Skip to content

The axis a run plays on is the one its segment was advertised at (#418) - #420

Merged
superuser404notfound merged 2 commits into
mainfrom
fix/ae418-reaimed-gate-axis
Aug 25, 2026
Merged

superuser404notfound merged 2 commits into
mainfrom
fix/ae418-reaimed-gate-axis

Conversation

@superuser404notfound

Copy link
Copy Markdown
Owner

Fixes the axis error AE#408's early-opening gate introduced, and adds the harness that could have caught it.

What was measured

aetherctl play --picture-probe (first commit) attaches an AVPlayerItemVideoOutput to the running item and decodes the source time out of the frame itself, against a fixture whose picture states its own frame number in binary. Every other axis observable describes what the engine WROTE; this one says where AVPlayer PUT it.

The reading: AVPlayer presents a segment at the position the playlist gives it, not at the tfdt the segment carries, and then plays continuously from there. AE#408 shipped on the opposite assumption and published no shift for an early-opening gate, so the clock ran ahead of the picture by the whole re-aim.

The fix

  1. The offset a consumer folds is measured against the segment's advertised start, never against where the gate opened. A pinned (late) gate makes the two identical, which is why publishing the muxer's shift held until a gate that opens early existed. The muxer's own shift is untouched.
  2. That offset belongs to the decode run, not to the timeline: a seek that leaves the loaded region without provoking a restart begins a fresh run on an axis-true segment, and the previous run's offset must stop applying there. Without this half the defect is mirrored rather than fixed (capErr +0.892 where it had been -0.875).

Numbers

tc-cues-lie.mkv, Cues at non-sync positions, 12 s keyframe drought at 43 s, resume at 53 s (gate re-aims three times, opens at 38.417):

arm published shift picture vs item axis picture vs sourceTime
before AE#408 (pinned) +3.000 +3.000 +0.075
AE#408 as shipped 0.000 -13.583 -13.550
this change -13.583 -13.583 -0.009

Control fixture (Cues ARE sync samples): no re-aim, no seam, axisErr 0 on both arms.

2067 tests green, including the fixture-backed restart-continuity suite.

Not in scope

The re-aim's 4 / 8 / 16 / 32 s backoff opens at the first sync sample above where it landed rather than the nearest one below the boundary, so a resume into a drought lands further back than it needs to (38.417 where 43.0 was available). Visible now that the clock is honest; tracked separately.

🤖 Generated with Claude Code

https://claude.ai/code/session_01RbWZLwBVLGM1xUVXa9NeJ1

Vincent Herbst and others added 2 commits August 25, 2026 19:09
…sents (#418)

Every axis observable the engine has describes what it WROTE: #260 pairs a frame's
demuxed PTS with the value muxed into the segment, prodShift / hostShift describe the
fold the clock applies. None of them says where AVPlayer then PUT that segment, so the
question AE#408 answered by assumption ("an early-opening gate leaves the item axis
where the plan puts it") could not be measured at all.

`play --picture-probe` attaches an AVPlayerItemVideoOutput to the running item and
decodes the source time out of the frame itself, against a fixture whose picture states
its own frame number in binary (Scripts/timecode-fixture.sh, 12 blocks on one pixel
row). Per tick: `pic` (source seconds on screen), `picItem` (AVPlayer's own
itemTimeForDisplay), `axisErr` (their difference, 0 on an honest axis) and `capErr`
(the same error as a host placing a cue at sourceTime would make it).

Measured on the control arm, whose Cues are its sync samples: axisErr +0.000 on every
tick of a resume. On the AE#408 shape it reads the defect off directly, which is what
the following commit fixes.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01RbWZLwBVLGM1xUVXa9NeJ1
…ised at (#418)

AVPlayer presents a segment at the position the PLAYLIST gives it, not at the tfdt the
segment carries, and then plays continuously from there. Measured with the picture probe
from the previous commit, so this is a reading rather than an inference. AE#408 shipped
the early-opening gate on the opposite assumption and published no shift for it, which
put the clock ahead of the picture by the whole re-aim: captions early, and a synced
host's reported position with them.

Two halves, and the second is what the measurement forced.

The offset a consumer folds is measured against the segment's ADVERTISED start, never
against where the gate actually opened. A pinned (late) gate makes the two identical,
which is why publishing the muxer's shift held until a gate that opens early existed.
The muxer's own shift is untouched: it is the source-to-item offset for the bytes.

That offset belongs to the decode RUN, not to the timeline. Only an epoch's first
segment can carry one (every segment cut after it starts on its own boundary), a run
carries it across every boundary it plays through, and a seek that leaves the loaded
region without provoking a restart begins a fresh run on an axis-true segment where it
must stop applying. Publishing the producer's offset alone got the first case right and
the second wrong by the same amount (capErr +0.892 where the defect had been -0.875).

Measured on tc-cues-lie.mkv (Cues at non-sync positions, 12 s keyframe drought at 43 s),
source time decoded from the picture, resume at 53 s whose gate re-aims to 38.417:

  arm                     published   picture vs      picture vs
                          shift       item axis       sourceTime
  before AE#408 (pinned)  +3.000      +3.000          +0.075
  AE#408 as shipped       0.000       -13.583         -13.550
  this change             -13.583     -13.583         -0.009

and after a seek that leaves the loaded region: +0.892 before, +0.017 after. The control
fixture, identical except that its Cues ARE its sync samples, is untouched on both arms:
no re-aim, no seam, axisErr 0.

Not addressed here, and visible now that the clock is honest: the re-aim's 4 / 8 / 16 /
32 s backoff opens at the first sync sample above where it landed, not at the nearest one
below the boundary, so a resume into a drought lands further back than it needs to
(38.417 where 43.0 was available). That is a landing-accuracy question, tracked
separately.

2067 tests green, including the fixture-backed restart-continuity suite.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01RbWZLwBVLGM1xUVXa9NeJ1
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