Close the timeout against waits derived from the argument, not only constants

The two bands ruled out a constant and ruled out nothing else. Any mapping that
is the identity at 200 and 900 passed for free, and the late tolerance was a flat
300 ms, so anything within that of the truth passed at every value forever.
Three ordinary ones survived all five scenarios on both targets: clamping the
wait to at most a second, adding 150 ms to it, and scaling it by six fifths.

The clamp is the one that matters. Its failure is verbatim the bug the last pass
claimed to fix — a host asking for five seconds gets one, forever, with nothing
reporting it — and "cap the wait so a shutdown gets noticed" is the most ordinary
spelling that line will ever be given.

So the long probe goes to 5000, above any ceiling a bridge would plausibly clamp
to, which kills the clamp and the scale on the early check and the late one. And
the late tolerance becomes a fraction of what was asked for — 60 ms plus an
eighth — which is what kills the offset: 150 ms is 75% late at the 200 ms probe
and there is no flat gap left to hide in. Measured overshoot on either target is
about 10 ms, against 85 ms allowed at the short probe and 685 at the long.

The table gets the clamp as an entry of its own, because the whole lesson here is
that a table of constants says nothing about a wait computed from the argument,
and a table of constants would go green again the moment these numbers drifted
back. Its honest limit is stated where the tolerance is defined: a scaling
smaller than an eighth survives, and nothing here claims otherwise.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-09-17 02:45:57 +02:00
commit c682619fbd
2 changed files with 53 additions and 11 deletions

View file

@ -478,10 +478,18 @@ 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, 200 ms and 900 ms, and measures. That is what makes
// a constant unsurvivable rather than merely unlucky: no single value sits in
// both bands, so the entries below are two sides of one rule and not two
// numbers to be tuned against.
// `polltimeout` asks twice and measures. That is what makes a constant
// unsurvivable rather than merely unlucky: no single value sits in both 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
// 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
// constants would go green again the moment those numbers drifted back.
{
target: "native",
honestOn: ["linux-x64", "win32-x64"],
@ -498,6 +506,19 @@ const mutations = [
old: "std::chrono::milliseconds(timeout_ms),",
new: "std::chrono::milliseconds(2000),",
},
{
target: "native",
honestOn: ["linux-x64", "win32-x64"],
// The derived wait, which is the shape the two constants above do not cover
// and the most ordinary spelling this line will ever be given: cap the wait
// 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.
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 close's wake. It was defended by committed code and had no entry, so the
// table understated what `closerace` covers; these say it.
{