FA-86351 / Procedural level generation constraints / Open access
Room placement with padding: Rooms start on the border row · case 01
Rooms at column or row zero erase the top or left wall.
ROOT CAUSE
The near-side bound allows coordinate zero, which is the border.
VERIFIED REPAIR
Restore `x < 1 or y < 1` at the near border step.
Unsuccessful approach: Checking only x still lets rooms start on the top border row.
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 < 0 or y < 0 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 near border #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 near 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',
[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]),
('partial repair boundary #2',
[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]),
('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',
[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 near border #1', [8, 25, [[0, 8, 3, 6], [4, -1, 4, 3], [1, 17, 5, 2]], 1], []),
('fault site near border #2',
[14,
21,
[[7, 6, 3, 6], [11, -1, 8, 2], [0, 12, 3, 3], [-1, 14, 8, 6], [6, 9, 3, 4], [1, 10, 4, 4], [9, 19, 2, 2]],
0],
[0, 5]),
('partial repair boundary #1',
[26, 13, [[7, 10, 8, 4], [22, -1, 3, 6], [3, 3, 4, 6], [17, 0, 8, 2]], 1],
[2]),
('regression near 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]),
('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',
[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]),
('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 near border #1',
[16,
29,
[[4, 0, 2, 3], [10, 16, 4, 6], [5, 21, 3, 6], [1, 9, 3, 3], [0, 22, 4, 3], [-1, 21, 4, 6], [14, 4, 5, 2]],
1],
[1, 2, 3]),
('fault site near border #2',
[29, 27, [[19, 5, 8, 3], [3, 14, 5, 3], [0, 20, 4, 4], [-1, 5, 3, 4], [0, 7, 5, 2]], 0],
[0, 1]),
('partial repair boundary #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]),
('regression near border #1',
[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',
[19, 27, [[6, 2, 3, 2], [4, 23, 5, 4], [4, 20, 2, 3], [12, 4, 8, 2], [10, 14, 8, 6]], 1],
[4]),
('control #2', [15, 13, [[6, 11, 5, 6], [-1, 3, 2, 4]], 1], [])],
[('regression near border #1',
[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]),
('regression near border #2',
[19,
18,
[[15, 0, 4, 3], [6, 4, 2, 4], [6, 4, 8, 3], [9, 15, 8, 2], [0, 0, 5, 3], [4, 11, 5, 4], [13, 0, 3, 3]],
1],
[2, 5]),
('partial repair boundary #1',
[18,
25,
[[4, 22, 5, 2], [7, 7, 3, 3], [2, -1, 3, 6], [5, 14, 8, 3], [4, 19, 5, 6], [8, 23, 3, 6], [0, 3, 2, 2]],
1],
[1, 3]),
('partial repair boundary #2',
[22,
11,
[[0, 0, 4, 2],
[4, 7, 8, 4],
[19, 6, 4, 6],
[11, 7, 2, 4],
[10, -1, 5, 4],
[13, 9, 4, 4],
[10, 1, 8, 4],
[19, 9, 4, 3]],
1],
[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', [9, 21, [[1, 11, 2, 4], [1, 3, 5, 2], [3, 3, 8, 6], [-1, 5, 4, 3]], 1], []),
('control #2',
[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])],
[('regression near border #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 near border #2',
[16, 18, [[4, 0, 3, 3], [0, 7, 8, 3], [11, 15, 3, 2], [1, 7, 5, 2], [10, 11, 5, 6]], 1],
[4]),
('regression near border #3',
[19,
18,
[[15, 0, 4, 3], [6, 4, 2, 4], [6, 4, 8, 3], [9, 15, 8, 2], [0, 0, 5, 3], [4, 11, 5, 4], [13, 0, 3, 3]],
1],
[2, 5]),
('partial repair boundary #1',
[17, 29, [[-1, 4, 2, 6], [8, 13, 2, 3], [1, -1, 3, 3], [12, 1, 8, 6], [4, 18, 3, 2], [13, -1, 8, 2]], 2],
[]),
('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',
[24, 17, [[21, 15, 8, 3], [1, 9, 3, 4], [1, 9, 5, 2], [1, 1, 5, 2], [20, 13, 5, 6]], 2],
[1]),
('control #2', [10, 15, [[-1, 9, 5, 2]], 1], [])]]
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 near border #1 | [4] | [] | Failed |
| regression near border #1 | [0, 2, 5] | [0, 5] | Failed |
| partial repair boundary #1 | [2] | [2] | Passed |
| partial repair boundary #2 | [0, 1, 5] | [0, 1, 5] | 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 | [0, 2] | [0, 2] | Passed |
SHA-256 / e8b00b7a678d1092c843e05bbd34736acd8d9eaa4c6ccd9a64917f3d85641bf7
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 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 near border #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 near 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',
[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]),
('partial repair boundary #2',
[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]),
('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',
[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 near border #1', [8, 25, [[0, 8, 3, 6], [4, -1, 4, 3], [1, 17, 5, 2]], 1], []),
('fault site near border #2',
[14,
21,
[[7, 6, 3, 6], [11, -1, 8, 2], [0, 12, 3, 3], [-1, 14, 8, 6], [6, 9, 3, 4], [1, 10, 4, 4], [9, 19, 2, 2]],
0],
[0, 5]),
('partial repair boundary #1',
[26, 13, [[7, 10, 8, 4], [22, -1, 3, 6], [3, 3, 4, 6], [17, 0, 8, 2]], 1],
[2]),
('regression near 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]),
('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',
[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]),
('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 near border #1',
[16,
29,
[[4, 0, 2, 3], [10, 16, 4, 6], [5, 21, 3, 6], [1, 9, 3, 3], [0, 22, 4, 3], [-1, 21, 4, 6], [14, 4, 5, 2]],
1],
[1, 2, 3]),
('fault site near border #2',
[29, 27, [[19, 5, 8, 3], [3, 14, 5, 3], [0, 20, 4, 4], [-1, 5, 3, 4], [0, 7, 5, 2]], 0],
[0, 1]),
('partial repair boundary #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]),
('regression near border #1',
[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',
[19, 27, [[6, 2, 3, 2], [4, 23, 5, 4], [4, 20, 2, 3], [12, 4, 8, 2], [10, 14, 8, 6]], 1],
[4]),
('control #2', [15, 13, [[6, 11, 5, 6], [-1, 3, 2, 4]], 1], [])],
[('regression near border #1',
[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]),
('regression near border #2',
[19,
18,
[[15, 0, 4, 3], [6, 4, 2, 4], [6, 4, 8, 3], [9, 15, 8, 2], [0, 0, 5, 3], [4, 11, 5, 4], [13, 0, 3, 3]],
1],
[2, 5]),
('partial repair boundary #1',
[18,
25,
[[4, 22, 5, 2], [7, 7, 3, 3], [2, -1, 3, 6], [5, 14, 8, 3], [4, 19, 5, 6], [8, 23, 3, 6], [0, 3, 2, 2]],
1],
[1, 3]),
('partial repair boundary #2',
[22,
11,
[[0, 0, 4, 2],
[4, 7, 8, 4],
[19, 6, 4, 6],
[11, 7, 2, 4],
[10, -1, 5, 4],
[13, 9, 4, 4],
[10, 1, 8, 4],
[19, 9, 4, 3]],
1],
[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', [9, 21, [[1, 11, 2, 4], [1, 3, 5, 2], [3, 3, 8, 6], [-1, 5, 4, 3]], 1], []),
('control #2',
[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])],
[('regression near border #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 near border #2',
[16, 18, [[4, 0, 3, 3], [0, 7, 8, 3], [11, 15, 3, 2], [1, 7, 5, 2], [10, 11, 5, 6]], 1],
[4]),
('regression near border #3',
[19,
18,
[[15, 0, 4, 3], [6, 4, 2, 4], [6, 4, 8, 3], [9, 15, 8, 2], [0, 0, 5, 3], [4, 11, 5, 4], [13, 0, 3, 3]],
1],
[2, 5]),
('partial repair boundary #1',
[17, 29, [[-1, 4, 2, 6], [8, 13, 2, 3], [1, -1, 3, 3], [12, 1, 8, 6], [4, 18, 3, 2], [13, -1, 8, 2]], 2],
[]),
('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',
[24, 17, [[21, 15, 8, 3], [1, 9, 3, 4], [1, 9, 5, 2], [1, 1, 5, 2], [20, 13, 5, 6]], 2],
[1]),
('control #2', [10, 15, [[-1, 9, 5, 2]], 1], [])]]
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 near border #1 | [] | [] | Passed |
| regression near border #1 | [0, 2, 5] | [0, 5] | Failed |
| partial repair boundary #1 | [1, 2] | [2] | Failed |
| partial repair boundary #2 | [0, 1, 3, 5, 7] | [0, 1, 5] | 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 | [0, 2] | [0, 2] | Passed |
SHA-256 / fe97b567b162aa5dd82b101556aafb9b615c708a7862766e225ecde2288575aa
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 near border #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 near 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',
[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]),
('partial repair boundary #2',
[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]),
('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',
[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 near border #1', [8, 25, [[0, 8, 3, 6], [4, -1, 4, 3], [1, 17, 5, 2]], 1], []),
('fault site near border #2',
[14,
21,
[[7, 6, 3, 6], [11, -1, 8, 2], [0, 12, 3, 3], [-1, 14, 8, 6], [6, 9, 3, 4], [1, 10, 4, 4], [9, 19, 2, 2]],
0],
[0, 5]),
('partial repair boundary #1',
[26, 13, [[7, 10, 8, 4], [22, -1, 3, 6], [3, 3, 4, 6], [17, 0, 8, 2]], 1],
[2]),
('regression near 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]),
('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',
[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]),
('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 near border #1',
[16,
29,
[[4, 0, 2, 3], [10, 16, 4, 6], [5, 21, 3, 6], [1, 9, 3, 3], [0, 22, 4, 3], [-1, 21, 4, 6], [14, 4, 5, 2]],
1],
[1, 2, 3]),
('fault site near border #2',
[29, 27, [[19, 5, 8, 3], [3, 14, 5, 3], [0, 20, 4, 4], [-1, 5, 3, 4], [0, 7, 5, 2]], 0],
[0, 1]),
('partial repair boundary #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]),
('regression near border #1',
[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',
[19, 27, [[6, 2, 3, 2], [4, 23, 5, 4], [4, 20, 2, 3], [12, 4, 8, 2], [10, 14, 8, 6]], 1],
[4]),
('control #2', [15, 13, [[6, 11, 5, 6], [-1, 3, 2, 4]], 1], [])],
[('regression near border #1',
[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]),
('regression near border #2',
[19,
18,
[[15, 0, 4, 3], [6, 4, 2, 4], [6, 4, 8, 3], [9, 15, 8, 2], [0, 0, 5, 3], [4, 11, 5, 4], [13, 0, 3, 3]],
1],
[2, 5]),
('partial repair boundary #1',
[18,
25,
[[4, 22, 5, 2], [7, 7, 3, 3], [2, -1, 3, 6], [5, 14, 8, 3], [4, 19, 5, 6], [8, 23, 3, 6], [0, 3, 2, 2]],
1],
[1, 3]),
('partial repair boundary #2',
[22,
11,
[[0, 0, 4, 2],
[4, 7, 8, 4],
[19, 6, 4, 6],
[11, 7, 2, 4],
[10, -1, 5, 4],
[13, 9, 4, 4],
[10, 1, 8, 4],
[19, 9, 4, 3]],
1],
[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', [9, 21, [[1, 11, 2, 4], [1, 3, 5, 2], [3, 3, 8, 6], [-1, 5, 4, 3]], 1], []),
('control #2',
[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])],
[('regression near border #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 near border #2',
[16, 18, [[4, 0, 3, 3], [0, 7, 8, 3], [11, 15, 3, 2], [1, 7, 5, 2], [10, 11, 5, 6]], 1],
[4]),
('regression near border #3',
[19,
18,
[[15, 0, 4, 3], [6, 4, 2, 4], [6, 4, 8, 3], [9, 15, 8, 2], [0, 0, 5, 3], [4, 11, 5, 4], [13, 0, 3, 3]],
1],
[2, 5]),
('partial repair boundary #1',
[17, 29, [[-1, 4, 2, 6], [8, 13, 2, 3], [1, -1, 3, 3], [12, 1, 8, 6], [4, 18, 3, 2], [13, -1, 8, 2]], 2],
[]),
('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',
[24, 17, [[21, 15, 8, 3], [1, 9, 3, 4], [1, 9, 5, 2], [1, 1, 5, 2], [20, 13, 5, 6]], 2],
[1]),
('control #2', [10, 15, [[-1, 9, 5, 2]], 1], [])]]
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 near border #1 | [] | [] | Passed |
| regression near border #1 | [0, 5] | [0, 5] | Passed |
| partial repair boundary #1 | [2] | [2] | Passed |
| partial repair boundary #2 | [0, 1, 5] | [0, 1, 5] | 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 | [0, 2] | [0, 2] | Passed |
SHA-256 / e478a52e6136269d32b2c0d50c2a98a2ee1f534b995344c6042f2cc6f9baf371
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.792488+00:00.
Case digest / d898b9967a61629b5933ef6b1472568bf6aeac9a017dc1da70d7856d65dd88ae