Skip to content

The JIT backtracker: portable Rust that ties hand-tuned C on hard boards

A safe, portable Rust depth-first backtracker, specialised at runtime by emitting and compiling per-puzzle Rust, taken from 43 to 123 million search-nodes per second on one core. Measured fairly against Peter McGavin's C on the same machine: a tie on hard, deep boards like the real Eternity II, and about 44% of its speed on easy ones. Every rung searches the identical tree; the whole gain is code, not algorithm.

by Raphaël Anjou · method by Peter McGavin

experimentmeasurementmeasuredGo fasterBacktrackingUpdated 2026-07-20
Reproduceheavy compute — script and results are committedreruns the searchBudget: 6–30 s per benchmark run
Hardware & run
Standardized benchCPU only
0.0083core-hours
Cores
1
RAM
16 GiB
GPUs
0
CPU
Apple M1
Machine
MacBook (Apple M1, 8 cores), single-threaded generated binary
Budget
6–30 s per benchmark run
Start
deterministic search; a candidate-order --seed only reorders equal buckets for portfolio diversity
Reproduce this result

heavy compute — script and results are committed

cargo run --release -p dfs-codegen --bin run_dfs_codegen_jit -- --puzzle P.json --chain2 --opt native

Keep exploring

Referenced by

Page sourceView as Markdown