A join onto a slow stream keeps at most the head start in hand (#180) #182
Loading…
Reference in a new issue
No description provided.
Delete branch "slow-stream-join"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #180.
The fault
A join that cannot be exact goes back by the shortfall plus what the new stream needs in hand. For a source slower than real time, the watch measures that need as all the stream fell behind over its window. No buffer makes that up. On 2026-11-16, a Play onto shd247.world (pace 0.90×) kept the buffer's whole depth, 26.7 s, so the picture went back 43.4 s for a stream that was 16.7 s short.
The fix
Channel._needsnow keeps at most the head start in hand ("Start behind live", 15 s by default), as a fresh tune of that stream would.aim-the-swapspec says so: "at most the buffer's depth or the head start", with a new scenario, "A slow stream further behind than is held".Checks
test_a_slow_stream_further_behind_than_is_held_keeps_no_more_than_the_head_start: a standby 30 s behind whose watch measured 40 s of need. It kept 19.0 s before the fix (the depth); now it keeps 15–17.5 s, and the picture moves by the shortfall plus that.openspec validate aim-the-swap --strict: valid.make test: 1,489 passed, 1 skipped.🤖 Generated with Claude Code
A join that cannot be exact goes back by the shortfall and what the new stream needs in hand. For a source slower than real time that need is all it fell behind over the watch window, which no buffer makes up: on 2026-11-16 a Play onto shd247.world (0.90x) kept the buffer's whole depth, 26.7 s, and the picture went back 43.4 s for a stream 16.7 s short. Channel._needs now keeps at most the head start ("Start behind live", 15 s by default), as a fresh tune of that stream would. A steady stream's smaller need is unchanged, and so is a channel with the head start off. The aim-the-swap spec says so, with a scenario and its test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>