Skip to content

Make the slow tests small: no million-node searches in the suite - #12

Merged
madeline-v-brandt merged 1 commit into
mainfrom
smaller-slow-tests
Nov 16, 2026
Merged

madeline-v-brandt merged 1 commit into
mainfrom
smaller-slow-tests

Conversation

@kuvychko

Copy link
Copy Markdown
Member

What

The nine slow tests took 12¾ minutes. Most of that was three footprint searches (new1-flat, new2-flat, cor1-flat, 909 750 to 1 500 000 nodes each), each run several times across the tests. This PR keeps every check but runs it on fixtures that are cheap to search. The whole suite now runs in about 2 minutes (1617 tests), and the slow marker is gone.

  • maxplus-bench run --only FIXTURE... runs a manifest on some of its fixtures, every run on them unchanged. Its table is exactly the full table's rows for those fixtures. It is backed by manifest.restrict, with unit tests that include refusing a fixture the manifest does not name.
  • The table tests (phase 7's exit criterion, and the edge-to-edge table) run their manifest --only on the fixtures outside support.corpus.EXPENSIVE and compare those rows of the committed tables exactly. They went from 333 s and 95 s to about 5 s each. The corpus one also leaves out rat2-flat, where CP-SAT takes 80 s.
  • The rows left out are read, not reproduced. A new test holds them to what the documents claim: where cor1-flat stops, the margin under the node limit, where the prototype stops, and the assembly counts.
  • The per-fixture exit tests of phases 5, 6 and 8 leave out the same fixtures instead of marking them slow.
  • CLAUDE.md, the roadmap, docs/experiments.md and both manifests say what changed and what is given up.

What is given up

No automated test searches new1-flat or new2-flat to the end any more. Their rows in the committed tables are checked against a search only when someone runs the full command by hand (about 6 minutes):

uv run maxplus-bench run benchmarks/manifests/corpus.toml --no-times
uv run maxplus-bench run benchmarks/manifests/edge_to_edge.toml --no-times

A solver change that could move those counts should be checked this way before merging.

How it was checked

  • ruff, pyright and the whole suite pass locally.
  • Each new check was seen to fail. A cheap row of corpus.md was broken by hand, and the reproduction test failed. An expensive row of each table was broken by hand, and the claims tests failed. The tables were then restored.

The lesson

CLAUDE.md said the slow tests took "tens of seconds" and that CI runs everything. By now they took 12¾ minutes, so nobody ran them locally. They were checked only in CI, after the fact, and the description of them had quietly stopped being true. A test that is too slow to run is not doing its job, and moving it out of the way with a marker hides the cost without paying it.

The fix was not to delete the checks, nor to run them less often. It was to ask what each one needs to see. A reproduction test needs to see the mechanism reproduce a table exactly. It does not need the most expensive rows to do so. Those rows are a record of results: they get checked for consistency with the documents on every run, and re-derived by hand when a solver change could move them. That trade-off is now written down where the next person will find it, instead of hidden behind -m "not slow".

As a rule of thumb, when a test gets slow, shrink what it runs before you mark it, and write down what the smaller test no longer proves. A useful test must be fast enough to be executed regularly.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Jfg9ffdDE7wGdk3wwUWE5H

The nine slow tests took 12 3/4 minutes, mostly whole footprint searches of
new1-flat, new2-flat and cor1-flat (909 750 to 1 500 000 nodes) run again
and again. They are narrowed rather than deselected:

- maxplus-bench run --only FIXTURE... runs a manifest on some of its
  fixtures, every run on them unchanged, so its table is the full table's
  rows for them (manifest.restrict, with unit tests and refusals).
- The corpus and edge-to-edge table tests run their manifest --only on the
  fixtures outside support.corpus.EXPENSIVE and compare those rows of the
  committed tables exactly: 333 s and 95 s become 5 s each. The corpus test
  also leaves out rat2-flat, where CP-SAT takes 80 s.
- The rows left out are read from the committed tables and held to what the
  documents claim (where cor1-flat stops, the margin under the node limit,
  where the prototype stops, the assembly counts).
- The per-fixture exit tests of phases 5, 6 and 8 leave out the same
  fixtures instead of marking them slow. The slow marker is gone.

What is given up: no automated test searches new1-flat and new2-flat to the
end. Their rows are checked only by running the full command by hand.
CLAUDE.md, the roadmap, experiments.md and the manifests say so.

Each new check was seen to fail on a hand-broken committed table (a cheap
row, an expensive row in each table). The whole suite runs in about two
minutes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jfg9ffdDE7wGdk3wwUWE5H
@madeline-v-brandt
madeline-v-brandt merged commit 5b482e0 into main Nov 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants