FAILURE MAP
← Case archive

FA-86546 / Procedural level generation constraints / Open access

BSP dungeon partition: Partition goes one level too deep · case 01

Dungeons have twice as many rooms as configured.

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

ROOT CAUSE

The recursion stops only after depth becomes negative.

VERIFIED REPAIR

Restore `if d == 0 or` at the depth exhaustion step.

Unsuccessful approach: Stopping at depth one removes the last configured level.

Case contract

Recursively split the rectangle while depth remains. An axis can be split when that side is >= 2*min_size; if neither can, it is a leaf. Split vertically when w > h, or when w == h at even remaining depth; if the chosen axis cannot be split use the other. The first child gets floor(side/2). Returns leaves [x, y, w, h] in left/top-first order.

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(x, y, w, h, min_size, depth):
    out = []
    def split(x, y, w, h, d):
        can_v = w >= 2 * min_size
        can_h = h >= 2 * min_size
        if d < 0 or not (can_v or can_h):
            out.append([x, y, w, h])
            return
        vertical = w > h or (w == h and d % 2 == 0)
        if vertical and not can_v:
            vertical = False
        elif not vertical and not can_h:
            vertical = True
        if vertical:
            half = w // 2
            split(x, y, half, h, d - 1)
            split(x + half, y, w - half, h, d - 1)
        else:
            half = h // 2
            split(x, y, w, half, d - 1)
            split(x, y + half, w, h - half, d - 1)
    split(x, y, w, h, depth)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('square at even depth #1', [0, 0, 10, 10, 2, 2], [[0, 0, 5, 5], [0, 5, 5, 5], [5, 0, 5, 5], [5, 5, 5, 5]]),
  ('exactly splittable #1', [0, 0, 8, 3, 4, 1], [[0, 0, 4, 3], [4, 0, 4, 3]]),
  ('odd width #1', [1, 1, 9, 4, 2, 1], [[1, 1, 4, 4], [5, 1, 5, 4]]),
  ('regression depth exhaustion #1', [2, 3, 16, 10, 5, 1], [[2, 3, 8, 10], [10, 3, 8, 10]]),
  ('regression depth exhaustion #2', [3, 0, 14, 28, 4, 1], [[3, 0, 14, 14], [3, 14, 14, 14]]),
  ('partial repair boundary #1',
   [5, 5, 10, 8, 4, 2],
   [[5, 5, 5, 4], [5, 9, 5, 4], [10, 5, 5, 4], [10, 9, 5, 4]]),
  ('control #1', [5, 1, 1, 10, 4, 2], [[5, 1, 1, 5], [5, 6, 1, 5]]),
  ('control #2', [1, 4, 9, 1, 3, 4], [[1, 4, 4, 1], [5, 4, 5, 1]])],
 [('odd width #1', [1, 1, 9, 4, 2, 1], [[1, 1, 4, 4], [5, 1, 5, 4]]),
  ('square at even depth #1', [0, 0, 10, 10, 2, 2], [[0, 0, 5, 5], [0, 5, 5, 5], [5, 0, 5, 5], [5, 5, 5, 5]]),
  ('regression depth exhaustion #1', [2, 3, 16, 10, 5, 1], [[2, 3, 8, 10], [10, 3, 8, 10]]),
  ('regression depth exhaustion #2', [3, 0, 14, 28, 4, 1], [[3, 0, 14, 14], [3, 14, 14, 14]]),
  ('partial repair boundary #1',
   [5, 5, 10, 8, 4, 2],
   [[5, 5, 5, 4], [5, 9, 5, 4], [10, 5, 5, 4], [10, 9, 5, 4]]),
  ('partial repair boundary #2',
   [2, 1, 16, 5, 4, 2],
   [[2, 1, 4, 5], [6, 1, 4, 5], [10, 1, 4, 5], [14, 1, 4, 5]]),
  ('control #1', [5, 5, 1, 15, 5, 4], [[5, 5, 1, 7], [5, 12, 1, 8]]),
  ('control #2', [2, 3, 26, 3, 4, 3], [[2, 3, 6, 3], [8, 3, 7, 3], [15, 3, 6, 3], [21, 3, 7, 3]])],
 [('square at even depth #1', [0, 0, 10, 10, 2, 2], [[0, 0, 5, 5], [0, 5, 5, 5], [5, 0, 5, 5], [5, 5, 5, 5]]),
  ('odd width #1', [1, 1, 9, 4, 2, 1], [[1, 1, 4, 4], [5, 1, 5, 4]]),
  ('fault site depth exhaustion #1', [5, 1, 24, 20, 4, 0], [[5, 1, 24, 20]]),
  ('fault site depth exhaustion #2', [5, 0, 15, 27, 5, 0], [[5, 0, 15, 27]]),
  ('regression depth exhaustion #1', [3, 0, 14, 28, 4, 1], [[3, 0, 14, 14], [3, 14, 14, 14]]),
  ('partial repair boundary #1',
   [5, 5, 10, 8, 4, 2],
   [[5, 5, 5, 4], [5, 9, 5, 4], [10, 5, 5, 4], [10, 9, 5, 4]]),
  ('control #1', [3, 4, 21, 6, 6, 2], [[3, 4, 10, 6], [13, 4, 11, 6]]),
  ('control #2', [4, 0, 10, 3, 2, 4], [[4, 0, 2, 3], [6, 0, 3, 3], [9, 0, 2, 3], [11, 0, 3, 3]])],
 [('odd width #1', [1, 1, 9, 4, 2, 1], [[1, 1, 4, 4], [5, 1, 5, 4]]),
  ('exactly splittable #1', [0, 0, 8, 3, 4, 1], [[0, 0, 4, 3], [4, 0, 4, 3]]),
  ('regression depth exhaustion #1', [0, 3, 21, 1, 3, 1], [[0, 3, 10, 1], [10, 3, 11, 1]]),
  ('regression depth exhaustion #2', [4, 2, 16, 17, 2, 1], [[4, 2, 16, 8], [4, 10, 16, 9]]),
  ('partial repair boundary #1',
   [2, 1, 16, 5, 4, 2],
   [[2, 1, 4, 5], [6, 1, 4, 5], [10, 1, 4, 5], [14, 1, 4, 5]]),
  ('partial repair boundary #2',
   [3, 2, 2, 18, 2, 3],
   [[3, 2, 2, 2],
    [3, 4, 2, 2],
    [3, 6, 2, 2],
    [3, 8, 2, 3],
    [3, 11, 2, 2],
    [3, 13, 2, 2],
    [3, 15, 2, 2],
    [3, 17, 2, 3]]),
  ('control #1', [2, 3, 15, 3, 3, 3], [[2, 3, 3, 3], [5, 3, 4, 3], [9, 3, 4, 3], [13, 3, 4, 3]]),
  ('control #2', [3, 5, 26, 4, 5, 4], [[3, 5, 6, 4], [9, 5, 7, 4], [16, 5, 6, 4], [22, 5, 7, 4]])],
 [('square at even depth #1', [0, 0, 10, 10, 2, 2], [[0, 0, 5, 5], [0, 5, 5, 5], [5, 0, 5, 5], [5, 5, 5, 5]]),
  ('odd width #1', [1, 1, 9, 4, 2, 1], [[1, 1, 4, 4], [5, 1, 5, 4]]),
  ('fault site depth exhaustion #1', [2, 0, 23, 3, 6, 0], [[2, 0, 23, 3]]),
  ('fault site depth exhaustion #2', [1, 0, 13, 21, 2, 0], [[1, 0, 13, 21]]),
  ('partial repair boundary #1',
   [3, 2, 2, 18, 2, 3],
   [[3, 2, 2, 2],
    [3, 4, 2, 2],
    [3, 6, 2, 2],
    [3, 8, 2, 3],
    [3, 11, 2, 2],
    [3, 13, 2, 2],
    [3, 15, 2, 2],
    [3, 17, 2, 3]]),
  ('regression depth exhaustion #1', [4, 2, 16, 17, 2, 1], [[4, 2, 16, 8], [4, 10, 16, 9]]),
  ('control #1', [5, 5, 9, 8, 3, 4], [[5, 5, 4, 4], [5, 9, 4, 4], [9, 5, 5, 4], [9, 9, 5, 4]]),
  ('control #2', [2, 0, 2, 1, 3, 3], [[2, 0, 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 fixtureActualExpectedOutcome
square at even depth #1[[0, 0, 2, 5], [2, 0, 3, 5], [0, 5, 2, 5], [2, 5, 3, 5], [5, 0, 2, 5], [7, 0, 3, 5], [5, 5, 2, 5], [7, 5, 3, 5]][[0, 0, 5, 5], [0, 5, 5, 5], [5, 0, 5, 5], [5, 5, 5, 5]]Failed
exactly splittable #1[[0, 0, 4, 3], [4, 0, 4, 3]][[0, 0, 4, 3], [4, 0, 4, 3]]Passed
odd width #1[[1, 1, 2, 4], [3, 1, 2, 4], [5, 1, 2, 4], [7, 1, 3, 4]][[1, 1, 4, 4], [5, 1, 5, 4]]Failed
regression depth exhaustion #1[[2, 3, 8, 5], [2, 8, 8, 5], [10, 3, 8, 5], [10, 8, 8, 5]][[2, 3, 8, 10], [10, 3, 8, 10]]Failed
regression depth exhaustion #2[[3, 0, 7, 14], [10, 0, 7, 14], [3, 14, 7, 14], [10, 14, 7, 14]][[3, 0, 14, 14], [3, 14, 14, 14]]Failed
partial repair boundary #1[[5, 5, 5, 4], [5, 9, 5, 4], [10, 5, 5, 4], [10, 9, 5, 4]][[5, 5, 5, 4], [5, 9, 5, 4], [10, 5, 5, 4], [10, 9, 5, 4]]Passed
control #1[[5, 1, 1, 5], [5, 6, 1, 5]][[5, 1, 1, 5], [5, 6, 1, 5]]Passed
control #2[[1, 4, 4, 1], [5, 4, 5, 1]][[1, 4, 4, 1], [5, 4, 5, 1]]Passed

SHA-256 / fc1b860b2eeb3edd964cd89679684538416b60785f460eb4f1e5f42d4d0c2c32

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(x, y, w, h, min_size, depth):
    out = []
    def split(x, y, w, h, d):
        can_v = w >= 2 * min_size
        can_h = h >= 2 * min_size
        if d <= 1 or not (can_v or can_h):
            out.append([x, y, w, h])
            return
        vertical = w > h or (w == h and d % 2 == 0)
        if vertical and not can_v:
            vertical = False
        elif not vertical and not can_h:
            vertical = True
        if vertical:
            half = w // 2
            split(x, y, half, h, d - 1)
            split(x + half, y, w - half, h, d - 1)
        else:
            half = h // 2
            split(x, y, w, half, d - 1)
            split(x, y + half, w, h - half, d - 1)
    split(x, y, w, h, depth)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('square at even depth #1', [0, 0, 10, 10, 2, 2], [[0, 0, 5, 5], [0, 5, 5, 5], [5, 0, 5, 5], [5, 5, 5, 5]]),
  ('exactly splittable #1', [0, 0, 8, 3, 4, 1], [[0, 0, 4, 3], [4, 0, 4, 3]]),
  ('odd width #1', [1, 1, 9, 4, 2, 1], [[1, 1, 4, 4], [5, 1, 5, 4]]),
  ('regression depth exhaustion #1', [2, 3, 16, 10, 5, 1], [[2, 3, 8, 10], [10, 3, 8, 10]]),
  ('regression depth exhaustion #2', [3, 0, 14, 28, 4, 1], [[3, 0, 14, 14], [3, 14, 14, 14]]),
  ('partial repair boundary #1',
   [5, 5, 10, 8, 4, 2],
   [[5, 5, 5, 4], [5, 9, 5, 4], [10, 5, 5, 4], [10, 9, 5, 4]]),
  ('control #1', [5, 1, 1, 10, 4, 2], [[5, 1, 1, 5], [5, 6, 1, 5]]),
  ('control #2', [1, 4, 9, 1, 3, 4], [[1, 4, 4, 1], [5, 4, 5, 1]])],
 [('odd width #1', [1, 1, 9, 4, 2, 1], [[1, 1, 4, 4], [5, 1, 5, 4]]),
  ('square at even depth #1', [0, 0, 10, 10, 2, 2], [[0, 0, 5, 5], [0, 5, 5, 5], [5, 0, 5, 5], [5, 5, 5, 5]]),
  ('regression depth exhaustion #1', [2, 3, 16, 10, 5, 1], [[2, 3, 8, 10], [10, 3, 8, 10]]),
  ('regression depth exhaustion #2', [3, 0, 14, 28, 4, 1], [[3, 0, 14, 14], [3, 14, 14, 14]]),
  ('partial repair boundary #1',
   [5, 5, 10, 8, 4, 2],
   [[5, 5, 5, 4], [5, 9, 5, 4], [10, 5, 5, 4], [10, 9, 5, 4]]),
  ('partial repair boundary #2',
   [2, 1, 16, 5, 4, 2],
   [[2, 1, 4, 5], [6, 1, 4, 5], [10, 1, 4, 5], [14, 1, 4, 5]]),
  ('control #1', [5, 5, 1, 15, 5, 4], [[5, 5, 1, 7], [5, 12, 1, 8]]),
  ('control #2', [2, 3, 26, 3, 4, 3], [[2, 3, 6, 3], [8, 3, 7, 3], [15, 3, 6, 3], [21, 3, 7, 3]])],
 [('square at even depth #1', [0, 0, 10, 10, 2, 2], [[0, 0, 5, 5], [0, 5, 5, 5], [5, 0, 5, 5], [5, 5, 5, 5]]),
  ('odd width #1', [1, 1, 9, 4, 2, 1], [[1, 1, 4, 4], [5, 1, 5, 4]]),
  ('fault site depth exhaustion #1', [5, 1, 24, 20, 4, 0], [[5, 1, 24, 20]]),
  ('fault site depth exhaustion #2', [5, 0, 15, 27, 5, 0], [[5, 0, 15, 27]]),
  ('regression depth exhaustion #1', [3, 0, 14, 28, 4, 1], [[3, 0, 14, 14], [3, 14, 14, 14]]),
  ('partial repair boundary #1',
   [5, 5, 10, 8, 4, 2],
   [[5, 5, 5, 4], [5, 9, 5, 4], [10, 5, 5, 4], [10, 9, 5, 4]]),
  ('control #1', [3, 4, 21, 6, 6, 2], [[3, 4, 10, 6], [13, 4, 11, 6]]),
  ('control #2', [4, 0, 10, 3, 2, 4], [[4, 0, 2, 3], [6, 0, 3, 3], [9, 0, 2, 3], [11, 0, 3, 3]])],
 [('odd width #1', [1, 1, 9, 4, 2, 1], [[1, 1, 4, 4], [5, 1, 5, 4]]),
  ('exactly splittable #1', [0, 0, 8, 3, 4, 1], [[0, 0, 4, 3], [4, 0, 4, 3]]),
  ('regression depth exhaustion #1', [0, 3, 21, 1, 3, 1], [[0, 3, 10, 1], [10, 3, 11, 1]]),
  ('regression depth exhaustion #2', [4, 2, 16, 17, 2, 1], [[4, 2, 16, 8], [4, 10, 16, 9]]),
  ('partial repair boundary #1',
   [2, 1, 16, 5, 4, 2],
   [[2, 1, 4, 5], [6, 1, 4, 5], [10, 1, 4, 5], [14, 1, 4, 5]]),
  ('partial repair boundary #2',
   [3, 2, 2, 18, 2, 3],
   [[3, 2, 2, 2],
    [3, 4, 2, 2],
    [3, 6, 2, 2],
    [3, 8, 2, 3],
    [3, 11, 2, 2],
    [3, 13, 2, 2],
    [3, 15, 2, 2],
    [3, 17, 2, 3]]),
  ('control #1', [2, 3, 15, 3, 3, 3], [[2, 3, 3, 3], [5, 3, 4, 3], [9, 3, 4, 3], [13, 3, 4, 3]]),
  ('control #2', [3, 5, 26, 4, 5, 4], [[3, 5, 6, 4], [9, 5, 7, 4], [16, 5, 6, 4], [22, 5, 7, 4]])],
 [('square at even depth #1', [0, 0, 10, 10, 2, 2], [[0, 0, 5, 5], [0, 5, 5, 5], [5, 0, 5, 5], [5, 5, 5, 5]]),
  ('odd width #1', [1, 1, 9, 4, 2, 1], [[1, 1, 4, 4], [5, 1, 5, 4]]),
  ('fault site depth exhaustion #1', [2, 0, 23, 3, 6, 0], [[2, 0, 23, 3]]),
  ('fault site depth exhaustion #2', [1, 0, 13, 21, 2, 0], [[1, 0, 13, 21]]),
  ('partial repair boundary #1',
   [3, 2, 2, 18, 2, 3],
   [[3, 2, 2, 2],
    [3, 4, 2, 2],
    [3, 6, 2, 2],
    [3, 8, 2, 3],
    [3, 11, 2, 2],
    [3, 13, 2, 2],
    [3, 15, 2, 2],
    [3, 17, 2, 3]]),
  ('regression depth exhaustion #1', [4, 2, 16, 17, 2, 1], [[4, 2, 16, 8], [4, 10, 16, 9]]),
  ('control #1', [5, 5, 9, 8, 3, 4], [[5, 5, 4, 4], [5, 9, 4, 4], [9, 5, 5, 4], [9, 9, 5, 4]]),
  ('control #2', [2, 0, 2, 1, 3, 3], [[2, 0, 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 fixtureActualExpectedOutcome
square at even depth #1[[0, 0, 5, 10], [5, 0, 5, 10]][[0, 0, 5, 5], [0, 5, 5, 5], [5, 0, 5, 5], [5, 5, 5, 5]]Failed
exactly splittable #1[[0, 0, 8, 3]][[0, 0, 4, 3], [4, 0, 4, 3]]Failed
odd width #1[[1, 1, 9, 4]][[1, 1, 4, 4], [5, 1, 5, 4]]Failed
regression depth exhaustion #1[[2, 3, 16, 10]][[2, 3, 8, 10], [10, 3, 8, 10]]Failed
regression depth exhaustion #2[[3, 0, 14, 28]][[3, 0, 14, 14], [3, 14, 14, 14]]Failed
partial repair boundary #1[[5, 5, 5, 8], [10, 5, 5, 8]][[5, 5, 5, 4], [5, 9, 5, 4], [10, 5, 5, 4], [10, 9, 5, 4]]Failed
control #1[[5, 1, 1, 5], [5, 6, 1, 5]][[5, 1, 1, 5], [5, 6, 1, 5]]Passed
control #2[[1, 4, 4, 1], [5, 4, 5, 1]][[1, 4, 4, 1], [5, 4, 5, 1]]Passed

SHA-256 / 065f510880f46e2dce3a3696c5b1c317a7c8617431388ca1ba929809425be99a

3 / The verified repair

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

N = 1
observations = []
def solve(x, y, w, h, min_size, depth):
    out = []
    def split(x, y, w, h, d):
        can_v = w >= 2 * min_size
        can_h = h >= 2 * min_size
        if d == 0 or not (can_v or can_h):
            out.append([x, y, w, h])
            return
        vertical = w > h or (w == h and d % 2 == 0)
        if vertical and not can_v:
            vertical = False
        elif not vertical and not can_h:
            vertical = True
        if vertical:
            half = w // 2
            split(x, y, half, h, d - 1)
            split(x + half, y, w - half, h, d - 1)
        else:
            half = h // 2
            split(x, y, w, half, d - 1)
            split(x, y + half, w, h - half, d - 1)
    split(x, y, w, h, depth)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('square at even depth #1', [0, 0, 10, 10, 2, 2], [[0, 0, 5, 5], [0, 5, 5, 5], [5, 0, 5, 5], [5, 5, 5, 5]]),
  ('exactly splittable #1', [0, 0, 8, 3, 4, 1], [[0, 0, 4, 3], [4, 0, 4, 3]]),
  ('odd width #1', [1, 1, 9, 4, 2, 1], [[1, 1, 4, 4], [5, 1, 5, 4]]),
  ('regression depth exhaustion #1', [2, 3, 16, 10, 5, 1], [[2, 3, 8, 10], [10, 3, 8, 10]]),
  ('regression depth exhaustion #2', [3, 0, 14, 28, 4, 1], [[3, 0, 14, 14], [3, 14, 14, 14]]),
  ('partial repair boundary #1',
   [5, 5, 10, 8, 4, 2],
   [[5, 5, 5, 4], [5, 9, 5, 4], [10, 5, 5, 4], [10, 9, 5, 4]]),
  ('control #1', [5, 1, 1, 10, 4, 2], [[5, 1, 1, 5], [5, 6, 1, 5]]),
  ('control #2', [1, 4, 9, 1, 3, 4], [[1, 4, 4, 1], [5, 4, 5, 1]])],
 [('odd width #1', [1, 1, 9, 4, 2, 1], [[1, 1, 4, 4], [5, 1, 5, 4]]),
  ('square at even depth #1', [0, 0, 10, 10, 2, 2], [[0, 0, 5, 5], [0, 5, 5, 5], [5, 0, 5, 5], [5, 5, 5, 5]]),
  ('regression depth exhaustion #1', [2, 3, 16, 10, 5, 1], [[2, 3, 8, 10], [10, 3, 8, 10]]),
  ('regression depth exhaustion #2', [3, 0, 14, 28, 4, 1], [[3, 0, 14, 14], [3, 14, 14, 14]]),
  ('partial repair boundary #1',
   [5, 5, 10, 8, 4, 2],
   [[5, 5, 5, 4], [5, 9, 5, 4], [10, 5, 5, 4], [10, 9, 5, 4]]),
  ('partial repair boundary #2',
   [2, 1, 16, 5, 4, 2],
   [[2, 1, 4, 5], [6, 1, 4, 5], [10, 1, 4, 5], [14, 1, 4, 5]]),
  ('control #1', [5, 5, 1, 15, 5, 4], [[5, 5, 1, 7], [5, 12, 1, 8]]),
  ('control #2', [2, 3, 26, 3, 4, 3], [[2, 3, 6, 3], [8, 3, 7, 3], [15, 3, 6, 3], [21, 3, 7, 3]])],
 [('square at even depth #1', [0, 0, 10, 10, 2, 2], [[0, 0, 5, 5], [0, 5, 5, 5], [5, 0, 5, 5], [5, 5, 5, 5]]),
  ('odd width #1', [1, 1, 9, 4, 2, 1], [[1, 1, 4, 4], [5, 1, 5, 4]]),
  ('fault site depth exhaustion #1', [5, 1, 24, 20, 4, 0], [[5, 1, 24, 20]]),
  ('fault site depth exhaustion #2', [5, 0, 15, 27, 5, 0], [[5, 0, 15, 27]]),
  ('regression depth exhaustion #1', [3, 0, 14, 28, 4, 1], [[3, 0, 14, 14], [3, 14, 14, 14]]),
  ('partial repair boundary #1',
   [5, 5, 10, 8, 4, 2],
   [[5, 5, 5, 4], [5, 9, 5, 4], [10, 5, 5, 4], [10, 9, 5, 4]]),
  ('control #1', [3, 4, 21, 6, 6, 2], [[3, 4, 10, 6], [13, 4, 11, 6]]),
  ('control #2', [4, 0, 10, 3, 2, 4], [[4, 0, 2, 3], [6, 0, 3, 3], [9, 0, 2, 3], [11, 0, 3, 3]])],
 [('odd width #1', [1, 1, 9, 4, 2, 1], [[1, 1, 4, 4], [5, 1, 5, 4]]),
  ('exactly splittable #1', [0, 0, 8, 3, 4, 1], [[0, 0, 4, 3], [4, 0, 4, 3]]),
  ('regression depth exhaustion #1', [0, 3, 21, 1, 3, 1], [[0, 3, 10, 1], [10, 3, 11, 1]]),
  ('regression depth exhaustion #2', [4, 2, 16, 17, 2, 1], [[4, 2, 16, 8], [4, 10, 16, 9]]),
  ('partial repair boundary #1',
   [2, 1, 16, 5, 4, 2],
   [[2, 1, 4, 5], [6, 1, 4, 5], [10, 1, 4, 5], [14, 1, 4, 5]]),
  ('partial repair boundary #2',
   [3, 2, 2, 18, 2, 3],
   [[3, 2, 2, 2],
    [3, 4, 2, 2],
    [3, 6, 2, 2],
    [3, 8, 2, 3],
    [3, 11, 2, 2],
    [3, 13, 2, 2],
    [3, 15, 2, 2],
    [3, 17, 2, 3]]),
  ('control #1', [2, 3, 15, 3, 3, 3], [[2, 3, 3, 3], [5, 3, 4, 3], [9, 3, 4, 3], [13, 3, 4, 3]]),
  ('control #2', [3, 5, 26, 4, 5, 4], [[3, 5, 6, 4], [9, 5, 7, 4], [16, 5, 6, 4], [22, 5, 7, 4]])],
 [('square at even depth #1', [0, 0, 10, 10, 2, 2], [[0, 0, 5, 5], [0, 5, 5, 5], [5, 0, 5, 5], [5, 5, 5, 5]]),
  ('odd width #1', [1, 1, 9, 4, 2, 1], [[1, 1, 4, 4], [5, 1, 5, 4]]),
  ('fault site depth exhaustion #1', [2, 0, 23, 3, 6, 0], [[2, 0, 23, 3]]),
  ('fault site depth exhaustion #2', [1, 0, 13, 21, 2, 0], [[1, 0, 13, 21]]),
  ('partial repair boundary #1',
   [3, 2, 2, 18, 2, 3],
   [[3, 2, 2, 2],
    [3, 4, 2, 2],
    [3, 6, 2, 2],
    [3, 8, 2, 3],
    [3, 11, 2, 2],
    [3, 13, 2, 2],
    [3, 15, 2, 2],
    [3, 17, 2, 3]]),
  ('regression depth exhaustion #1', [4, 2, 16, 17, 2, 1], [[4, 2, 16, 8], [4, 10, 16, 9]]),
  ('control #1', [5, 5, 9, 8, 3, 4], [[5, 5, 4, 4], [5, 9, 4, 4], [9, 5, 5, 4], [9, 9, 5, 4]]),
  ('control #2', [2, 0, 2, 1, 3, 3], [[2, 0, 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 fixtureActualExpectedOutcome
square at even depth #1[[0, 0, 5, 5], [0, 5, 5, 5], [5, 0, 5, 5], [5, 5, 5, 5]][[0, 0, 5, 5], [0, 5, 5, 5], [5, 0, 5, 5], [5, 5, 5, 5]]Passed
exactly splittable #1[[0, 0, 4, 3], [4, 0, 4, 3]][[0, 0, 4, 3], [4, 0, 4, 3]]Passed
odd width #1[[1, 1, 4, 4], [5, 1, 5, 4]][[1, 1, 4, 4], [5, 1, 5, 4]]Passed
regression depth exhaustion #1[[2, 3, 8, 10], [10, 3, 8, 10]][[2, 3, 8, 10], [10, 3, 8, 10]]Passed
regression depth exhaustion #2[[3, 0, 14, 14], [3, 14, 14, 14]][[3, 0, 14, 14], [3, 14, 14, 14]]Passed
partial repair boundary #1[[5, 5, 5, 4], [5, 9, 5, 4], [10, 5, 5, 4], [10, 9, 5, 4]][[5, 5, 5, 4], [5, 9, 5, 4], [10, 5, 5, 4], [10, 9, 5, 4]]Passed
control #1[[5, 1, 1, 5], [5, 6, 1, 5]][[5, 1, 1, 5], [5, 6, 1, 5]]Passed
control #2[[1, 4, 4, 1], [5, 4, 5, 1]][[1, 4, 4, 1], [5, 4, 5, 1]]Passed

SHA-256 / ad35a00e6ddba972230534228907b29589ca9ed295fd30134da3a51de4e02734

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

Case digest / 998689ebdb16d34302ca958aab4e03d24a49010404190f9390f6aa0823845521