FA-70811 / GIS polygon topology / Open access
Iterative removal of backtracking spikes: collapse threshold · case 01
Rings reduced to a segment are returned as polygons.
ROOT CAUSE
Only an empty cycle is treated as collapsed.
VERIFIED REPAIR
At the collapse threshold step restore `if len(pts) < 3: return None`, leaving the rest of the model unchanged.
Unsuccessful approach: A two-vertex remnant is still returned.
Case contract
Input: a closed ring of integer vertices. Working on the open vertex cycle, repeatedly delete a vertex whose cyclic predecessor equals its cyclic successor (an exact out-and-back spike) or which equals its predecessor, until no such vertex remains or fewer than 3 vertices are left. Collinear pass-through vertices and partial backtracks are kept. Return None if fewer than 3 vertices remain, else the cycle closed with its first vertex.
Why this case matters
Digitising and snapping leave out-and-back spikes; cleaning must remove nested spikes, including those at the ring start, without changing genuine shape.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(x):
pts = x[:-1]
changed = True
while changed and len(pts) >= 3:
changed = False
n = len(pts)
for i in range(n):
if pts[i - 1] == pts[(i + 1) % n] or pts[i] == pts[i - 1]:
del pts[i]
changed = True
break
if not pts:
return None
return pts + [pts[0]]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('control #0', [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]], [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]), ('regression #1', [[0, 0], [10, 0], [10, 10], [12, 12], [10, 10], [0, 10], [0, 0]], [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]), ('regression #2', [[0, 0], [10, 0], [10, 10], [12, 12], [14, 14], [12, 12], [10, 10], [0, 10], [0, 0]], [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]), ('regression #3', [[5, 0], [10, 0], [10, 10], [0, 10], [0, 0], [5, 0], [5, -3], [5, 0]], [[10, 0], [10, 10], [0, 10], [0, 0], [5, 0], [10, 0]]), ('regression #4', [[5, -3], [5, 0], [10, 0], [10, 10], [0, 10], [0, 0], [5, 0], [5, -3]], [[10, 0], [10, 10], [0, 10], [0, 0], [5, 0], [10, 0]]), ('control #5', [[0, 0], [5, 0], [10, 0], [10, 10], [0, 10], [0, 0]], [[0, 0], [5, 0], [10, 0], [10, 10], [0, 10], [0, 0]]), ('boundary #7', [[0, 0], [10, 0], [0, 0], [0, 0]], None), ('boundary #8', [[0, 0], [10, 0], [5, 5], [10, 0], [0, 0]], None)], [('regression #3', [[5, 0], [10, 0], [10, 10], [0, 10], [0, 0], [5, 0], [5, -3], [5, 0]], [[10, 0], [10, 10], [0, 10], [0, 0], [5, 0], [10, 0]]), ('regression #4', [[5, -3], [5, 0], [10, 0], [10, 10], [0, 10], [0, 0], [5, 0], [5, -3]], [[10, 0], [10, 10], [0, 10], [0, 0], [5, 0], [10, 0]]), ('control #5', [[0, 0], [5, 0], [10, 0], [10, 10], [0, 10], [0, 0]], [[0, 0], [5, 0], [10, 0], [10, 10], [0, 10], [0, 0]]), ('regression #6', [[0, 0], [10, 0], [10, 10], [10, 14], [10, 10], [10, 12], [10, 10], [0, 10], [0, 0]], [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]), ('boundary #7', [[0, 0], [10, 0], [0, 0], [0, 0]], None), ('boundary #8', [[0, 0], [10, 0], [5, 5], [10, 0], [0, 0]], None), ('regression #9', [[0, 0], [10, 0], [10, 10], [10, 14], [10, 8], [10, 10], [0, 10], [0, 0]], [[0, 0], [10, 0], [10, 10], [10, 14], [10, 8], [10, 10], [0, 10], [0, 0]]), ('control #10', [[0, 0], [4, 0], [4, 4], [0, 0]], [[0, 0], [4, 0], [4, 4], [0, 0]])], [('regression #6', [[0, 0], [10, 0], [10, 10], [10, 14], [10, 10], [10, 12], [10, 10], [0, 10], [0, 0]], [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]), ('boundary #7', [[0, 0], [10, 0], [0, 0], [0, 0]], None), ('boundary #8', [[0, 0], [10, 0], [5, 5], [10, 0], [0, 0]], None), ('regression #9', [[0, 0], [10, 0], [10, 10], [10, 14], [10, 8], [10, 10], [0, 10], [0, 0]], [[0, 0], [10, 0], [10, 10], [10, 14], [10, 8], [10, 10], [0, 10], [0, 0]]), ('control #10', [[0, 0], [4, 0], [4, 4], [0, 0]], [[0, 0], [4, 0], [4, 4], [0, 0]]), ('regression #11', [[0, 0], [8, 0], [8, 8], [0, 8], [0, 12], [0, 8], [0, 0]], [[0, 0], [8, 0], [8, 8], [0, 8], [0, 0]]), ('regression #12', [[0, 0], [8, 0], [8, 8], [0, 8], [0, 0], [-3, 0], [0, 0]], [[8, 0], [8, 8], [0, 8], [0, 0], [8, 0]]), ('regression #13', [[0, 0], [8, 0], [8, 8], [0, 8], [0, 0], [-3, 0], [-5, 0], [-3, 0], [0, 0]], [[8, 0], [8, 8], [0, 8], [0, 0], [8, 0]])], [('control #0', [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]], [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]), ('regression #1', [[0, 0], [10, 0], [10, 10], [12, 12], [10, 10], [0, 10], [0, 0]], [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]), ('regression #2', [[0, 0], [10, 0], [10, 10], [12, 12], [14, 14], [12, 12], [10, 10], [0, 10], [0, 0]], [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]), ('boundary #7', [[0, 0], [10, 0], [0, 0], [0, 0]], None), ('boundary #8', [[0, 0], [10, 0], [5, 5], [10, 0], [0, 0]], None), ('regression #11', [[0, 0], [8, 0], [8, 8], [0, 8], [0, 12], [0, 8], [0, 0]], [[0, 0], [8, 0], [8, 8], [0, 8], [0, 0]]), ('regression #12', [[0, 0], [8, 0], [8, 8], [0, 8], [0, 0], [-3, 0], [0, 0]], [[8, 0], [8, 8], [0, 8], [0, 0], [8, 0]]), ('regression #13', [[0, 0], [8, 0], [8, 8], [0, 8], [0, 0], [-3, 0], [-5, 0], [-3, 0], [0, 0]], [[8, 0], [8, 8], [0, 8], [0, 0], [8, 0]])], [('control #0', [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]], [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]), ('regression #1', [[0, 0], [10, 0], [10, 10], [12, 12], [10, 10], [0, 10], [0, 0]], [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]), ('regression #2', [[0, 0], [10, 0], [10, 10], [12, 12], [14, 14], [12, 12], [10, 10], [0, 10], [0, 0]], [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]), ('regression #3', [[5, 0], [10, 0], [10, 10], [0, 10], [0, 0], [5, 0], [5, -3], [5, 0]], [[10, 0], [10, 10], [0, 10], [0, 0], [5, 0], [10, 0]]), ('regression #4', [[5, -3], [5, 0], [10, 0], [10, 10], [0, 10], [0, 0], [5, 0], [5, -3]], [[10, 0], [10, 10], [0, 10], [0, 0], [5, 0], [10, 0]]), ('control #5', [[0, 0], [5, 0], [10, 0], [10, 10], [0, 10], [0, 0]], [[0, 0], [5, 0], [10, 0], [10, 10], [0, 10], [0, 0]]), ('boundary #7', [[0, 0], [10, 0], [0, 0], [0, 0]], None), ('boundary #8', [[0, 0], [10, 0], [5, 5], [10, 0], [0, 0]], None)]]
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 | [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]] | [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]] | Passed |
| regression #1 | [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]] | [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]] | Passed |
| regression #2 | [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]] | [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]] | Passed |
| regression #3 | [[10, 0], [10, 10], [0, 10], [0, 0], [5, 0], [10, 0]] | [[10, 0], [10, 10], [0, 10], [0, 0], [5, 0], [10, 0]] | Passed |
| regression #4 | [[10, 0], [10, 10], [0, 10], [0, 0], [5, 0], [10, 0]] | [[10, 0], [10, 10], [0, 10], [0, 0], [5, 0], [10, 0]] | Passed |
| control #5 | [[0, 0], [5, 0], [10, 0], [10, 10], [0, 10], [0, 0]] | [[0, 0], [5, 0], [10, 0], [10, 10], [0, 10], [0, 0]] | Passed |
| boundary #7 | [[10, 0], [0, 0], [10, 0]] | None | Failed |
| boundary #8 | [[5, 5], [10, 0], [5, 5]] | None | Failed |
SHA-256 / efc166fc3480724f04503b422cf52ada05e6378d5ced7556ffed1bd455fe0f6d
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(x):
pts = x[:-1]
changed = True
while changed and len(pts) >= 3:
changed = False
n = len(pts)
for i in range(n):
if pts[i - 1] == pts[(i + 1) % n] or pts[i] == pts[i - 1]:
del pts[i]
changed = True
break
if len(pts) < 2:
return None
return pts + [pts[0]]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('control #0', [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]], [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]), ('regression #1', [[0, 0], [10, 0], [10, 10], [12, 12], [10, 10], [0, 10], [0, 0]], [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]), ('regression #2', [[0, 0], [10, 0], [10, 10], [12, 12], [14, 14], [12, 12], [10, 10], [0, 10], [0, 0]], [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]), ('regression #3', [[5, 0], [10, 0], [10, 10], [0, 10], [0, 0], [5, 0], [5, -3], [5, 0]], [[10, 0], [10, 10], [0, 10], [0, 0], [5, 0], [10, 0]]), ('regression #4', [[5, -3], [5, 0], [10, 0], [10, 10], [0, 10], [0, 0], [5, 0], [5, -3]], [[10, 0], [10, 10], [0, 10], [0, 0], [5, 0], [10, 0]]), ('control #5', [[0, 0], [5, 0], [10, 0], [10, 10], [0, 10], [0, 0]], [[0, 0], [5, 0], [10, 0], [10, 10], [0, 10], [0, 0]]), ('boundary #7', [[0, 0], [10, 0], [0, 0], [0, 0]], None), ('boundary #8', [[0, 0], [10, 0], [5, 5], [10, 0], [0, 0]], None)], [('regression #3', [[5, 0], [10, 0], [10, 10], [0, 10], [0, 0], [5, 0], [5, -3], [5, 0]], [[10, 0], [10, 10], [0, 10], [0, 0], [5, 0], [10, 0]]), ('regression #4', [[5, -3], [5, 0], [10, 0], [10, 10], [0, 10], [0, 0], [5, 0], [5, -3]], [[10, 0], [10, 10], [0, 10], [0, 0], [5, 0], [10, 0]]), ('control #5', [[0, 0], [5, 0], [10, 0], [10, 10], [0, 10], [0, 0]], [[0, 0], [5, 0], [10, 0], [10, 10], [0, 10], [0, 0]]), ('regression #6', [[0, 0], [10, 0], [10, 10], [10, 14], [10, 10], [10, 12], [10, 10], [0, 10], [0, 0]], [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]), ('boundary #7', [[0, 0], [10, 0], [0, 0], [0, 0]], None), ('boundary #8', [[0, 0], [10, 0], [5, 5], [10, 0], [0, 0]], None), ('regression #9', [[0, 0], [10, 0], [10, 10], [10, 14], [10, 8], [10, 10], [0, 10], [0, 0]], [[0, 0], [10, 0], [10, 10], [10, 14], [10, 8], [10, 10], [0, 10], [0, 0]]), ('control #10', [[0, 0], [4, 0], [4, 4], [0, 0]], [[0, 0], [4, 0], [4, 4], [0, 0]])], [('regression #6', [[0, 0], [10, 0], [10, 10], [10, 14], [10, 10], [10, 12], [10, 10], [0, 10], [0, 0]], [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]), ('boundary #7', [[0, 0], [10, 0], [0, 0], [0, 0]], None), ('boundary #8', [[0, 0], [10, 0], [5, 5], [10, 0], [0, 0]], None), ('regression #9', [[0, 0], [10, 0], [10, 10], [10, 14], [10, 8], [10, 10], [0, 10], [0, 0]], [[0, 0], [10, 0], [10, 10], [10, 14], [10, 8], [10, 10], [0, 10], [0, 0]]), ('control #10', [[0, 0], [4, 0], [4, 4], [0, 0]], [[0, 0], [4, 0], [4, 4], [0, 0]]), ('regression #11', [[0, 0], [8, 0], [8, 8], [0, 8], [0, 12], [0, 8], [0, 0]], [[0, 0], [8, 0], [8, 8], [0, 8], [0, 0]]), ('regression #12', [[0, 0], [8, 0], [8, 8], [0, 8], [0, 0], [-3, 0], [0, 0]], [[8, 0], [8, 8], [0, 8], [0, 0], [8, 0]]), ('regression #13', [[0, 0], [8, 0], [8, 8], [0, 8], [0, 0], [-3, 0], [-5, 0], [-3, 0], [0, 0]], [[8, 0], [8, 8], [0, 8], [0, 0], [8, 0]])], [('control #0', [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]], [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]), ('regression #1', [[0, 0], [10, 0], [10, 10], [12, 12], [10, 10], [0, 10], [0, 0]], [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]), ('regression #2', [[0, 0], [10, 0], [10, 10], [12, 12], [14, 14], [12, 12], [10, 10], [0, 10], [0, 0]], [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]), ('boundary #7', [[0, 0], [10, 0], [0, 0], [0, 0]], None), ('boundary #8', [[0, 0], [10, 0], [5, 5], [10, 0], [0, 0]], None), ('regression #11', [[0, 0], [8, 0], [8, 8], [0, 8], [0, 12], [0, 8], [0, 0]], [[0, 0], [8, 0], [8, 8], [0, 8], [0, 0]]), ('regression #12', [[0, 0], [8, 0], [8, 8], [0, 8], [0, 0], [-3, 0], [0, 0]], [[8, 0], [8, 8], [0, 8], [0, 0], [8, 0]]), ('regression #13', [[0, 0], [8, 0], [8, 8], [0, 8], [0, 0], [-3, 0], [-5, 0], [-3, 0], [0, 0]], [[8, 0], [8, 8], [0, 8], [0, 0], [8, 0]])], [('control #0', [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]], [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]), ('regression #1', [[0, 0], [10, 0], [10, 10], [12, 12], [10, 10], [0, 10], [0, 0]], [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]), ('regression #2', [[0, 0], [10, 0], [10, 10], [12, 12], [14, 14], [12, 12], [10, 10], [0, 10], [0, 0]], [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]), ('regression #3', [[5, 0], [10, 0], [10, 10], [0, 10], [0, 0], [5, 0], [5, -3], [5, 0]], [[10, 0], [10, 10], [0, 10], [0, 0], [5, 0], [10, 0]]), ('regression #4', [[5, -3], [5, 0], [10, 0], [10, 10], [0, 10], [0, 0], [5, 0], [5, -3]], [[10, 0], [10, 10], [0, 10], [0, 0], [5, 0], [10, 0]]), ('control #5', [[0, 0], [5, 0], [10, 0], [10, 10], [0, 10], [0, 0]], [[0, 0], [5, 0], [10, 0], [10, 10], [0, 10], [0, 0]]), ('boundary #7', [[0, 0], [10, 0], [0, 0], [0, 0]], None), ('boundary #8', [[0, 0], [10, 0], [5, 5], [10, 0], [0, 0]], None)]]
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 | [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]] | [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]] | Passed |
| regression #1 | [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]] | [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]] | Passed |
| regression #2 | [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]] | [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]] | Passed |
| regression #3 | [[10, 0], [10, 10], [0, 10], [0, 0], [5, 0], [10, 0]] | [[10, 0], [10, 10], [0, 10], [0, 0], [5, 0], [10, 0]] | Passed |
| regression #4 | [[10, 0], [10, 10], [0, 10], [0, 0], [5, 0], [10, 0]] | [[10, 0], [10, 10], [0, 10], [0, 0], [5, 0], [10, 0]] | Passed |
| control #5 | [[0, 0], [5, 0], [10, 0], [10, 10], [0, 10], [0, 0]] | [[0, 0], [5, 0], [10, 0], [10, 10], [0, 10], [0, 0]] | Passed |
| boundary #7 | [[10, 0], [0, 0], [10, 0]] | None | Failed |
| boundary #8 | [[5, 5], [10, 0], [5, 5]] | None | Failed |
SHA-256 / 0f248eb78c57e607e0965c5e23f25ed4fcdb6e21bb62cf7a298805fd9a47795e
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(x):
pts = x[:-1]
changed = True
while changed and len(pts) >= 3:
changed = False
n = len(pts)
for i in range(n):
if pts[i - 1] == pts[(i + 1) % n] or pts[i] == pts[i - 1]:
del pts[i]
changed = True
break
if len(pts) < 3:
return None
return pts + [pts[0]]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('control #0', [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]], [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]), ('regression #1', [[0, 0], [10, 0], [10, 10], [12, 12], [10, 10], [0, 10], [0, 0]], [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]), ('regression #2', [[0, 0], [10, 0], [10, 10], [12, 12], [14, 14], [12, 12], [10, 10], [0, 10], [0, 0]], [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]), ('regression #3', [[5, 0], [10, 0], [10, 10], [0, 10], [0, 0], [5, 0], [5, -3], [5, 0]], [[10, 0], [10, 10], [0, 10], [0, 0], [5, 0], [10, 0]]), ('regression #4', [[5, -3], [5, 0], [10, 0], [10, 10], [0, 10], [0, 0], [5, 0], [5, -3]], [[10, 0], [10, 10], [0, 10], [0, 0], [5, 0], [10, 0]]), ('control #5', [[0, 0], [5, 0], [10, 0], [10, 10], [0, 10], [0, 0]], [[0, 0], [5, 0], [10, 0], [10, 10], [0, 10], [0, 0]]), ('boundary #7', [[0, 0], [10, 0], [0, 0], [0, 0]], None), ('boundary #8', [[0, 0], [10, 0], [5, 5], [10, 0], [0, 0]], None)], [('regression #3', [[5, 0], [10, 0], [10, 10], [0, 10], [0, 0], [5, 0], [5, -3], [5, 0]], [[10, 0], [10, 10], [0, 10], [0, 0], [5, 0], [10, 0]]), ('regression #4', [[5, -3], [5, 0], [10, 0], [10, 10], [0, 10], [0, 0], [5, 0], [5, -3]], [[10, 0], [10, 10], [0, 10], [0, 0], [5, 0], [10, 0]]), ('control #5', [[0, 0], [5, 0], [10, 0], [10, 10], [0, 10], [0, 0]], [[0, 0], [5, 0], [10, 0], [10, 10], [0, 10], [0, 0]]), ('regression #6', [[0, 0], [10, 0], [10, 10], [10, 14], [10, 10], [10, 12], [10, 10], [0, 10], [0, 0]], [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]), ('boundary #7', [[0, 0], [10, 0], [0, 0], [0, 0]], None), ('boundary #8', [[0, 0], [10, 0], [5, 5], [10, 0], [0, 0]], None), ('regression #9', [[0, 0], [10, 0], [10, 10], [10, 14], [10, 8], [10, 10], [0, 10], [0, 0]], [[0, 0], [10, 0], [10, 10], [10, 14], [10, 8], [10, 10], [0, 10], [0, 0]]), ('control #10', [[0, 0], [4, 0], [4, 4], [0, 0]], [[0, 0], [4, 0], [4, 4], [0, 0]])], [('regression #6', [[0, 0], [10, 0], [10, 10], [10, 14], [10, 10], [10, 12], [10, 10], [0, 10], [0, 0]], [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]), ('boundary #7', [[0, 0], [10, 0], [0, 0], [0, 0]], None), ('boundary #8', [[0, 0], [10, 0], [5, 5], [10, 0], [0, 0]], None), ('regression #9', [[0, 0], [10, 0], [10, 10], [10, 14], [10, 8], [10, 10], [0, 10], [0, 0]], [[0, 0], [10, 0], [10, 10], [10, 14], [10, 8], [10, 10], [0, 10], [0, 0]]), ('control #10', [[0, 0], [4, 0], [4, 4], [0, 0]], [[0, 0], [4, 0], [4, 4], [0, 0]]), ('regression #11', [[0, 0], [8, 0], [8, 8], [0, 8], [0, 12], [0, 8], [0, 0]], [[0, 0], [8, 0], [8, 8], [0, 8], [0, 0]]), ('regression #12', [[0, 0], [8, 0], [8, 8], [0, 8], [0, 0], [-3, 0], [0, 0]], [[8, 0], [8, 8], [0, 8], [0, 0], [8, 0]]), ('regression #13', [[0, 0], [8, 0], [8, 8], [0, 8], [0, 0], [-3, 0], [-5, 0], [-3, 0], [0, 0]], [[8, 0], [8, 8], [0, 8], [0, 0], [8, 0]])], [('control #0', [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]], [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]), ('regression #1', [[0, 0], [10, 0], [10, 10], [12, 12], [10, 10], [0, 10], [0, 0]], [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]), ('regression #2', [[0, 0], [10, 0], [10, 10], [12, 12], [14, 14], [12, 12], [10, 10], [0, 10], [0, 0]], [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]), ('boundary #7', [[0, 0], [10, 0], [0, 0], [0, 0]], None), ('boundary #8', [[0, 0], [10, 0], [5, 5], [10, 0], [0, 0]], None), ('regression #11', [[0, 0], [8, 0], [8, 8], [0, 8], [0, 12], [0, 8], [0, 0]], [[0, 0], [8, 0], [8, 8], [0, 8], [0, 0]]), ('regression #12', [[0, 0], [8, 0], [8, 8], [0, 8], [0, 0], [-3, 0], [0, 0]], [[8, 0], [8, 8], [0, 8], [0, 0], [8, 0]]), ('regression #13', [[0, 0], [8, 0], [8, 8], [0, 8], [0, 0], [-3, 0], [-5, 0], [-3, 0], [0, 0]], [[8, 0], [8, 8], [0, 8], [0, 0], [8, 0]])], [('control #0', [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]], [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]), ('regression #1', [[0, 0], [10, 0], [10, 10], [12, 12], [10, 10], [0, 10], [0, 0]], [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]), ('regression #2', [[0, 0], [10, 0], [10, 10], [12, 12], [14, 14], [12, 12], [10, 10], [0, 10], [0, 0]], [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]), ('regression #3', [[5, 0], [10, 0], [10, 10], [0, 10], [0, 0], [5, 0], [5, -3], [5, 0]], [[10, 0], [10, 10], [0, 10], [0, 0], [5, 0], [10, 0]]), ('regression #4', [[5, -3], [5, 0], [10, 0], [10, 10], [0, 10], [0, 0], [5, 0], [5, -3]], [[10, 0], [10, 10], [0, 10], [0, 0], [5, 0], [10, 0]]), ('control #5', [[0, 0], [5, 0], [10, 0], [10, 10], [0, 10], [0, 0]], [[0, 0], [5, 0], [10, 0], [10, 10], [0, 10], [0, 0]]), ('boundary #7', [[0, 0], [10, 0], [0, 0], [0, 0]], None), ('boundary #8', [[0, 0], [10, 0], [5, 5], [10, 0], [0, 0]], None)]]
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 | [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]] | [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]] | Passed |
| regression #1 | [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]] | [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]] | Passed |
| regression #2 | [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]] | [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]] | Passed |
| regression #3 | [[10, 0], [10, 10], [0, 10], [0, 0], [5, 0], [10, 0]] | [[10, 0], [10, 10], [0, 10], [0, 0], [5, 0], [10, 0]] | Passed |
| regression #4 | [[10, 0], [10, 10], [0, 10], [0, 0], [5, 0], [10, 0]] | [[10, 0], [10, 10], [0, 10], [0, 0], [5, 0], [10, 0]] | Passed |
| control #5 | [[0, 0], [5, 0], [10, 0], [10, 10], [0, 10], [0, 0]] | [[0, 0], [5, 0], [10, 0], [10, 10], [0, 10], [0, 0]] | Passed |
| boundary #7 | None | None | Passed |
| boundary #8 | None | None | Passed |
SHA-256 / 6412a9d3ea63f0610f73c72bcc7b19101f451e165042f1b0a5fdb4812b35e5f8
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:24.161719+00:00.
Case digest / 5989f90f176d71646b3ac8b78bbcfa23673b09a0d3bb0a5342e257ab0810bcbe