# CLOISTER

> Fix a perfect border, then search the interior with the border's edges treated as hard constraints from the very first cell.

- Canonical page (with interactive figures/demos): https://eternity2.dev/research/lab/experiments/raphael-anjou/pipelines/cloister/
- Updated: 2026-07-21
- Topics: local-search, backtracking
- Source: Rare-colour border geography (this project): why the frame is the natural cut — https://github.com/raphael-anjou/eternity2/blob/main/web/content/research/why/rare-color-geography.mdx

---
The border and the interior are usually solved together, which wastes effort:
the interior keeps proposing pieces that can't possibly meet the border
later. CLOISTER pins a perfect 60-piece frame first, then searches the 14×14
interior with the frame's inward-facing edges as real constraints from cell
one, so a doomed interior is rejected immediately instead of at the end.

## How it works

Start from a complete, perfectly-matched border. The interior search is a
break-allowing depth-first fill, but the cells along the inner edge of the
frame must match the frame, and that requirement is live from the first
placement, not checked only when the interior is finished. Exact endgames
score the last region, including how well it seals against the rim.

Because the border is fixed, the search collects something a post-hoc
interior can't: the handful of extra edges that come from the interior
actually fitting the rim it was built against, rather than being grafted onto
a rim later.

> **[Figure]** Interactive: how the frame anchors the interior — interactive: BorderAnchorDiagram. Rendered on the canonical page (link above); not shown in this markdown export.

Try it live: fix a frame and watch the interior search run against it in your
browser.

> **[Figure]** Interactive: solve the standalone interior live — interactive: CloisterLiveLab. Rendered on the canonical page (link above); not shown in this markdown export.

## The result

As a standalone interior solver CLOISTER reaches an interior score of 453
unhinted, in minutes, and confirms a real effect: an interior built against
its own rim attaches with a few more matched edges than the same-quality
interior attached after the fact. With all five official clues forced it
settles in the high 440s to low 450s.

It doesn't break the top records, and it saturates like everything else does
near the wall. But it cleanly isolates and measures the border-interior
coupling that whole-board search blurs together.

## Method

The search is a break-tolerant DFS over the interior, but the leverage is in
the framing and a two-phase campaign over *many* frames.

- **Frame as hard constraint.** A complete 60-piece border is fixed, and the
  frame's inward-facing colours become hard constraints on the rim cells from
  the very first interior placement, not a check deferred to the end. A doomed
  interior is pruned immediately.
- **Exact tail.** The endgame region is solved exactly (a 14-cell exact tail),
  including how it seals against the rim, so the last few cells are closed
  deterministically rather than by heuristic.
- **Frame-breadth campaign.** Rather than one border, sweep a directory of
  candidate frames in two phases: a cheap ~6-second hint-compatibility probe
  drops frames that can't host the clues, then a 30-second tail recipe runs
  over each surviving frame with 8 seeds. The best interior wins.

The measured effect is small but real, and it comes from one thing: the
border-interior coupling that whole-board search averages away, but that a
rim-first build gets to exploit while it still can. 453 unhinted; high-440s to
low-450s with all five clues forced.

## Reproduce

Seeded and close to deterministic given a frame: the DFS interior solve off a
fixed frame reproduces its score reliably, and the committed board is checkable
edge by edge in the viewer. The solve needs one input beyond the puzzle, a
pre-solved perfect border frame; a runnable backing directory that ships that
frame alongside the engine is planned.

## Open questions

How much of the rim-compatibility bonus can be collected without fixing the
border first? Does scanning many borders, rather than one, find an interior
that attaches better still? And where exactly does the strict-clue version's
ceiling come from?

## Related

- [STAGED](https://eternity2.dev/research/lab/experiments/raphael-anjou/pipelines/staged) — Build the whole board from scratch with no pre-set frame, in stages, letting the border emerge last from whatever pieces are left.
- [The rare colors live on the frame](https://eternity2.dev/research/why/rare-color-geography) — Five of Eternity II's 22 colors appear only along the border ring, each on exactly 24 edges, never once in the interior. A structural split that shapes how every solver treats the frame.
- [MIDDEN](https://eternity2.dev/research/lab/experiments/raphael-anjou/pipelines/midden) — Decide in advance not when a board may break, but where: confine every mismatch to a chosen shape of cells, and search for the best shape.
- [Meet in the middle](https://eternity2.dev/research/build/exact/meet-in-the-middle) — Enumerate two halves of a problem and join them on a shared interface, trading memory for an exponent cut in half. The classic Horowitz–Sahni trick, what it looks like on bands of the board, and what this project's BANDSAW experiment measured, including the one-sided method that beat it.
