Skip to content

feat(live): an arm that prices fastZap's bounded start against the holdback (AE#594) - #601

Merged
superuser404notfound merged 1 commit into
mainfrom
fix/594-bounded-start-floor
Sep 22, 2026
Merged

superuser404notfound merged 1 commit into
mainfrom
fix/594-bounded-start-floor

Conversation

@superuser404notfound

Copy link
Copy Markdown
Owner

Closes #594 as a measurement. The policy is not changed: the arm is env-gated and off.

What the arm is

AETHER_BOUNDED_START_FLOOR=1 skips the bounded branch in waitForFirstLiveSegment, so the wait ends at the full 3 x TD cushion or at the 30 s outer deadline. It arrives as an init parameter on VideoSegmentProvider (boundedStartFloorsAtHoldback) rather than a global, so the tests set it per instance, and the engine reads the environment once per process so a run cannot change arms midway.

The price

hlsfixture origin of pre-cut GOP-aligned segments, play --live --fast-zap --seconds 45, two passes per cell (three for 6 s / A):

origin cut arm gate held first manifest first picture -16832
1 s A (bounded) 3.028 s 2 segs / 2.000 s < 3 s holdback 3.47 s 0
1 s B (floored) 3.068 s 3 segs / 3.000 s >= 3 s holdback 3.26 s 0
3 s A 8.252 s 2 segs / 6.000 s < 9 s holdback 9.64 s 0
3 s B 9.458 s 3 segs / 9.000 s >= 9 s holdback 9.65 s 0
6 s A 14.342 s 2 segs / 12.000 s < 18 s holdback 16.72 s 0
6 s B 18.597 s 3 segs / 18.000 s >= 18 s holdback 18.79 s 0

Arm A serves short at every cadence, and the shortfall grows with the cut, which is the defect the issue describes: 12 s of window against an 18 s holdback at a 6 s cut.

The floor costs one more segment minus the grace, and the gate deltas say exactly that: +0.04 s at 1 s (the 1.0 s grace already covers the wait), +1.21 s at 3 s, +4.26 s at 6 s where the grace clamps to 2.0 s. At the picture, +0.00 / +0.01 / +2.07 s.

Why the policy is not changed

The benefit half is not measured, and the table would be misread as measuring it. -16832 never appeared, in either arm, at any cadence, across thirteen runs. That is not evidence the shallow window is safe: on this harness the session joins at the HEAD of the served window and advances 1x from there, instead of seeking to edge-minus-holdback, so the state the issue is about is never entered. edge= and behind= cannot be used to check that either, with or without --dvr-window: edge stays pinned at its first value for the whole run and behind is derived from it.

So what ships here is the instrument and the price, and the recommendation is to leave the trade alone until a field capture or an origin that reproduces the seek can price the other side. The arm stays because it is what made the price readable, and it is what a future repro would be driven with.

Tests

Issue594BoundedStartFloorTests, XCTest, RED first against an inert parameter:

error: -[Issue594BoundedStartFloorTests testFloorHoldsAStrictRealtimeOriginPastTheGrace] :
  XCTAssertNil failed: "true" - the bounded start served a window shallower than the holdback

Three cases: the floor holds a strict-realtime origin past the grace, the floor is free on a backlog origin (the control, and the hypothesis at unit scale, 0.005 s), and arm A still serves at the grace so the A/B moves one thing. Both runners green afterwards: XCTest 629, swift-testing 3334 in 449 suites.

docs/cli.md carries the table and the limitation.

🤖 Generated with Claude Code

https://claude.ai/code/session_014AVNwe8YDG9EQM7uHdjT3f

…ldback (AE#594)

The bounded start serves once two segments exist plus a clamped grace, and
that window can be shallower than the holdback the same manifest advertises.
The trade was deliberate and had never been priced.

AETHER_BOUNDED_START_FLOOR=1 skips the bounded branch, so the wait ends at the
full cushion or at the outer deadline. It is a measurement arm rather than a
policy, read once per process so a run cannot change arms midway.

Measured, two passes per cell, three cadences: the floor costs one more segment
minus the grace, +0.04s at a 1s cut, +1.21s at 3s, +4.26s at 6s, and +0.00 /
+0.01 / +2.07s at the first picture. No -16832 appeared in either arm at any
cadence, but this harness joins at the head of the served window rather than
seeking to edge-minus-holdback, so it cannot price the harm the floor would buy.
Table and that limit are in docs/cli.md.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_014AVNwe8YDG9EQM7uHdjT3f
@superuser404notfound
superuser404notfound merged commit 202c1ad into main Sep 22, 2026
7 checks passed
@superuser404notfound
superuser404notfound deleted the fix/594-bounded-start-floor branch September 22, 2026 14:00
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.

fastZap's bounded start can serve a window shallower than the holdback it advertises, so AVPlayer joins with no cushion

1 participant