Measuring: a source slower than about 0.67x is still taken for a new stream every 90 s (shd247.world) #190

Closed
opened 2026-11-17 15:15:05 -05:00 by cmoriarty · 0 comments
Owner

What happens

On 2026-11-17, on build 849c2f8 with #179's fix, shd247.world's links on the European friendlies listed media far slower than real time, stalling and bursting. Their playlists were on edge1 and edge2.candyshop.st. The watch read these paces:

  • 0.35 to 0.69 on Bosnia-Herzegovina vs. Romania and Denmark vs. Norway;
  • 0.0 to 0.64 on Poland vs. Sweden.

The app kept taking these links for new streams:

  • How often. Between 19:45 and 20:10 UTC, the five-minute summaries (offsets: in 300 s, …: N clock restarts) counted 28 clock restarts on four shd247 links. That is about one every 90 s per link.
  • How far. The log names only the first restart in each span, 13 in all:
    • drift-sized: −30.4, −30.7, −33.1, −37.5, −40.2, −46.8, −47.7, −52.8 and −55.6 s;
    • longer: −86.6, −171.3, −270.7 and −343.5 s.
  • What it cost. Each restart dropped the link's pairs, mostly before they had matched, so these links were rarely measured.
    • The Poland and Bosnia links never matched (0 of 4 and 0 of 2 results).
    • Denmark's link was found at 20:02, shown at −0.8 s and then −30.9 and −64.0 s as it fell behind. It was dropped at 20:05:15 by a −33.1 s jump.
    • The four links took 44 comparisons in those 25 minutes.

On 2026-11-16 the same site ran at a steady 0.90×, which #179 (PR #184) fixed. Tonight's slower, burstier listing is outside what that fix covers.

Why

  • The restart check. A standby's clock gets one reading per sample, about every 45 s. offsets._listed compares each reading with the clock carried forward by the link's drift (_freshest). A jump of more than 30 s (RESTART_SECONDS) is taken for a new stream: the readings are cleared and the pairs dropped.
  • Why a slow source trips it. The drift is measured only from three readings at least 60 s apart (DRIFT_MIN_READINGS, DRIFT_MIN_SECONDS).
    • After a clear, the second reading comes 45 s on and the third 90 s on.
    • At 0.6× the clock has fallen 36 s by the third reading, before any drift is measured, so the readings are cleared again.
    • So a source steadily slower than about 0.67× is never measured: two samples' fall, 2 × 45 × (1 − pace), exceeds 30 s. Stalls and bursts make it worse.
  • How a real restart differs. A clock cannot fall behind by more than the time that has passed: a slow or stalled source's timestamps still advance, only more slowly, or not at all. A new stream behind a link shows as timestamps that go back or leap ahead. Tonight's real restarts moved its clock by −3,551.6, −3,762.9 and −18,284.1 s.
  • A limit to keep in mind. A stream more than 150 s behind the stream playing cannot match in any case: that is the sound kept to search in (HEARD_SECONDS). At 0.5× that point comes after about five minutes. So the gain is in the first minutes of such a link, and in far fewer drops, comparisons and log lines.

Done when

  • Slow is not a restart. A link whose timestamps keep advancing, however slowly or in bursts, keeps its readings and its pairs. One way to do it: decide a restart from the link's own timestamps (they went back, or leapt ahead of the time that passed), not from the distance to the carried-forward clock.
  • Real restarts still drop. A stream whose timestamps go back or leap ahead still drops its pairs, as now.
  • Tests:
    • A source at 0.5× with stalls and bursts keeps its pair for 10 minutes, with no restart, and its shown lead follows how far behind it is.
    • A restart with new timestamps still drops the pairs.
    • The 0.9× test from #179 still passes.
## What happens On 2026-11-17, on build 849c2f8 with #179's fix, shd247.world's links on the European friendlies listed media far slower than real time, stalling and bursting. Their playlists were on edge1 and edge2.candyshop.st. The watch read these paces: - 0.35 to 0.69 on Bosnia-Herzegovina vs. Romania and Denmark vs. Norway; - 0.0 to 0.64 on Poland vs. Sweden. The app kept taking these links for new streams: - **How often.** Between 19:45 and 20:10 UTC, the five-minute summaries (`offsets: in 300 s, …: N clock restarts`) counted 28 clock restarts on four shd247 links. That is about one every 90 s per link. - **How far.** The log names only the first restart in each span, 13 in all: - drift-sized: −30.4, −30.7, −33.1, −37.5, −40.2, −46.8, −47.7, −52.8 and −55.6 s; - longer: −86.6, −171.3, −270.7 and −343.5 s. - **What it cost.** Each restart dropped the link's pairs, mostly before they had matched, so these links were rarely measured. - The Poland and Bosnia links never matched (0 of 4 and 0 of 2 results). - Denmark's link was found at 20:02, shown at −0.8 s and then −30.9 and −64.0 s as it fell behind. It was dropped at 20:05:15 by a −33.1 s jump. - The four links took 44 comparisons in those 25 minutes. On 2026-11-16 the same site ran at a steady 0.90×, which #179 (PR #184) fixed. Tonight's slower, burstier listing is outside what that fix covers. ## Why - **The restart check.** A standby's clock gets one reading per sample, about every 45 s. `offsets._listed` compares each reading with the clock carried forward by the link's drift (`_freshest`). A jump of more than 30 s (`RESTART_SECONDS`) is taken for a new stream: the readings are cleared and the pairs dropped. - **Why a slow source trips it.** The drift is measured only from three readings at least 60 s apart (`DRIFT_MIN_READINGS`, `DRIFT_MIN_SECONDS`). - After a clear, the second reading comes 45 s on and the third 90 s on. - At 0.6× the clock has fallen 36 s by the third reading, before any drift is measured, so the readings are cleared again. - So a source steadily slower than about 0.67× is never measured: two samples' fall, 2 × 45 × (1 − pace), exceeds 30 s. Stalls and bursts make it worse. - **How a real restart differs.** A clock cannot fall behind by more than the time that has passed: a slow or stalled source's timestamps still advance, only more slowly, or not at all. A new stream behind a link shows as timestamps that go back or leap ahead. Tonight's real restarts moved its clock by −3,551.6, −3,762.9 and −18,284.1 s. - **A limit to keep in mind.** A stream more than 150 s behind the stream playing cannot match in any case: that is the sound kept to search in (`HEARD_SECONDS`). At 0.5× that point comes after about five minutes. So the gain is in the first minutes of such a link, and in far fewer drops, comparisons and log lines. ## Done when - **Slow is not a restart.** A link whose timestamps keep advancing, however slowly or in bursts, keeps its readings and its pairs. One way to do it: decide a restart from the link's own timestamps (they went back, or leapt ahead of the time that passed), not from the distance to the carried-forward clock. - **Real restarts still drop.** A stream whose timestamps go back or leap ahead still drops its pairs, as now. - **Tests:** - A source at 0.5× with stalls and bursts keeps its pair for 10 minutes, with no restart, and its shown lead follows how far behind it is. - A restart with new timestamps still drops the pairs. - The 0.9× test from #179 still passes.
Sign in to join this conversation.
No labels
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#190
No description provided.