Searching for Runge-Kutta methods that survive fixed-point arithmetic

An unattended search for Runge-Kutta coefficients, scored by code it cannot edit.

Textbook Runge-Kutta coefficients are tuned for exact arithmetic. A microcontroller without an FPU rounds every multiply down, so the error always leans the same way. This project is an unattended search for the coefficients that do best after that rounding. Each candidate is scored on its end-to-end error in Q15 at a fixed cycle budget, modeled for a Cortex-M0+ rather than measured on one.

The result, in one interaction

11 Runge-Kutta methods, 8 textbook and 3 found by the search, ranked by their error at an equal 65,536-cycle budget. On the left every multiply rounds down, which is what a Cortex-M0+ without an FPU does. On the right it rounds to nearest, as the textbooks assume. Hover a line to follow one method across, or tap it to keep it lit and read both of its ranks under the chart. A tap anywhere else hides the ranks and leaves the line lit. With the chart focused, the arrow keys move from method to method and Escape clears the choice. The buttons switch problems.

test problem

Open the demo → Change the method and the problem and watch the trajectory quantize.

problem

Textbook coefficients assume arithmetic the chip does not have

Runge-Kutta tableaus are derived by cancelling truncation error in exact arithmetic. A Cortex-M0+ has no FPU, so the state lives in Q15 and every multiply ends in a right shift that rounds down, biasing each product by half an LSB in the same direction. The adjacent literature analyzes fixed methods under round-to-nearest and stochastic rounding in low-precision floating point; this run searches the tableau space against directed floor rounding in fixed point (related work).

the premise, tested before the search →
approach

Score end-to-end error at a fixed cycle budget, and pin the scorer

Fitness is the error a method delivers within 65,536 cycles, so a cheap method gets to take more, smaller steps. Cost is counted analytically from the tableau under two Cortex-M0+ multiplier models. CMA-ES fills a MAP-Elites grid, and a language model in the outer loop chooses where to search but never touches the scorer. Ten files are hashed, and the container will not start if the hash changes.

how the system is built →
result

Floor rounding is a bias the search can use

On one test problem the true answer is smaller than one Q15 step, and the bias carries the cheapest method to the closest value the format has, while rk4, the textbook favorite, ends up several times further away. Searched against that bias, the best coefficients are not the textbook ones. The same problem is where the format reports rather than the method: each of the 9 methods scored on it for finding 1, 8 classical and the discovered champion, ends within 2 Q15 steps of zero there, and the champion is the least accurate of them. Finding 2 flags dahlquist as degenerate over the 4 classical methods it publishes, and the same detector flags it over those 9 as well.

six findings, with their caveats →
verify

Every number traces to a file, and the demo checks itself

The charts are built from one analysis file recomputed from the run archive. The demo page re-implements the Q15 integrator in the browser and, on load, compares all 154 of its runs with the pinned Python evaluator down to the final int16 state. The build fails if any of them differ.

how it is tested →

The run is over

The rk run ended on 2026-11-10, after cycle 17,364, and no more compute goes to it. Epoch 2 is frozen at 358,752 archive records. Both sites are now the final record: the findings site is no longer rebuilt, and this snapshot will not be refreshed.

Final findings

The numbers on this site come from epoch 1, which closed at 141,364 verified tableaus over 3,931 search cycles. They are what the project found:

Epoch 2 kept searching under the current pinned rule until the run ended. Its archive, every elite, and the implicit and adaptive measurements beside them are on the findings site, frozen as the run left them. Cycle counts throughout come from a Cortex-M0+ cost model, not from hardware.

The harness

rk-harness is the code that ran all of this, and it is public: anyone can clone it, rerun this search, or point it at a different one.

The epoch 1 figures in this section come from tools/key_findings.json and rk-work/epochs/1/validation/results.json, the epoch 2 totals from the run archive.

Where these coefficients do not belong

These coefficients are built for one regime, and outside it they are the wrong choice. Give the same tableaus float64 and the same step counts and they are far less accurate than rk4: on buck_converter the champion's float64 error is 9.69e-07 against 1.15e-10 for rk4, and across the 7 validation problems where both finish it runs 1,992 to 420,975 times worse (every row is on the findings validation page). That is what an order-2 method against an order-4 one looks like once the arithmetic stops rounding down.

They are for fixed-point targets with no FPU, at budgets where quantization dominates truncation. The explicit class also runs out of room on the stiff problems: on 1 of the 3 stiff validation problems every discovered tableau overflows Q15 where cheap classical methods finish (finding 6), which is an argument for the implicit class rather than for these coefficients.

Both figures come from rk-work/validation/results.json, built at 141,364 archive records rather than at this page's snapshot.

Three method classes

The run takes turns between three classes of integrator. Only the explicit class is scored by the pinned verifier. The findings site gives each class its own page.

scored
explicit

Fixed-step explicit tableaus, found by MAP-Elites and CMA-ES and scored by the pinned verifier in Q15 at a fixed cycle budget. Every result on the key findings page comes from this class.

explicit methods on rk-findings ↗

measured, not scored
implicit

Two-stage SDIRK methods for stiff problems, enumerated over a dyadic grid with a fixed Newton iteration count. They are ranked by the cycles they need to reach a tolerance, in float64, and their order is not checked by the pinned verifier.

implicit methods on rk-findings ↗

measured, not scored
adaptive

Embedded pairs on the dyadic lattice with a division-free step-size controller. They are ranked the same way as the implicit class: cycles to reach a tolerance, in float64, not order-verified.

adaptive methods on rk-findings ↗

What it took

141,364
verified tableaus archived
3,931
search cycles
17 of 136
searchable grid cells occupied
3,897
cycles since the best held-out error improved

The first three are counted from the run archive as of 2026-09-10 (US Central), at 141,364 records. The fourth is from tools/key_findings.json, computed at 141,364 records.

Cells are counted against the searchable lattice: an order can only use stage counts that can reach it, which leaves 136 cells rather than every order, stage and bucket combination. One more cell holds a seeded classical method (euler at one stage) outside that range, so the archive holds 18 elites in all. The best held-out error has stepped down 5 times since cycle 0 and last moved at cycle 33. The run's saturation check still reads CONTINUE: it asks whether any cell has gained or improved an elite inside its window, not whether that number moved. The suite collects 1,833 tests: 119 golden ones pinned to fixture values, 71 canaries against gaming, and 1,643 behavior and property tests. The container runs 55 of the golden and canary cases as its start gate before a cycle may begin.

The source

Four public repositories. Every number on this site traces back through them to the code that produced it.

rk-harness ↗
The package the container runs: verifier, cost model, evaluator, search, site generator, and the tests that gate all of it.
rk-work ↗
Run data: the append-only archive, the hypothesis ledger, and the validation and benchmark results, written by the container on every cycle of the run.
rk-findings ↗
The numbers site, rebuilt by the container on every cycle with no human in the loop, and frozen as the final snapshot when the run ended.
rk-overview ↗
This site, and the tools that build it from the run archive.