# MOSAIC

> Tile the board into small blocks, solve each one to proven optimality, and glue them together, paying for the seams instead of forbidding them. From scratch, with no record to copy, it reaches 448.

- Canonical page (with interactive figures/demos): https://eternity2.dev/research/lab/experiments/raphael-anjou/pipelines/mosaic/
- Updated: 2026-07-21
- Topics: exact-methods
- Source: RC2 MaxSAT (the exact block solver): a core-guided weighted-MaxSAT algorithm — https://doi.org/10.3233/SAT190116

---
Eternity II has no local structure you can exploit globally, but a small
window of it, a 4×4 block, solves to perfect optimality in seconds. MOSAIC is
an experiment built on that single fact: if you can solve a block exactly, can
you compose sixteen exact blocks into a whole board?

## How it works

The 16×16 board is cut into sixteen 4×4 blocks, filled one at a time. Each
block is handed to an exact MaxSAT solver, which finds the best possible
placement of pieces in it. The trick is in how a block meets its
already-placed neighbours: those shared edges are not hard requirements but
*soft* targets the block is rewarded for matching. So a block can never become
impossible; it simply pays for any seam it can't match, and always completes.

The second idea fights piece theft directly. Before filling a block, MOSAIC
holds back the globally scarcest pieces, so the last blocks aren't starved of
the rare pieces their seams will demand. Tuning how much to reserve is the one
real knob; too little and the corner starves, too much and the early blocks
suffer.

> **[Figure]** Interactive: the block-assembly search — interactive: MosaicBlockLab. Rendered on the canonical page (link above); not shown in this markdown export.

## The result

The window primitive does what it promises: a 4×4 block solves to its 24-edge
optimum in about thirty seconds, a 3×3 in eleven, confirming the puzzle
really is tractable in the small. Composed across the whole board, from
scratch and with no warm start, MOSAIC reaches 448 of 480. The reservation
sweet spot is around eight percent of the pool.

The shortfall is informative: almost all of it is in the last three blocks of
the bottom-right corner, where the pool finally runs thin: piece theft again,
now visible as a single bright spot on the board. Exact-in-the-small does
compose, but the composition order spends its freedom early and pays for it at
the end, the same shape every method here runs into.

## Method

The exactness is genuine, and so is the backtracking that stitches it
together.

- **Exact blocks.** Each 4×4 block is encoded as a *weighted MaxSAT* problem
  and solved by RC2, a core-guided solver, to a provably-optimal fill. Shared
  edges with already-placed neighbours are *soft* clauses (rewarded, not
  required), so a block can never be infeasible, it pays for any seam it can't
  match and always completes.
- **Backtracking over solutions.** MOSAIC is not a one-shot glue. Each block
  level keeps an *enumerator* of MaxSAT solutions, best-first, via RC2 plus
  blocking clauses that rule out already-seen fills. When a later block is
  starved or a level exhausts, it backtracks and pulls the *next* solution of
  the previous block (freeing a different set of pieces). It is a coarse
  16-level backtracking search where each node is a whole optimal block.
- **Scarcity reservation.** Before filling, MOSAIC holds back the globally
  scarcest pieces so the final blocks aren't starved of the rare pieces their
  seams demand. That reservation fraction is the one real knob; the measured
  sweet spot is ~8% of the pool.

The window primitive is real: a 4×4 block reaches its 24-edge optimum in ~30 s,
a 3×3 in ~11 s, the puzzle *is* tractable in the small. Composed from scratch
it reaches 448, with the residual shortfall concentrated in the last three
bottom-right blocks: [piece theft](/research/why/piece-theft) made visible as a
single bright spot.

## Reproduce

Deterministic: the MaxSAT block solves and the backtracking composition are
exact, so `kind: exact`, the 448 board reproduces and is checkable edge by
edge in the viewer. The block engine runs from the puzzle alone, with no corpus
or seed board, its only external dependency being a MaxSAT solver, so a runnable
backing directory for it is planned alongside the other exact experiments.

## Open questions

Would a non-row-major block order, spiralling in or solving the constrained
corner first, move the depletion off the hardest block? Could blocks overlap,
so seams are solved twice and reconciled? And does a faster (Rust) primitive
make a larger block size, with its stronger exact guarantee, affordable?

## Related

- [BANDSAW](https://eternity2.dev/research/lab/experiments/raphael-anjou/meet-in-the-middle/bandsaw) — Solve a band of rows exactly by meeting in the middle, to find the true best ending and to measure how far ahead an endgame can be decided.
- [Piece theft, where solvers die](https://eternity2.dev/research/why/piece-theft) — A solver fills a few rows for free, then hits a wall in the middle of the board. Here's the mechanism: a scarce piece spent in the wrong place, rows ago.
- [Which wall stops which method](https://eternity2.dev/research/why/walls-and-methods) — The research section has two halves: the structural walls that make Eternity II hard, and the algorithms built to climb them. This page is the bridge: each method lined up against the wall it actually attacks, and the score where that wall stopped it.
- [SAT and CSP encodings](https://eternity2.dev/research/build/exact/sat-csp-encodings) — Write the puzzle as clauses and hand it to an industrial solver: the obvious move, tried since 2008. Why complete solvers stall on the full board, and where their verdicts still earn their keep as impossibility proofs.
