Repository navigation
Description
What happened?
seekableLiveRange's lower bound is max(0, edgeTime − dvrWindowSeconds) — pure window arithmetic that never consults the cache — so the advertised rewind depth over-promises whenever the retained content is shallower than the window, which on a fresh live session is always.
Measured in two regimes on a real live source (Jellyfin 10.11 /stream.ts,
dvrWindowSeconds: 1800, per-second sampling of seekableLiveRange /
liveEdgeTime / behindLiveSeconds over four sessions to 29 min):
- While
edgeTime < 1800:lowerBoundreads 0.00 for the entire run — including at
session ages of 5–7 minutes when at most that much content can exist anywhere. - Once
edgeTime > 1800:lowerBoundtracksedgeTime − 1800exactly, sliding 1 s/s. - The REAL floor, probed by seeking: the session's own start plus ~19 s (a below-floor
target lands at the floor — same clamp value across repeated probes in one session).
The advertised bound and the real floor never met in any session we ran.
The code states the formula (Video/LiveWindow.swift:17-20, unchanged at cb3baaf):
return Swift.max(0, edgeTime - w)...edgeTime.
Consequences for a host building a rewind UI on this API:
- A scrub strip that derives its depth from
seekableLiveRangeover-promises massively
(a 3-minute-old session with a 1800 s window advertises 30 minutes of rewind). seek(to:)targets inside the advertised-but-not-retained region are accepted and
clamp silently (the seek's own completion reports the requested target; the truth is
only visible on the next clock sample).clampLiveResumeIfBehindWindow()consumes the same bound for its DVR-window clamp
(lowerBound + 5), so the engine's own resume clamping can aim at a position that was
never retained.
Ask: bound seekableLiveRange.lowerBound by the cache's actual resident floor (the
segment cache knows its oldest resident output position), or expose the floor as its own
published value so hosts can intersect. Either shape makes an honest strip possible.
Steps to reproduce
- Load any live source with
isLive: true, dvrWindowSeconds: 1800(native/loopback
route). - Sample
seekableLiveRangeonce per second. For the first 30 minutes of the session
the lower bound readsmax(0, edgeTime − 1800)regardless of what the cache holds. - Probe the real floor:
seek(to:)a target well below the advertised lower bound's
implied depth (e.g. 300 s behind on a 5-minute-old session) — playback lands at the
session-start floor, not the target, while the advertised range said the target was
in-window the momentedgeTimecrossed the window size.
AetherEngine version or commit SHA
Measured at 6.21.0 (87868c1); formula verified unchanged at 6.50.1
(cb3baaf, Sources/AetherEngine/Video/LiveWindow.swift:17-20).
Host app
Custom / my own integration
Platform
macOS
OS version
macOS 26.5.2
Device / chip
Mac Studio, Apple M4 Max (aetherctl harness; per-second range sampling added to a local
copy of the CLI for the measurement)
Playback path
Native AVPlayer
Source media (for playback bugs)
Live TV channel via Jellyfin 10.11 raw MPEG-TS (/stream.ts): h264 1920×1080 59.94fps
progressive + AAC-LC. Four sessions, 7–29 minutes each.
Error codes / log lines
None — the over-promise is silent by construction. Per-second sample tables from all
four sessions available on request.
Anything else
Related: the resume auto-snap consumes this bound (filed separately), and our deep-seek
interaction report quotes the same sessions. We are building a live rewind strip on this
rung; today its depth must come from probing clamps rather than the API.
Activity
superuser404notfound commentedon Aug 28, 2026
Fixed on
fix/ae441-resident-live-floor(906ee421). The bound is now the intersection of the DVRwindow (policy) and what the segment cache actually holds and can play forward from (fact), and
LiveWindow.clampreads the same range, soseek(to:)asks for a target it can reach.One correction and one addition, because the reproduction turned up a regime the report does not cover.
The parenthetical overstates it. A 3-minute-old session with an 1800 s window advertised
0.00 ... 180, which is a depth of 180 s, not 30 minutes.seekableLiveRangeis a range on the sessionaxis, so a host reading its depth as
upperBound - lowerBoundwas never told 30 minutes. What the boundreally over-promised is the SESSION'S OWN START, and that is worth stating precisely because it explains
the ~19 s measured: the offset is small when the source's timeline begins with the session and large when
it does not. On the harness, joining a source already 181 s into its own timeline:
The regime that outlives startup, and is not in the report: retention and the window are separate
budgets, so they diverge for the whole life of a session rather than only its first
windowseconds. WithdvrWindowSeconds: 30on 1 s segments the cache kept 24 s while the bound still claimed 30. That one doesnot heal itself once
edgeTimepasses the window size, which is the part worth having a test for.The floor is a backward-contiguous walk from the newest resident segment, not the cache's lowest
index. A minimum index is not proof of coverage: retained scrub bands leave interior holes (the
segment-serve path already refuses to read
min ... maxas residency for that reason), and a rewindadvertised below a hole cannot play forward. Paths with no such cache to ask, software live, report no
floor and keep the arithmetic exactly as before.
The clamp in
clampLiveResumeIfBehindWindow()now lands on that same honest bound, which is the secondhalf of #444.
One thing already exists. "The seek's own completion reports the requested target" is true of
await seek(to:), which returns no position at all, but not of the engine:SeekEventon$seekEventscarries
.landed(renderedTime:), and.begancarries the CLAMPED target rather than the requested one.The same run, engine-side:
So a host has an honest landing signal today; a harness that prints the value it passed in is reporting an
intention rather than an outcome.
Finally,
aetherctl playnow carriesedge=,behind=andrange=on its live telemetry. Samplingthose needed a patched copy of the CLI, which is a fair part of why a bound this visible went unread for
this long.
superuser404notfound commentedon Aug 28, 2026
Released in 6.52.0. The bound is the intersection of the window and the resident floor, and
seek(to:)clamps to the same value. Leaving this open for a retest against a real rewind strip, where the interesting number is whether the advertised depth and a probed floor now agree in both regimes.cmcpherson274 commentedon Aug 28, 2026
Retested at 6.53.0 against a real rewind strip (Jellyfin live
stream.ts, the same stack as the report), both regimes. The advertised depth and the probed floor now agree, in both.Regime 1 — session younger than the window (window 1800 s, probe at t=120): advertised
range=1.45...108.24; a deliberate seek below it (seek(to: 0)) came back with.began target=1.45— the clamp aimed at the advertised bound — landedrendered=1.45, and played forward from there (behind ≈106 s). Bound == clamp == landing == playable.Regime 2 — retention below the window for the session's life (window 420 s, probe at t=480): pure window arithmetic would have advertised
edge−420 = 55.74. The engine advertised 70.35 — the resident floor, ~15 s of honest retention shortfall — clamped the same deliberate under-seek to it, landed exactly there, and the session then played REWOUND (behind ≈405 s) for the remaining seven minutes with zero stalls. This is the regime your fix note said was worth a test; it holds.One observation, offered as a nuance rather than a defect: during that rewound stretch the advertised
lowerBoundadvances a few seconds AHEAD of the in-flight playhead (e.g. floor 83.70 while rendering 80.60, persistently ~3 s) and playback still runs clean — the reader outruns eviction with a small margin. So the bound behaves as a seek-contract ("where a NEW rewind can land"), not a playback death line for a session already below it. If that margin is deliberate, all good; if the floor is meant to also bound the active reader, the ~3 s inversion is reproducible on demand.Closing-quality from our side — the patched CLI we used to sample this is retired; the native
edge=/behind=/range=telemetry carried the whole retest.superuser404notfound commentedon Aug 28, 2026
Deliberate, and the sharper answer is that it is not a margin at all but a sawtooth whose amplitude is one segment.
residentFloorOutputSeconds()walks what is on DISK, and what it returns is the START of the oldest visible segment, so it advances in whole-segment steps each time the window slides.notePlayheadrecords what is RENDERED, which advances continuously. A viewer parked at the floor rides it, solowerBound - playheadsweeps a segment-wide band, positive for the part of each segment right after a slide. Nothing in that band needs fetching: it was handed to the consumer already. The cache states the same invariant in the other direction, oncontiguousForwardFrontier(fromPlayhead:):declareTargetis only ever called from the segment-serve path, so everything belowcurrentTargetIndexsits in the consumer's own buffer.Reproduced with a new harness leg, paced 1x, 60 s window, parked at the floor for 144 s on 5 s segments:
A third of the samples invert, and the largest one is inside a single segment. Roughly 3 s against a TARGETDURATION of 5 or 6 is that same shape.
The version that IS a defect is separable, and the engine already names it. It is not the floor passing the rendered playhead, it is the window passing the consumer's FETCH point, and
noteWindowSlideRelativeToConsumerlatches a line for exactly that:Driving it deliberately (unpaced origin handing over backlog faster than the consumer drains it, 30 s window):
So two things separate the readings without needing source access: whether the inversion stays inside one TARGETDURATION, and whether that line appears at all. Seven minutes of ~3 s with no such line is the bound doing its job.
The retest data did turn up one real defect, and it lives in the regime that only exists because retention runs short of the window. The resume clamp has LANDED on the honest floor since 6.52.0, but it still TRIGGERED on window arithmetic,
behind > window - 5. On the regime 2 numbers (window 420 s, advertised depth ~405 s) a resume with the playhead between 405 s and 415 s behind is below the floor and got no clamp at all, because410 > 415is false. Both ends read the same bound now. The margin applies only once the window is actually sliding: before it fills, the floor is the session's own start rather than an eviction frontier, so a margin there would only shove a resume near the start forward. Where retention matches the window the two formulations are the same statement, and a test pins that boundary as unmoved. Onmainin c55a6b5, riding the next tag.It is a narrow hole rather than something a normal session walks into, since it needs a pause of very nearly one window. It exists only because the ~15 s shortfall exists, which is the part the retest established.
The leg is
aetherctl live --rewind-hold N: it parks the playhead N seconds behind the edge and holds it there for the rest of the run, reporting the inversion, stalled ticks and any slide line. Nothing could drive that regime before (--freeze-afterkills the source,--rewind-testsamples five seconds), which is a fair part of why the resume gate stayed unexamined after the landing moved.Leaving open for the resume-clamp half.
cmcpherson274 commentedon Aug 28, 2026
Ran your two discriminators over the regime-2 capture, and the sawtooth reading holds — with one wrinkle in the data you didn't have:
lowerBound − renderedacross the 415 post-landing ticks = 5.02 s against TARGETDURATION 6 s — inside one segment, your sawtooth exactly.firstVisible = consumerTarget + 1, and none in the remaining six minutes. Zero stalled ticks, no cache-miss or edge-jump consequences anywhere in the run. So on this capture the line's one-segment off-by-one form fires transiently while the fetch point settles after a deep landing, then goes quiet — visibly distinct from your driven defect-class run (59 lines, 65 s inversions, stalls). If the latch is meant as a defect discriminator it may want the same one-segment tolerance the floor has; if the landing transient is expected, all good — reporting it since "no such line" was part of the reading.And thank you for chasing the resume-clamp trigger out of the retest data — the
behind > window − 5window-arithmetic trigger against an honest-floor landing is exactly the kind of seam only the shortfall regime exposes. We'll pick upc55a6b51(and--rewind-hold) with the next tag; the retest rides our next pin move.superuser404notfound commentedon Aug 28, 2026
The tolerance is right, and the reason it is right is sharper than a tolerance: the line was reading the
LAST fetch when what a slide costs is decided by the NEXT one.
declareTargetis called as a segment is served, and the consumer walks indices forward one at a time,so everything strictly below
consumerTargetis already in AVPlayer's own buffer and the index it willask for next is
consumerTarget + 1. AtfirstVisible == consumerTarget + 1that next fetch is the newfirst visible segment, which is resident, so nothing is missed. It is the same one-segment sawtooth the
floor has against the rendered playhead, on the fetch axis instead of the render axis: the slide moves in
whole segments while the consumer moves continuously. From
firstVisible - 2down, the index it is aboutto ask for has already been deleted, and that is the miss the line exists to name. So the predicate is
now
consumerTarget + 1 < firstVisible.The local counter-run that read 0 lines was measuring nothing, and that is worth stating plainly. The
--rewind-holdleg filledwindow * 0.6before rewinding, so at the rewind the session was alwaysyounger than its own window and the floor was the session's START rather than an eviction frontier. There
was no eviction in the regime it sampled at all. Filled past full instead, the same leg reproduces the
report exactly:
Four lines, gap 1 on every one, zero stalls, inversion inside one segment. One difference in shape worth
naming: this run keeps producing them across the whole hold rather than going quiet after 48 s, because
the playhead here rides the floor for the rest of the session while a forward buffer refilling after a
deep landing pulls the fetch point clear of it. Same off-by-one either way.
Chasing that transient turned up why the tolerance is not merely cosmetic. At exactly that
off-by-one, eviction unlinks the segment currently being SERVED. A serve holds a URL rather than a file
handle:
mediaSegmentURLhandspeekURL's result to a response that stats and opens the fileafterwards, so a slide reaching the fetch point is a window in which that response answers 404 for an
index the playlist offered when it was asked for. Narrow on loopback, where a serve finishes in well
under a segment, and it did not fire in any of these runs, but the four latched lines are four moments
where it was open. Eviction now stops at the consumer's fetch point, which is the bound
evictBelowalready documented for itself and the caller did not honour. It never trails
firstVisibleby more thanthat one segment, so a consumer that has stopped fetching entirely cannot pin retention behind it.
After, same fixture and same leg:
So the discriminator loses nothing by tolerating the sawtooth: the defect class is if anything louder
against it. The leg also reports the shape of each line now (
max firstVisible-consumerTarget gap, andhow many are above one segment) rather than only counting them, since the count alone was the part that
could not tell the two readings apart.
On
mainin 7ea32cf, riding the next tag alongside c55a6b5.superuser404notfound commentedon Aug 28, 2026
6.55.0 carries both halves of the retest.
c55a6b51: the resume clamp now triggers on the same bound it lands on, so the regime you measured, retention short of the window for the session's whole life (420 s window, ~405 s of real depth), gets a clamp for a resume that falls between the two. Before it, a resume in that band got none at all for a position the cache no longer held.7ea32cf2: the fourlive window slid past the consumerlines were an off-by-one on the reading side,firstVisible == consumerTarget + 1is the consumer's next fetch and it is resident, so they should be gone. Chasing them turned up something that was not cosmetic: at exactly that off-by-one, eviction unlinked the segment being served, and a serve holds a URL rather than a file handle. Eviction stops at the fetch point now. Not observable from outside on a healthy run, which is the point.cmcpherson274 commentedon Aug 28, 2026
--rewind-holdretest at 6.55.0, run against a seed captured from the reporting stack's own live source (real broadcast TS): window 60, hold 55, 300 s paced 1×.Zero latched lines — the tolerated predicate is quiet through a full parked-at-the-floor run where the old one produced the landing transients, inversion inside one segment throughout, and the eviction-race fix is invisible-on-healthy exactly as intended. Both halves verified from our end; fine to close whenever suits you.
superuser404notfound commentedon Aug 28, 2026
That run reached the regime, which is worth saying explicitly because the first version of this leg did not: at
--dvr-window 60the fill iswindow + 12, so 300 s leaves ~228 s of hold with the window actually sliding, and a hold of 55 in a 60 s window parks about 5 s above the floor, which is inside the sawtooth band for the whole stretch. The predicate had every opportunity to fire and stayed quiet.The 1.89 s is itself a reading, not just a smaller number. The inversion is bounded by one cut, so it is expected to scale with the source rather than sit near a fixed few seconds: 3.60 s against a 4 s fixture here, 5.02 s against TARGETDURATION 6 in the regime-2 capture, 1.89 s against a broadcast TS cutting somewhere near 2 s. A margin would have stayed put across all three. That it tracks the cut size is the sawtooth confirming itself on a source neither of us chose for it.
The tolerance did not cost the line its teeth, which is the half a clean run cannot show: the same build reads 1326 latched lines with gaps up to 12 on the unpaced backlog-burst arm, all of them above one segment. Quiet on healthy, louder on the defect class than before.
And on the eviction bound being invisible: by construction it can only ever be, so what pins it is not a run but the assertions,
liveEvictionFloor(firstVisible: 5, consumerTarget: 4) == 4for the off-by-one and eviction falling back to the window when no fetch point has been declared. The four latched lines in the earlier capture were four open moments for a 404 on an index the playlist had just offered, and they are what turned a reading fix into a correctness one.Closing. Thank you for the full arc on this one: the original report, both regimes retested against a real rewind strip, the inversion nuance that produced the resume-clamp defect, and the four transient lines that produced the eviction bound. Three fixes in this issue exist because a retest kept going after the verdict line said PASS.
fix(live): advertise the rewind a session actually holds
fix(network): what the relay hands the player has to be what the orig…