FAILURE MAP
← Case archive

FA-86756 / Procedural level generation constraints / Open access

Rotated prefab stamping: Rejected stamp leaks partial tiles · case 01

A failed placement leaves half a prefab in the level.

Verified by executionVariant 1 · 8 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The rejection returns the partially stamped copy.

VERIFIED REPAIR

Restore `return [grid, False]` at the rejection result step.

Unsuccessful approach: Skipping offending tiles stamps the rest and reports success.

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[::-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 [[''.join(row) for row in g], 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 = [[('regression rejection result #1',
   [['...', '#..', 'X..', '...', '#X.', '..X'], ['.D.', '#.D'], 0, 0, -1],
   [['...', '#..', 'X..', '...', '#X.', '..X'], False]),
  ('regression rejection result #2',
   [['XX', 'X.', '..', '..', '..'], ['D', 'D', ' '], 0, 4, -3],
   [['XX', 'X.', '..', '..', '..'], False]),
  ('partial repair boundary #1',
   [['.#...#', '.#.#..'], ['  ', '# '], 1, -1, 6],
   [['.#...#', '.#.#..'], False]),
  ('partial repair boundary #2',
   [['#X', '..', '..', '#.', '#.'], [' D', '.#', '.#'], -1, 2, 3],
   [['#X', '..', '..', '#.', '#.'], False]),
  ('quarter turn #1', [['....', '....'], ['#D'], 0, 0, 1], [['#...', 'D...'], True]),
  ('counter-clockwise turn #1', [['...', '...'], ['#.', '..'], 0, 0, -1], [['...', '#..'], True]),
  ('transparent overhang #1', [['..', '..'], [' #', ' #'], -1, 0, 0], [['#.', '#.'], True]),
  ('control #1', [['.#.', '#..'], ['  ', 'DD', '#.'], 0, -1, 4], [['DD.', '#..'], True])],
 [('regression rejection result #1',
   [['...#', '.X..', 'XX..', '.#X.', 'X.##'], [' .', '  ', '##'], 1, 4, 0],
   [['...#', '.X..', 'XX..', '.#X.', 'X.##'], False]),
  ('regression rejection result #2',
   [['##.', '..#', '#..', '.X.', '.#X', '#..'], ['.', 'D', '.'], 1, 1, 6],
   [['##.', '..#', '#..', '.X.', '.#X', '#..'], False]),
  ('partial repair boundary #1',
   [['#X', '..', '..', '#.', '#.'], [' D', '.#', '.#'], -1, 2, 3],
   [['#X', '..', '..', '#.', '#.'], False]),
  ('regression rejection result #3',
   [['XX', 'X.', '..', '..', '..'], ['D', 'D', ' '], 0, 4, -3],
   [['XX', 'X.', '..', '..', '..'], False]),
  ('transparent overhang #1', [['..', '..'], [' #', ' #'], -1, 0, 0], [['#.', '#.'], True]),
  ('quarter turn #1', [['....', '....'], ['#D'], 0, 0, 1], [['#...', 'D...'], True]),
  ('control #1', [['.#.', '#..'], ['  ', 'DD', '#.'], 0, -1, 4], [['DD.', '#..'], True]),
  ('control #2',
   [['..#X.', '.....', '.....', '.XX#.'], ['##D', '#. ', '.# '], 0, 0, 0],
   [['##DX.', '#....', '.#...', '.XX#.'], True])],
 [('regression rejection result #1',
   [['..', '.X', '..', '.X'], ['#', ' ', 'D'], 0, 2, 6],
   [['..', '.X', '..', '.X'], False]),
  ('regression rejection result #2', [['..', '..', '.#'], ['.DD'], 0, 1, 0], [['..', '..', '.#'], False]),
  ('partial repair boundary #1', [['.X.', '...'], ['D#.', 'D #'], -1, -1, -1], [['.X.', '...'], False]),
  ('regression rejection result #3',
   [['...#', '.X..', 'XX..', '.#X.', 'X.##'], [' .', '  ', '##'], 1, 4, 0],
   [['...#', '.X..', 'XX..', '.#X.', 'X.##'], False]),
  ('counter-clockwise turn #1', [['...', '...'], ['#.', '..'], 0, 0, -1], [['...', '#..'], True]),
  ('transparent overhang #1', [['..', '..'], [' #', ' #'], -1, 0, 0], [['#.', '#.'], True]),
  ('control #1',
   [['..#X.', '.....', '.....', '.XX#.'], ['##D', '#. ', '.# '], 0, 0, 0],
   [['##DX.', '#....', '.#...', '.XX#.'], True]),
  ('control #2',
   [['...#..', '.#....', '#.....'], ['#.', ' .', '#D'], 2, 0, 5],
   [['..###.', '.#D...', '#.....'], True])],
 [('regression rejection result #1', [['..#', '#..'], ['.#', 'D.'], 2, 0, -3], [['..#', '#..'], False]),
  ('regression rejection result #2',
   [['.....#', '#.#..X', 'X.....', '..#XX.', '.#..X.', '...#X.'], ['D', '.'], 2, 3, -1],
   [['.....#', '#.#..X', 'X.....', '..#XX.', '.#..X.', '...#X.'], False]),
  ('partial repair boundary #1',
   [['#..X.X', '.X....'], ['#D', 'D#'], 5, 0, -2],
   [['#..X.X', '.X....'], False]),
  ('partial repair boundary #2',
   [['#.', '..', 'X.', '.#'], ['. #', '. .'], 0, 2, 5],
   [['#.', '..', 'X.', '.#'], False]),
  ('quarter turn #1', [['....', '....'], ['#D'], 0, 0, 1], [['#...', 'D...'], True]),
  ('counter-clockwise turn #1', [['...', '...'], ['#.', '..'], 0, 0, -1], [['...', '#..'], True]),
  ('control #1', [['..X', '#..', '...'], ['#', '.', '#'], 1, 0, 4], [['.#X', '#..', '.#.'], True]),
  ('control #2',
   [['....X', '.....', '..#..', '...X.', '...XX', '..#X#'], ['.'], 1, 5, 6],
   [['....X', '.....', '..#..', '...X.', '...XX', '..#X#'], True])],
 [('regression rejection result #1',
   [['....#', '.X...', '....X', 'X...#', '.....'], ['. .', '.DD', '  D'], 3, 0, -1],
   [['....#', '.X...', '....X', 'X...#', '.....'], False]),
  ('regression rejection result #2',
   [['#.#.X#', '..#.##', '......', '..#..#', 'X.#...'], ['# #', '#  ', 'DD '], 5, 0, 1],
   [['#.#.X#', '..#.##', '......', '..#..#', 'X.#...'], False]),
  ('partial repair boundary #1',
   [['......', '.....#', '.#....'], [' ##'], -1, -1, -2],
   [['......', '.....#', '.#....'], False]),
  ('partial repair boundary #2',
   [['..#.', '..X.', '.X#.', '..X.', '.X#.'], ['#.'], 2, 3, 5],
   [['..#.', '..X.', '.X#.', '..X.', '.X#.'], False]),
  ('transparent overhang #1', [['..', '..'], [' #', ' #'], -1, 0, 0], [['#.', '#.'], True]),
  ('quarter turn #1', [['....', '....'], ['#D'], 0, 0, 1], [['#...', 'D...'], True]),
  ('control #1',
   [['#.#', '#..', '#..', '#.X', 'X#.'], [' '], 1, 4, 3],
   [['#.#', '#..', '#..', '#.X', 'X#.'], True]),
  ('control #2',
   [['..#', '...', '...', '##.'], [' #', 'D#'], 1, 2, -3],
   [['..#', '...', '.D.', '###'], True])]]
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 fixtureActualExpectedOutcome
regression rejection result #1[['.D.', 'D..', 'X..', '...', '#X.', '..X'], False][['...', '#..', 'X..', '...', '#X.', '..X'], False]Failed
regression rejection result #2[['XX', 'X.', '..', '..', '.D'], False][['XX', 'X.', '..', '..', '..'], False]Failed
partial repair boundary #1[['.#...#', '.#.#..'], False][['.#...#', '.#.#..'], False]Passed
partial repair boundary #2[['#X', '..', '..', '#.', '#.'], False][['#X', '..', '..', '#.', '#.'], False]Passed
quarter turn #1[['#...', 'D...'], True][['#...', 'D...'], True]Passed
counter-clockwise turn #1[['...', '#..'], True][['...', '#..'], True]Passed
transparent overhang #1[['#.', '#.'], True][['#.', '#.'], True]Passed
control #1[['DD.', '#..'], True][['DD.', '#..'], True]Passed

SHA-256 / 4b26e0b07834b253a2bf5aef9b32e693b6137baae013d01a0f11c4d27d8aca31

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 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':
                continue
            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 = [[('regression rejection result #1',
   [['...', '#..', 'X..', '...', '#X.', '..X'], ['.D.', '#.D'], 0, 0, -1],
   [['...', '#..', 'X..', '...', '#X.', '..X'], False]),
  ('regression rejection result #2',
   [['XX', 'X.', '..', '..', '..'], ['D', 'D', ' '], 0, 4, -3],
   [['XX', 'X.', '..', '..', '..'], False]),
  ('partial repair boundary #1',
   [['.#...#', '.#.#..'], ['  ', '# '], 1, -1, 6],
   [['.#...#', '.#.#..'], False]),
  ('partial repair boundary #2',
   [['#X', '..', '..', '#.', '#.'], [' D', '.#', '.#'], -1, 2, 3],
   [['#X', '..', '..', '#.', '#.'], False]),
  ('quarter turn #1', [['....', '....'], ['#D'], 0, 0, 1], [['#...', 'D...'], True]),
  ('counter-clockwise turn #1', [['...', '...'], ['#.', '..'], 0, 0, -1], [['...', '#..'], True]),
  ('transparent overhang #1', [['..', '..'], [' #', ' #'], -1, 0, 0], [['#.', '#.'], True]),
  ('control #1', [['.#.', '#..'], ['  ', 'DD', '#.'], 0, -1, 4], [['DD.', '#..'], True])],
 [('regression rejection result #1',
   [['...#', '.X..', 'XX..', '.#X.', 'X.##'], [' .', '  ', '##'], 1, 4, 0],
   [['...#', '.X..', 'XX..', '.#X.', 'X.##'], False]),
  ('regression rejection result #2',
   [['##.', '..#', '#..', '.X.', '.#X', '#..'], ['.', 'D', '.'], 1, 1, 6],
   [['##.', '..#', '#..', '.X.', '.#X', '#..'], False]),
  ('partial repair boundary #1',
   [['#X', '..', '..', '#.', '#.'], [' D', '.#', '.#'], -1, 2, 3],
   [['#X', '..', '..', '#.', '#.'], False]),
  ('regression rejection result #3',
   [['XX', 'X.', '..', '..', '..'], ['D', 'D', ' '], 0, 4, -3],
   [['XX', 'X.', '..', '..', '..'], False]),
  ('transparent overhang #1', [['..', '..'], [' #', ' #'], -1, 0, 0], [['#.', '#.'], True]),
  ('quarter turn #1', [['....', '....'], ['#D'], 0, 0, 1], [['#...', 'D...'], True]),
  ('control #1', [['.#.', '#..'], ['  ', 'DD', '#.'], 0, -1, 4], [['DD.', '#..'], True]),
  ('control #2',
   [['..#X.', '.....', '.....', '.XX#.'], ['##D', '#. ', '.# '], 0, 0, 0],
   [['##DX.', '#....', '.#...', '.XX#.'], True])],
 [('regression rejection result #1',
   [['..', '.X', '..', '.X'], ['#', ' ', 'D'], 0, 2, 6],
   [['..', '.X', '..', '.X'], False]),
  ('regression rejection result #2', [['..', '..', '.#'], ['.DD'], 0, 1, 0], [['..', '..', '.#'], False]),
  ('partial repair boundary #1', [['.X.', '...'], ['D#.', 'D #'], -1, -1, -1], [['.X.', '...'], False]),
  ('regression rejection result #3',
   [['...#', '.X..', 'XX..', '.#X.', 'X.##'], [' .', '  ', '##'], 1, 4, 0],
   [['...#', '.X..', 'XX..', '.#X.', 'X.##'], False]),
  ('counter-clockwise turn #1', [['...', '...'], ['#.', '..'], 0, 0, -1], [['...', '#..'], True]),
  ('transparent overhang #1', [['..', '..'], [' #', ' #'], -1, 0, 0], [['#.', '#.'], True]),
  ('control #1',
   [['..#X.', '.....', '.....', '.XX#.'], ['##D', '#. ', '.# '], 0, 0, 0],
   [['##DX.', '#....', '.#...', '.XX#.'], True]),
  ('control #2',
   [['...#..', '.#....', '#.....'], ['#.', ' .', '#D'], 2, 0, 5],
   [['..###.', '.#D...', '#.....'], True])],
 [('regression rejection result #1', [['..#', '#..'], ['.#', 'D.'], 2, 0, -3], [['..#', '#..'], False]),
  ('regression rejection result #2',
   [['.....#', '#.#..X', 'X.....', '..#XX.', '.#..X.', '...#X.'], ['D', '.'], 2, 3, -1],
   [['.....#', '#.#..X', 'X.....', '..#XX.', '.#..X.', '...#X.'], False]),
  ('partial repair boundary #1',
   [['#..X.X', '.X....'], ['#D', 'D#'], 5, 0, -2],
   [['#..X.X', '.X....'], False]),
  ('partial repair boundary #2',
   [['#.', '..', 'X.', '.#'], ['. #', '. .'], 0, 2, 5],
   [['#.', '..', 'X.', '.#'], False]),
  ('quarter turn #1', [['....', '....'], ['#D'], 0, 0, 1], [['#...', 'D...'], True]),
  ('counter-clockwise turn #1', [['...', '...'], ['#.', '..'], 0, 0, -1], [['...', '#..'], True]),
  ('control #1', [['..X', '#..', '...'], ['#', '.', '#'], 1, 0, 4], [['.#X', '#..', '.#.'], True]),
  ('control #2',
   [['....X', '.....', '..#..', '...X.', '...XX', '..#X#'], ['.'], 1, 5, 6],
   [['....X', '.....', '..#..', '...X.', '...XX', '..#X#'], True])],
 [('regression rejection result #1',
   [['....#', '.X...', '....X', 'X...#', '.....'], ['. .', '.DD', '  D'], 3, 0, -1],
   [['....#', '.X...', '....X', 'X...#', '.....'], False]),
  ('regression rejection result #2',
   [['#.#.X#', '..#.##', '......', '..#..#', 'X.#...'], ['# #', '#  ', 'DD '], 5, 0, 1],
   [['#.#.X#', '..#.##', '......', '..#..#', 'X.#...'], False]),
  ('partial repair boundary #1',
   [['......', '.....#', '.#....'], [' ##'], -1, -1, -2],
   [['......', '.....#', '.#....'], False]),
  ('partial repair boundary #2',
   [['..#.', '..X.', '.X#.', '..X.', '.X#.'], ['#.'], 2, 3, 5],
   [['..#.', '..X.', '.X#.', '..X.', '.X#.'], False]),
  ('transparent overhang #1', [['..', '..'], [' #', ' #'], -1, 0, 0], [['#.', '#.'], True]),
  ('quarter turn #1', [['....', '....'], ['#D'], 0, 0, 1], [['#...', 'D...'], True]),
  ('control #1',
   [['#.#', '#..', '#..', '#.X', 'X#.'], [' '], 1, 4, 3],
   [['#.#', '#..', '#..', '#.X', 'X#.'], True]),
  ('control #2',
   [['..#', '...', '...', '##.'], [' #', 'D#'], 1, 2, -3],
   [['..#', '...', '.D.', '###'], True])]]
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 fixtureActualExpectedOutcome
regression rejection result #1[['.D.', 'D..', 'X#.', '...', '#X.', '..X'], True][['...', '#..', 'X..', '...', '#X.', '..X'], False]Failed
regression rejection result #2[['XX', 'X.', '..', '..', '.D'], True][['XX', 'X.', '..', '..', '..'], False]Failed
partial repair boundary #1[['.#...#', '.#.#..'], True][['.#...#', '.#.#..'], False]Failed
partial repair boundary #2[['#X', '..', '##', '..', '#.'], True][['#X', '..', '..', '#.', '#.'], False]Failed
quarter turn #1[['#...', 'D...'], True][['#...', 'D...'], True]Passed
counter-clockwise turn #1[['...', '#..'], True][['...', '#..'], True]Passed
transparent overhang #1[['#.', '#.'], True][['#.', '#.'], True]Passed
control #1[['DD.', '#..'], True][['DD.', '#..'], True]Passed

SHA-256 / df5b772e2357be592ac26904ced5ef5626e02b886c08708a15ac13a31aff0591

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 = [[('regression rejection result #1',
   [['...', '#..', 'X..', '...', '#X.', '..X'], ['.D.', '#.D'], 0, 0, -1],
   [['...', '#..', 'X..', '...', '#X.', '..X'], False]),
  ('regression rejection result #2',
   [['XX', 'X.', '..', '..', '..'], ['D', 'D', ' '], 0, 4, -3],
   [['XX', 'X.', '..', '..', '..'], False]),
  ('partial repair boundary #1',
   [['.#...#', '.#.#..'], ['  ', '# '], 1, -1, 6],
   [['.#...#', '.#.#..'], False]),
  ('partial repair boundary #2',
   [['#X', '..', '..', '#.', '#.'], [' D', '.#', '.#'], -1, 2, 3],
   [['#X', '..', '..', '#.', '#.'], False]),
  ('quarter turn #1', [['....', '....'], ['#D'], 0, 0, 1], [['#...', 'D...'], True]),
  ('counter-clockwise turn #1', [['...', '...'], ['#.', '..'], 0, 0, -1], [['...', '#..'], True]),
  ('transparent overhang #1', [['..', '..'], [' #', ' #'], -1, 0, 0], [['#.', '#.'], True]),
  ('control #1', [['.#.', '#..'], ['  ', 'DD', '#.'], 0, -1, 4], [['DD.', '#..'], True])],
 [('regression rejection result #1',
   [['...#', '.X..', 'XX..', '.#X.', 'X.##'], [' .', '  ', '##'], 1, 4, 0],
   [['...#', '.X..', 'XX..', '.#X.', 'X.##'], False]),
  ('regression rejection result #2',
   [['##.', '..#', '#..', '.X.', '.#X', '#..'], ['.', 'D', '.'], 1, 1, 6],
   [['##.', '..#', '#..', '.X.', '.#X', '#..'], False]),
  ('partial repair boundary #1',
   [['#X', '..', '..', '#.', '#.'], [' D', '.#', '.#'], -1, 2, 3],
   [['#X', '..', '..', '#.', '#.'], False]),
  ('regression rejection result #3',
   [['XX', 'X.', '..', '..', '..'], ['D', 'D', ' '], 0, 4, -3],
   [['XX', 'X.', '..', '..', '..'], False]),
  ('transparent overhang #1', [['..', '..'], [' #', ' #'], -1, 0, 0], [['#.', '#.'], True]),
  ('quarter turn #1', [['....', '....'], ['#D'], 0, 0, 1], [['#...', 'D...'], True]),
  ('control #1', [['.#.', '#..'], ['  ', 'DD', '#.'], 0, -1, 4], [['DD.', '#..'], True]),
  ('control #2',
   [['..#X.', '.....', '.....', '.XX#.'], ['##D', '#. ', '.# '], 0, 0, 0],
   [['##DX.', '#....', '.#...', '.XX#.'], True])],
 [('regression rejection result #1',
   [['..', '.X', '..', '.X'], ['#', ' ', 'D'], 0, 2, 6],
   [['..', '.X', '..', '.X'], False]),
  ('regression rejection result #2', [['..', '..', '.#'], ['.DD'], 0, 1, 0], [['..', '..', '.#'], False]),
  ('partial repair boundary #1', [['.X.', '...'], ['D#.', 'D #'], -1, -1, -1], [['.X.', '...'], False]),
  ('regression rejection result #3',
   [['...#', '.X..', 'XX..', '.#X.', 'X.##'], [' .', '  ', '##'], 1, 4, 0],
   [['...#', '.X..', 'XX..', '.#X.', 'X.##'], False]),
  ('counter-clockwise turn #1', [['...', '...'], ['#.', '..'], 0, 0, -1], [['...', '#..'], True]),
  ('transparent overhang #1', [['..', '..'], [' #', ' #'], -1, 0, 0], [['#.', '#.'], True]),
  ('control #1',
   [['..#X.', '.....', '.....', '.XX#.'], ['##D', '#. ', '.# '], 0, 0, 0],
   [['##DX.', '#....', '.#...', '.XX#.'], True]),
  ('control #2',
   [['...#..', '.#....', '#.....'], ['#.', ' .', '#D'], 2, 0, 5],
   [['..###.', '.#D...', '#.....'], True])],
 [('regression rejection result #1', [['..#', '#..'], ['.#', 'D.'], 2, 0, -3], [['..#', '#..'], False]),
  ('regression rejection result #2',
   [['.....#', '#.#..X', 'X.....', '..#XX.', '.#..X.', '...#X.'], ['D', '.'], 2, 3, -1],
   [['.....#', '#.#..X', 'X.....', '..#XX.', '.#..X.', '...#X.'], False]),
  ('partial repair boundary #1',
   [['#..X.X', '.X....'], ['#D', 'D#'], 5, 0, -2],
   [['#..X.X', '.X....'], False]),
  ('partial repair boundary #2',
   [['#.', '..', 'X.', '.#'], ['. #', '. .'], 0, 2, 5],
   [['#.', '..', 'X.', '.#'], False]),
  ('quarter turn #1', [['....', '....'], ['#D'], 0, 0, 1], [['#...', 'D...'], True]),
  ('counter-clockwise turn #1', [['...', '...'], ['#.', '..'], 0, 0, -1], [['...', '#..'], True]),
  ('control #1', [['..X', '#..', '...'], ['#', '.', '#'], 1, 0, 4], [['.#X', '#..', '.#.'], True]),
  ('control #2',
   [['....X', '.....', '..#..', '...X.', '...XX', '..#X#'], ['.'], 1, 5, 6],
   [['....X', '.....', '..#..', '...X.', '...XX', '..#X#'], True])],
 [('regression rejection result #1',
   [['....#', '.X...', '....X', 'X...#', '.....'], ['. .', '.DD', '  D'], 3, 0, -1],
   [['....#', '.X...', '....X', 'X...#', '.....'], False]),
  ('regression rejection result #2',
   [['#.#.X#', '..#.##', '......', '..#..#', 'X.#...'], ['# #', '#  ', 'DD '], 5, 0, 1],
   [['#.#.X#', '..#.##', '......', '..#..#', 'X.#...'], False]),
  ('partial repair boundary #1',
   [['......', '.....#', '.#....'], [' ##'], -1, -1, -2],
   [['......', '.....#', '.#....'], False]),
  ('partial repair boundary #2',
   [['..#.', '..X.', '.X#.', '..X.', '.X#.'], ['#.'], 2, 3, 5],
   [['..#.', '..X.', '.X#.', '..X.', '.X#.'], False]),
  ('transparent overhang #1', [['..', '..'], [' #', ' #'], -1, 0, 0], [['#.', '#.'], True]),
  ('quarter turn #1', [['....', '....'], ['#D'], 0, 0, 1], [['#...', 'D...'], True]),
  ('control #1',
   [['#.#', '#..', '#..', '#.X', 'X#.'], [' '], 1, 4, 3],
   [['#.#', '#..', '#..', '#.X', 'X#.'], True]),
  ('control #2',
   [['..#', '...', '...', '##.'], [' #', 'D#'], 1, 2, -3],
   [['..#', '...', '.D.', '###'], True])]]
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 fixtureActualExpectedOutcome
regression rejection result #1[['...', '#..', 'X..', '...', '#X.', '..X'], False][['...', '#..', 'X..', '...', '#X.', '..X'], False]Passed
regression rejection result #2[['XX', 'X.', '..', '..', '..'], False][['XX', 'X.', '..', '..', '..'], False]Passed
partial repair boundary #1[['.#...#', '.#.#..'], False][['.#...#', '.#.#..'], False]Passed
partial repair boundary #2[['#X', '..', '..', '#.', '#.'], False][['#X', '..', '..', '#.', '#.'], False]Passed
quarter turn #1[['#...', 'D...'], True][['#...', 'D...'], True]Passed
counter-clockwise turn #1[['...', '#..'], True][['...', '#..'], True]Passed
transparent overhang #1[['#.', '#.'], True][['#.', '#.'], True]Passed
control #1[['DD.', '#..'], True][['DD.', '#..'], True]Passed

SHA-256 / 376a12fe84950504253db955643b4e08b1d284753e1cd3554452c1eb348f33e1

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.558901+00:00.

Case digest / 74aa25ccf3ab1cdb88c642a19d13ae0a9bd048c2c69843b236a5ea7ff87e94c9