FA-70496 / GIS polygon topology / Open access
Rook and queen polygon adjacency: edge direction normalisation · case 01
Neighbouring polygons with the same winding are never rook-adjacent.
ROOT CAUSE
Edges are compared as directed pairs, but adjacent polygons traverse their shared edge in opposite directions.
THE FAILURE
Edges are compared as directed pairs, but adjacent polygons traverse their shared edge in opposite directions.
Unsuccessful approach: Sorting endpoints by x alone leaves vertical shared edges unnormalised.
Case contract
Input [polygons, mode] where each polygon is a closed ring of integer vertices on a noded coverage (shared borders use identical vertices). Rook neighbours share at least one non-degenerate edge irrespective of direction; queen neighbours share at least one vertex. Return, for each polygon index, the ascending list of neighbour indexes (never itself).
Why this case matters
Spatial weights for regional statistics, district contiguity checks and map colouring all start from adjacency.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(x):
polys, mode = x
def edges(r):
return {(tuple(a), tuple(b)) for a, b in zip(r, r[1:]) if a != b}
def verts(r):
return {tuple(p) for p in r}
E = [edges(p) for p in polys]
V = [verts(p) for p in polys]
out = []
for i in range(len(polys)):
nb = []
for j in range(len(polys)):
if i == j:
continue
if mode == 'rook':
ok = bool(E[i] & E[j])
else:
ok = bool(V[i] & V[j])
if ok:
nb.append(j)
out.append(nb)
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('control #0', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]], [[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]]], 'rook'], [[1, 3], [0], [], [0]]), ('control #1', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]], [[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]]], 'queen'], [[1, 3], [0, 2, 3], [1], [0, 1]]), ('control #2', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]]], 'rook'], [[1, 2], [0, 3], [0, 3], [1, 2]]), ('control #3', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]]], 'queen'], [[1, 2, 3], [0, 2, 3], [0, 1, 3], [0, 1, 2]]), ('control #4', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]], [[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]]], 'rook'], [[1, 3], [0, 4], [4], [0, 4], [1, 2, 3]]), ('control #5', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]], [[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]]], 'queen'], [[1, 3, 4], [0, 2, 3, 4], [1, 4], [0, 1, 4], [0, 1, 2, 3]]), ('control #6', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[10, 10], [12, 10], [11, 12], [10, 10]]], 'rook'], [[], []]), ('control #7', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[10, 10], [12, 10], [11, 12], [10, 10]]], 'queen'], [[], []])], [('control #2', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]]], 'rook'], [[1, 2], [0, 3], [0, 3], [1, 2]]), ('control #4', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]], [[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]]], 'rook'], [[1, 3], [0, 4], [4], [0, 4], [1, 2, 3]]), ('control #5', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]], [[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]]], 'queen'], [[1, 3, 4], [0, 2, 3, 4], [1, 4], [0, 1, 4], [0, 1, 2, 3]]), ('control #6', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[10, 10], [12, 10], [11, 12], [10, 10]]], 'rook'], [[], []]), ('control #7', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[10, 10], [12, 10], [11, 12], [10, 10]]], 'queen'], [[], []]), ('control #8', [[[[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'rook'], [[], []]), ('control #9', [[[[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'queen'], [[1], [0]]), ('control #10', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]]], 'rook'], [[], []])], [('control #4', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]], [[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]]], 'rook'], [[1, 3], [0, 4], [4], [0, 4], [1, 2, 3]]), ('control #7', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[10, 10], [12, 10], [11, 12], [10, 10]]], 'queen'], [[], []]), ('control #8', [[[[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'rook'], [[], []]), ('control #9', [[[[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'queen'], [[1], [0]]), ('control #10', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]]], 'rook'], [[], []]), ('control #11', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]]], 'queen'], [[1], [0]]), ('control #12', [[[[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'rook'], [[1], [0, 2], [1]]), ('control #13', [[[[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'queen'], [[1], [0, 2], [1]])], [('control #9', [[[[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'queen'], [[1], [0]]), ('control #10', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]]], 'rook'], [[], []]), ('control #11', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]]], 'queen'], [[1], [0]]), ('control #12', [[[[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'rook'], [[1], [0, 2], [1]]), ('control #13', [[[[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'queen'], [[1], [0, 2], [1]]), ('control #14', [[[[0, 0], [0, 2], [2, 2], [2, 0], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]]], 'rook'], [[1], [0]]), ('control #15', [[[[0, 0], [0, 2], [2, 2], [2, 0], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]]], 'queen'], [[1], [0]]), ('control #16', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [4, 2], [2, 2], [2, 0]], [[4, 2], [4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'rook'], [[1], [0], []])], [('control #12', [[[[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'rook'], [[1], [0, 2], [1]]), ('control #13', [[[[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'queen'], [[1], [0, 2], [1]]), ('control #14', [[[[0, 0], [0, 2], [2, 2], [2, 0], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]]], 'rook'], [[1], [0]]), ('control #15', [[[[0, 0], [0, 2], [2, 2], [2, 0], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]]], 'queen'], [[1], [0]]), ('control #16', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [4, 2], [2, 2], [2, 0]], [[4, 2], [4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'rook'], [[1], [0], []]), ('control #17', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [4, 2], [2, 2], [2, 0]], [[4, 2], [4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'queen'], [[1], [0, 2], [1]]), ('control #18', [[[[2, 0], [4, 0], [4, 2], [4, 2], [2, 2], [2, 0]], [[4, 2], [4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'rook'], [[], []]), ('control #20', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]]], 'rook'], [[1], [0]])]]
for label, args, expected in fixtures[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 |
|---|---|---|---|
| control #0 | [[], [], [], []] | [[1, 3], [0], [], [0]] | Failed |
| control #1 | [[1, 3], [0, 2, 3], [1], [0, 1]] | [[1, 3], [0, 2, 3], [1], [0, 1]] | Passed |
| control #2 | [[], [], [], []] | [[1, 2], [0, 3], [0, 3], [1, 2]] | Failed |
| control #3 | [[1, 2, 3], [0, 2, 3], [0, 1, 3], [0, 1, 2]] | [[1, 2, 3], [0, 2, 3], [0, 1, 3], [0, 1, 2]] | Passed |
| control #4 | [[], [], [], [], []] | [[1, 3], [0, 4], [4], [0, 4], [1, 2, 3]] | Failed |
| control #5 | [[1, 3, 4], [0, 2, 3, 4], [1, 4], [0, 1, 4], [0, 1, 2, 3]] | [[1, 3, 4], [0, 2, 3, 4], [1, 4], [0, 1, 4], [0, 1, 2, 3]] | Passed |
| control #6 | [[], []] | [[], []] | Passed |
| control #7 | [[], []] | [[], []] | Passed |
SHA-256 / a0910c4dcadf94d511d798aa74d83f6103cbff96957c09e5a253f0111f7c6e89
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(x):
polys, mode = x
def edges(r):
return {tuple(sorted([tuple(a), tuple(b)], key=lambda p: p[0])) for a, b in zip(r, r[1:]) if a != b}
def verts(r):
return {tuple(p) for p in r}
E = [edges(p) for p in polys]
V = [verts(p) for p in polys]
out = []
for i in range(len(polys)):
nb = []
for j in range(len(polys)):
if i == j:
continue
if mode == 'rook':
ok = bool(E[i] & E[j])
else:
ok = bool(V[i] & V[j])
if ok:
nb.append(j)
out.append(nb)
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('control #0', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]], [[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]]], 'rook'], [[1, 3], [0], [], [0]]), ('control #1', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]], [[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]]], 'queen'], [[1, 3], [0, 2, 3], [1], [0, 1]]), ('control #2', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]]], 'rook'], [[1, 2], [0, 3], [0, 3], [1, 2]]), ('control #3', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]]], 'queen'], [[1, 2, 3], [0, 2, 3], [0, 1, 3], [0, 1, 2]]), ('control #4', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]], [[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]]], 'rook'], [[1, 3], [0, 4], [4], [0, 4], [1, 2, 3]]), ('control #5', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]], [[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]]], 'queen'], [[1, 3, 4], [0, 2, 3, 4], [1, 4], [0, 1, 4], [0, 1, 2, 3]]), ('control #6', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[10, 10], [12, 10], [11, 12], [10, 10]]], 'rook'], [[], []]), ('control #7', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[10, 10], [12, 10], [11, 12], [10, 10]]], 'queen'], [[], []])], [('control #2', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]]], 'rook'], [[1, 2], [0, 3], [0, 3], [1, 2]]), ('control #4', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]], [[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]]], 'rook'], [[1, 3], [0, 4], [4], [0, 4], [1, 2, 3]]), ('control #5', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]], [[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]]], 'queen'], [[1, 3, 4], [0, 2, 3, 4], [1, 4], [0, 1, 4], [0, 1, 2, 3]]), ('control #6', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[10, 10], [12, 10], [11, 12], [10, 10]]], 'rook'], [[], []]), ('control #7', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[10, 10], [12, 10], [11, 12], [10, 10]]], 'queen'], [[], []]), ('control #8', [[[[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'rook'], [[], []]), ('control #9', [[[[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'queen'], [[1], [0]]), ('control #10', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]]], 'rook'], [[], []])], [('control #4', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]], [[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]]], 'rook'], [[1, 3], [0, 4], [4], [0, 4], [1, 2, 3]]), ('control #7', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[10, 10], [12, 10], [11, 12], [10, 10]]], 'queen'], [[], []]), ('control #8', [[[[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'rook'], [[], []]), ('control #9', [[[[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'queen'], [[1], [0]]), ('control #10', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]]], 'rook'], [[], []]), ('control #11', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]]], 'queen'], [[1], [0]]), ('control #12', [[[[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'rook'], [[1], [0, 2], [1]]), ('control #13', [[[[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'queen'], [[1], [0, 2], [1]])], [('control #9', [[[[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'queen'], [[1], [0]]), ('control #10', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]]], 'rook'], [[], []]), ('control #11', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]]], 'queen'], [[1], [0]]), ('control #12', [[[[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'rook'], [[1], [0, 2], [1]]), ('control #13', [[[[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'queen'], [[1], [0, 2], [1]]), ('control #14', [[[[0, 0], [0, 2], [2, 2], [2, 0], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]]], 'rook'], [[1], [0]]), ('control #15', [[[[0, 0], [0, 2], [2, 2], [2, 0], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]]], 'queen'], [[1], [0]]), ('control #16', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [4, 2], [2, 2], [2, 0]], [[4, 2], [4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'rook'], [[1], [0], []])], [('control #12', [[[[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'rook'], [[1], [0, 2], [1]]), ('control #13', [[[[0, 2], [2, 2], [2, 4], [0, 4], [0, 2]], [[2, 2], [4, 2], [4, 4], [2, 4], [2, 2]], [[4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'queen'], [[1], [0, 2], [1]]), ('control #14', [[[[0, 0], [0, 2], [2, 2], [2, 0], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]]], 'rook'], [[1], [0]]), ('control #15', [[[[0, 0], [0, 2], [2, 2], [2, 0], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]]], 'queen'], [[1], [0]]), ('control #16', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [4, 2], [2, 2], [2, 0]], [[4, 2], [4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'rook'], [[1], [0], []]), ('control #17', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [4, 2], [2, 2], [2, 0]], [[4, 2], [4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'queen'], [[1], [0, 2], [1]]), ('control #18', [[[[2, 0], [4, 0], [4, 2], [4, 2], [2, 2], [2, 0]], [[4, 2], [4, 2], [6, 2], [6, 4], [4, 4], [4, 2]]], 'rook'], [[], []]), ('control #20', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]], [[2, 0], [4, 0], [4, 2], [2, 2], [2, 0]]], 'rook'], [[1], [0]])]]
for label, args, expected in fixtures[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 |
|---|---|---|---|
| control #0 | [[3], [], [], [0]] | [[1, 3], [0], [], [0]] | Failed |
| control #1 | [[1, 3], [0, 2, 3], [1], [0, 1]] | [[1, 3], [0, 2, 3], [1], [0, 1]] | Passed |
| control #2 | [[2], [3], [0], [1]] | [[1, 2], [0, 3], [0, 3], [1, 2]] | Failed |
| control #3 | [[1, 2, 3], [0, 2, 3], [0, 1, 3], [0, 1, 2]] | [[1, 2, 3], [0, 2, 3], [0, 1, 3], [0, 1, 2]] | Passed |
| control #4 | [[3], [4], [], [0], [1]] | [[1, 3], [0, 4], [4], [0, 4], [1, 2, 3]] | Failed |
| control #5 | [[1, 3, 4], [0, 2, 3, 4], [1, 4], [0, 1, 4], [0, 1, 2, 3]] | [[1, 3, 4], [0, 2, 3, 4], [1, 4], [0, 1, 4], [0, 1, 2, 3]] | Passed |
| control #6 | [[], []] | [[], []] | Passed |
| control #7 | [[], []] | [[], []] | Passed |
SHA-256 / a4cec56fcf10a5c64eeffe4ad5c3cd6393e338acef113e72f8853d766a689ca1
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
Stipulated deterministic toy contract on a bounded input domain; results are rounded as stated and no conformance with any published standard or library is claimed. 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:48:21.242409+00:00.
Case digest / 10f114154a4c5e435ba4bd5ebf6224755045d8c2a4774486d0e592aa0baad6e0