Skip to content

Seek starvation by superseded readers + cold far-seek latency #240

Closed

Description

@cmcpherson274

What happened?

Seek on a large remote MKV: superseded seek/prefetch AVIO readers keep fetching and starve the active seek — landing budget expires and re-anchors stack to 13-25 s; separately, a cold far seek anchors one segment before the target (~5 s floor at 65 Mbps source over a ~90 Mbps link)

Two related behaviours on far seeks in a large high-bitrate MKV served over HTTP, measured on a
real device with millisecond-timestamped logs (10 repetitions: 5x isolated cold seek 0->640 s in
fresh sessions, 5x rapid sequence 600->30->302->640 at ~4 s intervals).

THE BUG (rapid-seek case): when a new seek supersedes one still in flight, the superseded
pipeline's AVIOReader range connections and the forward subtitle prefetcher KEEP FETCHING. We
counted 5-8 concurrent range connections at 32 MiB-stride offsets competing on a link barely
above the source bitrate. The active seek's segment serve then starves: the same seg159 that
served in 2.2 s on a cold seek took 7.5 s (wait=7456.1 ms) under contention, the 8 s landing
budget expired — your own log: "seek did not land within budget (1 extension; starved,
island=1.37s at target...)" — the producer re-anchored, contention repeated, and observed
landings stacked to 13.7-25.2 s. The engine starves itself: its own budget is defeated by its
own uncancelled readers.

PERFORMANCE CONTEXT 1 (not claimed as a bug — cold-seek floor): on a fresh session, seek to
640.0 lands in 4.4-6.1 s (5/5, positionally exact every time). The timeline decomposes cleanly:
the producer restart anchors at the segment BEFORE the target (seg158 = 632.38 s for a 640.0
target at the seg159/seg160 boundary), so ~7.6 s of pre-target media — 56.4 MB at this bitrate —
must flow before the playhead reaches the target. We measured that transfer at 90 Mbps, our
link's line rate; the engine's own repositioning took 0.31 s (restart 33 ms, first ranged data
177 ms, A/V gates open at +310 ms). So the floor is transfer-bound geometry, not engine CPU.

PERFORMANCE CONTEXT 2: first new PGS cue after a cold first seek arrives in 3.7-6.4 s (10/10
sessions); after later seeks in the same session, usually 0.2-0.9 s. The warm number shows the
fast path exists; the cold path pays the full pipeline serially. (49 PGS tracks on this file.)

Our product gate has a 2 s command-to-correct-state seek deadline — that is OUR bar, not any
contract of yours, and this report is framed accordingly: the starvation is the part we believe
is yours; the cold floor on our Wi-Fi bench is substantially our link (on gigabit the same
geometry would cost ~0.5 s).

Steps to reproduce

  1. Serve a large high-bitrate MKV over HTTP (ours: 48.29 GB 4K HEVC DV P8.1 remux, ~65 Mbps
    overall; any comparable file should do) and play it via the local-HLS path into AVPlayer
    (4.000 s segment duration).
  2. BUG: while playback runs, issue several far seeks ~4 s apart (e.g. 600 -> 30 -> 302 -> 640).
    Watch the AVIOReader connection log: superseded generations keep opening/fetching at 32 MiB
    strides alongside the new seek's reads. On a link within ~1.5x of the source bitrate, the
    active seek's segment serve time balloons (2.2 s -> 7.5 s for the same segment), the landing
    budget expires ("starved"), and the re-anchor cycle stacks landings to 13-25 s.
  3. COLD FLOOR: from a fresh session, single seek to a far target near a segment-boundary end
    (e.g. 640.0 with 4 s segments). The producer restarts one segment early (632.38 s), forcing
    ~7.6 s of pre-target media through the pipe before landing.

AetherEngine version or commit SHA

5.25.2 (cf164d8); FFmpegBuild 2.2.0 (e832f22c), LibDovi 1.0.2

Host app

Custom / my own integration

Platform

tvOS

OS version

tvOS 26.5

Device / chip

Apple TV 4K (3rd generation), AppleTV14,1 — real hardware, not simulator. Network: Wi-Fi, ~90 Mbps effective measured (relevant to the numbers above and stated so the transfer-bound share is attributable to our bench, not your code).

Playback path

Native AVPlayer

Source media (for playback bugs)

48.29 GB Matroska remux: 4K HEVC, Dolby Vision Profile 8.1, DTS-X, 2 audio + 49 PGS tracks,
~65 Mbps overall bitrate, served by Jellyfin 10.11.11 as a direct file over HTTP range reads.
Cannot be attached (size + commercial content); full timestamped logs of every repetition are
available on request, and the behaviour should reproduce on any comparable large high-bitrate
MKV over a link within ~1.5x of its bitrate.

Error codes / log lines

No error is raised; the seek eventually lands. The two annotated timelines:

COLD SEEK (isolated-1, 5.199 s total; times relative to the seek command):
  t+0.000  seek begin target=640.0
  t+0.005  AVPlayer GETs /seg158.mp4; out-of-range -> producer restart
  t+0.039  producer restarted at idx=158, seek=632.38s absolute source PTS
           (restart took 33ms; stopWait=32 seek=0 build=0)
  t+0.216  new persistent range connection first data (offset ~4.52 GB — correct
           region immediately, no index hunting)
  t+0.310  video gate open: actual=632382 target=632382 shift=0 / audio gapMs=2.0
  t+2.725  seg158: served 21986807 B (wait=2719.9ms)
  t+5.024  seg159: served 34399188 B (wait=2241.6ms)
  t+5.199  landed at exactly 640.0

STARVED SEEK (sequence-2 gen=4, 25.1 s total, after superseding two in-flight seeks):
  t+0.011  seg159: out-of-range fetch -> producer restarted at idx=159 (101ms)
  t+0.9    firstNewCue=927ms (subtitle path is FINE here — video starves, cues don't)
  t+1.4..t+12  persistent conn starts gen=9..16 at 32 MiB strides — the superseded
           pipelines and forward prefetcher still fetching alongside the live seek
  t+7.5    seg159: served 34399356 B (wait=7456.1ms — same segment, 3.3x the cold time)
  t+8.1    "seek slow but producer serving target (island=1.37s at target...); extending
           budget 1/4"
  t+12.1   "seek did not land within budget (1 extension; starved, island=1.37s at
           target, rendered=603.01s buffered=603.01s); holding clock at target 640.00s
           and re-anchored producer at 640.00s, re-seeking"
  ...cycle repeats; landed at 640.0 at t+25.151

Anything else

Activity

  1. added
    bug
    on Jul 28, 2026
  2. added a commit that references this issue on Jul 28, 2026
  3. superuser404notfound commented on Jul 28, 2026

    @superuser404notfound
    Owner

    Fixed in 5.28.0. Thank you for the measurement discipline in this report: ten repetitions, both cases separated, the transfer-bound share attributed to your own bench, and the discriminator built right into the data. The isolated cold seek measuring at line rate while the same segment took 3.3x longer in the burst is what made this findable, and I took the framing straight from it.

    What it was

    Not superseded readers, though I understand why the log reads that way. A producer restart stops the old pump and waits for it, and markCloseds a demuxer it has to replace; the restart coalescer runs one restart at a time; a prefetch re-anchor cancels its task and markCloseds its side demuxer. None of those leak a fetching connection.

    What the log could not tell you is that the generation counter is per reader and that a bounded range starts a new generation every 32 MiB, so one reader walking forward looks exactly like several concurrent connections. There were two readers, not five to eight, and that was enough.

    The second one is the subtitle forward prefetcher (#151), and on Matroska it is a second full copy of the stream. matroska_parse_cluster has ebml_parse read the whole cluster off the wire, and only matroska_parse_block then honours AVDISCARD_ALL, so a "subtitle-only" reader still pulls every video and audio byte to reach the sparse subtitle packets. Your session was asking the link for about twice the media rate; measured on another report's capture it came to 2.6x. On a link at 1.38x that is oversubscribed by construction, and the two readers split it.

    Then it fed itself, which is the part that produced your 13 to 25 s. The landing budget expires, the recovery re-anchors the producer, the clock jumps, and a clock jump is what tells the prefetcher to re-anchor: it tore its session down and built a new one, paying a fresh open, the Matroska cue-index prewarm and a positioning seek, each of which since 5.24.0 takes a full bounded range off the same link. More contention, next serve starves, budget expires again.

    What changed

    The video path has priority now, as a rule rather than a share, since playback is load-bearing and subtitle lookahead is not:

    • A seek in flight owns the link outright. Nothing else may spend the landing budget.
    • A pump that is fetching outranks a side reader. A parked pump (forward buffer full, which on a link with headroom is nearly all of the time) leaves the link to it.
    • Two bounded escapes so this cannot become a mute switch: a grace window after each anchor, so a freshly selected track fills even against a busy pump, and a cap on continuous yielding, so a pump that never parks cannot silently disable lookahead for the rest of a session.
    • A playhead jump re-anchors the running prefetch session in place. One seek on a demuxer that is already open and already has its index, instead of a rebuild.

    Your three suggestions all landed in some form, arrived at from the reader side rather than the cancellation side: the prefetcher is deprioritized while a video seek is in flight, superseded work stops paying for the link, and the per-jump rebuild cost is gone.

    Measured

    Reproducing this needed a bench that shapes the SUM of all connections; with per-connection shaping two readers each get the full rate and the defect cannot appear at all. That mode plus a far-seek pattern driver are in the release (Scripts/throttle-origin.py --shared, aetherctl play --seek-pattern).

    900 s Matroska at 8 Mbit/s with one SRT track, everything sharing 1.4x the media rate, five far seeks 25 s apart, two runs per build:

    before after
    seek landing, median 23.5 s / 23.7 s 12.7 s / 13.8 s
    source connections 35 21
    side reader share of bytes ~47% ~24%

    On your two performance notes

    The cold-seek floor is yours to keep, and you priced it correctly. The producer anchors where AVPlayer asks: it requested seg158 for a 640.0 target, so the pre-target media is AVPlayer's own preroll geometry, not a choice the engine makes. At 90 Mbit/s against 65 Mbit/s of content that is about 5 s of transfer, and on gigabit it is the ~0.5 s you estimated. I would rather not shorten segments after a seek to hide it: the segment plan is what the whole timeline continuity rests on, and a variable-duration tail near the seek target has cost more than it saved every time it has come up.

    Which also means a 2 s command-to-correct-state gate is not reachable on a link at 1.38x the source bitrate, whatever the engine does. The bytes for two segments have to arrive. What was ours was everything above that floor, and that is what this release removes.

    For the retest

    If it is still slow, the log now answers the attribution question directly. Connection lines name their reader ([AVIOReader] pump conn start gen=4 offset=... len=32MB versus prefetch), and the 30 s memprobe carries pumpFetchedMB next to prefFetchedMB plus prefetch=read|yield|park and prefetchYielded=Ns. If prefFetchedMB still tracks pumpFetchedMB during a seek burst, the arbitration is not engaging and I would want that log. 49 PGS tracks is also a lot of side-reader work in general, so I am interested in what your numbers look like against the synthetic bench above.

  4. superuser404notfound commented on Jul 29, 2026

    @superuser404notfound
    Owner

    Re-measured the table above, because the bench script that produced it had a defect of its own.

    rrgomes flagged it on #220: the throttle-origin.py that was in path for those numbers passed a body that ended short of its own Content-Length off as a complete one, which left the client waiting on bytes that could no longer arrive until its own 20 s stall timeout fired, and a single 180 s socket timeout also closed connections that were parked legitimately. Both are fixed in 96c85fa8, and the script now emits [proxy TRUNCATED] and [proxy GONE ... reason=], so neither can happen quietly again.

    Both arms re-run with the fixed script, same driver, same shaped rate, same seek pattern, two runs per build:

    before after
    seek landing, median 17.8 s / 18.0 s 12.1 s / 12.2 s
    source connections 21 / 21 15 / 15
    proxy truncations 0 0
    proxy idle closes 0 0

    The improvement stands, and neither defect fired in any of the four runs, so nothing in the original table came from a teardown the script produced. source connections is now the count of TCP connections the proxy accepted, which the old script did not log at all.

    The absolute values moved because the bench file had to be rebuilt: same 10x concat of the same source, same 4 s key frame interval, same 8 Mbit/s, but not a byte-identical encode, so segment boundaries and therefore landings differ. Read this as a like-for-like comparison inside one experiment rather than against the earlier one, and where the two disagree these are the numbers taken with a script that reports what it does.

    The retest above is unaffected either way; this is about what the measurement rows are worth, not about the fix.

  5. superuser404notfound commented on Jul 29, 2026

    @superuser404notfound
    Owner

    The arbitration got measured from the byte-attribution side, on different hardware and a different origin.

    The reporter of #220 ran 5.28.0 with a subtitle track selected on a 4K HEVC Dolby Vision title at about 11.2 MB/s media rate, 4295 s to natural end of media, with every connection sharing a 15 MB/s shaped link:

    bytes fetched
    pump 43.8 GB
    side reader 5.7 GB

    The side reader took 12% of what the video path did. The same title over an unshaped LAN pulled 57 GB against the pump's 73 GB, so about 0.78 of a full second copy of the file. Constrain the link and strict priority collapses that to roughly a tenth while the video path holds media rate, which is the bench table above arrived at from the opposite side of the wire.

    Worth being precise about what that rate means. With a subtitle track selected two readers want about 2x media rate, so 15 MB/s against 11.2 is roughly 0.67x of what the pair would draw unarbitrated. The link is under-provisioned for the pair by construction, which is the condition this issue exists for, and it played to a clean end of media with zero slow reads.

    What the same run also showed

    Ten AVPlayerWaitingToMinimizeStallsReason freezes, five of 3.0 s and five of 4.0 s, nine of them in the back half. The reading offered was that the pump sat at media rate with no margin, so every hiccup surfaced as a stall. Two numbers from the same run do not fit that:

    • The loaded range held around 33 s throughout. A 33 s buffer absorbs a 3 to 4 s deficit without AVPlayer ever having to wait.
    • The link was not saturated. 43.8 plus 5.7 GB over 4295 s is 11.5 MB/s against a 15 MB/s cap, so about 3.5 MB/s went unused on average.

    Two candidates, and they are cleanly separable:

    1. AVPlayer's bandwidth estimator rather than the buffer. On the HLS loopback it estimates from segment delivery, and a slow segment can put it into waiting-to-minimize-stalls with plenty still buffered. Then the loaded range does not dip at the stall instant.
    2. A valve grant. The continuous-yield cap fires only when the pump fetches for 60 s without parking once, and the side reader then takes 10 s of the link back so lookahead cannot be muted for a whole session. Each grant is 10 s at close to full rate in front of a pump with no reserve. The counter-argument is in the same numbers: 5.7 GB over 4295 s averages 1.33 MB/s, which fits inside the 3.5 MB/s the link had spare, so ordinary pump parks can account for all of it without the valve ever firing.

    One run answers it. grep the log for #151 forward prefetch yielded the link for, which is emitted once per grant and gives the count and the timestamps directly, and log loadedTimeRanges from the timeControlStatus handler so the buffer is sampled at the stall instant instead of on the 30 s memprobe cadence. If the grep comes back empty, candidate 2 is dead and the estimator is the whole story.

    If it turns out to be the valve, the lever is not the priority rule but the grant's granularity. A 32 MB range taken in one piece is too coarse in front of a pump with no reserve, where the same 10 s spent in smaller slices would stay inside the buffer's tolerance.

    None of this changes what this issue is waiting on, which is the retest on the library with 49 PGS tracks.

  6. cmcpherson274 commented on Jul 29, 2026

    @cmcpherson274
    Author

    Following up on my own report, with a correction and a data point.

    The cold far-seek half of this issue was substantially my bench, not the engine.

    I re-ran the identical seek shape (isolated 640 s ×5, then the sequence 600→30→302→640 ×5) on a wired Apple TV 4K instead of the ~90 Mbps Wi-Fi one, against the same 48.29 GB / ~65 Mbps HEVC file and the same 5.25.2 build:

      | Wi-Fi (original report) | wired, same build -- | -- | -- command→landing, all repetitions | 3.385 – 25.151 s | 0.180 – 0.885 s (median 0.692) under a 2.000 s bar | 0 / 20 | 25 / 25 isolated cold seek ×5 | 4.398 – 6.058 s | 0.836 – 0.885 s cue reacquisition | 3726 – 6402 ms | 101 – 1367 ms did not land within budget | 4 | 0 superseded / unobserved landings | 7 of 20 | 0 of 25

    That matches the arithmetic in the original report rather than contradicting it: ~56.4 MB of pre-target media at 90 Mbps line rate is ≈5 s, while the engine's own repositioning measured 0.310 s. On a link where the transfer is not the bottleneck, the same geometry costs well under a second.

    Two things this sharpens, both in your favour:

    1. The starvation signature disappeared entirely (4 → 0). The superseded readers are still not cancelled, but their harm appears to need a link near saturation before it shows. So the severity in my original report was bench-specific, and the priority-gate approach in the 5.28.0 notes looks well aimed at where it actually bites.
    2. The 7 "superseded / unobserved" landings were a cadence artefact of a slow link, not a pipeline defect. My harness issued the next seek on a fixed 4 s cadence; at ~0.7 s landings nothing is superseded and all 25 were observed. That part of the report was my instrument, not your engine.

    I have not run 5.28.0 yet — when I do it will be under a pre-registered protocol, and I will report whatever it shows. Thanks for the quick turnaround.

    (Bench: Apple TV 4K 3rd gen, tvOS 26.5, wired gigabit, ping stddev 0.607 ms. Same server, same file, same build as the original report. Not a controlled one-variable comparison — the unit also went 64 GB → 128 GB — so read it as "the failure did not survive the move off Wi-Fi", not as an isolated network measurement.)

  7. superuser404notfound commented on Jul 29, 2026

    @superuser404notfound
    Owner

    Thank you for going back and re-running your own report against a second link. Retracting half your own severity is not the common move, and the wired arm is worth more than the retraction: it is the control the original report did not have.

    The arithmetic closes on both arms

    Your 56.4 MB of pre-target media, priced at each link:

    transfer plus 0.310 s repositioning you measured, isolated cold seek
    ~90 Mbit/s Wi-Fi ~5.0 s ~5.3 s 4.398 to 6.058 s
    gigabit wire ~0.45 to 0.5 s ~0.8 s 0.836 to 0.885 s

    Two links an order of magnitude apart, and on both of them the transfer plus the engine's own repositioning accounts for the landing with under a tenth of a second left over. That is about as cleanly as this kind of attribution ever resolves. The cold far-seek floor is AVPlayer's preroll geometry moving over the wire, in both arms, and there is nothing in it for the engine to give back.

    One correction, because it would misdirect the retest

    The superseded readers are still not cancelled

    They are, and this matters for what to look for in the 5.28.0 logs. A producer restart calls stop() on the old pump, waits for it, and markCloseds the demuxer it replaces; the restart coalescer runs one at a time; cancelSubtitleForwardPrefetcher cancels the task and markCloseds its side demuxer, so a parked AVIO read cannot survive teardown either. What the log could not tell you was reader identity, and the generation counter is per reader and increments on every 32 MiB re-request, so one reader walking forward prints exactly like five to eight concurrent connections.

    What 5.28.0 changed is not cancellation. It is which of two live readers gets the link. The distinction decides what the retest should grep for: connection lines now name their reader (pump, prefetch, nativesubs, extract), and a single prefetcher will still climb through gen= values without that meaning anything is leaking.

    Which arm can show 5.28.0, and which cannot

    The arbitration rule is "an actively fetching producer wins the link". On a link with headroom the producer parks as soon as its forward buffer is full, which is nearly all of the time, so the policy hands the link to the side reader exactly as before. On your wired box, before and after run the same program by construction. The Wi-Fi box is the arm this release exists for.

    Since you are pre-registering, here is what I am predicting, before your run:

    Wired (control, plus one real prediction)

    1. command to landing does not move. It stays around your 0.692 s median. No Seek starvation by superseded readers + cold far-seek latency #240 mechanism touches it.
    2. cue reacquisition should fall, and the 1367 ms upper edge should go first. The in-place re-anchor is the one part of 5.28.0 that does not depend on a constrained link: through 5.25.2 every playhead jump tore the prefetch session down and paid a fresh open, a Matroska cue-index prewarm and a positioning seek, each of which since 5.24.0 takes a full bounded range. From 5.28.0 it is one seek on a demuxer that is already open and already has its index. If that number does not move on wire, the re-anchor path is not engaging and I want the log.
    3. grep '#151 forward prefetch yielded the link for' should come back empty and the memprobe should show prefetchYielded=0s. If it does not, a pump on an unthrottled link is not parking when it should, which is its own finding and a more interesting one than the seek numbers.

    Wi-Fi (the actual test)

    1. The 4 "did not land within budget" go to 0, and the 13 to 25 s tail goes with them. That tail was the self-feeding cycle, not the floor.
    2. The floor stays, so do not set the bar at 2 s in that arm. Five seconds of preroll transfer at 90 Mbit/s is not reachable whatever the engine does. What 5.28.0 actually claims there is "no landing far above the transfer floor, and zero budget misses", not "under 2 s".
    3. prefFetchedMB should sit far below pumpFetchedMB through the seek bursts. Measured on another reporter's shaped link it came out at 12% of the video path, against 78% unshaped.

    And the risk in the other direction, which interests me more than the landings: strict priority can starve subtitle lookahead on a link that is already short. The 8 s grace after each anchor and the 60 s continuous-yield cap exist to bound that, but they are bounds, not proofs. If cues arrive late after a seek, or a freshly selected track comes up empty, that is a 5.28.0 regression and I want prefetch=read|yield|park plus prefetchYielded=Ns from the run. On the library with 49 PGS tracks that is the more informative of the two tests.

  8. cmcpherson274 commented on Jul 29, 2026

    @cmcpherson274
    Author

    5.28.0 retest, wired arm, same rig and same shape as my previous comment: isolated 640 ×5 plus the 600→30→302→640 sequence ×5, the 48 GB / 49-PGS-track title, PGS track selected throughout. One build note first: a fresh resolve of 5.28.0 today floats LibDovi to a release whose tvOS platform floor is 17 against the engine's declared 16 and the build fails — I pinned the transitives to 5.28.0's own Package.resolved (ffmpegbuild 2.3.0, libdovi 1.0.2, smbclient 0.3.1) and built with automatic resolution disabled.

    Against your predictions

      | 5.25.2 wired | 5.28.0 wired -- | -- | -- command→landing, all 25 | 0.180–0.885 s, median 0.692 | 0.181–0.908 s, median 0.707 cue reacquisition | 101–1367 ms | 101–1384 ms, median 920 did not land within budget | 0 | 0 superseded / unobserved landings | 0/25 | 0/25

    1 — command→landing does not move: confirmed. Median 0.692 → 0.707 s.

    2 — cue reacquisition falls: it did not. The upper edge is 1367 → 1384 ms. You said if the number doesn't move on wire the re-anchor isn't engaging and you'd want the log — it is engaging: all 25 seeks emit

    #151 forward prefetch re-anchored in place at 640.00s (seek)

    one line per seek, zero per-seek teardowns (the 45 forward prefetch started: lines across the run are the 10 app launches plus track-selection restarts, each startAt=0.00s, none follows a seek). So the mechanism works as designed and the wired number is flat anyway — reading it here, the fresh-open cost the re-anchor removes doesn't look like it was the dominant term of wired cue reacquisition at 5.25.2 in the first place. Happy to attach the per-repetition log slices.

    3 — the yield grep comes back empty: yes, but the two surfaces disagree. grep '#151 forward prefetch yielded the link for' = 0 hits, as you predicted. But the memprobe does not show prefetchYielded=0s — it climbs 2s → 6s within sessions, and prefetch=yield appears in 2 of 127 fragments:

    … prefWinMB=15 prefSusp=1 prefFetchedMB=1151 prefetch=yield prefetchLead=59.5s prefetchHarvested=5173 prefetchTbFallback=0 prefetchYielded=4s …

    Either prefetchYielded counts ordinary priority yields that the once-per-grant line doesn't (and the counters are consistent, with the prediction pointing at the wrong one), or something is granting without logging. You'd know which; the full memprobe series is easy to hand over.

    The regression you said interests you more: not observed on this arm. The prefetcher parks at prefetchLead=59.x s almost immediately and stays there (park in 112 of 127 fragments, read in 13), every post-seek first cue arrived inside 1.4 s, and a freshly selected track never came up empty. Unshaped byte split end-of-run: prefFetchedMB=1633 against pumpFetchedMB=1816, ~0.90 — same territory as the ~0.78 unshaped you quoted from the other reporter.

    Caveats: fresh app session per repetition, so every rep pays one cold prefetch start; the Wi-Fi unit that produced the original report is retired from my bench, so your predictions 4–6 (the arm this release actually exists for) stay untested here. And thanks for the correction on reader cancellation — with the readers now named in the connection lines, pump/prefetch attribution was clean throughout: one walking reader climbing gen= values looks exactly as you described.

  9. superuser404notfound commented on Jul 29, 2026

    @superuser404notfound
    Owner

    Two of the three wired predictions were wrong, and the finding in this run is not in the seek numbers at all. Taking that one first, because it costs everyone else the most.

    The build note is a real break, and it is mine

    Confirmed, and fixed within the hour. LibDovi published the visionOS slices and the tvOS floor correction together as 1.1.0. Raising a declared platform floor is a breaking change, so it belonged in a major: SwiftPM resolves that new minor into every consumer pinning from: "1.0.x", then fails the build on the floor mismatch rather than backing off to a version that fits. Every 5.x tag of this engine declares tvOS 16 and LibDovi from: "1.0.2", so all of them became unbuildable on a fresh resolve, which is exactly what you walked into.

    • The same content is now LibDovi 2.0.0, and the 1.1.0 tag and release are withdrawn.
    • AetherEngine 6.0.1 pins from: "2.0.0". 6.0.0 pins the withdrawn tag and no longer resolves, so it is superseded rather than merely followed.
    • 5.x needs no change on its side: a tvOS 16 consumer asking for from: "1.0.2" resolves back to 1.0.2 again, verified against the live repository rather than reasoned about. Your transitive pinning and disabled automatic resolution can go.

    Thank you for putting that in the report at all. A retester who works around a broken resolve silently is the normal case, and this one would then have surfaced through someone with less patience.

    Prediction 2 was wrong, and your log rules out the reason I gave for it

    I said that if wired cue reacquisition did not move, the re-anchor was not engaging. It is engaging, your log shows one re-anchor line per seek and zero per-seek teardowns, and the number is flat anyway. So the fault is in the prediction, not in the mechanism, and the premise it rested on was that the side reader owns the first cue after a seek. It does not.

    Both readers write into one session packet store. The pump taps every embedded subtitle packet it demuxes into that store (HLSSegmentProducer.subtitlePacketSink), and the side reader appends to the same store from its own connection. After a seek, the pump has to fetch the region around the target before it can produce a single frame there, so it reaches the new position first by construction, on any link. The first cue therefore comes off the pump's own harvest, and what the side reader contributes is lookahead beyond the pump's forward park, which is a different quantity from reacquisition.

    Your own two medians say it plainly: command to landing 0.707 s, cue reacquisition 0.920 s. The first cue trails the first frame by about 0.2 s. That is what "the pump's tap delivered it" looks like. A second connection opening, prewarming a Matroska index, seeking and reading would not arrive 0.2 s after the video.

    Which also corrects a claim I made in the same comment: the in-place re-anchor is not the link-independent half of 5.28.0. What it removes is a fresh open, a cue-index prewarm and a positioning seek, each pulling a bounded range off the link once per playhead jump. That is bytes not stolen from the video path during a seek burst, which is a constrained-link effect like everything else in the release. Nothing in 5.28.0 was measurable on your wired arm, including the part I nominated for it.

    One thing worth checking in the data you already have, if you are curious: if the 101 to 1384 ms spread clusters by seek target rather than scattering across repetitions, the residual is the distance to the next cue in the content at each target, which is a property of a sparse PGS track and not of any reader. I do not need it to accept the result.

    Prediction 3: you are right, and I pointed at the wrong counter

    The two surfaces are supposed to disagree, and I conflated them. prefetchYielded=Ns accumulates every priority yield: a seek in flight, a producer that is actively fetching, all of it. The #151 forward prefetch yielded the link for line is emitted once per continuous-yield-cap grant only, which on a healthy link never happens. So a session showing seconds of yield with zero hits of that grep is the consistent case, not the anomalous one, and your first reading was the correct one.

    Where those seconds come from on a wired box: a seek in flight yields unconditionally, and that rule sits above the anchor grace in the ordering, so every seek contributes yield time even to a reader that just re-anchored. Twenty five seeks at a 250 ms arbitration poll is the right order of magnitude for the 2 s to 6 s you saw climbing. It is not a pump failing to park.

    Your alternative reading did surface something real, though. The native subtitle readers run the same arbitration and took their cap grants with no log line at all, so one reader in the engine genuinely could grant without logging. As of 6.0.1 both readers log grants in the same shape, and the memprobe carries prefetchValve=N next to prefetchYielded=Ns so the escape hatch that overrides the arbitration has a figure of its own rather than only a line. The doc comment now says which of the two counts what, since the ambiguity was mine to remove.

    The starvation direction, and what stays untested

    Parked at prefetchLead=59.x s in 112 of 127 fragments, first cue inside 1.4 s after every seek, no empty track after a fresh selection: that is the answer I wanted on the risk side, and on a 49-track PGS library it is the more informative half of the run. Your unshaped split of 1633 against 1816 MB is the same territory as the 0.78 from the other report, and both are the Matroska tax rather than a defect: a subtitle-only reader still pulls every video and audio byte of each cluster to reach the sparse packets.

    That leaves predictions 4 to 6 on the shaped arm, which your retired Wi-Fi unit was the only reporter-side way to reach. Covered for now by two other sources: the #220 reporter's byte attribution on a shaped 15 MB/s link (side reader at about 12% of the video path, against roughly 78% unshaped on the same build), and a local bench with a sum-throttled origin at 1.4x media rate, where the landing median went 17.8 s to 12.1 s and source connections 21 to 15. Neither is your rig, and I am not going to claim your original symptom is closed on someone else's hardware.

    Leaving this open on that basis. If you would rather close it out given that the arm that produced the report no longer exists on your bench, say so and it closes.

  10. cmcpherson274 commented on Jul 29, 2026

    @cmcpherson274
    Author

    Confirmed on the build fix: a fresh resolve of 5.28.0 with no pinning and automatic resolution enabled now completes — LibDovi comes back at 1.0.2. Thanks for turning that around within the hour, and for the release-note credit. One observation from the same verification, in the spirit of "verified against the live repository rather than reasoned about": that fresh resolve now takes FFmpegBuild 2.4.0, where 5.28.0's own Package.resolved records 2.3.0 — it builds, but it isn't the dependency set 5.28.0 shipped with. Harmless for ordinary use; for my pre-registered measurement runs I'm keeping the lockfile-seeded, resolution-disabled build regardless, since a measurement build has to be a function of its recorded inputs rather than of the registry's state on the day someone re-runs it — a week that saw the registry change twice in one day makes the case better than I could.

    Your clustering check: yes, and more cleanly than I expected. The spread decomposes almost entirely by target, and the residuals line up with the authored subtitle timeline of this title (I have frame-accurate display-set timings for these four regions from other work):

    target | n | values (ms) | reading -- | -- | -- | -- 600 | 10 | 1170–1367, median 1209 | tight cluster = distance to the next display set at 600 302 | 10 | 8× 101–108, 2× 1317/1384 | bimodal: the 101 ms mode is the store-backfill of a composition that spans the target (established ~1.6 s before it); the two outliers land exactly on the next authored transitions at +1.387/+1.554 s — reps where the spanning composition didn't count as "new" and the first genuinely new cue was the next one in the content 30 | 10 | 8× 402–525, 2× 925/1035 | the first display set on this track is at 88.380 s; ~0.4–0.5 s is the forward prefetcher harvesting it into the published set (~58 s ahead of the playhead), i.e. arrival cadence, not display 640 | 20 | 439–1203, spread | the one target that doesn't cluster tightly; the region around 640 has the densest transitions of the four

    So the 101–1384 ms "spread" is content geometry plus which mechanism (backfill vs pump tap) delivered first — consistent with your description of the tap owning reacquisition, and nothing in it looks like reader behaviour to chase.

  11. superuser404notfound commented on Jul 30, 2026

    @superuser404notfound
    Owner

    The FFmpegBuild drift

    Correct, and worth pinning down precisely, because the drift happens to be empty in the direction that could touch your runs. I checked the tags rather than the release note: git diff --name-only 2.3.0 2.4.0 is 356 files, 344 of them under an xros path. The other twelve are Package.swift, README.md, build.sh and the nine top-level xcframework Info.plists, which gain the two xros dicts (the rest of that plist diff is -create-xcframework reordering entries it already had). Not one iOS, tvOS or macOS slice binary changed, and the declared floors are the same three with an additive .visionOS(.v1). So a 5.28.0 measurement that resolved 2.4.0 ran the same decode stack as one that resolved 2.3.0, and the runs stay comparable across the registry change.

    Your method is the right one anyway, and this makes the reason concrete rather than stylistic: SwiftPM never reads a dependency's Package.resolved, only the root's. The 2.3.0 recorded in 5.28.0 is the engine repository's own checkout state and was never shipped to anyone; from the moment 2.4.0 existed, every fresh resolve of that tag took it. A lockfile-seeded, resolution-disabled build is the only mechanism that makes a tag a function of its recorded inputs, which is what a measurement build has to be.

    Changed here so the class cannot recur going forward: both first-party binary dependencies are now .upToNextMinor(from:) rather than from: (d49f7528 on main). That blocks both failures this week produced, the floor raise (a from: "1.0.2" consumer would never have been offered LibDovi 1.1.0) and the silent stack swap, while patch rebuilds still reach existing tags, which is where a pure rebuild belongs. It is forward-looking only: already published tags keep whatever they declared, so nothing about 5.28.0 moves and your lockfile stays load-bearing for anything already cut.

    The clustering

    Better decomposition than I asked for, and I take the reading as it stands for 600, 30 and 640. One correction on 302, because the quantity that varies there is not content.

    The drain reset a seek triggers scans a fixed 15 s behind the playhead, so a composition established 1.6 s before the target is inside that window by construction, in every repetition. What separates your 101 ms mode from the 1317/1384 ms pair is therefore not the window, it is whether the packet was in the store when the window ran. The store has two writers, the pump's own subtitle tap and the forward prefetcher, and after a seek both start at an anchor and work forward: the pump from wherever its restart anchored, the prefetcher re-anchored at the new playhead. Neither covers anything behind the restart anchor. So the effective backscan is not 15 s, it is the distance from the restart anchor to the playhead, and on a landing where that anchor sits after the spanning composition's PCS the composition is never harvested at all. The reconstruction pass then has nothing behind the playhead to seed a candidate from and ends on the next composition that arrives, which is precisely your +1.387 s and +1.554 s.

    That makes the two modes two reader states rather than two pieces of content, and the practical shape is that a subtitle already on screen at a seek target is restored most of the time rather than every time. Two samples in ten is not something I will turn into a fix on its own, but it is engine-side, so I would rather carry it as that than file it under geometry. If it ever surfaces as a visible miss on a normal seek rather than a number in a table, that is the one worth saying.

  12. cmcpherson274 commented on Aug 4, 2026

    @cmcpherson274
    Author

    Measured follow-up from a fixed-pin acceptance run — wired hardware, 15 fresh-session repetitions

    We ran a pre-registered acceptance battery against a frozen pin and think the numbers are worth adding here, with their limits stated up front.

    Setup

    AetherEngine 6.3.0 (496aaae); transitive set FFmpegBuild 2.4.0 (87a5655979b9d6fa9f4b8db69e0a7e8df9075639), LibDovi 2.0.0 (89be93431c2a5f2e54fb77e93059071b8d2ddb3a), SMBClient 0.3.1 (e636c2b2458930770932a36d311ec9d478575b90).
    tvOS 26.6 (23L773) on real Apple TV 4K (3rd gen) hardware, active wired Ethernet (not simulator, not Wi-Fi). Source: a 48 GB local file served over LAN; bitmap (PGS) subtitle track selected and pinned.
    15 independent repetitions, one far seek each, fresh session per repetition (targets 302 s ×5, 600 s ×5, 640 s ×5).
    What we measured

    7 of 15 repetitions landed at 29.2405–29.2991 s, including 5 of 5 at target 640.
    3 of 15 cleared our project's inclusive 2.000 s combined threshold (playhead correct and subtitle state correct, whichever is later).
    To be explicit: the two-second bar is Tevemate's own acceptance requirement, not an SLA we are asserting against this project.
    What the ~29.25 s figure is, and is not

    It is the instant our generation-fenced semantic witness became admissible — at the next periodic tick after the seek. It is not a claim that users necessarily saw 29 seconds of blank subtitles. The tight clustering just under 29.3 s across three different seek targets is what makes us think the observation is about restore/emission cadence rather than about transfer or decode.

    Why we think this adds something

    Earlier discussion attributed observations in this family to a shaped/constrained link. Our bench is wired and fast (four concurrent decode-disabled transfers sustained ~931 Mbps aggregate immediately before the battery), so the bandwidth explanation does not account for this witness/restore-cadence observation on our setup. That said: this does not invalidate the maintainer's shaped-link measurements, and 15 repetitions on one bench does not establish a universal occurrence rate.

    The ask

    Rather than a latency target, what would help us most is determinism: a restore that is deterministic after a seek, and/or emission at the moment resolvedThrough first crosses the post-seek playhead, instead of the state becoming observable only at the next periodic tick.

    Happy to provide the per-repetition figures or more detail on the measurement method if useful.

  13. cmcpherson274 commented on Aug 5, 2026

    @cmcpherson274
    Author

    Clarification to the ask in my preceding comment, based on decomposition of the same archived 15 repetitions:

    In all five 640 s repetitions, the instrumented rendered subtitle state matched the frozen extracted truth at 1.33–1.39 s after the seek command. At reconstruction, AetherEngine also emitted a generation-matched via=pump line with resolvedThrough=644.48, against the gate's rendered source time of 640.00.

    Our frozen gate intentionally does not accept that pump value as semantic coverage: in this spelling it is the drain cursor, a lower bound. The later via=prefetch frontier statement was admissible in kind but remained short at 639.30–639.89; the next admissible crossing was the periodic tick at 29.24–29.30 s.

    So please read our request more narrowly: not "emit any resolvedThrough value when it first crosses"—the reconstruction line already does that—but "emit a generation-fenced semantic-coverage statement equivalent in strength to the current prefetch/eof forms as soon as coverage is established through the rendered post-seek source time."

    We are not asking to treat the pump cursor as coverage or to meet Tevemate's two-second bar. The ~29 s observation reflects the interaction between semantic-report cadence and our unchanged admission rule; it is not a rendered-state-latency claim.

  14. superuser404notfound commented on Aug 7, 2026

    @superuser404notfound
    Owner

    Thanks for both comments, and in particular for the decomposition in the second one. The narrowed request is the right one, and it is now built and released.

    The ~29.25 s is my emission cadence, and your reading of it is correct. Tracing the sequence against the code confirms it end to end:

    1. The reconstruction tick is via=pump by construction. The reanchor request (startSubtitleForwardPrefetcher()) runs after the per-channel drain loop, so when that line is written the side reader has not yet been asked to move. Its resolvedThrough is the drain cursor, a lower bound, and your gate is right to refuse it as coverage. That is exactly what the via= field is there to say.
    2. The next line fires when the frontier's SOURCE changes, pump to prefetch. In your runs that landed at 639.30 to 639.89 against a rendered 640.00, so it was admissible in kind and short in fact.
    3. After that via never changes again, so nothing was printed while the frontier climbed past 640 about a second later.
    4. The next emission point is reason=tick, which rides the 30 s memory probe. That is your 29.24 to 29.30 s, and it is why the figure clusters that tightly across three different seek targets: the cadence has nothing to do with the content.

    So it was never a rendered-state-latency observation, and your own 1.33 to 1.39 s figure is the one that describes the engine's behaviour here.

    Shipped in 6.8.0 (fix 6296e1b9, tracked as #318). The drain tick now emits a fifth reason on the first tick whose stated span actually contains the playhead:

    [AetherEngine] #250 subtitle-resolution loadGen=2 seekGen=7 stream=4 coveredFrom=626.40 retainedFrom=-15.00 resolvedThrough=646.10 via=prefetch decodedThrough=641.88 reason=coverage
    

    Properties worth stating precisely, since your gate adjudicates on them:

    • The trigger requires via != pump and a span that CONTAINS the playhead, resolvedThrough >= playhead and coveredFrom <= playhead. A run that ends above the playhead but starts above it too does not determine the position being rendered.
    • It is not a new claim. The line prints the statement the tick already builds every decoding tick, so the strength of the number is unchanged and the pump cursor is still not coverage.
    • One per decoded run, re-armed by every reset, and it does not repeat at the 2 Hz drain cadence afterwards. Per tick raw cadence stays out, as you asked in Expose a generation-fenced subtitle-resolution statement (absolute coveredFrom/resolvedThrough on the source axis) #250.
    • If a reset or frontier-change line already states coverage, that counts as stated and no second line repeats it.
    • Its absence remains informative. On a link that cannot carry both the pump and the side reader, which is the actual subject of this issue, the frontier never catches the playhead and no line claims that it did.
    • Parser note: coverage is a new value of the reason field. Field set and field order are unchanged.

    To be explicit about what this does not do: it does not move any latency, and it makes no claim against your two second bar. It reports the crossing where it happens instead of at the next cadence tick.

    Two open threads, kept apart:

    • Post-seek subtitle coverage is only observable at the next cadence tick, not when determination first crosses the playhead #318 for the retest of the above. If your gate now admits the crossing near where your instrumentation sees the rendered state match, that closes it, and per repetition figures are welcome either way.
    • This issue stays open for the arm it was filed for. The 5.28.0 link-priority fix is invisible by construction on a link with headroom (the policy rule is videoProducing, and a pump that parks yields the link exactly as before), so a wired bench cannot exercise it in either direction. Your wired numbers here are useful, they just measure a different question.
  15. cmcpherson274 commented on Oct 11, 2026

    @cmcpherson274
    Author

    Closing from our side: #318's reason=coverage line answered the narrowed ask, and the arm this issue was kept open for, a link that cannot carry both the pump and the side reader, is one our setup cannot stage. Far seeks on our wired link have stayed clean on the pins we have measured since 5.28.0 (we are on 7.28.3), which by your 7 August note says nothing about the link-priority fix either way. That arm stays unmeasured from our side. Thank you for the byte-attribution measurements and the coverage line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions