Repository navigation
fix(live): fastZap seals headroom over the GOPs it cuts - #676
Merged
Merged
Conversation
Reported in AE#670. Under .fastZap the cut target (0.5 s) sits below any real GOP, so every segment the engine cuts is one whole source GOP, and TARGETDURATION was sealed from the first few with no headroom over them. A broadcast whose GOPs run 1.0 to 2.4 s sealed TD 1 on three 1.000 s ones, then broke EXTINF <= TD on every longer GOP and held the playlist unchanged past AVPlayer's 1.5 x TD patience: -12888, #446 reading the source as dead, #524 on 1.5 s of runway, and on macOS the playlist refused as a parse error (-12642) with a fall to the software path. Self-cut fastZap segments now seal ceil(1.5 x max EXTINF), the headroom .standard always had from its 1.5 x cut-target floor. Ingested segments (bounded by the upstream's own TD, AE#447) and .standard are unchanged. Measured with aetherctl live --fast-zap --realtime --preroll 0 on a seed with that GOP pattern, two passes per arm: main sealed 1 s, one stall, -12642 and a software fallback on both; this branch sealed 2 s, none of the three on either. Regular 1 s GOPs: join 1.38 s against 1.14 / 1.23 s. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WJcXkGQrMiBPixVEFTSBJS
superuser404notfound
force-pushed
the
fix/ae670-fastzap-td-headroom
branch
from
September 30, 2026 16:59
83547d0 to
623765a
Compare
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.
Refs #670.
Root cause
Under
.fastZapthe cut target (0.5 s) is below any real GOP, so every segment the engine cuts is one whole source GOP. TARGETDURATION is sealed from the first window and never moves (RFC 8216, AE#209). On the reported source that window held three 1.000 s GOPs: sealed at 1, holdback 3 s, zero headroom. The source's GOPs are irregular (1.0 to 2.4 s), so every longer one:EXTINF <= TD(2.4 rounds to 2 > 1),1.5 x TDpatience while the cutter waits for the next keyframe (-12888),.standardnever had this because itsceil(1.5 x cut target)floor is exactly that headroom. Under fastZap it collapses toceil(0.75) = 1.Fix
Where the engine cuts the segments itself and the cut target is sub-second, the seal also takes
ceil(1.5 x max EXTINF). 1 s GOPs now serve TARGETDURATION 2 / HOLD-BACK 6, the value the fastZap reporter already verified on real origins in #195. Not applied to:.standard: the same rule would lift the common 5.76 s segment shape from TD 6 to 9.The seal line names the new term:
1.5 x max EXTINF 1.500s (each segment is one whole GOP).Measured
aetherctl live --fast-zap --realtime --preroll 0 --seconds 90, two passes per arm. The seed is a 50 fps H.264 + AAC TS with GOPs 1.0 x 8, then 1.0 / 1.12 / 2.4 / 2.0 mixed.macOS AVPlayer refuses the non-conforming playlist outright. The reporter's tvOS one degrades to -12888 and freezes instead.
What is left over. #524 still fires 3 to 4 times per run on the irregular seed at 1.6 to 2.0 s of runway, with no stall. That comes from the bounded start serving a 3 s window under the 6 s holdback (#594), not from the seal.
Cost. A fastZap channel with 1 s GOPs plays 6 s behind the live edge instead of 3 s. The join itself grows by about 0.2 s, because the bounded start serves after two segments either way.
Tests
Issue670FastZapGOPHeadroomTests: reported seal, later 2.4 s GOP inside it, scaling, ingest unchanged,.standardunchanged, seal account.Issue195FastLiveJoinTestsandLiveWindowObservedCadenceTestsmoved to the new self-cut values. The invariants they pin (TD tracks GOP, hold = 3 x sealed TD) are unchanged.Issue445VMRegionCensusTestsfailed once under parallel load and then passed 3 / 3 in isolation (unrelated, process memory census).🤖 Generated with Claude Code
https://claude.ai/code/session_01WJcXkGQrMiBPixVEFTSBJS