FA-86686 / Procedural level generation constraints / Open access
Decoration scatter with quadrant quota: Odd maps get a third quadrant column · case 01
Quotas are bypassed along the last column of odd-width maps.
ROOT CAUSE
Quadrants are computed by dividing by half the size, producing extra quadrants for odd sizes.
THE FAILURE
Quadrants are computed by dividing by half the size, producing extra quadrants for odd sizes.
Unsuccessful approach: Swapping width and height misassigns quadrants on non-square maps.
Case contract
Candidates [x, y] (grid[y][x]) are tried in order. Accept when in bounds on '.', its quadrant (x*2//w, y*2//h) holds fewer than per_quadrant accepted props, and its squared Euclidean distance to every accepted prop is at least radius*radius. Returns accepted [x, y].
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, candidates, radius, per_quadrant):
h = len(grid)
w = len(grid[0])
placed = []
quota = {}
for x, y in candidates:
if not (0 <= y < h and 0 <= x < w) or grid[y][x] != '.':
continue
q = (x // (w // 2), y // (h // 2))
if quota.get(q, 0) >= per_quadrant:
continue
if any((x - px) ** 2 + (y - py) ** 2 < radius * radius for px, py in placed):
continue
placed.append([x, y])
quota[q] = quota.get(q, 0) + 1
return placed
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('quadrant full #1', [['....', '....'], [[0, 0], [1, 0], [3, 0]], 1, 1], [[0, 0], [3, 0]]),
('regression quadrant index #1',
[['~~..#', '.....', '....#'], [[3, 1], [1, 2], [5, 2], [2, 3], [0, 3], [3, 0], [1, 1], [0, 1]], 1, 1],
[[3, 1], [1, 2], [1, 1]]),
('regression quadrant index #2',
[['.##', '.#.', '...', '~..', '~.~', '..#', '...'],
[[3, 0], [1, 6], [3, 0], [0, 0], [0, 6], [0, 5], [1, 3]],
2,
1],
[[1, 6], [0, 0]]),
('partial repair boundary #1',
[['...~.#', '.#....'], [[0, 2], [6, 1], [2, 0], [6, 0], [2, 1], [2, 1], [1, 2], [0, 1]], 1, 1],
[[2, 0], [2, 1]]),
('regression quadrant index #3',
[['##', '#.', '#.', '##', '..', '.#', '..'], [[1, 4], [1, 6]], 1, 1],
[[1, 4]]),
('diagonal within radius #1', [['...', '...', '...'], [[0, 0], [1, 1]], 2, 3], [[0, 0]]),
('control #1',
[['~..~.', '.#...', '~..#.', '..~#.'], [[1, 2], [4, 3], [1, 2], [4, 3], [1, 1]], 2, 3],
[[1, 2], [4, 3]]),
('control #2', [['#..', '..#'], [[1, 1]], 1, 1], [[1, 1]])],
[('quadrant full #1', [['....', '....'], [[0, 0], [1, 0], [3, 0]], 1, 1], [[0, 0], [3, 0]]),
('regression quadrant index #1',
[['##', '#.', '#.', '##', '..', '.#', '..'], [[1, 4], [1, 6]], 1, 1],
[[1, 4]]),
('fault site quadrant index #1',
[['.....', '.#.##', '.....', '#.~.#', '.~.#.'],
[[3, 1], [3, 2], [5, 4], [3, 5], [2, 1], [0, 0], [4, 1], [4, 0], [1, 1], [3, 2]],
2,
1],
[[3, 2], [0, 0]]),
('partial repair boundary #1',
[['...~.#', '.#....'], [[0, 2], [6, 1], [2, 0], [6, 0], [2, 1], [2, 1], [1, 2], [0, 1]], 1, 1],
[[2, 0], [2, 1]]),
('regression quadrant index #2',
[['.##', '.#.', '...', '~..', '~.~', '..#', '...'],
[[3, 0], [1, 6], [3, 0], [0, 0], [0, 6], [0, 5], [1, 3]],
2,
1],
[[1, 6], [0, 0]]),
('diagonal within radius #1', [['...', '...', '...'], [[0, 0], [1, 1]], 2, 3], [[0, 0]]),
('control #1', [['#..', '..#'], [[1, 1]], 1, 1], [[1, 1]]),
('control #2',
[['..', '~.'],
[[2, 1], [1, 2], [2, 0], [2, 0], [0, 1], [2, 1], [0, 0], [2, 2], [0, 0], [1, 1], [2, 0]],
3,
2],
[[0, 0]])],
[('quadrant full #1', [['....', '....'], [[0, 0], [1, 0], [3, 0]], 1, 1], [[0, 0], [3, 0]]),
('regression quadrant index #1',
[['####..', '.~..##', '#.~~..', '.#...#', '...#~.'],
[[1, 3], [3, 3], [6, 0], [2, 0], [5, 4], [2, 5]],
1,
1],
[[3, 3]]),
('fault site quadrant index #1',
[['...~#~.', '~.~~...', '..~.##.', '......#', '#~.~~.#', '......#', '~#.....'],
[[0, 1], [0, 7], [2, 6], [2, 6], [6, 0], [7, 3], [6, 3], [0, 1], [7, 1], [3, 6], [6, 3], [1, 3]],
1,
1],
[[2, 6], [6, 0], [1, 3]]),
('regression quadrant index #2',
[['##', '#.', '#.', '##', '..', '.#', '..'], [[1, 4], [1, 6]], 1, 1],
[[1, 4]]),
('partial repair boundary #1',
[['.~#', '##.', '~#.', '.##', '...', '.#.'],
[[3, 5], [1, 0], [0, 4], [1, 2], [3, 6], [2, 4], [2, 0], [1, 0], [0, 3], [2, 4], [3, 3], [0, 4]],
2,
1],
[[0, 4], [2, 4]]),
('diagonal within radius #1', [['...', '...', '...'], [[0, 0], [1, 1]], 2, 3], [[0, 0]]),
('control #1', [['....', '..#.'], [[0, 1], [3, 0], [1, 0]], 3, 2], [[0, 1], [3, 0]]),
('control #2',
[['..', '.#', '..', '~~', '..', '..', '..'],
[[1, 6], [1, 1], [0, 7], [0, 0], [2, 1], [2, 5], [2, 0], [0, 4], [1, 1], [0, 0], [0, 3], [2, 6]],
3,
3],
[[1, 6], [0, 0]])],
[('quadrant full #1', [['....', '....'], [[0, 0], [1, 0], [3, 0]], 1, 1], [[0, 0], [3, 0]]),
('regression quadrant index #1',
[['......#', '#...#..'], [[2, 1], [3, 1], [7, 2], [6, 2], [7, 1], [1, 1], [5, 0], [3, 1]], 1, 2],
[[2, 1], [3, 1], [5, 0]]),
('regression quadrant index #2',
[['...~.#..', '~#.###~.', '.#.#..~#', '...#.#~.', '~.~.~..#', '.#...#.#', '#..~#...'],
[[4, 2], [6, 0], [7, 3], [5, 4], [7, 6], [5, 6], [7, 4], [0, 2], [4, 0], [5, 2], [1, 2]],
2,
2],
[[4, 2], [6, 0], [5, 4], [7, 6], [0, 2]]),
('regression quadrant index #3',
[['####..', '.~..##', '#.~~..', '.#...#', '...#~.'],
[[1, 3], [3, 3], [6, 0], [2, 0], [5, 4], [2, 5]],
1,
1],
[[3, 3]]),
('partial repair boundary #1',
[['..~...', '......', '#.#.~.', '......'],
[[3, 1], [5, 1], [0, 2], [6, 0], [5, 2], [0, 0], [0, 3], [4, 1], [4, 3], [4, 4]],
2,
1],
[[3, 1], [5, 2], [0, 0], [0, 3]]),
('diagonal within radius #1', [['...', '...', '...'], [[0, 0], [1, 1]], 2, 3], [[0, 0]]),
('control #1',
[['...~#.~~', '~~~~#.~.', '~.#....#', '#~..~...'], [[0, 4], [1, 1], [5, 2], [3, 2], [1, 1]], 2, 2],
[[5, 2], [3, 2]]),
('control #2',
[['...', '.#.'], [[3, 1], [0, 2], [1, 2], [2, 2], [3, 0], [3, 1], [3, 0], [1, 0]], 1, 2],
[[1, 0]])],
[('quadrant full #1', [['....', '....'], [[0, 0], [1, 0], [3, 0]], 1, 1], [[0, 0], [3, 0]]),
('fault site quadrant index #1',
[['.~~~', '....', '..#~'], [[0, 2], [2, 1], [0, 0], [2, 3], [2, 2], [0, 3], [2, 2], [1, 1], [2, 2]], 1, 1],
[[0, 2], [2, 1], [0, 0]]),
('fault site quadrant index #2',
[['......~', '.~##.#.', '.~..~.~', '.......', '.......', '#.~.#..', '.~.....', '#.#....'],
[[0, 0], [4, 4], [4, 8], [2, 5], [3, 0], [1, 7], [0, 8], [6, 2], [1, 6], [4, 8], [5, 2]],
3,
1],
[[0, 0], [4, 4], [1, 7]]),
('partial repair boundary #1',
[['..~...', '......', '#.#.~.', '......'],
[[3, 1], [5, 1], [0, 2], [6, 0], [5, 2], [0, 0], [0, 3], [4, 1], [4, 3], [4, 4]],
2,
1],
[[3, 1], [5, 2], [0, 0], [0, 3]]),
('regression quadrant index #1',
[['...~.#..', '~#.###~.', '.#.#..~#', '...#.#~.', '~.~.~..#', '.#...#.#', '#..~#...'],
[[4, 2], [6, 0], [7, 3], [5, 4], [7, 6], [5, 6], [7, 4], [0, 2], [4, 0], [5, 2], [1, 2]],
2,
2],
[[4, 2], [6, 0], [5, 4], [7, 6], [0, 2]]),
('diagonal within radius #1', [['...', '...', '...'], [[0, 0], [1, 1]], 2, 3], [[0, 0]]),
('control #1', [['....', '.~#.'], [[1, 2], [2, 0], [4, 1], [3, 1]], 1, 2], [[2, 0], [3, 1]]),
('control #2', [['##.', '...', '...', '.#~'], [[0, 1], [0, 0], [2, 3]], 3, 1], [[0, 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 |
|---|---|---|---|
| quadrant full #1 | [[0, 0], [3, 0]] | [[0, 0], [3, 0]] | Passed |
| regression quadrant index #1 | [[3, 1], [1, 2], [3, 0], [1, 1]] | [[3, 1], [1, 2], [1, 1]] | Failed |
| regression quadrant index #2 | [[1, 6], [0, 0], [1, 3]] | [[1, 6], [0, 0]] | Failed |
| partial repair boundary #1 | [[2, 0], [2, 1]] | [[2, 0], [2, 1]] | Passed |
| regression quadrant index #3 | [[1, 4], [1, 6]] | [[1, 4]] | Failed |
| diagonal within radius #1 | [[0, 0]] | [[0, 0]] | Passed |
| control #1 | [[1, 2], [4, 3]] | [[1, 2], [4, 3]] | Passed |
| control #2 | [[1, 1]] | [[1, 1]] | Passed |
SHA-256 / 4c476fc54b6641dafcd56b4352151e968c46f7965b08613f6eb7ca45ae9abda0
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(grid, candidates, radius, per_quadrant):
h = len(grid)
w = len(grid[0])
placed = []
quota = {}
for x, y in candidates:
if not (0 <= y < h and 0 <= x < w) or grid[y][x] != '.':
continue
q = (x * 2 // h, y * 2 // w)
if quota.get(q, 0) >= per_quadrant:
continue
if any((x - px) ** 2 + (y - py) ** 2 < radius * radius for px, py in placed):
continue
placed.append([x, y])
quota[q] = quota.get(q, 0) + 1
return placed
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('quadrant full #1', [['....', '....'], [[0, 0], [1, 0], [3, 0]], 1, 1], [[0, 0], [3, 0]]),
('regression quadrant index #1',
[['~~..#', '.....', '....#'], [[3, 1], [1, 2], [5, 2], [2, 3], [0, 3], [3, 0], [1, 1], [0, 1]], 1, 1],
[[3, 1], [1, 2], [1, 1]]),
('regression quadrant index #2',
[['.##', '.#.', '...', '~..', '~.~', '..#', '...'],
[[3, 0], [1, 6], [3, 0], [0, 0], [0, 6], [0, 5], [1, 3]],
2,
1],
[[1, 6], [0, 0]]),
('partial repair boundary #1',
[['...~.#', '.#....'], [[0, 2], [6, 1], [2, 0], [6, 0], [2, 1], [2, 1], [1, 2], [0, 1]], 1, 1],
[[2, 0], [2, 1]]),
('regression quadrant index #3',
[['##', '#.', '#.', '##', '..', '.#', '..'], [[1, 4], [1, 6]], 1, 1],
[[1, 4]]),
('diagonal within radius #1', [['...', '...', '...'], [[0, 0], [1, 1]], 2, 3], [[0, 0]]),
('control #1',
[['~..~.', '.#...', '~..#.', '..~#.'], [[1, 2], [4, 3], [1, 2], [4, 3], [1, 1]], 2, 3],
[[1, 2], [4, 3]]),
('control #2', [['#..', '..#'], [[1, 1]], 1, 1], [[1, 1]])],
[('quadrant full #1', [['....', '....'], [[0, 0], [1, 0], [3, 0]], 1, 1], [[0, 0], [3, 0]]),
('regression quadrant index #1',
[['##', '#.', '#.', '##', '..', '.#', '..'], [[1, 4], [1, 6]], 1, 1],
[[1, 4]]),
('fault site quadrant index #1',
[['.....', '.#.##', '.....', '#.~.#', '.~.#.'],
[[3, 1], [3, 2], [5, 4], [3, 5], [2, 1], [0, 0], [4, 1], [4, 0], [1, 1], [3, 2]],
2,
1],
[[3, 2], [0, 0]]),
('partial repair boundary #1',
[['...~.#', '.#....'], [[0, 2], [6, 1], [2, 0], [6, 0], [2, 1], [2, 1], [1, 2], [0, 1]], 1, 1],
[[2, 0], [2, 1]]),
('regression quadrant index #2',
[['.##', '.#.', '...', '~..', '~.~', '..#', '...'],
[[3, 0], [1, 6], [3, 0], [0, 0], [0, 6], [0, 5], [1, 3]],
2,
1],
[[1, 6], [0, 0]]),
('diagonal within radius #1', [['...', '...', '...'], [[0, 0], [1, 1]], 2, 3], [[0, 0]]),
('control #1', [['#..', '..#'], [[1, 1]], 1, 1], [[1, 1]]),
('control #2',
[['..', '~.'],
[[2, 1], [1, 2], [2, 0], [2, 0], [0, 1], [2, 1], [0, 0], [2, 2], [0, 0], [1, 1], [2, 0]],
3,
2],
[[0, 0]])],
[('quadrant full #1', [['....', '....'], [[0, 0], [1, 0], [3, 0]], 1, 1], [[0, 0], [3, 0]]),
('regression quadrant index #1',
[['####..', '.~..##', '#.~~..', '.#...#', '...#~.'],
[[1, 3], [3, 3], [6, 0], [2, 0], [5, 4], [2, 5]],
1,
1],
[[3, 3]]),
('fault site quadrant index #1',
[['...~#~.', '~.~~...', '..~.##.', '......#', '#~.~~.#', '......#', '~#.....'],
[[0, 1], [0, 7], [2, 6], [2, 6], [6, 0], [7, 3], [6, 3], [0, 1], [7, 1], [3, 6], [6, 3], [1, 3]],
1,
1],
[[2, 6], [6, 0], [1, 3]]),
('regression quadrant index #2',
[['##', '#.', '#.', '##', '..', '.#', '..'], [[1, 4], [1, 6]], 1, 1],
[[1, 4]]),
('partial repair boundary #1',
[['.~#', '##.', '~#.', '.##', '...', '.#.'],
[[3, 5], [1, 0], [0, 4], [1, 2], [3, 6], [2, 4], [2, 0], [1, 0], [0, 3], [2, 4], [3, 3], [0, 4]],
2,
1],
[[0, 4], [2, 4]]),
('diagonal within radius #1', [['...', '...', '...'], [[0, 0], [1, 1]], 2, 3], [[0, 0]]),
('control #1', [['....', '..#.'], [[0, 1], [3, 0], [1, 0]], 3, 2], [[0, 1], [3, 0]]),
('control #2',
[['..', '.#', '..', '~~', '..', '..', '..'],
[[1, 6], [1, 1], [0, 7], [0, 0], [2, 1], [2, 5], [2, 0], [0, 4], [1, 1], [0, 0], [0, 3], [2, 6]],
3,
3],
[[1, 6], [0, 0]])],
[('quadrant full #1', [['....', '....'], [[0, 0], [1, 0], [3, 0]], 1, 1], [[0, 0], [3, 0]]),
('regression quadrant index #1',
[['......#', '#...#..'], [[2, 1], [3, 1], [7, 2], [6, 2], [7, 1], [1, 1], [5, 0], [3, 1]], 1, 2],
[[2, 1], [3, 1], [5, 0]]),
('regression quadrant index #2',
[['...~.#..', '~#.###~.', '.#.#..~#', '...#.#~.', '~.~.~..#', '.#...#.#', '#..~#...'],
[[4, 2], [6, 0], [7, 3], [5, 4], [7, 6], [5, 6], [7, 4], [0, 2], [4, 0], [5, 2], [1, 2]],
2,
2],
[[4, 2], [6, 0], [5, 4], [7, 6], [0, 2]]),
('regression quadrant index #3',
[['####..', '.~..##', '#.~~..', '.#...#', '...#~.'],
[[1, 3], [3, 3], [6, 0], [2, 0], [5, 4], [2, 5]],
1,
1],
[[3, 3]]),
('partial repair boundary #1',
[['..~...', '......', '#.#.~.', '......'],
[[3, 1], [5, 1], [0, 2], [6, 0], [5, 2], [0, 0], [0, 3], [4, 1], [4, 3], [4, 4]],
2,
1],
[[3, 1], [5, 2], [0, 0], [0, 3]]),
('diagonal within radius #1', [['...', '...', '...'], [[0, 0], [1, 1]], 2, 3], [[0, 0]]),
('control #1',
[['...~#.~~', '~~~~#.~.', '~.#....#', '#~..~...'], [[0, 4], [1, 1], [5, 2], [3, 2], [1, 1]], 2, 2],
[[5, 2], [3, 2]]),
('control #2',
[['...', '.#.'], [[3, 1], [0, 2], [1, 2], [2, 2], [3, 0], [3, 1], [3, 0], [1, 0]], 1, 2],
[[1, 0]])],
[('quadrant full #1', [['....', '....'], [[0, 0], [1, 0], [3, 0]], 1, 1], [[0, 0], [3, 0]]),
('fault site quadrant index #1',
[['.~~~', '....', '..#~'], [[0, 2], [2, 1], [0, 0], [2, 3], [2, 2], [0, 3], [2, 2], [1, 1], [2, 2]], 1, 1],
[[0, 2], [2, 1], [0, 0]]),
('fault site quadrant index #2',
[['......~', '.~##.#.', '.~..~.~', '.......', '.......', '#.~.#..', '.~.....', '#.#....'],
[[0, 0], [4, 4], [4, 8], [2, 5], [3, 0], [1, 7], [0, 8], [6, 2], [1, 6], [4, 8], [5, 2]],
3,
1],
[[0, 0], [4, 4], [1, 7]]),
('partial repair boundary #1',
[['..~...', '......', '#.#.~.', '......'],
[[3, 1], [5, 1], [0, 2], [6, 0], [5, 2], [0, 0], [0, 3], [4, 1], [4, 3], [4, 4]],
2,
1],
[[3, 1], [5, 2], [0, 0], [0, 3]]),
('regression quadrant index #1',
[['...~.#..', '~#.###~.', '.#.#..~#', '...#.#~.', '~.~.~..#', '.#...#.#', '#..~#...'],
[[4, 2], [6, 0], [7, 3], [5, 4], [7, 6], [5, 6], [7, 4], [0, 2], [4, 0], [5, 2], [1, 2]],
2,
2],
[[4, 2], [6, 0], [5, 4], [7, 6], [0, 2]]),
('diagonal within radius #1', [['...', '...', '...'], [[0, 0], [1, 1]], 2, 3], [[0, 0]]),
('control #1', [['....', '.~#.'], [[1, 2], [2, 0], [4, 1], [3, 1]], 1, 2], [[2, 0], [3, 1]]),
('control #2', [['##.', '...', '...', '.#~'], [[0, 1], [0, 0], [2, 3]], 3, 1], [[0, 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 |
|---|---|---|---|
| quadrant full #1 | [[0, 0], [1, 0], [3, 0]] | [[0, 0], [3, 0]] | Failed |
| regression quadrant index #1 | [[3, 1], [1, 2]] | [[3, 1], [1, 2], [1, 1]] | Failed |
| regression quadrant index #2 | [[1, 6], [0, 0], [1, 3]] | [[1, 6], [0, 0]] | Failed |
| partial repair boundary #1 | [[2, 0], [0, 1]] | [[2, 0], [2, 1]] | Failed |
| regression quadrant index #3 | [[1, 4], [1, 6]] | [[1, 4]] | Failed |
| diagonal within radius #1 | [[0, 0]] | [[0, 0]] | Passed |
| control #1 | [[1, 2], [4, 3]] | [[1, 2], [4, 3]] | Passed |
| control #2 | [[1, 1]] | [[1, 1]] | Passed |
SHA-256 / c61e5ca34af2467e7ba364dedecc894020dd4241814052582a82d912f16f226b
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗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:51.899008+00:00.
Case digest / 4b919cc2b3d79c4be48c10b7d46ad8fac65c32f2a9b6b8710b38016ad00666fc