FA-86636 / Procedural level generation constraints / Open access
Perfect maze validator: Uncompressed parents counted as roots · case 01
Fully connected mazes are reported disconnected.
ROOT CAUSE
Components are counted from raw parent pointers.
VERIFIED REPAIR
Restore `roots = {find(p) for p in parent}` at the component roots step.
Unsuccessful approach: Skipping self-parented cells misses isolated cells.
Case contract
Cells (x, y) with 0 <= x < w, 0 <= y < h. First pass over passages [[x1, y1], [x2, y2]]: out-of-bounds or non-orthogonally-adjacent pairs -> 'invalid-edge'; the same passage twice in either orientation -> 'duplicate'. Then union passages in order: joining already connected cells -> 'loop'. Finally 'perfect' if all cells are connected, else 'disconnected'.
Why this case matters
Procedural generators silently emit unplayable or unfair levels when a single constraint check uses the wrong boundary, axis, neighborhood or update order; the defect is visible in exact generated geometry.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(w, h, passages):
seen = set()
parent = {(x, y): (x, y) for x in range(w) for y in range(h)}
def find(p):
while parent[p] != p:
parent[p] = parent[parent[p]]
p = parent[p]
return p
for (x1, y1), (x2, y2) in passages:
if not (0 <= x1 < w and 0 <= y1 < h and 0 <= x2 < w and 0 <= y2 < h):
return 'invalid-edge'
if abs(x1 - x2) + abs(y1 - y2) != 1:
return 'invalid-edge'
key = tuple(sorted([(x1, y1), (x2, y2)]))
if key in seen:
return 'duplicate'
seen.add(key)
for (x1, y1), (x2, y2) in passages:
a, b = find((x1, y1)), find((x2, y2))
if a == b:
return 'loop'
parent[a] = b
roots = {parent[p] for p in parent}
return 'perfect' if len(roots) == 1 else 'disconnected'
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('single cell maze #1', [1, 1, []], 'perfect'),
('fault site component roots #1',
[3, 2, [[[0, 1], [0, 0]], [[1, 1], [2, 1]], [[1, 1], [0, 1]], [[1, 0], [1, 1]], [[2, 1], [2, 0]]]],
'perfect'),
('fault site component roots #2', [3, 1, [[[0, 0], [1, 0]], [[1, 0], [2, 0]]]], 'perfect'),
('partial repair boundary #1', [1, 3, [[[0, 1], [0, 2]]]], 'disconnected'),
('partial repair boundary #2',
[4,
2,
[[[2, 1], [2, 0]],
[[1, 1], [2, 1]],
[[1, 1], [0, 1]],
[[2, 0], [1, 0]],
[[2, 1], [3, 1]],
[[3, 0], [3, 1]]]],
'disconnected'),
('diagonal passage #1', [2, 2, [[[0, 0], [1, 1]]]], 'invalid-edge'),
('reversed duplicate #1', [2, 1, [[[0, 0], [1, 0]], [[1, 0], [0, 0]]]], 'duplicate'),
('control #1',
[3, 2, [[[2, 1], [1, 1]], [[0, 1], [0, 0]], [[1, 1], [2, 2]], [[0, 0], [1, 0]]]],
'invalid-edge')],
[('single cell maze #1', [1, 1, []], 'perfect'),
('fault site component roots #1',
[2, 2, [[[0, 0], [0, 1]], [[0, 1], [1, 1]], [[1, 1], [1, 0]]]],
'perfect'),
('fault site component roots #2', [1, 3, [[[0, 1], [0, 2]], [[0, 1], [0, 0]]]], 'perfect'),
('partial repair boundary #1',
[4,
2,
[[[2, 1], [2, 0]],
[[1, 1], [2, 1]],
[[1, 1], [0, 1]],
[[2, 0], [1, 0]],
[[2, 1], [3, 1]],
[[3, 0], [3, 1]]]],
'disconnected'),
('partial repair boundary #2',
[4, 2, [[[2, 1], [1, 1]], [[1, 0], [0, 0]], [[2, 1], [2, 0]], [[1, 0], [1, 1]]]],
'disconnected'),
('diagonal passage #1', [2, 2, [[[0, 0], [1, 1]]]], 'invalid-edge'),
('reversed duplicate #1', [2, 1, [[[0, 0], [1, 0]], [[1, 0], [0, 0]]]], 'duplicate'),
('control #1',
[3, 2, [[[2, 1], [1, 1]], [[0, 1], [0, 0]], [[1, 1], [2, 2]], [[0, 0], [1, 0]]]],
'invalid-edge')],
[('single cell maze #1', [1, 1, []], 'perfect'),
('fault site component roots #1',
[1, 4, [[[0, 2], [0, 3]], [[0, 2], [0, 1]], [[0, 1], [0, 0]]]],
'perfect'),
('fault site component roots #2',
[3, 2, [[[1, 1], [2, 1]], [[0, 0], [1, 0]], [[2, 1], [2, 0]], [[0, 0], [0, 1]], [[1, 0], [2, 0]]]],
'perfect'),
('partial repair boundary #1', [3, 1, [[[0, 0], [1, 0]]]], 'disconnected'),
('partial repair boundary #2',
[3,
4,
[[[2, 0], [1, 0]],
[[1, 2], [1, 1]],
[[2, 2], [2, 3]],
[[2, 2], [2, 1]],
[[1, 0], [1, 1]],
[[1, 1], [2, 1]],
[[1, 0], [0, 0]],
[[1, 3], [1, 2]],
[[0, 2], [0, 1]],
[[1, 2], [0, 2]]]],
'disconnected'),
('diagonal passage #1', [2, 2, [[[0, 0], [1, 1]]]], 'invalid-edge'),
('reversed duplicate #1', [2, 1, [[[0, 0], [1, 0]], [[1, 0], [0, 0]]]], 'duplicate'),
('control #1',
[3, 2, [[[2, 1], [1, 1]], [[0, 1], [0, 0]], [[1, 1], [2, 2]], [[0, 0], [1, 0]]]],
'invalid-edge')],
[('single cell maze #1', [1, 1, []], 'perfect'),
('fault site component roots #1',
[2,
4,
[[[0, 0], [1, 0]],
[[0, 2], [0, 1]],
[[1, 2], [1, 3]],
[[1, 2], [0, 2]],
[[0, 3], [1, 3]],
[[1, 0], [1, 1]],
[[1, 1], [0, 1]]]],
'perfect'),
('fault site component roots #2',
[2, 3, [[[0, 2], [0, 1]], [[0, 0], [0, 1]], [[1, 1], [1, 0]], [[1, 2], [0, 2]], [[0, 0], [1, 0]]]],
'perfect'),
('partial repair boundary #1', [1, 3, [[[0, 1], [0, 0]]]], 'disconnected'),
('partial repair boundary #2', [1, 3, [[[0, 2], [0, 1]]]], 'disconnected'),
('diagonal passage #1', [2, 2, [[[0, 0], [1, 1]]]], 'invalid-edge'),
('reversed duplicate #1', [2, 1, [[[0, 0], [1, 0]], [[1, 0], [0, 0]]]], 'duplicate'),
('control #1',
[4,
3,
[[[1, 0], [1, 1]],
[[0, 1], [0, 0]],
[[0, 1], [0, 2]],
[[2, 0], [2, 1]],
[[1, 0], [0, 0]],
[[1, 0], [2, 0]],
[[2, 1], [2, 2]],
[[2, 2], [3, 2]],
[[2, 1], [3, 1]],
[[2, 2], [1, 2]],
[[1, 1], [0, 1]],
[[0, 2], [1, 2]]]],
'loop')],
[('single cell maze #1', [1, 1, []], 'perfect'),
('fault site component roots #1',
[1, 4, [[[0, 0], [0, 1]], [[0, 1], [0, 2]], [[0, 2], [0, 3]]]],
'perfect'),
('fault site component roots #2',
[4,
2,
[[[1, 0], [1, 1]],
[[0, 0], [0, 1]],
[[3, 1], [3, 0]],
[[3, 1], [2, 1]],
[[1, 1], [0, 1]],
[[2, 0], [3, 0]],
[[2, 1], [1, 1]]]],
'perfect'),
('partial repair boundary #1', [2, 3, [[[0, 1], [0, 0]], [[0, 1], [0, 2]]]], 'disconnected'),
('partial repair boundary #2', [4, 1, [[[3, 0], [2, 0]], [[1, 0], [2, 0]]]], 'disconnected'),
('diagonal passage #1', [2, 2, [[[0, 0], [1, 1]]]], 'invalid-edge'),
('reversed duplicate #1', [2, 1, [[[0, 0], [1, 0]], [[1, 0], [0, 0]]]], 'duplicate'),
('control #1',
[4, 1, [[[2, 0], [1, 0]], [[3, 0], [2, 0]], [[0, 0], [1, 0]], [[1, 0], [0, 0]]]],
'duplicate')]]
for label, args, expected in cases[N-1]:
check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| single cell maze #1 | perfect | perfect | Passed |
| fault site component roots #1 | disconnected | perfect | Failed |
| fault site component roots #2 | disconnected | perfect | Failed |
| partial repair boundary #1 | disconnected | disconnected | Passed |
| partial repair boundary #2 | disconnected | disconnected | Passed |
| diagonal passage #1 | invalid-edge | invalid-edge | Passed |
| reversed duplicate #1 | duplicate | duplicate | Passed |
| control #1 | invalid-edge | invalid-edge | Passed |
SHA-256 / bfffe05d4e63e6937d78ee22866d800113b6e04a0d66e485228665911a0e5918
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(w, h, passages):
seen = set()
parent = {(x, y): (x, y) for x in range(w) for y in range(h)}
def find(p):
while parent[p] != p:
parent[p] = parent[parent[p]]
p = parent[p]
return p
for (x1, y1), (x2, y2) in passages:
if not (0 <= x1 < w and 0 <= y1 < h and 0 <= x2 < w and 0 <= y2 < h):
return 'invalid-edge'
if abs(x1 - x2) + abs(y1 - y2) != 1:
return 'invalid-edge'
key = tuple(sorted([(x1, y1), (x2, y2)]))
if key in seen:
return 'duplicate'
seen.add(key)
for (x1, y1), (x2, y2) in passages:
a, b = find((x1, y1)), find((x2, y2))
if a == b:
return 'loop'
parent[a] = b
roots = {find(p) for p in parent if parent[p] != p}
return 'perfect' if len(roots) == 1 else 'disconnected'
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('single cell maze #1', [1, 1, []], 'perfect'),
('fault site component roots #1',
[3, 2, [[[0, 1], [0, 0]], [[1, 1], [2, 1]], [[1, 1], [0, 1]], [[1, 0], [1, 1]], [[2, 1], [2, 0]]]],
'perfect'),
('fault site component roots #2', [3, 1, [[[0, 0], [1, 0]], [[1, 0], [2, 0]]]], 'perfect'),
('partial repair boundary #1', [1, 3, [[[0, 1], [0, 2]]]], 'disconnected'),
('partial repair boundary #2',
[4,
2,
[[[2, 1], [2, 0]],
[[1, 1], [2, 1]],
[[1, 1], [0, 1]],
[[2, 0], [1, 0]],
[[2, 1], [3, 1]],
[[3, 0], [3, 1]]]],
'disconnected'),
('diagonal passage #1', [2, 2, [[[0, 0], [1, 1]]]], 'invalid-edge'),
('reversed duplicate #1', [2, 1, [[[0, 0], [1, 0]], [[1, 0], [0, 0]]]], 'duplicate'),
('control #1',
[3, 2, [[[2, 1], [1, 1]], [[0, 1], [0, 0]], [[1, 1], [2, 2]], [[0, 0], [1, 0]]]],
'invalid-edge')],
[('single cell maze #1', [1, 1, []], 'perfect'),
('fault site component roots #1',
[2, 2, [[[0, 0], [0, 1]], [[0, 1], [1, 1]], [[1, 1], [1, 0]]]],
'perfect'),
('fault site component roots #2', [1, 3, [[[0, 1], [0, 2]], [[0, 1], [0, 0]]]], 'perfect'),
('partial repair boundary #1',
[4,
2,
[[[2, 1], [2, 0]],
[[1, 1], [2, 1]],
[[1, 1], [0, 1]],
[[2, 0], [1, 0]],
[[2, 1], [3, 1]],
[[3, 0], [3, 1]]]],
'disconnected'),
('partial repair boundary #2',
[4, 2, [[[2, 1], [1, 1]], [[1, 0], [0, 0]], [[2, 1], [2, 0]], [[1, 0], [1, 1]]]],
'disconnected'),
('diagonal passage #1', [2, 2, [[[0, 0], [1, 1]]]], 'invalid-edge'),
('reversed duplicate #1', [2, 1, [[[0, 0], [1, 0]], [[1, 0], [0, 0]]]], 'duplicate'),
('control #1',
[3, 2, [[[2, 1], [1, 1]], [[0, 1], [0, 0]], [[1, 1], [2, 2]], [[0, 0], [1, 0]]]],
'invalid-edge')],
[('single cell maze #1', [1, 1, []], 'perfect'),
('fault site component roots #1',
[1, 4, [[[0, 2], [0, 3]], [[0, 2], [0, 1]], [[0, 1], [0, 0]]]],
'perfect'),
('fault site component roots #2',
[3, 2, [[[1, 1], [2, 1]], [[0, 0], [1, 0]], [[2, 1], [2, 0]], [[0, 0], [0, 1]], [[1, 0], [2, 0]]]],
'perfect'),
('partial repair boundary #1', [3, 1, [[[0, 0], [1, 0]]]], 'disconnected'),
('partial repair boundary #2',
[3,
4,
[[[2, 0], [1, 0]],
[[1, 2], [1, 1]],
[[2, 2], [2, 3]],
[[2, 2], [2, 1]],
[[1, 0], [1, 1]],
[[1, 1], [2, 1]],
[[1, 0], [0, 0]],
[[1, 3], [1, 2]],
[[0, 2], [0, 1]],
[[1, 2], [0, 2]]]],
'disconnected'),
('diagonal passage #1', [2, 2, [[[0, 0], [1, 1]]]], 'invalid-edge'),
('reversed duplicate #1', [2, 1, [[[0, 0], [1, 0]], [[1, 0], [0, 0]]]], 'duplicate'),
('control #1',
[3, 2, [[[2, 1], [1, 1]], [[0, 1], [0, 0]], [[1, 1], [2, 2]], [[0, 0], [1, 0]]]],
'invalid-edge')],
[('single cell maze #1', [1, 1, []], 'perfect'),
('fault site component roots #1',
[2,
4,
[[[0, 0], [1, 0]],
[[0, 2], [0, 1]],
[[1, 2], [1, 3]],
[[1, 2], [0, 2]],
[[0, 3], [1, 3]],
[[1, 0], [1, 1]],
[[1, 1], [0, 1]]]],
'perfect'),
('fault site component roots #2',
[2, 3, [[[0, 2], [0, 1]], [[0, 0], [0, 1]], [[1, 1], [1, 0]], [[1, 2], [0, 2]], [[0, 0], [1, 0]]]],
'perfect'),
('partial repair boundary #1', [1, 3, [[[0, 1], [0, 0]]]], 'disconnected'),
('partial repair boundary #2', [1, 3, [[[0, 2], [0, 1]]]], 'disconnected'),
('diagonal passage #1', [2, 2, [[[0, 0], [1, 1]]]], 'invalid-edge'),
('reversed duplicate #1', [2, 1, [[[0, 0], [1, 0]], [[1, 0], [0, 0]]]], 'duplicate'),
('control #1',
[4,
3,
[[[1, 0], [1, 1]],
[[0, 1], [0, 0]],
[[0, 1], [0, 2]],
[[2, 0], [2, 1]],
[[1, 0], [0, 0]],
[[1, 0], [2, 0]],
[[2, 1], [2, 2]],
[[2, 2], [3, 2]],
[[2, 1], [3, 1]],
[[2, 2], [1, 2]],
[[1, 1], [0, 1]],
[[0, 2], [1, 2]]]],
'loop')],
[('single cell maze #1', [1, 1, []], 'perfect'),
('fault site component roots #1',
[1, 4, [[[0, 0], [0, 1]], [[0, 1], [0, 2]], [[0, 2], [0, 3]]]],
'perfect'),
('fault site component roots #2',
[4,
2,
[[[1, 0], [1, 1]],
[[0, 0], [0, 1]],
[[3, 1], [3, 0]],
[[3, 1], [2, 1]],
[[1, 1], [0, 1]],
[[2, 0], [3, 0]],
[[2, 1], [1, 1]]]],
'perfect'),
('partial repair boundary #1', [2, 3, [[[0, 1], [0, 0]], [[0, 1], [0, 2]]]], 'disconnected'),
('partial repair boundary #2', [4, 1, [[[3, 0], [2, 0]], [[1, 0], [2, 0]]]], 'disconnected'),
('diagonal passage #1', [2, 2, [[[0, 0], [1, 1]]]], 'invalid-edge'),
('reversed duplicate #1', [2, 1, [[[0, 0], [1, 0]], [[1, 0], [0, 0]]]], 'duplicate'),
('control #1',
[4, 1, [[[2, 0], [1, 0]], [[3, 0], [2, 0]], [[0, 0], [1, 0]], [[1, 0], [0, 0]]]],
'duplicate')]]
for label, args, expected in cases[N-1]:
check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| single cell maze #1 | disconnected | perfect | Failed |
| fault site component roots #1 | perfect | perfect | Passed |
| fault site component roots #2 | perfect | perfect | Passed |
| partial repair boundary #1 | perfect | disconnected | Failed |
| partial repair boundary #2 | perfect | disconnected | Failed |
| diagonal passage #1 | invalid-edge | invalid-edge | Passed |
| reversed duplicate #1 | duplicate | duplicate | Passed |
| control #1 | invalid-edge | invalid-edge | Passed |
SHA-256 / 627b4d52a16d29e2e5426b0dccf36d7fb02b1186058a6ee1d747affb52a0c6d0
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(w, h, passages):
seen = set()
parent = {(x, y): (x, y) for x in range(w) for y in range(h)}
def find(p):
while parent[p] != p:
parent[p] = parent[parent[p]]
p = parent[p]
return p
for (x1, y1), (x2, y2) in passages:
if not (0 <= x1 < w and 0 <= y1 < h and 0 <= x2 < w and 0 <= y2 < h):
return 'invalid-edge'
if abs(x1 - x2) + abs(y1 - y2) != 1:
return 'invalid-edge'
key = tuple(sorted([(x1, y1), (x2, y2)]))
if key in seen:
return 'duplicate'
seen.add(key)
for (x1, y1), (x2, y2) in passages:
a, b = find((x1, y1)), find((x2, y2))
if a == b:
return 'loop'
parent[a] = b
roots = {find(p) for p in parent}
return 'perfect' if len(roots) == 1 else 'disconnected'
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('single cell maze #1', [1, 1, []], 'perfect'),
('fault site component roots #1',
[3, 2, [[[0, 1], [0, 0]], [[1, 1], [2, 1]], [[1, 1], [0, 1]], [[1, 0], [1, 1]], [[2, 1], [2, 0]]]],
'perfect'),
('fault site component roots #2', [3, 1, [[[0, 0], [1, 0]], [[1, 0], [2, 0]]]], 'perfect'),
('partial repair boundary #1', [1, 3, [[[0, 1], [0, 2]]]], 'disconnected'),
('partial repair boundary #2',
[4,
2,
[[[2, 1], [2, 0]],
[[1, 1], [2, 1]],
[[1, 1], [0, 1]],
[[2, 0], [1, 0]],
[[2, 1], [3, 1]],
[[3, 0], [3, 1]]]],
'disconnected'),
('diagonal passage #1', [2, 2, [[[0, 0], [1, 1]]]], 'invalid-edge'),
('reversed duplicate #1', [2, 1, [[[0, 0], [1, 0]], [[1, 0], [0, 0]]]], 'duplicate'),
('control #1',
[3, 2, [[[2, 1], [1, 1]], [[0, 1], [0, 0]], [[1, 1], [2, 2]], [[0, 0], [1, 0]]]],
'invalid-edge')],
[('single cell maze #1', [1, 1, []], 'perfect'),
('fault site component roots #1',
[2, 2, [[[0, 0], [0, 1]], [[0, 1], [1, 1]], [[1, 1], [1, 0]]]],
'perfect'),
('fault site component roots #2', [1, 3, [[[0, 1], [0, 2]], [[0, 1], [0, 0]]]], 'perfect'),
('partial repair boundary #1',
[4,
2,
[[[2, 1], [2, 0]],
[[1, 1], [2, 1]],
[[1, 1], [0, 1]],
[[2, 0], [1, 0]],
[[2, 1], [3, 1]],
[[3, 0], [3, 1]]]],
'disconnected'),
('partial repair boundary #2',
[4, 2, [[[2, 1], [1, 1]], [[1, 0], [0, 0]], [[2, 1], [2, 0]], [[1, 0], [1, 1]]]],
'disconnected'),
('diagonal passage #1', [2, 2, [[[0, 0], [1, 1]]]], 'invalid-edge'),
('reversed duplicate #1', [2, 1, [[[0, 0], [1, 0]], [[1, 0], [0, 0]]]], 'duplicate'),
('control #1',
[3, 2, [[[2, 1], [1, 1]], [[0, 1], [0, 0]], [[1, 1], [2, 2]], [[0, 0], [1, 0]]]],
'invalid-edge')],
[('single cell maze #1', [1, 1, []], 'perfect'),
('fault site component roots #1',
[1, 4, [[[0, 2], [0, 3]], [[0, 2], [0, 1]], [[0, 1], [0, 0]]]],
'perfect'),
('fault site component roots #2',
[3, 2, [[[1, 1], [2, 1]], [[0, 0], [1, 0]], [[2, 1], [2, 0]], [[0, 0], [0, 1]], [[1, 0], [2, 0]]]],
'perfect'),
('partial repair boundary #1', [3, 1, [[[0, 0], [1, 0]]]], 'disconnected'),
('partial repair boundary #2',
[3,
4,
[[[2, 0], [1, 0]],
[[1, 2], [1, 1]],
[[2, 2], [2, 3]],
[[2, 2], [2, 1]],
[[1, 0], [1, 1]],
[[1, 1], [2, 1]],
[[1, 0], [0, 0]],
[[1, 3], [1, 2]],
[[0, 2], [0, 1]],
[[1, 2], [0, 2]]]],
'disconnected'),
('diagonal passage #1', [2, 2, [[[0, 0], [1, 1]]]], 'invalid-edge'),
('reversed duplicate #1', [2, 1, [[[0, 0], [1, 0]], [[1, 0], [0, 0]]]], 'duplicate'),
('control #1',
[3, 2, [[[2, 1], [1, 1]], [[0, 1], [0, 0]], [[1, 1], [2, 2]], [[0, 0], [1, 0]]]],
'invalid-edge')],
[('single cell maze #1', [1, 1, []], 'perfect'),
('fault site component roots #1',
[2,
4,
[[[0, 0], [1, 0]],
[[0, 2], [0, 1]],
[[1, 2], [1, 3]],
[[1, 2], [0, 2]],
[[0, 3], [1, 3]],
[[1, 0], [1, 1]],
[[1, 1], [0, 1]]]],
'perfect'),
('fault site component roots #2',
[2, 3, [[[0, 2], [0, 1]], [[0, 0], [0, 1]], [[1, 1], [1, 0]], [[1, 2], [0, 2]], [[0, 0], [1, 0]]]],
'perfect'),
('partial repair boundary #1', [1, 3, [[[0, 1], [0, 0]]]], 'disconnected'),
('partial repair boundary #2', [1, 3, [[[0, 2], [0, 1]]]], 'disconnected'),
('diagonal passage #1', [2, 2, [[[0, 0], [1, 1]]]], 'invalid-edge'),
('reversed duplicate #1', [2, 1, [[[0, 0], [1, 0]], [[1, 0], [0, 0]]]], 'duplicate'),
('control #1',
[4,
3,
[[[1, 0], [1, 1]],
[[0, 1], [0, 0]],
[[0, 1], [0, 2]],
[[2, 0], [2, 1]],
[[1, 0], [0, 0]],
[[1, 0], [2, 0]],
[[2, 1], [2, 2]],
[[2, 2], [3, 2]],
[[2, 1], [3, 1]],
[[2, 2], [1, 2]],
[[1, 1], [0, 1]],
[[0, 2], [1, 2]]]],
'loop')],
[('single cell maze #1', [1, 1, []], 'perfect'),
('fault site component roots #1',
[1, 4, [[[0, 0], [0, 1]], [[0, 1], [0, 2]], [[0, 2], [0, 3]]]],
'perfect'),
('fault site component roots #2',
[4,
2,
[[[1, 0], [1, 1]],
[[0, 0], [0, 1]],
[[3, 1], [3, 0]],
[[3, 1], [2, 1]],
[[1, 1], [0, 1]],
[[2, 0], [3, 0]],
[[2, 1], [1, 1]]]],
'perfect'),
('partial repair boundary #1', [2, 3, [[[0, 1], [0, 0]], [[0, 1], [0, 2]]]], 'disconnected'),
('partial repair boundary #2', [4, 1, [[[3, 0], [2, 0]], [[1, 0], [2, 0]]]], 'disconnected'),
('diagonal passage #1', [2, 2, [[[0, 0], [1, 1]]]], 'invalid-edge'),
('reversed duplicate #1', [2, 1, [[[0, 0], [1, 0]], [[1, 0], [0, 0]]]], 'duplicate'),
('control #1',
[4, 1, [[[2, 0], [1, 0]], [[3, 0], [2, 0]], [[0, 0], [1, 0]], [[1, 0], [0, 0]]]],
'duplicate')]]
for label, args, expected in cases[N-1]:
check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| single cell maze #1 | perfect | perfect | Passed |
| fault site component roots #1 | perfect | perfect | Passed |
| fault site component roots #2 | perfect | perfect | Passed |
| partial repair boundary #1 | disconnected | disconnected | Passed |
| partial repair boundary #2 | disconnected | disconnected | Passed |
| diagonal passage #1 | invalid-edge | invalid-edge | Passed |
| reversed duplicate #1 | duplicate | duplicate | Passed |
| control #1 | invalid-edge | invalid-edge | Passed |
SHA-256 / 7668f1f45052871e785ae7ebb1924dd982c3e008be8169262eea1fc4ae20c104
Verification & scope
Deterministic toy contract stipulated for this model; integer or exact arithmetic only, not a reproduction of any specific game engine. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.
Observations recorded using Python 3.12.14 at 2026-09-29T14:50:51.413138+00:00.
Case digest / e9c287ed245983fbf1ce65eb96c56df166b47bf5f7a4624ae59604485536af51