wai: a from-rest burst asserted a 2 ms race, and linux-arm64 called it #192
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/wai-burst-race-assertion"
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?
a_from_rest_burst_counts_only_work_begun_inside_the_windowasserted, inside thesampler callback, that at most one unit of work per worker had begun by the
instant the window opened:
Nothing in
burst_from_restentails that. Once the barrier releases, eachworker increments the counter and sleeps 2 ms; the caller then calls the closure.
For
begunto exceed the worker count, the caller need only be descheduled forlonger than that 2 ms at exactly this point. It is a race the test does not
control, not a property of the code under test.
A contended host duly called it: the assertion failed on the
linux-arm64runner — a colima VM on a box at load 173 — while every other platform passed.
On the basis for this change
I could not reproduce it here, including under 28 competing busy loops. So
this is reasoned from the code and the CI log, not from a local repro, and that
is the honest basis for it.
The argument does not need one: an assertion nothing establishes can fail without
a defect, and the failing run is evidence that it does. The quantity is now
recorded rather than asserted — it printed
2on the first local run, alreadybelow the old bound, which is exactly the variance the bound was pretending to
constrain.
Nothing is lost
What the test establishes about starting from rest is asserted elsewhere and does
not depend on scheduling:
FromRest;That last one bounds a difference by the worker count, instead of asserting
that a particular instant arrived before a 2 ms sleep finished — so it holds
however the host schedules the threads. It now also says what it saw when it
fails. Falsified by making the helper over-count completions:
The fifth copy of this family
eoc-meter,jouleclaw-energy(#166),proof-cascadeandsandbox-meter(#181) each put a floor on something the host's scheduler controls. This one
puts a ceiling on how much work fits in an interval it does not control. Same
mistake, opposite direction.
Verification
wai-rslib 187 passed, clippy clean on the touched file.Pre-existing and untouched by any branch of mine — it surfaced on #183 (a
mesh-only change) only because a rebase fires every path-filtered workflow, which
is what #191 fixes.
🤖 Generated with Claude Code
`a_from_rest_burst_counts_only_work_begun_inside_the_window` asserted, inside the sampler callback, that at most one unit of work per worker had begun by the instant the window opened: assert!(begun <= 3, "no more than one unit per worker can have begun"); Nothing in `burst_from_rest` entails that. Once the barrier releases, each worker increments the counter and sleeps 2 ms; the caller then calls the closure. For `begun` to exceed the worker count the caller need only be descheduled for longer than that 2 ms at exactly this point. It is a race the test does not control, not a property of the code under test. A contended host duly called it: the assertion failed on the `linux-arm64` runner — a colima VM on a box at load 173 — while every other platform passed. I could not reproduce it here, including under 28 competing busy loops, so this is reasoned from the code and the CI log rather than from a local repro, and that is the honest basis for it. The argument does not need one: an assertion nothing establishes can fail without a defect, and the failing run is evidence that it does. The quantity is now recorded rather than asserted — it printed 2 on the first local run, already below the old bound, which is the variance the bound was pretending to constrain. Nothing is lost. What the test establishes about starting from rest is asserted elsewhere and does not depend on the scheduling: the window opened `FromRest`, every worker was in flight, and completions never exceed starts by more than the worker count. That last one bounds a *difference* by the worker count instead of asserting an instant arrived before a sleep finished, so it holds however the host schedules — and it now says what it saw when it fails. This is the fifth copy of this family in the repo. `eoc-meter`, `jouleclaw-energy` (#166), `proof-cascade` and `sandbox-meter` (#181) each put a floor on something the host's scheduler controls; this one puts a ceiling on how much work fits in an interval it does not control. Same mistake, opposite direction. wai-rs lib: 187 passed, clippy clean on the touched file. Pre-existing and untouched by any branch of mine — it surfaced on #183 only because a rebase fires every path-filtered workflow (#191). Co-Authored-By: Claude Opus 5 <[email protected]>