FA-86796 / Procedural level generation constraints / Open access
Door placement between rooms: Doors on corner-touching rooms · case 01
Rooms that only meet at a corner get a door.
ROOT CAUSE
An empty overlap is accepted.
VERIFIED REPAIR
Restore `if hi - lo >= 1:` at the span requirement step.
Unsuccessful approach: Requiring two shared tiles rejects legitimate one-tile doors.
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 >= 0:
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 = [[('fault site span requirement #1', [[9, 4, 3, 2], [13, 6, 1, 5]], None),
('fault site span requirement #2', [[8, 9, 3, 6], [5, 4, 2, 5]], None),
('partial repair boundary #1', [[3, 10, 2, 1], [6, 6, 6, 5]], [5, 10]),
('partial repair boundary #2', [[11, 7, 6, 3], [7, 7, 3, 1]], [10, 7]),
('side by side #1', [[0, 0, 3, 4], [4, 1, 2, 5]], [3, 2]),
('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)],
[('fault site span requirement #1', [[10, -3, 6, 3], [4, 0, 5, 6]], None),
('fault site span requirement #2', [[11, 14, 1, 4], [6, 9, 4, 5]], None),
('partial repair boundary #1', [[10, 9, 4, 1], [15, 9, 3, 4]], [14, 9]),
('partial repair boundary #2', [[0, 9, 1, 5], [2, 9, 3, 1]], [1, 9]),
('rooms touching without wall #1', [[0, 0, 3, 3], [3, 0, 3, 3]], None),
('side by side #1', [[0, 0, 3, 4], [4, 1, 2, 5]], [3, 2]),
('control #1', [[6, 10, 4, 6], [5, 7, 4, 3]], None),
('control #2', [[0, 14, 4, 5], [3, 9, 3, 1]], None)],
[('fault site span requirement #1', [[8, 1, 5, 5], [4, 6, 3, 1]], None),
('fault site span requirement #2', [[10, 9, 4, 3], [7, 7, 2, 2]], None),
('partial repair boundary #1', [[6, 6, 4, 1], [11, 4, 6, 4]], [10, 6]),
('partial repair boundary #2', [[8, 5, 4, 2], [13, 6, 1, 3]], [12, 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', [[0, 14, 4, 5], [3, 9, 3, 1]], None),
('control #2', [[7, 2, 4, 4], [4, 3, 3, 3]], None)],
[('fault site span requirement #1', [[6, 7, 6, 6], [0, 13, 5, 3]], None),
('fault site span requirement #2', [[10, 6, 6, 3], [5, 9, 4, 2]], None),
('partial repair boundary #1', [[7, 7, 6, 1], [14, 3, 5, 5]], [13, 7]),
('partial repair boundary #2', [[7, 13, 1, 6], [4, 9, 2, 5]], [6, 13]),
('side by side #1', [[0, 0, 3, 4], [4, 1, 2, 5]], [3, 2]),
('stacked reversed order #1', [[2, 5, 3, 2], [1, 0, 4, 4]], [3, 4]),
('control #1', [[2, 9, 3, 5], [5, 15, 1, 5]], None),
('control #2', [[7, 2, 3, 3], [8, 5, 2, 6]], None)],
[('fault site span requirement #1', [[4, 7, 3, 6], [1, 6, 2, 1]], None),
('fault site span requirement #2', [[12, 13, 3, 1], [6, 9, 5, 4]], None),
('partial repair boundary #1', [[7, 4, 4, 3], [2, 5, 4, 1]], [6, 5]),
('partial repair boundary #2', [[15, 9, 6, 6], [10, 5, 4, 5]], [14, 9]),
('rooms touching without wall #1', [[0, 0, 3, 3], [3, 0, 3, 3]], None),
('side by side #1', [[0, 0, 3, 4], [4, 1, 2, 5]], [3, 2]),
('control #1', [[0, 7, 4, 1], [15, 3, 4, 5]], None),
('control #2', [[10, 0, 2, 6], [14, -1, 1, 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fault site span requirement #1 | [12, 5] | None | Failed |
| fault site span requirement #2 | [7, 8] | None | Failed |
| partial repair boundary #1 | [5, 10] | [5, 10] | Passed |
| partial repair boundary #2 | [10, 7] | [10, 7] | Passed |
| side by side #1 | [3, 2] | [3, 2] | 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 / 4ecaa8adeba23fc08bfd8ade0729dadd276f3ba7ef61154e0932c5ba98fb2a4e
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, 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 = [[('fault site span requirement #1', [[9, 4, 3, 2], [13, 6, 1, 5]], None),
('fault site span requirement #2', [[8, 9, 3, 6], [5, 4, 2, 5]], None),
('partial repair boundary #1', [[3, 10, 2, 1], [6, 6, 6, 5]], [5, 10]),
('partial repair boundary #2', [[11, 7, 6, 3], [7, 7, 3, 1]], [10, 7]),
('side by side #1', [[0, 0, 3, 4], [4, 1, 2, 5]], [3, 2]),
('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)],
[('fault site span requirement #1', [[10, -3, 6, 3], [4, 0, 5, 6]], None),
('fault site span requirement #2', [[11, 14, 1, 4], [6, 9, 4, 5]], None),
('partial repair boundary #1', [[10, 9, 4, 1], [15, 9, 3, 4]], [14, 9]),
('partial repair boundary #2', [[0, 9, 1, 5], [2, 9, 3, 1]], [1, 9]),
('rooms touching without wall #1', [[0, 0, 3, 3], [3, 0, 3, 3]], None),
('side by side #1', [[0, 0, 3, 4], [4, 1, 2, 5]], [3, 2]),
('control #1', [[6, 10, 4, 6], [5, 7, 4, 3]], None),
('control #2', [[0, 14, 4, 5], [3, 9, 3, 1]], None)],
[('fault site span requirement #1', [[8, 1, 5, 5], [4, 6, 3, 1]], None),
('fault site span requirement #2', [[10, 9, 4, 3], [7, 7, 2, 2]], None),
('partial repair boundary #1', [[6, 6, 4, 1], [11, 4, 6, 4]], [10, 6]),
('partial repair boundary #2', [[8, 5, 4, 2], [13, 6, 1, 3]], [12, 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', [[0, 14, 4, 5], [3, 9, 3, 1]], None),
('control #2', [[7, 2, 4, 4], [4, 3, 3, 3]], None)],
[('fault site span requirement #1', [[6, 7, 6, 6], [0, 13, 5, 3]], None),
('fault site span requirement #2', [[10, 6, 6, 3], [5, 9, 4, 2]], None),
('partial repair boundary #1', [[7, 7, 6, 1], [14, 3, 5, 5]], [13, 7]),
('partial repair boundary #2', [[7, 13, 1, 6], [4, 9, 2, 5]], [6, 13]),
('side by side #1', [[0, 0, 3, 4], [4, 1, 2, 5]], [3, 2]),
('stacked reversed order #1', [[2, 5, 3, 2], [1, 0, 4, 4]], [3, 4]),
('control #1', [[2, 9, 3, 5], [5, 15, 1, 5]], None),
('control #2', [[7, 2, 3, 3], [8, 5, 2, 6]], None)],
[('fault site span requirement #1', [[4, 7, 3, 6], [1, 6, 2, 1]], None),
('fault site span requirement #2', [[12, 13, 3, 1], [6, 9, 5, 4]], None),
('partial repair boundary #1', [[7, 4, 4, 3], [2, 5, 4, 1]], [6, 5]),
('partial repair boundary #2', [[15, 9, 6, 6], [10, 5, 4, 5]], [14, 9]),
('rooms touching without wall #1', [[0, 0, 3, 3], [3, 0, 3, 3]], None),
('side by side #1', [[0, 0, 3, 4], [4, 1, 2, 5]], [3, 2]),
('control #1', [[0, 7, 4, 1], [15, 3, 4, 5]], None),
('control #2', [[10, 0, 2, 6], [14, -1, 1, 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fault site span requirement #1 | None | None | Passed |
| fault site span requirement #2 | None | None | Passed |
| partial repair boundary #1 | None | [5, 10] | Failed |
| partial repair boundary #2 | None | [10, 7] | Failed |
| side by side #1 | [3, 2] | [3, 2] | 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 / f73bbc96ac9ecdb714cb97aace21bdab4e2a1619981e2cc401800620e009ac05
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 = [[('fault site span requirement #1', [[9, 4, 3, 2], [13, 6, 1, 5]], None),
('fault site span requirement #2', [[8, 9, 3, 6], [5, 4, 2, 5]], None),
('partial repair boundary #1', [[3, 10, 2, 1], [6, 6, 6, 5]], [5, 10]),
('partial repair boundary #2', [[11, 7, 6, 3], [7, 7, 3, 1]], [10, 7]),
('side by side #1', [[0, 0, 3, 4], [4, 1, 2, 5]], [3, 2]),
('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)],
[('fault site span requirement #1', [[10, -3, 6, 3], [4, 0, 5, 6]], None),
('fault site span requirement #2', [[11, 14, 1, 4], [6, 9, 4, 5]], None),
('partial repair boundary #1', [[10, 9, 4, 1], [15, 9, 3, 4]], [14, 9]),
('partial repair boundary #2', [[0, 9, 1, 5], [2, 9, 3, 1]], [1, 9]),
('rooms touching without wall #1', [[0, 0, 3, 3], [3, 0, 3, 3]], None),
('side by side #1', [[0, 0, 3, 4], [4, 1, 2, 5]], [3, 2]),
('control #1', [[6, 10, 4, 6], [5, 7, 4, 3]], None),
('control #2', [[0, 14, 4, 5], [3, 9, 3, 1]], None)],
[('fault site span requirement #1', [[8, 1, 5, 5], [4, 6, 3, 1]], None),
('fault site span requirement #2', [[10, 9, 4, 3], [7, 7, 2, 2]], None),
('partial repair boundary #1', [[6, 6, 4, 1], [11, 4, 6, 4]], [10, 6]),
('partial repair boundary #2', [[8, 5, 4, 2], [13, 6, 1, 3]], [12, 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', [[0, 14, 4, 5], [3, 9, 3, 1]], None),
('control #2', [[7, 2, 4, 4], [4, 3, 3, 3]], None)],
[('fault site span requirement #1', [[6, 7, 6, 6], [0, 13, 5, 3]], None),
('fault site span requirement #2', [[10, 6, 6, 3], [5, 9, 4, 2]], None),
('partial repair boundary #1', [[7, 7, 6, 1], [14, 3, 5, 5]], [13, 7]),
('partial repair boundary #2', [[7, 13, 1, 6], [4, 9, 2, 5]], [6, 13]),
('side by side #1', [[0, 0, 3, 4], [4, 1, 2, 5]], [3, 2]),
('stacked reversed order #1', [[2, 5, 3, 2], [1, 0, 4, 4]], [3, 4]),
('control #1', [[2, 9, 3, 5], [5, 15, 1, 5]], None),
('control #2', [[7, 2, 3, 3], [8, 5, 2, 6]], None)],
[('fault site span requirement #1', [[4, 7, 3, 6], [1, 6, 2, 1]], None),
('fault site span requirement #2', [[12, 13, 3, 1], [6, 9, 5, 4]], None),
('partial repair boundary #1', [[7, 4, 4, 3], [2, 5, 4, 1]], [6, 5]),
('partial repair boundary #2', [[15, 9, 6, 6], [10, 5, 4, 5]], [14, 9]),
('rooms touching without wall #1', [[0, 0, 3, 3], [3, 0, 3, 3]], None),
('side by side #1', [[0, 0, 3, 4], [4, 1, 2, 5]], [3, 2]),
('control #1', [[0, 7, 4, 1], [15, 3, 4, 5]], None),
('control #2', [[10, 0, 2, 6], [14, -1, 1, 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fault site span requirement #1 | None | None | Passed |
| fault site span requirement #2 | None | None | Passed |
| partial repair boundary #1 | [5, 10] | [5, 10] | Passed |
| partial repair boundary #2 | [10, 7] | [10, 7] | Passed |
| side by side #1 | [3, 2] | [3, 2] | 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 / a0b5b75f667fd629d033baf7c333237a2a448fcff66a8db9b45a21fa698056a3
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.814614+00:00.
Case digest / 5eb187e60596e3159f4199a6c6541e698d597372f7c209c3dfcc49c59571aa3a