Probe the host's timeout at 15, 200 and 7300 ms, and stress the tolerance

Soul's sixth pass (N2): with probes at 150, 200 and 5000 ms, `min(t,5000)`,
`min(t,4990)`, `t*11/10` and `t+70` survived both targets, `max(t,220)`
survived linux-x64, and `max(t,250)` and `t+80` died by 22 and 2 ms. "5000 is
above any plausible ceiling" was wrong: 5000 is a round ceiling.

- A 15 ms probe, asked ten times with the fastest checked against 30 ms. It
  is the only place a floor or an added constant shows. Scheduler delay only
  adds, so noise has to delay all ten attempts to fail the bridge.
- The long probe is 7300 ms, which is not a round number.
- A single poll gets 60 ms plus a sixteenth of the timeout.
- Each timed scenario prints its worst overshoot per probe.
- Three harness entries: a round clamp `min(t,5000)`, a floor
  `max(t,100)` and an offset `t+100`.

Stressed with two busy threads per logical CPU (16 on 8), five rounds of
every timed scenario on both targets. At normal priority, Windows put a
single poll up to 127 ms late and the fastest of ten 15 ms attempts up to
87 ms late, and a 45 ms tolerance failed the unmutated bridge in four rounds
of five. The timed scenarios therefore raise their own process to
HIGH_PRIORITY_CLASS on win32-x64, which needs no privilege. With that, the
worst single-poll overshoot was 15 ms on win32-x64 and 41 ms on linux-x64,
at normal priority there. The fastest 15 ms attempt was 0 ms late on both.

The limit in source is measured, not asserted. Each boundary mutant was
compiled in and run on both targets:
- `t+25` survived and `t+40` died;
- `max(t,40)` survived and `max(t,50)` died, on linux-x64 by 5 ms;
- `t*106/100` survived and `t*108/100` died;
- `min(t,7285)` survived and `min(t,7275)` died.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-09-22 01:59:37 +02:00
commit 37967e8b9b
2 changed files with 159 additions and 50 deletions

View file

@ -478,17 +478,17 @@ const mutations = [
// for five seconds silently got two, and every consumer's poll loop spun at two
// and a half times the rate it asked for.
//
// `polltimeout` asks twice and measures. That is what makes a constant
// unsurvivable rather than merely unlucky: no single value sits in both bands,
// `polltimeout` asks three times and measures. That is what makes a constant
// unsurvivable rather than merely unlucky: no single value sits in two bands,
// so the first two entries below are two sides of one rule and not two numbers
// to be tuned against.
//
// A constant was never the hard case, though. A wait computed from the
// argument is identity wherever the probes are, and passes for free: the two
// argument is identity wherever the probes are, and passes for free: the
// bands rule out a constant and rule out nothing else. Clamping, adding and
// scaling all survived the whole matrix once, on bands of 200 and 900 with a
// flat late tolerance of 300 ms. The scenario's numbers are what closed that,
// and the third entry is here so nothing reopens it quietly — a table of
// and the entries after the constants are here so nothing reopens it quietly — a table of
// constants would go green again the moment those numbers drifted back.
{
target: "native",
@ -514,11 +514,39 @@ const mutations = [
// so a shutdown gets noticed. Its failure is verbatim the one the scenario
// exists for — a host asking for five seconds gets one, forever, with
// nothing reporting it — and it is identity at any probe below the cap, so
// it is the long probe's height that kills it rather than the two bands.
// it is the long probe's height that kills it rather than the bands.
rule: "the wait is on the host's timeout (loosening: the bridge caps it at a second)",
old: "std::chrono::milliseconds(timeout_ms),",
new: "std::chrono::milliseconds((std::min)(timeout_ms, 1000)),",
},
// The same clamp at a round ceiling nobody would call short. It survived both
// targets while the long probe was 5000, where it is the identity; the probe is
// 7300 now so that no round ceiling sits on it.
{
target: "native",
honestOn: ["linux-x64", "win32-x64"],
rule: "the wait is on the host's timeout (loosening: the bridge caps it at a round five seconds)",
old: "std::chrono::milliseconds(timeout_ms),",
new: "std::chrono::milliseconds((std::min)(timeout_ms, 5000)),",
},
// A floor and an added constant are the whole wait at a small timeout and a
// rounding error at a large one, so only the 15 ms probe sees them. Both
// survived every probe while the smallest was 150 ms. The scenario's source
// states how small a floor or offset still survives.
{
target: "native",
honestOn: ["linux-x64", "win32-x64"],
rule: "the wait is on the host's timeout (loosening: a floor, so a polling host cannot spin)",
old: "std::chrono::milliseconds(timeout_ms),",
new: "std::chrono::milliseconds((std::max)(timeout_ms, 100)),",
},
{
target: "native",
honestOn: ["linux-x64", "win32-x64"],
rule: "the wait is on the host's timeout (loosening: a little grace added to it)",
old: "std::chrono::milliseconds(timeout_ms),",
new: "std::chrono::milliseconds(timeout_ms + 100),",
},
// The seam's own rule, and the only non-comment source change of the last pass
// that nothing pinned. It is development-only and folds away in release, so
// nothing shipped was at risk; it is still the shape this campaign keeps