FA-86346 / Procedural level generation constraints / Open access
Room placement with padding: Rooms overwrite the outer wall · case 01
Rooms touch the map edge, leaving no boundary wall.
ROOT CAUSE
The right bound ignores the reserved border column.
VERIFIED REPAIR
Restore `x + w > width - 1` at the right border step.
Unsuccessful approach: The inclusive comparison also rejects rooms that end right next to the border.
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 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 = [[('touching border tile #1', [10, 10, [[1, 1, 8, 8]], 1], [0]),
('fault site right border #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]),
('regression right border #1',
[16,
30,
[[12, 13, 3, 6],
[11, 9, 5, 3],
[1, 0, 5, 3],
[14, 10, 8, 3],
[13, 19, 8, 4],
[6, 14, 5, 6],
[8, 18, 5, 2]],
1],
[0, 5]),
('partial repair boundary #1',
[19, 27, [[6, 2, 3, 2], [4, 23, 5, 4], [4, 20, 2, 3], [12, 4, 8, 2], [10, 14, 8, 6]], 1],
[4]),
('partial repair boundary #2',
[18, 14, [[11, 10, 3, 2], [16, 1, 2, 4], [11, 10, 5, 2], [4, 10, 5, 3], [9, 4, 8, 3]], 1],
[3, 4]),
('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],
[])],
[('touching border tile #1', [10, 10, [[1, 1, 8, 8]], 1], [0]),
('fault site right border #1',
[10, 8, [[7, 3, 3, 3], [2, 3, 5, 3], [5, 6, 5, 6], [6, 3, 3, 6], [8, 3, 2, 3], [2, -1, 4, 4]], 0],
[1]),
('fault site right border #2', [13, 24, [[9, 5, 4, 4], [4, 0, 3, 2]], 2], []),
('regression right border #1',
[16,
30,
[[12, 13, 3, 6],
[11, 9, 5, 3],
[1, 0, 5, 3],
[14, 10, 8, 3],
[13, 19, 8, 4],
[6, 14, 5, 6],
[8, 18, 5, 2]],
1],
[0, 5]),
('partial repair boundary #1',
[18, 14, [[11, 10, 3, 2], [16, 1, 2, 4], [11, 10, 5, 2], [4, 10, 5, 3], [9, 4, 8, 3]], 1],
[3, 4]),
('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],
[])],
[('touching border tile #1', [10, 10, [[1, 1, 8, 8]], 1], [0]),
('fault site right border #1',
[24, 25, [[12, 19, 2, 4], [3, 10, 5, 6], [19, 19, 5, 3], [13, 6, 2, 6], [6, 23, 8, 2], [10, 14, 3, 3]], 0],
[1, 5]),
('fault site right border #2',
[15,
14,
[[8, 11, 8, 2], [5, 3, 4, 4], [13, 11, 5, 2], [8, 6, 2, 6], [11, 11, 8, 6], [1, -1, 2, 4], [11, 6, 4, 3]],
1],
[1]),
('partial repair boundary #1',
[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]),
('partial repair boundary #2',
[18,
19,
[[7, 11, 4, 2],
[2, 8, 8, 2],
[14, 9, 3, 3],
[8, 8, 5, 2],
[7, 13, 3, 2],
[10, 12, 8, 2],
[14, 5, 8, 4],
[5, 0, 5, 4]],
1],
[2]),
('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],
[])],
[('touching border tile #1', [10, 10, [[1, 1, 8, 8]], 1], [0]),
('regression right border #1',
[9, 15, [[4, 2, 4, 6], [2, 0, 8, 6], [6, 10, 3, 3], [6, -1, 5, 6], [0, 13, 8, 6]], 1],
[0]),
('fault site right border #1', [20, 13, [[14, 4, 8, 6], [17, 5, 3, 6]], 0], []),
('partial repair boundary #1',
[16, 18, [[4, 0, 3, 3], [0, 7, 8, 3], [11, 15, 3, 2], [1, 7, 5, 2], [10, 11, 5, 6]], 1],
[4]),
('partial repair boundary #2',
[10,
27,
[[-1, 13, 2, 4],
[1, 23, 2, 3],
[8, 22, 3, 2],
[7, 8, 4, 6],
[2, 6, 2, 2],
[8, 24, 5, 4],
[6, 21, 8, 6],
[6, 16, 3, 4]],
1],
[7]),
('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])],
[('touching border tile #1', [10, 10, [[1, 1, 8, 8]], 1], [0]),
('fault site right border #1', [20, 11, [[16, 1, 4, 6], [1, -1, 5, 3]], 0], []),
('fault site right border #2', [9, 21, [[1, 1, 8, 4]], 1], []),
('partial repair boundary #1',
[10,
27,
[[-1, 13, 2, 4],
[1, 23, 2, 3],
[8, 22, 3, 2],
[7, 8, 4, 6],
[2, 6, 2, 2],
[8, 24, 5, 4],
[6, 21, 8, 6],
[6, 16, 3, 4]],
1],
[7]),
('partial repair boundary #2', [15, 13, [[6, 2, 8, 3], [10, 5, 8, 6]], 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',
[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])]]
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 |
|---|---|---|---|
| touching border tile #1 | [0] | [0] | Passed |
| fault site right border #1 | [0, 1, 4, 5] | [0, 1, 5] | Failed |
| regression right border #1 | [0, 1, 5] | [0, 5] | Failed |
| partial repair boundary #1 | [4] | [4] | Passed |
| partial repair boundary #2 | [3, 4] | [3, 4] | Passed |
| rooms exactly pad apart #1 | [0, 1] | [0, 1] | Passed |
| thin corridor room #1 | [1] | [1] | Passed |
| control #1 | [] | [] | Passed |
SHA-256 / deba25cbf79cdb7a358d4034027ee739b794731d9b15a8e36712802c08e5e748
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.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 = [[('touching border tile #1', [10, 10, [[1, 1, 8, 8]], 1], [0]),
('fault site right border #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]),
('regression right border #1',
[16,
30,
[[12, 13, 3, 6],
[11, 9, 5, 3],
[1, 0, 5, 3],
[14, 10, 8, 3],
[13, 19, 8, 4],
[6, 14, 5, 6],
[8, 18, 5, 2]],
1],
[0, 5]),
('partial repair boundary #1',
[19, 27, [[6, 2, 3, 2], [4, 23, 5, 4], [4, 20, 2, 3], [12, 4, 8, 2], [10, 14, 8, 6]], 1],
[4]),
('partial repair boundary #2',
[18, 14, [[11, 10, 3, 2], [16, 1, 2, 4], [11, 10, 5, 2], [4, 10, 5, 3], [9, 4, 8, 3]], 1],
[3, 4]),
('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],
[])],
[('touching border tile #1', [10, 10, [[1, 1, 8, 8]], 1], [0]),
('fault site right border #1',
[10, 8, [[7, 3, 3, 3], [2, 3, 5, 3], [5, 6, 5, 6], [6, 3, 3, 6], [8, 3, 2, 3], [2, -1, 4, 4]], 0],
[1]),
('fault site right border #2', [13, 24, [[9, 5, 4, 4], [4, 0, 3, 2]], 2], []),
('regression right border #1',
[16,
30,
[[12, 13, 3, 6],
[11, 9, 5, 3],
[1, 0, 5, 3],
[14, 10, 8, 3],
[13, 19, 8, 4],
[6, 14, 5, 6],
[8, 18, 5, 2]],
1],
[0, 5]),
('partial repair boundary #1',
[18, 14, [[11, 10, 3, 2], [16, 1, 2, 4], [11, 10, 5, 2], [4, 10, 5, 3], [9, 4, 8, 3]], 1],
[3, 4]),
('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],
[])],
[('touching border tile #1', [10, 10, [[1, 1, 8, 8]], 1], [0]),
('fault site right border #1',
[24, 25, [[12, 19, 2, 4], [3, 10, 5, 6], [19, 19, 5, 3], [13, 6, 2, 6], [6, 23, 8, 2], [10, 14, 3, 3]], 0],
[1, 5]),
('fault site right border #2',
[15,
14,
[[8, 11, 8, 2], [5, 3, 4, 4], [13, 11, 5, 2], [8, 6, 2, 6], [11, 11, 8, 6], [1, -1, 2, 4], [11, 6, 4, 3]],
1],
[1]),
('partial repair boundary #1',
[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]),
('partial repair boundary #2',
[18,
19,
[[7, 11, 4, 2],
[2, 8, 8, 2],
[14, 9, 3, 3],
[8, 8, 5, 2],
[7, 13, 3, 2],
[10, 12, 8, 2],
[14, 5, 8, 4],
[5, 0, 5, 4]],
1],
[2]),
('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],
[])],
[('touching border tile #1', [10, 10, [[1, 1, 8, 8]], 1], [0]),
('regression right border #1',
[9, 15, [[4, 2, 4, 6], [2, 0, 8, 6], [6, 10, 3, 3], [6, -1, 5, 6], [0, 13, 8, 6]], 1],
[0]),
('fault site right border #1', [20, 13, [[14, 4, 8, 6], [17, 5, 3, 6]], 0], []),
('partial repair boundary #1',
[16, 18, [[4, 0, 3, 3], [0, 7, 8, 3], [11, 15, 3, 2], [1, 7, 5, 2], [10, 11, 5, 6]], 1],
[4]),
('partial repair boundary #2',
[10,
27,
[[-1, 13, 2, 4],
[1, 23, 2, 3],
[8, 22, 3, 2],
[7, 8, 4, 6],
[2, 6, 2, 2],
[8, 24, 5, 4],
[6, 21, 8, 6],
[6, 16, 3, 4]],
1],
[7]),
('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])],
[('touching border tile #1', [10, 10, [[1, 1, 8, 8]], 1], [0]),
('fault site right border #1', [20, 11, [[16, 1, 4, 6], [1, -1, 5, 3]], 0], []),
('fault site right border #2', [9, 21, [[1, 1, 8, 4]], 1], []),
('partial repair boundary #1',
[10,
27,
[[-1, 13, 2, 4],
[1, 23, 2, 3],
[8, 22, 3, 2],
[7, 8, 4, 6],
[2, 6, 2, 2],
[8, 24, 5, 4],
[6, 21, 8, 6],
[6, 16, 3, 4]],
1],
[7]),
('partial repair boundary #2', [15, 13, [[6, 2, 8, 3], [10, 5, 8, 6]], 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',
[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])]]
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 |
|---|---|---|---|
| touching border tile #1 | [] | [0] | Failed |
| fault site right border #1 | [0, 1, 5] | [0, 1, 5] | Passed |
| regression right border #1 | [5] | [0, 5] | Failed |
| partial repair boundary #1 | [] | [4] | Failed |
| partial repair boundary #2 | [3] | [3, 4] | Failed |
| rooms exactly pad apart #1 | [0, 1] | [0, 1] | Passed |
| thin corridor room #1 | [1] | [1] | Passed |
| control #1 | [] | [] | Passed |
SHA-256 / 164f12ad89cca8c3184bd59df6c30f7f808255dc47eff5010288aeafeb5d2d47
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 = [[('touching border tile #1', [10, 10, [[1, 1, 8, 8]], 1], [0]),
('fault site right border #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]),
('regression right border #1',
[16,
30,
[[12, 13, 3, 6],
[11, 9, 5, 3],
[1, 0, 5, 3],
[14, 10, 8, 3],
[13, 19, 8, 4],
[6, 14, 5, 6],
[8, 18, 5, 2]],
1],
[0, 5]),
('partial repair boundary #1',
[19, 27, [[6, 2, 3, 2], [4, 23, 5, 4], [4, 20, 2, 3], [12, 4, 8, 2], [10, 14, 8, 6]], 1],
[4]),
('partial repair boundary #2',
[18, 14, [[11, 10, 3, 2], [16, 1, 2, 4], [11, 10, 5, 2], [4, 10, 5, 3], [9, 4, 8, 3]], 1],
[3, 4]),
('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],
[])],
[('touching border tile #1', [10, 10, [[1, 1, 8, 8]], 1], [0]),
('fault site right border #1',
[10, 8, [[7, 3, 3, 3], [2, 3, 5, 3], [5, 6, 5, 6], [6, 3, 3, 6], [8, 3, 2, 3], [2, -1, 4, 4]], 0],
[1]),
('fault site right border #2', [13, 24, [[9, 5, 4, 4], [4, 0, 3, 2]], 2], []),
('regression right border #1',
[16,
30,
[[12, 13, 3, 6],
[11, 9, 5, 3],
[1, 0, 5, 3],
[14, 10, 8, 3],
[13, 19, 8, 4],
[6, 14, 5, 6],
[8, 18, 5, 2]],
1],
[0, 5]),
('partial repair boundary #1',
[18, 14, [[11, 10, 3, 2], [16, 1, 2, 4], [11, 10, 5, 2], [4, 10, 5, 3], [9, 4, 8, 3]], 1],
[3, 4]),
('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],
[])],
[('touching border tile #1', [10, 10, [[1, 1, 8, 8]], 1], [0]),
('fault site right border #1',
[24, 25, [[12, 19, 2, 4], [3, 10, 5, 6], [19, 19, 5, 3], [13, 6, 2, 6], [6, 23, 8, 2], [10, 14, 3, 3]], 0],
[1, 5]),
('fault site right border #2',
[15,
14,
[[8, 11, 8, 2], [5, 3, 4, 4], [13, 11, 5, 2], [8, 6, 2, 6], [11, 11, 8, 6], [1, -1, 2, 4], [11, 6, 4, 3]],
1],
[1]),
('partial repair boundary #1',
[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]),
('partial repair boundary #2',
[18,
19,
[[7, 11, 4, 2],
[2, 8, 8, 2],
[14, 9, 3, 3],
[8, 8, 5, 2],
[7, 13, 3, 2],
[10, 12, 8, 2],
[14, 5, 8, 4],
[5, 0, 5, 4]],
1],
[2]),
('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],
[])],
[('touching border tile #1', [10, 10, [[1, 1, 8, 8]], 1], [0]),
('regression right border #1',
[9, 15, [[4, 2, 4, 6], [2, 0, 8, 6], [6, 10, 3, 3], [6, -1, 5, 6], [0, 13, 8, 6]], 1],
[0]),
('fault site right border #1', [20, 13, [[14, 4, 8, 6], [17, 5, 3, 6]], 0], []),
('partial repair boundary #1',
[16, 18, [[4, 0, 3, 3], [0, 7, 8, 3], [11, 15, 3, 2], [1, 7, 5, 2], [10, 11, 5, 6]], 1],
[4]),
('partial repair boundary #2',
[10,
27,
[[-1, 13, 2, 4],
[1, 23, 2, 3],
[8, 22, 3, 2],
[7, 8, 4, 6],
[2, 6, 2, 2],
[8, 24, 5, 4],
[6, 21, 8, 6],
[6, 16, 3, 4]],
1],
[7]),
('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])],
[('touching border tile #1', [10, 10, [[1, 1, 8, 8]], 1], [0]),
('fault site right border #1', [20, 11, [[16, 1, 4, 6], [1, -1, 5, 3]], 0], []),
('fault site right border #2', [9, 21, [[1, 1, 8, 4]], 1], []),
('partial repair boundary #1',
[10,
27,
[[-1, 13, 2, 4],
[1, 23, 2, 3],
[8, 22, 3, 2],
[7, 8, 4, 6],
[2, 6, 2, 2],
[8, 24, 5, 4],
[6, 21, 8, 6],
[6, 16, 3, 4]],
1],
[7]),
('partial repair boundary #2', [15, 13, [[6, 2, 8, 3], [10, 5, 8, 6]], 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',
[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])]]
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 |
|---|---|---|---|
| touching border tile #1 | [0] | [0] | Passed |
| fault site right border #1 | [0, 1, 5] | [0, 1, 5] | Passed |
| regression right border #1 | [0, 5] | [0, 5] | Passed |
| partial repair boundary #1 | [4] | [4] | Passed |
| partial repair boundary #2 | [3, 4] | [3, 4] | Passed |
| rooms exactly pad apart #1 | [0, 1] | [0, 1] | Passed |
| thin corridor room #1 | [1] | [1] | Passed |
| control #1 | [] | [] | Passed |
SHA-256 / e684a408d78df3f4f8650ebd6fe8c87a80cdbc4714b52397ed828e75e5734a3a
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.691862+00:00.
Case digest / 5606fe28b13c41b850b41bb0db5e5477e7ef80e77caff78c0bc134facb86decf