# M80. The tests in less time: what a test need not do **Package:** C21. With the counters of the coverage, 80 of the 658 tests of the core took 87 % of the time of all. The package was to give each of them the smallest problem that still shows what it asserts. That is not where the time was. This milestone took out what tests did that they had no use for, and says what is left. ## What was found **The time is not the counters alone.** Without them, on one thread, the tests of the core take 291 s of processor time, and with them 705 s. To build them fully optimized changes nothing, 690 s. Only the crates of the project carry counters, so the counters sit in the loops of the core itself. **Most of the slow tests are heavy for what they assert.** A sampler of stacks showed, line by line, where the slowest spend their time. Nearly all let the planner choose on a shape and then solve, to assert what it chose and how exact the solution is, or they assert an order over four degrees. A smaller problem would assert something else. Two tests that expect a panic take three seconds, which is the first start of a program of 280 MB and not the test. **What tests did without need:** - On shapes, a test that names its method called the planner for a plan and replaced the method. The planner solves on mesh after mesh to choose one. Seven helpers did so, for most tests of five files. - The examples of the documentation ran among the tests of Python that are measured, with the counters: 118 pages, 45 % of the time of those tests. Three lines of the core were reached by a page alone. - The test that compares bits on one thread and on four spent nearly all of its time in five of its 23 cases: steps in time to a tolerance of $10^{-10}$, and elements of the degrees 12 and 14. **CI has two cores.** There the tests of Python took ten minutes of a run, and the examples about half of that. ## Decisions ### D80.1. The examples of the documentation are tested with the package that users get *Developer, 2026-11-26.* `scripts/coverage.sh` leaves `test_docs.py` out, and `scripts/examples.sh` runs it: a stage of its own in the full check, and a step of the job of the documentation in CI. `scripts/test.sh` runs it with all other tests, as before. The floor of decision D6 is measured without the pages. What only a page reached has tests now: a quarter of a stadium, whose modes gain little from a higher degree, and a system on a shape that is solved without a plan. With them the tests reach one line more than before: 380 of 33 148 are missed, where it was 381. The coverage of Python is 100 % with and without the pages. The rule that follows: a line of the core is not covered by a page. A page shows, and a test asserts. ### D80.2. A test that names its method does not run the planner *Developer, 2026-11-26.* `shaped_tests::framed` gives the plan of a problem on a shape with a method of the caller: the grid of the output and the times, as the planner sets them for every plan on a shape. For one run of the tests it compared its grid and times with the planner's, in each of the 84 tests on shapes, and they were the same in every one. What is lost is that the planner ran on each of these problems and did not fail. What it chooses is asserted where a test asks for it, and the coverage of the planners is what it was. ### D80.3. The tests that are heavy stay as they are *Developer, 2026-11-26.* To halve the time of the slowest tests, their tolerances would have to be loosened or their problems replaced. Both change what is verified, and the project verifies against exact solutions with the order asserted. So they stay. The time of the checks is brought down by what runs side by side: package C23 for CI. ## What was built - **`shaped_tests::framed`**, used by the helpers `elements`, `layered`, `propagated` and `stepped` of the tests on shapes. - **`scripts/examples.sh`**, a stage of `scripts/check.sh` and a step of the job of the documentation. - **Two tests** for what only pages reached, and `lighter` in the test of the threads, which gives a method a looser tolerance in time and a lower degree. - **The workflow** says how the examples are tested and what a test need not do. ## What was measured On four cores. The full check took 799 s before milestone 79. | | Before | After | |---|---|---| | The tests of the core, processor time of all | 730 s | 638 s | | The tests of Python | 182 s | 72 s | | `scripts/coverage.sh` | 520 s | 362 s | | The examples, now a stage of their own | | 24 s | | The full check, `scripts/check.sh` | 707 s | 460 s | | Lines of Rust that no test reaches | 381 | 380 | **The run of CI of milestone 79**, which its record left to this one. The job of the documentation took 6 min 53 s, where the stage had taken 12 min: 3 min to build the package, with no cache yet for the new job, and 3 min for the pages. The job of the tests took 27 min on the pull request, on a slow runner, and 13 min on `main` right after, where it had taken 17. So a pull request waits 13 minutes on a runner as most are, where it waited 30. ## What was left - **Two jobs for the tests in CI** (C23, for the owner). - **The tests that let the planner choose on a shape** are the slowest that are left. They get faster when the planner does: packages C16 and C17. - **The tests of Python on regions** repeat, through the frontend, what tests of the core assert: 32 s of the 72. They assert what the frontend hands through, and were left.