Skip to content

feat(subtitles): generation-fenced subtitle-resolution statement (#250) - #251

Merged
superuser404notfound merged 2 commits into
mainfrom
feat/issue250-subtitle-resolution-log
Jul 29, 2026
Merged

superuser404notfound merged 2 commits into
mainfrom
feat/issue250-subtitle-resolution-log

Conversation

@superuser404notfound

Copy link
Copy Markdown
Owner

Closes nothing yet: #250 stays open until cmcpherson274's harness has read the line.

What

One EngineLog line per active subtitle drain target, stating the absolute source-time span the subtitle path has decoded display state over, fenced by the engine's own generation counters:

[AetherEngine] #250 subtitle-resolution loadGen=3 seekGen=7 stream=4 coveredFrom=1189.00 resolvedThrough=1218.00 via=prefetch decodedThrough=1204.00 reason=reconstruction

The question it answers is the one no existing surface can: after a far seek lands, has the pipeline DETERMINED the display state at the rendered position, or has it merely produced nothing yet? On a PGS track with no acquisition point those two are indistinguishable from outside. The memprobe prefetch fragment is playhead-relative and ungated by generation, the #151 session lines state the harvest frontier rather than how far determination has advanced, and the drain tick logs nothing at all.

Why resolvedThrough is neither obvious candidate

  • Not the drain window's lead edge (playhead + 60 s): that claims determination over bytes nobody read. An empty window is ambiguous between "no cue here" and "not harvested yet", which is exactly the ambiguity the line exists to remove.
  • Not the drain cursor: that is the last actual cue, and on a sparse or forced track it stands still for minutes, so every dialogue pause would read as unresolved.

So it is the decode window clamped to a harvest frontier, with the frontier's source travelling alongside:

via bound worth
prefetch the #151 reader's banked read position exact; since #230 that is the read position on the source axis, so everything below it not in the store carries no subtitle packet
eof the window in full strongest state: an empty position means "no cue here", not "not yet"
pump the drain cursor a lower bound, not a contiguity claim. The producer tap has no read-position surface. A via=pump line is itself the answer "not determined"

Why the fence is load-bearing, not decorative

Since #240 the prefetch session SURVIVES a seek: the anchor box moves its cursor in place instead of rebuilding it, so a position banked before the seek is still sitting in the gauge afterwards. A fence captured at session start would therefore go stale on the first in-place move, and go stale in exactly the superseded-seek case it exists to resolve.

So the re-anchor request carries the seek generation that asked for it, and the loop stamps it AFTER the reposition. The gap between request and seek reads as unresolved rather than validating a position the seek has not reached yet. A frontier fenced to a superseded load or seek is not usable at all.

Emission points

Four, chosen so the line marks transitions rather than ticks (the drainer runs at 2 Hz per channel):

Scope

No published property, no new public type, no behaviour change. seekGeneration stays private with a read-only accessor: only seek(to:) may move it.

Verification

  • swift test: 1287 tests, 198 suites, green
  • swift build -Xswiftc -strict-concurrency=complete: clean
  • xcodebuild -scheme AetherEngine -destination 'generic/platform=tvOS Simulator': clean
  • 15 new tests in Issue250SubtitleResolutionTests, one per way the statement could lie (a diagnostic that over-claims is worse than none, since the harness would adjudicate on it)

Second commit removes the prefetcher's dead readPosition local, which the tvOS build had been warning about and whose comment claimed a role it lost when the arbiter changed signature.

🤖 Generated with Claude Code

https://claude.ai/code/session_01At1agC2qU2Y2MX2BKLdT4N

Vincent Herbst and others added 2 commits July 29, 2026 17:23
An external conformance harness adjudicating seek-time subtitle correctness
has to decide, from observable surfaces alone, whether the pipeline has
DETERMINED the display state at the rendered position or has merely produced
nothing yet. On a PGS track with no acquisition point those two are
indistinguishable from outside, and no existing surface answers it: the
memprobe prefetch fragment is playhead-relative and carries no generation, the
#151 session lines state the harvest frontier rather than how far
determination has advanced, and the drain tick logs nothing at all.

Emits one line per active drain target:

  [AetherEngine] #250 subtitle-resolution loadGen= seekGen= stream=
    coveredFrom= resolvedThrough= via= decodedThrough= reason=

Neither obvious candidate for resolvedThrough can be used. The drain window's
lead edge (playhead + 60 s) claims determination over bytes nobody read, which
is the ambiguity the line exists to remove; the drain cursor is the last actual
cue, which on a sparse track stands still for minutes, so every dialogue pause
would read as unresolved. So it is the decode window clamped to a harvest
frontier, and the frontier's source travels with it: via=prefetch is exact
(since #230 the side reader's banked position is the read position on the
source axis), via=eof is the strongest state (the window is determined in
full), via=pump is the weak one and says so (the producer tap has no
read-position surface, so the claim collapses to the drain cursor).

The fence is load-bearing rather than decorative. Since #240 the prefetch
session SURVIVES a seek: the anchor box moves its cursor in place instead of
rebuilding, so a position banked before the seek is still sitting in the gauge
afterwards. The re-anchor request therefore carries the seek generation that
asked for it, and the loop stamps it AFTER the reposition, so the gap between
request and seek reads as unresolved instead of validating a pre-seek position.
A frontier fenced to a superseded load or seek is not usable at all.

Four emission points, chosen so the line marks transitions rather than ticks:
post-seek reconstruction, the 30 s memprobe cadence, prefetcher EOF, and any
change of frontier source (the #231 mid-session death is the case that
otherwise passes silently). No published property, no behaviour change.

Reported by cmcpherson274.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01At1agC2qU2Y2MX2BKLdT4N
`readPosition` was written in three places and read in none, and its comment
claimed it fed the link arbitration's lead, which it has not since the arbiter
took `yieldedSeconds` instead. The live position is banked in
SubtitlePrefetchTelemetry, which is where #250 reads it from. The tvOS build
has been warning about it.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01At1agC2qU2Y2MX2BKLdT4N
@superuser404notfound
superuser404notfound merged commit 340a169 into main Jul 29, 2026
3 checks passed
@superuser404notfound
superuser404notfound deleted the feat/issue250-subtitle-resolution-log branch July 29, 2026 15:32
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