FA-86821 / Procedural level generation constraints / Open access
Aligned stair placement: Stairs scanned column-major · case 01
Stair placement differs from the documented row-major rule.
ROOT CAUSE
The loops iterate columns in the outer loop.
VERIFIED REPAIR
Restore `for y in range(len(floor_a)): for x in range(len(floor_a[0])):` at the scan order step.
Unsuccessful approach: Scanning rows bottom-up still picks a different first cell.
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 x in range(len(floor_a[0])):
for y in range(len(floor_a)):
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 = [[('first row candidate #1', [['..', '..'], ['#.', '..'], [0, 0], 1], [1, 0]),
('regression scan order #1',
[['#....', '..#..', '#...#', '#..#.', '.#.#.', '.#.#.'],
['#~..', '..~.', '..~.', '..#.', '##~~'],
[1, 4],
1],
[2, 0]),
('regression scan order #2',
[['.#..', '....', '....', '#...'], ['~#...', '~.~..', '#~.~.'], [3, 0], 0],
[2, 0]),
('partial repair boundary #1',
[['..###.', '.#.#..', '...##.', '###...', '.#..##'], ['#', '~', '.', '.', '.', '#'], [2, 2], 2],
[0, 2]),
('partial repair boundary #2',
[['#', '.', '.', '.', '.', '#'], ['..', '..', '..', '.~', '.~', '##'], [0, 3], 0],
[0, 1]),
('water below #1', [['.'], ['~'], [0, 0], 0], None),
('distance exactly min #1', [['...'], ['...'], [0, 0], 2], [2, 0]),
('control #1', [['#.#.', '...#'], ['...#~', '.....'], [3, 1], 4], None)],
[('first row candidate #1', [['..', '..'], ['#.', '..'], [0, 0], 1], [1, 0]),
('regression scan order #1',
[['.#..', '....', '....', '#...'], ['~#...', '~.~..', '#~.~.'], [3, 0], 0],
[2, 0]),
('regression scan order #2',
[['..#..', '#..#.', '..#..', '.....', '.#...', '##.#.'],
['~~.', '##.', '~#~', '###', '.##', '...'],
[2, 1],
0],
[2, 1]),
('partial repair boundary #1',
[['..###.', '.#.#..', '...##.', '###...', '.#..##'], ['#', '~', '.', '.', '.', '#'], [2, 2], 2],
[0, 2]),
('partial repair boundary #2',
[['#', '.', '.', '.', '.', '#'], ['..', '..', '..', '.~', '.~', '##'], [0, 3], 0],
[0, 1]),
('water below #1', [['.'], ['~'], [0, 0], 0], None),
('distance exactly min #1', [['...'], ['...'], [0, 0], 2], [2, 0]),
('control #1', [['#.#.', '...#'], ['...#~', '.....'], [3, 1], 4], None)],
[('first row candidate #1', [['..', '..'], ['#.', '..'], [0, 0], 1], [1, 0]),
('regression scan order #1',
[['###..', '.#.##', '.....', '.....', '#.##.'], ['~#..', '...#'], [0, 0], 3],
[3, 0]),
('regression scan order #2',
[['..#..', '#....', '##...', '...#.', '..#..'], ['~.~.', '.##.', '~.##', '....', '...~'], [4, 2], 0],
[1, 0]),
('partial repair boundary #1',
[['#', '.', '.', '.', '.', '#'], ['..', '..', '..', '.~', '.~', '##'], [0, 3], 0],
[0, 1]),
('partial repair boundary #2',
[['...#', '.##.', '#..#', '.#..', '.#.#', '....'], ['.....', '.#..~', '.#~.#', '.#~.#'], [2, 5], 1],
[0, 0]),
('water below #1', [['.'], ['~'], [0, 0], 0], None),
('distance exactly min #1', [['...'], ['...'], [0, 0], 2], [2, 0]),
('control #1', [['#.#.', '...#'], ['...#~', '.....'], [3, 1], 4], None)],
[('first row candidate #1', [['..', '..'], ['#.', '..'], [0, 0], 1], [1, 0]),
('regression scan order #1',
[['...', '...', '###', '...', '###'], ['~.#', '.#~', '~..', '.#~', '.#.'], [1, 3], 2],
[1, 0]),
('regression scan order #2',
[['..', '..', '.#', '##', '..', '..'], ['~.', '.~', '..', '~.', '~#'], [1, 4], 4],
[1, 0]),
('regression scan order #3',
[['..#..', '#..#.', '..#..', '.....', '.#...', '##.#.'],
['~~.', '##.', '~#~', '###', '.##', '...'],
[2, 1],
0],
[2, 1]),
('regression scan order #4',
[['###..', '.#.##', '.....', '.....', '#.##.'], ['~#..', '...#'], [0, 0], 3],
[3, 0]),
('water below #1', [['.'], ['~'], [0, 0], 0], None),
('distance exactly min #1', [['...'], ['...'], [0, 0], 2], [2, 0]),
('control #1', [['.', '#', '.', '#'], ['#.....'], [0, 1], 4], None)],
[('first row candidate #1', [['..', '..'], ['#.', '..'], [0, 0], 1], [1, 0]),
('regression scan order #1',
[['...#', '##..', '.##.', '....', '.#..', '..##'], ['~.', '#.', '##', '~.', '#.', '.#'], [3, 2], 2],
[1, 0]),
('regression scan order #2',
[['.#...', '.....', '.....', '..##.'], ['~~.', '.#.', '...', '#.~', '~##', '...'], [0, 1], 3],
[2, 0]),
('partial repair boundary #1',
[['..#', '.#.', '#.#', '...', '..#'], ['#', '.', '#', '.'], [0, 0], 0],
[0, 1]),
('partial repair boundary #2',
[['.....#', '..#.#.', '.#..#.', '..###.', '#.#..#'], ['.#.~~#', '.#.##.', '~~#~..', '......'], [0, 3], 5],
[2, 0]),
('water below #1', [['.'], ['~'], [0, 0], 0], None),
('distance exactly min #1', [['...'], ['...'], [0, 0], 2], [2, 0]),
('control #1',
[['...', '.#.', '...', '..#', '###', '..#'], ['~.#.~', '##~~#', '~~#..', '.~.~.'], [2, 4], 5],
[1, 0])]]
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 |
|---|---|---|---|
| first row candidate #1 | [0, 1] | [1, 0] | Failed |
| regression scan order #1 | [0, 1] | [2, 0] | Failed |
| regression scan order #2 | [1, 1] | [2, 0] | Failed |
| partial repair boundary #1 | [0, 2] | [0, 2] | Passed |
| partial repair boundary #2 | [0, 1] | [0, 1] | Passed |
| water below #1 | None | None | Passed |
| distance exactly min #1 | [2, 0] | [2, 0] | Passed |
| control #1 | None | None | Passed |
SHA-256 / 425c0dc9fbb7ae83f3b1a894c85cdd8cb58118c4e16717130cc8e10302ed29a6
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 reversed(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 = [[('first row candidate #1', [['..', '..'], ['#.', '..'], [0, 0], 1], [1, 0]),
('regression scan order #1',
[['#....', '..#..', '#...#', '#..#.', '.#.#.', '.#.#.'],
['#~..', '..~.', '..~.', '..#.', '##~~'],
[1, 4],
1],
[2, 0]),
('regression scan order #2',
[['.#..', '....', '....', '#...'], ['~#...', '~.~..', '#~.~.'], [3, 0], 0],
[2, 0]),
('partial repair boundary #1',
[['..###.', '.#.#..', '...##.', '###...', '.#..##'], ['#', '~', '.', '.', '.', '#'], [2, 2], 2],
[0, 2]),
('partial repair boundary #2',
[['#', '.', '.', '.', '.', '#'], ['..', '..', '..', '.~', '.~', '##'], [0, 3], 0],
[0, 1]),
('water below #1', [['.'], ['~'], [0, 0], 0], None),
('distance exactly min #1', [['...'], ['...'], [0, 0], 2], [2, 0]),
('control #1', [['#.#.', '...#'], ['...#~', '.....'], [3, 1], 4], None)],
[('first row candidate #1', [['..', '..'], ['#.', '..'], [0, 0], 1], [1, 0]),
('regression scan order #1',
[['.#..', '....', '....', '#...'], ['~#...', '~.~..', '#~.~.'], [3, 0], 0],
[2, 0]),
('regression scan order #2',
[['..#..', '#..#.', '..#..', '.....', '.#...', '##.#.'],
['~~.', '##.', '~#~', '###', '.##', '...'],
[2, 1],
0],
[2, 1]),
('partial repair boundary #1',
[['..###.', '.#.#..', '...##.', '###...', '.#..##'], ['#', '~', '.', '.', '.', '#'], [2, 2], 2],
[0, 2]),
('partial repair boundary #2',
[['#', '.', '.', '.', '.', '#'], ['..', '..', '..', '.~', '.~', '##'], [0, 3], 0],
[0, 1]),
('water below #1', [['.'], ['~'], [0, 0], 0], None),
('distance exactly min #1', [['...'], ['...'], [0, 0], 2], [2, 0]),
('control #1', [['#.#.', '...#'], ['...#~', '.....'], [3, 1], 4], None)],
[('first row candidate #1', [['..', '..'], ['#.', '..'], [0, 0], 1], [1, 0]),
('regression scan order #1',
[['###..', '.#.##', '.....', '.....', '#.##.'], ['~#..', '...#'], [0, 0], 3],
[3, 0]),
('regression scan order #2',
[['..#..', '#....', '##...', '...#.', '..#..'], ['~.~.', '.##.', '~.##', '....', '...~'], [4, 2], 0],
[1, 0]),
('partial repair boundary #1',
[['#', '.', '.', '.', '.', '#'], ['..', '..', '..', '.~', '.~', '##'], [0, 3], 0],
[0, 1]),
('partial repair boundary #2',
[['...#', '.##.', '#..#', '.#..', '.#.#', '....'], ['.....', '.#..~', '.#~.#', '.#~.#'], [2, 5], 1],
[0, 0]),
('water below #1', [['.'], ['~'], [0, 0], 0], None),
('distance exactly min #1', [['...'], ['...'], [0, 0], 2], [2, 0]),
('control #1', [['#.#.', '...#'], ['...#~', '.....'], [3, 1], 4], None)],
[('first row candidate #1', [['..', '..'], ['#.', '..'], [0, 0], 1], [1, 0]),
('regression scan order #1',
[['...', '...', '###', '...', '###'], ['~.#', '.#~', '~..', '.#~', '.#.'], [1, 3], 2],
[1, 0]),
('regression scan order #2',
[['..', '..', '.#', '##', '..', '..'], ['~.', '.~', '..', '~.', '~#'], [1, 4], 4],
[1, 0]),
('regression scan order #3',
[['..#..', '#..#.', '..#..', '.....', '.#...', '##.#.'],
['~~.', '##.', '~#~', '###', '.##', '...'],
[2, 1],
0],
[2, 1]),
('regression scan order #4',
[['###..', '.#.##', '.....', '.....', '#.##.'], ['~#..', '...#'], [0, 0], 3],
[3, 0]),
('water below #1', [['.'], ['~'], [0, 0], 0], None),
('distance exactly min #1', [['...'], ['...'], [0, 0], 2], [2, 0]),
('control #1', [['.', '#', '.', '#'], ['#.....'], [0, 1], 4], None)],
[('first row candidate #1', [['..', '..'], ['#.', '..'], [0, 0], 1], [1, 0]),
('regression scan order #1',
[['...#', '##..', '.##.', '....', '.#..', '..##'], ['~.', '#.', '##', '~.', '#.', '.#'], [3, 2], 2],
[1, 0]),
('regression scan order #2',
[['.#...', '.....', '.....', '..##.'], ['~~.', '.#.', '...', '#.~', '~##', '...'], [0, 1], 3],
[2, 0]),
('partial repair boundary #1',
[['..#', '.#.', '#.#', '...', '..#'], ['#', '.', '#', '.'], [0, 0], 0],
[0, 1]),
('partial repair boundary #2',
[['.....#', '..#.#.', '.#..#.', '..###.', '#.#..#'], ['.#.~~#', '.#.##.', '~~#~..', '......'], [0, 3], 5],
[2, 0]),
('water below #1', [['.'], ['~'], [0, 0], 0], None),
('distance exactly min #1', [['...'], ['...'], [0, 0], 2], [2, 0]),
('control #1',
[['...', '.#.', '...', '..#', '###', '..#'], ['~.#.~', '##~~#', '~~#..', '.~.~.'], [2, 4], 5],
[1, 0])]]
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 |
|---|---|---|---|
| first row candidate #1 | [0, 1] | [1, 0] | Failed |
| regression scan order #1 | [1, 3] | [2, 0] | Failed |
| regression scan order #2 | [2, 2] | [2, 0] | Failed |
| partial repair boundary #1 | [0, 4] | [0, 2] | Failed |
| partial repair boundary #2 | [0, 4] | [0, 1] | Failed |
| water below #1 | None | None | Passed |
| distance exactly min #1 | [2, 0] | [2, 0] | Passed |
| control #1 | None | None | Passed |
SHA-256 / 5043bedb0220dedba35f9588cd41d452efa9c8985f0f1d37c9116ffa9b94ff63
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 = [[('first row candidate #1', [['..', '..'], ['#.', '..'], [0, 0], 1], [1, 0]),
('regression scan order #1',
[['#....', '..#..', '#...#', '#..#.', '.#.#.', '.#.#.'],
['#~..', '..~.', '..~.', '..#.', '##~~'],
[1, 4],
1],
[2, 0]),
('regression scan order #2',
[['.#..', '....', '....', '#...'], ['~#...', '~.~..', '#~.~.'], [3, 0], 0],
[2, 0]),
('partial repair boundary #1',
[['..###.', '.#.#..', '...##.', '###...', '.#..##'], ['#', '~', '.', '.', '.', '#'], [2, 2], 2],
[0, 2]),
('partial repair boundary #2',
[['#', '.', '.', '.', '.', '#'], ['..', '..', '..', '.~', '.~', '##'], [0, 3], 0],
[0, 1]),
('water below #1', [['.'], ['~'], [0, 0], 0], None),
('distance exactly min #1', [['...'], ['...'], [0, 0], 2], [2, 0]),
('control #1', [['#.#.', '...#'], ['...#~', '.....'], [3, 1], 4], None)],
[('first row candidate #1', [['..', '..'], ['#.', '..'], [0, 0], 1], [1, 0]),
('regression scan order #1',
[['.#..', '....', '....', '#...'], ['~#...', '~.~..', '#~.~.'], [3, 0], 0],
[2, 0]),
('regression scan order #2',
[['..#..', '#..#.', '..#..', '.....', '.#...', '##.#.'],
['~~.', '##.', '~#~', '###', '.##', '...'],
[2, 1],
0],
[2, 1]),
('partial repair boundary #1',
[['..###.', '.#.#..', '...##.', '###...', '.#..##'], ['#', '~', '.', '.', '.', '#'], [2, 2], 2],
[0, 2]),
('partial repair boundary #2',
[['#', '.', '.', '.', '.', '#'], ['..', '..', '..', '.~', '.~', '##'], [0, 3], 0],
[0, 1]),
('water below #1', [['.'], ['~'], [0, 0], 0], None),
('distance exactly min #1', [['...'], ['...'], [0, 0], 2], [2, 0]),
('control #1', [['#.#.', '...#'], ['...#~', '.....'], [3, 1], 4], None)],
[('first row candidate #1', [['..', '..'], ['#.', '..'], [0, 0], 1], [1, 0]),
('regression scan order #1',
[['###..', '.#.##', '.....', '.....', '#.##.'], ['~#..', '...#'], [0, 0], 3],
[3, 0]),
('regression scan order #2',
[['..#..', '#....', '##...', '...#.', '..#..'], ['~.~.', '.##.', '~.##', '....', '...~'], [4, 2], 0],
[1, 0]),
('partial repair boundary #1',
[['#', '.', '.', '.', '.', '#'], ['..', '..', '..', '.~', '.~', '##'], [0, 3], 0],
[0, 1]),
('partial repair boundary #2',
[['...#', '.##.', '#..#', '.#..', '.#.#', '....'], ['.....', '.#..~', '.#~.#', '.#~.#'], [2, 5], 1],
[0, 0]),
('water below #1', [['.'], ['~'], [0, 0], 0], None),
('distance exactly min #1', [['...'], ['...'], [0, 0], 2], [2, 0]),
('control #1', [['#.#.', '...#'], ['...#~', '.....'], [3, 1], 4], None)],
[('first row candidate #1', [['..', '..'], ['#.', '..'], [0, 0], 1], [1, 0]),
('regression scan order #1',
[['...', '...', '###', '...', '###'], ['~.#', '.#~', '~..', '.#~', '.#.'], [1, 3], 2],
[1, 0]),
('regression scan order #2',
[['..', '..', '.#', '##', '..', '..'], ['~.', '.~', '..', '~.', '~#'], [1, 4], 4],
[1, 0]),
('regression scan order #3',
[['..#..', '#..#.', '..#..', '.....', '.#...', '##.#.'],
['~~.', '##.', '~#~', '###', '.##', '...'],
[2, 1],
0],
[2, 1]),
('regression scan order #4',
[['###..', '.#.##', '.....', '.....', '#.##.'], ['~#..', '...#'], [0, 0], 3],
[3, 0]),
('water below #1', [['.'], ['~'], [0, 0], 0], None),
('distance exactly min #1', [['...'], ['...'], [0, 0], 2], [2, 0]),
('control #1', [['.', '#', '.', '#'], ['#.....'], [0, 1], 4], None)],
[('first row candidate #1', [['..', '..'], ['#.', '..'], [0, 0], 1], [1, 0]),
('regression scan order #1',
[['...#', '##..', '.##.', '....', '.#..', '..##'], ['~.', '#.', '##', '~.', '#.', '.#'], [3, 2], 2],
[1, 0]),
('regression scan order #2',
[['.#...', '.....', '.....', '..##.'], ['~~.', '.#.', '...', '#.~', '~##', '...'], [0, 1], 3],
[2, 0]),
('partial repair boundary #1',
[['..#', '.#.', '#.#', '...', '..#'], ['#', '.', '#', '.'], [0, 0], 0],
[0, 1]),
('partial repair boundary #2',
[['.....#', '..#.#.', '.#..#.', '..###.', '#.#..#'], ['.#.~~#', '.#.##.', '~~#~..', '......'], [0, 3], 5],
[2, 0]),
('water below #1', [['.'], ['~'], [0, 0], 0], None),
('distance exactly min #1', [['...'], ['...'], [0, 0], 2], [2, 0]),
('control #1',
[['...', '.#.', '...', '..#', '###', '..#'], ['~.#.~', '##~~#', '~~#..', '.~.~.'], [2, 4], 5],
[1, 0])]]
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 |
|---|---|---|---|
| first row candidate #1 | [1, 0] | [1, 0] | Passed |
| regression scan order #1 | [2, 0] | [2, 0] | Passed |
| regression scan order #2 | [2, 0] | [2, 0] | Passed |
| partial repair boundary #1 | [0, 2] | [0, 2] | Passed |
| partial repair boundary #2 | [0, 1] | [0, 1] | Passed |
| water below #1 | None | None | Passed |
| distance exactly min #1 | [2, 0] | [2, 0] | Passed |
| control #1 | None | None | Passed |
SHA-256 / f41668c6b88b6ac5893cc84b0d21df1ab015f13d7530400e6e13abc6f8cafc0e
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.143519+00:00.
Case digest / 041a2d355ff503a42077fcb584889f3378780c8f4d616aa2ade85a38c9288a71