Repository navigation
Seed the seek-landing PGS line from any decoded composition (#143) - #149
Merged
Merged
Conversation
…on (#143) A seek landing mid-cue (or on a display-set boundary, with the drain tick's playhead already a few frames past it) on a PGS stream without acquisition points never re-showed the landing line, forced cues included, until the next authored composition. Root cause: the #112 reconstruction pass seeded its active-line candidate only from a self-contained composition (Acquisition Point / Epoch Start). On AP-less/sparse-authored streams every lead-in composition is Normal, so no candidate was ever seeded and the landing-span line was silently discarded; the pass-ending successor published fine, which kept first-new-cue instruments blind to the loss. Seed the candidate from any successfully decoded composition behind the playhead instead. A composition that decoded at all is renderable: the drain decoder is rebuilt fresh at the backscan start, so a set with missing references fails decode and never reaches the gate, and the steady-state path outside reconstruction already publishes Normal compositions unconditionally. Companion fix: pgsTrimAt (broadcast by every composition and clear) now also closes the reconstruction candidate's open placeholder window. A clear carries no cues and never reaches admit, so a line the author cleared before the playhead used to keep its open window and resurrect as the active line at pass end (latent since #112 for AP content, proven by the new acquisition-point resurrection test). Co-Authored-By: Claude <[email protected]> Claude-Session: https://claude.ai/code/session_01NAPCg4tCDdSqkK6tPkNptw
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.
Fixes #143.
Problem
A seek landing mid-cue (or exactly on a display-set start boundary) on a PGS stream without acquisition points never re-shows the landing line, forced cues included, until the next authored composition arrives. On sparse dialogue the blackout runs tens of seconds. Successor cues re-emit normally, so only the line the viewer lands on is lost, which keeps "first new cue after seek" instruments blind to it.
Root cause
Exactly where the reporter pointed: the #112 reconstruction pass (
PGSStaleArrivalGate.admitDuringReconstruction) seeded its active-line candidate only from a self-contained composition (Acquisition Point / Epoch Start). On AP-less/sparse-authored streams every lead-in composition is Normal, so no candidate was ever seeded and the landing-span line was silently discarded. The exact-boundary variant collapses into the same shape because the drain tick's playhead has advanced a few frames past the boundary by decode time.Fix
Seed the candidate from any successfully decoded composition behind the playhead (the reporter's first suggested direction). A composition that decoded at all is renderable: the drain decoder is rebuilt fresh at the backscan start, so a set with missing palette/object references fails decode and never reaches the gate. The steady-state path outside reconstruction already publishes Normal compositions unconditionally, so the gate was strictly more conservative than the pipeline it feeds with nothing gained.
Companion fix uncovered while widening the seed:
pgsTrimAt(broadcast by every PGS composition and clear) now also closes the reconstruction candidate's open placeholder window. A clear event carries no cues and never reachesadmit, so a line the author cleared before the playhead kept its open window and resurrected as the "active" line at pass end. That hole predates this issue for acquisition-point content (proven by the new resurrection test, which fails on main) and would have widened with the new seeding.The #112 no-scroll invariant is untouched: lead-in compositions are still held, only the single newest line at/behind the playhead emits once the decode reaches the playhead.
isSelfContainedstays on the gate's signature; callers keep reporting the PCS classification, which the epoch-start-aware backscan direction (the reporter's second suggestion, for content whose landing sets are not standalone-decodable) would need.Tests
Issue143PGSLandingLineTests, 7 cases: AP-less mid-cue landing, boundary landing with advanced tick playhead, AP-less no-scroll invariant, cleared-line non-resurrection (Normal and acquisition-point variants), ahead-clear trimming the emitted line, candidate refinement from a Normal seed. 6 of 7 fail on main. Full suite: 744 tests green, strict-concurrency=complete clean, tvOS simulator build green.🤖 Generated with Claude Code
https://claude.ai/code/session_01NAPCg4tCDdSqkK6tPkNptw