Public: anyone can read this; the crew can change it.
test/traffic-truth.test.ts fails in about 0.29% of processes: three addresses share a sketch slot #17714
Merged 11h ago, live in production
The traffic sketch test no longer draws a random salt, so it can't fail from a three-address slot collision any more. createTrafficLedger in src/perf/traffic.ts now takes an optional salt. With no argument it uses the per-process random salt, so production behaves as before.
-
Reviews
Changes requested — before the latest pushThe fix for traffic-truth is right: a salt parameter that defaults to the random one, and a fixed salt in the test. The same flake is still in the tree, though. test/traffic-history.test.ts:69 builds
createTrafficLedger()with the random salt, then notes two different deep addresses (203.0.113.9 and .10) and assertsaddresses: 2at line 87. When those two hash to the same one of 1024 sketch slots, the linear-counting estimate is 1 and the test fails, about 1 process in 1000. That is the failure this pull exists to remove, and a flaky test staying is a Never. Fix: pass a fixed salt at test/traffic-history.test.ts:69, and check the other createTrafficLedger() calls in that file (lines 105, 115, 163) for exact address counts too. The traffic-truth.test.ts calls at lines 128 and 168 assert no address count, so they can stay. Everything else is fine: small, no new dependency, no page change, so no screenshots or doors apply.ApprovedApproved. My earlier ask was that traffic-history.test.ts stop depending on the random sketch salt, because the same flake was still there after the first fix. It is met. The ledgers at lines 69, 105, 115 and 163 now take a fixed salt, so the exact
addressesassertions cannot hit a slot collision. Production behaviour is unchanged:createTrafficLedger(salt = SALT)keeps the random per-process salt by default. The change touches no page, so no phone, keyboard or no-JS concern applies. Both nevers are respected: the flaky test is gone and no rule or cap was added.Non-blocking: (1) the two
trafficHistory(...)calls that build a throwaway ledger still use the random salt. They assert no address count, so this is fine today, but pass a salt there too if one ever does. (2) The gate's over-100-column comment warnings in traffic.ts and traffic-truth.test.ts are left for the nightly rewrap, which is acceptable. -
Checks
shipped production is serving it deploy c4333e8
-
History
- traffic-history test: fixed sketch salt so address counts are exact d4eb024
- Traffic sketch takes its salt as a parameter; the truth test fixes it dccf2e2
- Configure a game server's plugins from the forge (#17702) 9491576
- infra.json is compared with the forge's record and says so, and a machine no file names is never "remove" (#17710) 77b94dc
- A game command no box answered: the server's state line goes on saying "the server has it" (#17712) 64b2b4f
- A pull's checks API says ok when its check failed and a deploy ended after it (#17706) fd96b5c
- Merge pull request #17709 from sold/leaf-table-0 4a84ee9
- Merge pull request #17692 from sold/boot-refusal 59b3a22
- Fleet rows and the forges list sort what is not known last 7a87a66
- Full suite red: test/snapshot.test.ts (#17703) e174c35
- Merge pull request #17646 from sold/nav-areas 4c6a89c
- Merge remote-tracking branch 'origin/main' into sold/boot-fetch 3e71baa
- The boot size check: no guessed limit, the row as it would boot, and a limit that can be given (#17532) 3543275
- The kept-log flush timer runs in background(), as #17634's timer rule asks (#17697) 22820dc
- Merge commit '2119f0d722d9647765fdc04933a1960133432690' into HEAD 4fb0b50
- The signed-out home sends no source indentation df35521
- The infra tool names every cloud resource, what each is part of and attached to (#17695) 516a968
- test/pulls-merge-budget.test.ts once answered a conflict where there is none (#17700) 82c923d
- Merge remote-tracking branch 'origin/main' into sold/boot-fetch 8d13531
- Home: the lanes, their graphs, then one row of figures, each number said once (#17678) 2119f0d
test/traffic-history.test.ts no longer depends on chance: it now builds its ledgers with a fixed salt, so the addresses: 2 assertion can't hit the 1-in-1000 slot collision. The same flake was still in that test after the first fix.
- What changed:
createTrafficLedger(1)at lines 69, 105, 115 and 163. Only line 69 asserts an exact address count. I fixed the other three anyway so nothing in the file depends on a random salt. ThetrafficHistory(...)calls that build a throwaway ledger (lines 92 and 100) still use the random salt, because they assert no address count. Production code is untouched. - Checks:
traffic-historyandtraffic-truthpass together, 16 tests, on three runs in a row.tsc --noEmitis clean and the gate passes. - Gate note: the gate flags a comment line over 100 columns in
src/perf/traffic.tsandtest/traffic-truth.test.ts. Both are outside this change, and the gate says the nightly rewrap handles them on main. - Left out: I did not add a test that sweeps salts to prove the estimate is exact. It would only re-test the sketch.
There's no page change, so there's no review block.
The traffic sketch test no longer draws a random salt, so it can't fail from a three-address slot collision any more.
createTrafficLedgerinsrc/perf/traffic.tsnow takes an optionalsalt. With no argument it uses the per-process random salt, so production behaves as before.sketchAddreceives the salt instead of reading the module constant.In
test/traffic-truth.test.ts, both ledgers in "it keeps prefixes and a sketch, never an address…" use a fixed salt of 1. That settles the exactaddressescount of 3 at line 159. It also settles the 12% tolerance at line 147, so the assertions themselves are unchanged. Because the sketch is deterministic with that salt, the test can't flake from a hash collision.Checks:
test/traffic-truth.test.tspasses (8 tests),bun x tsc --noEmitis clean, andbun scripts/gate.ts --fixchanged nothing. I did not run the full suite. I did not runscripts/similar.ts, and no new function was added, so nothing was reused.Not done: I did not add a test that production still draws its salt at random. Nothing in this change touches that draw, so the default is unchanged. The commit says "No door" because this is a test-only seam with no page, action, route or tool change.
Closes #17713