Repository navigation
Description
Filed on behalf of @cmcpherson274, who raised this in the #240 thread (comments 5184806626 and 5186321555) after a 15 repetition acceptance battery on 6.3.0, wired Apple TV 4K, PGS on a 48 GB source. Splitting it out because #240 is a starvation bug on a constrained link and this is an enhancement to the #250 statement that stands on its own.
The observation
Their instrumented rendered subtitle state matched the frozen extracted truth 1.33 to 1.39 s after the seek command in all five repetitions targeting 640 s. Their gate, however, could only admit a generation fenced coverage statement at 29.24 to 29.30 s, clustered that tightly across three different seek targets. Their link sustained ~931 Mbps immediately before the battery, so transfer does not explain the gap.
Why the gap exists
It is emission cadence, not determination latency. After a far seek the statement is printed at these points only:
- The reconstruction tick, which is
via=pumpby construction (the reanchor request runs after the drain loop, so the side reader has not even been asked to move yet).resolvedThroughthere is the drain cursor, a lower bound. Their gate is right to refuse it as coverage. - The first tick where the frontier SOURCE changes, pump to prefetch. In their runs that line landed at
resolvedThrough639.30 to 639.89, still short of the rendered 640.00. - Nothing after that, because
vianever changes again. The prefetch frontier climbs past the playhead within about a second, and no line says so. - The next
reason=tick, which rides the 30 s memory probe. That is their 29.25 s, and it is why the number clusters independently of the seek target.
The ask
Emit a generation fenced statement, equal in strength to the current prefetch and eof forms, as soon as coverage is established through the rendered post seek source time. Explicitly not asked for: treating the pump cursor as coverage, or per tick raw cadence (they declined that in #250, "the transitions carry everything").
Planned shape
A fifth emission point, reason=coverage, edge triggered and latched per channel:
- fires on the first drain tick where
via != pumpandresolvedThrough >= playhead - the latch re arms on every
.resetAndDecode, so at most one line per seek per channel - no new claim semantics: it prints the statement the drain tick already builds every decoding tick since subtitle-resolution: expose the retained contiguous determination span (or a first-successor proof) under the active seek generation #276, so the strength of the number is unchanged
- its absence stays informative. On a link that cannot carry two readers (the Seek starvation by superseded readers + cold far-seek latency #240 case) the frontier never catches the playhead, and then the line correctly does not appear.
Parser note for the harness: coverage is a new value of the reason field. Field set and field order are unchanged.
Activity
Merge pull request #319 from superuser404notfound/feat/issue-318-cove…
superuser404notfound commentedon Aug 7, 2026
Reopening until @cmcpherson274 has retested. The PR's
Closeskeyword shut it on merge; the line is shipped in 6.8.0 but the check that matters is whether their gate now admits the crossing where their instrumentation already sees the rendered state, and that is theirs to run.diag(subtitles): state the post-seek coverage crossing when it happens (
cmcpherson274 commentedon Aug 9, 2026
Retested on 6.15.2, as invited — per-repetition figures below.
Setup (same bench and method as the measurements behind #240/#318): Apple TV 4K
(3rd gen, tvOS 26.6), wired gigabit, Jellyfin 10.11.11, a 48 GB mkv with PGS subtitles
(the same fixture as before), engine pinned to 6.15.2
(
c47db496b86e716f323417d4bb6996d04d112f2c). 15 fresh app sessions, one far seek persession — 5 repetitions each to targets 302 s, 600 s, and 640 s. The stopwatch is
command-to-correct-rendered-subtitle-state, measured against a pre-extracted
ground-truth table of expected subtitle state per target (device-emitted stamps
recomputed independently on the pulled logs; the two agreed in both directions on all
15 repetitions).
The headline: the cadence ceiling is gone. At 6.3.0, 7 of 15 repetitions on this
same protocol landed in a ~29.25 s cluster — the next-cadence-tick wait this issue
describes. At 6.15.2, zero of 15 did (worst repetition 3.18 s). The
reason=coverageemission fired on the first tick whose stated span contained the playhead in every
repetition, exactly once per crossing (the dedup latch behaved as described in the
#240 reply).
Per-repetition figures (seconds, command → correct rendered state):
The residual shape, for completeness: with the cadence wait removed, nine of the ten
302/640 repetitions sit at ~2.5–3.2 s (640-r3 was 1.99 s), while 600 sits at ~1.5 s.
Our earlier decomposition found that rendered-state latency dominates this residual
mode, with attribution still mixed at the threshold. We are not claiming an engine
defect in that residual and are continuing to investigate the application-side
rendered-state component. Happy to share the methodology or raw per-repetition logs if
useful.
superuser404notfound commentedon Aug 9, 2026
Retest logged, and it answers the question the reopen was held for: 7 of 15 repetitions sat in the ~29.25 s cadence cluster at 6.3.0, none do at 6.15.2, and the
reason=coverageline fired once per crossing on the first tick whose stated span contained the playhead. That is the entire claim of the fix, so this closes. Thanks for running the full battery again instead of a spot check, and for the per-repetition table rather than medians; the tightness of the 600 s column is what makes the residual discussion below possible at all.Two things verified here before closing:
c47db496b86e716f323417d4bb6996d04d112f2cis exactly the6.15.2tag, so those figures are against the intended build.AetherEngine+Subtitles.swift,AetherEngine+SubtitleResolution.swiftorSubtitleResolutionStatement.swift. The retest therefore still describes the current release, no re-run on 6.18.x needed.On the residual, taking "not claiming an engine defect" at face value, here are the two cuts that would settle attribution without another battery.
1. The
reason=coverageline is the attribution boundary. It is emitted at the first drain tick wherevia != pump,resolvedThrough >= playheadandcoveredFrom <= playhead, which is the earliest moment the engine can defensibly say the rendered position is determined (the third condition is the subtle one: a decoded run that ends above the playhead can also start above it, and then the position is not determined at all). So command to coverage-line stamp is the engine half, coverage-line to correct-rendered-state is the half on the application side. If the coverage stamp is flat across the three targets while only the second half varies, the per-target split is not in the engine, and the split shape (600 s tight at ~1.5 s, 302/640 s at ~2.5 to 3.2 s) is exactly where that would show.2. Split the residual by seek cost class before comparing targets. Far-seek landings on the native path fall into distinct cost classes (target already buffered, producer cache hit, producer restart) that are an order of magnitude apart, so comparing targets that landed in different classes measures which class each target happened to hit, not the engine. Each seek names its class in the log:
declareTarget backward jump N -> M, proactively restarting producer, thensegN: served <bytes> B (wait=...ms cache=... restarted=<bool>). A restart-class landing on a high-bitrate source is bounded below by roughly two segment fetches at link rate, which is the region the 302/640 figures sit in; a cache hit is not. Worth checking whether 600 s is simply not in the same class as the other two.One question may be cheaper than either: does the ground-truth table at 600 s expect a cue on screen, or an empty state? A target that expects an empty state is satisfied by a clear, a target that expects a cue needs a decoded PGS bitmap presented, and those are not the same measurement. If 600 s is the empty one, the split lives in the protocol rather than in either code base.
The offer of raw per-repetition logs is taken up. With the timestamped
#250lines from the 15 runs the engine half above can be decomposed here rather than guessed at, and if that decomposition turns up something the engine owns it gets its own issue.cmcpherson274 commentedon Aug 10, 2026
Taking up the raw-logs offer: the timestamped
#250lines for all 15 repetitions arebelow, one collapsed block per repetition, together with each landing's segment-serve and
producer-restart lines since they answer the cost-class question directly. All stamps are
the same device clock; each block opens with the instant the far seek was commanded,
measured inside the seek adapter.
We also ran your cuts against the same archived repetitions. In order of cheapness:
1. The 600 s ground truth expects a cue on screen, not an empty state. All three
targets in this battery are cue-on-screen states, each established by a display set that
begins shortly before the nominal instant: 302 s ← a set at 300.384 s, 600 s ← 598.515 s,
640 s ← 638.305 s. (The frozen truth's only provably-empty window is 30 s, which is not
part of this battery.) So the split does not live in the protocol: all three targets
require a decoded PGS bitmap presented, none is satisfied by a clear.
2. Seek cost class: all 15 landings are the same class — producer restart. Every
repetition logs
out-of-range fetch … restarting producerfollowed by arestarted=truesegment serve; none was a cache-resident landing. Within that one class, the observed
transfer volumes per repetition were: bytes served before the rendered state first matched
truth — 63,797,781 on all five 600 s repetitions; 125,293,630 on all five 302 s
repetitions; 87,044,758 on four 640 s repetitions and 116,657,990 on the fifth (640 r3).
Total bytes served in the 30 s after the command were 63,797,781 / 125,293,630 /
116,657,990 for 600 / 302 / 640 on every repetition of each target. We note, as an
observation, that the per-target ordering of these volumes matches the per-target ordering
of the timing figures; we are not claiming a demonstrated mechanism from this data.
3. The statement boundary. One protocol fact first, so the numbers read correctly: our
stopwatch's subtitle-correct stamp is witness-validated — rendered-state equality is
admitted only once a qualifying engine statement exists (
via != pump, stated spancontaining the rendered post-seek source time), and the stamp is that statement's instant.
On 13 of 15 repetitions the admitted statement IS the literal
reason=coverageline. Onthe other two (302 s r2 and 640 s r3), an earlier frontier-change line was already
admissible against our bound (the rendered post-seek source times there were 302.2 and
640.1), so the gate stamps that earlier line; the literal
reason=coverageline stillfired later in both. The table therefore gives both cuts side by side — the
admitted-statement boundary (what our reported totals are built on) and the literal
reason=coverageboundary (the line your cut named):reason=coverageline (s)reason=coveragereason=frontierreason=coveragereason=coveragereason=coveragereason=coveragereason=coveragereason=coveragereason=coveragereason=coveragereason=coveragereason=coveragereason=frontierreason=coveragereason=coverageReading the table: at the admitted-statement boundary the "second half"
(statement → rendered) is zero by construction of our gate, and the rendered state was in
fact correct before the engine's first admissible statement on every repetition — the
command → rendered-equality column. Both that column and the rendered → statement column
vary by target, and the per-target pattern is present under either boundary choice. Stated
as observations only; the two boundary spellings may simply compare different playhead
references at those instants.
As before, we are not claiming an engine defect in any of this. Happy to provide anything
further from the same archive.
Raw per-repetition lines
302 s — repetition 1
302 s — repetition 2
302 s — repetition 3
302 s — repetition 4
302 s — repetition 5
600 s — repetition 1
600 s — repetition 2
600 s — repetition 3
600 s — repetition 4
600 s — repetition 5
640 s — repetition 1
640 s — repetition 2
640 s — repetition 3
640 s — repetition 4
640 s — repetition 5
superuser404notfound commentedon Aug 10, 2026
The raw logs settle the attribution, and they move it further than either of us expected: the residual is almost entirely engine and transport, not application. Thanks for archiving the per-repetition stamps rather than summaries, none of the below is reachable from the table alone.
1. The first half is the engine's reconstruction tick, to the millisecond
command → rendered state correctis not close to the post-seekreason=reconstructionline. It is that line, on all 15 repetitions:reason=reconstructionin the same log (s)(Reconstruction line = the first
seekGen=1statement whosecoveredFromis the real post-seek window floor, i.e. 287 / 585 / 625, not the transientcoveredFrom=-15.00line that the seek itself prints.)Max deviation 1.5 ms, spread 1.0 ms, and the stamp always trails the log line rather than leading it. So the component described as "application-side rendered-state" is the engine tick that publishes the reconstructed window, and the application adds under 1.5 ms on top of it.
2. Which means that stamp is a publication stamp, not a presentation stamp
That tightness is itself a finding. A stamp taken from something actually on screen cannot track a log line to 1 ms with 1 ms of spread across 15 runs, because presentation is quantised by the display: at least one frame interval, 41.7 ms at 24p. A sub-2 ms lag with that little spread says the observation is taken where the cue array changes, not where a frame is presented.
Nothing wrong with that as a measurement, but it means the battery has never measured publication → pixels, in either direction. Worth knowing before any further decomposition, because that unmeasured piece is the only genuinely application-side term in the whole residual.
3. The first half is transfer-bound, and the byte column is the mechanism, not a coincidence
Taking the interval from each landing's
restarting producerline to its reconstruction tick, against the bytes served inside that interval:The volumes differ by 2x, the rates agree within 6% of each other. A least-squares fit over all 15 gives elapsed = bytes / 510 Mbps - 76 ms, R² = 0.91. So the per-target split is a volume difference inside one cost class, exactly as suspected, and the byte column already measures it. It is also deterministic per target: identical to the byte across all five repetitions of each.
The 640 r3 outlier dissolves on the same cut. Its 116,657,990 figure includes seg161, which landed 71 ms before the reconstruction tick in that run and after it in the other four. Counted the way its siblings are counted, r3 is 87,044,758 B in 1.370 s = 508 Mbps, dead centre of the 640 column, and its first half (1.3730 s) was never different from the rest. r3 differs only in the second half, for the reason in section 5.
One observation with a deliberate non-conclusion: 510 to 580 Mbps against a link measured at ~931 Mbps idle. The serve lines cannot say whether that gap is the producer, the client's request pacing or concurrent decode, since the gaps between consecutive serve completions are consistently larger than the
wait=values inside them. Not claiming anything from it, only naming it as unresolved.What does remain open on the media side: why the landing at 302 s needs four segments and 600 s needs three. That is source geometry (segment size in that bitrate region, and how far the demuxer has to read to reach the target's interleave position), not a per-run variable, so it is an ffprobe question on the fixture rather than a timing question.
4. The second half is one or two drain ticks, and nothing else is in it
The drainer sleeps 500 ms between ticks (
subtitleDrainTickNanoseconds); the tick spacing in these logs is 0.53 to 0.68 s including the tick's own work. The reconstruction tick isvia=pumpby construction, and the reanchor that repositions the side reader is issued in that same tick, immediately after the statement. The reader then restarts at the window floor (playhead - 15, i.e. the 287.00 / 585.00 / 625.00 in thecoveredFromfields) and climbs from there, so the earliest possible coverage statement is the following tick, and only if the frontier has passed the playhead by then:So the ~0.5 s of per-target difference in the second half is one tick boundary of the same 500 ms cadence. It is quantisation, not a property of the targets.
5. The two odd repetitions are the playhead reference, as suspected in the closing line
The engine's crossing test compares against the live playhead at that tick, deliberately the same value the tick planned its window with. The gate compares against the frozen post-seek rendered source time. Both repetitions fall out of that difference, and the logs bound it:
reason=frontier, so the engine's coverage test failed, so the live playhead was already above 302.43. Playback had therefore advanced at least 0.23 s of source time in the 0.532 s since the reconstruction tick.frontier, so the playhead was above 640.31: at least 0.21 s of advance in 0.619 s.The 600 s repetitions bound it from the other side (600 r2 needs the playhead at or below 600.60 after 0.661 s), which is consistent: playback is resuming through that window, so the advance is real but sub-realtime.
So the two spellings are not in conflict. They answer different questions: "was the landing position determined" against "is what is on screen now determined". The line answers the second, because after a landing the position being asked about is already moving, and a claim fenced to a position the playhead has left is the kind of stale claim the whole statement exists to avoid.
Verdict, and the one thing that changed since the battery
Nothing in the residual reads as an engine defect, and I looked specifically for a tick to shave. There is not one: the reanchor is already issued in the same tick as the reconstruction statement, so the side reader is not idling, and the missing half second is the reader reading the 15 s backscan region and banking a fenced position.
One thing has moved since this was closed. The drain path was untouched between 6.15.2 and 6.18.1 when that was checked; it no longer is.
7476f588(#357, released in 6.19.1) is diagnostics only, it leaves decode, publication order, the drain cadence and the#250statement untouched, so the figures still describe today's tip, 6.19.4. But it adds the two surfaces this thread has been inferring around:#357 subtitle-delivery, emitted immediately after the cue publication on every decoding tick and on every reset tick, withadmitted=/published=/outcome=. On the reconstruction tick that line is the publication instant measured inside the engine, so command → publication stops being an inference and publication → pixels becomes a subtraction.playhead=, the engine's live reference at that instant, which is precisely the value section 5 above has to bound rather than read.If the battery gets re-run on 6.19.4, those are the two columns worth capturing. Everything else here already reproduces from the archive.
cmcpherson274 commentedon Aug 15, 2026
Retested on 6.21.0 (
87868c1c88ca4ae613180c4cfb5d68c07dde0298) — and capturedthe two #357 columns your closing analysis named.
Setup: unchanged from the 6.15.2 figures above (same bench, fixture, and method:
Apple TV 4K 3rd gen tvOS 26.6, wired gigabit, Jellyfin 10.11.11, the 48 GB PGS mkv;
a fresh app session per launch, one far seek in each scored session; the same command
→ admitted publication-plus-witness measurement against the pre-extracted ground-truth
table; device stamps recomputed independently on the pulled logs, agreement both
directions on every scored repetition). This is not a terminal-pixel measurement.
Per-repetition figures (seconds, command → admitted publication-plus-witness stamp):
* one 640 launch produced no measurement: every recorded harness and engine log source
ceased ~1.1 s after launch, before
C5_ARMEDand before any seek was posed, with nofurther line for that attempt before the next
--terminate-existinglaunch; thepost-sitting device listing contained no run-date crash or jetsam report. Counted as
no-measurement, not as a figure; noting it for completeness since it consumed one of
the fifteen launch slots (14 scored).
Across the fourteen scored repetitions, the worst was 3.1059 s and the median was
2.3211 s. No scored repetition reached the old ~29 s
cadence-ceiling cluster. The measured publication-to-admitted-witness remainder falls
into the same one-vs-two drain-tick bands identified in your decomposition:
0.5288–0.6222 s in eight repetitions and 1.0696–1.2621 s in six. Unlike run-07, each
target has repetitions in both bands, so run-08 does not support labeling 600 as the
one-tick target and 302/640 as the two-tick targets.
The #357 capture — the two columns, per scored repetition. One data point first: in
all fourteen scored repetitions the first post-seek
subtitle-deliveryline wasalready
outcome=published— noempty/held/trimOnlyintermediate between thelanding and publication. So one line per repetition carries both of your columns; its
offset is measured from the seek command on the device clock:
playhead=302.20admitted=5published=5outcome=publishedplayhead=302.30admitted=5published=5outcome=publishedplayhead=302.20admitted=5published=5outcome=publishedplayhead=302.20admitted=4published=4outcome=publishedplayhead=302.20admitted=5published=5outcome=publishedplayhead=600.00admitted=2published=2outcome=publishedplayhead=600.00admitted=2published=2outcome=publishedplayhead=600.00admitted=2published=2outcome=publishedplayhead=600.00admitted=2published=2outcome=publishedplayhead=600.00admitted=2published=2outcome=publishedplayhead=640.00admitted=2published=2outcome=publishedplayhead=640.00admitted=2published=2outcome=publishedplayhead=640.00admitted=2published=2outcome=publishedplayhead=640.00admitted=2published=2outcome=publishedReading it the way your sections 4 and 5 frame it: the first post-seek #357
outcome=publishedline supplies a measured command → publication instant inside theengine (your "stops being an inference"), and the table's remainder is publication →
our admitted #250 witness. That remainder is engine/witness timing, not a measured
application-side or pixel interval. We still have no terminal-pixel stamp, so
publication → pixels remains unmeasured. The
playhead=field is the live referenceyour section 5 previously had to bound; it is printed per line here.
As before: we are not claiming an engine defect in the residual — this is the promised
retest data, with the columns you asked for. Raw per-repetition logs and the extraction
script are archived and available on request.
superuser404notfound commentedon Aug 15, 2026
Thanks for running it with the two columns. The residual is now fully decomposed from measurement rather than from inference, and one number in the retest contradicts my own reading of run-07, which is the more useful part of it.
The band mixing corrects section 4, in the direction section 4 argued
Run-07 made the one-vs-two tick split look like a property of the target: 600 crossed on the first prefetch tick in 5 of 5, 302 and 640 never did. Run-08 has both bands at every target, so that labeling was an artifact of five repetitions, not a target characteristic. The claim underneath it survives intact and is now better supported: the remainder is one or two ticks of the same fixed 500 ms cadence (
subtitleDrainTickNanoseconds, unchanged at 500 ms on today's tip), and your two bands, 0.5288 to 0.6222 s and 1.0696 to 1.2621 s, are one tick and two ticks with the tick's own work inside them. What run-08 adds is that the phase between the reanchor and the next tick boundary is not deterministic per target, which is exactly what a fixed cadence sampling a variable reader climb should look like.The first half reproduces, with one column worth a second look
Comparing your run-08 publication instants against the run-07 reconstruction ticks for the same targets:
600 and 640 reproduce inside 12 ms across a five release gap, which is a strong result for a transfer-bound quantity. 302 sits 151 ms higher with its spread collapsed from 506 ms to 73 ms, and the shape of that is familiar: run-07's 302 column contained two fast repetitions (1.5340 and 1.7380), and the byte fit already explains fast repetitions as a segment landing before the tick rather than after it, the way 640 r3 did. Run-08's five sit tightly where run-07's slow three sat.
That is a hypothesis, not a finding, and your archive can settle it without a new sitting: bytes served from
restarting producerto the publication line, per repetition. If all five 302 repetitions carry the same ~125.3 MB that run-07's slow ones did, the difference is transfer and nothing else moved.What changed between 6.21.0 and the tip, since these figures will be quoted later
The statement machinery this thread is about did not move:
Diagnostics/SubtitleResolutionStatement.swiftandAetherEngine+SubtitleResolution.swifthave no commits between 6.21.0 (87868c1c) and 6.25.4 (f4d00511). The drain path around them did, three times, and two of the three touch your protocol:dc62e704(PGS overlay cue delivery permanently starves after a few seeks (loopback-HLS VOD) — subtitle-resolution keeps pace with every landing but applySubtitleEvent never fires again, and the last cue's open-ended endTime pins it on screen #357). A reset tick now retires a placeholder cue end that the seek outran, and drops the stale gate arrival and reconstruction candidate that carry the same open end. If any of youradmitted=/published=counts on the first post-seek line included a cue carried across the jump, that one is gone on the tip. Compare the counts to your ground truth for the backscan window, not to run-08's numbers.78ced68b(PGS display sets are closed by their successor instead of their own clear packet after a seek burst (loopback-HLS VOD) — spans of 77 s to 817 s where the source authors 2-4 s #362). A tick can now hold at a hole in the harvest instead of decoding across it, and a held tick deliberately does not claim determination past the hole, so it can push the coverage witness later. Your protocol cannot produce that shape: the hold fires only where a PTS-ascending pair's harvest sequence descends inside the window, at or after the playhead, which needs an island harvested by an earlier run sitting ahead of the landing. A fresh session with a single far seek has none. It becomes reachable the moment the battery does two seeks in one session, which is worth knowing before that variant gets run.subtitle-deliveryline gained a fifthoutcome=value,harvestHole, and two conditional trailing fields printed afteroutcome=:gapAt=<seconds>(6.23.1) andendsWithheld=<n>(6.25.3,f3d238a5). The leading fields and their order are unchanged, butoutcome=is no longer guaranteed to be the last token on the line. An extractor that reads the tail rather than the key needs one adjustment before a run on the tip.The lost launch
Nothing in the engine ends its own logging without ending the session, and a session end prints, so all sources ceasing at once at ~1.1 s with no crash and no jetsam report does not read as an engine shape from here. Not counting it against anything. If it recurs, the cheapest discriminator is whether the process was still alive when the next launch came around, since that separates a dead capture from a dead app, and a spindump at the end of the sitting separates a live but stuck process from a gone one.
The one open question I would rather ask than guess
You have now measured that the remainder is cadence quantisation plus the reader's climb through the 15 s backscan region, and publication to pixels stays unmeasured on both sides. On our side the quantisation is removable: after a landing the drainer could probe at a shorter interval until the first coverage statement of that generation, then return to the 500 ms cadence. That takes the tick boundary out of the remainder without weakening what the statement claims, since the crossing test itself is unchanged.
Whether it is worth building depends on something only you can answer: does that 0.5 to 1.2 s cost anything a viewer sees in your gate, or does it fall inside a window you already cover for other reasons? Cues are already published at the reconstruction tick, so this is about how fast a host that adjudicates on
#250may act, not about when the subtitle is on screen. If it buys nothing, it stays unbuilt.