Repository navigation
Description
What should the engine do?
Emit one diagnostic statement — an EngineLog info line is entirely sufficient — whenever the subtitle path settles a determination, stating the absolute source-time span it has decoded display state over, fenced by the engine's own generation counters:
[SubtitleResolution] loadGen= seekGen= stream= coveredFrom= resolvedThrough= reason=<reconstruction|tick|eof>
Natural emission points: a drain tick that completes a post-seek reconstruction window, steady-state cadence (the existing 30 s memprobe tick would be fine), and prefetcher EOF (or a nextEventPts= variant).
Motivating media or use case
An external conformance harness (same rig and 48 GB / 49-PGS-track asset as #240) that adjudicates seek-time subtitle correctness: after a far seek lands, it must decide from observable surfaces whether the pipeline has determined the display state at the rendered position, or merely hasn't produced anything yet. On a PGS stream with no acquisition points those two are indistinguishable from outside, and that distinction is the whole adjudication.
What I can already see, and why it falls short of that call (read at 5.28.0 38ad1b7; nothing in the 5.28.2–6.0.0 notes changes it):
the memprobe prefetch=… prefetchLead=… prefetchHarvested=… fragment is playhead-relative and carries no generation — a line from just before a seek is indistinguishable from one just after it landed;
the #151 forward prefetch started/re-anchored/exited lines are session-bracketed and explicit about EOF, but ungated by generation, and they state the harvest frontier (compressed packets read), not how far display-state determination has advanced;
the overlay drainer's decode window (playhead −15 s/+60 s) and cursor are computed inside a drain tick that currently logs nothing;
loadGeneration/seekGeneration are (reasonably) private, so none of the above can be fenced to "the seek I just issued" without counting lines — which breaks under superseded seeks.
My harness already taps EngineLog.handler and archives it, so a line with those six values is a complete answer — and it would also make the #240-style subtitle-health questions ("did cues arrive late after the seek burst?") answerable from the log alone rather than inferred from relative fragments. The counters' values only need to be stable and monotonic, not meaningful to the host. No published property, no new type, no behaviour change; nothing load-bearing for playback.
Area
Other
Host app / integration context
(tvOS Jellyfin client) — external QA/conformance harness, same integration as #240. tvOS 26.5, Apple TV 4K 3rd gen, wired.
Would you be willing to open a PR?
Maybe, with guidance
Activity
Merge pull request #251 from superuser404notfound/feat/issue250-subti…
superuser404notfound commentedon Jul 29, 2026
Built and released in 6.0.2 (
a216ca2), with two changes to the shape you proposed. Both come from the same place: a diagnostic that over-claims is worse than no diagnostic, because the harness would adjudicate on it.The line
Grep token is
#250 subtitle-resolution, EngineLog category.engine, one line per active drain target so a dual-channel session emits two.Change 1:
resolvedThroughneeds a frontier, and the frontier needs a nameNeither obvious candidate can carry the claim.
The drain window's own lead edge is
playhead + 60 s(subtitleDrainLeadSeconds) whether or not anyone has read that far, so reporting it would assert determination over bytes nobody fetched. That is precisely the ambiguity you are trying to remove, restated as a number.The drain cursor is the other candidate and fails the opposite way: it is the last actual cue, so on a sparse or forced track it stands still for minutes and every dialogue pause would read as unresolved.
So
resolvedThroughis the decode window clamped to a harvest frontier, andvianames which frontier bounds it, because the three are worth different things:viaprefetcheofpumpvia=pumpline is itself the answer "not determined beyond what is already on screen"For your rig
via=prefetchis the steady state andvia=pumpis the finding.decodedThrough(the drain cursor) is reported alongside rather than instead, so a sparse stretch stays distinguishable from a starved one: on a healthy sparse trackresolvedThroughruns well ahead of it.Change 2: the fence had to survive #240
The generation-fencing idea is right, but a fence captured when the prefetch session starts would have been stale for you in exactly the case you built it for. Since #240 the session survives a seek: the anchor box moves the reader's cursor in place instead of tearing the session down and rebuilding it, so a read position banked before the seek is still sitting in the gauge afterwards, under the old session's numbers.
So the re-anchor request carries the seek generation that asked for it, and the stamp lands after the reposition, not at request time. The window between the request and the seek that serves it reads as unresolved rather than validating a position the reader has not reached yet. A frontier fenced to a superseded load or seek is not usable at all, which is the fence doing real work rather than decorating the line.
Emission points
Yours, plus one:
reason=reconstructionreason=tickreason=eofreason=frontierThe last one is the #231 case. A prefetcher that dies mid-session collapses determination to the pump's few seconds of lookahead, and nothing else in the log says so at the moment it happens; waiting up to 30 s for the next cadence line would hide it behind whatever the harness was measuring.
Not per drain tick: the drainer runs at 2 Hz per channel, and a span restated four times a second buries the transitions that carry the information. If your harness would rather have the raw cadence, say so and it can become an opt-in.
Scope
No published property, no new public type, no behaviour change, as you asked.
loadGenerationandseekGenerationstay engine-internal;seekGenerationgained a read-only accessor only, since onlyseek(to:)may move it.Thank you for the writeup. Stating up front which surfaces you had already read and why each fell short is what made this a half-day change instead of a design round, and the #240 interaction above is a trap a naive implementation would have walked straight into.
Leaving this open for your harness to read the line and confirm the field set is sufficient.
cmcpherson274 commentedon Jul 29, 2026
Read back from a real run — 6.0.2, one of the PGS windows from the 48 GB title muxed as a standalone fixture, a single far seek into a composition that was established ~1.6 s before the target (the acquisition-point-free spanning case this whole request exists for). Four lines, and they narrate the session exactly:
#250 subtitle-resolution loadGen=1 seekGen=0 stream=1 coveredFrom=-15.00 resolvedThrough=39.29 via=pump decodedThrough=39.29 reason=reconstruction
#250 subtitle-resolution loadGen=1 seekGen=0 stream=1 coveredFrom=-15.00 resolvedThrough=60.12 via=prefetch decodedThrough=59.89 reason=frontier
#250 subtitle-resolution loadGen=1 seekGen=1 stream=1 coveredFrom=30.70 resolvedThrough=68.03 via=pump decodedThrough=68.03 reason=reconstruction
#250 subtitle-resolution loadGen=1 seekGen=1 stream=1 coveredFrom=30.70 resolvedThrough=105.95 via=eof decodedThrough=68.03 reason=eof
The field set is sufficient, and both of your shape changes carry weight in practice:
The seek's line is fenced (seekGen=1) and coveredFrom=30.70 is the target minus the backscan — exactly the "coverage begins at or before the checkpoint that establishes the state" claim the harness adjudicates. A fence captured at session start would indeed have been stale here; the post-reposition stamp is what makes the line usable.
via does the honest work: my adjudicator treats via=prefetch and via=eof as carrying the determination claim and via=pump as its own answer ("not determined beyond what is already decoded") — which is precisely the distinction the ruling I work under forbids papering over. The final line's resolvedThrough=105.95 against decodedThrough=68.03 is the sparse-track case stated cleanly.
reason=frontier firing at the handoff (line 2) rather than waiting for a cadence tick is the emission point I didn't know to ask for. The per-tick raw cadence you offered as opt-in: not needed — the transitions carry everything my harness consumes.
Sufficient as shipped; nothing further requested. My conformance harness will adopt a 6.0.2+ candidate under its usual pre-registration and this line becomes the subtitle-liveness witness it was missing. Thanks for the turnaround — same-day twice in one day is not a cadence I expected to write down.
superuser404notfound commentedon Jul 30, 2026
Those four lines read exactly as intended, including the two spots where the sequence is easy to over-read. Three notes so your adjudicator does not have to infer them, then closing.
coveredFrom=-15.00on the first line is deliberate, not a floor bug. It isplayhead - subtitleDrainBackscanSecondswith no clamp, because the source axis does not have to start at 0: on a container with a non-zerostart_timea clamp to 0 would claim coverage over a span that is genuinely below the first PTS, which is the same class of over-claim the whole line exists to avoid. Below the stream's own origin there is nothing to be wrong about, so the value stays raw. TreatcoveredFromas an upper bound on where the contiguous decoded run begins, never as a position that must exist.via=pumpon line 3, and novia=prefetchbetween it and line 4, is structure rather than a re-anchor that failed. The post-seekreason=reconstructionline is emitted inside the drain tick's per-channel loop, and the re-anchor request is issued once after that loop, so a reconstruction line following a jump isvia=pumpby construction: at the moment it is written the reader has not yet been asked to move, let alone stamped a position under the new fence. The next emission point is then whichever comes first, a frontier-change tick 500 ms later or the prefetcher's EOF, and on a standalone ~106 s fixture the re-anchor plus read-to-EOF fit inside that interval, so nothing ever observedvia=prefetchunderseekGen=1. Line 4 carryingvia=eofat all is the proof the re-anchor landed: an end-of-file stamped underseekGen=0fails the fence and would have readvia=pumpagain. On the 48 GB title expectvia=prefetchas the post-seek steady state, withvia=eofonly near the end of the track.6.1.0 is worth pinning over 6.0.2 for your harness specifically. It adds a
seekEventspublisher (.began/.landed(renderedTime:)/.stalled/.superseded/.rejected), which answers the other half of a post-seek adjudication from outside: which seek the observation belongs to, and whether it landed, is still recovering, or was taken over. That was #38, from a synchronized-playback host with the same "a level's falling edge cannot tell a landing from a give-up" problem your PGS case has on the subtitle axis. Purely additive;isSeeking/seekTargetkeep their meaning. One correlation caveat:SeekEvent.idis notseekGeneration. Both are monotonic per engine instance, but the event id also counts rejected seeks, so line up the n-th accepted seek with the n-th generation rather than comparing the numbers.Closing as shipped in 6.0.2. Thanks for running the fixture back and for reporting per-line what your adjudicator does with each field; that is what made the
viasplit and the post-reposition stamp verifiable rather than plausible.feat(subtitles): generation-fenced subtitle-resolution statement (sup…
chore(subtitles): drop the prefetcher's dead read-position local
feat(subtitles): state the retained contiguous determination span (su…
diag(subtitles): state the post-seek coverage crossing when it happens (
diag(subtitles): state what each drain tick delivered, budget the cue…
fix(subtitles): the background teardown hands its selection to the re…
feat(subtitles): the pump reads ahead for subtitles the index cannot …