FAILURE MAP
← Case archive

FA-86746 / Procedural level generation constraints / Open access

Rotated prefab stamping: Prefab stamped transposed · case 01

Non-square prefabs land rotated a quarter turn.

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

ROOT CAUSE

Row and column offsets within the prefab are swapped.

THE FAILURE

Row and column offsets within the prefab are swapped.

Unsuccessful approach: Swapping origin axes moves the prefab to the mirrored position.

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 + c, ox + r
            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 = [[('quarter turn #1', [['....', '....'], ['#D'], 0, 0, 1], [['#...', 'D...'], True]),
  ('transparent overhang #1', [['..', '..'], [' #', ' #'], -1, 0, 0], [['#.', '#.'], True]),
  ('counter-clockwise turn #1', [['...', '...'], ['#.', '..'], 0, 0, -1], [['...', '#..'], True]),
  ('regression stamp offset axes #1',
   [['.#...#', '.#.#..'], ['  ', '# '], 1, -1, 6],
   [['.#...#', '.#.#..'], False]),
  ('regression stamp offset axes #2', [['.#.', '#..'], ['  ', 'DD', '#.'], 0, -1, 4], [['DD.', '#..'], True]),
  ('regression stamp offset axes #3',
   [['...#..', '.#....', '#.....'], ['#.', ' .', '#D'], 2, 0, 5],
   [['..###.', '.#D...', '#.....'], True]),
  ('control #1',
   [['#X', '..', '..', '#.', '#.'], [' D', '.#', '.#'], -1, 2, 3],
   [['#X', '..', '..', '#.', '#.'], False]),
  ('control #2',
   [['XX', 'X.', '..', '..', '..'], ['D', 'D', ' '], 0, 4, -3],
   [['XX', 'X.', '..', '..', '..'], False])],
 [('counter-clockwise turn #1', [['...', '...'], ['#.', '..'], 0, 0, -1], [['...', '#..'], True]),
  ('transparent overhang #1', [['..', '..'], [' #', ' #'], -1, 0, 0], [['#.', '#.'], True]),
  ('regression stamp offset axes #1',
   [['.#...#', '.#.#..'], ['  ', '# '], 1, -1, 6],
   [['.#...#', '.#.#..'], False]),
  ('fault site stamp offset axes #1',
   [['...', '#..', 'X..', '...', '#X.', '..X'], ['.D.', '#.D'], 0, 0, -1],
   [['...', '#..', 'X..', '...', '#X.', '..X'], False]),
  ('regression stamp offset axes #2', [['.#.', '#..'], ['  ', 'DD', '#.'], 0, -1, 4], [['DD.', '#..'], True]),
  ('regression stamp offset axes #3',
   [['...#..', '.#....', '#.....'], ['#.', ' .', '#D'], 2, 0, 5],
   [['..###.', '.#D...', '#.....'], True]),
  ('control #1', [['.X.', '...'], ['D#.', 'D #'], -1, -1, -1], [['.X.', '...'], False]),
  ('control #2',
   [['...#', '.X..', 'XX..', '.#X.', 'X.##'], [' .', '  ', '##'], 1, 4, 0],
   [['...#', '.X..', 'XX..', '.#X.', 'X.##'], False])],
 [('transparent overhang #1', [['..', '..'], [' #', ' #'], -1, 0, 0], [['#.', '#.'], True]),
  ('fault site stamp offset axes #1',
   [['...', '#..', 'X..', '...', '#X.', '..X'], ['.D.', '#.D'], 0, 0, -1],
   [['...', '#..', 'X..', '...', '#X.', '..X'], False]),
  ('regression stamp offset axes #1', [['.#.', '#..'], ['  ', 'DD', '#.'], 0, -1, 4], [['DD.', '#..'], True]),
  ('regression stamp offset axes #2',
   [['..X', '#..', '...'], ['#', '.', '#'], 1, 0, 4],
   [['.#X', '#..', '.#.'], True]),
  ('partial repair boundary #1',
   [['....X', '.....', '..#..', '...X.', '...XX', '..#X#'], ['.'], 1, 5, 6],
   [['....X', '.....', '..#..', '...X.', '...XX', '..#X#'], True]),
  ('control #1',
   [['......', '.....#', '.#....'], [' ##'], -1, -1, -2],
   [['......', '.....#', '.#....'], False]),
  ('control #2',
   [['#.#', '#..', '#..', '#.X', 'X#.'], [' '], 1, 4, 3],
   [['#.#', '#..', '#..', '#.X', 'X#.'], True]),
  ('control #3',
   [['XX#', '.XX', '.#.', '##X', 'X.#'], [' DD', ' #D'], 0, 3, 5],
   [['XX#', '.XX', '.#.', '##X', 'X.#'], False])],
 [('quarter turn #1', [['....', '....'], ['#D'], 0, 0, 1], [['#...', 'D...'], True]),
  ('transparent overhang #1', [['..', '..'], [' #', ' #'], -1, 0, 0], [['#.', '#.'], True]),
  ('fault site stamp offset axes #1',
   [['..#X.', '.....', '.....', '.XX#.'], ['##D', '#. ', '.# '], 0, 0, 0],
   [['##DX.', '#....', '.#...', '.XX#.'], True]),
  ('regression stamp offset axes #1',
   [['...#..', '.#....', '#.....'], ['#.', ' .', '#D'], 2, 0, 5],
   [['..###.', '.#D...', '#.....'], True]),
  ('partial repair boundary #1',
   [['..#.', '..X.', '.X#.', '..X.', '.X#.'], ['#.'], 2, 3, 5],
   [['..#.', '..X.', '.X#.', '..X.', '.X#.'], False]),
  ('regression stamp offset axes #2',
   [['..#', '...', '...', '##.'], [' #', 'D#'], 1, 2, -3],
   [['..#', '...', '.D.', '###'], True]),
  ('control #1',
   [['......', '.....#', '.#....'], [' ##'], -1, -1, -2],
   [['......', '.....#', '.#....'], False]),
  ('control #2',
   [['#.#', '#..', '#..', '#.X', 'X#.'], [' '], 1, 4, 3],
   [['#.#', '#..', '#..', '#.X', 'X#.'], True])],
 [('counter-clockwise turn #1', [['...', '...'], ['#.', '..'], 0, 0, -1], [['...', '#..'], True]),
  ('transparent overhang #1', [['..', '..'], [' #', ' #'], -1, 0, 0], [['#.', '#.'], True]),
  ('regression stamp offset axes #1',
   [['..X', '#..', '...'], ['#', '.', '#'], 1, 0, 4],
   [['.#X', '#..', '.#.'], True]),
  ('regression stamp offset axes #2',
   [['..#', '...', '...', '##.'], [' #', 'D#'], 1, 2, -3],
   [['..#', '...', '.D.', '###'], True]),
  ('partial repair boundary #1',
   [['..', '..', '#.', 'X.'], ['D', '#', ' '], 0, 1, 6],
   [['..', '..', '#.', 'X.'], False]),
  ('regression stamp offset axes #3',
   [['...', 'X..', '#..', '#..'], ['DD'], 0, 2, -2],
   [['...', 'X..', 'DD.', '#..'], True]),
  ('control #1',
   [['XX#', '.XX', '.#.', '##X', 'X.#'], [' DD', ' #D'], 0, 3, 5],
   [['XX#', '.XX', '.#.', '##X', 'X.#'], False]),
  ('control #2',
   [['.X.', '#..', '.X.', '.X.', '...'], ['D', '#', '.'], -1, 4, 4],
   [['.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
quarter turn #1[['#D..', '....'], True][['#...', 'D...'], True]Failed
transparent overhang #1[['..', '..'], False][['#.', '#.'], True]Failed
counter-clockwise turn #1[['.#.', '...'], True][['...', '#..'], True]Failed
regression stamp offset axes #1[['.#...#', '.#.#..'], True][['.#...#', '.#.#..'], False]Failed
regression stamp offset axes #2[['.#.', '#..'], False][['DD.', '#..'], True]Failed
regression stamp offset axes #3[['..#D..', '.#....', '#.#...'], True][['..###.', '.#D...', '#.....'], True]Failed
control #1[['#X', '..', '..', '#.', '#.'], False][['#X', '..', '..', '#.', '#.'], False]Passed
control #2[['XX', 'X.', '..', '..', '..'], False][['XX', 'X.', '..', '..', '..'], False]Passed

SHA-256 / 1572a3f762447290fc191e05839b8945b24cdbbc917fc493eb308c2fb4149c73

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 = ox + r, oy + 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 = [[('quarter turn #1', [['....', '....'], ['#D'], 0, 0, 1], [['#...', 'D...'], True]),
  ('transparent overhang #1', [['..', '..'], [' #', ' #'], -1, 0, 0], [['#.', '#.'], True]),
  ('counter-clockwise turn #1', [['...', '...'], ['#.', '..'], 0, 0, -1], [['...', '#..'], True]),
  ('regression stamp offset axes #1',
   [['.#...#', '.#.#..'], ['  ', '# '], 1, -1, 6],
   [['.#...#', '.#.#..'], False]),
  ('regression stamp offset axes #2', [['.#.', '#..'], ['  ', 'DD', '#.'], 0, -1, 4], [['DD.', '#..'], True]),
  ('regression stamp offset axes #3',
   [['...#..', '.#....', '#.....'], ['#.', ' .', '#D'], 2, 0, 5],
   [['..###.', '.#D...', '#.....'], True]),
  ('control #1',
   [['#X', '..', '..', '#.', '#.'], [' D', '.#', '.#'], -1, 2, 3],
   [['#X', '..', '..', '#.', '#.'], False]),
  ('control #2',
   [['XX', 'X.', '..', '..', '..'], ['D', 'D', ' '], 0, 4, -3],
   [['XX', 'X.', '..', '..', '..'], False])],
 [('counter-clockwise turn #1', [['...', '...'], ['#.', '..'], 0, 0, -1], [['...', '#..'], True]),
  ('transparent overhang #1', [['..', '..'], [' #', ' #'], -1, 0, 0], [['#.', '#.'], True]),
  ('regression stamp offset axes #1',
   [['.#...#', '.#.#..'], ['  ', '# '], 1, -1, 6],
   [['.#...#', '.#.#..'], False]),
  ('fault site stamp offset axes #1',
   [['...', '#..', 'X..', '...', '#X.', '..X'], ['.D.', '#.D'], 0, 0, -1],
   [['...', '#..', 'X..', '...', '#X.', '..X'], False]),
  ('regression stamp offset axes #2', [['.#.', '#..'], ['  ', 'DD', '#.'], 0, -1, 4], [['DD.', '#..'], True]),
  ('regression stamp offset axes #3',
   [['...#..', '.#....', '#.....'], ['#.', ' .', '#D'], 2, 0, 5],
   [['..###.', '.#D...', '#.....'], True]),
  ('control #1', [['.X.', '...'], ['D#.', 'D #'], -1, -1, -1], [['.X.', '...'], False]),
  ('control #2',
   [['...#', '.X..', 'XX..', '.#X.', 'X.##'], [' .', '  ', '##'], 1, 4, 0],
   [['...#', '.X..', 'XX..', '.#X.', 'X.##'], False])],
 [('transparent overhang #1', [['..', '..'], [' #', ' #'], -1, 0, 0], [['#.', '#.'], True]),
  ('fault site stamp offset axes #1',
   [['...', '#..', 'X..', '...', '#X.', '..X'], ['.D.', '#.D'], 0, 0, -1],
   [['...', '#..', 'X..', '...', '#X.', '..X'], False]),
  ('regression stamp offset axes #1', [['.#.', '#..'], ['  ', 'DD', '#.'], 0, -1, 4], [['DD.', '#..'], True]),
  ('regression stamp offset axes #2',
   [['..X', '#..', '...'], ['#', '.', '#'], 1, 0, 4],
   [['.#X', '#..', '.#.'], True]),
  ('partial repair boundary #1',
   [['....X', '.....', '..#..', '...X.', '...XX', '..#X#'], ['.'], 1, 5, 6],
   [['....X', '.....', '..#..', '...X.', '...XX', '..#X#'], True]),
  ('control #1',
   [['......', '.....#', '.#....'], [' ##'], -1, -1, -2],
   [['......', '.....#', '.#....'], False]),
  ('control #2',
   [['#.#', '#..', '#..', '#.X', 'X#.'], [' '], 1, 4, 3],
   [['#.#', '#..', '#..', '#.X', 'X#.'], True]),
  ('control #3',
   [['XX#', '.XX', '.#.', '##X', 'X.#'], [' DD', ' #D'], 0, 3, 5],
   [['XX#', '.XX', '.#.', '##X', 'X.#'], False])],
 [('quarter turn #1', [['....', '....'], ['#D'], 0, 0, 1], [['#...', 'D...'], True]),
  ('transparent overhang #1', [['..', '..'], [' #', ' #'], -1, 0, 0], [['#.', '#.'], True]),
  ('fault site stamp offset axes #1',
   [['..#X.', '.....', '.....', '.XX#.'], ['##D', '#. ', '.# '], 0, 0, 0],
   [['##DX.', '#....', '.#...', '.XX#.'], True]),
  ('regression stamp offset axes #1',
   [['...#..', '.#....', '#.....'], ['#.', ' .', '#D'], 2, 0, 5],
   [['..###.', '.#D...', '#.....'], True]),
  ('partial repair boundary #1',
   [['..#.', '..X.', '.X#.', '..X.', '.X#.'], ['#.'], 2, 3, 5],
   [['..#.', '..X.', '.X#.', '..X.', '.X#.'], False]),
  ('regression stamp offset axes #2',
   [['..#', '...', '...', '##.'], [' #', 'D#'], 1, 2, -3],
   [['..#', '...', '.D.', '###'], True]),
  ('control #1',
   [['......', '.....#', '.#....'], [' ##'], -1, -1, -2],
   [['......', '.....#', '.#....'], False]),
  ('control #2',
   [['#.#', '#..', '#..', '#.X', 'X#.'], [' '], 1, 4, 3],
   [['#.#', '#..', '#..', '#.X', 'X#.'], True])],
 [('counter-clockwise turn #1', [['...', '...'], ['#.', '..'], 0, 0, -1], [['...', '#..'], True]),
  ('transparent overhang #1', [['..', '..'], [' #', ' #'], -1, 0, 0], [['#.', '#.'], True]),
  ('regression stamp offset axes #1',
   [['..X', '#..', '...'], ['#', '.', '#'], 1, 0, 4],
   [['.#X', '#..', '.#.'], True]),
  ('regression stamp offset axes #2',
   [['..#', '...', '...', '##.'], [' #', 'D#'], 1, 2, -3],
   [['..#', '...', '.D.', '###'], True]),
  ('partial repair boundary #1',
   [['..', '..', '#.', 'X.'], ['D', '#', ' '], 0, 1, 6],
   [['..', '..', '#.', 'X.'], False]),
  ('regression stamp offset axes #3',
   [['...', 'X..', '#..', '#..'], ['DD'], 0, 2, -2],
   [['...', 'X..', 'DD.', '#..'], True]),
  ('control #1',
   [['XX#', '.XX', '.#.', '##X', 'X.#'], [' DD', ' #D'], 0, 3, 5],
   [['XX#', '.XX', '.#.', '##X', 'X.#'], False]),
  ('control #2',
   [['.X.', '#..', '.X.', '.X.', '...'], ['D', '#', '.'], -1, 4, 4],
   [['.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
quarter turn #1[['#...', 'D...'], True][['#...', 'D...'], True]Passed
transparent overhang #1[['..', '..'], False][['#.', '#.'], True]Failed
counter-clockwise turn #1[['...', '#..'], True][['...', '#..'], True]Passed
regression stamp offset axes #1[['.#...#', '##.#..'], True][['.#...#', '.#.#..'], False]Failed
regression stamp offset axes #2[['.#.', '#..'], False][['DD.', '#..'], True]Failed
regression stamp offset axes #3[['...#..', '.#....', '#.....'], False][['..###.', '.#D...', '#.....'], True]Failed
control #1[['#X', '..', '..', '#.', '#.'], False][['#X', '..', '..', '#.', '#.'], False]Passed
control #2[['XX', 'X.', '..', '..', '..'], False][['XX', 'X.', '..', '..', '..'], False]Passed

SHA-256 / 3edacebccbde0d34c11952a88b9541e276edb2131b4ff0b16faa475a4434d61b

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

Case digest / 7120c17f185120097a1784e5a29b57750fc086413906f6a567a63e1bee5d2e6e