FAILURE MAP
← Case archive

FA-86826 / Procedural level generation constraints / Open access

Aligned stair placement: Stairs land in water below · case 01

The down stair leads onto a water tile.

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

ROOT CAUSE

Only walls are rejected on the lower floor.

VERIFIED REPAIR

Restore `floor_b[y][x] != '.'` at the lower floor tile step.

Unsuccessful approach: Checking floor_a twice never inspects the lower floor tile.

Case contract

Scan floor_a row by row (y), then column (x); choose the first cell where floor_a[y][x] == '.', the cell exists on floor_b and is '.' there, and the Manhattan distance to entrance [x, y] is at least min_dist. Returns [x, y] or None.

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(floor_a, floor_b, entrance, min_dist):
    for y in range(len(floor_a)):
        for x in range(len(floor_a[0])):
            if floor_a[y][x] != '.':
                continue
            if y >= len(floor_b) or x >= len(floor_b[0]) or floor_b[y][x] == '#':
                continue
            if abs(x - entrance[0]) + abs(y - entrance[1]) < min_dist:
                continue
            return [x, y]
    return None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('water below #1', [['.'], ['~'], [0, 0], 0], None),
  ('regression lower floor tile #1',
   [['...', '.#.', '...', '..#', '###', '..#'], ['~.#.~', '##~~#', '~~#..', '.~.~.'], [2, 4], 5],
   [1, 0]),
  ('regression lower floor tile #2',
   [['#....', '..#..', '#...#', '#..#.', '.#.#.', '.#.#.'],
    ['#~..', '..~.', '..~.', '..#.', '##~~'],
    [1, 4],
    1],
   [2, 0]),
  ('partial repair boundary #1',
   [['...##.', '..#.#.', '..#...', '#.....', '#.....'], ['#', '.', '.', '~'], [0, 2], 1],
   [0, 1]),
  ('regression lower floor tile #3',
   [['.#', '#.', '#.', '..', '..', '#.'], ['~..##', '#..#.', '#.#~.', '..~.~', '~~~..'], [0, 0], 5],
   None),
  ('first row candidate #1', [['..', '..'], ['#.', '..'], [0, 0], 1], [1, 0]),
  ('distance exactly min #1', [['...'], ['...'], [0, 0], 2], [2, 0]),
  ('control #1', [['#.#.', '...#'], ['...#~', '.....'], [3, 1], 4], None)],
 [('water below #1', [['.'], ['~'], [0, 0], 0], None),
  ('regression lower floor tile #1',
   [['#....', '..#..', '#...#', '#..#.', '.#.#.', '.#.#.'],
    ['#~..', '..~.', '..~.', '..#.', '##~~'],
    [1, 4],
    1],
   [2, 0]),
  ('regression lower floor tile #2',
   [['.#', '#.', '#.', '..', '..', '#.'], ['~..##', '#..#.', '#.#~.', '..~.~', '~~~..'], [0, 0], 5],
   None),
  ('partial repair boundary #1',
   [['...##.', '..#.#.', '..#...', '#.....', '#.....'], ['#', '.', '.', '~'], [0, 2], 1],
   [0, 1]),
  ('regression lower floor tile #3',
   [['.', '.', '#', '#'], ['~~.~~#', '~...~.', '~#.~#.', '~~~#~.'], [0, 2], 1],
   None),
  ('first row candidate #1', [['..', '..'], ['#.', '..'], [0, 0], 1], [1, 0]),
  ('distance exactly min #1', [['...'], ['...'], [0, 0], 2], [2, 0]),
  ('control #1', [['#.#.', '...#'], ['...#~', '.....'], [3, 1], 4], None)],
 [('water below #1', [['.'], ['~'], [0, 0], 0], None),
  ('regression lower floor tile #1',
   [['.', '.', '#', '#'], ['~~.~~#', '~...~.', '~#.~#.', '~~~#~.'], [0, 2], 1],
   None),
  ('regression lower floor tile #2',
   [['..', '..', '#.', '.#', '#.', '.#'], ['~.~', '~~~', '~#.', '~#.', '...', '##.'], [0, 4], 4],
   [1, 0]),
  ('regression lower floor tile #3',
   [['.#', '#.', '#.', '..', '..', '#.'], ['~..##', '#..#.', '#.#~.', '..~.~', '~~~..'], [0, 0], 5],
   None),
  ('regression lower floor tile #4',
   [['.#.#', '#...', '..#.'], ['..#', '~~.', '~.#', '...', '#~.', '~#.'], [2, 0], 4],
   None),
  ('first row candidate #1', [['..', '..'], ['#.', '..'], [0, 0], 1], [1, 0]),
  ('distance exactly min #1', [['...'], ['...'], [0, 0], 2], [2, 0]),
  ('control #1', [['#.#.', '...#'], ['...#~', '.....'], [3, 1], 4], None)],
 [('water below #1', [['.'], ['~'], [0, 0], 0], None),
  ('regression lower floor tile #1',
   [['.#.#', '#...', '..#.'], ['..#', '~~.', '~.#', '...', '#~.', '~#.'], [2, 0], 4],
   None),
  ('regression lower floor tile #2',
   [['.#..', '....', '....', '#...'], ['~#...', '~.~..', '#~.~.'], [3, 0], 0],
   [2, 0]),
  ('regression lower floor tile #3',
   [['..', '..', '#.', '.#', '#.', '.#'], ['~.~', '~~~', '~#.', '~#.', '...', '##.'], [0, 4], 4],
   [1, 0]),
  ('regression lower floor tile #4', [['.', '.', '.'], ['~..'], [0, 2], 1], None),
  ('first row candidate #1', [['..', '..'], ['#.', '..'], [0, 0], 1], [1, 0]),
  ('distance exactly min #1', [['...'], ['...'], [0, 0], 2], [2, 0]),
  ('control #1', [['.', '#', '.', '#'], ['#.....'], [0, 1], 4], None)],
 [('water below #1', [['.'], ['~'], [0, 0], 0], None),
  ('regression lower floor tile #1', [['.', '.', '.'], ['~..'], [0, 2], 1], None),
  ('regression lower floor tile #2',
   [['..###.', '.#.#..', '...##.', '###...', '.#..##'], ['#', '~', '.', '.', '.', '#'], [2, 2], 2],
   [0, 2]),
  ('regression lower floor tile #3',
   [['.#..', '....', '....', '#...'], ['~#...', '~.~..', '#~.~.'], [3, 0], 0],
   [2, 0]),
  ('partial repair boundary #1',
   [['..#.', '..#.', '..#.', '#...', '.#.#'], ['#..#', '.~#.', '.##~'], [0, 2], 5],
   None),
  ('first row candidate #1', [['..', '..'], ['#.', '..'], [0, 0], 1], [1, 0]),
  ('distance exactly min #1', [['...'], ['...'], [0, 0], 2], [2, 0]),
  ('control #1', [['##', '.#', '#.', '.#', '.#'], ['##.', '...', '.~#'], [0, 0], 5], None)]]
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
water below #1[0, 0]NoneFailed
regression lower floor tile #1[0, 0][1, 0]Failed
regression lower floor tile #2[1, 0][2, 0]Failed
partial repair boundary #1[0, 1][0, 1]Passed
regression lower floor tile #3[1, 4]NoneFailed
first row candidate #1[1, 0][1, 0]Passed
distance exactly min #1[2, 0][2, 0]Passed
control #1NoneNonePassed

SHA-256 / a6431017ea61011809c10421ff60bb0e879ab1fcc0a7834054a4373cece60a39

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(floor_a, floor_b, entrance, min_dist):
    for y in range(len(floor_a)):
        for x in range(len(floor_a[0])):
            if floor_a[y][x] != '.':
                continue
            if y >= len(floor_b) or x >= len(floor_b[0]) or floor_a[y][x] != '.':
                continue
            if abs(x - entrance[0]) + abs(y - entrance[1]) < min_dist:
                continue
            return [x, y]
    return None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('water below #1', [['.'], ['~'], [0, 0], 0], None),
  ('regression lower floor tile #1',
   [['...', '.#.', '...', '..#', '###', '..#'], ['~.#.~', '##~~#', '~~#..', '.~.~.'], [2, 4], 5],
   [1, 0]),
  ('regression lower floor tile #2',
   [['#....', '..#..', '#...#', '#..#.', '.#.#.', '.#.#.'],
    ['#~..', '..~.', '..~.', '..#.', '##~~'],
    [1, 4],
    1],
   [2, 0]),
  ('partial repair boundary #1',
   [['...##.', '..#.#.', '..#...', '#.....', '#.....'], ['#', '.', '.', '~'], [0, 2], 1],
   [0, 1]),
  ('regression lower floor tile #3',
   [['.#', '#.', '#.', '..', '..', '#.'], ['~..##', '#..#.', '#.#~.', '..~.~', '~~~..'], [0, 0], 5],
   None),
  ('first row candidate #1', [['..', '..'], ['#.', '..'], [0, 0], 1], [1, 0]),
  ('distance exactly min #1', [['...'], ['...'], [0, 0], 2], [2, 0]),
  ('control #1', [['#.#.', '...#'], ['...#~', '.....'], [3, 1], 4], None)],
 [('water below #1', [['.'], ['~'], [0, 0], 0], None),
  ('regression lower floor tile #1',
   [['#....', '..#..', '#...#', '#..#.', '.#.#.', '.#.#.'],
    ['#~..', '..~.', '..~.', '..#.', '##~~'],
    [1, 4],
    1],
   [2, 0]),
  ('regression lower floor tile #2',
   [['.#', '#.', '#.', '..', '..', '#.'], ['~..##', '#..#.', '#.#~.', '..~.~', '~~~..'], [0, 0], 5],
   None),
  ('partial repair boundary #1',
   [['...##.', '..#.#.', '..#...', '#.....', '#.....'], ['#', '.', '.', '~'], [0, 2], 1],
   [0, 1]),
  ('regression lower floor tile #3',
   [['.', '.', '#', '#'], ['~~.~~#', '~...~.', '~#.~#.', '~~~#~.'], [0, 2], 1],
   None),
  ('first row candidate #1', [['..', '..'], ['#.', '..'], [0, 0], 1], [1, 0]),
  ('distance exactly min #1', [['...'], ['...'], [0, 0], 2], [2, 0]),
  ('control #1', [['#.#.', '...#'], ['...#~', '.....'], [3, 1], 4], None)],
 [('water below #1', [['.'], ['~'], [0, 0], 0], None),
  ('regression lower floor tile #1',
   [['.', '.', '#', '#'], ['~~.~~#', '~...~.', '~#.~#.', '~~~#~.'], [0, 2], 1],
   None),
  ('regression lower floor tile #2',
   [['..', '..', '#.', '.#', '#.', '.#'], ['~.~', '~~~', '~#.', '~#.', '...', '##.'], [0, 4], 4],
   [1, 0]),
  ('regression lower floor tile #3',
   [['.#', '#.', '#.', '..', '..', '#.'], ['~..##', '#..#.', '#.#~.', '..~.~', '~~~..'], [0, 0], 5],
   None),
  ('regression lower floor tile #4',
   [['.#.#', '#...', '..#.'], ['..#', '~~.', '~.#', '...', '#~.', '~#.'], [2, 0], 4],
   None),
  ('first row candidate #1', [['..', '..'], ['#.', '..'], [0, 0], 1], [1, 0]),
  ('distance exactly min #1', [['...'], ['...'], [0, 0], 2], [2, 0]),
  ('control #1', [['#.#.', '...#'], ['...#~', '.....'], [3, 1], 4], None)],
 [('water below #1', [['.'], ['~'], [0, 0], 0], None),
  ('regression lower floor tile #1',
   [['.#.#', '#...', '..#.'], ['..#', '~~.', '~.#', '...', '#~.', '~#.'], [2, 0], 4],
   None),
  ('regression lower floor tile #2',
   [['.#..', '....', '....', '#...'], ['~#...', '~.~..', '#~.~.'], [3, 0], 0],
   [2, 0]),
  ('regression lower floor tile #3',
   [['..', '..', '#.', '.#', '#.', '.#'], ['~.~', '~~~', '~#.', '~#.', '...', '##.'], [0, 4], 4],
   [1, 0]),
  ('regression lower floor tile #4', [['.', '.', '.'], ['~..'], [0, 2], 1], None),
  ('first row candidate #1', [['..', '..'], ['#.', '..'], [0, 0], 1], [1, 0]),
  ('distance exactly min #1', [['...'], ['...'], [0, 0], 2], [2, 0]),
  ('control #1', [['.', '#', '.', '#'], ['#.....'], [0, 1], 4], None)],
 [('water below #1', [['.'], ['~'], [0, 0], 0], None),
  ('regression lower floor tile #1', [['.', '.', '.'], ['~..'], [0, 2], 1], None),
  ('regression lower floor tile #2',
   [['..###.', '.#.#..', '...##.', '###...', '.#..##'], ['#', '~', '.', '.', '.', '#'], [2, 2], 2],
   [0, 2]),
  ('regression lower floor tile #3',
   [['.#..', '....', '....', '#...'], ['~#...', '~.~..', '#~.~.'], [3, 0], 0],
   [2, 0]),
  ('partial repair boundary #1',
   [['..#.', '..#.', '..#.', '#...', '.#.#'], ['#..#', '.~#.', '.##~'], [0, 2], 5],
   None),
  ('first row candidate #1', [['..', '..'], ['#.', '..'], [0, 0], 1], [1, 0]),
  ('distance exactly min #1', [['...'], ['...'], [0, 0], 2], [2, 0]),
  ('control #1', [['##', '.#', '#.', '.#', '.#'], ['##.', '...', '.~#'], [0, 0], 5], None)]]
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
water below #1[0, 0]NoneFailed
regression lower floor tile #1[0, 0][1, 0]Failed
regression lower floor tile #2[1, 0][2, 0]Failed
partial repair boundary #1[0, 0][0, 1]Failed
regression lower floor tile #3[1, 4]NoneFailed
first row candidate #1[1, 0][1, 0]Passed
distance exactly min #1[2, 0][2, 0]Passed
control #1NoneNonePassed

SHA-256 / 3b30230161896b1be1e9c690368493891a268ccf6f45f17d54cc9366e34e972c

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(floor_a, floor_b, entrance, min_dist):
    for y in range(len(floor_a)):
        for x in range(len(floor_a[0])):
            if floor_a[y][x] != '.':
                continue
            if y >= len(floor_b) or x >= len(floor_b[0]) or floor_b[y][x] != '.':
                continue
            if abs(x - entrance[0]) + abs(y - entrance[1]) < min_dist:
                continue
            return [x, y]
    return None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('water below #1', [['.'], ['~'], [0, 0], 0], None),
  ('regression lower floor tile #1',
   [['...', '.#.', '...', '..#', '###', '..#'], ['~.#.~', '##~~#', '~~#..', '.~.~.'], [2, 4], 5],
   [1, 0]),
  ('regression lower floor tile #2',
   [['#....', '..#..', '#...#', '#..#.', '.#.#.', '.#.#.'],
    ['#~..', '..~.', '..~.', '..#.', '##~~'],
    [1, 4],
    1],
   [2, 0]),
  ('partial repair boundary #1',
   [['...##.', '..#.#.', '..#...', '#.....', '#.....'], ['#', '.', '.', '~'], [0, 2], 1],
   [0, 1]),
  ('regression lower floor tile #3',
   [['.#', '#.', '#.', '..', '..', '#.'], ['~..##', '#..#.', '#.#~.', '..~.~', '~~~..'], [0, 0], 5],
   None),
  ('first row candidate #1', [['..', '..'], ['#.', '..'], [0, 0], 1], [1, 0]),
  ('distance exactly min #1', [['...'], ['...'], [0, 0], 2], [2, 0]),
  ('control #1', [['#.#.', '...#'], ['...#~', '.....'], [3, 1], 4], None)],
 [('water below #1', [['.'], ['~'], [0, 0], 0], None),
  ('regression lower floor tile #1',
   [['#....', '..#..', '#...#', '#..#.', '.#.#.', '.#.#.'],
    ['#~..', '..~.', '..~.', '..#.', '##~~'],
    [1, 4],
    1],
   [2, 0]),
  ('regression lower floor tile #2',
   [['.#', '#.', '#.', '..', '..', '#.'], ['~..##', '#..#.', '#.#~.', '..~.~', '~~~..'], [0, 0], 5],
   None),
  ('partial repair boundary #1',
   [['...##.', '..#.#.', '..#...', '#.....', '#.....'], ['#', '.', '.', '~'], [0, 2], 1],
   [0, 1]),
  ('regression lower floor tile #3',
   [['.', '.', '#', '#'], ['~~.~~#', '~...~.', '~#.~#.', '~~~#~.'], [0, 2], 1],
   None),
  ('first row candidate #1', [['..', '..'], ['#.', '..'], [0, 0], 1], [1, 0]),
  ('distance exactly min #1', [['...'], ['...'], [0, 0], 2], [2, 0]),
  ('control #1', [['#.#.', '...#'], ['...#~', '.....'], [3, 1], 4], None)],
 [('water below #1', [['.'], ['~'], [0, 0], 0], None),
  ('regression lower floor tile #1',
   [['.', '.', '#', '#'], ['~~.~~#', '~...~.', '~#.~#.', '~~~#~.'], [0, 2], 1],
   None),
  ('regression lower floor tile #2',
   [['..', '..', '#.', '.#', '#.', '.#'], ['~.~', '~~~', '~#.', '~#.', '...', '##.'], [0, 4], 4],
   [1, 0]),
  ('regression lower floor tile #3',
   [['.#', '#.', '#.', '..', '..', '#.'], ['~..##', '#..#.', '#.#~.', '..~.~', '~~~..'], [0, 0], 5],
   None),
  ('regression lower floor tile #4',
   [['.#.#', '#...', '..#.'], ['..#', '~~.', '~.#', '...', '#~.', '~#.'], [2, 0], 4],
   None),
  ('first row candidate #1', [['..', '..'], ['#.', '..'], [0, 0], 1], [1, 0]),
  ('distance exactly min #1', [['...'], ['...'], [0, 0], 2], [2, 0]),
  ('control #1', [['#.#.', '...#'], ['...#~', '.....'], [3, 1], 4], None)],
 [('water below #1', [['.'], ['~'], [0, 0], 0], None),
  ('regression lower floor tile #1',
   [['.#.#', '#...', '..#.'], ['..#', '~~.', '~.#', '...', '#~.', '~#.'], [2, 0], 4],
   None),
  ('regression lower floor tile #2',
   [['.#..', '....', '....', '#...'], ['~#...', '~.~..', '#~.~.'], [3, 0], 0],
   [2, 0]),
  ('regression lower floor tile #3',
   [['..', '..', '#.', '.#', '#.', '.#'], ['~.~', '~~~', '~#.', '~#.', '...', '##.'], [0, 4], 4],
   [1, 0]),
  ('regression lower floor tile #4', [['.', '.', '.'], ['~..'], [0, 2], 1], None),
  ('first row candidate #1', [['..', '..'], ['#.', '..'], [0, 0], 1], [1, 0]),
  ('distance exactly min #1', [['...'], ['...'], [0, 0], 2], [2, 0]),
  ('control #1', [['.', '#', '.', '#'], ['#.....'], [0, 1], 4], None)],
 [('water below #1', [['.'], ['~'], [0, 0], 0], None),
  ('regression lower floor tile #1', [['.', '.', '.'], ['~..'], [0, 2], 1], None),
  ('regression lower floor tile #2',
   [['..###.', '.#.#..', '...##.', '###...', '.#..##'], ['#', '~', '.', '.', '.', '#'], [2, 2], 2],
   [0, 2]),
  ('regression lower floor tile #3',
   [['.#..', '....', '....', '#...'], ['~#...', '~.~..', '#~.~.'], [3, 0], 0],
   [2, 0]),
  ('partial repair boundary #1',
   [['..#.', '..#.', '..#.', '#...', '.#.#'], ['#..#', '.~#.', '.##~'], [0, 2], 5],
   None),
  ('first row candidate #1', [['..', '..'], ['#.', '..'], [0, 0], 1], [1, 0]),
  ('distance exactly min #1', [['...'], ['...'], [0, 0], 2], [2, 0]),
  ('control #1', [['##', '.#', '#.', '.#', '.#'], ['##.', '...', '.~#'], [0, 0], 5], None)]]
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
water below #1NoneNonePassed
regression lower floor tile #1[1, 0][1, 0]Passed
regression lower floor tile #2[2, 0][2, 0]Passed
partial repair boundary #1[0, 1][0, 1]Passed
regression lower floor tile #3NoneNonePassed
first row candidate #1[1, 0][1, 0]Passed
distance exactly min #1[2, 0][2, 0]Passed
control #1NoneNonePassed

SHA-256 / 5ee8c134123f172bc8a2a14ccd9ab720bc86754caaace4fb6520dcb7494a0798

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

Case digest / b326f5240c3129fb75a7ba8817897c4d89a4354d526d9e73c992ade69bc0a531