FAILURE MAP
← Case archive

FA-86811 / Procedural level generation constraints / Open access

Door placement between rooms: Rooms listed right-to-left get no door · case 01

Connectivity depends on the order rooms were generated.

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

ROOT CAUSE

Only the a-then-b orientation is tested.

VERIFIED REPAIR

Restore `return door(a, b) or door(b, a)` at the room order step.

Unsuccessful approach: Choosing orientation by x misses stacked rooms listed bottom first.

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, 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)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('stacked reversed order #1', [[2, 5, 3, 2], [1, 0, 4, 4]], [3, 4]),
  ('fault site room order #1', [[13, 5, 1, 2], [6, 2, 6, 6]], [12, 5]),
  ('fault site room order #2', [[11, 7, 6, 3], [7, 7, 3, 1]], [10, 7]),
  ('regression room order #1', [[5, 5, 2, 5], [5, 1, 6, 3]], [5, 4]),
  ('regression room order #2', [[7, 11, 4, 3], [7, 4, 5, 6]], [8, 10]),
  ('side by side #1', [[0, 0, 3, 4], [4, 1, 2, 5]], [3, 2]),
  ('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)],
 [('stacked reversed order #1', [[2, 5, 3, 2], [1, 0, 4, 4]], [3, 4]),
  ('fault site room order #1', [[11, 7, 6, 3], [7, 7, 3, 1]], [10, 7]),
  ('regression room order #1', [[5, 5, 2, 5], [5, 1, 6, 3]], [5, 4]),
  ('regression room order #2', [[9, 5, 4, 3], [9, 3, 5, 1]], [10, 4]),
  ('partial repair boundary #1', [[9, 6, 4, 6], [8, 13, 6, 4]], [10, 12]),
  ('side by side #1', [[0, 0, 3, 4], [4, 1, 2, 5]], [3, 2]),
  ('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)],
 [('stacked reversed order #1', [[2, 5, 3, 2], [1, 0, 4, 4]], [3, 4]),
  ('fault site room order #1', [[11, 6, 5, 4], [6, 6, 4, 3]], [10, 7]),
  ('fault site room order #2', [[10, 11, 6, 4], [7, 7, 6, 3]], [11, 10]),
  ('partial repair boundary #1', [[4, 10, 5, 6], [3, 17, 5, 1]], [5, 16]),
  ('regression room order #1', [[4, 12, 6, 5], [9, 9, 4, 2]], [9, 11]),
  ('side by side #1', [[0, 0, 3, 4], [4, 1, 2, 5]], [3, 2]),
  ('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)],
 [('stacked reversed order #1', [[2, 5, 3, 2], [1, 0, 4, 4]], [3, 4]),
  ('regression room order #1', [[7, 11, 4, 3], [7, 4, 5, 6]], [8, 10]),
  ('fault site room order #1', [[7, 6, 5, 5], [3, 0, 6, 5]], [7, 5]),
  ('regression room order #2', [[1, 5, 4, 3], [3, 3, 1, 1]], [3, 4]),
  ('partial repair boundary #1', [[1, 7, 2, 4], [-2, 12, 4, 3]], [1, 11]),
  ('side by side #1', [[0, 0, 3, 4], [4, 1, 2, 5]], [3, 2]),
  ('rooms touching without wall #1', [[0, 0, 3, 3], [3, 0, 3, 3]], None),
  ('control #1', [[3, 10, 2, 1], [6, 6, 6, 5]], [5, 10])],
 [('stacked reversed order #1', [[2, 5, 3, 2], [1, 0, 4, 4]], [3, 4]),
  ('fault site room order #1', [[4, 13, 5, 2], [3, 9, 2, 3]], [4, 12]),
  ('regression room order #1', [[9, 5, 4, 3], [9, 3, 5, 1]], [10, 4]),
  ('partial repair boundary #1', [[10, 4, 4, 5], [9, 10, 4, 4]], [11, 9]),
  ('regression room order #2', [[-4, 12, 5, 4], [0, 6, 1, 5]], [0, 11]),
  ('side by side #1', [[0, 0, 3, 4], [4, 1, 2, 5]], [3, 2]),
  ('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)]]
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
stacked reversed order #1None[3, 4]Failed
fault site room order #1None[12, 5]Failed
fault site room order #2None[10, 7]Failed
regression room order #1None[5, 4]Failed
regression room order #2None[8, 10]Failed
side by side #1[3, 2][3, 2]Passed
rooms touching without wall #1NoneNonePassed
control #1NoneNonePassed

SHA-256 / 697678570f22d0385330229197ecd7b32d9a1b372ba36c554e422e9ef55dce14

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) if a[0] <= b[0] else door(b, a)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('stacked reversed order #1', [[2, 5, 3, 2], [1, 0, 4, 4]], [3, 4]),
  ('fault site room order #1', [[13, 5, 1, 2], [6, 2, 6, 6]], [12, 5]),
  ('fault site room order #2', [[11, 7, 6, 3], [7, 7, 3, 1]], [10, 7]),
  ('regression room order #1', [[5, 5, 2, 5], [5, 1, 6, 3]], [5, 4]),
  ('regression room order #2', [[7, 11, 4, 3], [7, 4, 5, 6]], [8, 10]),
  ('side by side #1', [[0, 0, 3, 4], [4, 1, 2, 5]], [3, 2]),
  ('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)],
 [('stacked reversed order #1', [[2, 5, 3, 2], [1, 0, 4, 4]], [3, 4]),
  ('fault site room order #1', [[11, 7, 6, 3], [7, 7, 3, 1]], [10, 7]),
  ('regression room order #1', [[5, 5, 2, 5], [5, 1, 6, 3]], [5, 4]),
  ('regression room order #2', [[9, 5, 4, 3], [9, 3, 5, 1]], [10, 4]),
  ('partial repair boundary #1', [[9, 6, 4, 6], [8, 13, 6, 4]], [10, 12]),
  ('side by side #1', [[0, 0, 3, 4], [4, 1, 2, 5]], [3, 2]),
  ('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)],
 [('stacked reversed order #1', [[2, 5, 3, 2], [1, 0, 4, 4]], [3, 4]),
  ('fault site room order #1', [[11, 6, 5, 4], [6, 6, 4, 3]], [10, 7]),
  ('fault site room order #2', [[10, 11, 6, 4], [7, 7, 6, 3]], [11, 10]),
  ('partial repair boundary #1', [[4, 10, 5, 6], [3, 17, 5, 1]], [5, 16]),
  ('regression room order #1', [[4, 12, 6, 5], [9, 9, 4, 2]], [9, 11]),
  ('side by side #1', [[0, 0, 3, 4], [4, 1, 2, 5]], [3, 2]),
  ('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)],
 [('stacked reversed order #1', [[2, 5, 3, 2], [1, 0, 4, 4]], [3, 4]),
  ('regression room order #1', [[7, 11, 4, 3], [7, 4, 5, 6]], [8, 10]),
  ('fault site room order #1', [[7, 6, 5, 5], [3, 0, 6, 5]], [7, 5]),
  ('regression room order #2', [[1, 5, 4, 3], [3, 3, 1, 1]], [3, 4]),
  ('partial repair boundary #1', [[1, 7, 2, 4], [-2, 12, 4, 3]], [1, 11]),
  ('side by side #1', [[0, 0, 3, 4], [4, 1, 2, 5]], [3, 2]),
  ('rooms touching without wall #1', [[0, 0, 3, 3], [3, 0, 3, 3]], None),
  ('control #1', [[3, 10, 2, 1], [6, 6, 6, 5]], [5, 10])],
 [('stacked reversed order #1', [[2, 5, 3, 2], [1, 0, 4, 4]], [3, 4]),
  ('fault site room order #1', [[4, 13, 5, 2], [3, 9, 2, 3]], [4, 12]),
  ('regression room order #1', [[9, 5, 4, 3], [9, 3, 5, 1]], [10, 4]),
  ('partial repair boundary #1', [[10, 4, 4, 5], [9, 10, 4, 4]], [11, 9]),
  ('regression room order #2', [[-4, 12, 5, 4], [0, 6, 1, 5]], [0, 11]),
  ('side by side #1', [[0, 0, 3, 4], [4, 1, 2, 5]], [3, 2]),
  ('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)]]
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
stacked reversed order #1[3, 4][3, 4]Passed
fault site room order #1[12, 5][12, 5]Passed
fault site room order #2[10, 7][10, 7]Passed
regression room order #1None[5, 4]Failed
regression room order #2None[8, 10]Failed
side by side #1[3, 2][3, 2]Passed
rooms touching without wall #1NoneNonePassed
control #1NoneNonePassed

SHA-256 / 1249d9a5ca5963bc34eea67dda112facceaae9d5c51154483e51dee435cb5992

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 = [[('stacked reversed order #1', [[2, 5, 3, 2], [1, 0, 4, 4]], [3, 4]),
  ('fault site room order #1', [[13, 5, 1, 2], [6, 2, 6, 6]], [12, 5]),
  ('fault site room order #2', [[11, 7, 6, 3], [7, 7, 3, 1]], [10, 7]),
  ('regression room order #1', [[5, 5, 2, 5], [5, 1, 6, 3]], [5, 4]),
  ('regression room order #2', [[7, 11, 4, 3], [7, 4, 5, 6]], [8, 10]),
  ('side by side #1', [[0, 0, 3, 4], [4, 1, 2, 5]], [3, 2]),
  ('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)],
 [('stacked reversed order #1', [[2, 5, 3, 2], [1, 0, 4, 4]], [3, 4]),
  ('fault site room order #1', [[11, 7, 6, 3], [7, 7, 3, 1]], [10, 7]),
  ('regression room order #1', [[5, 5, 2, 5], [5, 1, 6, 3]], [5, 4]),
  ('regression room order #2', [[9, 5, 4, 3], [9, 3, 5, 1]], [10, 4]),
  ('partial repair boundary #1', [[9, 6, 4, 6], [8, 13, 6, 4]], [10, 12]),
  ('side by side #1', [[0, 0, 3, 4], [4, 1, 2, 5]], [3, 2]),
  ('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)],
 [('stacked reversed order #1', [[2, 5, 3, 2], [1, 0, 4, 4]], [3, 4]),
  ('fault site room order #1', [[11, 6, 5, 4], [6, 6, 4, 3]], [10, 7]),
  ('fault site room order #2', [[10, 11, 6, 4], [7, 7, 6, 3]], [11, 10]),
  ('partial repair boundary #1', [[4, 10, 5, 6], [3, 17, 5, 1]], [5, 16]),
  ('regression room order #1', [[4, 12, 6, 5], [9, 9, 4, 2]], [9, 11]),
  ('side by side #1', [[0, 0, 3, 4], [4, 1, 2, 5]], [3, 2]),
  ('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)],
 [('stacked reversed order #1', [[2, 5, 3, 2], [1, 0, 4, 4]], [3, 4]),
  ('regression room order #1', [[7, 11, 4, 3], [7, 4, 5, 6]], [8, 10]),
  ('fault site room order #1', [[7, 6, 5, 5], [3, 0, 6, 5]], [7, 5]),
  ('regression room order #2', [[1, 5, 4, 3], [3, 3, 1, 1]], [3, 4]),
  ('partial repair boundary #1', [[1, 7, 2, 4], [-2, 12, 4, 3]], [1, 11]),
  ('side by side #1', [[0, 0, 3, 4], [4, 1, 2, 5]], [3, 2]),
  ('rooms touching without wall #1', [[0, 0, 3, 3], [3, 0, 3, 3]], None),
  ('control #1', [[3, 10, 2, 1], [6, 6, 6, 5]], [5, 10])],
 [('stacked reversed order #1', [[2, 5, 3, 2], [1, 0, 4, 4]], [3, 4]),
  ('fault site room order #1', [[4, 13, 5, 2], [3, 9, 2, 3]], [4, 12]),
  ('regression room order #1', [[9, 5, 4, 3], [9, 3, 5, 1]], [10, 4]),
  ('partial repair boundary #1', [[10, 4, 4, 5], [9, 10, 4, 4]], [11, 9]),
  ('regression room order #2', [[-4, 12, 5, 4], [0, 6, 1, 5]], [0, 11]),
  ('side by side #1', [[0, 0, 3, 4], [4, 1, 2, 5]], [3, 2]),
  ('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)]]
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
stacked reversed order #1[3, 4][3, 4]Passed
fault site room order #1[12, 5][12, 5]Passed
fault site room order #2[10, 7][10, 7]Passed
regression room order #1[5, 4][5, 4]Passed
regression room order #2[8, 10][8, 10]Passed
side by side #1[3, 2][3, 2]Passed
rooms touching without wall #1NoneNonePassed
control #1NoneNonePassed

SHA-256 / c9aa390707b0e8a0da09e341c9acccdb17289876609a3c21c66d4a4824b74553

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

Case digest / a26691307773df060cc9002a1ca7d3d9f84c36848ec048b6b94a9a4bc285acae