FAILURE MAP
← Case archive

FA-86426 / Procedural level generation constraints / Open access

Enemy spawn point selection: Diagonal spawns count as far away · case 01

Enemies spawn diagonally next to the player.

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

ROOT CAUSE

Player distance uses Manhattan instead of Chebyshev distance.

VERIFIED REPAIR

Restore `max(abs(r - pr), abs(c - pc))` at the player distance metric step.

Unsuccessful approach: Using the smaller axis distance underestimates separation everywhere.

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 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 = [[('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]]),
  ('regression player distance metric #1',
   [['......', '..#...', '...~..', '.~#...', '~..~~.'],
    [1, 3],
    [[0, 0], [-1, 4], [-1, 2], [5, 4], [5, 1], [5, 1], [3, 5], [5, 6], [1, 4], [5, 2]],
    3,
    3],
   [[0, 0]]),
  ('fault site player distance metric #1',
   [['..~##.', '~..~..', '.~~#.~'], [0, 3], [[1, 4], [-1, 6], [1, 1], [2, 4], [2, 2], [1, 0]], 3, 5],
   []),
  ('partial repair boundary #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]]),
  ('partial repair boundary #2',
   [['~..~.#.', '.....#.', '.......', '#......', '##....~'],
    [1, 4],
    [[5, 0], [2, 0], [1, 6], [-1, 7], [0, 2], [1, 1], [3, 5], [2, 3], [5, 4]],
    1,
    3],
   [[2, 0], [1, 6], [0, 2]]),
  ('diagonal neighbour spawn #1', [['....', '....', '....'], [0, 0], [[1, 2], [2, 3]], 1, 3], [[1, 2]]),
  ('control #1',
   [['#.#', '...', '#.#', '.#.', '...', '...', '...', '##.'], [6, 2], [[2, -1], [7, 2]], 0, 0],
   [])],
 [('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]]),
  ('fault site player distance metric #1',
   [['..~##.', '~..~..', '.~~#.~'], [0, 3], [[1, 4], [-1, 6], [1, 1], [2, 4], [2, 2], [1, 0]], 3, 5],
   []),
  ('fault site player distance metric #2',
   [['...', '#..', '.~~', '#~.', '.~.', '~..'], [2, 1], [[-1, 0], [1, 1], [3, 2], [4, 3]], 2, 1],
   []),
  ('partial repair boundary #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]]),
  ('partial repair boundary #2',
   [['~..~.#.', '.....#.', '.......', '#......', '##....~'],
    [1, 4],
    [[5, 0], [2, 0], [1, 6], [-1, 7], [0, 2], [1, 1], [3, 5], [2, 3], [5, 4]],
    1,
    3],
   [[2, 0], [1, 6], [0, 2]]),
  ('diagonal neighbour spawn #1', [['....', '....', '....'], [0, 0], [[1, 2], [2, 3]], 1, 3], [[1, 2]]),
  ('control #1',
   [['#.#', '...', '#.#', '.#.', '...', '...', '...', '##.'], [6, 2], [[2, -1], [7, 2]], 0, 0],
   [])],
 [('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]]),
  ('fault site player distance metric #1',
   [['~...', '.~..', '.#..', '#.~.', '....', '...#', '..#.', '~~.#'],
    [5, 2],
    [[8, 4], [4, -1], [8, -1], [4, 3]],
    2,
    1],
   []),
  ('regression player distance metric #1',
   [['~...', '....', '~~..', '.#..', '...~', '~.~.', '..~.'],
    [2, 2],
    [[3, 3], [3, 2], [2, 0], [6, 3], [7, 2], [7, 1], [7, 2], [0, 3]],
    3,
    3],
   [[6, 3]]),
  ('partial repair boundary #1',
   [['.~.', '#..', '.#.', '...', '..#', '.~.', '#..', '~..'],
    [0, 2],
    [[3, 3], [3, 1], [3, 0], [7, -1], [4, 3], [7, 1]],
    3,
    2],
   [[3, 1], [7, 1]]),
  ('regression player distance metric #2',
   [['......', '..#...', '...~..', '.~#...', '~..~~.'],
    [1, 3],
    [[0, 0], [-1, 4], [-1, 2], [5, 4], [5, 1], [5, 1], [3, 5], [5, 6], [1, 4], [5, 2]],
    3,
    3],
   [[0, 0]]),
  ('diagonal neighbour spawn #1', [['....', '....', '....'], [0, 0], [[1, 2], [2, 3]], 1, 3], [[1, 2]]),
  ('control #1',
   [['.#~', '...', '~.#', '#.~', '..#', '#~.'], [3, 1], [[5, 0], [1, 0], [6, -1], [6, -1]], 0, 5],
   [[1, 0]])],
 [('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]]),
  ('regression player distance metric #1',
   [['.~....##', '......#.', '~...#..#', '~......~'],
    [2, 3],
    [[-1, 3], [0, 1], [1, -1], [1, 2], [2, 5], [1, 3]],
    2,
    1],
   [[2, 5]]),
  ('regression player distance metric #2',
   [['.~.~....', '....~~~#', '......~~', '....#...'],
    [1, 5],
    [[-1, 7], [0, 7], [2, 5], [0, 8], [2, 1], [-1, 3], [1, 5]],
    3,
    3],
   [[2, 1]]),
  ('partial repair boundary #1',
   [['..~...', '#.~...', '.#....'],
    [0, 5],
    [[0, 3], [0, 0], [1, 1], [3, 3], [2, 1], [0, 1], [0, 5], [2, 4], [2, 3], [1, 4]],
    1,
    3],
   [[0, 3], [0, 0], [2, 4]]),
  ('partial repair boundary #2',
   [['.~..', '#...', '..~~', '#...', '..~.'],
    [3, 0],
    [[0, 4], [5, 3], [3, 2], [4, -1], [-1, -1], [2, 0], [1, 2], [1, -1], [0, 1]],
    1,
    3],
   [[3, 2], [2, 0], [1, 2]]),
  ('diagonal neighbour spawn #1', [['....', '....', '....'], [0, 0], [[1, 2], [2, 3]], 1, 3], [[1, 2]]),
  ('control #1',
   [['...#...', '......~', '~~.....', '..~....', '.~....~', '.....#.'], [5, 2], [[1, 5]], 0, 0],
   [])],
 [('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]]),
  ('fault site player distance metric #1',
   [['..~#.', '.~...', '~..~.', '..~..', '~..#.', '##...', '....~', '...#.'],
    [5, 0],
    [[5, 1], [2, 4], [3, 5], [6, 1], [4, 0], [8, 1], [2, 4], [8, 1], [6, 5], [7, 2]],
    3,
    5],
   [[2, 4]]),
  ('regression player distance metric #1',
   [['..~.~', '..#..', '.~...', '..~.~', '.~#..', '.....', '.....'],
    [0, 2],
    [[2, 0], [4, 5], [5, 0], [0, 5], [5, 4], [7, 1], [-1, -1], [4, 0], [7, 3]],
    3,
    3],
   [[5, 0], [5, 4]]),
  ('regression player distance metric #2',
   [['~...', '....', '~~..', '.#..', '...~', '~.~.', '..~.'],
    [2, 2],
    [[3, 3], [3, 2], [2, 0], [6, 3], [7, 2], [7, 1], [7, 2], [0, 3]],
    3,
    3],
   [[6, 3]]),
  ('partial repair boundary #1',
   [['.#~', '...', '...', '.~.', '#.~', '.#.', '~..'],
    [2, 0],
    [[4, 2], [0, -1], [0, 3], [6, 1], [4, 0], [4, 2], [7, 2], [3, 2], [1, 2]],
    3,
    1],
   [[6, 1]]),
  ('diagonal neighbour spawn #1', [['....', '....', '....'], [0, 0], [[1, 2], [2, 3]], 1, 3], [[1, 2]]),
  ('control #1',
   [['....', '.#.~', '..~~', '...#'], [2, 0], [[4, -1], [3, 3], [3, 1], [1, 0], [1, 3]], 0, 2],
   [[3, 1], [1, 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
exact safe radius #1[[1, 1]][[0, 2]]Failed
negative index candidate #1[[2, 0]][[2, 0]]Passed
regression player distance metric #1[[0, 0], [3, 5]][[0, 0]]Failed
fault site player distance metric #1[[1, 1], [2, 4]][]Failed
partial repair boundary #1[[6, 1], [5, 3]][[6, 1], [5, 3]]Passed
partial repair boundary #2[[2, 0], [1, 6], [0, 2]][[2, 0], [1, 6], [0, 2]]Passed
diagonal neighbour spawn #1[[1, 2]][[1, 2]]Passed
control #1[][]Passed

SHA-256 / c1d7890a1b4b97fa03cbf12376cb0560966357bcddae6146736336358634af09

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] != '.':
            continue
        if min(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 = [[('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]]),
  ('regression player distance metric #1',
   [['......', '..#...', '...~..', '.~#...', '~..~~.'],
    [1, 3],
    [[0, 0], [-1, 4], [-1, 2], [5, 4], [5, 1], [5, 1], [3, 5], [5, 6], [1, 4], [5, 2]],
    3,
    3],
   [[0, 0]]),
  ('fault site player distance metric #1',
   [['..~##.', '~..~..', '.~~#.~'], [0, 3], [[1, 4], [-1, 6], [1, 1], [2, 4], [2, 2], [1, 0]], 3, 5],
   []),
  ('partial repair boundary #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]]),
  ('partial repair boundary #2',
   [['~..~.#.', '.....#.', '.......', '#......', '##....~'],
    [1, 4],
    [[5, 0], [2, 0], [1, 6], [-1, 7], [0, 2], [1, 1], [3, 5], [2, 3], [5, 4]],
    1,
    3],
   [[2, 0], [1, 6], [0, 2]]),
  ('diagonal neighbour spawn #1', [['....', '....', '....'], [0, 0], [[1, 2], [2, 3]], 1, 3], [[1, 2]]),
  ('control #1',
   [['#.#', '...', '#.#', '.#.', '...', '...', '...', '##.'], [6, 2], [[2, -1], [7, 2]], 0, 0],
   [])],
 [('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]]),
  ('fault site player distance metric #1',
   [['..~##.', '~..~..', '.~~#.~'], [0, 3], [[1, 4], [-1, 6], [1, 1], [2, 4], [2, 2], [1, 0]], 3, 5],
   []),
  ('fault site player distance metric #2',
   [['...', '#..', '.~~', '#~.', '.~.', '~..'], [2, 1], [[-1, 0], [1, 1], [3, 2], [4, 3]], 2, 1],
   []),
  ('partial repair boundary #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]]),
  ('partial repair boundary #2',
   [['~..~.#.', '.....#.', '.......', '#......', '##....~'],
    [1, 4],
    [[5, 0], [2, 0], [1, 6], [-1, 7], [0, 2], [1, 1], [3, 5], [2, 3], [5, 4]],
    1,
    3],
   [[2, 0], [1, 6], [0, 2]]),
  ('diagonal neighbour spawn #1', [['....', '....', '....'], [0, 0], [[1, 2], [2, 3]], 1, 3], [[1, 2]]),
  ('control #1',
   [['#.#', '...', '#.#', '.#.', '...', '...', '...', '##.'], [6, 2], [[2, -1], [7, 2]], 0, 0],
   [])],
 [('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]]),
  ('fault site player distance metric #1',
   [['~...', '.~..', '.#..', '#.~.', '....', '...#', '..#.', '~~.#'],
    [5, 2],
    [[8, 4], [4, -1], [8, -1], [4, 3]],
    2,
    1],
   []),
  ('regression player distance metric #1',
   [['~...', '....', '~~..', '.#..', '...~', '~.~.', '..~.'],
    [2, 2],
    [[3, 3], [3, 2], [2, 0], [6, 3], [7, 2], [7, 1], [7, 2], [0, 3]],
    3,
    3],
   [[6, 3]]),
  ('partial repair boundary #1',
   [['.~.', '#..', '.#.', '...', '..#', '.~.', '#..', '~..'],
    [0, 2],
    [[3, 3], [3, 1], [3, 0], [7, -1], [4, 3], [7, 1]],
    3,
    2],
   [[3, 1], [7, 1]]),
  ('regression player distance metric #2',
   [['......', '..#...', '...~..', '.~#...', '~..~~.'],
    [1, 3],
    [[0, 0], [-1, 4], [-1, 2], [5, 4], [5, 1], [5, 1], [3, 5], [5, 6], [1, 4], [5, 2]],
    3,
    3],
   [[0, 0]]),
  ('diagonal neighbour spawn #1', [['....', '....', '....'], [0, 0], [[1, 2], [2, 3]], 1, 3], [[1, 2]]),
  ('control #1',
   [['.#~', '...', '~.#', '#.~', '..#', '#~.'], [3, 1], [[5, 0], [1, 0], [6, -1], [6, -1]], 0, 5],
   [[1, 0]])],
 [('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]]),
  ('regression player distance metric #1',
   [['.~....##', '......#.', '~...#..#', '~......~'],
    [2, 3],
    [[-1, 3], [0, 1], [1, -1], [1, 2], [2, 5], [1, 3]],
    2,
    1],
   [[2, 5]]),
  ('regression player distance metric #2',
   [['.~.~....', '....~~~#', '......~~', '....#...'],
    [1, 5],
    [[-1, 7], [0, 7], [2, 5], [0, 8], [2, 1], [-1, 3], [1, 5]],
    3,
    3],
   [[2, 1]]),
  ('partial repair boundary #1',
   [['..~...', '#.~...', '.#....'],
    [0, 5],
    [[0, 3], [0, 0], [1, 1], [3, 3], [2, 1], [0, 1], [0, 5], [2, 4], [2, 3], [1, 4]],
    1,
    3],
   [[0, 3], [0, 0], [2, 4]]),
  ('partial repair boundary #2',
   [['.~..', '#...', '..~~', '#...', '..~.'],
    [3, 0],
    [[0, 4], [5, 3], [3, 2], [4, -1], [-1, -1], [2, 0], [1, 2], [1, -1], [0, 1]],
    1,
    3],
   [[3, 2], [2, 0], [1, 2]]),
  ('diagonal neighbour spawn #1', [['....', '....', '....'], [0, 0], [[1, 2], [2, 3]], 1, 3], [[1, 2]]),
  ('control #1',
   [['...#...', '......~', '~~.....', '..~....', '.~....~', '.....#.'], [5, 2], [[1, 5]], 0, 0],
   [])],
 [('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]]),
  ('fault site player distance metric #1',
   [['..~#.', '.~...', '~..~.', '..~..', '~..#.', '##...', '....~', '...#.'],
    [5, 0],
    [[5, 1], [2, 4], [3, 5], [6, 1], [4, 0], [8, 1], [2, 4], [8, 1], [6, 5], [7, 2]],
    3,
    5],
   [[2, 4]]),
  ('regression player distance metric #1',
   [['..~.~', '..#..', '.~...', '..~.~', '.~#..', '.....', '.....'],
    [0, 2],
    [[2, 0], [4, 5], [5, 0], [0, 5], [5, 4], [7, 1], [-1, -1], [4, 0], [7, 3]],
    3,
    3],
   [[5, 0], [5, 4]]),
  ('regression player distance metric #2',
   [['~...', '....', '~~..', '.#..', '...~', '~.~.', '..~.'],
    [2, 2],
    [[3, 3], [3, 2], [2, 0], [6, 3], [7, 2], [7, 1], [7, 2], [0, 3]],
    3,
    3],
   [[6, 3]]),
  ('partial repair boundary #1',
   [['.#~', '...', '...', '.~.', '#.~', '.#.', '~..'],
    [2, 0],
    [[4, 2], [0, -1], [0, 3], [6, 1], [4, 0], [4, 2], [7, 2], [3, 2], [1, 2]],
    3,
    1],
   [[6, 1]]),
  ('diagonal neighbour spawn #1', [['....', '....', '....'], [0, 0], [[1, 2], [2, 3]], 1, 3], [[1, 2]]),
  ('control #1',
   [['....', '.#.~', '..~~', '...#'], [2, 0], [[4, -1], [3, 3], [3, 1], [1, 0], [1, 3]], 0, 2],
   [[3, 1], [1, 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
exact safe radius #1[][[0, 2]]Failed
negative index candidate #1[][[2, 0]]Failed
regression player distance metric #1[][[0, 0]]Failed
fault site player distance metric #1[][]Passed
partial repair boundary #1[][[6, 1], [5, 3]]Failed
partial repair boundary #2[[2, 0], [0, 2], [3, 5]][[2, 0], [1, 6], [0, 2]]Failed
diagonal neighbour spawn #1[[1, 2]][[1, 2]]Passed
control #1[][]Passed

SHA-256 / ca328a898bb40740207a1223cb68fd71a975e155c64125b34ffe2ed4bbae27e5

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 = [[('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]]),
  ('regression player distance metric #1',
   [['......', '..#...', '...~..', '.~#...', '~..~~.'],
    [1, 3],
    [[0, 0], [-1, 4], [-1, 2], [5, 4], [5, 1], [5, 1], [3, 5], [5, 6], [1, 4], [5, 2]],
    3,
    3],
   [[0, 0]]),
  ('fault site player distance metric #1',
   [['..~##.', '~..~..', '.~~#.~'], [0, 3], [[1, 4], [-1, 6], [1, 1], [2, 4], [2, 2], [1, 0]], 3, 5],
   []),
  ('partial repair boundary #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]]),
  ('partial repair boundary #2',
   [['~..~.#.', '.....#.', '.......', '#......', '##....~'],
    [1, 4],
    [[5, 0], [2, 0], [1, 6], [-1, 7], [0, 2], [1, 1], [3, 5], [2, 3], [5, 4]],
    1,
    3],
   [[2, 0], [1, 6], [0, 2]]),
  ('diagonal neighbour spawn #1', [['....', '....', '....'], [0, 0], [[1, 2], [2, 3]], 1, 3], [[1, 2]]),
  ('control #1',
   [['#.#', '...', '#.#', '.#.', '...', '...', '...', '##.'], [6, 2], [[2, -1], [7, 2]], 0, 0],
   [])],
 [('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]]),
  ('fault site player distance metric #1',
   [['..~##.', '~..~..', '.~~#.~'], [0, 3], [[1, 4], [-1, 6], [1, 1], [2, 4], [2, 2], [1, 0]], 3, 5],
   []),
  ('fault site player distance metric #2',
   [['...', '#..', '.~~', '#~.', '.~.', '~..'], [2, 1], [[-1, 0], [1, 1], [3, 2], [4, 3]], 2, 1],
   []),
  ('partial repair boundary #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]]),
  ('partial repair boundary #2',
   [['~..~.#.', '.....#.', '.......', '#......', '##....~'],
    [1, 4],
    [[5, 0], [2, 0], [1, 6], [-1, 7], [0, 2], [1, 1], [3, 5], [2, 3], [5, 4]],
    1,
    3],
   [[2, 0], [1, 6], [0, 2]]),
  ('diagonal neighbour spawn #1', [['....', '....', '....'], [0, 0], [[1, 2], [2, 3]], 1, 3], [[1, 2]]),
  ('control #1',
   [['#.#', '...', '#.#', '.#.', '...', '...', '...', '##.'], [6, 2], [[2, -1], [7, 2]], 0, 0],
   [])],
 [('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]]),
  ('fault site player distance metric #1',
   [['~...', '.~..', '.#..', '#.~.', '....', '...#', '..#.', '~~.#'],
    [5, 2],
    [[8, 4], [4, -1], [8, -1], [4, 3]],
    2,
    1],
   []),
  ('regression player distance metric #1',
   [['~...', '....', '~~..', '.#..', '...~', '~.~.', '..~.'],
    [2, 2],
    [[3, 3], [3, 2], [2, 0], [6, 3], [7, 2], [7, 1], [7, 2], [0, 3]],
    3,
    3],
   [[6, 3]]),
  ('partial repair boundary #1',
   [['.~.', '#..', '.#.', '...', '..#', '.~.', '#..', '~..'],
    [0, 2],
    [[3, 3], [3, 1], [3, 0], [7, -1], [4, 3], [7, 1]],
    3,
    2],
   [[3, 1], [7, 1]]),
  ('regression player distance metric #2',
   [['......', '..#...', '...~..', '.~#...', '~..~~.'],
    [1, 3],
    [[0, 0], [-1, 4], [-1, 2], [5, 4], [5, 1], [5, 1], [3, 5], [5, 6], [1, 4], [5, 2]],
    3,
    3],
   [[0, 0]]),
  ('diagonal neighbour spawn #1', [['....', '....', '....'], [0, 0], [[1, 2], [2, 3]], 1, 3], [[1, 2]]),
  ('control #1',
   [['.#~', '...', '~.#', '#.~', '..#', '#~.'], [3, 1], [[5, 0], [1, 0], [6, -1], [6, -1]], 0, 5],
   [[1, 0]])],
 [('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]]),
  ('regression player distance metric #1',
   [['.~....##', '......#.', '~...#..#', '~......~'],
    [2, 3],
    [[-1, 3], [0, 1], [1, -1], [1, 2], [2, 5], [1, 3]],
    2,
    1],
   [[2, 5]]),
  ('regression player distance metric #2',
   [['.~.~....', '....~~~#', '......~~', '....#...'],
    [1, 5],
    [[-1, 7], [0, 7], [2, 5], [0, 8], [2, 1], [-1, 3], [1, 5]],
    3,
    3],
   [[2, 1]]),
  ('partial repair boundary #1',
   [['..~...', '#.~...', '.#....'],
    [0, 5],
    [[0, 3], [0, 0], [1, 1], [3, 3], [2, 1], [0, 1], [0, 5], [2, 4], [2, 3], [1, 4]],
    1,
    3],
   [[0, 3], [0, 0], [2, 4]]),
  ('partial repair boundary #2',
   [['.~..', '#...', '..~~', '#...', '..~.'],
    [3, 0],
    [[0, 4], [5, 3], [3, 2], [4, -1], [-1, -1], [2, 0], [1, 2], [1, -1], [0, 1]],
    1,
    3],
   [[3, 2], [2, 0], [1, 2]]),
  ('diagonal neighbour spawn #1', [['....', '....', '....'], [0, 0], [[1, 2], [2, 3]], 1, 3], [[1, 2]]),
  ('control #1',
   [['...#...', '......~', '~~.....', '..~....', '.~....~', '.....#.'], [5, 2], [[1, 5]], 0, 0],
   [])],
 [('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]]),
  ('fault site player distance metric #1',
   [['..~#.', '.~...', '~..~.', '..~..', '~..#.', '##...', '....~', '...#.'],
    [5, 0],
    [[5, 1], [2, 4], [3, 5], [6, 1], [4, 0], [8, 1], [2, 4], [8, 1], [6, 5], [7, 2]],
    3,
    5],
   [[2, 4]]),
  ('regression player distance metric #1',
   [['..~.~', '..#..', '.~...', '..~.~', '.~#..', '.....', '.....'],
    [0, 2],
    [[2, 0], [4, 5], [5, 0], [0, 5], [5, 4], [7, 1], [-1, -1], [4, 0], [7, 3]],
    3,
    3],
   [[5, 0], [5, 4]]),
  ('regression player distance metric #2',
   [['~...', '....', '~~..', '.#..', '...~', '~.~.', '..~.'],
    [2, 2],
    [[3, 3], [3, 2], [2, 0], [6, 3], [7, 2], [7, 1], [7, 2], [0, 3]],
    3,
    3],
   [[6, 3]]),
  ('partial repair boundary #1',
   [['.#~', '...', '...', '.~.', '#.~', '.#.', '~..'],
    [2, 0],
    [[4, 2], [0, -1], [0, 3], [6, 1], [4, 0], [4, 2], [7, 2], [3, 2], [1, 2]],
    3,
    1],
   [[6, 1]]),
  ('diagonal neighbour spawn #1', [['....', '....', '....'], [0, 0], [[1, 2], [2, 3]], 1, 3], [[1, 2]]),
  ('control #1',
   [['....', '.#.~', '..~~', '...#'], [2, 0], [[4, -1], [3, 3], [3, 1], [1, 0], [1, 3]], 0, 2],
   [[3, 1], [1, 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
exact safe radius #1[[0, 2]][[0, 2]]Passed
negative index candidate #1[[2, 0]][[2, 0]]Passed
regression player distance metric #1[[0, 0]][[0, 0]]Passed
fault site player distance metric #1[][]Passed
partial repair boundary #1[[6, 1], [5, 3]][[6, 1], [5, 3]]Passed
partial repair boundary #2[[2, 0], [1, 6], [0, 2]][[2, 0], [1, 6], [0, 2]]Passed
diagonal neighbour spawn #1[[1, 2]][[1, 2]]Passed
control #1[][]Passed

SHA-256 / 4c1c1d919ce2957b5545ae6b3d5651ed83fd44422b0af78448ae6dca0aa09da2

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

Case digest / 8128d8e14fad966f9b379ab4de964876d18b91a3cf1ad9c0f9835fcc7be145aa