A join onto a slow stream keeps at most the head start in hand (#180) #182

Merged
cmoriarty merged 1 commit from slow-stream-join into main 2026-11-16 17:09:36 -05:00
Owner

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._needs now keeps at most the head start in hand ("Start behind live", 15 s by default), as a fresh tune of that stream would.

  • A steady stream's smaller need is unchanged. Germany vs. Netherlands' 8.3 s that day stays 8.3 s.
  • With the head start off, nothing changes.
  • The aim-the-swap spec 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

  • New test 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

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._needs` now keeps at most the head start in hand ("Start behind live", 15 s by default), as a fresh tune of that stream would. - A steady stream's smaller need is unchanged. Germany vs. Netherlands' 8.3 s that day stays 8.3 s. - With the head start off, nothing changes. - The `aim-the-swap` spec 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 - New test `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](https://claude.com/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>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
cmoriarty/sports-breaker!182
No description provided.