FA-86731 / Procedural level generation constraints / Open access
Rotated prefab stamping: Rotation is a transpose · case 01
Rotated prefabs appear mirrored.
ROOT CAUSE
Rotation transposes without reversing rows.
VERIFIED REPAIR
Restore `zip(*p[::-1])` at the rotation direction step.
Unsuccessful approach: Reversing after transposing rotates counter-clockwise.
Case contract
The prefab (rows of chars, ' ' transparent) is rotated clockwise rot times (rot taken mod 4, negative allowed) and stamped with its top-left at column ox, row oy. If any non-transparent tile would land out of bounds or on a locked 'X' tile, the stamp is rejected and the original grid returned with False; otherwise the new grid with True.
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(grid, prefab, ox, oy, rot):
p = [list(row) for row in prefab]
for _ in range(rot % 4):
p = [list(row) for row in zip(*p)]
g = [list(row) for row in grid]
for r, line in enumerate(p):
for c, t in enumerate(line):
if t == ' ':
continue
y, x = oy + r, ox + c
if not (0 <= y < len(g) and 0 <= x < len(g[0])) or g[y][x] == 'X':
return [grid, False]
g[y][x] = t
return [[''.join(row) for row in g], True]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('counter-clockwise turn #1', [['...', '...'], ['#.', '..'], 0, 0, -1], [['...', '#..'], True]),
('quarter turn #1', [['....', '....'], ['#D'], 0, 0, 1], [['#...', 'D...'], True]),
('fault site rotation direction #1',
[['.#...#', '.#.#..'], [' ', '# '], 1, -1, 6],
[['.#...#', '.#.#..'], False]),
('regression rotation direction #1',
[['XX', 'X.', '..', '..', '..'], ['D', 'D', ' '], 0, 4, -3],
[['XX', 'X.', '..', '..', '..'], False]),
('regression rotation direction #2',
[['...#..', '.#....', '#.....'], ['#.', ' .', '#D'], 2, 0, 5],
[['..###.', '.#D...', '#.....'], True]),
('regression rotation direction #3',
[['..#', '...', '...', '##.'], [' #', 'D#'], 1, 2, -3],
[['..#', '...', '.D.', '###'], True]),
('transparent overhang #1', [['..', '..'], [' #', ' #'], -1, 0, 0], [['#.', '#.'], True]),
('control #1',
[['...', '#..', 'X..', '...', '#X.', '..X'], ['.D.', '#.D'], 0, 0, -1],
[['...', '#..', 'X..', '...', '#X.', '..X'], False])],
[('counter-clockwise turn #1', [['...', '...'], ['#.', '..'], 0, 0, -1], [['...', '#..'], True]),
('quarter turn #1', [['....', '....'], ['#D'], 0, 0, 1], [['#...', 'D...'], True]),
('regression rotation direction #1',
[['XX', 'X.', '..', '..', '..'], ['D', 'D', ' '], 0, 4, -3],
[['XX', 'X.', '..', '..', '..'], False]),
('regression rotation direction #2',
[['...#..', '.#....', '#.....'], ['#.', ' .', '#D'], 2, 0, 5],
[['..###.', '.#D...', '#.....'], True]),
('regression rotation direction #3',
[['..#', '...', '...', '##.'], [' #', 'D#'], 1, 2, -3],
[['..#', '...', '.D.', '###'], True]),
('partial repair boundary #1',
[['...', '...', '...', 'X#.', 'X#.', '...'], ['.', '.', ' '], 1, 3, -1],
[['...', '...', '...', 'X..', 'X#.', '...'], True]),
('transparent overhang #1', [['..', '..'], [' #', ' #'], -1, 0, 0], [['#.', '#.'], True]),
('control #1',
[['...', '#..', 'X..', '...', '#X.', '..X'], ['.D.', '#.D'], 0, 0, -1],
[['...', '#..', 'X..', '...', '#X.', '..X'], False])],
[('counter-clockwise turn #1', [['...', '...'], ['#.', '..'], 0, 0, -1], [['...', '#..'], True]),
('quarter turn #1', [['....', '....'], ['#D'], 0, 0, 1], [['#...', 'D...'], True]),
('regression rotation direction #1',
[['..#', '...', '...', '##.'], [' #', 'D#'], 1, 2, -3],
[['..#', '...', '.D.', '###'], True]),
('fault site rotation direction #1',
[['..', '..', '#.', 'X.'], ['D', '#', ' '], 0, 1, 6],
[['..', '..', '#.', 'X.'], False]),
('partial repair boundary #1',
[['...', '...', '...', 'X#.', 'X#.', '...'], ['.', '.', ' '], 1, 3, -1],
[['...', '...', '...', 'X..', 'X#.', '...'], True]),
('partial repair boundary #2',
[['..#..', '..#..', '..X#X', 'X.XX.', 'X.X..'], [' ', '#'], 3, 1, 3],
[['..#..', '..#.#', '..X#X', 'X.XX.', 'X.X..'], True]),
('transparent overhang #1', [['..', '..'], [' #', ' #'], -1, 0, 0], [['#.', '#.'], True]),
('control #1',
[['#X', '..', '..', '#.', '#.'], [' D', '.#', '.#'], -1, 2, 3],
[['#X', '..', '..', '#.', '#.'], False])],
[('counter-clockwise turn #1', [['...', '...'], ['#.', '..'], 0, 0, -1], [['...', '#..'], True]),
('quarter turn #1', [['....', '....'], ['#D'], 0, 0, 1], [['#...', 'D...'], True]),
('fault site rotation direction #1',
[['..X.#', '.#X..', 'X.#.#'], ['#', '.', ' '], 3, 1, 6],
[['..X.#', '.#X..', 'X.#.#'], False]),
('fault site rotation direction #2',
[['..#.X.', '......', '.#..#.', 'XX.#.#', 'X..#.X'], [' ', ' .', 'D.'], 4, 0, 2],
[['..#.X.', '......', '.#..#.', 'XX.#.#', 'X..#.X'], False]),
('partial repair boundary #1',
[['..#..', '..#..', '..X#X', 'X.XX.', 'X.X..'], [' ', '#'], 3, 1, 3],
[['..#..', '..#.#', '..X#X', 'X.XX.', 'X.X..'], True]),
('regression rotation direction #1',
[['.X..', '..XX', '...#', '..##', 'X...', '..X.'], ['D', ' '], 3, 0, 1],
[['.X..', '..XX', '...#', '..##', 'X...', '..X.'], False]),
('transparent overhang #1', [['..', '..'], [' #', ' #'], -1, 0, 0], [['#.', '#.'], True]),
('control #1', [['.X.', '...'], ['D#.', 'D #'], -1, -1, -1], [['.X.', '...'], False])],
[('counter-clockwise turn #1', [['...', '...'], ['#.', '..'], 0, 0, -1], [['...', '#..'], True]),
('quarter turn #1', [['....', '....'], ['#D'], 0, 0, 1], [['#...', 'D...'], True]),
('fault site rotation direction #1',
[['X.', '#.', 'X#', '..', '..', '..'], ['# ', 'D '], 0, 1, 2],
[['X.', '#D', 'X#', '..', '..', '..'], True]),
('regression rotation direction #1',
[['.X..', '..XX', '...#', '..##', 'X...', '..X.'], ['D', ' '], 3, 0, 1],
[['.X..', '..XX', '...#', '..##', 'X...', '..X.'], False]),
('partial repair boundary #1',
[['.X.', '...', 'X#.'], ['#', ' '], 2, 2, -1],
[['.X.', '...', 'X##'], True]),
('partial repair boundary #2', [['.X#', '.##', '#..'], ['D '], 0, 2, 1], [['.X#', '.##', 'D..'], True]),
('transparent overhang #1', [['..', '..'], [' #', ' #'], -1, 0, 0], [['#.', '#.'], True]),
('control #1',
[['...#', '.X..', 'XX..', '.#X.', 'X.##'], [' .', ' ', '##'], 1, 4, 0],
[['...#', '.X..', 'XX..', '.#X.', 'X.##'], False])]]
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 |
|---|---|---|---|
| counter-clockwise turn #1 | [['#..', '...'], True] | [['...', '#..'], True] | Failed |
| quarter turn #1 | [['#...', 'D...'], True] | [['#...', 'D...'], True] | Passed |
| fault site rotation direction #1 | [['.#...#', '.#.#..'], True] | [['.#...#', '.#.#..'], False] | Failed |
| regression rotation direction #1 | [['XX', 'X.', '..', '..', 'DD'], True] | [['XX', 'X.', '..', '..', '..'], False] | Failed |
| regression rotation direction #2 | [['..###.', '.#..D.', '#.....'], True] | [['..###.', '.#D...', '#.....'], True] | Failed |
| regression rotation direction #3 | [['..#', '...', '..D', '###'], True] | [['..#', '...', '.D.', '###'], True] | Failed |
| transparent overhang #1 | [['#.', '#.'], True] | [['#.', '#.'], True] | Passed |
| control #1 | [['...', '#..', 'X..', '...', '#X.', '..X'], False] | [['...', '#..', 'X..', '...', '#X.', '..X'], False] | Passed |
SHA-256 / 3bc17e2da7ed9e6725362f38790200f31c07d6da85b80a30f0464df3c15a9d38
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(grid, prefab, ox, oy, rot):
p = [list(row) for row in prefab]
for _ in range(rot % 4):
p = [list(row) for row in list(zip(*p))[::-1]]
g = [list(row) for row in grid]
for r, line in enumerate(p):
for c, t in enumerate(line):
if t == ' ':
continue
y, x = oy + r, ox + c
if not (0 <= y < len(g) and 0 <= x < len(g[0])) or g[y][x] == 'X':
return [grid, False]
g[y][x] = t
return [[''.join(row) for row in g], True]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('counter-clockwise turn #1', [['...', '...'], ['#.', '..'], 0, 0, -1], [['...', '#..'], True]),
('quarter turn #1', [['....', '....'], ['#D'], 0, 0, 1], [['#...', 'D...'], True]),
('fault site rotation direction #1',
[['.#...#', '.#.#..'], [' ', '# '], 1, -1, 6],
[['.#...#', '.#.#..'], False]),
('regression rotation direction #1',
[['XX', 'X.', '..', '..', '..'], ['D', 'D', ' '], 0, 4, -3],
[['XX', 'X.', '..', '..', '..'], False]),
('regression rotation direction #2',
[['...#..', '.#....', '#.....'], ['#.', ' .', '#D'], 2, 0, 5],
[['..###.', '.#D...', '#.....'], True]),
('regression rotation direction #3',
[['..#', '...', '...', '##.'], [' #', 'D#'], 1, 2, -3],
[['..#', '...', '.D.', '###'], True]),
('transparent overhang #1', [['..', '..'], [' #', ' #'], -1, 0, 0], [['#.', '#.'], True]),
('control #1',
[['...', '#..', 'X..', '...', '#X.', '..X'], ['.D.', '#.D'], 0, 0, -1],
[['...', '#..', 'X..', '...', '#X.', '..X'], False])],
[('counter-clockwise turn #1', [['...', '...'], ['#.', '..'], 0, 0, -1], [['...', '#..'], True]),
('quarter turn #1', [['....', '....'], ['#D'], 0, 0, 1], [['#...', 'D...'], True]),
('regression rotation direction #1',
[['XX', 'X.', '..', '..', '..'], ['D', 'D', ' '], 0, 4, -3],
[['XX', 'X.', '..', '..', '..'], False]),
('regression rotation direction #2',
[['...#..', '.#....', '#.....'], ['#.', ' .', '#D'], 2, 0, 5],
[['..###.', '.#D...', '#.....'], True]),
('regression rotation direction #3',
[['..#', '...', '...', '##.'], [' #', 'D#'], 1, 2, -3],
[['..#', '...', '.D.', '###'], True]),
('partial repair boundary #1',
[['...', '...', '...', 'X#.', 'X#.', '...'], ['.', '.', ' '], 1, 3, -1],
[['...', '...', '...', 'X..', 'X#.', '...'], True]),
('transparent overhang #1', [['..', '..'], [' #', ' #'], -1, 0, 0], [['#.', '#.'], True]),
('control #1',
[['...', '#..', 'X..', '...', '#X.', '..X'], ['.D.', '#.D'], 0, 0, -1],
[['...', '#..', 'X..', '...', '#X.', '..X'], False])],
[('counter-clockwise turn #1', [['...', '...'], ['#.', '..'], 0, 0, -1], [['...', '#..'], True]),
('quarter turn #1', [['....', '....'], ['#D'], 0, 0, 1], [['#...', 'D...'], True]),
('regression rotation direction #1',
[['..#', '...', '...', '##.'], [' #', 'D#'], 1, 2, -3],
[['..#', '...', '.D.', '###'], True]),
('fault site rotation direction #1',
[['..', '..', '#.', 'X.'], ['D', '#', ' '], 0, 1, 6],
[['..', '..', '#.', 'X.'], False]),
('partial repair boundary #1',
[['...', '...', '...', 'X#.', 'X#.', '...'], ['.', '.', ' '], 1, 3, -1],
[['...', '...', '...', 'X..', 'X#.', '...'], True]),
('partial repair boundary #2',
[['..#..', '..#..', '..X#X', 'X.XX.', 'X.X..'], [' ', '#'], 3, 1, 3],
[['..#..', '..#.#', '..X#X', 'X.XX.', 'X.X..'], True]),
('transparent overhang #1', [['..', '..'], [' #', ' #'], -1, 0, 0], [['#.', '#.'], True]),
('control #1',
[['#X', '..', '..', '#.', '#.'], [' D', '.#', '.#'], -1, 2, 3],
[['#X', '..', '..', '#.', '#.'], False])],
[('counter-clockwise turn #1', [['...', '...'], ['#.', '..'], 0, 0, -1], [['...', '#..'], True]),
('quarter turn #1', [['....', '....'], ['#D'], 0, 0, 1], [['#...', 'D...'], True]),
('fault site rotation direction #1',
[['..X.#', '.#X..', 'X.#.#'], ['#', '.', ' '], 3, 1, 6],
[['..X.#', '.#X..', 'X.#.#'], False]),
('fault site rotation direction #2',
[['..#.X.', '......', '.#..#.', 'XX.#.#', 'X..#.X'], [' ', ' .', 'D.'], 4, 0, 2],
[['..#.X.', '......', '.#..#.', 'XX.#.#', 'X..#.X'], False]),
('partial repair boundary #1',
[['..#..', '..#..', '..X#X', 'X.XX.', 'X.X..'], [' ', '#'], 3, 1, 3],
[['..#..', '..#.#', '..X#X', 'X.XX.', 'X.X..'], True]),
('regression rotation direction #1',
[['.X..', '..XX', '...#', '..##', 'X...', '..X.'], ['D', ' '], 3, 0, 1],
[['.X..', '..XX', '...#', '..##', 'X...', '..X.'], False]),
('transparent overhang #1', [['..', '..'], [' #', ' #'], -1, 0, 0], [['#.', '#.'], True]),
('control #1', [['.X.', '...'], ['D#.', 'D #'], -1, -1, -1], [['.X.', '...'], False])],
[('counter-clockwise turn #1', [['...', '...'], ['#.', '..'], 0, 0, -1], [['...', '#..'], True]),
('quarter turn #1', [['....', '....'], ['#D'], 0, 0, 1], [['#...', 'D...'], True]),
('fault site rotation direction #1',
[['X.', '#.', 'X#', '..', '..', '..'], ['# ', 'D '], 0, 1, 2],
[['X.', '#D', 'X#', '..', '..', '..'], True]),
('regression rotation direction #1',
[['.X..', '..XX', '...#', '..##', 'X...', '..X.'], ['D', ' '], 3, 0, 1],
[['.X..', '..XX', '...#', '..##', 'X...', '..X.'], False]),
('partial repair boundary #1',
[['.X.', '...', 'X#.'], ['#', ' '], 2, 2, -1],
[['.X.', '...', 'X##'], True]),
('partial repair boundary #2', [['.X#', '.##', '#..'], ['D '], 0, 2, 1], [['.X#', '.##', 'D..'], True]),
('transparent overhang #1', [['..', '..'], [' #', ' #'], -1, 0, 0], [['#.', '#.'], True]),
('control #1',
[['...#', '.X..', 'XX..', '.#X.', 'X.##'], [' .', ' ', '##'], 1, 4, 0],
[['...#', '.X..', 'XX..', '.#X.', 'X.##'], False])]]
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 |
|---|---|---|---|
| counter-clockwise turn #1 | [['.#.', '...'], True] | [['...', '#..'], True] | Failed |
| quarter turn #1 | [['D...', '#...'], True] | [['#...', 'D...'], True] | Failed |
| fault site rotation direction #1 | [['.#...#', '.#.#..'], False] | [['.#...#', '.#.#..'], False] | Passed |
| regression rotation direction #1 | [['XX', 'X.', '..', '..', 'DD'], True] | [['XX', 'X.', '..', '..', '..'], False] | Failed |
| regression rotation direction #2 | [['....D.', '.##.#.', '#.....'], True] | [['..###.', '.#D...', '#.....'], True] | Failed |
| regression rotation direction #3 | [['..#', '...', '.##', '##D'], True] | [['..#', '...', '.D.', '###'], True] | Failed |
| transparent overhang #1 | [['#.', '#.'], True] | [['#.', '#.'], True] | Passed |
| control #1 | [['...', '#..', 'X..', '...', '#X.', '..X'], False] | [['...', '#..', 'X..', '...', '#X.', '..X'], False] | Passed |
SHA-256 / b8cb8e41b970e948674f1bf2df10c48c86c2d1ec7280fa12a3a255fd28b2a0a1
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(grid, prefab, ox, oy, rot):
p = [list(row) for row in prefab]
for _ in range(rot % 4):
p = [list(row) for row in zip(*p[::-1])]
g = [list(row) for row in grid]
for r, line in enumerate(p):
for c, t in enumerate(line):
if t == ' ':
continue
y, x = oy + r, ox + c
if not (0 <= y < len(g) and 0 <= x < len(g[0])) or g[y][x] == 'X':
return [grid, False]
g[y][x] = t
return [[''.join(row) for row in g], True]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('counter-clockwise turn #1', [['...', '...'], ['#.', '..'], 0, 0, -1], [['...', '#..'], True]),
('quarter turn #1', [['....', '....'], ['#D'], 0, 0, 1], [['#...', 'D...'], True]),
('fault site rotation direction #1',
[['.#...#', '.#.#..'], [' ', '# '], 1, -1, 6],
[['.#...#', '.#.#..'], False]),
('regression rotation direction #1',
[['XX', 'X.', '..', '..', '..'], ['D', 'D', ' '], 0, 4, -3],
[['XX', 'X.', '..', '..', '..'], False]),
('regression rotation direction #2',
[['...#..', '.#....', '#.....'], ['#.', ' .', '#D'], 2, 0, 5],
[['..###.', '.#D...', '#.....'], True]),
('regression rotation direction #3',
[['..#', '...', '...', '##.'], [' #', 'D#'], 1, 2, -3],
[['..#', '...', '.D.', '###'], True]),
('transparent overhang #1', [['..', '..'], [' #', ' #'], -1, 0, 0], [['#.', '#.'], True]),
('control #1',
[['...', '#..', 'X..', '...', '#X.', '..X'], ['.D.', '#.D'], 0, 0, -1],
[['...', '#..', 'X..', '...', '#X.', '..X'], False])],
[('counter-clockwise turn #1', [['...', '...'], ['#.', '..'], 0, 0, -1], [['...', '#..'], True]),
('quarter turn #1', [['....', '....'], ['#D'], 0, 0, 1], [['#...', 'D...'], True]),
('regression rotation direction #1',
[['XX', 'X.', '..', '..', '..'], ['D', 'D', ' '], 0, 4, -3],
[['XX', 'X.', '..', '..', '..'], False]),
('regression rotation direction #2',
[['...#..', '.#....', '#.....'], ['#.', ' .', '#D'], 2, 0, 5],
[['..###.', '.#D...', '#.....'], True]),
('regression rotation direction #3',
[['..#', '...', '...', '##.'], [' #', 'D#'], 1, 2, -3],
[['..#', '...', '.D.', '###'], True]),
('partial repair boundary #1',
[['...', '...', '...', 'X#.', 'X#.', '...'], ['.', '.', ' '], 1, 3, -1],
[['...', '...', '...', 'X..', 'X#.', '...'], True]),
('transparent overhang #1', [['..', '..'], [' #', ' #'], -1, 0, 0], [['#.', '#.'], True]),
('control #1',
[['...', '#..', 'X..', '...', '#X.', '..X'], ['.D.', '#.D'], 0, 0, -1],
[['...', '#..', 'X..', '...', '#X.', '..X'], False])],
[('counter-clockwise turn #1', [['...', '...'], ['#.', '..'], 0, 0, -1], [['...', '#..'], True]),
('quarter turn #1', [['....', '....'], ['#D'], 0, 0, 1], [['#...', 'D...'], True]),
('regression rotation direction #1',
[['..#', '...', '...', '##.'], [' #', 'D#'], 1, 2, -3],
[['..#', '...', '.D.', '###'], True]),
('fault site rotation direction #1',
[['..', '..', '#.', 'X.'], ['D', '#', ' '], 0, 1, 6],
[['..', '..', '#.', 'X.'], False]),
('partial repair boundary #1',
[['...', '...', '...', 'X#.', 'X#.', '...'], ['.', '.', ' '], 1, 3, -1],
[['...', '...', '...', 'X..', 'X#.', '...'], True]),
('partial repair boundary #2',
[['..#..', '..#..', '..X#X', 'X.XX.', 'X.X..'], [' ', '#'], 3, 1, 3],
[['..#..', '..#.#', '..X#X', 'X.XX.', 'X.X..'], True]),
('transparent overhang #1', [['..', '..'], [' #', ' #'], -1, 0, 0], [['#.', '#.'], True]),
('control #1',
[['#X', '..', '..', '#.', '#.'], [' D', '.#', '.#'], -1, 2, 3],
[['#X', '..', '..', '#.', '#.'], False])],
[('counter-clockwise turn #1', [['...', '...'], ['#.', '..'], 0, 0, -1], [['...', '#..'], True]),
('quarter turn #1', [['....', '....'], ['#D'], 0, 0, 1], [['#...', 'D...'], True]),
('fault site rotation direction #1',
[['..X.#', '.#X..', 'X.#.#'], ['#', '.', ' '], 3, 1, 6],
[['..X.#', '.#X..', 'X.#.#'], False]),
('fault site rotation direction #2',
[['..#.X.', '......', '.#..#.', 'XX.#.#', 'X..#.X'], [' ', ' .', 'D.'], 4, 0, 2],
[['..#.X.', '......', '.#..#.', 'XX.#.#', 'X..#.X'], False]),
('partial repair boundary #1',
[['..#..', '..#..', '..X#X', 'X.XX.', 'X.X..'], [' ', '#'], 3, 1, 3],
[['..#..', '..#.#', '..X#X', 'X.XX.', 'X.X..'], True]),
('regression rotation direction #1',
[['.X..', '..XX', '...#', '..##', 'X...', '..X.'], ['D', ' '], 3, 0, 1],
[['.X..', '..XX', '...#', '..##', 'X...', '..X.'], False]),
('transparent overhang #1', [['..', '..'], [' #', ' #'], -1, 0, 0], [['#.', '#.'], True]),
('control #1', [['.X.', '...'], ['D#.', 'D #'], -1, -1, -1], [['.X.', '...'], False])],
[('counter-clockwise turn #1', [['...', '...'], ['#.', '..'], 0, 0, -1], [['...', '#..'], True]),
('quarter turn #1', [['....', '....'], ['#D'], 0, 0, 1], [['#...', 'D...'], True]),
('fault site rotation direction #1',
[['X.', '#.', 'X#', '..', '..', '..'], ['# ', 'D '], 0, 1, 2],
[['X.', '#D', 'X#', '..', '..', '..'], True]),
('regression rotation direction #1',
[['.X..', '..XX', '...#', '..##', 'X...', '..X.'], ['D', ' '], 3, 0, 1],
[['.X..', '..XX', '...#', '..##', 'X...', '..X.'], False]),
('partial repair boundary #1',
[['.X.', '...', 'X#.'], ['#', ' '], 2, 2, -1],
[['.X.', '...', 'X##'], True]),
('partial repair boundary #2', [['.X#', '.##', '#..'], ['D '], 0, 2, 1], [['.X#', '.##', 'D..'], True]),
('transparent overhang #1', [['..', '..'], [' #', ' #'], -1, 0, 0], [['#.', '#.'], True]),
('control #1',
[['...#', '.X..', 'XX..', '.#X.', 'X.##'], [' .', ' ', '##'], 1, 4, 0],
[['...#', '.X..', 'XX..', '.#X.', 'X.##'], False])]]
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 |
|---|---|---|---|
| counter-clockwise turn #1 | [['...', '#..'], True] | [['...', '#..'], True] | Passed |
| quarter turn #1 | [['#...', 'D...'], True] | [['#...', 'D...'], True] | Passed |
| fault site rotation direction #1 | [['.#...#', '.#.#..'], False] | [['.#...#', '.#.#..'], False] | Passed |
| regression rotation direction #1 | [['XX', 'X.', '..', '..', '..'], False] | [['XX', 'X.', '..', '..', '..'], False] | Passed |
| regression rotation direction #2 | [['..###.', '.#D...', '#.....'], True] | [['..###.', '.#D...', '#.....'], True] | Passed |
| regression rotation direction #3 | [['..#', '...', '.D.', '###'], True] | [['..#', '...', '.D.', '###'], True] | Passed |
| transparent overhang #1 | [['#.', '#.'], True] | [['#.', '#.'], True] | Passed |
| control #1 | [['...', '#..', 'X..', '...', '#X.', '..X'], False] | [['...', '#..', 'X..', '...', '#X.', '..X'], False] | Passed |
SHA-256 / f2b3ca6c7f661af509a5dc9fb4587bf634a90f3372e99d292034575a190fe1ee
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:52.168271+00:00.
Case digest / 0d7dd7a4f22b15c70f40dbde12cacaa6ef93e4d77a7d6b1b05c7fd66ca1bfa42