Skip to content

After a seek that restarts the producer, the reported clock runs ~1.7 s ahead of the picture for about seven seconds #448

Closed

Description

@superuser404notfound

Found while measuring #418 round 3, on the same harness and in the same arm. The axis is right throughout; the clock is not.

What happens

After a seek whose restart opens a fresh epoch, the reported clock (currentTime and sourceTime, which read the same value here) sits about 1.7 s ABOVE the source time of the frame on screen, and stays there for about seven seconds before settling on its own. A host placing a subtitle cue at sourceTime shows it that far early for that whole window.

Measured with the picture probe, which decodes the source time out of the picture itself, so the number needs no interpretation:

swift run aetherctl play --seconds 34 --start-position 53 --seek-every 8 --seek-count 2 \
    --seek-pattern 25,3 --picture-probe file:///tmp/tc-cues-lie.mkv

seek#2 programmatic began target=3.00
video gate open: actual=0 anchorPts=0 target=<Int64.min> desired=0 shift=0
seek#2 programmatic landed rendered=4.67 target=3.00

t=25 cur=5.50  pic=3.875  picItem=14.584  axisErr=-10.709  capErr=-1.625
t=26 cur=6.50  pic=4.875  picItem=15.584  axisErr=-10.709  capErr=-1.625
t=27 cur=7.50  pic=5.875  picItem=16.584  axisErr=-10.709  capErr=-1.625
t=28 cur=8.50  pic=6.875  picItem=17.584  axisErr=-10.709  capErr=-1.625
t=29 cur=9.60  pic=7.875  picItem=18.584  axisErr=-10.709  capErr=-1.725
t=30 cur=10.60 pic=8.875  picItem=19.584  axisErr=-10.709  capErr=-1.725
t=31 cur=11.60 pic=9.875  picItem=20.584  axisErr=-10.709  capErr=-1.725
t=32 cur=10.93 pic=10.875 picItem=21.584  axisErr=-10.709  capErr=-0.058
t=33 cur=11.93 pic=11.917 picItem=22.626  axisErr=-10.709  capErr=-0.017

axisErr never moves, so the axis is honest for the whole run: at picItem=14.584 with an axis of -10.667 the picture is source 3.917, and the probe reads 3.875. The clock said 5.50. At t=32 it steps BACK by 0.67 s and lands on the picture, which is the settle rather than a seek.

Where it comes from, as far as the log carries it

The landing is already wrong: landed rendered=4.67 for a seek to 3.00, while the picture at that instant is 3.05. From there the clock advances in real time from the landing value rather than being derived from the item clock, so it carries the landing's error until the $renderedTime sink settles it. Deriving it the ordinary way (itemClock + axis) gives 14.584 - 10.667 = 3.917, which is the picture.

Reproduces on both spacings of that arm (seeks 8 ticks and 1 tick apart), identically, and the epoch it lands in carries no offset of its own (worth 0, so #418 publishes nothing for it). So this is not the axis and not the re-aim: it is what the clock does between a landing and the sink that corrects it.

Why it matters

Seven seconds is long enough to be seen rather than sampled, and it is exactly the window a viewer is looking at the screen after a scrub. On the reporting asset for #418 every seek in a burst opens such a window, which is one reason a caption error there is hard to attribute: the axis and the clock can be wrong at the same time for different reasons and in opposite directions.

Engine version

main at 20ce5b34 (6.56.0 plus the #418 round 3 fix). The behaviour predates both.

Platform

macOS harness (aetherctl), native AVPlayer path, loopback HLS VOD.

Activity

  1. superuser404notfound commented on Aug 29, 2026

    @superuser404notfound
    OwnerAuthor

    Root cause, and it is neither the landing nor the axis: a missing seam.

    What was actually wrong

    The axis is a step function of item time, one step per producer epoch, and an epoch's step is published when AVPlayer places its first segment. That publish only happened when the epoch was worth something: epochShiftTable dropped a zero rather than recording it, so an epoch whose first segment opens exactly on its boundary announced nothing at all.

    Its bytes still take over everything from their placement upward. After a backward seek that stretch is still covered by an older epoch's seam, and the clock folds that one instead. The memprobe line in the report names it in two fields:

    prodShift=-10.67s hostShift=-9.00s seams=2
    

    The session's axis was -10.667 and the clock folded -9.000, because the playhead sat below the newest seam (item 21.000, from the previous epoch) and the map answered from the one underneath it. The 1.667 s between them is the whole error, and it healed the moment playback crossed 21.000 at t=32, which is why it read as a settle rather than as a wrong axis. The landing value is derived through the same fold, so landed rendered=4.67 target=3.00 was that same error rather than a second one.

    The change

    An epoch's first segment publishes a seam whatever it is worth. The axis VALUE is unchanged for a zero-worth epoch, since its content begins exactly at its advertised start; the seam is the point, because it is what says which stretch of the item axis those bytes own. Recording the zero is also what keeps the table's real question answerable: it says "an epoch begins here", not "this is worth something".

    Same arm, after:

    #418 seg0 placed (advertised 0.000s, worth 0.000s): axis shift -10.667s -> -10.667s from item 10.667s
    VOD shift published: -10.667s (prev -10.667s, delta 0.000s, changed=no) seamAt=10.667s
    seek#2 programmatic landed rendered=3.00 target=3.00
    t=25 cur=3.83 pic=3.875 picItem=14.584 axisErr=-10.709 capErr=+0.042
    memprobe: prodShift=-10.67s hostShift=-10.67s frameAhead=0.00s
    

    capErr is within one frame from the first tick after the landing, where it was -1.625 for seven of them; the landing is exact; and the two shift fields agree. AE#418's placement check confirms the new seam against AVPlayer itself, placement confirmed: AVPlayer holds it from item 10.709s against a predicted 10.667s, one frame apart.

    Both fixture control arms are unchanged: the case fixture reads axisErr=-9.000 and the control fixture (Cues that ARE sync samples) axisErr=+0.000, capErr within two frames on both. One AE#418 round 2 test asserted the old behaviour and is rewritten with the reason; "an epoch that opened on its boundary records nothing" was this defect written down.

    On main (e7b20949), 2310 tests in 320 suites pass. Not released yet.

  2. superuser404notfound commented on Aug 29, 2026

    @superuser404notfound
    OwnerAuthor

    Shipped in 6.56.1 (e7b20949).

    On a retest, the shape to watch is a backward seek whose restart opens a fresh epoch: the landing should read rendered and target within a frame of each other instead of the ~1.7 s gap, and the memprobe line should show prodShift and hostShift agreeing immediately rather than converging when playback crosses the seam. An epoch whose first segment opens exactly on its boundary now publishes its seam even though it is worth nothing, because the seam says which stretch of the item axis those bytes own.

  3. superuser404notfound commented on Sep 3, 2026

    @superuser404notfound
    OwnerAuthor

    Released in 6.56.1 (e7b20949) and retested on this end since: the landing reads rendered and target together, and the seam is published from the first segment of every epoch. Closing.

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