Repository navigation
Commit 4a2f8ca
test(governor): a hold the machine held back is measured again on the machine's own evidence, and the wait for room ends only on room that lasts
The macOS leg of run 40204757033 failed holds_nineteen_percent_of_this_machine_for_ten_seconds:
"mean of the last half 0.1393 is outside ±0.05 of 0.19 (the machine was idle for 0.0572 of
it)". The native code is unchanged since the last green run. The runner was overloaded for the
whole hold: the sampling thread was woken more than a whole 100 ms period late at four samples
of the second half, and later than asked at most of the rest. The workers used what the
controller allowed (0.1391 of 0.1434), so the shortfall was in what the controller allowed, on
a machine with almost nothing idle. The old rule measured a hold again only when the mean idle
share of the second half was within the band (0.05), so 0.057 failed the test on its first try.
A hold short of the band is now measured again when the second half shows a full machine in
either of two ways, each at least twice (once may be a blip: macOS read 1.000 here at one moment
of a half that was 0.76 idle):
- a machine reading at or over the controller's own line (MACHINE_FULL_SHARE), at which the
controller holds its duty rather than wind it up against work that is not its own;
- the sampling thread woken a whole period late, which means no core was free for it.
The hold report keeps each machine reading it took (machine_busy, Rust only: skipped when the
report is serialized for Node, whose keys nativeLoader pins). The wait for room before the next
hold now ends only after three readings in a row with room: with eight busy loops on this Mac's
eight cores, one reading of 0.40 idle in 50 s used to end it.
This changes only when a hold is measured again. The last of the three attempts is still held to
the band whatever the machine did, and its message now says how many readings found the machine
full and how many wakeups came late, and names only the signs it saw. A governor that really
under-holds still fails: with the controller's duty capped at a quarter it held 0.038 of 0.19 on
this Mac, and the test failed on the band with the machine 0.85 idle.
Checked: 17 hand mutants of the predicate, the wait, the message and the report field, each red
and restored by SHA-256. The hold test on this Mac (8 cores): 10 of 10 passed at once under 4
busy loops; 5 of 5 failed honestly under 10, after three attempts, each naming a machine full at
nearly every reading; and under 10 busy loops for the first 8 s of each run, 6 of 6 held 0.10
to 0.14 at the first attempt, measured again and passed at 0.19. The second halves of those six
first holds were 0.18 to 0.29 idle, so the old rule would have failed all six at once.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>1 parent b788ae9 commit 4a2f8ca
3 files changed
Lines changed: 439 additions & 27 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
235 | 243 | | |
236 | 244 | | |
237 | 245 | | |
| |||
281 | 289 | | |
282 | 290 | | |
283 | 291 | | |
| 292 | + | |
284 | 293 | | |
285 | 294 | | |
286 | 295 | | |
| |||
390 | 399 | | |
391 | 400 | | |
392 | 401 | | |
| 402 | + | |
393 | 403 | | |
394 | 404 | | |
395 | 405 | | |
| |||
0 commit comments