Repository navigation
feat(swplayback): report the software path's read-ahead and display outcome (#303) - #304
Merged
Merged
Conversation
…utcome (#303) A software session left a field trace with no cushion figure in it. frameAhead is activeProducerShiftSeconds - playlistShiftSeconds, the #49 producer-shift fold on the native path, and reads 0 here by construction; it was read in #295 as evidence that the path holds no read-ahead, which it cannot support either way. bufferedSessionTime is fed from noteEdge, whose call sites are both gated on isLive, so a VOD software session published max(currentTime, 0) and mirrored its own playhead. The isReadyForMoreMediaData=false line is latched to one per session and marks the first fill, not a sustained one. SampleBufferRenderer records the newest timestamp it has admitted, at admission into the reorder buffer so it is past the #298 unschedulable gate and the post-seek skip, and clears it on flush so a backward seek cannot report the distance travelled as cushion. SoftwareBufferFrontier holds the arithmetic between that frontier and the clock as plain functions, since the two inputs come from different objects and the composition is the part worth pinning. clock.bufferedPosition on a VOD software session now carries the cushion. The #54 contract holds (never trails the playhead) and the live frontier still wins where it is larger. The memprobe gains swAhead=, swDropped= and swDelay=, the latter two from AVSampleBufferVideoRenderer's own metrics, which count frames dropped for missing their display deadline: the class our own counters cannot see. Absent rather than zero on a native session. Measurement only. No floor and no target depth: whether this path holds too little is unproven, and with #295 fixed it is unknown whether anything is left. Verified with aetherctl play --sw over a 70 s fixture: swFrames=753 swAhead=0.26s swDropped=187/749 swDelay=0.00s and the same run without --sw leaves the line as it was. The drop count there is an artefact of a headless layer in no view hierarchy, not a statement about on-device cushion. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01HX5zV3Fcf7Nzq4DYGdXvQE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #303.
Why
A software session left a field trace with no cushion figure in it, which is what made #295 hard to place: a ~100 ms blocked read reached the picture and no number said whether the buffer had 40 ms or 2 s.
Three signals look like they answer it and do not:
frameAheadisactiveProducerShiftSeconds - playlistShiftSeconds, the Clock/frame divergence accumulates under sustained seek rate (#35-class, #38 retest follow-up) #49 producer-shift fold on the native path, hardcoded to 0 on software and audio. It was read in Software-path SD MPEG-2 (PAL 25i): intermittent brief picture glitches with no engine-log signature — first seen on 6.5.3, unchanged on 6.5.6 #295 as evidence of no read-ahead. It cannot carry that claim in either direction.bufferedSessionTimeis fed fromnoteEdge, whose two call sites are both gated onisLive. On VOD it returns 0, sobufferedPositionfell back tomax(currentTime, 0)and published the playhead back as its own frontier.[Renderer] isReadyForMoreMediaData=false at enqueue #Nis latched to one line per session. It marks the first fill, which is healthy, not a sustained one.What
SampleBufferRendererrecords the newest timestamp it has admitted, at admission into the reorder buffer so it sits past the #298 unschedulable gate and the post-seek skip, and clears it onflushso a backward seek cannot report the distance travelled as cushion. The frontier is the newest timestamp HELD, not the newest handed over, or a B-frame run would make the number breathe with the coding pattern.SoftwareBufferFrontierholds the arithmetic as plain functions. The two inputs come from different objects (the renderer knows what it queued, the host knows where the synchronizer is) and the composition is the part worth pinning down.clock.bufferedPositionon a VOD software session now carries the cushion. The #54 contract holds and the live frontier still wins where it is larger. This is a behaviour change on a public surface, in the direction of that surface's documented meaning.The memprobe gains
swAhead=,swDropped=andswDelay=. The latter two come fromAVSampleBufferVideoRenderer.videoPerformanceMetrics, which counts frames dropped for missing their display deadline: exactly the class our own counters cannot see. Absent rather than zero on a native session.Scope
Measurement only. No floor, no target depth, no change to the demux loop
's back-pressure. Whether this path holds too little is unproven, and with the #295 mechanism removed it is unknown whether anything is left. Measure first, decide after.Verification
aetherctl play --swover a 70 s fixture:and the same run without
--swleaves the line as it was. Worth stating plainly: that drop count is an artefact of a headless layer in no view hierarchy (the #298 warning fires in the same run), not a statement about on-device cushion.12 new tests, full suite green (1504 tests, 223 suites, plus the XCTest targets). The tests cover the frontier, the gate interaction, the cushion arithmetic and the log fragment. What they do not cover, and I am not claiming otherwise:
AVVideoPerformanceMetricsneeds a real renderer, so only the aetherctl run exercises it.