FAILURE MAP
← Case archive

FA-86361 / Procedural level generation constraints / Open access

Room placement with padding: Rejected rooms still block space · case 01

A rejected candidate prevents later valid rooms from being placed.

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

ROOT CAUSE

Every candidate that reaches the overlap stage is recorded as an obstacle, even rejected ones.

VERIFIED REPAIR

Restore `if ok: placed.append((x, y, w, h)) out.append(i)` at the accepted set bookkeeping step.

Unsuccessful approach: Keeping only the last accepted room lets new rooms overlap older ones.

Case contract

Candidates [x, y, w, h] are tried in order. A room needs w >= 3 and h >= 3, must stay inside a one-tile border (x >= 1, y >= 1, x+w <= width-1, y+h <= height-1) and must keep at least pad empty tiles to every accepted room on both axes (rooms conflict when their pad-expanded extents overlap). Returns indices of accepted candidates.

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(width, height, candidates, pad):
    placed = []
    out = []
    for i, (x, y, w, h) in enumerate(candidates):
        if w < 3 or h < 3:
            continue
        if x < 1 or y < 1 or x + w > width - 1 or y + h > height - 1:
            continue
        ok = True
        for px, py, pw, ph in placed:
            if x < px + pw + pad and px < x + w + pad and y < py + ph + pad and py < y + h + pad:
                ok = False
                break
        placed.append((x, y, w, h))
        if ok:
            out.append(i)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('fault site accepted set bookkeeping #1',
   [25,
    23,
    [[5, 9, 3, 6],
     [8, 10, 5, 6],
     [9, 14, 5, 4],
     [-1, 1, 3, 6],
     [-1, 14, 2, 3],
     [17, 18, 4, 2],
     [4, 20, 3, 4]],
    1],
   [0, 2]),
  ('fault site accepted set bookkeeping #2',
   [29,
    11,
    [[19, 6, 4, 6],
     [9, 5, 3, 4],
     [1, 1, 3, 2],
     [5, 4, 5, 6],
     [14, 0, 8, 3],
     [1, 8, 5, 6],
     [5, 5, 3, 3],
     [7, 2, 2, 3]],
    1],
   [1, 6]),
  ('partial repair boundary #1',
   [11, 28, [[1, 8, 8, 4], [5, 14, 3, 3], [1, 4, 5, 3], [7, 23, 2, 2], [-1, 11, 5, 2]], 2],
   [0, 1]),
  ('partial repair boundary #2',
   [23,
    15,
    [[20, -1, 2, 4],
     [3, 6, 4, 6],
     [10, 5, 8, 6],
     [18, 10, 2, 4],
     [2, 4, 4, 6],
     [2, 13, 3, 4],
     [1, 10, 4, 3],
     [19, 1, 3, 4]],
    0],
   [1, 2, 7]),
  ('touching border tile #1', [10, 10, [[1, 1, 8, 8]], 1], [0]),
  ('rooms exactly pad apart #1', [20, 10, [[1, 1, 4, 4], [6, 1, 4, 4]], 1], [0, 1]),
  ('thin corridor room #1', [20, 20, [[2, 2, 2, 9], [2, 2, 5, 5]], 0], [1]),
  ('control #1',
   [13,
    21,
    [[9, 8, 5, 3], [11, 14, 8, 3], [7, 15, 3, 2], [-1, 10, 8, 6], [0, 3, 3, 3], [10, 0, 5, 6], [8, 13, 2, 4]],
    2],
   [])],
 [('regression accepted set bookkeeping #1',
   [28,
    27,
    [[15, 2, 4, 6],
     [17, 17, 3, 3],
     [0, 24, 4, 2],
     [12, 1, 4, 4],
     [19, 7, 2, 3],
     [10, 6, 8, 6],
     [9, 4, 5, 4],
     [1, 8, 3, 6]],
    1],
   [0, 1, 6, 7]),
  ('fault site accepted set bookkeeping #1',
   [16,
    27,
    [[9, 19, 8, 6],
     [0, 23, 3, 3],
     [9, 16, 2, 4],
     [8, 4, 5, 4],
     [2, 1, 8, 6],
     [6, 19, 4, 6],
     [13, 10, 8, 2],
     [4, 1, 3, 6]],
    0],
   [3, 5, 7]),
  ('partial repair boundary #1',
   [28,
    10,
    [[1, 8, 5, 4],
     [18, 5, 5, 6],
     [22, 3, 3, 4],
     [19, 2, 4, 2],
     [3, 1, 5, 4],
     [16, 3, 4, 6],
     [16, 0, 4, 2],
     [1, 2, 3, 6]],
    1],
   [2, 4, 5]),
  ('partial repair boundary #2',
   [26,
    20,
    [[4, 11, 5, 4],
     [2, 5, 8, 3],
     [2, 2, 4, 2],
     [2, 11, 4, 6],
     [24, 14, 4, 2],
     [24, 11, 2, 4],
     [3, 10, 8, 6],
     [1, 9, 2, 6]],
    2],
   [0, 1]),
  ('thin corridor room #1', [20, 20, [[2, 2, 2, 9], [2, 2, 5, 5]], 0], [1]),
  ('touching border tile #1', [10, 10, [[1, 1, 8, 8]], 1], [0]),
  ('control #1',
   [13,
    21,
    [[9, 8, 5, 3], [11, 14, 8, 3], [7, 15, 3, 2], [-1, 10, 8, 6], [0, 3, 3, 3], [10, 0, 5, 6], [8, 13, 2, 4]],
    2],
   []),
  ('control #2',
   [30, 11, [[-1, 1, 2, 2], [24, -1, 5, 3], [16, 4, 5, 6], [3, 1, 2, 6], [26, 2, 2, 3], [5, 9, 8, 2]], 0],
   [2])],
 [('fault site accepted set bookkeeping #1',
   [30,
    27,
    [[8, 21, 5, 3],
     [25, 10, 4, 2],
     [23, 24, 8, 4],
     [12, 18, 3, 6],
     [15, 14, 5, 2],
     [4, 17, 8, 3],
     [2, 7, 8, 4]],
    1],
   [0, 5, 6]),
  ('fault site accepted set bookkeeping #2',
   [25,
    23,
    [[5, 9, 3, 6],
     [8, 10, 5, 6],
     [9, 14, 5, 4],
     [-1, 1, 3, 6],
     [-1, 14, 2, 3],
     [17, 18, 4, 2],
     [4, 20, 3, 4]],
    1],
   [0, 2]),
  ('regression accepted set bookkeeping #1',
   [28,
    27,
    [[15, 2, 4, 6],
     [17, 17, 3, 3],
     [0, 24, 4, 2],
     [12, 1, 4, 4],
     [19, 7, 2, 3],
     [10, 6, 8, 6],
     [9, 4, 5, 4],
     [1, 8, 3, 6]],
    1],
   [0, 1, 6, 7]),
  ('partial repair boundary #1',
   [29, 21, [[7, 17, 8, 3], [8, 3, 8, 6], [2, 2, 8, 4], [4, 13, 8, 6], [21, 1, 2, 3]], 1],
   [0, 1]),
  ('rooms exactly pad apart #1', [20, 10, [[1, 1, 4, 4], [6, 1, 4, 4]], 1], [0, 1]),
  ('thin corridor room #1', [20, 20, [[2, 2, 2, 9], [2, 2, 5, 5]], 0], [1]),
  ('control #1',
   [30, 11, [[-1, 1, 2, 2], [24, -1, 5, 3], [16, 4, 5, 6], [3, 1, 2, 6], [26, 2, 2, 3], [5, 9, 8, 2]], 0],
   [2]),
  ('control #2',
   [19, 27, [[6, 2, 3, 2], [4, 23, 5, 4], [4, 20, 2, 3], [12, 4, 8, 2], [10, 14, 8, 6]], 1],
   [4])],
 [('fault site accepted set bookkeeping #1',
   [29,
    11,
    [[19, 6, 4, 6],
     [9, 5, 3, 4],
     [1, 1, 3, 2],
     [5, 4, 5, 6],
     [14, 0, 8, 3],
     [1, 8, 5, 6],
     [5, 5, 3, 3],
     [7, 2, 2, 3]],
    1],
   [1, 6]),
  ('regression accepted set bookkeeping #1',
   [28,
    27,
    [[15, 2, 4, 6],
     [17, 17, 3, 3],
     [0, 24, 4, 2],
     [12, 1, 4, 4],
     [19, 7, 2, 3],
     [10, 6, 8, 6],
     [9, 4, 5, 4],
     [1, 8, 3, 6]],
    1],
   [0, 1, 6, 7]),
  ('partial repair boundary #1',
   [29, 29, [[23, 24, 4, 2], [27, 5, 2, 2], [3, 5, 3, 3], [24, 5, 3, 3], [26, 22, 2, 6], [1, 3, 5, 3]], 1],
   [2, 3]),
  ('partial repair boundary #2',
   [28,
    21,
    [[18, 4, 3, 6],
     [19, 16, 4, 4],
     [12, -1, 4, 4],
     [2, 16, 8, 4],
     [18, 15, 3, 4],
     [5, 19, 4, 2],
     [1, 1, 5, 3]],
    1],
   [0, 1, 3, 6]),
  ('touching border tile #1', [10, 10, [[1, 1, 8, 8]], 1], [0]),
  ('rooms exactly pad apart #1', [20, 10, [[1, 1, 4, 4], [6, 1, 4, 4]], 1], [0, 1]),
  ('control #1', [15, 13, [[6, 11, 5, 6], [-1, 3, 2, 4]], 1], []),
  ('control #2', [9, 21, [[1, 11, 2, 4], [1, 3, 5, 2], [3, 3, 8, 6], [-1, 5, 4, 3]], 1], [])],
 [('fault site accepted set bookkeeping #1',
   [16,
    27,
    [[9, 19, 8, 6],
     [0, 23, 3, 3],
     [9, 16, 2, 4],
     [8, 4, 5, 4],
     [2, 1, 8, 6],
     [6, 19, 4, 6],
     [13, 10, 8, 2],
     [4, 1, 3, 6]],
    0],
   [3, 5, 7]),
  ('fault site accepted set bookkeeping #2',
   [30,
    27,
    [[8, 21, 5, 3],
     [25, 10, 4, 2],
     [23, 24, 8, 4],
     [12, 18, 3, 6],
     [15, 14, 5, 2],
     [4, 17, 8, 3],
     [2, 7, 8, 4]],
    1],
   [0, 5, 6]),
  ('partial repair boundary #1',
   [20,
    22,
    [[0, 11, 8, 3],
     [12, 9, 2, 4],
     [9, 1, 5, 4],
     [5, 8, 4, 6],
     [1, 17, 8, 4],
     [3, 4, 3, 4],
     [5, 14, 3, 2],
     [5, 17, 2, 4]],
    1],
   [2, 3, 4]),
  ('partial repair boundary #2',
   [22,
    20,
    [[12, 9, 8, 2],
     [20, 18, 8, 4],
     [3, 15, 8, 4],
     [16, 7, 5, 6],
     [2, 13, 4, 4],
     [8, 16, 2, 3],
     [3, 16, 8, 4]],
    2],
   [2, 3]),
  ('thin corridor room #1', [20, 20, [[2, 2, 2, 9], [2, 2, 5, 5]], 0], [1]),
  ('touching border tile #1', [10, 10, [[1, 1, 8, 8]], 1], [0]),
  ('control #1',
   [27,
    21,
    [[17, 14, 4, 3],
     [16, 17, 4, 3],
     [23, -1, 5, 3],
     [21, -1, 4, 4],
     [19, 6, 8, 6],
     [7, 11, 3, 3],
     [3, 2, 5, 2],
     [4, -1, 5, 3]],
    0],
   [0, 1, 5]),
  ('control #2', [26, 13, [[7, 10, 8, 4], [22, -1, 3, 6], [3, 3, 4, 6], [17, 0, 8, 2]], 1], [2])]]
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
fault site accepted set bookkeeping #1[0][0, 2]Failed
fault site accepted set bookkeeping #2[1][1, 6]Failed
partial repair boundary #1[0, 1][0, 1]Passed
partial repair boundary #2[1, 2, 7][1, 2, 7]Passed
touching border tile #1[0][0]Passed
rooms exactly pad apart #1[0, 1][0, 1]Passed
thin corridor room #1[1][1]Passed
control #1[][]Passed

SHA-256 / 7831c0e99a771cdded859c06793a9ba3d4ed7a7f937dc04a62d80cbef75b0aa6

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(width, height, candidates, pad):
    placed = []
    out = []
    for i, (x, y, w, h) in enumerate(candidates):
        if w < 3 or h < 3:
            continue
        if x < 1 or y < 1 or x + w > width - 1 or y + h > height - 1:
            continue
        ok = True
        for px, py, pw, ph in placed:
            if x < px + pw + pad and px < x + w + pad and y < py + ph + pad and py < y + h + pad:
                ok = False
                break
        if ok:
            placed = [(x, y, w, h)]
            out.append(i)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('fault site accepted set bookkeeping #1',
   [25,
    23,
    [[5, 9, 3, 6],
     [8, 10, 5, 6],
     [9, 14, 5, 4],
     [-1, 1, 3, 6],
     [-1, 14, 2, 3],
     [17, 18, 4, 2],
     [4, 20, 3, 4]],
    1],
   [0, 2]),
  ('fault site accepted set bookkeeping #2',
   [29,
    11,
    [[19, 6, 4, 6],
     [9, 5, 3, 4],
     [1, 1, 3, 2],
     [5, 4, 5, 6],
     [14, 0, 8, 3],
     [1, 8, 5, 6],
     [5, 5, 3, 3],
     [7, 2, 2, 3]],
    1],
   [1, 6]),
  ('partial repair boundary #1',
   [11, 28, [[1, 8, 8, 4], [5, 14, 3, 3], [1, 4, 5, 3], [7, 23, 2, 2], [-1, 11, 5, 2]], 2],
   [0, 1]),
  ('partial repair boundary #2',
   [23,
    15,
    [[20, -1, 2, 4],
     [3, 6, 4, 6],
     [10, 5, 8, 6],
     [18, 10, 2, 4],
     [2, 4, 4, 6],
     [2, 13, 3, 4],
     [1, 10, 4, 3],
     [19, 1, 3, 4]],
    0],
   [1, 2, 7]),
  ('touching border tile #1', [10, 10, [[1, 1, 8, 8]], 1], [0]),
  ('rooms exactly pad apart #1', [20, 10, [[1, 1, 4, 4], [6, 1, 4, 4]], 1], [0, 1]),
  ('thin corridor room #1', [20, 20, [[2, 2, 2, 9], [2, 2, 5, 5]], 0], [1]),
  ('control #1',
   [13,
    21,
    [[9, 8, 5, 3], [11, 14, 8, 3], [7, 15, 3, 2], [-1, 10, 8, 6], [0, 3, 3, 3], [10, 0, 5, 6], [8, 13, 2, 4]],
    2],
   [])],
 [('regression accepted set bookkeeping #1',
   [28,
    27,
    [[15, 2, 4, 6],
     [17, 17, 3, 3],
     [0, 24, 4, 2],
     [12, 1, 4, 4],
     [19, 7, 2, 3],
     [10, 6, 8, 6],
     [9, 4, 5, 4],
     [1, 8, 3, 6]],
    1],
   [0, 1, 6, 7]),
  ('fault site accepted set bookkeeping #1',
   [16,
    27,
    [[9, 19, 8, 6],
     [0, 23, 3, 3],
     [9, 16, 2, 4],
     [8, 4, 5, 4],
     [2, 1, 8, 6],
     [6, 19, 4, 6],
     [13, 10, 8, 2],
     [4, 1, 3, 6]],
    0],
   [3, 5, 7]),
  ('partial repair boundary #1',
   [28,
    10,
    [[1, 8, 5, 4],
     [18, 5, 5, 6],
     [22, 3, 3, 4],
     [19, 2, 4, 2],
     [3, 1, 5, 4],
     [16, 3, 4, 6],
     [16, 0, 4, 2],
     [1, 2, 3, 6]],
    1],
   [2, 4, 5]),
  ('partial repair boundary #2',
   [26,
    20,
    [[4, 11, 5, 4],
     [2, 5, 8, 3],
     [2, 2, 4, 2],
     [2, 11, 4, 6],
     [24, 14, 4, 2],
     [24, 11, 2, 4],
     [3, 10, 8, 6],
     [1, 9, 2, 6]],
    2],
   [0, 1]),
  ('thin corridor room #1', [20, 20, [[2, 2, 2, 9], [2, 2, 5, 5]], 0], [1]),
  ('touching border tile #1', [10, 10, [[1, 1, 8, 8]], 1], [0]),
  ('control #1',
   [13,
    21,
    [[9, 8, 5, 3], [11, 14, 8, 3], [7, 15, 3, 2], [-1, 10, 8, 6], [0, 3, 3, 3], [10, 0, 5, 6], [8, 13, 2, 4]],
    2],
   []),
  ('control #2',
   [30, 11, [[-1, 1, 2, 2], [24, -1, 5, 3], [16, 4, 5, 6], [3, 1, 2, 6], [26, 2, 2, 3], [5, 9, 8, 2]], 0],
   [2])],
 [('fault site accepted set bookkeeping #1',
   [30,
    27,
    [[8, 21, 5, 3],
     [25, 10, 4, 2],
     [23, 24, 8, 4],
     [12, 18, 3, 6],
     [15, 14, 5, 2],
     [4, 17, 8, 3],
     [2, 7, 8, 4]],
    1],
   [0, 5, 6]),
  ('fault site accepted set bookkeeping #2',
   [25,
    23,
    [[5, 9, 3, 6],
     [8, 10, 5, 6],
     [9, 14, 5, 4],
     [-1, 1, 3, 6],
     [-1, 14, 2, 3],
     [17, 18, 4, 2],
     [4, 20, 3, 4]],
    1],
   [0, 2]),
  ('regression accepted set bookkeeping #1',
   [28,
    27,
    [[15, 2, 4, 6],
     [17, 17, 3, 3],
     [0, 24, 4, 2],
     [12, 1, 4, 4],
     [19, 7, 2, 3],
     [10, 6, 8, 6],
     [9, 4, 5, 4],
     [1, 8, 3, 6]],
    1],
   [0, 1, 6, 7]),
  ('partial repair boundary #1',
   [29, 21, [[7, 17, 8, 3], [8, 3, 8, 6], [2, 2, 8, 4], [4, 13, 8, 6], [21, 1, 2, 3]], 1],
   [0, 1]),
  ('rooms exactly pad apart #1', [20, 10, [[1, 1, 4, 4], [6, 1, 4, 4]], 1], [0, 1]),
  ('thin corridor room #1', [20, 20, [[2, 2, 2, 9], [2, 2, 5, 5]], 0], [1]),
  ('control #1',
   [30, 11, [[-1, 1, 2, 2], [24, -1, 5, 3], [16, 4, 5, 6], [3, 1, 2, 6], [26, 2, 2, 3], [5, 9, 8, 2]], 0],
   [2]),
  ('control #2',
   [19, 27, [[6, 2, 3, 2], [4, 23, 5, 4], [4, 20, 2, 3], [12, 4, 8, 2], [10, 14, 8, 6]], 1],
   [4])],
 [('fault site accepted set bookkeeping #1',
   [29,
    11,
    [[19, 6, 4, 6],
     [9, 5, 3, 4],
     [1, 1, 3, 2],
     [5, 4, 5, 6],
     [14, 0, 8, 3],
     [1, 8, 5, 6],
     [5, 5, 3, 3],
     [7, 2, 2, 3]],
    1],
   [1, 6]),
  ('regression accepted set bookkeeping #1',
   [28,
    27,
    [[15, 2, 4, 6],
     [17, 17, 3, 3],
     [0, 24, 4, 2],
     [12, 1, 4, 4],
     [19, 7, 2, 3],
     [10, 6, 8, 6],
     [9, 4, 5, 4],
     [1, 8, 3, 6]],
    1],
   [0, 1, 6, 7]),
  ('partial repair boundary #1',
   [29, 29, [[23, 24, 4, 2], [27, 5, 2, 2], [3, 5, 3, 3], [24, 5, 3, 3], [26, 22, 2, 6], [1, 3, 5, 3]], 1],
   [2, 3]),
  ('partial repair boundary #2',
   [28,
    21,
    [[18, 4, 3, 6],
     [19, 16, 4, 4],
     [12, -1, 4, 4],
     [2, 16, 8, 4],
     [18, 15, 3, 4],
     [5, 19, 4, 2],
     [1, 1, 5, 3]],
    1],
   [0, 1, 3, 6]),
  ('touching border tile #1', [10, 10, [[1, 1, 8, 8]], 1], [0]),
  ('rooms exactly pad apart #1', [20, 10, [[1, 1, 4, 4], [6, 1, 4, 4]], 1], [0, 1]),
  ('control #1', [15, 13, [[6, 11, 5, 6], [-1, 3, 2, 4]], 1], []),
  ('control #2', [9, 21, [[1, 11, 2, 4], [1, 3, 5, 2], [3, 3, 8, 6], [-1, 5, 4, 3]], 1], [])],
 [('fault site accepted set bookkeeping #1',
   [16,
    27,
    [[9, 19, 8, 6],
     [0, 23, 3, 3],
     [9, 16, 2, 4],
     [8, 4, 5, 4],
     [2, 1, 8, 6],
     [6, 19, 4, 6],
     [13, 10, 8, 2],
     [4, 1, 3, 6]],
    0],
   [3, 5, 7]),
  ('fault site accepted set bookkeeping #2',
   [30,
    27,
    [[8, 21, 5, 3],
     [25, 10, 4, 2],
     [23, 24, 8, 4],
     [12, 18, 3, 6],
     [15, 14, 5, 2],
     [4, 17, 8, 3],
     [2, 7, 8, 4]],
    1],
   [0, 5, 6]),
  ('partial repair boundary #1',
   [20,
    22,
    [[0, 11, 8, 3],
     [12, 9, 2, 4],
     [9, 1, 5, 4],
     [5, 8, 4, 6],
     [1, 17, 8, 4],
     [3, 4, 3, 4],
     [5, 14, 3, 2],
     [5, 17, 2, 4]],
    1],
   [2, 3, 4]),
  ('partial repair boundary #2',
   [22,
    20,
    [[12, 9, 8, 2],
     [20, 18, 8, 4],
     [3, 15, 8, 4],
     [16, 7, 5, 6],
     [2, 13, 4, 4],
     [8, 16, 2, 3],
     [3, 16, 8, 4]],
    2],
   [2, 3]),
  ('thin corridor room #1', [20, 20, [[2, 2, 2, 9], [2, 2, 5, 5]], 0], [1]),
  ('touching border tile #1', [10, 10, [[1, 1, 8, 8]], 1], [0]),
  ('control #1',
   [27,
    21,
    [[17, 14, 4, 3],
     [16, 17, 4, 3],
     [23, -1, 5, 3],
     [21, -1, 4, 4],
     [19, 6, 8, 6],
     [7, 11, 3, 3],
     [3, 2, 5, 2],
     [4, -1, 5, 3]],
    0],
   [0, 1, 5]),
  ('control #2', [26, 13, [[7, 10, 8, 4], [22, -1, 3, 6], [3, 3, 4, 6], [17, 0, 8, 2]], 1], [2])]]
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
fault site accepted set bookkeeping #1[0, 2][0, 2]Passed
fault site accepted set bookkeeping #2[1, 6][1, 6]Passed
partial repair boundary #1[0, 1, 2][0, 1]Failed
partial repair boundary #2[1, 2, 4, 6, 7][1, 2, 7]Failed
touching border tile #1[0][0]Passed
rooms exactly pad apart #1[0, 1][0, 1]Passed
thin corridor room #1[1][1]Passed
control #1[][]Passed

SHA-256 / b8d2249a8747637890e15bdd6c52428ca6977bab85f388a5903cbebd177c1109

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(width, height, candidates, pad):
    placed = []
    out = []
    for i, (x, y, w, h) in enumerate(candidates):
        if w < 3 or h < 3:
            continue
        if x < 1 or y < 1 or x + w > width - 1 or y + h > height - 1:
            continue
        ok = True
        for px, py, pw, ph in placed:
            if x < px + pw + pad and px < x + w + pad and y < py + ph + pad and py < y + h + pad:
                ok = False
                break
        if ok:
            placed.append((x, y, w, h))
            out.append(i)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('fault site accepted set bookkeeping #1',
   [25,
    23,
    [[5, 9, 3, 6],
     [8, 10, 5, 6],
     [9, 14, 5, 4],
     [-1, 1, 3, 6],
     [-1, 14, 2, 3],
     [17, 18, 4, 2],
     [4, 20, 3, 4]],
    1],
   [0, 2]),
  ('fault site accepted set bookkeeping #2',
   [29,
    11,
    [[19, 6, 4, 6],
     [9, 5, 3, 4],
     [1, 1, 3, 2],
     [5, 4, 5, 6],
     [14, 0, 8, 3],
     [1, 8, 5, 6],
     [5, 5, 3, 3],
     [7, 2, 2, 3]],
    1],
   [1, 6]),
  ('partial repair boundary #1',
   [11, 28, [[1, 8, 8, 4], [5, 14, 3, 3], [1, 4, 5, 3], [7, 23, 2, 2], [-1, 11, 5, 2]], 2],
   [0, 1]),
  ('partial repair boundary #2',
   [23,
    15,
    [[20, -1, 2, 4],
     [3, 6, 4, 6],
     [10, 5, 8, 6],
     [18, 10, 2, 4],
     [2, 4, 4, 6],
     [2, 13, 3, 4],
     [1, 10, 4, 3],
     [19, 1, 3, 4]],
    0],
   [1, 2, 7]),
  ('touching border tile #1', [10, 10, [[1, 1, 8, 8]], 1], [0]),
  ('rooms exactly pad apart #1', [20, 10, [[1, 1, 4, 4], [6, 1, 4, 4]], 1], [0, 1]),
  ('thin corridor room #1', [20, 20, [[2, 2, 2, 9], [2, 2, 5, 5]], 0], [1]),
  ('control #1',
   [13,
    21,
    [[9, 8, 5, 3], [11, 14, 8, 3], [7, 15, 3, 2], [-1, 10, 8, 6], [0, 3, 3, 3], [10, 0, 5, 6], [8, 13, 2, 4]],
    2],
   [])],
 [('regression accepted set bookkeeping #1',
   [28,
    27,
    [[15, 2, 4, 6],
     [17, 17, 3, 3],
     [0, 24, 4, 2],
     [12, 1, 4, 4],
     [19, 7, 2, 3],
     [10, 6, 8, 6],
     [9, 4, 5, 4],
     [1, 8, 3, 6]],
    1],
   [0, 1, 6, 7]),
  ('fault site accepted set bookkeeping #1',
   [16,
    27,
    [[9, 19, 8, 6],
     [0, 23, 3, 3],
     [9, 16, 2, 4],
     [8, 4, 5, 4],
     [2, 1, 8, 6],
     [6, 19, 4, 6],
     [13, 10, 8, 2],
     [4, 1, 3, 6]],
    0],
   [3, 5, 7]),
  ('partial repair boundary #1',
   [28,
    10,
    [[1, 8, 5, 4],
     [18, 5, 5, 6],
     [22, 3, 3, 4],
     [19, 2, 4, 2],
     [3, 1, 5, 4],
     [16, 3, 4, 6],
     [16, 0, 4, 2],
     [1, 2, 3, 6]],
    1],
   [2, 4, 5]),
  ('partial repair boundary #2',
   [26,
    20,
    [[4, 11, 5, 4],
     [2, 5, 8, 3],
     [2, 2, 4, 2],
     [2, 11, 4, 6],
     [24, 14, 4, 2],
     [24, 11, 2, 4],
     [3, 10, 8, 6],
     [1, 9, 2, 6]],
    2],
   [0, 1]),
  ('thin corridor room #1', [20, 20, [[2, 2, 2, 9], [2, 2, 5, 5]], 0], [1]),
  ('touching border tile #1', [10, 10, [[1, 1, 8, 8]], 1], [0]),
  ('control #1',
   [13,
    21,
    [[9, 8, 5, 3], [11, 14, 8, 3], [7, 15, 3, 2], [-1, 10, 8, 6], [0, 3, 3, 3], [10, 0, 5, 6], [8, 13, 2, 4]],
    2],
   []),
  ('control #2',
   [30, 11, [[-1, 1, 2, 2], [24, -1, 5, 3], [16, 4, 5, 6], [3, 1, 2, 6], [26, 2, 2, 3], [5, 9, 8, 2]], 0],
   [2])],
 [('fault site accepted set bookkeeping #1',
   [30,
    27,
    [[8, 21, 5, 3],
     [25, 10, 4, 2],
     [23, 24, 8, 4],
     [12, 18, 3, 6],
     [15, 14, 5, 2],
     [4, 17, 8, 3],
     [2, 7, 8, 4]],
    1],
   [0, 5, 6]),
  ('fault site accepted set bookkeeping #2',
   [25,
    23,
    [[5, 9, 3, 6],
     [8, 10, 5, 6],
     [9, 14, 5, 4],
     [-1, 1, 3, 6],
     [-1, 14, 2, 3],
     [17, 18, 4, 2],
     [4, 20, 3, 4]],
    1],
   [0, 2]),
  ('regression accepted set bookkeeping #1',
   [28,
    27,
    [[15, 2, 4, 6],
     [17, 17, 3, 3],
     [0, 24, 4, 2],
     [12, 1, 4, 4],
     [19, 7, 2, 3],
     [10, 6, 8, 6],
     [9, 4, 5, 4],
     [1, 8, 3, 6]],
    1],
   [0, 1, 6, 7]),
  ('partial repair boundary #1',
   [29, 21, [[7, 17, 8, 3], [8, 3, 8, 6], [2, 2, 8, 4], [4, 13, 8, 6], [21, 1, 2, 3]], 1],
   [0, 1]),
  ('rooms exactly pad apart #1', [20, 10, [[1, 1, 4, 4], [6, 1, 4, 4]], 1], [0, 1]),
  ('thin corridor room #1', [20, 20, [[2, 2, 2, 9], [2, 2, 5, 5]], 0], [1]),
  ('control #1',
   [30, 11, [[-1, 1, 2, 2], [24, -1, 5, 3], [16, 4, 5, 6], [3, 1, 2, 6], [26, 2, 2, 3], [5, 9, 8, 2]], 0],
   [2]),
  ('control #2',
   [19, 27, [[6, 2, 3, 2], [4, 23, 5, 4], [4, 20, 2, 3], [12, 4, 8, 2], [10, 14, 8, 6]], 1],
   [4])],
 [('fault site accepted set bookkeeping #1',
   [29,
    11,
    [[19, 6, 4, 6],
     [9, 5, 3, 4],
     [1, 1, 3, 2],
     [5, 4, 5, 6],
     [14, 0, 8, 3],
     [1, 8, 5, 6],
     [5, 5, 3, 3],
     [7, 2, 2, 3]],
    1],
   [1, 6]),
  ('regression accepted set bookkeeping #1',
   [28,
    27,
    [[15, 2, 4, 6],
     [17, 17, 3, 3],
     [0, 24, 4, 2],
     [12, 1, 4, 4],
     [19, 7, 2, 3],
     [10, 6, 8, 6],
     [9, 4, 5, 4],
     [1, 8, 3, 6]],
    1],
   [0, 1, 6, 7]),
  ('partial repair boundary #1',
   [29, 29, [[23, 24, 4, 2], [27, 5, 2, 2], [3, 5, 3, 3], [24, 5, 3, 3], [26, 22, 2, 6], [1, 3, 5, 3]], 1],
   [2, 3]),
  ('partial repair boundary #2',
   [28,
    21,
    [[18, 4, 3, 6],
     [19, 16, 4, 4],
     [12, -1, 4, 4],
     [2, 16, 8, 4],
     [18, 15, 3, 4],
     [5, 19, 4, 2],
     [1, 1, 5, 3]],
    1],
   [0, 1, 3, 6]),
  ('touching border tile #1', [10, 10, [[1, 1, 8, 8]], 1], [0]),
  ('rooms exactly pad apart #1', [20, 10, [[1, 1, 4, 4], [6, 1, 4, 4]], 1], [0, 1]),
  ('control #1', [15, 13, [[6, 11, 5, 6], [-1, 3, 2, 4]], 1], []),
  ('control #2', [9, 21, [[1, 11, 2, 4], [1, 3, 5, 2], [3, 3, 8, 6], [-1, 5, 4, 3]], 1], [])],
 [('fault site accepted set bookkeeping #1',
   [16,
    27,
    [[9, 19, 8, 6],
     [0, 23, 3, 3],
     [9, 16, 2, 4],
     [8, 4, 5, 4],
     [2, 1, 8, 6],
     [6, 19, 4, 6],
     [13, 10, 8, 2],
     [4, 1, 3, 6]],
    0],
   [3, 5, 7]),
  ('fault site accepted set bookkeeping #2',
   [30,
    27,
    [[8, 21, 5, 3],
     [25, 10, 4, 2],
     [23, 24, 8, 4],
     [12, 18, 3, 6],
     [15, 14, 5, 2],
     [4, 17, 8, 3],
     [2, 7, 8, 4]],
    1],
   [0, 5, 6]),
  ('partial repair boundary #1',
   [20,
    22,
    [[0, 11, 8, 3],
     [12, 9, 2, 4],
     [9, 1, 5, 4],
     [5, 8, 4, 6],
     [1, 17, 8, 4],
     [3, 4, 3, 4],
     [5, 14, 3, 2],
     [5, 17, 2, 4]],
    1],
   [2, 3, 4]),
  ('partial repair boundary #2',
   [22,
    20,
    [[12, 9, 8, 2],
     [20, 18, 8, 4],
     [3, 15, 8, 4],
     [16, 7, 5, 6],
     [2, 13, 4, 4],
     [8, 16, 2, 3],
     [3, 16, 8, 4]],
    2],
   [2, 3]),
  ('thin corridor room #1', [20, 20, [[2, 2, 2, 9], [2, 2, 5, 5]], 0], [1]),
  ('touching border tile #1', [10, 10, [[1, 1, 8, 8]], 1], [0]),
  ('control #1',
   [27,
    21,
    [[17, 14, 4, 3],
     [16, 17, 4, 3],
     [23, -1, 5, 3],
     [21, -1, 4, 4],
     [19, 6, 8, 6],
     [7, 11, 3, 3],
     [3, 2, 5, 2],
     [4, -1, 5, 3]],
    0],
   [0, 1, 5]),
  ('control #2', [26, 13, [[7, 10, 8, 4], [22, -1, 3, 6], [3, 3, 4, 6], [17, 0, 8, 2]], 1], [2])]]
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
fault site accepted set bookkeeping #1[0, 2][0, 2]Passed
fault site accepted set bookkeeping #2[1, 6][1, 6]Passed
partial repair boundary #1[0, 1][0, 1]Passed
partial repair boundary #2[1, 2, 7][1, 2, 7]Passed
touching border tile #1[0][0]Passed
rooms exactly pad apart #1[0, 1][0, 1]Passed
thin corridor room #1[1][1]Passed
control #1[][]Passed

SHA-256 / 22c603596dd289edb1c3d10dd714c8ee35c384135501762c27cec5fb06373121

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

Case digest / c3d558374a948b9d84f90b74102a03d284e006a90c29c2adcf71c61bd11c7f22