Skip to content

fix(subtitles): the pump's harvest anchor is stated on the source axis (#107, #416) - #575

Merged
superuser404notfound merged 1 commit into
mainfrom
fix/subtitle-harvest-anchor-source-axis
Sep 20, 2026
Merged

superuser404notfound merged 1 commit into
mainfrom
fix/subtitle-harvest-anchor-source-axis

Conversation

@superuser404notfound

Copy link
Copy Markdown
Owner

Found while reviewing #573, which fixes the same axis confusion inside SoftwarePlaybackHost. This is the one place outside it that the same target reaches.

What happens

A software VOD seek states the pump's coverage anchor at the session-axis target:

softwareSubtitlePacketStore?.noteHarvestAnchor(.pump, at: clockTarget)

but subtitleDrainTick reports that same reader's progress from sourceTime, the raw source clock. For a zero-based source the two axes coincide, so nothing was ever wrong. For a mid-stream-joined one (#107) the anchor sits the whole offset below every note that follows it, and noteReach has no unannounced-advance guard, only noteProgress does. The first note therefore stretches one run across the entire offset.

SubtitleHarvestCoverage.covers then answers yes to any span, and subtitleLandingGroundIsRead admits exactly the stale PGS arrival #416 exists to refuse. The doc comment on noteProgress names this as the one failure mode the type must not have.

The change

SoftwarePlaybackHost.sourceSeconds(forSession:) exposes the conversion seek(to:) already makes for everything inside the host, and the call site uses it, so the anchor and the notes name the same axis. The identity for a zero-based source.

Test plan

  • swift test: 3163 swift-testing tests and the XCTest half green, exit 0.
  • Two cases added to Issue416LandingGroundTests: a session-axis anchor followed by a source-axis reach note covers the whole offset (the defect), and the carried anchor claims only what was read.

Not device-verified: the effect is a claim in the ledger rather than something visible, and it needs a mid-stream-joined source with PGS.

🤖 Generated with Claude Code

https://claude.ai/code/session_015PM3xUJB6ZQyqnmGK1fp6F

#107, #416)

A software VOD seek opened the pump's coverage run at the session-axis target
while `subtitleDrainTick` reports that reader's progress from `sourceTime`.
On a zero-based source the two coincide, so nothing was ever wrong. On a
mid-stream-joined one the anchor sits the whole offset below every note that
follows it, and `noteReach` has no unannounced-advance guard (only
`noteProgress` does), so the first note stretches one run across ground nobody
read. `SubtitleHarvestCoverage.covers` then answers yes to anything, and
`subtitleLandingGroundIsRead` admits exactly the stale PGS arrival #416 exists
to refuse.

`SoftwarePlaybackHost.sourceSeconds(forSession:)` exposes the conversion
`seek(to:)` already makes for everything inside the host, so the anchor and
the notes name the same axis.

Found while reviewing #573, which fixes the same axis confusion inside the
host. swift test: 3163 swift-testing tests and the XCTest half green, exit 0.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_015PM3xUJB6ZQyqnmGK1fp6F
@superuser404notfound
superuser404notfound merged commit d8f2f34 into main Sep 20, 2026
7 checks passed
@superuser404notfound
superuser404notfound deleted the fix/subtitle-harvest-anchor-source-axis branch September 20, 2026 15:25
ijuniorfu pushed a commit to ijuniorfu/AetherEngine that referenced this pull request Sep 21, 2026
… axis (superuser404notfound#107, superuser404notfound#416)

`clock.sourceTime` rides the raw synchronizer clock on this path, so that the
overlay drainer's playhead and the packet store's timestamps agree; the
`$sourceClockSeconds` sink says so. The software live branch then wrote the
session-relative target over it, and stated the pump's harvest anchor there
too, which is the same confusion superuser404notfound#575 fixed for VOD.

It does not wedge: the live branch never sets `seekInFlight`, so the host's
own tick puts the raw clock back within 250 ms. Inside that window one drain
tick reads the whole offset as an unannounced reposition, resets its cursor
and scans a stretch the store has nothing at, and the tick after it sees the
same offset in the other direction. Two resets and a dark tick for a seek that
moved the playhead a few seconds, on any source whose PTS do not start at zero.

`SoftwarePlaybackHost.sourceSeconds(forSession:)` now covers both session
shapes (live anchors on `sessionStartPts`, VOD on the resolved
`clockSessionZero`), and `liveScrubStill` and `seekLiveDVR` go through it
instead of each holding their own copy of the addition. Behaviour there is
unchanged; the mapping now exists once.

The call site itself is not reachable from a unit test, so the guard is on the
consequence: `SubtitleOverlayDrainerTests` pins that an axis change reads as a
reposition twice and backscans below everything the store holds, while the
carried value is the one reposition it really is.

swift test: 3164 swift-testing tests and the XCTest half green, exit 0.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_015PM3xUJB6ZQyqnmGK1fp6F
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant