FAILURE MAP
← Case archive

FA-86751 / Procedural level generation constraints / Open access

Rotated prefab stamping: Locked tiles are overwritten · case 01

Quest-critical locked tiles get replaced by prefabs.

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

ROOT CAUSE

The lock test checks walls instead of locked tiles.

THE FAILURE

The lock test checks walls instead of locked tiles.

Unsuccessful approach: Rejecting walls as well refuses valid stamps over walls.

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] == '#':
                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 locked tile check #1', [['.#.', '#..'], ['  ', 'DD', '#.'], 0, -1, 4], [['DD.', '#..'], True]),
  ('regression locked tile check #2',
   [['..#X.', '.....', '.....', '.XX#.'], ['##D', '#. ', '.# '], 0, 0, 0],
   [['##DX.', '#....', '.#...', '.XX#.'], True]),
  ('regression locked tile check #3',
   [['..#', '...', '...', '##.'], [' #', 'D#'], 1, 2, -3],
   [['..#', '...', '.D.', '###'], True]),
  ('regression locked tile check #4',
   [['...', 'X..', '#..', '#..'], ['DD'], 0, 2, -2],
   [['...', 'X..', 'DD.', '#..'], True]),
  ('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', [['.#...#', '.#.#..'], ['  ', '# '], 1, -1, 6], [['.#...#', '.#.#..'], False])],
 [('fault site locked tile check #1',
   [['X.', '..', '#X', '..', 'X.', '#.'], ['D#', '# '], 0, 0, 0],
   [['X.', '..', '#X', '..', 'X.', '#.'], False]),
  ('regression locked tile check #1',
   [['..#', '...', '...', '##.'], [' #', 'D#'], 1, 2, -3],
   [['..#', '...', '.D.', '###'], True]),
  ('regression locked tile check #2',
   [['...', 'X..', '#..', '#..'], ['DD'], 0, 2, -2],
   [['...', 'X..', 'DD.', '#..'], True]),
  ('regression locked tile check #3',
   [['X#.XX', '....X', '...#.', 'X...#', 'X....'], ['D', 'D'], 1, 0, -1],
   [['XDDXX', '....X', '...#.', 'X...#', 'X....'], True]),
  ('transparent overhang #1', [['..', '..'], [' #', ' #'], -1, 0, 0], [['#.', '#.'], True]),
  ('quarter turn #1', [['....', '....'], ['#D'], 0, 0, 1], [['#...', 'D...'], True]),
  ('control #1', [['.#...#', '.#.#..'], ['  ', '# '], 1, -1, 6], [['.#...#', '.#.#..'], False]),
  ('control #2',
   [['...', '#..', 'X..', '...', '#X.', '..X'], ['.D.', '#.D'], 0, 0, -1],
   [['...', '#..', 'X..', '...', '#X.', '..X'], False])],
 [('fault site locked tile check #1',
   [['##.', '..#', '#..', '.X.', '.#X', '#..'], ['.', 'D', '.'], 1, 1, 6],
   [['##.', '..#', '#..', '.X.', '.#X', '#..'], False]),
  ('regression locked tile check #1',
   [['...', 'X..', '#..', '#..'], ['DD'], 0, 2, -2],
   [['...', 'X..', 'DD.', '#..'], True]),
  ('regression locked tile check #2',
   [['X#.XX', '....X', '...#.', 'X...#', 'X....'], ['D', 'D'], 1, 0, -1],
   [['XDDXX', '....X', '...#.', 'X...#', 'X....'], True]),
  ('regression locked tile check #3',
   [['#...#.', '.##X..', '...X#.', '..XX..', '..#X.#'], ['.', '.'], 1, 1, -1],
   [['#...#.', '...X..', '...X#.', '..XX..', '..#X.#'], True]),
  ('counter-clockwise turn #1', [['...', '...'], ['#.', '..'], 0, 0, -1], [['...', '#..'], True]),
  ('transparent overhang #1', [['..', '..'], [' #', ' #'], -1, 0, 0], [['#.', '#.'], True]),
  ('control #1',
   [['...', '#..', 'X..', '...', '#X.', '..X'], ['.D.', '#.D'], 0, 0, -1],
   [['...', '#..', 'X..', '...', '#X.', '..X'], False]),
  ('control #2',
   [['#X', '..', '..', '#.', '#.'], [' D', '.#', '.#'], -1, 2, 3],
   [['#X', '..', '..', '#.', '#.'], False])],
 [('fault site locked tile check #1',
   [['.....', 'X..X#', 'X.X.X'], ['. .'], 1, 1, 2],
   [['.....', 'X..X#', 'X.X.X'], False]),
  ('fault site locked tile check #2',
   [['..#.X.', '......', '.#..#.', 'XX.#.#', 'X..#.X'], ['  ', ' .', 'D.'], 4, 0, 2],
   [['..#.X.', '......', '.#..#.', 'XX.#.#', 'X..#.X'], False]),
  ('regression locked tile check #1',
   [['...', '...', '...', 'X#.', 'X#.', '...'], ['.', '.', ' '], 1, 3, -1],
   [['...', '...', '...', 'X..', 'X#.', '...'], True]),
  ('regression locked tile check #2',
   [['X###', '...#', '.X..', '...#', 'XX#.', '..#.'], ['.# '], 3, 2, 1],
   [['X###', '...#', '.X..', '...#', 'XX#.', '..#.'], True]),
  ('quarter turn #1', [['....', '....'], ['#D'], 0, 0, 1], [['#...', 'D...'], True]),
  ('counter-clockwise turn #1', [['...', '...'], ['#.', '..'], 0, 0, -1], [['...', '#..'], True]),
  ('control #1',
   [['XX', 'X.', '..', '..', '..'], ['D', 'D', ' '], 0, 4, -3],
   [['XX', 'X.', '..', '..', '..'], False]),
  ('control #2', [['.X.', '...'], ['D#.', 'D #'], -1, -1, -1], [['.X.', '...'], False])],
 [('regression locked tile check #1',
   [['X#.XX', '....X', '...#.', 'X...#', 'X....'], ['D', 'D'], 1, 0, -1],
   [['XDDXX', '....X', '...#.', 'X...#', 'X....'], True]),
  ('regression locked tile check #2',
   [['#...#.', '.##X..', '...X#.', '..XX..', '..#X.#'], ['.', '.'], 1, 1, -1],
   [['#...#.', '...X..', '...X#.', '..XX..', '..#X.#'], True]),
  ('regression locked tile check #3',
   [['X.', '#.', 'X#', '..', '..', '..'], ['# ', 'D '], 0, 1, 2],
   [['X.', '#D', 'X#', '..', '..', '..'], True]),
  ('regression locked tile check #4',
   [['.#', '..', '.X', '..', '.#', 'X.'], ['.'], 1, 4, 0],
   [['.#', '..', '.X', '..', '..', 'X.'], True]),
  ('transparent overhang #1', [['..', '..'], [' #', ' #'], -1, 0, 0], [['#.', '#.'], True]),
  ('quarter turn #1', [['....', '....'], ['#D'], 0, 0, 1], [['#...', 'D...'], True]),
  ('control #1',
   [['...#', '.X..', 'XX..', '.#X.', 'X.##'], [' .', '  ', '##'], 1, 4, 0],
   [['...#', '.X..', 'XX..', '.#X.', 'X.##'], False]),
  ('control #2', [['#..X.X', '.X....'], ['#D', 'D#'], 5, 0, -2], [['#..X.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 fixtureActualExpectedOutcome
regression locked tile check #1[['.#.', '#..'], False][['DD.', '#..'], True]Failed
regression locked tile check #2[['..#X.', '.....', '.....', '.XX#.'], False][['##DX.', '#....', '.#...', '.XX#.'], True]Failed
regression locked tile check #3[['..#', '...', '...', '##.'], False][['..#', '...', '.D.', '###'], True]Failed
regression locked tile check #4[['...', 'X..', '#..', '#..'], False][['...', 'X..', 'DD.', '#..'], True]Failed
quarter turn #1[['#...', 'D...'], True][['#...', 'D...'], True]Passed
counter-clockwise turn #1[['...', '#..'], True][['...', '#..'], True]Passed
transparent overhang #1[['#.', '#.'], True][['#.', '#.'], True]Passed
control #1[['.#...#', '.#.#..'], False][['.#...#', '.#.#..'], False]Passed

SHA-256 / ed175bd2a99d5e8ef469a6ae28aa766fca06e7d9fce73049b29205b727822c12

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] in '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 locked tile check #1', [['.#.', '#..'], ['  ', 'DD', '#.'], 0, -1, 4], [['DD.', '#..'], True]),
  ('regression locked tile check #2',
   [['..#X.', '.....', '.....', '.XX#.'], ['##D', '#. ', '.# '], 0, 0, 0],
   [['##DX.', '#....', '.#...', '.XX#.'], True]),
  ('regression locked tile check #3',
   [['..#', '...', '...', '##.'], [' #', 'D#'], 1, 2, -3],
   [['..#', '...', '.D.', '###'], True]),
  ('regression locked tile check #4',
   [['...', 'X..', '#..', '#..'], ['DD'], 0, 2, -2],
   [['...', 'X..', 'DD.', '#..'], True]),
  ('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', [['.#...#', '.#.#..'], ['  ', '# '], 1, -1, 6], [['.#...#', '.#.#..'], False])],
 [('fault site locked tile check #1',
   [['X.', '..', '#X', '..', 'X.', '#.'], ['D#', '# '], 0, 0, 0],
   [['X.', '..', '#X', '..', 'X.', '#.'], False]),
  ('regression locked tile check #1',
   [['..#', '...', '...', '##.'], [' #', 'D#'], 1, 2, -3],
   [['..#', '...', '.D.', '###'], True]),
  ('regression locked tile check #2',
   [['...', 'X..', '#..', '#..'], ['DD'], 0, 2, -2],
   [['...', 'X..', 'DD.', '#..'], True]),
  ('regression locked tile check #3',
   [['X#.XX', '....X', '...#.', 'X...#', 'X....'], ['D', 'D'], 1, 0, -1],
   [['XDDXX', '....X', '...#.', 'X...#', 'X....'], True]),
  ('transparent overhang #1', [['..', '..'], [' #', ' #'], -1, 0, 0], [['#.', '#.'], True]),
  ('quarter turn #1', [['....', '....'], ['#D'], 0, 0, 1], [['#...', 'D...'], True]),
  ('control #1', [['.#...#', '.#.#..'], ['  ', '# '], 1, -1, 6], [['.#...#', '.#.#..'], False]),
  ('control #2',
   [['...', '#..', 'X..', '...', '#X.', '..X'], ['.D.', '#.D'], 0, 0, -1],
   [['...', '#..', 'X..', '...', '#X.', '..X'], False])],
 [('fault site locked tile check #1',
   [['##.', '..#', '#..', '.X.', '.#X', '#..'], ['.', 'D', '.'], 1, 1, 6],
   [['##.', '..#', '#..', '.X.', '.#X', '#..'], False]),
  ('regression locked tile check #1',
   [['...', 'X..', '#..', '#..'], ['DD'], 0, 2, -2],
   [['...', 'X..', 'DD.', '#..'], True]),
  ('regression locked tile check #2',
   [['X#.XX', '....X', '...#.', 'X...#', 'X....'], ['D', 'D'], 1, 0, -1],
   [['XDDXX', '....X', '...#.', 'X...#', 'X....'], True]),
  ('regression locked tile check #3',
   [['#...#.', '.##X..', '...X#.', '..XX..', '..#X.#'], ['.', '.'], 1, 1, -1],
   [['#...#.', '...X..', '...X#.', '..XX..', '..#X.#'], True]),
  ('counter-clockwise turn #1', [['...', '...'], ['#.', '..'], 0, 0, -1], [['...', '#..'], True]),
  ('transparent overhang #1', [['..', '..'], [' #', ' #'], -1, 0, 0], [['#.', '#.'], True]),
  ('control #1',
   [['...', '#..', 'X..', '...', '#X.', '..X'], ['.D.', '#.D'], 0, 0, -1],
   [['...', '#..', 'X..', '...', '#X.', '..X'], False]),
  ('control #2',
   [['#X', '..', '..', '#.', '#.'], [' D', '.#', '.#'], -1, 2, 3],
   [['#X', '..', '..', '#.', '#.'], False])],
 [('fault site locked tile check #1',
   [['.....', 'X..X#', 'X.X.X'], ['. .'], 1, 1, 2],
   [['.....', 'X..X#', 'X.X.X'], False]),
  ('fault site locked tile check #2',
   [['..#.X.', '......', '.#..#.', 'XX.#.#', 'X..#.X'], ['  ', ' .', 'D.'], 4, 0, 2],
   [['..#.X.', '......', '.#..#.', 'XX.#.#', 'X..#.X'], False]),
  ('regression locked tile check #1',
   [['...', '...', '...', 'X#.', 'X#.', '...'], ['.', '.', ' '], 1, 3, -1],
   [['...', '...', '...', 'X..', 'X#.', '...'], True]),
  ('regression locked tile check #2',
   [['X###', '...#', '.X..', '...#', 'XX#.', '..#.'], ['.# '], 3, 2, 1],
   [['X###', '...#', '.X..', '...#', 'XX#.', '..#.'], True]),
  ('quarter turn #1', [['....', '....'], ['#D'], 0, 0, 1], [['#...', 'D...'], True]),
  ('counter-clockwise turn #1', [['...', '...'], ['#.', '..'], 0, 0, -1], [['...', '#..'], True]),
  ('control #1',
   [['XX', 'X.', '..', '..', '..'], ['D', 'D', ' '], 0, 4, -3],
   [['XX', 'X.', '..', '..', '..'], False]),
  ('control #2', [['.X.', '...'], ['D#.', 'D #'], -1, -1, -1], [['.X.', '...'], False])],
 [('regression locked tile check #1',
   [['X#.XX', '....X', '...#.', 'X...#', 'X....'], ['D', 'D'], 1, 0, -1],
   [['XDDXX', '....X', '...#.', 'X...#', 'X....'], True]),
  ('regression locked tile check #2',
   [['#...#.', '.##X..', '...X#.', '..XX..', '..#X.#'], ['.', '.'], 1, 1, -1],
   [['#...#.', '...X..', '...X#.', '..XX..', '..#X.#'], True]),
  ('regression locked tile check #3',
   [['X.', '#.', 'X#', '..', '..', '..'], ['# ', 'D '], 0, 1, 2],
   [['X.', '#D', 'X#', '..', '..', '..'], True]),
  ('regression locked tile check #4',
   [['.#', '..', '.X', '..', '.#', 'X.'], ['.'], 1, 4, 0],
   [['.#', '..', '.X', '..', '..', 'X.'], True]),
  ('transparent overhang #1', [['..', '..'], [' #', ' #'], -1, 0, 0], [['#.', '#.'], True]),
  ('quarter turn #1', [['....', '....'], ['#D'], 0, 0, 1], [['#...', 'D...'], True]),
  ('control #1',
   [['...#', '.X..', 'XX..', '.#X.', 'X.##'], [' .', '  ', '##'], 1, 4, 0],
   [['...#', '.X..', 'XX..', '.#X.', 'X.##'], False]),
  ('control #2', [['#..X.X', '.X....'], ['#D', 'D#'], 5, 0, -2], [['#..X.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 fixtureActualExpectedOutcome
regression locked tile check #1[['.#.', '#..'], False][['DD.', '#..'], True]Failed
regression locked tile check #2[['..#X.', '.....', '.....', '.XX#.'], False][['##DX.', '#....', '.#...', '.XX#.'], True]Failed
regression locked tile check #3[['..#', '...', '...', '##.'], False][['..#', '...', '.D.', '###'], True]Failed
regression locked tile check #4[['...', 'X..', '#..', '#..'], False][['...', 'X..', 'DD.', '#..'], True]Failed
quarter turn #1[['#...', 'D...'], True][['#...', 'D...'], True]Passed
counter-clockwise turn #1[['...', '#..'], True][['...', '#..'], True]Passed
transparent overhang #1[['#.', '#.'], True][['#.', '#.'], True]Passed
control #1[['.#...#', '.#.#..'], False][['.#...#', '.#.#..'], False]Passed

SHA-256 / e07cf1440cc164bb36bb629997cd983851578969e9fa563235740b7d98789e4e

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

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

Case digest / 7ca2360e0a24710b2ba84c52eb22930e108c037ec7059d34871f7dd16f4da16b