# The repair study

> The sibling of the DFS study, for the other way people attack Eternity II: destroy part of a board, rebuild it, keep the change if it helps. One question, asked carefully. What does each decision in that loop buy: which region to destroy, how to rebuild it, when to keep a move, when to restart, and what board to start from?

- Canonical page (with interactive figures/demos): https://eternity2.dev/research/lab/experiments/raphael-anjou/repair-study/
- Updated: 2026-07-16
- Topics: local-search, search-space, speed
- Reproduce: `just experiments repair-study`
- Source: Runnable engine + committed results + scripts (this study's backing directory) — https://github.com/raphael-anjou/eternity2/tree/main/research/experiments/repair-study

---
There are two ways people actually attack Eternity II. One is to build a board
cell by cell and backtrack when it fails; the [DFS study](/research/lab/experiments/raphael-anjou/dfs-study)
takes that apart. The other is to hold a whole board and *repair* it: rip out a
region, rebuild it, keep the change if it helped, and repeat. Repair is the last
stage of the construct-then-refine pipelines behind this project's own
record-approaching boards, and it is the method the literature reaches for once a
board is too good for a single-piece move to improve. This study takes the repair
loop apart the same way its sibling took backtracking apart: one decision at a
time, on the same ten corner-pinned variants, single core, sixty seconds a run.
The maximum score is 480 matched edges.

The loop itself is short. One iteration, walked through below.

> **[Figure]** One destroy-and-repair iteration, step by step — interactive: RepairLoopDiagram. Rendered on the canonical page (link above); not shown in this markdown export.

The point is not to win. Most variants finish in the 360s and 370s, and the one that
does best (446) does so by starting from a strong backtracked board rather than a
constructed one, which is itself the study's central lesson. Repairing a plain
greedy board on one core for a minute is a small thing next to the pipelines the
records use; what the study measures is *what each decision in the
loop is worth* by changing one at a time and measuring the result with the same
canonical scorer the DFS study and the rest of the site use.

## The family, and the leaderboard

Five families, laid out so that neighbours differ by a single decision, all
branching off one plain anchor loop (greedy start, destroy the mismatched cells,
greedy refill, keep the result unless it loses score, never restart). **Starting
board** changes where the loop begins. **Destroy operator** changes which cells
each iteration lifts. **Repair** changes how the hole is rebuilt. **Acceptance**
changes when a non-improving move is kept. **Restart** changes what happens once
the loop stalls.
> **[Interactive: RepairStudyLeaderboard]** Rendered on the canonical page (link above); not shown in this markdown export.
## What the study found

- **Starting from a strong backtracked board wins the whole study.** The variant
  that spends its first twenty seconds running the DFS study's break-DFS, then
  repairs the resulting low-440s board, finishes highest of all, at a mean of 446
  (best 449). Repair adds only a handful of edges on top of that board, but the board it
  starts from is a hundred points better than a greedy construction, and that
  carries through. This is the construct-then-refine division of labour the records
  use, reproduced end to end on one core in one minute.
- **Among the greedy-start variants, random destroy wins and targeting the breaks
  backfires.** A geometry-blind destroy that lifts twelve *random* cells finishes
  at a mean of 402 (best 409) and keeps improving deep into the run. Every operator
  that targets the broken cells finishes below it, and the more precisely it
  fixates, the worse it does: the mismatched-cells anchor lands at 366, a larger
  connected-component destroy at 350. On a mediocre board there is improvement
  available everywhere, so exploring beats attacking where it already hurts. That
  inverts on a near-record board, where the few remaining mismatches are the only
  thing left to fix.
- **The starting board sets the floor.** A greedy construction starts around 348;
  a random one starts near 18, and although the loop lifts it a spectacular 308
  points, it still finishes below where the greedy start *began*. Construction is
  the lever, repair is the polish.
- **The acceptance rule is the other real lever.** Simulated annealing, which
  steps downhill occasionally to leave a plateau, is the strongest acceptance rule
  by a clear margin (mean 377, best 394), well
  ahead of a strict hill-climb (361). How much a non-improving move is allowed is
  worth a sixteen-point swing on the same loop.
- **The clever refinements buy nothing here.** A whole-band destroy is inert (zero
  improvements on nine of ten instances). A bounded *exact* refill of a small hole
  does not beat a plain greedy refill of the same hole, a clean negative result:
  its locally-perfect rebuilds cost enough iterations that more, cheaper greedy
  rebuilds reach just as far. Neither a random kick nor a revert-to-best on a stall
  moves the score off the no-restart baseline.

Each of these has its own treatment: how the engine is built and what every
raised statistic means is on the [method page](/research/lab/experiments/raphael-anjou/repair-study/method),
and the destroy, repair, acceptance, restart and starting-board comparisons are
worked through on the [findings page](/research/lab/experiments/raphael-anjou/repair-study/findings).

## How to read the numbers

Every board is re-scored by the one canonical scorer, and no engine's
self-reported score is trusted. The loop maintains its score incrementally as it
places and lifts pieces, but the published number is always a fresh canonical
re-score of the output board. Throughput is reported in repair-iterations per
second and is **never compared across families**, because an iteration that runs
an exact refill is not the same unit of work as one that runs a greedy fill.

The axis to watch is the *stall*: the iteration at which the global best last
improved, against the total iterations run. When the first is a few thousand and
the second is hundreds of thousands, the run found its answer early and then
ground the same basin for the rest of the minute. That gap is the measured form
of a long-standing observation about this puzzle, that destroy-and-repair is a
superb basin-explorer and essentially never escapes the basin it lands in.

The whole apparatus (the engine, the ten variants, the committed per-run results
and the grid scripts) lives under the study's
[backing directory](https://github.com/raphael-anjou/eternity2/tree/main/research/experiments/repair-study),
and `just experiments repair-study` rebuilds the engine and reruns the whole
grid. The board, scorer and IO layer come from a
[shared library](https://github.com/raphael-anjou/eternity2/tree/main/research/experiments/common)
the DFS study uses too, so a repaired board and a backtracked one are scored by
exactly the same code.

## Pages in this section

- [How the study is built](https://eternity2.dev/research/lab/experiments/raphael-anjou/repair-study/method) — The engine behind the repair study: one composable destroy-and-repair loop where a variant is a declared change over a parent, the shared IO and scorer it sits on with the DFS study, an incrementally-maintained mismatch map, and the definitions of every statistic the study raises.
- [What each decision buys](https://eternity2.dev/research/lab/experiments/raphael-anjou/repair-study/findings) — The five comparisons at the heart of the repair study, worked through: blind random destroy wins while every conflict-targeting operator loses; construction sets the floor; simulated annealing is the strongest acceptance rule; and the clever refinements (exact refill, restarts) buy nothing at this budget.

## Related

- [Raphaël Anjou's experiments](https://eternity2.dev/research/lab/experiments/raphael-anjou) — A notebook of Eternity II search experiments, organised into the shared engines they run on, the combination pipelines that chase the score, three studies that take one search paradigm apart a decision at a time, and exact endgame solves. Each has its idea, its best board, and the questions it left open. The best reaches 463 of 480.
- [The DFS study](https://eternity2.dev/research/lab/experiments/raphael-anjou/dfs-study) — One question, asked carefully: among depth-first backtrackers for Eternity II, what does each fill order, each heuristic, and the break mechanism actually buy? A family of from-scratch backtrackers, each one change apart, run on the same ten corner-pinned variants, single core, sixty seconds.
- [Local search and ALNS](https://eternity2.dev/research/build/local-search/local-search-alns) — Destroy part of a board, rebuild it better, and let the algorithm learn which demolitions pay. Adaptive large-neighborhood search is the most reliable polisher this project has, and the cleanest demonstration of the wall where polishing ends.
