A link's clock follows a source that falls behind steadily (#179) #184
Loading…
Reference in a new issue
No description provided.
Delete branch "link-clock-drift"
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 #179.
The fault
A link's clock was the largest
segment end timestamp − time first listedof the last 10 minutes. That holds while a stream's delay is steady. On 2026-11-16, shd247.world's sources listed media at 0.90× real time, so their delay grew about 6 s a minute.Joins were never wrong: they go by the timestamp relation.
The fix
offsets._driftmeasures how fast a link's clock falls behind from its own readings: the slope over the window, once there are three readings a minute apart. It is 0 for a steady source or one catching up.offsets._freshestcarries each reading forward by that drift before taking the largest.clock_of(the seconds shown) and_listed's restart check both go by it. A steady drift is no restart; a sudden jump still is.Checks
New test
test_a_source_slower_than_real_time_keeps_its_pairs_and_shows_its_lead_as_it_is_now: a standby at 0.9×, starting 5 s behind.The restart tests still drop the pairs on a real jump. All 25 offsets tests pass.
make test: 1,485 passed, 4 failed. All four failures were timeouts, while another project's Playwright run on the same Mac held the load average near 150:test_bare_machine_start("the service process did not answer in time");test_click_to_play_works_in_the_bare_run;test_hand_picked_game_starts_playing_on_click;test_a_comparison_that_runs_too_long_is_said_with_what_it_does_and_the_busy_threads.Run alone, the last two passed.
test_bare_machine_startfails the same way on #183's branch (no clock change) under the same load, though it passed in that branch's full lane earlier. The lane will be run again once the load drops, and the result added here.🤖 Generated with Claude Code
Second
make testrun, 22:07 UTC on6353c09: 1,448 passed, 41 failed, in 11 min, with the Mac's load average at 384 from another project's Playwright run.test_operator_opens_the_appandtest_click_to_play_works_in_the_bare_run, both browser tests.test_watch_offsets.pyfailed the same way, not on any clock assertion. It passed in the targeted run (test_offsets.pyandtest_watch_offsets.py: 25 passed).Not merged on that result. The branch now has
mainmerged in (03a7040, after #182 and #183). The lane runs again once the 5-minute load average is under 20, and its result will be added here.Third
make testrun, 23:10 UTC on03a7040(this branch withmainmerged in, after #182 and #183), with the load average at 1.7: 1,493 passed, 1 skipped, in 27 s. The earlier failures were the machine load.