FAILURE MAP
← Case archive

FA-86441 / Procedural level generation constraints / Open access

Enemy spawn point selection: Enemies spawn in water · case 01

Land enemies appear on water tiles.

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

ROOT CAUSE

Only walls are rejected, so any other tile type is spawnable.

VERIFIED REPAIR

Restore `grid[r][c] != '.'` at the spawn tile step.

Unsuccessful approach: Explicitly allowing water keeps the defect.

Case contract

Candidates [row, col] are tried in order until count spawns are chosen. A spawn must be in bounds on a '.' tile, at Chebyshev distance >= min_dist from the player and at Chebyshev distance >= 2 from every chosen spawn (no touching spawns, diagonals included). Returns chosen cells.

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(grid, player, candidates, min_dist, count):
    chosen = []
    pr, pc = player
    for r, c in candidates:
        if len(chosen) >= count:
            break
        if not (0 <= r < len(grid) and 0 <= c < len(grid[0])) or grid[r][c] == '#':
            continue
        if max(abs(r - pr), abs(c - pc)) < min_dist:
            continue
        if any(max(abs(r - a), abs(c - b)) < 2 for a, b in chosen):
            continue
        chosen.append([r, c])
    return chosen
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('regression spawn tile #1',
   [['...#', '.#..', '#.#~', '~~.~', '~~#.', '~##.', '....', '...#'],
    [1, 2],
    [[0, 1], [6, 4], [5, 4], [4, 1], [4, 0], [6, 1], [0, 4], [7, 2], [5, 3], [-1, 1]],
    3,
    2],
   [[6, 1], [5, 3]]),
  ('regression spawn tile #2',
   [['~......', '......~', '~#.~##.', '.#..~~.', '#..#~#.', '......#'],
    [3, 2],
    [[1, 0], [6, 3], [5, 2], [4, 0], [2, 3], [1, 4], [6, 7], [2, 7]],
    0,
    5],
   [[1, 0], [5, 2], [1, 4]]),
  ('regression spawn tile #3',
   [['~#...~..', '~...~~#.', '~~.#.##~', '~.#.#~#.'],
    [0, 5],
    [[2, 8], [1, 0], [2, 1], [3, 7], [2, 1], [-1, 5], [3, 2], [0, 0]],
    1,
    3],
   [[3, 7]]),
  ('regression spawn tile #4',
   [['#.#', '~..', '~.#', '.#~', '.#.', '#..', '##.', '~#.'], [7, 0], [[5, 0], [2, 0], [5, 3]], 3, 3],
   []),
  ('diagonal neighbour spawn #1', [['....', '....', '....'], [0, 0], [[1, 2], [2, 3]], 1, 3], [[1, 2]]),
  ('exact safe radius #1', [['.....', '.....'], [0, 0], [[1, 1], [0, 2]], 2, 2], [[0, 2]]),
  ('negative index candidate #1', [['...', '...', '..#'], [0, 0], [[-1, -1], [2, 0]], 1, 2], [[2, 0]]),
  ('control #1',
   [['#.#', '...', '#.#', '.#.', '...', '...', '...', '##.'], [6, 2], [[2, -1], [7, 2]], 0, 0],
   [])],
 [('regression spawn tile #1',
   [['~#...~..', '~...~~#.', '~~.#.##~', '~.#.#~#.'],
    [0, 5],
    [[2, 8], [1, 0], [2, 1], [3, 7], [2, 1], [-1, 5], [3, 2], [0, 0]],
    1,
    3],
   [[3, 7]]),
  ('regression spawn tile #2',
   [['#.#', '~..', '~.#', '.#~', '.#.', '#..', '##.', '~#.'], [7, 0], [[5, 0], [2, 0], [5, 3]], 3, 3],
   []),
  ('regression spawn tile #3',
   [['..~##.', '~..~..', '.~~#.~'], [0, 3], [[1, 4], [-1, 6], [1, 1], [2, 4], [2, 2], [1, 0]], 3, 5],
   []),
  ('regression spawn tile #4',
   [['..##....', '~.#.#.~#', '##...#.~', '.....#~~', '#...#..~', '...#.~.~'],
    [1, 0],
    [[2, 2], [3, 8], [5, 7], [5, 5]],
    0,
    5],
   [[2, 2]]),
  ('negative index candidate #1', [['...', '...', '..#'], [0, 0], [[-1, -1], [2, 0]], 1, 2], [[2, 0]]),
  ('diagonal neighbour spawn #1', [['....', '....', '....'], [0, 0], [[1, 2], [2, 3]], 1, 3], [[1, 2]]),
  ('control #1',
   [['#.#', '...', '#.#', '.#.', '...', '...', '...', '##.'], [6, 2], [[2, -1], [7, 2]], 0, 0],
   []),
  ('control #2',
   [['.#~', '...', '~.#', '#.~', '..#', '#~.'], [3, 1], [[5, 0], [1, 0], [6, -1], [6, -1]], 0, 5],
   [[1, 0]])],
 [('regression spawn tile #1',
   [['..~##.', '~..~..', '.~~#.~'], [0, 3], [[1, 4], [-1, 6], [1, 1], [2, 4], [2, 2], [1, 0]], 3, 5],
   []),
  ('regression spawn tile #2',
   [['..##....', '~.#.#.~#', '##...#.~', '.....#~~', '#...#..~', '...#.~.~'],
    [1, 0],
    [[2, 2], [3, 8], [5, 7], [5, 5]],
    0,
    5],
   [[2, 2]]),
  ('regression spawn tile #3',
   [['~#~~', '.~~.', '~.~.', '....', '.#.~'],
    [1, 0],
    [[-1, 2], [-1, 1], [1, 2], [5, 2], [-1, 4], [-1, 2], [2, 0]],
    2,
    3],
   []),
  ('regression spawn tile #4',
   [['.~....##', '......#.', '~...#..#', '~......~'],
    [2, 3],
    [[-1, 3], [0, 1], [1, -1], [1, 2], [2, 5], [1, 3]],
    2,
    1],
   [[2, 5]]),
  ('exact safe radius #1', [['.....', '.....'], [0, 0], [[1, 1], [0, 2]], 2, 2], [[0, 2]]),
  ('negative index candidate #1', [['...', '...', '..#'], [0, 0], [[-1, -1], [2, 0]], 1, 2], [[2, 0]]),
  ('control #1',
   [['.#~', '...', '~.#', '#.~', '..#', '#~.'], [3, 1], [[5, 0], [1, 0], [6, -1], [6, -1]], 0, 5],
   [[1, 0]]),
  ('control #2',
   [['...#...', '......~', '~~.....', '..~....', '.~....~', '.....#.'], [5, 2], [[1, 5]], 0, 0],
   [])],
 [('regression spawn tile #1',
   [['~#~~', '.~~.', '~.~.', '....', '.#.~'],
    [1, 0],
    [[-1, 2], [-1, 1], [1, 2], [5, 2], [-1, 4], [-1, 2], [2, 0]],
    2,
    3],
   []),
  ('regression spawn tile #2',
   [['.~....##', '......#.', '~...#..#', '~......~'],
    [2, 3],
    [[-1, 3], [0, 1], [1, -1], [1, 2], [2, 5], [1, 3]],
    2,
    1],
   [[2, 5]]),
  ('regression spawn tile #3',
   [['.#..#~..', '~...#.#~', '..~.~...'], [0, 4], [[3, 7], [2, 5], [3, -1], [1, 0], [3, 1], [-1, -1]], 2, 3],
   [[2, 5]]),
  ('regression spawn tile #4',
   [['~...', '~~.~', '....', '#.~#', '..#~', '....', '#.~.'],
    [6, 1],
    [[1, 1], [-1, 0], [6, 1], [5, 3], [4, 1], [2, 1], [-1, 3], [1, -1], [6, 1]],
    1,
    1],
   [[5, 3]]),
  ('diagonal neighbour spawn #1', [['....', '....', '....'], [0, 0], [[1, 2], [2, 3]], 1, 3], [[1, 2]]),
  ('exact safe radius #1', [['.....', '.....'], [0, 0], [[1, 1], [0, 2]], 2, 2], [[0, 2]]),
  ('control #1',
   [['....', '.#.~', '..~~', '...#'], [2, 0], [[4, -1], [3, 3], [3, 1], [1, 0], [1, 3]], 0, 2],
   [[3, 1], [1, 0]]),
  ('control #2',
   [['.#.', '...', '#..', '...', '#..', '#.~'], [5, 2], [[2, -1], [5, 2], [1, 3], [2, 0], [6, 0]], 3, 0],
   [])],
 [('regression spawn tile #1',
   [['.#..#~..', '~...#.#~', '..~.~...'], [0, 4], [[3, 7], [2, 5], [3, -1], [1, 0], [3, 1], [-1, -1]], 2, 3],
   [[2, 5]]),
  ('regression spawn tile #2',
   [['~...', '~~.~', '....', '#.~#', '..#~', '....', '#.~.'],
    [6, 1],
    [[1, 1], [-1, 0], [6, 1], [5, 3], [4, 1], [2, 1], [-1, 3], [1, -1], [6, 1]],
    1,
    1],
   [[5, 3]]),
  ('regression spawn tile #3',
   [['..~.#', '..#~.', '.....', '.....', '~~~~.', '.#..#', '...#.', '#.~##'], [7, 1], [[4, 2]], 3, 2],
   []),
  ('regression spawn tile #4',
   [['..~..', '..#..', '.#..~'],
    [1, 0],
    [[0, 2], [-1, -1], [0, 1], [3, 5], [-1, 3], [3, 4], [-1, 0], [2, 2], [2, 5], [2, 1]],
    0,
    1],
   [[0, 1]]),
  ('negative index candidate #1', [['...', '...', '..#'], [0, 0], [[-1, -1], [2, 0]], 1, 2], [[2, 0]]),
  ('diagonal neighbour spawn #1', [['....', '....', '....'], [0, 0], [[1, 2], [2, 3]], 1, 3], [[1, 2]]),
  ('control #1',
   [['.#.#~.', '~.....', '.~#...', '......', '..#.#.'], [0, 0], [[1, 1], [5, 0], [3, 3], [-1, 0]], 0, 5],
   [[1, 1], [3, 3]]),
  ('control #2',
   [['...', '~..', '...', '..#', '...', '..~'],
    [0, 0],
    [[6, 1], [3, 2], [0, 3], [2, -1], [1, 1], [5, 1]],
    3,
    0],
   [])]]
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
regression spawn tile #1[[4, 1], [6, 1]][[6, 1], [5, 3]]Failed
regression spawn tile #2[[1, 0], [5, 2], [2, 3]][[1, 0], [5, 2], [1, 4]]Failed
regression spawn tile #3[[1, 0], [3, 7]][[3, 7]]Failed
regression spawn tile #4[[2, 0]][]Failed
diagonal neighbour spawn #1[[1, 2]][[1, 2]]Passed
exact safe radius #1[[0, 2]][[0, 2]]Passed
negative index candidate #1[[2, 0]][[2, 0]]Passed
control #1[][]Passed

SHA-256 / 5af784b2dc8214905bdd599443438c5d81c3629a9b4815042bbed7ec06853c10

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(grid, player, candidates, min_dist, count):
    chosen = []
    pr, pc = player
    for r, c in candidates:
        if len(chosen) >= count:
            break
        if not (0 <= r < len(grid) and 0 <= c < len(grid[0])) or grid[r][c] not in '.~':
            continue
        if max(abs(r - pr), abs(c - pc)) < min_dist:
            continue
        if any(max(abs(r - a), abs(c - b)) < 2 for a, b in chosen):
            continue
        chosen.append([r, c])
    return chosen
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('regression spawn tile #1',
   [['...#', '.#..', '#.#~', '~~.~', '~~#.', '~##.', '....', '...#'],
    [1, 2],
    [[0, 1], [6, 4], [5, 4], [4, 1], [4, 0], [6, 1], [0, 4], [7, 2], [5, 3], [-1, 1]],
    3,
    2],
   [[6, 1], [5, 3]]),
  ('regression spawn tile #2',
   [['~......', '......~', '~#.~##.', '.#..~~.', '#..#~#.', '......#'],
    [3, 2],
    [[1, 0], [6, 3], [5, 2], [4, 0], [2, 3], [1, 4], [6, 7], [2, 7]],
    0,
    5],
   [[1, 0], [5, 2], [1, 4]]),
  ('regression spawn tile #3',
   [['~#...~..', '~...~~#.', '~~.#.##~', '~.#.#~#.'],
    [0, 5],
    [[2, 8], [1, 0], [2, 1], [3, 7], [2, 1], [-1, 5], [3, 2], [0, 0]],
    1,
    3],
   [[3, 7]]),
  ('regression spawn tile #4',
   [['#.#', '~..', '~.#', '.#~', '.#.', '#..', '##.', '~#.'], [7, 0], [[5, 0], [2, 0], [5, 3]], 3, 3],
   []),
  ('diagonal neighbour spawn #1', [['....', '....', '....'], [0, 0], [[1, 2], [2, 3]], 1, 3], [[1, 2]]),
  ('exact safe radius #1', [['.....', '.....'], [0, 0], [[1, 1], [0, 2]], 2, 2], [[0, 2]]),
  ('negative index candidate #1', [['...', '...', '..#'], [0, 0], [[-1, -1], [2, 0]], 1, 2], [[2, 0]]),
  ('control #1',
   [['#.#', '...', '#.#', '.#.', '...', '...', '...', '##.'], [6, 2], [[2, -1], [7, 2]], 0, 0],
   [])],
 [('regression spawn tile #1',
   [['~#...~..', '~...~~#.', '~~.#.##~', '~.#.#~#.'],
    [0, 5],
    [[2, 8], [1, 0], [2, 1], [3, 7], [2, 1], [-1, 5], [3, 2], [0, 0]],
    1,
    3],
   [[3, 7]]),
  ('regression spawn tile #2',
   [['#.#', '~..', '~.#', '.#~', '.#.', '#..', '##.', '~#.'], [7, 0], [[5, 0], [2, 0], [5, 3]], 3, 3],
   []),
  ('regression spawn tile #3',
   [['..~##.', '~..~..', '.~~#.~'], [0, 3], [[1, 4], [-1, 6], [1, 1], [2, 4], [2, 2], [1, 0]], 3, 5],
   []),
  ('regression spawn tile #4',
   [['..##....', '~.#.#.~#', '##...#.~', '.....#~~', '#...#..~', '...#.~.~'],
    [1, 0],
    [[2, 2], [3, 8], [5, 7], [5, 5]],
    0,
    5],
   [[2, 2]]),
  ('negative index candidate #1', [['...', '...', '..#'], [0, 0], [[-1, -1], [2, 0]], 1, 2], [[2, 0]]),
  ('diagonal neighbour spawn #1', [['....', '....', '....'], [0, 0], [[1, 2], [2, 3]], 1, 3], [[1, 2]]),
  ('control #1',
   [['#.#', '...', '#.#', '.#.', '...', '...', '...', '##.'], [6, 2], [[2, -1], [7, 2]], 0, 0],
   []),
  ('control #2',
   [['.#~', '...', '~.#', '#.~', '..#', '#~.'], [3, 1], [[5, 0], [1, 0], [6, -1], [6, -1]], 0, 5],
   [[1, 0]])],
 [('regression spawn tile #1',
   [['..~##.', '~..~..', '.~~#.~'], [0, 3], [[1, 4], [-1, 6], [1, 1], [2, 4], [2, 2], [1, 0]], 3, 5],
   []),
  ('regression spawn tile #2',
   [['..##....', '~.#.#.~#', '##...#.~', '.....#~~', '#...#..~', '...#.~.~'],
    [1, 0],
    [[2, 2], [3, 8], [5, 7], [5, 5]],
    0,
    5],
   [[2, 2]]),
  ('regression spawn tile #3',
   [['~#~~', '.~~.', '~.~.', '....', '.#.~'],
    [1, 0],
    [[-1, 2], [-1, 1], [1, 2], [5, 2], [-1, 4], [-1, 2], [2, 0]],
    2,
    3],
   []),
  ('regression spawn tile #4',
   [['.~....##', '......#.', '~...#..#', '~......~'],
    [2, 3],
    [[-1, 3], [0, 1], [1, -1], [1, 2], [2, 5], [1, 3]],
    2,
    1],
   [[2, 5]]),
  ('exact safe radius #1', [['.....', '.....'], [0, 0], [[1, 1], [0, 2]], 2, 2], [[0, 2]]),
  ('negative index candidate #1', [['...', '...', '..#'], [0, 0], [[-1, -1], [2, 0]], 1, 2], [[2, 0]]),
  ('control #1',
   [['.#~', '...', '~.#', '#.~', '..#', '#~.'], [3, 1], [[5, 0], [1, 0], [6, -1], [6, -1]], 0, 5],
   [[1, 0]]),
  ('control #2',
   [['...#...', '......~', '~~.....', '..~....', '.~....~', '.....#.'], [5, 2], [[1, 5]], 0, 0],
   [])],
 [('regression spawn tile #1',
   [['~#~~', '.~~.', '~.~.', '....', '.#.~'],
    [1, 0],
    [[-1, 2], [-1, 1], [1, 2], [5, 2], [-1, 4], [-1, 2], [2, 0]],
    2,
    3],
   []),
  ('regression spawn tile #2',
   [['.~....##', '......#.', '~...#..#', '~......~'],
    [2, 3],
    [[-1, 3], [0, 1], [1, -1], [1, 2], [2, 5], [1, 3]],
    2,
    1],
   [[2, 5]]),
  ('regression spawn tile #3',
   [['.#..#~..', '~...#.#~', '..~.~...'], [0, 4], [[3, 7], [2, 5], [3, -1], [1, 0], [3, 1], [-1, -1]], 2, 3],
   [[2, 5]]),
  ('regression spawn tile #4',
   [['~...', '~~.~', '....', '#.~#', '..#~', '....', '#.~.'],
    [6, 1],
    [[1, 1], [-1, 0], [6, 1], [5, 3], [4, 1], [2, 1], [-1, 3], [1, -1], [6, 1]],
    1,
    1],
   [[5, 3]]),
  ('diagonal neighbour spawn #1', [['....', '....', '....'], [0, 0], [[1, 2], [2, 3]], 1, 3], [[1, 2]]),
  ('exact safe radius #1', [['.....', '.....'], [0, 0], [[1, 1], [0, 2]], 2, 2], [[0, 2]]),
  ('control #1',
   [['....', '.#.~', '..~~', '...#'], [2, 0], [[4, -1], [3, 3], [3, 1], [1, 0], [1, 3]], 0, 2],
   [[3, 1], [1, 0]]),
  ('control #2',
   [['.#.', '...', '#..', '...', '#..', '#.~'], [5, 2], [[2, -1], [5, 2], [1, 3], [2, 0], [6, 0]], 3, 0],
   [])],
 [('regression spawn tile #1',
   [['.#..#~..', '~...#.#~', '..~.~...'], [0, 4], [[3, 7], [2, 5], [3, -1], [1, 0], [3, 1], [-1, -1]], 2, 3],
   [[2, 5]]),
  ('regression spawn tile #2',
   [['~...', '~~.~', '....', '#.~#', '..#~', '....', '#.~.'],
    [6, 1],
    [[1, 1], [-1, 0], [6, 1], [5, 3], [4, 1], [2, 1], [-1, 3], [1, -1], [6, 1]],
    1,
    1],
   [[5, 3]]),
  ('regression spawn tile #3',
   [['..~.#', '..#~.', '.....', '.....', '~~~~.', '.#..#', '...#.', '#.~##'], [7, 1], [[4, 2]], 3, 2],
   []),
  ('regression spawn tile #4',
   [['..~..', '..#..', '.#..~'],
    [1, 0],
    [[0, 2], [-1, -1], [0, 1], [3, 5], [-1, 3], [3, 4], [-1, 0], [2, 2], [2, 5], [2, 1]],
    0,
    1],
   [[0, 1]]),
  ('negative index candidate #1', [['...', '...', '..#'], [0, 0], [[-1, -1], [2, 0]], 1, 2], [[2, 0]]),
  ('diagonal neighbour spawn #1', [['....', '....', '....'], [0, 0], [[1, 2], [2, 3]], 1, 3], [[1, 2]]),
  ('control #1',
   [['.#.#~.', '~.....', '.~#...', '......', '..#.#.'], [0, 0], [[1, 1], [5, 0], [3, 3], [-1, 0]], 0, 5],
   [[1, 1], [3, 3]]),
  ('control #2',
   [['...', '~..', '...', '..#', '...', '..~'],
    [0, 0],
    [[6, 1], [3, 2], [0, 3], [2, -1], [1, 1], [5, 1]],
    3,
    0],
   [])]]
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
regression spawn tile #1[[4, 1], [6, 1]][[6, 1], [5, 3]]Failed
regression spawn tile #2[[1, 0], [5, 2], [2, 3]][[1, 0], [5, 2], [1, 4]]Failed
regression spawn tile #3[[1, 0], [3, 7]][[3, 7]]Failed
regression spawn tile #4[[2, 0]][]Failed
diagonal neighbour spawn #1[[1, 2]][[1, 2]]Passed
exact safe radius #1[[0, 2]][[0, 2]]Passed
negative index candidate #1[[2, 0]][[2, 0]]Passed
control #1[][]Passed

SHA-256 / 1b0caddb47cfb8d8f88db31492f0424ec630126708054c65aabd260b246f4a54

3 / The verified repair

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

N = 1
observations = []
def solve(grid, player, candidates, min_dist, count):
    chosen = []
    pr, pc = player
    for r, c in candidates:
        if len(chosen) >= count:
            break
        if not (0 <= r < len(grid) and 0 <= c < len(grid[0])) or grid[r][c] != '.':
            continue
        if max(abs(r - pr), abs(c - pc)) < min_dist:
            continue
        if any(max(abs(r - a), abs(c - b)) < 2 for a, b in chosen):
            continue
        chosen.append([r, c])
    return chosen
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('regression spawn tile #1',
   [['...#', '.#..', '#.#~', '~~.~', '~~#.', '~##.', '....', '...#'],
    [1, 2],
    [[0, 1], [6, 4], [5, 4], [4, 1], [4, 0], [6, 1], [0, 4], [7, 2], [5, 3], [-1, 1]],
    3,
    2],
   [[6, 1], [5, 3]]),
  ('regression spawn tile #2',
   [['~......', '......~', '~#.~##.', '.#..~~.', '#..#~#.', '......#'],
    [3, 2],
    [[1, 0], [6, 3], [5, 2], [4, 0], [2, 3], [1, 4], [6, 7], [2, 7]],
    0,
    5],
   [[1, 0], [5, 2], [1, 4]]),
  ('regression spawn tile #3',
   [['~#...~..', '~...~~#.', '~~.#.##~', '~.#.#~#.'],
    [0, 5],
    [[2, 8], [1, 0], [2, 1], [3, 7], [2, 1], [-1, 5], [3, 2], [0, 0]],
    1,
    3],
   [[3, 7]]),
  ('regression spawn tile #4',
   [['#.#', '~..', '~.#', '.#~', '.#.', '#..', '##.', '~#.'], [7, 0], [[5, 0], [2, 0], [5, 3]], 3, 3],
   []),
  ('diagonal neighbour spawn #1', [['....', '....', '....'], [0, 0], [[1, 2], [2, 3]], 1, 3], [[1, 2]]),
  ('exact safe radius #1', [['.....', '.....'], [0, 0], [[1, 1], [0, 2]], 2, 2], [[0, 2]]),
  ('negative index candidate #1', [['...', '...', '..#'], [0, 0], [[-1, -1], [2, 0]], 1, 2], [[2, 0]]),
  ('control #1',
   [['#.#', '...', '#.#', '.#.', '...', '...', '...', '##.'], [6, 2], [[2, -1], [7, 2]], 0, 0],
   [])],
 [('regression spawn tile #1',
   [['~#...~..', '~...~~#.', '~~.#.##~', '~.#.#~#.'],
    [0, 5],
    [[2, 8], [1, 0], [2, 1], [3, 7], [2, 1], [-1, 5], [3, 2], [0, 0]],
    1,
    3],
   [[3, 7]]),
  ('regression spawn tile #2',
   [['#.#', '~..', '~.#', '.#~', '.#.', '#..', '##.', '~#.'], [7, 0], [[5, 0], [2, 0], [5, 3]], 3, 3],
   []),
  ('regression spawn tile #3',
   [['..~##.', '~..~..', '.~~#.~'], [0, 3], [[1, 4], [-1, 6], [1, 1], [2, 4], [2, 2], [1, 0]], 3, 5],
   []),
  ('regression spawn tile #4',
   [['..##....', '~.#.#.~#', '##...#.~', '.....#~~', '#...#..~', '...#.~.~'],
    [1, 0],
    [[2, 2], [3, 8], [5, 7], [5, 5]],
    0,
    5],
   [[2, 2]]),
  ('negative index candidate #1', [['...', '...', '..#'], [0, 0], [[-1, -1], [2, 0]], 1, 2], [[2, 0]]),
  ('diagonal neighbour spawn #1', [['....', '....', '....'], [0, 0], [[1, 2], [2, 3]], 1, 3], [[1, 2]]),
  ('control #1',
   [['#.#', '...', '#.#', '.#.', '...', '...', '...', '##.'], [6, 2], [[2, -1], [7, 2]], 0, 0],
   []),
  ('control #2',
   [['.#~', '...', '~.#', '#.~', '..#', '#~.'], [3, 1], [[5, 0], [1, 0], [6, -1], [6, -1]], 0, 5],
   [[1, 0]])],
 [('regression spawn tile #1',
   [['..~##.', '~..~..', '.~~#.~'], [0, 3], [[1, 4], [-1, 6], [1, 1], [2, 4], [2, 2], [1, 0]], 3, 5],
   []),
  ('regression spawn tile #2',
   [['..##....', '~.#.#.~#', '##...#.~', '.....#~~', '#...#..~', '...#.~.~'],
    [1, 0],
    [[2, 2], [3, 8], [5, 7], [5, 5]],
    0,
    5],
   [[2, 2]]),
  ('regression spawn tile #3',
   [['~#~~', '.~~.', '~.~.', '....', '.#.~'],
    [1, 0],
    [[-1, 2], [-1, 1], [1, 2], [5, 2], [-1, 4], [-1, 2], [2, 0]],
    2,
    3],
   []),
  ('regression spawn tile #4',
   [['.~....##', '......#.', '~...#..#', '~......~'],
    [2, 3],
    [[-1, 3], [0, 1], [1, -1], [1, 2], [2, 5], [1, 3]],
    2,
    1],
   [[2, 5]]),
  ('exact safe radius #1', [['.....', '.....'], [0, 0], [[1, 1], [0, 2]], 2, 2], [[0, 2]]),
  ('negative index candidate #1', [['...', '...', '..#'], [0, 0], [[-1, -1], [2, 0]], 1, 2], [[2, 0]]),
  ('control #1',
   [['.#~', '...', '~.#', '#.~', '..#', '#~.'], [3, 1], [[5, 0], [1, 0], [6, -1], [6, -1]], 0, 5],
   [[1, 0]]),
  ('control #2',
   [['...#...', '......~', '~~.....', '..~....', '.~....~', '.....#.'], [5, 2], [[1, 5]], 0, 0],
   [])],
 [('regression spawn tile #1',
   [['~#~~', '.~~.', '~.~.', '....', '.#.~'],
    [1, 0],
    [[-1, 2], [-1, 1], [1, 2], [5, 2], [-1, 4], [-1, 2], [2, 0]],
    2,
    3],
   []),
  ('regression spawn tile #2',
   [['.~....##', '......#.', '~...#..#', '~......~'],
    [2, 3],
    [[-1, 3], [0, 1], [1, -1], [1, 2], [2, 5], [1, 3]],
    2,
    1],
   [[2, 5]]),
  ('regression spawn tile #3',
   [['.#..#~..', '~...#.#~', '..~.~...'], [0, 4], [[3, 7], [2, 5], [3, -1], [1, 0], [3, 1], [-1, -1]], 2, 3],
   [[2, 5]]),
  ('regression spawn tile #4',
   [['~...', '~~.~', '....', '#.~#', '..#~', '....', '#.~.'],
    [6, 1],
    [[1, 1], [-1, 0], [6, 1], [5, 3], [4, 1], [2, 1], [-1, 3], [1, -1], [6, 1]],
    1,
    1],
   [[5, 3]]),
  ('diagonal neighbour spawn #1', [['....', '....', '....'], [0, 0], [[1, 2], [2, 3]], 1, 3], [[1, 2]]),
  ('exact safe radius #1', [['.....', '.....'], [0, 0], [[1, 1], [0, 2]], 2, 2], [[0, 2]]),
  ('control #1',
   [['....', '.#.~', '..~~', '...#'], [2, 0], [[4, -1], [3, 3], [3, 1], [1, 0], [1, 3]], 0, 2],
   [[3, 1], [1, 0]]),
  ('control #2',
   [['.#.', '...', '#..', '...', '#..', '#.~'], [5, 2], [[2, -1], [5, 2], [1, 3], [2, 0], [6, 0]], 3, 0],
   [])],
 [('regression spawn tile #1',
   [['.#..#~..', '~...#.#~', '..~.~...'], [0, 4], [[3, 7], [2, 5], [3, -1], [1, 0], [3, 1], [-1, -1]], 2, 3],
   [[2, 5]]),
  ('regression spawn tile #2',
   [['~...', '~~.~', '....', '#.~#', '..#~', '....', '#.~.'],
    [6, 1],
    [[1, 1], [-1, 0], [6, 1], [5, 3], [4, 1], [2, 1], [-1, 3], [1, -1], [6, 1]],
    1,
    1],
   [[5, 3]]),
  ('regression spawn tile #3',
   [['..~.#', '..#~.', '.....', '.....', '~~~~.', '.#..#', '...#.', '#.~##'], [7, 1], [[4, 2]], 3, 2],
   []),
  ('regression spawn tile #4',
   [['..~..', '..#..', '.#..~'],
    [1, 0],
    [[0, 2], [-1, -1], [0, 1], [3, 5], [-1, 3], [3, 4], [-1, 0], [2, 2], [2, 5], [2, 1]],
    0,
    1],
   [[0, 1]]),
  ('negative index candidate #1', [['...', '...', '..#'], [0, 0], [[-1, -1], [2, 0]], 1, 2], [[2, 0]]),
  ('diagonal neighbour spawn #1', [['....', '....', '....'], [0, 0], [[1, 2], [2, 3]], 1, 3], [[1, 2]]),
  ('control #1',
   [['.#.#~.', '~.....', '.~#...', '......', '..#.#.'], [0, 0], [[1, 1], [5, 0], [3, 3], [-1, 0]], 0, 5],
   [[1, 1], [3, 3]]),
  ('control #2',
   [['...', '~..', '...', '..#', '...', '..~'],
    [0, 0],
    [[6, 1], [3, 2], [0, 3], [2, -1], [1, 1], [5, 1]],
    3,
    0],
   [])]]
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
regression spawn tile #1[[6, 1], [5, 3]][[6, 1], [5, 3]]Passed
regression spawn tile #2[[1, 0], [5, 2], [1, 4]][[1, 0], [5, 2], [1, 4]]Passed
regression spawn tile #3[[3, 7]][[3, 7]]Passed
regression spawn tile #4[][]Passed
diagonal neighbour spawn #1[[1, 2]][[1, 2]]Passed
exact safe radius #1[[0, 2]][[0, 2]]Passed
negative index candidate #1[[2, 0]][[2, 0]]Passed
control #1[][]Passed

SHA-256 / 98f7cbd51002ddb7068dd0524b0623ea81b0d96512d2f37a1e192c1851f4d3c0

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

Case digest / 3de658c2f51a77f993e44ba208dae8fdc4af04145dfb9f2ae0f601ce1f79b71d