FA-86806 / Procedural level generation constraints / Open access
Door placement between rooms: Side door placed inside the neighbour room · case 01
Side doors are drawn one tile into the right room.
ROOT CAUSE
The door column is one past the wall.
VERIFIED REPAIR
Restore `return [px + pw, lo + (hi - lo - 1) // 2]` at the door column step.
Unsuccessful approach: One column short puts the door inside the left room.
Case contract
Rooms [x, y, w, h] are interiors separated by one wall tile when x_a + w_a + 1 == x_b (b right of a) or y_a + h_a + 1 == y_b (b below a), checked in both room orders. The door sits in the wall at the middle of the shared span [lo, hi) (lower middle for even spans): column x_a+w_a for side-by-side rooms, row y_a+h_a for stacked rooms. 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(a, b):
def door(p, q):
px, py, pw, ph = p
qx, qy, qw, qh = q
if px + pw + 1 == qx:
lo = max(py, qy)
hi = min(py + ph, qy + qh)
if hi - lo >= 1:
return [px + pw + 1, lo + (hi - lo - 1) // 2]
if py + ph + 1 == qy:
lo = max(px, qx)
hi = min(px + pw, qx + qw)
if hi > lo:
return [(lo + hi - 1) // 2, py + ph]
return None
return door(a, b) or door(b, a)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('side by side #1', [[0, 0, 3, 4], [4, 1, 2, 5]], [3, 2]),
('regression door column #1', [[3, 10, 2, 1], [6, 6, 6, 5]], [5, 10]),
('regression door column #2', [[13, 5, 1, 2], [6, 2, 6, 6]], [12, 5]),
('regression door column #3', [[11, 7, 6, 3], [7, 7, 3, 1]], [10, 7]),
('regression door column #4', [[10, 9, 4, 1], [15, 9, 3, 4]], [14, 9]),
('stacked reversed order #1', [[2, 5, 3, 2], [1, 0, 4, 4]], [3, 4]),
('rooms touching without wall #1', [[0, 0, 3, 3], [3, 0, 3, 3]], None),
('control #1', [[6, 10, 4, 6], [5, 7, 4, 3]], None)],
[('side by side #1', [[0, 0, 3, 4], [4, 1, 2, 5]], [3, 2]),
('regression door column #1', [[13, 5, 1, 2], [6, 2, 6, 6]], [12, 5]),
('regression door column #2', [[11, 7, 6, 3], [7, 7, 3, 1]], [10, 7]),
('regression door column #3', [[10, 9, 4, 1], [15, 9, 3, 4]], [14, 9]),
('regression door column #4', [[0, 9, 1, 5], [2, 9, 3, 1]], [1, 9]),
('stacked reversed order #1', [[2, 5, 3, 2], [1, 0, 4, 4]], [3, 4]),
('rooms touching without wall #1', [[0, 0, 3, 3], [3, 0, 3, 3]], None),
('control #1', [[6, 10, 4, 6], [5, 7, 4, 3]], None)],
[('side by side #1', [[0, 0, 3, 4], [4, 1, 2, 5]], [3, 2]),
('regression door column #1', [[10, 9, 4, 1], [15, 9, 3, 4]], [14, 9]),
('regression door column #2', [[0, 9, 1, 5], [2, 9, 3, 1]], [1, 9]),
('regression door column #3', [[11, 6, 5, 4], [6, 6, 4, 3]], [10, 7]),
('regression door column #4', [[6, 6, 4, 1], [11, 4, 6, 4]], [10, 6]),
('stacked reversed order #1', [[2, 5, 3, 2], [1, 0, 4, 4]], [3, 4]),
('rooms touching without wall #1', [[0, 0, 3, 3], [3, 0, 3, 3]], None),
('control #1', [[6, 10, 4, 6], [5, 7, 4, 3]], None)],
[('side by side #1', [[0, 0, 3, 4], [4, 1, 2, 5]], [3, 2]),
('regression door column #1', [[11, 6, 5, 4], [6, 6, 4, 3]], [10, 7]),
('regression door column #2', [[6, 6, 4, 1], [11, 4, 6, 4]], [10, 6]),
('regression door column #3', [[8, 5, 4, 2], [13, 6, 1, 3]], [12, 6]),
('regression door column #4', [[7, 7, 6, 1], [14, 3, 5, 5]], [13, 7]),
('stacked reversed order #1', [[2, 5, 3, 2], [1, 0, 4, 4]], [3, 4]),
('rooms touching without wall #1', [[0, 0, 3, 3], [3, 0, 3, 3]], None),
('control #1', [[0, 14, 4, 5], [3, 9, 3, 1]], None)],
[('side by side #1', [[0, 0, 3, 4], [4, 1, 2, 5]], [3, 2]),
('regression door column #1', [[8, 5, 4, 2], [13, 6, 1, 3]], [12, 6]),
('regression door column #2', [[7, 7, 6, 1], [14, 3, 5, 5]], [13, 7]),
('regression door column #3', [[11, 6, 3, 5], [4, 9, 6, 6]], [10, 9]),
('regression door column #4', [[7, 13, 1, 6], [4, 9, 2, 5]], [6, 13]),
('stacked reversed order #1', [[2, 5, 3, 2], [1, 0, 4, 4]], [3, 4]),
('rooms touching without wall #1', [[0, 0, 3, 3], [3, 0, 3, 3]], None),
('control #1', [[7, 2, 4, 4], [4, 3, 3, 3]], 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| side by side #1 | [4, 2] | [3, 2] | Failed |
| regression door column #1 | [6, 10] | [5, 10] | Failed |
| regression door column #2 | [13, 5] | [12, 5] | Failed |
| regression door column #3 | [11, 7] | [10, 7] | Failed |
| regression door column #4 | [15, 9] | [14, 9] | Failed |
| stacked reversed order #1 | [3, 4] | [3, 4] | Passed |
| rooms touching without wall #1 | None | None | Passed |
| control #1 | None | None | Passed |
SHA-256 / b6501f40e037f896e53c3a9fde2ec5b82dcca20907395c322b5cb4e6187da994
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(a, b):
def door(p, q):
px, py, pw, ph = p
qx, qy, qw, qh = q
if px + pw + 1 == qx:
lo = max(py, qy)
hi = min(py + ph, qy + qh)
if hi - lo >= 1:
return [px + pw - 1, lo + (hi - lo - 1) // 2]
if py + ph + 1 == qy:
lo = max(px, qx)
hi = min(px + pw, qx + qw)
if hi > lo:
return [(lo + hi - 1) // 2, py + ph]
return None
return door(a, b) or door(b, a)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('side by side #1', [[0, 0, 3, 4], [4, 1, 2, 5]], [3, 2]),
('regression door column #1', [[3, 10, 2, 1], [6, 6, 6, 5]], [5, 10]),
('regression door column #2', [[13, 5, 1, 2], [6, 2, 6, 6]], [12, 5]),
('regression door column #3', [[11, 7, 6, 3], [7, 7, 3, 1]], [10, 7]),
('regression door column #4', [[10, 9, 4, 1], [15, 9, 3, 4]], [14, 9]),
('stacked reversed order #1', [[2, 5, 3, 2], [1, 0, 4, 4]], [3, 4]),
('rooms touching without wall #1', [[0, 0, 3, 3], [3, 0, 3, 3]], None),
('control #1', [[6, 10, 4, 6], [5, 7, 4, 3]], None)],
[('side by side #1', [[0, 0, 3, 4], [4, 1, 2, 5]], [3, 2]),
('regression door column #1', [[13, 5, 1, 2], [6, 2, 6, 6]], [12, 5]),
('regression door column #2', [[11, 7, 6, 3], [7, 7, 3, 1]], [10, 7]),
('regression door column #3', [[10, 9, 4, 1], [15, 9, 3, 4]], [14, 9]),
('regression door column #4', [[0, 9, 1, 5], [2, 9, 3, 1]], [1, 9]),
('stacked reversed order #1', [[2, 5, 3, 2], [1, 0, 4, 4]], [3, 4]),
('rooms touching without wall #1', [[0, 0, 3, 3], [3, 0, 3, 3]], None),
('control #1', [[6, 10, 4, 6], [5, 7, 4, 3]], None)],
[('side by side #1', [[0, 0, 3, 4], [4, 1, 2, 5]], [3, 2]),
('regression door column #1', [[10, 9, 4, 1], [15, 9, 3, 4]], [14, 9]),
('regression door column #2', [[0, 9, 1, 5], [2, 9, 3, 1]], [1, 9]),
('regression door column #3', [[11, 6, 5, 4], [6, 6, 4, 3]], [10, 7]),
('regression door column #4', [[6, 6, 4, 1], [11, 4, 6, 4]], [10, 6]),
('stacked reversed order #1', [[2, 5, 3, 2], [1, 0, 4, 4]], [3, 4]),
('rooms touching without wall #1', [[0, 0, 3, 3], [3, 0, 3, 3]], None),
('control #1', [[6, 10, 4, 6], [5, 7, 4, 3]], None)],
[('side by side #1', [[0, 0, 3, 4], [4, 1, 2, 5]], [3, 2]),
('regression door column #1', [[11, 6, 5, 4], [6, 6, 4, 3]], [10, 7]),
('regression door column #2', [[6, 6, 4, 1], [11, 4, 6, 4]], [10, 6]),
('regression door column #3', [[8, 5, 4, 2], [13, 6, 1, 3]], [12, 6]),
('regression door column #4', [[7, 7, 6, 1], [14, 3, 5, 5]], [13, 7]),
('stacked reversed order #1', [[2, 5, 3, 2], [1, 0, 4, 4]], [3, 4]),
('rooms touching without wall #1', [[0, 0, 3, 3], [3, 0, 3, 3]], None),
('control #1', [[0, 14, 4, 5], [3, 9, 3, 1]], None)],
[('side by side #1', [[0, 0, 3, 4], [4, 1, 2, 5]], [3, 2]),
('regression door column #1', [[8, 5, 4, 2], [13, 6, 1, 3]], [12, 6]),
('regression door column #2', [[7, 7, 6, 1], [14, 3, 5, 5]], [13, 7]),
('regression door column #3', [[11, 6, 3, 5], [4, 9, 6, 6]], [10, 9]),
('regression door column #4', [[7, 13, 1, 6], [4, 9, 2, 5]], [6, 13]),
('stacked reversed order #1', [[2, 5, 3, 2], [1, 0, 4, 4]], [3, 4]),
('rooms touching without wall #1', [[0, 0, 3, 3], [3, 0, 3, 3]], None),
('control #1', [[7, 2, 4, 4], [4, 3, 3, 3]], 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| side by side #1 | [2, 2] | [3, 2] | Failed |
| regression door column #1 | [4, 10] | [5, 10] | Failed |
| regression door column #2 | [11, 5] | [12, 5] | Failed |
| regression door column #3 | [9, 7] | [10, 7] | Failed |
| regression door column #4 | [13, 9] | [14, 9] | Failed |
| stacked reversed order #1 | [3, 4] | [3, 4] | Passed |
| rooms touching without wall #1 | None | None | Passed |
| control #1 | None | None | Passed |
SHA-256 / 05d425039f4c04ad1ffed7df070a2d7a16bc68f149ac84f68964d3f2d9f09d27
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(a, b):
def door(p, q):
px, py, pw, ph = p
qx, qy, qw, qh = q
if px + pw + 1 == qx:
lo = max(py, qy)
hi = min(py + ph, qy + qh)
if hi - lo >= 1:
return [px + pw, lo + (hi - lo - 1) // 2]
if py + ph + 1 == qy:
lo = max(px, qx)
hi = min(px + pw, qx + qw)
if hi > lo:
return [(lo + hi - 1) // 2, py + ph]
return None
return door(a, b) or door(b, a)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('side by side #1', [[0, 0, 3, 4], [4, 1, 2, 5]], [3, 2]),
('regression door column #1', [[3, 10, 2, 1], [6, 6, 6, 5]], [5, 10]),
('regression door column #2', [[13, 5, 1, 2], [6, 2, 6, 6]], [12, 5]),
('regression door column #3', [[11, 7, 6, 3], [7, 7, 3, 1]], [10, 7]),
('regression door column #4', [[10, 9, 4, 1], [15, 9, 3, 4]], [14, 9]),
('stacked reversed order #1', [[2, 5, 3, 2], [1, 0, 4, 4]], [3, 4]),
('rooms touching without wall #1', [[0, 0, 3, 3], [3, 0, 3, 3]], None),
('control #1', [[6, 10, 4, 6], [5, 7, 4, 3]], None)],
[('side by side #1', [[0, 0, 3, 4], [4, 1, 2, 5]], [3, 2]),
('regression door column #1', [[13, 5, 1, 2], [6, 2, 6, 6]], [12, 5]),
('regression door column #2', [[11, 7, 6, 3], [7, 7, 3, 1]], [10, 7]),
('regression door column #3', [[10, 9, 4, 1], [15, 9, 3, 4]], [14, 9]),
('regression door column #4', [[0, 9, 1, 5], [2, 9, 3, 1]], [1, 9]),
('stacked reversed order #1', [[2, 5, 3, 2], [1, 0, 4, 4]], [3, 4]),
('rooms touching without wall #1', [[0, 0, 3, 3], [3, 0, 3, 3]], None),
('control #1', [[6, 10, 4, 6], [5, 7, 4, 3]], None)],
[('side by side #1', [[0, 0, 3, 4], [4, 1, 2, 5]], [3, 2]),
('regression door column #1', [[10, 9, 4, 1], [15, 9, 3, 4]], [14, 9]),
('regression door column #2', [[0, 9, 1, 5], [2, 9, 3, 1]], [1, 9]),
('regression door column #3', [[11, 6, 5, 4], [6, 6, 4, 3]], [10, 7]),
('regression door column #4', [[6, 6, 4, 1], [11, 4, 6, 4]], [10, 6]),
('stacked reversed order #1', [[2, 5, 3, 2], [1, 0, 4, 4]], [3, 4]),
('rooms touching without wall #1', [[0, 0, 3, 3], [3, 0, 3, 3]], None),
('control #1', [[6, 10, 4, 6], [5, 7, 4, 3]], None)],
[('side by side #1', [[0, 0, 3, 4], [4, 1, 2, 5]], [3, 2]),
('regression door column #1', [[11, 6, 5, 4], [6, 6, 4, 3]], [10, 7]),
('regression door column #2', [[6, 6, 4, 1], [11, 4, 6, 4]], [10, 6]),
('regression door column #3', [[8, 5, 4, 2], [13, 6, 1, 3]], [12, 6]),
('regression door column #4', [[7, 7, 6, 1], [14, 3, 5, 5]], [13, 7]),
('stacked reversed order #1', [[2, 5, 3, 2], [1, 0, 4, 4]], [3, 4]),
('rooms touching without wall #1', [[0, 0, 3, 3], [3, 0, 3, 3]], None),
('control #1', [[0, 14, 4, 5], [3, 9, 3, 1]], None)],
[('side by side #1', [[0, 0, 3, 4], [4, 1, 2, 5]], [3, 2]),
('regression door column #1', [[8, 5, 4, 2], [13, 6, 1, 3]], [12, 6]),
('regression door column #2', [[7, 7, 6, 1], [14, 3, 5, 5]], [13, 7]),
('regression door column #3', [[11, 6, 3, 5], [4, 9, 6, 6]], [10, 9]),
('regression door column #4', [[7, 13, 1, 6], [4, 9, 2, 5]], [6, 13]),
('stacked reversed order #1', [[2, 5, 3, 2], [1, 0, 4, 4]], [3, 4]),
('rooms touching without wall #1', [[0, 0, 3, 3], [3, 0, 3, 3]], None),
('control #1', [[7, 2, 4, 4], [4, 3, 3, 3]], 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| side by side #1 | [3, 2] | [3, 2] | Passed |
| regression door column #1 | [5, 10] | [5, 10] | Passed |
| regression door column #2 | [12, 5] | [12, 5] | Passed |
| regression door column #3 | [10, 7] | [10, 7] | Passed |
| regression door column #4 | [14, 9] | [14, 9] | Passed |
| stacked reversed order #1 | [3, 4] | [3, 4] | Passed |
| rooms touching without wall #1 | None | None | Passed |
| control #1 | None | None | Passed |
SHA-256 / 7965b444055bba7bd0cd511a484c9e198e4f8ead3279511e2a2aee9da7fcbc1f
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.846522+00:00.
Case digest / 4e43f26130adab908a6866754a50253e701604008c44380ba99ae46dd6ce237c