From 72cc0cb89cd55315a3b463532cf41fa736688d20 Mon Sep 17 00:00:00 2001 From: "@permadeath.com" Date: Sun, 30 Aug 2026 08:49:32 -0400 Subject: [PATCH] docs(harness): what the unbounded test run cost, and why clippy keeps -j 2 A concurrent benchmark went 66-74s a match to 113 and back to 44-55. And the clippy hook is correct as it stands - clippy is a compiler, with no second binary downstream for -j to miss. Change-Id: I448bf2a778237bdb1daf16bf81ff8d96db5a0292 --- plan/harness.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/plan/harness.md b/plan/harness.md index 5279c79..4fbd748 100644 --- a/plan/harness.md +++ b/plan/harness.md @@ -306,6 +306,31 @@ the expensive work was done. the source rather than after the fact. It is a protocol change and a breaking one, so it needs its own argument +## What the unbounded test run cost a benchmark + +The fix is in `prek.toml` and `CLAUDE.md` already - `cargo test -j 2` bounds +compilation and not the tests, and `-- --test-threads 2` is the flag that +reaches them. Two things about it are recorded here rather than there, because +neither belongs in a comment beside a hook. + +**What it cost, which is why anybody should care.** A 240-match benchmark +running beside unbounded test binaries went from **66-74 seconds a match to +113**, and recovered to 44-55 once the flag was in use. That is a benchmark +taking half again as long for the whole time somebody else is running a test +suite, on a machine where four agents share sixteen cores. The defect is a flag +that did not reach its target; the consequence is every concurrent measurement +being slower and noisier than it reads. + +**`cargo clippy -j 2` is correct as it stands and must not be "fixed" too.** +This is written down because the obvious next move, on seeing the test hook +gain `--test-threads`, is to make the clippy hook consistent. It should not be. +Clippy is a compiler: `-j` is cargo's job count and it is exactly the right +knob there, because there is no second program with a thread pool of its own +downstream of it. The asymmetry is the point - `cargo test` produces a *binary* +that then runs, and that binary is what `-j` never reached. + +- [x] Considered and deliberately left: the clippy hook keeps `-j 2` alone + ## A scenario played twice from the same side The seat was `game % 2` and the scenario was `game % len(scenarios)`, so a -- 2.51.2