From 8131f579bf3bc669cb47f6002fd2d6e76c75ef49 Mon Sep 17 00:00:00 2001 From: Aaron Miller Date: Mon, 31 Aug 2026 15:16:32 +0100 Subject: [PATCH 01/14] =?UTF-8?q?docs(benches):=20=F0=9F=93=9D=20the=20ben?= =?UTF-8?q?chmarking=20ladder=20for=20sensitive=20PRs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaces the rung runner with the document it was wrapping. `benches/LADDER.md` names four groups of benchmark configurations at the sizes the library is used at — L1 one thread at ~10M terms, L2 one node at ~1B, L3 the same problems on four nodes, L4 the strong and weak scaling ladders — each as the exact pytest flags and `-k` selector that produce it, run through the ordinary `just bench` route. No CLI, no TOML schema, no gate, and nothing to recalibrate but a term count in a table. The sizes, term counts and costs are the 2026-08-27 campaign's; time and memory are rounded to a figure that sizes a job rather than quoted as a baseline. Co-Authored-By: Claude Opus 5 (1M context) --- benches/LADDER.md | 240 +++++++++++++++++++++++++++++++ benches/README.md | 4 +- benches/conftest.py | 6 +- docs/content/docs/benchmarks.mdx | 160 +++++++++++++++++++++ 4 files changed, 407 insertions(+), 3 deletions(-) create mode 100644 benches/LADDER.md diff --git a/benches/LADDER.md b/benches/LADDER.md new file mode 100644 index 00000000..7aabdb5c --- /dev/null +++ b/benches/LADDER.md @@ -0,0 +1,240 @@ +# The benchmarking ladder for sensitive PRs + +Four groups of benchmark configurations at the sizes monoprop is used at. Each row gives the +pytest flags and the `-k` selector that produce it, so a group is a handful of ordinary +`just bench` invocations — there is no separate runner, no table format and no gate. + +**Nothing runs these for you, and no benchmark gates a pull request.** Run the group your change +could plausibly move, on your branch **and** on its merge base, and put both sets of numbers in the +PR. Quote the `_core.so` md5 from each run's `meta` block: it is the only thing that identifies +which binary produced a number. + +## Which group + +| a change to | run | +| --- | --- | +| a kernel, encoding or data structure | L1, then L2. Hubbard makes 29 `propagate` calls and pauli 1, so a per-call cost shows on one and hides on the other | +| the graph build or contraction | L2's graph and eval rows, both pictures | +| MPI, routing, exchange or placement | L4. A communication cost is a function of `P` = ranks × partitions, not of node count | +| memory layout or allocation | L1 **and** L2. The per-term and the per-process terms of the memory cost only separate across sizes | +| ranks per node, or anything paid per process | L2 against L3 — same cores per node, 1 rank against 8 | + +## Running one row + +```bash +uv sync --all-groups --all-extras # once +just bench L1-hubbard --hubbard-cutoff=10 --hubbard-lower-atol=4.2e-05 \ + -k "test_model_propagate and hubbard" +``` + +`LABEL` is one column in `benches/results/REPORT.md`, so name it for the group, the row and the +arm: `L1-hubbard-branch`, `L1-hubbard-base`. Each run writes `results/time-