Skip to content

feat(live): env-gated first-serve latch arm for engine-cut sources (#686) - #692

Merged
superuser404notfound merged 1 commit into
mainfrom
feat/686-first-serve-latch-arm
Oct 3, 2026
Merged

superuser404notfound merged 1 commit into
mainfrom
feat/686-first-serve-latch-arm

Conversation

@superuser404notfound

Copy link
Copy Markdown
Owner

Refs #686.

AETHER_FIRST_SERVE_LATCH_ALL=1 applies #684's first-serve latch to sources the engine cuts itself (raw MPEG-TS), so AVPlayer's second plain /media.m3u8 request no longer waits out a second fastZap grace. Measurement arm, read once per process, off by default (same shape as AETHER_BOUNDED_START_FLOOR for #594). Default behaviour is unchanged.

Both arms now emit one line per session with the second request's hold, which was silent before:

[HLSVideoEngine] repeat live manifest request held 2.003s, fastZap bounded start after 2.000s grace
[HLSVideoEngine] repeat live manifest request held 0.000s, first-serve latch

Mac measurement

aetherctl live --fast-zap --realtime --preroll 0 --seconds 40, two runs per arm, interleaved:

seed arm 2nd request held GET /init.mp4 sustained advance item= at end stalls
h264-ts-sample (2 s cuts) off 2.003 s 6.10 to 6.14 s 7.4 to 7.7 s 34.78 to 34.95 s 0
h264-ts-sample on 0.000 s 4.08 s 5.2 to 5.3 s 36.57 to 37.20 s 0
1080p59.94, 1 s GOP off 1.011 s 2.43 s 3.2 s 38.30 to 38.40 s 0
1080p59.94, 1 s GOP on 0.000 s 1.41 to 1.44 s 1.1 s 39.19 to 39.30 s 0

The stall half needs a client that seeks to edge-minus-holdback, which the Mac harness does not do (see the #594 section in docs/cli.md); that is what the reporter's Apple TV A/B is for.

Tests

Issue686FirstServeLatchArmTests: armed second request passes at once, unserved gate stays a gate, repeat line once per session in either arm. Full swift test: 718 XCTest + 4056 swift-testing, 0 failures.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WJcXkGQrMiBPixVEFTSBJS

…sources (#686)

On a source the engine cuts itself (raw MPEG-TS under fastZap) a bounded
start holds AVPlayer's second plain /media.m3u8 request for a second
grace: 1.015 to 1.384 s on every bounded start on the reporter's Apple TV.
#684 latched the gate for ingest sessions only, because whether skipping
that wait costs a stall (the session sits closer to the producing edge)
was never measured on a device.

AETHER_FIRST_SERVE_LATCH_ALL=1 extends the latch to engine-cut sources,
read once and off by default, like AETHER_BOUNDED_START_FLOOR. Both arms
now log how long the second request waited, which the reporter noted
was silent.

On the Mac (live --fast-zap --realtime --preroll 0, two runs per arm):
the arm removes exactly the grace (2.003 s / 1.011 s), init.mp4 and the
sustained advance come that much sooner, the playhead ends 0.9 to 2.0 s
closer to the edge, and neither arm stalled.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WJcXkGQrMiBPixVEFTSBJS
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