Repository navigation
Make the slow tests small: no million-node searches in the suite - #12
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The nine
slowtests 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 theslowmarker 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 bymanifest.restrict, with unit tests that include refusing a fixture the manifest does not name.--onlyon the fixtures outsidesupport.corpus.EXPENSIVEand 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 outrat2-flat, where CP-SAT takes 80 s.cor1-flatstops, the margin under the node limit, where the prototype stops, and the assembly counts.CLAUDE.md, the roadmap,docs/experiments.mdand both manifests say what changed and what is given up.What is given up
No automated test searches
new1-flatornew2-flatto 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):A solver change that could move those counts should be checked this way before merging.
How it was checked
ruff,pyrightand the whole suite pass locally.corpus.mdwas 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.mdsaid 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