Skip to content

A session-preserving audio-delay setter — setAudioDelay(seconds:) with setRate's contract — for host lip-sync correction #464

Closed

Description

@cmcpherson274

Closed-source tvOS Jellyfin client, pinned 6.60.0 (771d8592). AetherEngine is the shipped engine for VOD, live TV and the guide's picture-in-guide; TVVLCKit is being removed this cycle, and this is the fourth and last ask in that removal-groundwork set (after #460, #461, #462): the one in-player control the removal deletes that has no home at any layer we own.

Context. Same host as #460/#461/#462. The engine we are removing carried an in-player
"Audio Sync" stepper (libVLC's --audio-desync, applied at construction and re-applied on
rebuild) and a subtitle delay. We are rebuilding the subtitle half ourselves — our cue painter
owns the subtitle presentation axis, so a per-session offset on sourceTime is host-side work
(shipping this cycle). The audio half is the one shipped control the removal deletes with no
replacement at any layer — not because the render sites are hidden from a host, but because
nothing on them takes an offset. On the native path the AVFoundation objects are public and
documented for hosts (currentAVPlayer / currentAVPlayerItem, AetherEngine.swift:4876/:4886;
nativePlayerLayer, :746; docs/api.md:272, :434), and they give us nothing to set:
AVPlayerItem has no audio-delay control; the item is HLS off your loopback origin
(http://127.0.0.1:<port>/<token>/master.m3u8, or media.m3u8 without master metadata,
Network/HLSLocalServer.swift:234-251), so audioMix/MTAudioProcessingTap is not a route
either — an HLS-streamed asset exposes no AVAssetTracks to bind mix parameters to (AVFoundation's
documented behaviour, not something we measured), and the engine sets no audioMix anywhere; and
A/V alignment on that path is decided upstream of AVPlayer, in your fMP4 mux. Your audio tap is
explicitly off the render path (api.md:298) — it observes, it cannot retime. On .software both
AVFoundation objects are nil (api.md:272) and softwarePiPSource (AetherEngine.swift:710) vends
the display layer and transport only; the audio renderer is never exposed. The one thing we could
do ourselves is rewrite audio PES timestamps in the bytes we already feed you through
MediaSource.custom(IOReader, formatHint:) (api.md:215) on our live arm — a TS retimer we would
own and maintain, and no help at all on plain-URL VOD loads, which is why we are asking you.

What the code says. At 6.60.0 (771d8592) the engine carries no audio-delay, A/V-offset or
subtitle-delay symbol at all: a case-insensitive grep of Sources/AetherEngine for
audioDelay|subtitleDelay|avOffset|audioOffset|lipSync returns a single hit, a comment about
lipsync drift in the fMP4 muxer (Video/MP4SegmentMuxer.swift:482) — no symbol, public or
internal. The nearest A/V-offset-shaped quantity anywhere is read-only telemetry
(LiveTelemetry.accumulatedFrameDelaySeconds, Diagnostics/LiveTelemetry.swift:39), and
LoadOptions (PlayerState.swift:208-572) has no field for it.

Why it matters to a host. Lip-sync error is a property of the viewer's chain (a soundbar
or AVR adding video-processing latency, or the reverse), not of the file, so it is a per-setup
nudge, typically ±50–250 ms, that people set once and expect the player to honour on every
session. Every player we replace or compete with offers it in the player.

Why the shape is already yours. setRate(_:) (AetherEngine.swift:5337; api.md:232) is
already a per-session audio-presentation setting with both properties this ask needs: it reaches
both decode routes (you pin audioTimePitchAlgorithm on the native AVPlayerItem and on the
software path's renderer, Audio/AudioRatePolicy.swift:25/:29), it belongs to the item, and it
holds across the rebuilds a session makes on its own (reload at position, audio-track switch,
AirPlay LAN swap, background return). An audio offset is the second parameter of that same
contract.

The ask (one). A session-preserving audio offset setter — setAudioDelay(seconds:) with
setRate's semantics (or, as the alternative spelling, a LoadOptions.audioDelaySeconds that a
reload-with-options, #460, could carry, replayed the way #364's teletext page is) — positive
meaning audio is presented later relative to video, honoured on the routes that hold the
timestamps, .loopback and .software ($videoRoute, api.md:263), the two our sessions take.
We are deliberately not asking for it on .remoteBypass: you never hold those timestamps, so a
logged no-op there in selectAudioTrack's style (api.md:297) is the honest answer. Scope: the
audio axis only — our cue painter owns subtitle presentation, so we are not asking for a
subtitle twin.

What we have not measured. No engine defect is involved; this is a capability request,
tagged as removal groundwork. We can measure delivered offset on the bench (an HDMI capture of
a lip-sync test pattern) if you want a verification recipe attached.

Filed as groundwork for the removal of our second engine — the fourth ask beside #460/#461/#462, filed separately so it can move on its own.

Activity

  1. superuser404notfound commented on Sep 2, 2026

    @superuser404notfound
    Owner

    Shipped in 6.66.0.

    setAudioDelay(_:) with setRate's contract, plus LoadOptions.audioDelaySeconds as the load-time spelling, so both halves of the ask are there and reloadAtCurrentPosition(applying:) from #460 can correct it like any other tuning field. Positive presents audio later, clamped to +/-2 s, honoured on .loopback and .software, and a logged no-op on .remoteBypass and audio-only sessions, as you proposed.

    Your reading of the code was right on every point I could check, including the two that mattered most: that nothing on the AVFoundation surfaces takes an offset, and that the engine carried no such symbol at all. The offset is applied where you said it would have to be. Two things about WHERE exactly are worth passing back, because both are places a host-side implementation would have landed and neither fails visibly.

    The software path. The obvious site is the decoded sample's stamp, and it is wrong three times over. That buffer is the one the #95 audio tap mirrors, and the tap documents its sourceTime as the source axis (it feeds transcription). It is stamped by AudioClockAnchor, a gapless clock that treats anything below a 100 ms discontinuity threshold as container rounding, so a 50 ms nudge would be absorbed into its running sample count and never heard at all. And the look-ahead measures its lead off that same timestamp against the synchronizer clock. The offset now rides AudioOutput.enqueue, past all three, so only the renderer sees it.

    The loopback path. The offset goes into the muxer's audio timestamps, fixed for that muxer's life. Two offsets inside one output track are not splicable: the seam gains a gap or an overlap of exactly the change, and a change that moves audio EARLIER is clamped away entirely by the muxer's strictly-increasing-DTS guard. So a new offset is a new muxer.

    Video is never moved on either route, which is the property your subtitle work depends on: currentTime, seeking and the source axis your cue painter draws against are untouched by a nudge.

    On the cost, since this is the one place it does not behave like setRate. The media between the offset and the speaker is already committed to the previous value, so a change is brought to the playhead. On .software that is a seek to the current position. On .loopback it is #460's reload, and that was settled by measurement rather than by argument, in case you were planning the TS retimer as a fallback:

    • Seeking to the position AVPlayer already holds is a buffer hit. It plays the old-offset segments out regardless.
    • Dropping those segments under it turns the hand-over into a 6 s rebuffer.
    • Requesting the producer restart beside the seek is reported as a user scrub, which opens a second seek ticket and leaves it stalled with phase stuck at seeking.

    Replacing the item is what makes AVPlayer let go, which is the alternative spelling you offered yourself. Measured on a 30 fps H.264 + AAC fixture: about 0.3 s of held picture, position preserved 7.80 s to 7.80 s. A live session without a DVR window has no position to return to, so it keeps the value and takes it at the next seam it makes on its own rather than being denied it.

    The verification recipe, since you offered a bench capture. It is measurable without one, which may save you the HDMI rig. aetherctl serve --audio-delay <ms> parks the loopback server with the offset in its muxer; fetch init.mp4 plus one segment and read the first audio and video packet timestamps with ffprobe -show_entries packet=stream_index,pts_time. Against that fixture's own +21.8 ms alignment, a +200 ms setting reads +221.8 ms and a -150 ms setting reads -128.2 ms, with the video timestamp unchanged in every arm.

    On your own stack the engine states the delivered offset rather than the requested one, for the same reason:

    [AudioOutput] AE#464 audio delay in effect: +200 ms (sample at 3.994s delivered at 4.194s)
    [MP4SegmentMuxer] AE#464 cutting seg1+ with audio delay -150 ms (-6615 ticks @ 44100/1)
    

    Leaving this open for your trial. That completes the removal-groundwork set; thanks for the four write-ups, the code references in them made all four of these considerably faster to place.

  2. cmcpherson274 commented on Sep 2, 2026

    @cmcpherson274
    Author

    Tried on our stack at 6.66.0 (1eebae01, pinned this morning), and it does what the ask wanted on both routes — the AUDIO SYNC row that left with our libVLC rung on 2026-09-01 is back, on the engine's lever, with the same sign and step (positive = audio later, ±50 ms per press) and the clamp moved to your ±2 s.

    Measured, your recipe first (the muxer half, off the served segments). aetherctl serve --audio-delay <ms> on our live seed (h264 + aac 48 kHz), init.mp4 + seg0.mp4, first packet pts per stream via ffprobe -show_entries packet=stream_index,pts_time:

                        first video pts   first audio pts   audio − video
    --audio-delay 0        0.050056 s       0.028729 s       −21.3 ms   (the seed's own alignment)
    --audio-delay 200      0.050056 s       0.228729 s      +178.7 ms   (= −21.3 + 200)
    --audio-delay -150     0.050056 s      −0.121271 s      −171.3 ms   (= −21.3 − 150)
    [MP4SegmentMuxer] AE#464 cutting seg0+ with audio delay +200 ms (9600 ticks @ 48000/1)
    [MP4SegmentMuxer] AE#464 cutting seg0+ with audio delay -150 ms (-7200 ticks @ 48000/1)
    

    Same result on a different fixture: 48 kHz rather than your 44.1 kHz, and a seed whose own alignment is negative (−21.3 ms), so the −150 arm puts the first audio packet at a negative pts (−0.121271 s) — — a zero your arms never had to cross, since your table reads a segment 16 s in (first video pts 16.000000 s) while ours reads seg0 at 0.050056 s. The first video pts is identical across all three arms (0.050056 s in each).

    On hardware (Apple TV 4K gen 3, tvOS 26.6), the loopback route, an SDR H.264 MKV mid-play — first the wiring we measured this morning, then the one we ship now.

    Our first wiring called setAudioDelay directly and let your .loopback re-anchor run. Three stepper steps through the real ±50 ms press path inside one runloop turn (10:32:42.804–.807) started three of your reloads (#361 startup 0/8 dispatched (gen 2) .835, (gen 3) .836, (gen 4) .837), two were superseded by generation (load superseded (gen 3 -> 4); unwinding .873, (gen 2 -> 4) .881), the muxer re-cut (AE#464 cutting seg0+ with audio delay +150 ms (7200 ticks @ 48000/1) .919) and the surviving generation presented (#361 startup 8/8 presenting (gen 4) .997). Two things about that leg are worth your eyes — the first measured, the second measured at the muxer and read off the code for its cause — both ours to handle but yours to know:

    • The rebuilt host settled paused and stayed there. Our LoadOptions carry autoplay = false (the app owns transport). Your no-arg reloadAtCurrentPosition() replays those options, so the rebuilt native host reported [NativeAVPlayerHost] #2 timeControlStatus=paused reason=- t+0.00s at 10:32:42.903 and never reached playing; the producer sat in [HLSSegmentProducer] #65 backpressure PARK (advance) … (consumer paused; wedge detection suspended) from 12 s to 52 s while we kept reporting progress. Every wrapper-owned load path of ours pairs its load with play(); this one was yours, so nothing did. A host with autoplay = false gets a frozen picture with no error from a mid-play nudge on this route — worth a line in the docs beside the line that says a .loopback change is the session-preserving reload, or carrying the transport state across the re-anchor.
    • The re-cut started from segment 0. The surviving generation cut seg0+ although the nudge came 15 s into the title (the rig presses at +15 s; on the fixed build the same leg’s reload snapshots startPos=15.30s). Read off the code rather than measured: the reload snapshots currentTime (AetherEngine.swift:4178) and a load() already in flight has reset that clock to 0 (:3137), so a reload stacked behind another one takes 0 as its position.

    So the shipped path now routes a .loopback nudge through reloadAtCurrentPosition(applying:) (#460) with audioDelaySeconds as the corrected field — the same engine rebuild, but our wrapper owns the resume and coalesces presses — and keeps your direct setter for .software. Same three steps on the same title, the shipped build:

    09-02 12:22:40.638  [Aether] option correction → audio delay 150 ms — session-preserving reload (#460)
    09-02 12:22:40.640  [AetherEngine] #460: reload applying audioDelaySeconds
    09-02 12:22:40.716  [NativeAVPlayerHost] #2 timeControlStatus=paused reason=- t+0.00s
    09-02 12:22:40.717  [Aether] option correction done (audio delay 150 ms) — subtitle session + audio pick carried by the engine
    09-02 12:22:40.732  [MP4SegmentMuxer] AE#464 cutting seg2+ with audio delay +150 ms (7200 ticks @ 48000/1)
    09-02 12:22:40.872  [AetherEngine] #361 startup 8/8 presenting (gen 2)
    09-02 12:22:40.909  [NativeAVPlayerHost] #2 timeControlStatus=playing reason=- t+0.19s
    

    One correction for the three steps (the latest value wins), the muxer re-cut 94 ms after the correction call, presenting at 234 ms, playing at 271 ms, seg2+ — the playhead kept. The #460 spelling of #464 is therefore our product path on .loopback, and it works exactly as your ReloadWithOptions docs say it should.

    The software route (simulator), same stepper, 150 ms in three steps (the shipped build): [Aether] audio delay → 50 ms (engine axis, route software), then → 100 ms and → 150 ms — three lines, each with your AE#464: audio delay = +N ms on the software path beside it, all at 12:26:08.439 → [AudioOutput] AE#464 audio delay in effect: +150 ms (sample at 16.427s delivered at 16.577s) at .440 → the re-anchor seek [Aether] seek #3 landed rendered=12.38 at .510 (our seek sink prints it uncaused, which we now expect). The clamp: 2500 ms asked → our control stops at 2000 → in effect: +2000 ms (sample at 12.032s delivered at 14.032s) (12:27:25.719); your out-of-range line never fires because the host clamps first. And the value survives a fresh install the way the release note says it survives the engine's own rebuilds: after a hard engine stop (our fault rig) and the recovery re-install, in effect: +100 ms (sample at 24.043s delivered at 24.143s) 91 ms after Aether in-place recovery 1/3 (12:29:09.892 → .983) — we carry it in LoadOptions.audioDelaySeconds on every load as well as through the setter, because a fresh load() replaces the options wholesale. The #460 spelling on this route: #460: reload applying audioDelaySeconds 12:30:03.046 → in effect: +120 ms (sample at 18.027s delivered at 18.147s) .187.

    Two more things read off the code that you may want to look at — we have not measured them, on purpose, because on our stack the first would rewind a live session:

    1. The live re-anchor gate does not implement its own docstring. reanchorForAudioDelay passes hasLiveWindow: liveWindow != nil (AetherEngine+AudioDelay.swift:116, :133-139), but liveWindow is constructed non-nil for every live load (AetherEngine.swift:3131-3133); windowSeconds is what carries the distinction — LiveWindow's own doc reads "windowSeconds == nil = live-only (no rewind)" (Video/LiveWindow.swift:4), and the engine's seek path discriminates on exactly that (AetherEngine.swift:4249-4260 → AetherEngine+Live.swift:438-441). So the docstring's own branch — "Live without a DVR window has no position to return to, so the value simply stands from the next seam the session makes on its own" (:105-109) — is unreachable for a host that loads live with dvrWindowSeconds nil, our exact configuration (the one the AE#446 round-4 comment at AetherEngine.swift:4245-4248 names): a live .loopback session takes the reload, and a live .software session issues a seek(origin: .host) that the engine then rejects as liveWithoutDVR. Suggested: hasLiveWindow: liveWindow?.windowSeconds != nil.
    2. The custom-source case has no refusal on this path. On .loopback the re-anchor is the no-arg reloadAtCurrentPosition() (AetherEngine+AudioDelay.swift:101), which consults no refusal at all: on a custom source it rebuilds the session on the RETAINED reader whenever that reader reported itself seekable (AetherEngine.swift:4161-4176). Our live-rewind spool reader does report seekable, so sessionReloadRefusal is nil for it and A session-preserving reload that can change one LoadOption (reload(withOptions:) or per-setting setters) #460's own guard would not catch this shape either — the refusal has to be ours. So we do not offer the control on live at all (hidden, not disabled), and the wrapper refuses setAudioDelay on the spool arm by construction. Same family as the note in the A per-session native→software decode escape for the formats VTCapabilityProbe deliberately cannot classify #461 reply; no separate issue.

    Minor, for completeness: setAudioDelay returns Void and try?-swallows the reload, and audioDelaySeconds is not @Published, so a host mirrors the value itself — fine for us (the setter is idempotent and the stepper owns the number). The ±2 s bound is what our stepper clamps to now. We never reach the .remoteBypass no-op — the row is hidden on that route — so that half is read, not run. Thank you — this closes the last of the four.

  3. superuser404notfound commented on Sep 3, 2026

    @superuser404notfound
    Owner

    Round 2 is on main in 25849dd9, unreleased. All four go in, and two of them turned out not to be about the audio delay at all.

    Your measurement first. The seg0 arm is a better reading of the muxer than mine was. Mine read a segment 16 s in, so the negative arm never had to cross zero; yours does, at -0.121271 s, on a seed whose own alignment is already negative, with the first video pts identical in all three arms. That pair, a negative first audio pts and an untouched video one, is the property the whole design rests on, and I had not actually shown it.

    The rebuilt host settled paused. Taken, and not as a doc line. reloadAtCurrentPosition was replaying LoadOptions.autoplay, and that flag describes the FIRST mount, not the session, so this was never really about the audio delay: every rebuild the engine raises on its own had it. The AirPlay LAN swap is the sharp one, because it fires from a route-change notification and there is no host call anywhere near it to pair a play() with. A #460 correction had it too. The rate a host set already survived these rebuilds (#436); the play/pause did not.

    The rebuild now comes back in the state the session is in, read from the native host's durable transport intent (#122) rather than from state, so one raised mid-scrub does not come back paused. One carve-out: a resume after a background teardown has no transport left to read and is the host's call, so that path replays the mount flag exactly as before.

    Reproduced on macOS, which the CLI could not do before it learned --paused (mount with autoplay = false) and --host-calls play (the host playing next to its own load). Before, on a 300 s H.264 + AAC fixture, nudged at t=14.80 s of a 32 s run:

    [NativeAVPlayerHost] #2 timeControlStatus=paused reason=- t+0.00s     <- the last one it ever logged
    [HLSSegmentProducer] #65 backpressure PARK (advance) head=15 target=5 ... (consumer paused; wedge detection suspended)
    VERDICT: OK
    

    After: [NativeAVPlayerHost] #2 timeControlStatus=playing reason=- t+0.06s.

    The VERDICT: OK is worth a second of attention. That is your "no error" in one line: the harness whose entire job is to catch this called it a clean run.

    One consequence for a host: autoplay is not correctable through reloadAtCurrentPosition(applying:) any more, since the rebuild takes the session's transport state over it. Your shipped wrapper owns the resume itself, so nothing moves for you; the direct setter has just stopped being a trap for whoever wires it next.

    The re-cut started from segment 0. Your read off the code is right, and it measures. reloadAtCurrentPosition snapshots currentTime; load zeroes that clock at its start, before the session it is building has anything to put there; a reload stacked behind one still in flight therefore reads the zero. The custom-source branch had the same line (resumeAt = resumeOverride ?? currentTime). The position each load was handed is parked across that window now and read back while a load is in flight, so the honest answer is available exactly when the clock is not.

    Three presses in one runloop turn, before:

    #361 startup 0/8 dispatched (gen 2), (gen 3), (gen 4)
    load superseded (gen 2 -> 4); (gen 3 -> 4)
    [NativeAVPlayerHost] #2 load ... startPos=nil
    [MP4SegmentMuxer] AE#464 cutting seg0+ with audio delay +150 ms (7200 ticks @ 48000/1)
    

    After, the same three presses: startPos=14.90s, [HLSVideoEngine] initial producer anchored at idx=3 (startPosition=14.90s), cutting seg3+.

    The live re-anchor gate. Correct on every point, and liveWindow?.windowSeconds != nil is what it needed. I took the shape one step further and handed the gate the window itself rather than a Bool, because the derivation was the defect and a parameter a call site cannot compute is a parameter it cannot get wrong.

    The part worth passing back is how it survived: that rule WAS tested, and one of the cases is named "live without a DVR window has no position to come back to". It passes, before and after. A pure gate exercised only through its own parameters is proof of the rule and says nothing about the argument, and the argument is where these die. The new cases pass LiveWindow(windowSeconds: nil), the shape load actually builds, and one of them just asserts the gate and liveSeekRefusedWithoutDVR agree across all three window shapes, since the software route's re-anchor is a seek(origin: .host) and a gate that admits what seek then refuses costs a teardown to change nothing.

    Measured both ways, since your stack could not risk it:

    • play --live with no DVR window, before: cutting seg0+, the full rebuild, on a session 69 s in. After: AE#464: audio delay = +150 ms stands, but this session cannot re-anchor at the playhead (state=playing, live=true); it arrives at the next seam.
    • play --live --dvr-window 1800: re-anchors and re-cuts in both arms, so the gate got correct rather than merely stricter.

    The custom-source case. Confirmed, and the refusal is asked for on that path now: the .loopback re-anchor reads sessionReloadRefusal before the teardown and states the outcome after it, instead of try? underneath a line that had already announced the re-cut.

    What that does not do is catch your spool, and I would rather say so than let the fix imply otherwise. A reader that reports itself seekable is reloadable by that check, which is the right answer for readers in general and the wrong one for a live rewind spool. What does catch it now is the window gate above: your sessions load with dvrWindowSeconds nil, so the re-anchor is refused before the reader is consulted at all. Keep the wrapper refusal, it is simply no longer the only thing between that spool and a rewind.

    Minor. The try? is gone as above. On the software re-anchor printing in your seek sink uncaused: it publishes SeekEvent.Origin.programmatic, which is accurate (a seek the engine issued, not a scrub), and I am not adding a case to a public enum to say audioDelayReanchor when .programmatic already excludes the only thing a host would act differently on. audioDelaySeconds stays unpublished by decision rather than by omission: it is a computed read off loadedOptions, which is not published either, and nothing inside the engine moves it, so a host that set it is holding the newer value by construction. If you would rather observe it, say so and I will publish it properly at the loadedOptions level instead of bolting on a second source of truth.

    Still open for your trial. Thanks for the two you read off the code and deliberately did not run; the first of them was worth considerably more than the nudge it was found under.

  4. superuser404notfound commented on Sep 3, 2026

    @superuser404notfound
    Owner

    Round 2 (7cd9face, merged as 25849dd9) is released in 6.67.0. Both consumers are pinned to it.

  5. cmcpherson274 commented on Sep 12, 2026

    @cmcpherson274
    Author

    Trialled at 6.81.0 (c7e7adb5) on both routes, on the build carrying our new pin — Office2 (Apple TV 4K gen 3, tvOS 26.6 / 23L773) for loopback, the tvOS simulator for software. Round 2 holds. None of the four fixes is attributable from our shipped press path, and I say so rather than let four green legs imply otherwise: two run on it but are masked or never reached, one runs on it and can only answer yes, and one lives inside setAudioDelay's .loopback branch, which we do not take.

    The loopback route, the September leg re-run

    First Do No Harm (avc1 1080p + aac 48 kHz, Direct Play), three ±50 ms stepper presses in one runloop turn at +15 s after the lock:

    09-12 09:03:28.589  [Aether] option correction → audio delay 150 ms — session-preserving reload (#460)
    09-12 09:03:28.593  [AetherEngine] #460: reload applying audioDelaySeconds
    09-12 09:03:28.646  [HLSVideoEngine] initial producer anchored at idx=2 (startPosition=15.30s)
    09-12 09:03:28.648  [NativeAVPlayerHost] #2 load url=… startPos=15.30s headers=none
    09-12 09:03:28.651  [Aether] option correction done (audio delay 150 ms) — subtitle session + audio pick carried by the engine
    09-12 09:03:28.657  [MP4SegmentMuxer] AE#464 cutting seg2+ with audio delay +150 ms (7200 ticks @ 48000/1)
    09-12 09:03:28.802  [AetherEngine] #361 startup 8/8 presenting (gen 2)
    09-12 09:03:28.851  [NativeAVPlayerHost] #2 timeControlStatus=playing reason=- t+0.20s
    
    6.66.0 (2026-09-02) 6.81.0 (today)
    correction → muxer re-cut 94 ms 68 ms
    → presenting 234 ms 213 ms
    → playing 271 ms 262 ms
    corrections for three presses 1 1
    segment seg2+ seg2+
    load superseded lines 0 0

    One run per column, ten days apart on the same box: the arc is intact and no slower. I am not attributing the 9–26 ms to the bump.

    From a 300 s resume the same press cuts seg52+ (startPos=312.80s), playing at t+0.18s: 60 / 182 / 230 ms. The #460 primitive driven directly with audioDelaySeconds = -120 ms: AE#464 cutting seg2+ with audio delay -120 ms (-5760 ticks @ 48000/1), 78 ms after the correction. We remember the value per Apple TV now, so a launch with no delay rig at all cuts 09-12 09:15:52.432 [MP4SegmentMuxer] AE#464 cutting seg0+ with audio delay +150 ms out of LoadOptions.audioDelaySeconds.

    The software route (simulator)

    Three steps in one turn: [Aether] audio delay → 50 ms (engine axis, route software), then → 100 ms and → 150 ms — three lines, each with your AE#464: audio delay = +N ms on the software path beside it (byte-identical at both tags) → [AudioOutput] AE#464 audio delay in effect: +150 ms (sample at 10.091s delivered at 10.241s), the re-anchor printing in our seek sink as [Aether] seek #3 landed rendered=12.39 (.programmatic, as you decided — our sink does not print the origin).

    Clamp: 2500 ms asked, our stepper stops at the ±2 s bound we mirror from your AudioDelayPolicy.maxAbsSeconds (Audio/AudioDelayPolicy.swift:34, byte-identical across the span) → applied 2000ms (asked 2500) → in effect: +2000 ms (sample at 10.091s delivered at 12.091s); your out-of-range line never fires, because the host clamps first (0 hits in the slice). Across a hard engine stop and our recovery re-install: in effect: +100 ms (sample at 24.043s delivered at 24.143s), 90 ms after Aether in-place recovery 1/3 (91 ms at 6.66.0). #460 here: reload applying audioDelaySeconds → in effect: +120 ms, 126 ms (141 ms at 6.66.0).

    Two things we are keeping

    The #460 routing of the loopback press. Your direct setter still has no in-flight latch (AetherEngine+AudioDelay.swift:100 into :143-156; reloadAtCurrentPosition() at AetherEngine.swift:4514 takes no guard either), so three presses should still raise three reloads — code-read at 6.81.0; the three-generation, two-superseded version is the 6.66.0 pre-fix leg. The parked position means a stacked one rebuilds at the playhead instead of seg0, which fixes the damage but not the work. Our path also owns three things yours cannot hand us: the in-flight latch our start-patience liveness predicate reads, the install-generation fence, and the guard keeping a correction and an install from racing.

    The live hide — for a product reason now. Your gate is right at AetherEngine+AudioDelay.swift:169-178 (!isLive || liveWindow?.windowSeconds != nil) and our loads do present nil: dvrWindowSeconds is deliberately unset, and AetherEngine.swift:3368-3370 builds the window off it on the custom-source branch too — we are not nativeRemoteHLS, so nothing substitutes the unbounded window. The fallback you made reachable is therefore reachable here — but on our live arm "the next seam" is a re-tune, so a visible row would do nothing a viewer can see. The justification our code carried (your gate tests liveWindow != nil, fallback unreachable) is false at 6.81.0 and has been rewritten, not quietly left.

    Read, not measured

    • The parked position is unexercised here. Our coalescing removes the stack before the engine sees it — one correction for three presses on both device legs — and rebuildPosition returns the parked value only while state == .loading (AetherEngine.swift:2309), so startPos=15.30s is the ordinary clock snapshot. Code-read at :3375 / :4569.
    • The transport-intent resume we cannot attribute. :4525 does run on our path, but our epilogue calls play() unless the viewer paused, so playing t+0.20s is belt-and-braces. On the paused branch the host stays paused at both tags — yours by intent (:4525 / :2979), ours by the replayed autoplay = false before it. Both code traces; we have no paused-nudge leg.
    • autoplay is silently overridden, not refused. Still in knownFields (AetherEngine+ReloadWithOptions.swift:283), absent from loadIdentityFields (:178-184): accepted, printed inside your #460: reload applying … line, then overwritten at :4525. You said as much here; worth a doc word too, since the two read very differently in a log.
    • The live refusal line is unreachable from our product path. The wrapper stands the control down before the engine is asked (App/AetherPlayerEngine.swift:190-193, off our Core stand-down table — ambient surface, spool arm, live, and the routes you answer .unavailable for), so a live leg produces only our own QA: JF_TUNE_TEST audio=100 stood down — no AUDIO SYNC control on this session …; nothing applied.
    • The moved loopback string is one our build cannot emit — single emitter inside setAudioDelay (AetherEngine+AudioDelay.swift:96-99), which we never reach. Not your problem, but it caught three places across two of our QA suites listing it as an expected line of the shipped press; they are on this session's docs list, to be deleted rather than re-spelled.

    Reading your round-2 resume against our epilogue turned up a defect of ours that predates the bump: our rate re-assertion wrote a non-zero rate onto a paused AVPlayer, so a title paused at 1.5× resumed under the viewer on any rebuild re-asserting the speed. Deferred to the resume now; nothing to do with #464. audioDelaySeconds unpublished suits us — we hold the newer value by construction and the stepper owns the number, so there is nothing here worth a second source of truth.

    Open on our side: nothing on #464. The live refusal and the parked position stay code readings — the first until we build a rig that lets the nudge reach the engine on a live session, which we have not; the second for as long as we coalesce. Say the word if you want the raw slices.

  6. superuser404notfound commented on Sep 12, 2026

    @superuser404notfound
    Owner

    Round 3 is on main in f749553b, unreleased. Both things you left here go in, and the second one turned out to be round 2's own defect re-entered through the door round 2 did not close.

    The doc word, and the half that was actually missing. docs/api.md has said it since round 2, in two places: "autoplay is the one listed field this cannot change" at the correction's own section, and "correcting it through reloadAtCurrentPosition(applying:) therefore does nothing; call play() or pause() instead" in the LoadOptions table. So the docs were not the gap. The log was, and the log is what a host reads while its correction is happening, which is your point rather than mine to concede: the two read very differently there. autoplay is a third category now (sessionOwnedFields, neither refused nor applied), it is not named in the applied line, and it gets its own:

    [AetherEngine] #460: reload applying httpHeaders
    [AetherEngine] #460: autoplay not applied, the session owns it: the rebuild comes back in the
    transport state the session is in, not the one a mount was given (AE#464 round 2). Call play() /
    pause() to change it
    

    A correction that changes nothing else now prints that line alone rather than "no option change (session already on these options)", which would have been the third way to be wrong about the same field. The one rebuild that DOES apply the flag, the resume after a background teardown (#357), still names it as applied, because there it is.

    The in-flight latch, and the two lines you did not see. Your code-read is right, and driving it turned up more than the duplicated work. Three presses in one runloop turn, at 6.82.0, on a 300 s H.264 + AAC fixture:

    loads dispatched: 4        (the initial one plus three re-anchors)
    superseded:       2
    [AetherEngine] AE#464: the re-cut at the playhead failed (CancellationError()); the audio delay
    +50 ms stands and arrives at the next seam
    [AetherEngine] AE#464: the re-cut at the playhead failed (CancellationError()); the audio delay
    +100 ms stands and arrives at the next seam
    [MP4SegmentMuxer] AE#464 cutting seg3+ with audio delay +150 ms (7200 ticks @ 48000/1)
    

    Those two lines are round 2's honesty work turning against itself. The catch that replaced the try? cannot tell a rebuild that FAILED from one that was superseded, so it reported a failure that did not happen, and it named the value each losing generation had been started with, both of which were already stale by the time the line was written. A host reading its own log was told twice that the nudge it was in the middle of delivering had not arrived. CancellationError is its own branch now and says what it is: the load that took this one's place reads the offset from loadedOptions, so the value in force is the value it cuts with.

    The latch itself folds presses that arrive during a re-anchor into it. That is safe for the reason your wrapper relies on too: the value does not ride the call. Every press writes loadedOptions.audioDelaySeconds synchronously before the re-anchor runs and both routes read the offset from there when they rebuild, so a re-anchor that has not reached its rebuild yet already carries the newest value. Only a press landing after the rebuild has read it needs anything more, and that is one catch-up pass, which ends as soon as what was delivered is what is in force. A stepper held down converges on one rebuild instead of queueing one per press. The same three presses after:

    loads dispatched: 2
    superseded:       0
    [AetherEngine] AE#464: audio delay = +100 ms folded into the re-anchor already in flight; that
    rebuild delivers it
    [AetherEngine] AE#464: audio delay = +150 ms folded into the re-anchor already in flight; that
    rebuild delivers it
    [MP4SegmentMuxer] AE#464 cutting seg3+ with audio delay +150 ms (7200 ticks @ 48000/1)
    

    Same segment, same offset, a third of the work. Your #460 routing and your coalescing are still the better product path for the three things you named that the engine cannot hand you; the direct setter has simply stopped being worse than it had to be for whoever wires it next.

    What the same leg was also doing, which is the part worth your eyes. Read the clock across those three presses before the fix:

    t=14 state=playing phase=playing cur=14.00
    t=15 state=paused  phase=paused  cur=14.90
    t=19 state=paused  phase=paused  cur=14.78
    VERDICT: OK
    

    The session stopped and stayed stopped, on a build carrying round 2's resume. A rebuild stacked behind one still in flight has no transport to read, for exactly the reason it has no clock to read: state is .loading for the load in flight, and the native host whose durable #122 intent would be asked is the one that load is replacing. So both readings answer "paused" about a session that is playing, the surviving generation mounts paused, and nothing is left to call play(). Round 2 parked the position for this window and did not park the transport, which is the whole of the bug. It is parked now, same shape, same window, and the terminal-state rule is unchanged outside it. Your shipped path never saw this because your coalescing removes the stack before the engine sees it, and your epilogue calls play() anyway, which is the second time this round that the belt-and-braces you flagged as unattributable was the only thing standing between a defect and a viewer.

    One more of the same kind, which is what I think the sentence of this round is. A press that lands while the session is being rebuilt read videoRoute == .none and answered the .unavailable branch:

    [AetherEngine] AE#464: audio delay = +150 ms, kept for the next load: this session's audio
    timestamps are not the engine's to move (route=none)
    [MP4SegmentMuxer] AE#464 cutting seg3+ with audio delay +150 ms (7200 ticks @ 48000/1)
    

    One line telling a host its route cannot carry an offset, directly above the muxer carrying it. .none at teardown is the ABSENCE of a route to ask, not a route that cannot move timestamps, and the value was always delivered; only the claim was wrong. It now says the load in flight reads it from the options and delivers it. Position, transport, route: three facts about a session, all read mid-rebuild, all answered by something that was not the session. That is one rule rather than three bugs, and round 2 found the first of them.

    The harness could not reproduce its own recipe, which is worth passing on. --switch-audio-delay ran one task per press, so the round-2 recipe (three presses three milliseconds apart) put a 50/100/150 series on the wire as 100, 150, 50 on one run. The engine delivered 50, correctly, and the arm read as a defect that was the harness. Presses sharing a delay are delivered by one task in argument order now, with no await between them, which is what "inside one runloop turn" means; different delays stay ordered by time. Anything measured through that flag before today, on either side, is worth a second look for ordering. --reload-applying autoplay= is new and drives the third answer end to end, so the field's behaviour is observable rather than code-read.

    Read, not measured, and one I could not stand up. On one intermediate build a second re-anchor landing right after the first one mounted took startPos from a clock still reading its segment's start, and the session lost about two seconds. I could not reproduce it on the merged build, 3 of 3 at 120, 150 and 180 ms after the first press, which is the window it would have to live in. Putting it here as an observation rather than a finding, in case it is ever the shape of something on real hardware.

    Still open for your trial. The two you read off the code and deliberately did not run were, again, worth more than the presses they were found under: the autoplay one moved a log line, and looking for the leg that would prove it is what put the paused session on the screen.

  7. superuser404notfound commented on Sep 12, 2026

    @superuser404notfound
    Owner

    Round 3 is released in 6.83.0 (0762be3e): the press folding, the parked transport intent behind a stacked rebuild, the autoplay line, and the route=none line.

  8. cmcpherson274 commented on Sep 18, 2026

    @cmcpherson274
    Author

    Trialled at 7.1.3 (13a86172), the pin we are landing, on both routes — Office2 (Apple TV 4K gen 3, tvOS 26.6 / 23L773) for .loopback, the tvOS simulator for .software. Three releases have landed since these legs ran (7.2.0, 7.3.0 and 7.4.0); no figure below is from any of them. Three of the four round-3 items are answered below; the fourth we did not reach, and I say which rather than fill the gap.

    A retraction first. We closed autoplay with "worth a doc word too, since the two read very differently in a log". The second half stands — you made the same point back. The first half was wrong at the pin we said it at: docs/api.md at 6.81.0 already carried it in both places you name — :149 ("autoplay is the one listed field this cannot change") and the LoadOptions table at :749 ("Correcting it through reloadAtCurrentPosition(applying:) therefore does nothing; call play() or pause() instead"). The docs were not the gap; the log was, and you had already said so. Struck.

    (a) The fold — measured, on the one press path of ours that reaches setAudioDelay

    First Do No Harm (h264 1080p + aac 48 kHz, Direct Play), our AUDIO SYNC stepper driven ±50 ms per press inside one runloop turn. Same fixture, same rig, three pins. The 37-press arm (audio=2500, the container carrying +150 in, so 37 effective steps to the ±2 s clamp):

    audiosync-clamp, 37 presses 6.81.0 7.1.0 7.1.3
    seek#N programmatic began 37 1 1
    … superseded 36 0 0
    … landed 1 1 1
    AE#464: … on the software path 37 37 37
    AE#464: … folded into the re-anchor … 0 36 36
    applied 2000ms (asked 2500) → in effect 59 ms 59 ms 58 ms
    delivered +2000 ms (sample at 10.091s delivered at 12.091s) identical identical

    The fold does not replace the entry line: all 37 presses log on the software path, and presses 2…37 add the fold line beside it, 0–1 ms later. Press 1, press 2 and press 37, pairs kept whole:

    09-17 13:12:41.519  [AetherEngine] AE#464: audio delay = +200 ms on the software path
    09-17 13:12:41.521  [AetherEngine] AE#464: audio delay = +250 ms on the software path
    09-17 13:12:41.521  [AetherEngine] AE#464: audio delay = +250 ms folded into the re-anchor already in flight; that rebuild delivers it
           …                           34 more pairs, +300 through +1950
    09-17 13:12:41.543  [AetherEngine] AE#464: audio delay = +2000 ms on the software path
    09-17 13:12:41.543  [AetherEngine] AE#464: audio delay = +2000 ms folded into the re-anchor already in flight; that rebuild delivers it
    09-17 13:12:41.543  QA: JF_TUNE_TEST audio delay applied 2000ms (asked 2500)
    09-17 13:12:41.551  [AetherEngine] seek#1 programmatic began target=12.38
    09-17 13:12:41.600  [AetherEngine] seek#1 programmatic landed rendered=12.38 target=12.38
    09-17 13:12:41.601  [AudioOutput] AE#464 audio delay in effect: +2000 ms (sample at 10.091s delivered at 12.091s)
    

    The three-press arm is the same shape at small scale: 3 / 2 / 1 seeks at 6.81.0 against 1 / 0 / 1 with two folded lines at both new pins, delivered − sample = +150 ms at all three. Your 4→2 loads and 2→0 superseded read on our route as 37 engine seeks becoming one, and the one delivers the last value asked for.

    Two readings off the same slice. The latch, not the Task, is what catches a burst — the whole 37-press burst lands in 24 ms and the re-anchor's seek does not begin until 8 ms after the last of them, so presses 2…37 are folded by a flag set synchronously at press 1 rather than by anything the Task has done yet. The catch-up pass therefore never runs here, and correctly: the log shows exactly one seek, and +AudioDelay.swift:205-207 says why — by the time the Task reads delivered the burst is over and it is already 2.0, so isChange is false. The catch-up is for human cadence, and we do have the instrument for that on this route — the stepper takes an optional per-step sleep (audiostep=<ms>) — but no leg here passed it, so that arm is owed rather than run.

    One string note for anyone grepping across the bump. The prefix AE#464: audio delay now matches 73 lines in that slice — 37 on the software path plus 36 folded. The full on the software path sentence itself does not move (37 at all three pins), so a count bound to it stays honest across the bump and a count bound to the prefix alone does not.

    (b) The parked transport intent — a negative control here, exactly as you called it

    "Your shipped path never saw this because your coalescing removes the stack before the engine sees it, and your epilogue calls play() anyway …" Confirmed at 7.1.3 rather than assumed: the same three presses on Office2 produce one correction, zero load superseded, zero folded (our loopback press never calls setAudioDelay), and the arc is the one we posted at 6.66.0 and again at 6.81.0, unmoved — selected lines:

    09-17 14:56:38.561  [Aether] option correction → audio delay 150 ms — session-preserving reload (#460)
    09-17 14:56:38.563  [AetherEngine] #460: reload applying audioDelaySeconds
    09-17 14:56:38.622  [Aether] option correction done (audio delay 150 ms) — subtitle session + audio pick carried by the engine
    09-17 14:56:38.628  [MP4SegmentMuxer] AE#464 cutting seg2+ with audio delay +150 ms (7200 ticks @ 48000/1)
    09-17 14:56:38.761  [AetherEngine] #361 startup 8/8 presenting (gen 2)
    09-17 14:56:38.795  [NativeAVPlayerHost] #2 timeControlStatus=playing reason=- t+0.18s
    

    From the correction: 2 / 61 / 67 / 200 / 234 ms, against 4 / 62 / 68 / 213 / 262 ms on the same leg at 6.81.0 five days earlier, seg2+ in both. No stack, so nothing to park.

    Why our host never resumes a session behind the viewer's back, which is the context for that epilogue. Two host-side guards, both measured on this build: a speed write arriving while the viewer has paused is deferred (rate write deferred → 1.5× (the viewer paused; applied on resume)), and the rate re-assertion our own #460 epilogue runs is deferred too (rate re-assert deferred → 1.5× (the viewer paused; re-applied on resume, after the option correction)); on the viewer's resume 25 s later the rate is re-asserted and your offset is in effect 3 ms after that (+150 ms (sample at 66.069s delivered at 66.219s)). On hardware, the same discipline on the transport itself — this is the audiosync-paused leg, an audio-delay=150 correction driven onto a .loopback session the viewer had paused 5.3 s earlier: it re-cut seg2+ with audio delay +150 ms and left the transport alone, the rebuilt host never reaching playing, its last transport line reading paused reason=- t+42.71s. The delay is delivered; the transport is not touched. That is if !userPaused { engine.play() }, and it is why our playing t+0.18s above is belt-and-braces rather than attribution.

    (c) autoplay not applied, the session owns it — reached, on both instruments

    We had no way to ask for it, so we added one: an autoplay=true key on the QA rig that already drives reloadAtCurrentPosition(applying:) — the same door your --reload-applying autoplay= opens. true only, deliberately: =false on a clean sitting is the no-change case, so our parser refuses that token, and on its own it arms nothing and the launch says NOT armed — a control run rather than a leg that looks like one. Simulator, .software, selected lines:

    09-17 12:01:49.615  [Aether] option correction → JF_AETHER_RELOAD_APPLY autoplay=true — session-preserving reload (#460)
    09-17 12:01:49.626  [AetherEngine] #460: autoplay not applied, the session owns it: the rebuild comes back in the transport state the session is in, not the one a mount was given (AE#464 round 2). Call play() / pause() to change it
    09-17 12:01:49.711  [Aether] option correction done (JF_AETHER_RELOAD_APPLY autoplay=true) — subtitle session + audio pick carried by the engine
    09-17 12:01:49.817  [AetherEngine] #361 startup 8/8 presenting (gen 2)
    

    11 / 96 / 202 ms from the correction, with #460: reload applying … at 0 lines and no option change at 0 lines — the line alone, as you wrote it. Office2, .loopback, same rig: 3 / 68 / 220 ms, then timeControlStatus=playing reason=- t+0.20s at 266. And the one that proves the sentence end to end, a separate leg (autoplay-owned-paused): the same correction asking autoplay=true on a session the viewer had paused 5.2 s earlier — 4 / 105 / 212 ms, and the rebuilt host never reached playing, its last transport line reading paused reason=- t+42.72s. Asking for autoplay=true on a paused session did nothing to the transport.

    One design observation, offered plainly because I may be missing the intent. A host cannot tell the third category from the first by anything except your log. reloadAtCurrentPosition(applying:) returns Void and throws only for refusals raised before any teardown (+ReloadWithOptions.swift:60-104) or for whatever the load itself throws; a session-owned field is neither refused nor applied, so the call runs applySessionOptionCorrection and the rebuild to completion (:138-139) and returns normally. Our wrapper returned true and logged its own done in every one of these legs — a correction that changed nothing, reported as done, having paid a full session rebuild (gen 2 at 202 ms on the sim, 220 ms and a second NativeAVPlayerHost on the device). Both halves may well be intended: the rebuild is the documented contract of the no-arg call, and stating the no-op in the log is exactly what you did for no option change. But if a host is meant to act on the third category, today it has to parse a log line to find out. Would the partition deserve a shape in the API — a returned (applied, sessionOwned), or a short-circuit when every changed field is session-owned, so the teardown is not spent on a field the rebuild decides for itself?

    (d) The route=none line — not reached at either pin, and we could not manufacture it

    The fourth item you named is the route=none line; what replaces it for the rebuild window is set while the session is being rebuilt. Zero occurrences of either, across every log this campaign produced, sim and device, current and superseded slices — and zero for re-cut at the playhead in any of its forms and for cannot re-anchor at the playhead. The before-half reads the same: the old sentence (kept for the next load: this session's audio timestamps are not the engine's to move (route=none)) is absent from our 6.81.0 slices too, so we never reached that window under the old code either. 681 run slices across three campaigns and every engine pin in them, nil throughout — which makes this a measurement rather than an inference.

    The cause is structural on both of our paths rather than a gap in the legs. On .software the re-anchor is a seek (+AudioDelay.swift:88-97), so there is no .loading window for a press to land in: your +AudioDelay.swift:70-77 guard is evaluated on that route — each of the 37 on the software path lines above sits downstream of it — and all 37 passed it. On .loopback our press never calls setAudioDelay at all: applyAudioDelayIfNeeded sends that route to our own #460 correction (App/AetherPlayerEngine.swift:218-222), so there the guard is never reached, whatever the press timing.

    One clarification, since we mention a new rig elsewhere: the per-step delay we added to the stepper (audiostep=<ms>) is not an instrument for this. It exists to time a press against our own loopback catch-up pass — the window of the second re-anchor you could not reproduce on the merged build, 120 to 180 ms after the first press — and no value of it can reach your line, for the two reasons above. Its own device leg is owed; when it runs it speaks to that observation, not this one.

    On ordering, since you asked for a second look at anything measured through that flag: these legs used --switch-audio-delay nowhere at all, and our own stepper issues its presses from one loop in argument order (App/PlayerView.swift:8554-8558) — its only await is that optional per-step sleep at :8555, which no leg here passed — so the series cannot be reordered on our side either.

    Nothing open on our side beyond the question in (c) and the legs owed in (a) and (d). Raw slices on request, as before.

  9. superuser404notfound commented on Sep 18, 2026

    @superuser404notfound
    Owner

    Round 4 is the answer to your question in (c), and it is both halves of it: the partition is returned rather than logged at, and a correction the session decides for itself no longer buys a teardown. Merged to main in 87710cd6, not released yet.

    reloadAtCurrentPosition(applying:) now returns a SessionOptionCorrectionOutcome (applied, sessionOwned, rebuilt), @discardableResult so no call site moves, and when every changed field is session-owned it returns before any teardown. Your reading was the right one: the call ran applySessionOptionCorrection and the full rebuild to completion for a field the rebuild decides for itself, so a host had to parse a diagnostic to learn what its own call had done, and paid a visible restart for the privilege.

    Measured on the same instrument you would use, play --reload-applying autoplay=false --reload-applying-at 8000 against a 120 s H.264 + AAC fixture, three runs per arm. Before (7.4.1, 3a001446) and after (87710cd6, the merged fix), same seam:

    at the correction 7.4.1 87710cd6
    #361 startup 8/8 presenting (gen 2) 3 of 3 0 of 3
    tick after the correction t=08 cur=7.90 (0.80 s of clock in 1 s, telemetry fields reset) t=08 cur=8.10 (1.10 s, line unbroken)
    what the call reported #460 correction applied #460 outcome applied=[] sessionOwned=[autoplay] rebuilt=false

    Before, the run rebuilds and the session comes back a second behind where it was going; after, there is no gen 2 in the log at all and the clock steps straight through.

    One decision inside it that is worth stating, because it went the opposite way from my first draft. The short circuit installs nothing. A rebuild writes the session's own transport over the mount flag before it replays the options (setLoadedAutoplay(sessionRebuildResumesPlaying)), so an autoplay correction has never outlived the call; installing it on the short-circuit path alone would have made the same field mean one thing travelling by itself and another with a header riding along. So the session keeps its value on both paths, which is what the docs have said since round 2. The one rebuild that does read the mount flag, the resume after a background teardown (#357), partitions the field as applied and never reaches the short circuit.

    The no-change case is deliberately left alone: --reload-applying autoplay=true on a session already mounted that way changes nothing, so it still rebuilds and reports applied=[] sessionOwned=[] rebuilt=true. A no-arg reloadAtCurrentPosition() is a documented way to ask for the rebuild itself, and a correction that turns out to be a no-op is the same ask.

    On (d), that is a measurement and I am taking it as one. 681 run slices with nil throughout, plus the structural reason on both routes, is a better answer than a leg that happened not to fire. The line is exercised from the engine side (--reload-applying-at aimed into the rebuild window against --switch-audio-delay), so it is not unverified, it is just not verifiable from a host whose two paths both keep a press out of that window. Nothing owed on your side for it.

    On (a), the count note is worth keeping. The entry line staying beside the fold line is deliberate: every press is acknowledged where it arrives, and the fold says what became of it. A count bound to AE#464: audio delay alone therefore doubles across the bump, as you found, and the on the software path sentence is the stable one. The human-cadence arm with audiostep=<ms> is the one leg I would still like to see, since it is the only one that reaches the catch-up pass at all.

    And thank you for the retraction on autoplay. The docs were right at that pin, the log was the half that was missing, and you had already said so.

  10. superuser404notfound commented on Sep 18, 2026

    @superuser404notfound
    Owner

    Released in 7.5.0 (87710cd6). Both consumers are on the new pin, so the round 4 behaviour is in the next build from either.

  11. cmcpherson274 commented on Sep 23, 2026

    @cmcpherson274
    Author

    The audiostep= leg is run, on both routes and on hardware as well as the simulator, and it does not say what
    either of us expected — the catch-up pass is reached by a press landing inside a re-anchor, not by human
    cadence, and human cadence is the one cadence that never reaches it. Round 4 is retested on hardware on both arms.
    And two things turned up on our side of the same mechanism, which are ours and are reported here as ours.

    Pins, each measurement labelled with its own: 7.1.3 (13a86172) is the E-7 control arm, 7.7.1
    (fa67d586)
    ran on 2026-09-19 (and, for four slices of §1's census, on 2026-09-21), 7.8.1 (b89240af) is the pin on our main since 2026-09-22 and ran on 2026-09-21/22. Eight
    releases have landed since it as of this writing (7.9.0 → 7.15.0, the last tagged 2026-09-23); no measurement below
    ran on any of them. Office2 is an Apple TV 4K (3rd gen) — AppleTV14,1, tvOS 26.6 (23L773) as the box's own
    diagnostic reported it on 2026-09-19 — with our app built on Xcode 27.0 / Swift 6.4; the other instrument is the
    tvOS simulator. Engine source line numbers are at 7.8.1 except where stated.
    AetherEngine+AudioDelay.swift is byte-identical at every 7.x tag — md5 7de055d93520bb0a8217fc04fc0cb63e at
    all twenty-three of them, 7.15.0 included — so every line number this reply gives for that file holds at 7.15.0 as well as
    at our pin; AetherEngine+ReloadWithOptions.swift has moved since our pin (md5
    94a2270fc43cf460979d88127026b6c7 at 7.8.1, b52ef96843e4f899afabe40393cb8c06 at 7.15.0), so its numbers are
    7.8.1's and only 7.8.1's. Prefixes trimmed, inner clauses elided (…); the rest verbatim. Bare :N are lines
    in the named log.

    1. The audiostep= arm — three shapes, and the catch-up pass is the middle one

    Our stepper issues ±50 ms presses from one loop, with an optional sleep between them — our JF_TUNE_TEST
    audiostep= loop; we cite our own code by name rather than by line, our own branches disagreeing about the line.
    Three presses per leg on the simulator (audio=150) and two on the device leg (audio=100), each leg inside our
    saturating reset bracket. The simulator legs use the round-3 fixture (First Do No Harm, h264 1080p + AAC 48 kHz).
    The simulator's VOD route is .software, so it walks in through setAudioDelay; Office2's is .loopback for every title in this reply, where
    our press never calls setAudioDelay at all — which is why the hardware half of this section comes from a session
    our #461 escape put on .software deliberately.

    shape when press 2 arrives, measured against seek#1 landing entry lines folded seeks in effect
    same-turn burst (audio=2500, no audiostep) every press before the re-anchor Task starts 37 36 1 1 in one run, 3 in the other — below
    inside the re-anchor (audiostep=20 sim, =40 device) 1 ms before on the simulator, 2 ms before on each of the two device runs 3 / 2 1 3 / 2 2 / 1
    after the re-anchor (audiostep=60, 150, 400) 2 ms after at 60, at both pins; 95 and 96 ms at 150; 358 and 337 ms at 400 3 0 3 3

    The burst is round 3's reading and it reproduces at both E-8 pins: SIM-E8-audiosync-clamp.log carries 37
    on the software path, 36 folded, one seek#N programmatic began and applied 2000ms (asked 2500) at 7.7.1
    (logs/p771/…:108–:214, :111–:216, :219, :217) and the identical counts at 7.8.1 (logs/…:108–:216,
    :111–:218, :220, :219).

    One thing inside the burst is not identical between the two runs, and it is worth having because it is the
    mechanism this section's source paragraph sets out, showing itself. The 7.7.1 run delivers the final value once —
    in effect: +2000 ms at logs/p771/…:218, 21 ms after the burst's first entry line and before the single seek at
    :219 begins. The 7.8.1 run delivers three times — +500 ms at logs/…:127 (+7 ms), +1450 ms at :185
    (+23 ms) and +2000 ms at :226 (+92 ms) — and the first two land inside the burst, with that run's only seek
    not beginning until :220. So on that run two intermediate values reached the renderer with no re-anchor at all,
    which is softwareHost?.setAudioDelay(clamped) at AetherEngine+AudioDelay.swift:92 running upstream of the fold
    guard at :194. We are not calling that a pin difference: the burst itself ran 20 ms at 7.7.1 and 31 ms at
    7.8.1, one run per cell, and how many buffers the output thread delivers inside a 20–31 ms window is its own
    cadence, not the engine's. The entry count, the fold count and the seek count are identical.

    The leg you asked for — audiostep=20, simulator, .software, 7.7.1

    p771/SIM-E8-audiosync-audiostep-20.log, play:…;t=120 with JF_TUNE_TEST=12;audio=150;audiostep=20,
    started (route software, 3.2s) at :99:

    09-19 20:51:17.560  AE#464: audio delay = +50 ms on the software path
    09-19 20:51:17.560  seek#1 programmatic began target=128.96
    09-19 20:51:17.617  AE#464: audio delay = +100 ms on the software path
    09-19 20:51:17.617  AE#464: audio delay = +100 ms folded into the re-anchor already in flight; that rebuild delivers it
    09-19 20:51:17.618  seek#1 programmatic landed rendered=128.96 target=128.96
    09-19 20:51:17.618  seek#2 programmatic began target=128.96
    09-19 20:51:17.636  seek#2 programmatic landed rendered=128.96 target=128.96
    09-19 20:51:17.636  AE#464 audio delay in effect: +100 ms (sample at 126.144s delivered at 126.244s)
    09-19 20:51:17.640  AE#464: audio delay = +150 ms on the software path
    09-19 20:51:17.640  QA: JF_TUNE_TEST audio delay applied 150ms (asked 150)
    09-19 20:51:17.640  seek#3 programmatic began target=128.96
    09-19 20:51:17.656  seek#3 programmatic landed rendered=128.96 target=128.96
    09-19 20:51:17.656  AE#464 audio delay in effect: +150 ms (sample at 126.144s delivered at 126.294s)
    

    :120–:144. seek#2 is the catch-up pass, and it begins in the same millisecond seek#1 lands. The leg's
    whole census: 4 AE#464: audio delay = lines (3 entry + 1 fold), 3 seeks, 2 in effect, applied 150ms (asked 150), zero audio delay stood down, zero deferred, zero option correction, zero ERROR.

    Two readings. The intermediate value is never presented. There is no in effect: +50 ms line anywhere in the
    leg — two delivery lines for three presses, against three for three at every cadence above the band. The source
    reading we take for that: press 2's softwareHost?.setAudioDelay(clamped) at AetherEngine+AudioDelay.swift:92
    runs upstream of the in-flight guard at :194-201, so the folded value reaches the renderer before seek#1's flush
    does. And the catch-up is what delivers it — the fold line's "that rebuild delivers it" is exact at the level
    of the Task, but the seek that carried it was the second one, issued by the while at :207 and the
    await reanchor at :220.

    The same shape on hardware, twice — 7.8.1

    On Office2 the one title of ours we have seen reach .software without our #461 escape is a VC-1 one
    (dispatch: codec=70 → software, at 7.7.1 and 7.8.1 alike), and no leg of ours pressed the stepper on it; so the
    hardware session here is one the escape moved onto your .sampleTimestamps arm: a 7,486.5 s UHD DV profile
    8.1 title with AC-3 6ch audio, [SWHost] session start: videoCodecID=173 audioCodecID=86019 and [AudioDecoder] Opened: 48000Hz, 6ch, codec=ac3
    (DEV-E8-f1-software-escape.log:335, :340), started (route software, 75.1s) at :467, then two presses at
    audiostep=40:

    09-22 01:24:53.267  AE#464: audio delay = +50 ms on the software path
    09-22 01:24:53.268  seek#1 programmatic began target=710.10
    09-22 01:24:53.353  AE#464: audio delay = +100 ms on the software path
    09-22 01:24:53.353  AE#464: audio delay = +100 ms folded into the re-anchor already in flight; that rebuild delivers it
    09-22 01:24:53.355  seek#1 programmatic landed rendered=710.10 target=710.10
    09-22 01:24:53.355  seek#2 programmatic began target=710.10
    09-22 01:24:53.357  seek#2 programmatic landed rendered=710.10 target=710.10
    09-22 01:24:53.366  AE#464 audio delay in effect: +100 ms (sample at 709.024s delivered at 709.124s)
    

    :654–:671. The same arc a run earlier on a different build of ours, same pin:
    DEV-E8-f1-software-escape.prev-012248.log:656-672, 23:51:37.789 → .889. One in effect, no +50.

    Human cadence is the one cadence that does not reach it, and that is a correction to what we wrote

    We told you in round 3 that "the catch-up is for human cadence", and you took that up. The measurement says the
    opposite. The gate is when the second press arrives, against the moment the first re-anchor returns — a window
    whose width is that re-anchor's own duration, and everything at or above a human's cadence arrives after it:

    leg pin achieved press intervals first re-anchor (seek#1 began → landed) press 2 against seek#1 landing folded
    sim audiostep=20 7.7.1 57, 23 ms 58 ms 1 ms before yes
    sim audiostep=60 7.7.1 65, 64 ms 63 ms 2 ms after no
    sim audiostep=60 7.8.1 62, 65 ms 57 ms 2 ms after no
    sim audiostep=150 7.7.1 / 7.8.1 159, 156 / 161, 161 ms 64 / 65 ms 95 / 96 ms after no
    sim audiostep=400 7.7.1 / 7.8.1 417, 428 / 406, 418 ms 58 / 54 ms 358 / 337 ms after no
    device audiostep=40 (.software via #461) 7.8.1 86 ms 87 ms 2 ms before yes
    device audiostep=40, run before 7.8.1 87 ms 88 ms 2 ms before yes

    The last two columns are close but they are not the same quantity, and we would rather say so than have the
    arithmetic fail to add up for you. The arrival gap is the one the mechanism turns on: press 2 against the moment
    seek#1 lands. (seek#1 programmatic landed is our observable for the await reanchor at AetherEngine+AudioDelay.swift:206 returning, which is
    not logged; the two agree to within whatever seek does after it lands, and the legs bear that out — everything
    before the landed line folds and everything after it does not.) The press interval against the re-anchor's
    duration
    equals the arrival gap only when press 1 and seek#1 began share a millisecond; in these legs they are
    0–15 ms apart, which is why the sim audiostep=60 row at 7.8.1 reads 5 ms on the subtraction and 2 ms on the
    clock. The interval is the knob a leg can set; the arrival gap is what decides.

    Two caveats we would rather state than have you find. The token is a floor, not the interval — each press does
    its own synchronous work before the loop sleeps, so audiostep=20 produced a 57 ms first interval and
    audiostep=40 produced 86 ms; quote the achieved interval, never the token. And our three overlapping readings
    cleared the boundary by 1 ms on the simulator and by 2 ms on each of the two device runs
    , which is a thin margin
    even though the device reproduced it twice. A leg meant to hit this reliably should ask for a step well under the
    re-anchor rather than near it. One run per cell.

    Why the three shapes follow from your source, which is what makes them a band rather than a coincidence

    reanchorForAudioDelay sets audioDelayReanchorInFlight synchronously at
    AetherEngine+AudioDelay.swift:202, then the Task at :203 reads delivered at :205 and awaits the first
    re-anchor at :206; the catch-up while is :207 and its own re-anchor :220. So the catch-up runs only for a
    press that arrives after the Task body has read delivered and before that first re-anchor returns. In the
    same-turn burst the Task body has not started at all — the whole burst runs synchronously on the MainActor ahead of
    it — so delivered is read already at the final value and isChange is false, which is what we reported in round 3
    and is why 37 presses produce one seek. Above the re-anchor's duration the flag is already cleared, so there is
    nothing to fold into and each press is its own complete re-anchor. The band's width is the first re-anchor's
    duration, measured at 54–65 ms over seven simulator runs across two pins and 87–88 ms over two device runs
    at 7.8.1.

    Your count note, re-confirmed at two more pins

    Census over every retained E-8 slice (all {DEV,SIM}-E8-*.log including the .prev-* rotations, excluding the
    .launch companions), each slice counted under the pin of the build installed when it ran, with the counts taken
    in Python rather than from a driver's own grep -c:

    corpus slices AE#464: audio delay = on the software path folded …
    7.7.1 simulator 106 2,277 1,160 1,117
    7.8.1 simulator 108 1,951 994 957
    7.7.1 Office2 69 0 0 0
    7.8.1 Office2 100 6 4 2
    7.1.3 Office2 (two same-hold controls) 2 0 0 0

    The prefix is the exact sum of the two sentences in every corpus, so the doubling is still the whole of it and
    on the software path is still the stable count. on the loopback path is 0 in all 385 slices — our
    applyAudioDelayIfNeeded sends .loopback to our own #460 correction and returns, so the shipped app never enters
    your loopback arm, and no leg of ours can ever report on it.

    2. Round 4, retested on hardware, both arms

    Our rig is a launch env, JF_AETHER_RELOAD_APPLY, not your --reload-applying flag — only the key autoplay=
    is borrowed from your vocabulary, and every figure in this section is an Apple TV or a simulator reading, never an
    aetherctl one. It has carried that key since round 3, takes true|false now, and each proof line names its own arm
    so the two legs cannot be read for each other.

    Our two arms are the mirror image of yours, which is the mount and not a disagreement. LoadOptions.autoplay
    defaults to true (PlayerState.swift:779) and our makeLoadOptions() writes false, because we drive play()
    explicitly and an unset field would auto-resume a recovery re-install that a viewer is deliberately holding paused.
    So where you measured the session-owned arm as --reload-applying autoplay=false, ours is autoplay=true; and
    where your no-change arm is autoplay=true, ours is autoplay=false. Same two branches, opposite tokens.

    Each leg fires exactly one correction — the rig is one-shot per launch — so every figure below is a sitting's
    first correction on a clean mount and we have measured no repeat of either arm within a sitting. We also never run either token
    across a background/foreground cycle, which is the one window where the field partitions as applied rather than
    session-owned.

    The session-owned arm, one run per cell on Office2, all at the same seam (our option correction → line is t=0;
    the simulator has a second run at each pin, under the table):

    7.1.3 13a86172 7.7.1 fa67d586 7.8.1 b89240af
    Office2: autoplay not applied, the session owns it +3 ms +3 ms +3 ms
    Office2: correction complete without a rebuild … — +4 ms +4 ms
    Office2: our option correction done +68 ms +4 ms +4 ms
    Office2: #361 startup 8/8 presenting (gen 2) +220 ms absent absent
    Office2: NativeAVPlayerHost instances in the slice #1, #2 #1 only #1 only
    Office2: mount seeks in the slice 2 (0.00s then 17.30s) 1 1
    Office2: transport after the correction #2 … playing … t+0.20s at +266 ms #1 … playing … t+19.91s #1 … playing … t+20.06s
    simulator: not applied / done / gen 2 +11 / +96 / +202 ms +12 / +12 / absent +6 / +7 / absent

    7.1.3: 2026-09-16-e7/logs/DEV-E7-autoplay-owned.log:163-261 and SIM-E7-autoplay-owned-b3.log:121-174.
    7.7.1: logs/p771/DEV-E8-reload-autoplay.log:166-171 and logs/p771/SIM-E8-reload-autoplay.log:130-133.
    7.8.1: logs/DEV-E8-reload-autoplay.log:168-173 and logs/SIM-E8-reload-autoplay.log:131-134.
    The simulator's second run of the same arm, from the title's head rather than 120 s in (both 7.1.3 runs start at the
    head), has the same shape as the table's run at each pin: +5 / +84 / +204 ms at 7.1.3
    (2026-09-16-e7/logs/SIM-E7-autoplay-owned.log:121-173), +5 / +5 / absent at 7.7.1
    (logs/p771/SIM-E8-autoplay-owned.log:121-124) and +6 / +6 / absent at 7.8.1 (logs/SIM-E8-autoplay-owned.log:120-123).
    Verbatim, 7.8.1, Office2:

    09-21 18:37:20.622  [Aether] option correction → JF_AETHER_RELOAD_APPLY autoplay=true — session-preserving reload (#460)
    09-21 18:37:20.625  #460: autoplay not applied, the session owns it: … Call play() / pause() to change it
    09-21 18:37:20.626  #460: correction complete without a rebuild, every field it changed is the session's own (AE#464 round 4)
    09-21 18:37:20.626  [Aether] option correction done (JF_AETHER_RELOAD_APPLY autoplay=true) — …
    09-21 18:37:20.628  [NativeAVPlayerHost] #1 timeControlStatus=playing reason=- t+20.06s
    

    So on hardware the third answer went from 220 ms and a second NativeAVPlayerHost to 4 ms and none, and
    the viewer's session is the one that was already running — your t=08 cur=8.10 reading, on the other instrument.

    The paused arm is the one we would not have predicted. autoplay-owned-paused asks autoplay=true on a
    session the viewer paused 5.1–5.3 s earlier — 5.226 s at 7.1.3 (the 5.2 s we gave you in round 3), 5.098 s
    at 7.7.1 and 5.312 s at 7.8.1, each leg's own pause to its own correction. At 7.1.3 that still bought a full
    rebuild — #2 mount seek: item axis 14.12s at +105 ms, gen 2 at +212 ms — with the transport correctly left paused
    (2026-09-16-e7/logs/DEV-E7-autoplay-owned-paused.log:173-259). At 7.7.1 and 7.8.1 there is no second host at all
    and the paused #1 simply carries on to paused reason=- t+64.94s / t+64.89s
    (logs/p771/DEV-E8-autoplay-owned-paused.log:174-191, logs/DEV-E8-autoplay-owned-paused.log:175-192). A paused
    viewer used to pay the rebuild too; now nobody does.

    The no-change control does exactly what you said it would, at both pins and on both instruments: one engine line
    and a real rebuild. Verbatim, 7.8.1, Office2:

    09-21 18:38:38.016  [Aether] option correction → JF_AETHER_RELOAD_APPLY autoplay=false — session-preserving reload (#460)
    09-21 18:38:38.017  #460: reload applying no option change (session already on these options)
    09-21 18:38:38.079  [NativeAVPlayerHost] #2 mount seek: item axis 137.20s (startPosition=137.20, live=false)
    09-21 18:38:38.219  #361 startup 8/8 presenting (gen 2)
    09-21 18:38:38.263  [NativeAVPlayerHost] #2 timeControlStatus=playing reason=- t+0.19s
    

    logs/DEV-E8-reload-nochange.log:168-267; 7.7.1's twin is logs/p771/DEV-E8-reload-nochange.log:166-265, same
    shape, 137.30s, gen 2 at +207 ms. Zero autoplay not applied, zero correction complete without a rebuild, and
    the playhead is carried across the rebuild rather than lost. One grep note in passing, because it caught us:
    no option change matches three lines in each of those slices and only one of them is yours — the other two
    are our own rig's armed and firing notes, whose prose quotes the literal. The engine emits it once.

    What we have done with the return value: nothing yet, and that is a choice we are naming rather than hiding.
    Our correctLoadOption still discards the SessionOptionCorrectionOutcome at try await engine.reloadAtCurrentPosition(applying: change) and hands its callers a bare Bool, so the done line above —
    and the post-rebuild epilogue under it (installedOnce, a 15 s track-apply deadline, a rate re-assertion,
    engine.play() where the viewer has not paused, and on live an onLiveRebuilt that re-arms our DVR anchors) — runs
    after a session that never went down. None of our three product call sites names autoplay, so only the QA rig
    reaches that branch today and nothing viewer-facing is wrong; it becomes reachable the moment a caller names a
    sessionOwnedFields member, and autoplay is still the only one
    (AetherEngine+ReloadWithOptions.swift:282 at 7.8.1). The adoption is written — a typed applied / sessionOwned /
    rebuilt result, the no-teardown answer given its own line and skipping that epilogue — and against the commit it
    was written on it applied cleanly and parsed (swiftc -frontend -parse, zero diagnostics). It has never been
    compiled
    , and it is unapplied: two later edits of ours to the same file — one to correctLoadOption's own
    comments, and the second fix below — changed the lines it was written against, so it no longer applies cleanly
    and will need re-cutting before it lands. We will say when it does.

    3. Two on our side of the same mechanism, and both are ours

    Neither is an engine finding. We report them because they are both in the same seam as this issue and because the
    second one only became visible after the first was fixed.

    E8-F1 — we read your rebuild's route park as a capability answer, and dropped a press for it

    On .loopback a second press arriving inside our own #460 correction was thrown away, with a reason borrowed
    from the wrong question. Measured on our 7.7.1 build, Office2, two presses 43 ms apart
    (logs/p771/DEV-E8-audiosync-loopback-stepped40.log):

    09-19 19:15:29.824  [Aether] option correction → audio delay 50 ms — session-preserving reload (#460)
    09-19 19:15:29.832  [Aether] video route → none
    09-19 19:15:29.867  [Aether] audio delay stood down (the engine does not hold this route’s audio timestamps) — 100 ms not applied
    09-19 19:15:29.963  [Aether] video route → loopback
    09-19 19:15:34.034  QA: JF_TUNE_TEST audio delay pending 100ms (asked 100) — the wrapper has not applied it within 4 s
    

    :163, :166, :194, :222, :285. The route was blank for 131 ms and the press landed 35 ms into it. Our
    policy put "none" in an unavailableRoutes set — correctly derived from your own
    AudioDelayPolicy.application(for:), which maps .none to .unavailable (AudioDelayPolicy.swift:67) — and then
    asked that question of a live reading of videoRoute during a rebuild we had raised ourselves.
    VideoRoute.none's own documentation says what it is: "Nothing loaded, or the session was torn down"
    (PlayerState.swift:54-55). It is a park reading, not a route, and a decision that treats it as a capability will
    drop a viewer's press. Two presses inside 131 ms is a held remote, not an exotic case. Fixed by asking about the
    last settled route; the press is now recorded and delivered by the coalescer we already had. The 150 ms control
    behaved at both pins and still does — DEV-E8-audiosync-loopback-stepped150.log under logs/p771/ and under
    logs/, mount seeks 300.00 → 312.80 → 312.31 in each, two corrections, applied 100ms (asked 100). Across all 385 retained slices there is exactly one
    audio delay stood down line — that one — and none at 7.8.1. The before is a 7.7.1 build and the after a 7.8.1
    one, so that pair is not single-variable; the engine is not implicated either way, the whole defect being in our
    reading of a value you publish correctly.

    E8-F4 — and then our follow-up correction restarted the film, while our own oracle passed

    With the press no longer dropped, the coalescer issued its second correction 1 ms after the first returned —
    and the freshly mounted host had not yet published a position. 7.8.1, Office2
    (logs/DEV-E8-audiosync-loopback-stepped40.log):

    09-21 20:49:54.515  [NativeAVPlayerHost] #2 mount seek: item axis 312.70s (startPosition=312.70, live=false)
    09-21 20:49:54.516  [Aether] option correction done (audio delay 50 ms) — …
    09-21 20:49:54.517  [Aether] option correction → audio delay 100 ms — session-preserving reload (#460)
    09-21 20:49:54.560  [NativeAVPlayerHost] #3 mount seek: item axis 0.00s (startPosition=nil, live=false)
    09-21 20:49:54.568  AE#464 cutting seg0+ with audio delay +100 ms (4800 ticks @ 48000/1)
    09-21 20:49:54.592  QA: JF_TUNE_TEST audio delay applied 100ms (asked 100)
    

    :214, :219, :223, :284, :312, :318. The delay value is right; the viewer is back at the opening credits,
    and — by our reading of our own progress reporting, not by a measurement — the server's resume point follows. Note the last line: our own application oracle passed on every run that did
    this
    , because an oracle that watches the value cannot see a lost position. Three legs on two builds of ours did it
    — four restarts in all, the two-press leg above, a second two-press leg
    (DEV-E8-f1-stepped40.prev-010705.log:280) and a five-press one twice
    (DEV-E8-f1-burst20.prev-011813.log:287, :357) — before anybody read the mount seeks. The 150 ms control never
    did it on any build or either pin: four retained stepped150 slices, third mount 312.31s in all four. (Their
    second mount reads 312.80s in three of the four and 312.70s in one — logs/DEV-E8-f1-stepped150.log:214 —
    which is where the playhead was, not the defect; the defect is a mount at 0.00s.)

    The engine-side mechanism, stated as information and not as a report, because the window is ours. At 7.8.1
    reloadAtCurrentPosition() takes its position from positionForSessionRebuild (AetherEngine.swift:4839 over
    :3171-3173), whose guard is scoped to a load still in flight — guard state == .loading, let parked = underReconstruction else { return clock } (:2477-2480) — while the autostart at the tail of load() has already
    written state = .playing before returning (:4631-4639) and load() itself zeroed clock.currentTime
    (:3608); LiveReloadPolicy.resumePosition then turns that 0 into nil (LiveReloadPolicy.swift:12-15, consumed
    at AetherEngine.swift:4863-4864). So AE#464 round 2's guard covers the window before a load returns, and we
    re-entered in the window immediately after one returned. We are not filing this: the position cannot be
    stated by a correction anyway — reloadAtCurrentPosition(applying:) takes only the LoadOptions closure and
    LoadOptions carries no start position — so it has to be waited for, which is what we did. Our follow-up now holds
    until the rebuilt session's clock reads a playhead (50 ms poll, 3 s cap, threshold 1 s, which is resumePosition's
    own boundary so the predicate asks the question you are about to ask). Measured on Office2 at 7.8.1:

    09-22 01:12:04.137  [NativeAVPlayerHost] #2 mount seek: item axis 312.80s (startPosition=312.80, live=false)
    09-22 01:12:04.189  [Aether] audio delay follow-up held 51 ms for a readable playhead (the rebuilt session's playhead reads 312.80s)
    09-22 01:12:04.189  [Aether] option correction → audio delay 100 ms — session-preserving reload (#460)
    09-22 01:12:04.232  [NativeAVPlayerHost] #3 mount seek: item axis 312.80s (startPosition=312.80, live=false)
    09-22 01:12:04.317  QA: JF_TUNE_TEST audio delay applied 100ms (asked 100)
    

    logs/DEV-E8-f1-stepped40.log:214, :250, :251, :305, :347. Five presses (logs/DEV-E8-f1-burst20.log) at an achieved 35, 22, 22 and
    21 ms
    — the token asked for 20, and §1's caveat about that applies here too — collapse the same way: four
    coalesced (:180, :200,
    :249, :252), one hold (:253), two corrections (:163, :254), applied 250ms (asked 250) (:343), every
    mount seek at the playhead. If it is worth a sentence in docs/api.md beside
    reloadAtCurrentPosition(applying:) that a correction raised immediately after one returns will rebuild at the head,
    that is your call and not an ask.

    4. Round 4, point by point

    "The human-cadence arm with audiostep=<ms> is the one leg I would still like to see, since it is the only one
    that reaches the catch-up pass at all."
    Run, on both instruments — and it is not the human-cadence arm that
    reaches it. At 150 ms and 400 ms nothing folds and nothing catches up: three presses, three complete re-anchors,
    three in effect lines, at both E-8 pins. The catch-up is reached by a press landing inside a re-anchor after the
    Task has read delivered, a band whose width is that re-anchor's own duration — 54–65 ms on the simulator, 87–88 ms
    on the Apple TV at 7.8.1. §1 has the leg, the arc and the boundary. The wrong half of that sentence is ours: we wrote "the
    catch-up is for human cadence"
    in round 3.

    "On (a), the count note is worth keeping … A count bound to AE#464: audio delay alone therefore doubles … the
    on the software path sentence is the stable one."
    Re-confirmed at two more pins, 7.7.1 and 7.8.1, over the 383 slices that ran on them: the prefix is
    the exact sum of the two sentences in every corpus (§1's table). We have kept our own counts bound to the sentence.

    "the partition is returned rather than logged at, and a correction the session decides for itself no longer buys a
    teardown."
    The second half retested on hardware and on the simulator, at 7.7.1 and 7.8.1, against the 7.1.3
    control: 220 ms and a second native host become 4 ms and none, the no-change control still rebuilds and reports
    itself, and a paused session no longer pays a rebuild either. §2 has the table. The first half we have not
    exercised: our call site still discards the returned outcome, so every measurement in §2's retest is read off the
    log — your engine's lines and our own — rather than off the outcome; §2 says what that costs us today and that the patch is written and unapplied.

    "On (d), that is a measurement and I am taking it as one … Nothing owed on your side for it." Re-confirmed
    rather than left: across all 385 retained E-8 slices (383 at 7.7.1 and 7.8.1, two 7.1.3 controls), …not the engine's to move (route=…) is
    0 and set while the session is being rebuilt is 0, as are cannot be rebuilt in place and
    cannot re-anchor at the playhead. The structural reason is unchanged on both of our routes.

    "And thank you for the retraction on autoplay." Noted; nothing owed.

    "Released in 7.5.0 (87710cd6). Both consumers are on the new pin, so the round 4 behaviour is in the next build
    from either."
    Our own builds are past it too — 7.7.1 and 7.8.1. Every count and presence in §2's table is
    identical between those two: the same two arms, the same absent gen 2, one
    NativeAVPlayerHost and one mount seek in each. Two cells differ and both are timings — the
    simulator's not applied / done offsets, 5–12 ms at 7.7.1 against 6–7 ms at 7.8.1 over two runs at each pin, and,
    one run per cell on Office2, the running session's own elapsed clock at the moment of the correction
    (t+19.91s against t+20.06s), which is how long each leg had been playing when our rig fired rather than an
    engine reading. We did not build 7.5.0 or 7.6.0, so we cannot say from our own evidence that the change landed
    exactly there; only that it is present at 7.7.1 and that 7.1.3 does not have it.

    Both retests pass, so this is closeable on your side whenever you like; the adoption is ours to land and is not a
    reason to hold it open. Raw slices on request, as before — and if the §1 hardware session is of any use to #592, it
    is a software-route sitting on the same 81 Mbps title, with a 133-tick [SWDiag] series in each of its two runs.

  12. superuser404notfound commented on Sep 23, 2026

    @superuser404notfound
    Owner

    Thank you for round 5, and especially for E8-F4. It is filed now, from this side: the window is the engine's, and the engine walks into it without any host's help.

    E8-F4 is an engine defect, fixed in #611. Your reading of the mechanism is exact: rebuildPosition honoured the parked position only while state == .loading, the autostart at the tail of load() writes .playing before the new host has published a position, and for about 50 ms the clock still reads the zero load() wrote. What makes it ours rather than a host timing question is that reanchorForAudioDelay's own catch-up pass starts in that exact millisecond: on .loopback its await reanchor(self.positionForSessionRebuild, delivered) runs the moment the first rebuild returns. Your app never reaches that arm on .loopback (as §1 says, 0 on the loopback path lines in 385 slices), so it could not have shown up in your corpus. It shows up on the CLI with nothing but the public setter: two setAudioDelay presses 50 to 90 ms apart on a 300 s H.264 + AAC fixture gave #3 mount seek: item axis 0.00s and cutting seg0+ on every run from @15050 to @15090.

    The fix: a .playing or .paused session whose clock reads exactly the reset zero now answers with the parked position, and an accepted seek retires the parked value so a real seek to 0 is never overridden. After: #3 mount seek: item axis 14.90s / seg3+ on every run in the same band. Control: load at 100 s, seek to 0, then a correction, and the rebuild mounts at 0.00s, not at the 100 s the load was handed. Both runners of swift test pass. Your 50 ms / 3 s hold stays harmless after this and can go whenever it suits you once the release carries it; I will say which release that is here.

    §1, the catch-up band. Taken as a measurement, and the correction is right: the pass is reached by a press landing inside a re-anchor, and human cadence never reaches it. The engine's own comment and docs/api.md both repeated the "a stepper held down converges" reading from round 3, and both are rewritten in #611 to your band (54 to 65 ms simulator, 87 to 88 ms Apple TV) with the three shapes named. The intermediate value reaching the renderer ahead of the flush on .software (softwareHost?.setAudioDelay upstream of the fold guard) is intended: the newest value should reach newly decoded buffers as early as possible, and the re-anchor then removes the ones already committed to the old one. Your decision not to call the burst's one-versus-three in effect count a pin difference matches my reading.

    §2, round 4 on hardware. Noted, including the paused arm, which I had not predicted either. The count note stays bound to on the software path.

    §3, E8-F1. Agreed that .none is a park reading and not a capability. Nothing on the engine side there.

    I will keep this open until #611 is in a release, then close it. The unapplied SessionOptionCorrectionOutcome adoption is yours to land and not a reason to hold it open, as you say.

  13. superuser404notfound commented on Sep 23, 2026

    @superuser404notfound
    Owner

    The E8-F4 fix from #611 is released in 7.15.1 (b93f9c4b): a correction raised in the ~50 ms after a rebuild returns now keeps the playhead instead of mounting at 0.

  14. superuser404notfound commented on Sep 23, 2026

    @superuser404notfound
    Owner

    Closing as promised: #611 shipped in 7.15.1, so every round of this thread is now in a release. The 50 ms / 3 s hold on your side can go whenever it suits you. Thank you for five rounds of measurements that kept correcting both sides, the catch-up band and E8-F4 included.

  15. cmcpherson274 commented on Sep 25, 2026

    @cmcpherson274
    Author

    The note our last reply here promised: the SessionOptionCorrectionOutcome adoption has landed on our main (24 September, at 7.15.1). Our correctLoadOption now reads the typed outcome, runs its post-rebuild epilogue only on rebuilt=true, and appends outcome applied=[…] sessionOwned=[…] rebuilt=<bool> to its option correction done line. On the Apple TV the round-4 answer reads applied=[] sessionOwned=[autoplay] rebuilt=false, 1 ms after your correction complete without a rebuild line [1], and the correction we make when the audio route drops reads applied=[audioBridgeMode] sessionOwned=[] rebuilt=true [2]. Thank you for the typed answer; it is what lets our own line say when nothing was rebuilt.

    [1] DEV-E9-post-g4-autoplay-p7151.log:174-175. [2] A test leg with display criteria suppressed, where the route dropped on its own: DEV-E9-esc4-h40-reinstall.log:146, :243.

  16. superuser404notfound commented on Sep 26, 2026

    @superuser404notfound
    Owner

    Thank you for closing the loop. Good to see the typed outcome doing its job on the device: rebuilt=false one millisecond after the engine's correction complete without a rebuild line is exactly the agreement between the two logs that the type was meant to give, and the route-drop correction reading applied=[audioBridgeMode] rebuilt=true shows the other arm. Nothing further on the engine side here.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions