Skip to content

fix(seek): carry transport intent through a superseded reposition (#292) - #299

Merged
superuser404notfound merged 2 commits into
mainfrom
fix/292-superseded-seek-resume-intent
Aug 4, 2026
Merged

superuser404notfound merged 2 commits into
mainfrom
fix/292-superseded-seek-resume-intent

Conversation

@superuser404notfound

Copy link
Copy Markdown
Owner

Closes nothing yet: #292 stays open for the reporter's retest.

What broke

A scrub during playback on the software path landed the session paused while the engine reported .playing. The audio clock re-armed at rate=0.0, the demux and feeder loops parked, and only a manual pause plus play brought it back.

SoftwarePlaybackHost.seek and AudioPlaybackHost.seek park their loops by clearing isPlaying, then await the demuxer reposition off the main actor (#254). A second seek entering that window read the flag its predecessor had cleared, took it for "was paused", and anchored the clock at rate 0 with pausedByHost set. The reporter's log is that interleave verbatim:

seek#1 programmatic began target=2432.97
seek#1 programmatic superseded target=2432.97
seek#2 programmatic began target=2432.97
[AudioOutput] seekClock to=2432.973 rate=0.0

Before #254 (released in 6.1.1) the reposition ran inline, so no seek could overlap another.

The fix

The intent lives in a stash that the seek owning the window keeps, whoever supersedes it inherits, and pause() / play() rewrite. It is read at the landing rather than at entry, which closes two siblings of the same defect along with the reported one:

  • a pause() issued during a reposition was swallowed and playback continued;
  • a play() issued during one landed at rate 0 under a running loop, freezing exactly like the report.

The engine's seek finalize no longer defaults to .playing for the software and audio hosts either. They carry the durable intent now, so it reads their transport state. That is the other half of "AetherEngine still reports playing" in the report title. AVPlayer-backed audio keeps the default.

Verification

aetherctl play --sw --host-calls overlapseek runs three drills, each healed to a known state first so one drill's damage is not inherited by the next. Same fixture, same binary, only the engine sources swapped:

Drill before after
A superseded scrub while playing (the report) seekClock rate=0.0, clock frozen, state=playing rate=1.0, +2.98 s in 3 s
B pause() during the reposition pause swallowed, kept playing (+2.95 s) lands paused, play() resumes from the target
C play() during the reposition seekClock rate=0.0, clock frozen, state=playing rate=1.0, +2.91 s in 3 s

seektest cannot reach any of this: it awaits every seek, so its bursts are strictly serial and never interleave. Full suite green (1483 tests).

🤖 Generated with Claude Code

https://claude.ai/code/session_01HX5zV3Fcf7Nzq4DYGdXvQE

Vincent Herbst and others added 2 commits August 4, 2026 07:06
A scrub during playback on the software path landed the session paused
while the engine reported `.playing`: the audio clock re-armed at
`rate=0.0`, the demux and feeder loops parked, and only a manual pause
plus play brought it back.

`SoftwarePlaybackHost.seek` and `AudioPlaybackHost.seek` park their loops
by clearing `isPlaying`, then await the demuxer reposition off the main
actor (#254). A second seek entering that window therefore read the flag
its predecessor had cleared, took it for "was paused", and anchored the
clock at rate 0 with `pausedByHost` set. The reporter's log is exactly
that interleave: seek#1 began, superseded, seek#2 began, seekClock
rate=0.0. Before #254 the reposition ran inline, so no seek could
overlap another.

The intent now lives in a stash that the seek owning the window keeps,
whoever supersedes it inherits, and `pause()` / `play()` rewrite, so it
is read at the landing rather than at entry. That closes two siblings of
the same defect along with the reported one: a `pause()` issued during a
reposition was swallowed and playback continued, and a `play()` issued
during one landed at rate 0 under a running loop, freezing exactly like
the report.

The engine's seek finalize no longer defaults to `.playing` for the
software and audio hosts either. They carry the durable intent now, so it
reads their transport state, which is the other half of "AetherEngine
still reports playing" in the report title. AVPlayer-backed audio keeps
the default.

Verified with `aetherctl play --sw --host-calls overlapseek` (three
drills, each healed to a known state first) before and after: superseded
scrub rate=0.0 and a frozen clock -> rate=1.0 and +2.98s; pause during
the reposition kept playing -> lands paused and resumes on play; play
during the reposition rate=0.0 -> rate=1.0 and +2.91s.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01HX5zV3Fcf7Nzq4DYGdXvQE
…292)

`seektest` awaits every seek, so its bursts are strictly serial and can
never produce the interleave #292 is about. `play --sw --host-calls
overlapseek` makes a transport call while a reposition is still in
flight: a second same-target seek (the report), a pause, and a play from
paused.

Each drill heals the session with pause plus play first, so a defect one
provokes is not inherited by the next (before the fix each leaves the
session wedged, and back-to-back drills on a wedged session are
unattributable). `inWindow` is the precondition: a call that arrived
after the landing reports INCONCLUSIVE instead of a green PASS.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01HX5zV3Fcf7Nzq4DYGdXvQE
@superuser404notfound
superuser404notfound merged commit b2ee6be into main Aug 4, 2026
3 checks passed
@superuser404notfound
superuser404notfound deleted the fix/292-superseded-seek-resume-intent branch August 4, 2026 05:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant