FAILURE MAP
← Case archive

FA-86786 / Procedural level generation constraints / Open access

Door placement between rooms: Doors between rooms with no wall · case 01

Doors are placed between touching rooms and inside the neighbour.

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

ROOT CAUSE

The adjacency test expects no wall column between rooms.

VERIFIED REPAIR

Restore `if px + pw + 1 == qx:` at the wall thickness step.

Unsuccessful approach: Accepting any distance places doors between far-apart rooms.

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

SHA-256 / 1bce38b54c03d7ff5364e50131c880eded04933ec8ae3ea6f0c1c13708956ccc

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

SHA-256 / 8eff930fcd37bd30fbdaf0cacbb18ea41f10ffccad937bca4365df54fcbccf65

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

SHA-256 / 5bc506f0b18bcc5e669e765b09e8d6e203d7f029bf8f3730893fe37279a603e5

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

Case digest / d885cc422fcda9249e661d6e84745265a07e55b0dd6aa19112ca2b23d780b0bb