FA-70491 / GIS polygon topology / Open access
TopoJSON arc stitching into rings: junction de-duplication · case 01
Stitched rings lose their closing vertex and contain doubled junctions.
ROOT CAUSE
Subsequent arcs drop their last position instead of the first, which duplicates the previous arc end.
VERIFIED REPAIR
At the junction de-duplication step restore `if out: pts = pts[1:]`, leaving the rest of the model unchanged.
Unsuccessful approach: The junction is dropped for forward arcs only; backward arcs still repeat it.
Case contract
Input [arcs, transform, ring]. Each arc is a list of quantized delta positions (the first is absolute, later ones add to the running position within that arc). transform [sx, sy, tx, ty] maps q to q*s + t per axis; a null transform is the identity [1, 1, 0, 0]. A ring lists arc indexes; a negative index i means arc ~i (bitwise complement) traversed backwards. Arcs after the first contribute all but their first position, which duplicates the previous arc end. Return the stitched list of [x, y].
Why this case matters
Shared-boundary topology formats store each border once; decoding errors break rings, reverse borders or duplicate junction vertices.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(x):
arcs, transform, ring = x
sx, sy, tx, ty = transform or [1, 1, 0, 0]
def decode(i):
pts = []
qx = qy = 0
for dx, dy in arcs[i]:
qx += dx
qy += dy
pts.append([qx * sx + tx, qy * sy + ty])
return pts
out = []
for ref in ring:
idx = ~ref if ref < 0 else ref
pts = decode(idx)
if ref < 0:
pts = pts[::-1]
if out:
pts = pts[:-1]
out.extend(pts)
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('control #0', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [0, 1]], [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5], [100.0, 202.5], [100.0, 200.0]]), ('control #1', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [0, 1]], [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5], [100.0, 202.5], [100.0, 200.0]]), ('control #2', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [-2, -1]], [[100.0, 200.0], [100.0, 202.5], [105.0, 202.5], [105.0, 200.0], [100.0, 200.0]]), ('control #3', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [2, 3, -1]], [[105.0, 202.5], [107.5, 202.5], [107.5, 200.0], [105.0, 200.0], [105.0, 200.0], [100.0, 200.0]]), ('control #4', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [0, -3, -4]], [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5], [107.5, 202.5], [105.0, 202.5], [107.5, 200.0]]), ('boundary #12', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [0]], [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5]]), ('boundary #13', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [-1]], [[105.0, 202.5], [105.0, 200.0], [100.0, 200.0]]), ('regression #16', [[[[3, 4], [2, 0], [0, 2], [-2, -2]]], [1.0, 2.0, 0.0, 0.0], [0]], [[3.0, 8.0], [5.0, 8.0], [5.0, 12.0], [3.0, 8.0]])], [('control #1', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [0, 1]], [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5], [100.0, 202.5], [100.0, 200.0]]), ('control #3', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [2, 3, -1]], [[105.0, 202.5], [107.5, 202.5], [107.5, 200.0], [105.0, 200.0], [105.0, 200.0], [100.0, 200.0]]), ('control #5', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [4, -2]], [[100.0, 202.5], [100.0, 203.75], [105.0, 203.75], [105.0, 202.5], [100.0, 202.5], [105.0, 202.5]]), ('control #6', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [1, 4]], [[105.0, 202.5], [100.0, 202.5], [100.0, 200.0], [100.0, 203.75], [105.0, 203.75], [105.0, 202.5]]), ('control #7', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], None, [0, 1]], [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]), ('boundary #12', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [0]], [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5]]), ('boundary #13', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [-1]], [[105.0, 202.5], [105.0, 200.0], [100.0, 200.0]]), ('regression #16', [[[[3, 4], [2, 0], [0, 2], [-2, -2]]], [1.0, 2.0, 0.0, 0.0], [0]], [[3.0, 8.0], [5.0, 8.0], [5.0, 12.0], [3.0, 8.0]])], [('control #2', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [-2, -1]], [[100.0, 200.0], [100.0, 202.5], [105.0, 202.5], [105.0, 200.0], [100.0, 200.0]]), ('control #5', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [4, -2]], [[100.0, 202.5], [100.0, 203.75], [105.0, 203.75], [105.0, 202.5], [100.0, 202.5], [105.0, 202.5]]), ('control #8', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], None, [-2, -1]], [[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]]), ('control #9', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], None, [2, 3, -1]], [[10, 10], [15, 10], [15, 0], [10, 0], [10, 0], [0, 0]]), ('control #10', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], None, [1, 4]], [[10, 10], [0, 10], [0, 0], [0, 15], [10, 15], [10, 10]]), ('boundary #12', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [0]], [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5]]), ('boundary #13', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [-1]], [[105.0, 202.5], [105.0, 200.0], [100.0, 200.0]]), ('regression #16', [[[[3, 4], [2, 0], [0, 2], [-2, -2]]], [1.0, 2.0, 0.0, 0.0], [0]], [[3.0, 8.0], [5.0, 8.0], [5.0, 12.0], [3.0, 8.0]])], [('control #3', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [2, 3, -1]], [[105.0, 202.5], [107.5, 202.5], [107.5, 200.0], [105.0, 200.0], [105.0, 200.0], [100.0, 200.0]]), ('control #8', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], None, [-2, -1]], [[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]]), ('regression #11', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [2.0, 3.0, -5.0, 7.0], [0, -3, -4]], [[-5.0, 7.0], [15.0, 7.0], [15.0, 37.0], [25.0, 37.0], [15.0, 37.0], [25.0, 7.0]]), ('boundary #12', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [0]], [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5]]), ('boundary #13', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [-1]], [[105.0, 202.5], [105.0, 200.0], [100.0, 200.0]]), ('regression #14', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [1.0, 1.0, 0.0, 0.0], [-5, 0]], [[10.0, 10.0], [10.0, 15.0], [0.0, 15.0], [0.0, 10.0], [10.0, 0.0], [10.0, 10.0]]), ('control #15', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.1, 0.1, -1.0, 2.0], [3, -3, 1]], [[0.5, 2.0], [0.0, 2.0], [0.5, 3.0], [0.0, 3.0], [-1.0, 3.0], [-1.0, 2.0]]), ('regression #16', [[[[3, 4], [2, 0], [0, 2], [-2, -2]]], [1.0, 2.0, 0.0, 0.0], [0]], [[3.0, 8.0], [5.0, 8.0], [5.0, 12.0], [3.0, 8.0]])], [('control #0', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [0, 1]], [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5], [100.0, 202.5], [100.0, 200.0]]), ('control #4', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [0, -3, -4]], [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5], [107.5, 202.5], [105.0, 202.5], [107.5, 200.0]]), ('control #9', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], None, [2, 3, -1]], [[10, 10], [15, 10], [15, 0], [10, 0], [10, 0], [0, 0]]), ('boundary #12', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [0]], [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5]]), ('regression #14', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [1.0, 1.0, 0.0, 0.0], [-5, 0]], [[10.0, 10.0], [10.0, 15.0], [0.0, 15.0], [0.0, 10.0], [10.0, 0.0], [10.0, 10.0]]), ('control #15', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.1, 0.1, -1.0, 2.0], [3, -3, 1]], [[0.5, 2.0], [0.0, 2.0], [0.5, 3.0], [0.0, 3.0], [-1.0, 3.0], [-1.0, 2.0]]), ('regression #16', [[[[3, 4], [2, 0], [0, 2], [-2, -2]]], [1.0, 2.0, 0.0, 0.0], [0]], [[3.0, 8.0], [5.0, 8.0], [5.0, 12.0], [3.0, 8.0]]), ('regression #17', [[[[3, 4], [2, 0], [0, 2], [-2, -2]]], [1.0, 2.0, 0.0, 0.0], [-1]], [[3.0, 8.0], [5.0, 12.0], [5.0, 8.0], [3.0, 8.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 | [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5], [105.0, 202.5], [100.0, 202.5]] | [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5], [100.0, 202.5], [100.0, 200.0]] | Failed |
| control #1 | [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5], [105.0, 202.5], [100.0, 202.5]] | [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5], [100.0, 202.5], [100.0, 200.0]] | Failed |
| control #2 | [[100.0, 200.0], [100.0, 202.5], [105.0, 202.5], [105.0, 202.5], [105.0, 200.0]] | [[100.0, 200.0], [100.0, 202.5], [105.0, 202.5], [105.0, 200.0], [100.0, 200.0]] | Failed |
| control #3 | [[105.0, 202.5], [107.5, 202.5], [107.5, 200.0], [107.5, 200.0], [105.0, 202.5], [105.0, 200.0]] | [[105.0, 202.5], [107.5, 202.5], [107.5, 200.0], [105.0, 200.0], [105.0, 200.0], [100.0, 200.0]] | Failed |
| control #4 | [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5], [107.5, 200.0], [107.5, 202.5], [105.0, 200.0]] | [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5], [107.5, 202.5], [105.0, 202.5], [107.5, 200.0]] | Failed |
| boundary #12 | [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5]] | [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5]] | Passed |
| boundary #13 | [[105.0, 202.5], [105.0, 200.0], [100.0, 200.0]] | [[105.0, 202.5], [105.0, 200.0], [100.0, 200.0]] | Passed |
| regression #16 | [[3.0, 8.0], [5.0, 8.0], [5.0, 12.0], [3.0, 8.0]] | [[3.0, 8.0], [5.0, 8.0], [5.0, 12.0], [3.0, 8.0]] | Passed |
SHA-256 / c56fab5c5002616f37e592eae5e3bf131f0b2eccf78e425009843c7ed51d588a
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(x):
arcs, transform, ring = x
sx, sy, tx, ty = transform or [1, 1, 0, 0]
def decode(i):
pts = []
qx = qy = 0
for dx, dy in arcs[i]:
qx += dx
qy += dy
pts.append([qx * sx + tx, qy * sy + ty])
return pts
out = []
for ref in ring:
idx = ~ref if ref < 0 else ref
pts = decode(idx)
if ref < 0:
pts = pts[::-1]
if out and ref >= 0:
pts = pts[1:]
out.extend(pts)
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('control #0', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [0, 1]], [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5], [100.0, 202.5], [100.0, 200.0]]), ('control #1', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [0, 1]], [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5], [100.0, 202.5], [100.0, 200.0]]), ('control #2', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [-2, -1]], [[100.0, 200.0], [100.0, 202.5], [105.0, 202.5], [105.0, 200.0], [100.0, 200.0]]), ('control #3', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [2, 3, -1]], [[105.0, 202.5], [107.5, 202.5], [107.5, 200.0], [105.0, 200.0], [105.0, 200.0], [100.0, 200.0]]), ('control #4', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [0, -3, -4]], [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5], [107.5, 202.5], [105.0, 202.5], [107.5, 200.0]]), ('boundary #12', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [0]], [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5]]), ('boundary #13', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [-1]], [[105.0, 202.5], [105.0, 200.0], [100.0, 200.0]]), ('regression #16', [[[[3, 4], [2, 0], [0, 2], [-2, -2]]], [1.0, 2.0, 0.0, 0.0], [0]], [[3.0, 8.0], [5.0, 8.0], [5.0, 12.0], [3.0, 8.0]])], [('control #1', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [0, 1]], [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5], [100.0, 202.5], [100.0, 200.0]]), ('control #3', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [2, 3, -1]], [[105.0, 202.5], [107.5, 202.5], [107.5, 200.0], [105.0, 200.0], [105.0, 200.0], [100.0, 200.0]]), ('control #5', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [4, -2]], [[100.0, 202.5], [100.0, 203.75], [105.0, 203.75], [105.0, 202.5], [100.0, 202.5], [105.0, 202.5]]), ('control #6', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [1, 4]], [[105.0, 202.5], [100.0, 202.5], [100.0, 200.0], [100.0, 203.75], [105.0, 203.75], [105.0, 202.5]]), ('control #7', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], None, [0, 1]], [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]), ('boundary #12', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [0]], [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5]]), ('boundary #13', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [-1]], [[105.0, 202.5], [105.0, 200.0], [100.0, 200.0]]), ('regression #16', [[[[3, 4], [2, 0], [0, 2], [-2, -2]]], [1.0, 2.0, 0.0, 0.0], [0]], [[3.0, 8.0], [5.0, 8.0], [5.0, 12.0], [3.0, 8.0]])], [('control #2', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [-2, -1]], [[100.0, 200.0], [100.0, 202.5], [105.0, 202.5], [105.0, 200.0], [100.0, 200.0]]), ('control #5', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [4, -2]], [[100.0, 202.5], [100.0, 203.75], [105.0, 203.75], [105.0, 202.5], [100.0, 202.5], [105.0, 202.5]]), ('control #8', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], None, [-2, -1]], [[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]]), ('control #9', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], None, [2, 3, -1]], [[10, 10], [15, 10], [15, 0], [10, 0], [10, 0], [0, 0]]), ('control #10', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], None, [1, 4]], [[10, 10], [0, 10], [0, 0], [0, 15], [10, 15], [10, 10]]), ('boundary #12', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [0]], [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5]]), ('boundary #13', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [-1]], [[105.0, 202.5], [105.0, 200.0], [100.0, 200.0]]), ('regression #16', [[[[3, 4], [2, 0], [0, 2], [-2, -2]]], [1.0, 2.0, 0.0, 0.0], [0]], [[3.0, 8.0], [5.0, 8.0], [5.0, 12.0], [3.0, 8.0]])], [('control #3', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [2, 3, -1]], [[105.0, 202.5], [107.5, 202.5], [107.5, 200.0], [105.0, 200.0], [105.0, 200.0], [100.0, 200.0]]), ('control #8', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], None, [-2, -1]], [[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]]), ('regression #11', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [2.0, 3.0, -5.0, 7.0], [0, -3, -4]], [[-5.0, 7.0], [15.0, 7.0], [15.0, 37.0], [25.0, 37.0], [15.0, 37.0], [25.0, 7.0]]), ('boundary #12', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [0]], [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5]]), ('boundary #13', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [-1]], [[105.0, 202.5], [105.0, 200.0], [100.0, 200.0]]), ('regression #14', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [1.0, 1.0, 0.0, 0.0], [-5, 0]], [[10.0, 10.0], [10.0, 15.0], [0.0, 15.0], [0.0, 10.0], [10.0, 0.0], [10.0, 10.0]]), ('control #15', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.1, 0.1, -1.0, 2.0], [3, -3, 1]], [[0.5, 2.0], [0.0, 2.0], [0.5, 3.0], [0.0, 3.0], [-1.0, 3.0], [-1.0, 2.0]]), ('regression #16', [[[[3, 4], [2, 0], [0, 2], [-2, -2]]], [1.0, 2.0, 0.0, 0.0], [0]], [[3.0, 8.0], [5.0, 8.0], [5.0, 12.0], [3.0, 8.0]])], [('control #0', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [0, 1]], [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5], [100.0, 202.5], [100.0, 200.0]]), ('control #4', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [0, -3, -4]], [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5], [107.5, 202.5], [105.0, 202.5], [107.5, 200.0]]), ('control #9', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], None, [2, 3, -1]], [[10, 10], [15, 10], [15, 0], [10, 0], [10, 0], [0, 0]]), ('boundary #12', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [0]], [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5]]), ('regression #14', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [1.0, 1.0, 0.0, 0.0], [-5, 0]], [[10.0, 10.0], [10.0, 15.0], [0.0, 15.0], [0.0, 10.0], [10.0, 0.0], [10.0, 10.0]]), ('control #15', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.1, 0.1, -1.0, 2.0], [3, -3, 1]], [[0.5, 2.0], [0.0, 2.0], [0.5, 3.0], [0.0, 3.0], [-1.0, 3.0], [-1.0, 2.0]]), ('regression #16', [[[[3, 4], [2, 0], [0, 2], [-2, -2]]], [1.0, 2.0, 0.0, 0.0], [0]], [[3.0, 8.0], [5.0, 8.0], [5.0, 12.0], [3.0, 8.0]]), ('regression #17', [[[[3, 4], [2, 0], [0, 2], [-2, -2]]], [1.0, 2.0, 0.0, 0.0], [-1]], [[3.0, 8.0], [5.0, 12.0], [5.0, 8.0], [3.0, 8.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 | [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5], [100.0, 202.5], [100.0, 200.0]] | [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5], [100.0, 202.5], [100.0, 200.0]] | Passed |
| control #1 | [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5], [100.0, 202.5], [100.0, 200.0]] | [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5], [100.0, 202.5], [100.0, 200.0]] | Passed |
| control #2 | [[100.0, 200.0], [100.0, 202.5], [105.0, 202.5], [105.0, 202.5], [105.0, 200.0], [100.0, 200.0]] | [[100.0, 200.0], [100.0, 202.5], [105.0, 202.5], [105.0, 200.0], [100.0, 200.0]] | Failed |
| control #3 | [[105.0, 202.5], [107.5, 202.5], [107.5, 200.0], [105.0, 200.0], [105.0, 202.5], [105.0, 200.0], [100.0, 200.0]] | [[105.0, 202.5], [107.5, 202.5], [107.5, 200.0], [105.0, 200.0], [105.0, 200.0], [100.0, 200.0]] | Failed |
| control #4 | [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5], [107.5, 200.0], [107.5, 202.5], [105.0, 202.5], [105.0, 200.0], [107.5, 200.0]] | [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5], [107.5, 202.5], [105.0, 202.5], [107.5, 200.0]] | Failed |
| boundary #12 | [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5]] | [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5]] | Passed |
| boundary #13 | [[105.0, 202.5], [105.0, 200.0], [100.0, 200.0]] | [[105.0, 202.5], [105.0, 200.0], [100.0, 200.0]] | Passed |
| regression #16 | [[3.0, 8.0], [5.0, 8.0], [5.0, 12.0], [3.0, 8.0]] | [[3.0, 8.0], [5.0, 8.0], [5.0, 12.0], [3.0, 8.0]] | Passed |
SHA-256 / c3d8a6b75c95cab627499487f5970eda9d7379473503e109a10cda4de57a4d72
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(x):
arcs, transform, ring = x
sx, sy, tx, ty = transform or [1, 1, 0, 0]
def decode(i):
pts = []
qx = qy = 0
for dx, dy in arcs[i]:
qx += dx
qy += dy
pts.append([qx * sx + tx, qy * sy + ty])
return pts
out = []
for ref in ring:
idx = ~ref if ref < 0 else ref
pts = decode(idx)
if ref < 0:
pts = pts[::-1]
if out:
pts = pts[1:]
out.extend(pts)
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('control #0', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [0, 1]], [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5], [100.0, 202.5], [100.0, 200.0]]), ('control #1', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [0, 1]], [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5], [100.0, 202.5], [100.0, 200.0]]), ('control #2', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [-2, -1]], [[100.0, 200.0], [100.0, 202.5], [105.0, 202.5], [105.0, 200.0], [100.0, 200.0]]), ('control #3', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [2, 3, -1]], [[105.0, 202.5], [107.5, 202.5], [107.5, 200.0], [105.0, 200.0], [105.0, 200.0], [100.0, 200.0]]), ('control #4', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [0, -3, -4]], [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5], [107.5, 202.5], [105.0, 202.5], [107.5, 200.0]]), ('boundary #12', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [0]], [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5]]), ('boundary #13', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [-1]], [[105.0, 202.5], [105.0, 200.0], [100.0, 200.0]]), ('regression #16', [[[[3, 4], [2, 0], [0, 2], [-2, -2]]], [1.0, 2.0, 0.0, 0.0], [0]], [[3.0, 8.0], [5.0, 8.0], [5.0, 12.0], [3.0, 8.0]])], [('control #1', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [0, 1]], [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5], [100.0, 202.5], [100.0, 200.0]]), ('control #3', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [2, 3, -1]], [[105.0, 202.5], [107.5, 202.5], [107.5, 200.0], [105.0, 200.0], [105.0, 200.0], [100.0, 200.0]]), ('control #5', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [4, -2]], [[100.0, 202.5], [100.0, 203.75], [105.0, 203.75], [105.0, 202.5], [100.0, 202.5], [105.0, 202.5]]), ('control #6', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [1, 4]], [[105.0, 202.5], [100.0, 202.5], [100.0, 200.0], [100.0, 203.75], [105.0, 203.75], [105.0, 202.5]]), ('control #7', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], None, [0, 1]], [[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]), ('boundary #12', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [0]], [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5]]), ('boundary #13', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [-1]], [[105.0, 202.5], [105.0, 200.0], [100.0, 200.0]]), ('regression #16', [[[[3, 4], [2, 0], [0, 2], [-2, -2]]], [1.0, 2.0, 0.0, 0.0], [0]], [[3.0, 8.0], [5.0, 8.0], [5.0, 12.0], [3.0, 8.0]])], [('control #2', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [-2, -1]], [[100.0, 200.0], [100.0, 202.5], [105.0, 202.5], [105.0, 200.0], [100.0, 200.0]]), ('control #5', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [4, -2]], [[100.0, 202.5], [100.0, 203.75], [105.0, 203.75], [105.0, 202.5], [100.0, 202.5], [105.0, 202.5]]), ('control #8', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], None, [-2, -1]], [[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]]), ('control #9', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], None, [2, 3, -1]], [[10, 10], [15, 10], [15, 0], [10, 0], [10, 0], [0, 0]]), ('control #10', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], None, [1, 4]], [[10, 10], [0, 10], [0, 0], [0, 15], [10, 15], [10, 10]]), ('boundary #12', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [0]], [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5]]), ('boundary #13', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [-1]], [[105.0, 202.5], [105.0, 200.0], [100.0, 200.0]]), ('regression #16', [[[[3, 4], [2, 0], [0, 2], [-2, -2]]], [1.0, 2.0, 0.0, 0.0], [0]], [[3.0, 8.0], [5.0, 8.0], [5.0, 12.0], [3.0, 8.0]])], [('control #3', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [2, 3, -1]], [[105.0, 202.5], [107.5, 202.5], [107.5, 200.0], [105.0, 200.0], [105.0, 200.0], [100.0, 200.0]]), ('control #8', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], None, [-2, -1]], [[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]]), ('regression #11', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [2.0, 3.0, -5.0, 7.0], [0, -3, -4]], [[-5.0, 7.0], [15.0, 7.0], [15.0, 37.0], [25.0, 37.0], [15.0, 37.0], [25.0, 7.0]]), ('boundary #12', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [0]], [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5]]), ('boundary #13', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [-1]], [[105.0, 202.5], [105.0, 200.0], [100.0, 200.0]]), ('regression #14', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [1.0, 1.0, 0.0, 0.0], [-5, 0]], [[10.0, 10.0], [10.0, 15.0], [0.0, 15.0], [0.0, 10.0], [10.0, 0.0], [10.0, 10.0]]), ('control #15', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.1, 0.1, -1.0, 2.0], [3, -3, 1]], [[0.5, 2.0], [0.0, 2.0], [0.5, 3.0], [0.0, 3.0], [-1.0, 3.0], [-1.0, 2.0]]), ('regression #16', [[[[3, 4], [2, 0], [0, 2], [-2, -2]]], [1.0, 2.0, 0.0, 0.0], [0]], [[3.0, 8.0], [5.0, 8.0], [5.0, 12.0], [3.0, 8.0]])], [('control #0', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [0, 1]], [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5], [100.0, 202.5], [100.0, 200.0]]), ('control #4', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [0, -3, -4]], [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5], [107.5, 202.5], [105.0, 202.5], [107.5, 200.0]]), ('control #9', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], None, [2, 3, -1]], [[10, 10], [15, 10], [15, 0], [10, 0], [10, 0], [0, 0]]), ('boundary #12', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.5, 0.25, 100.0, 200.0], [0]], [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5]]), ('regression #14', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [1.0, 1.0, 0.0, 0.0], [-5, 0]], [[10.0, 10.0], [10.0, 15.0], [0.0, 15.0], [0.0, 10.0], [10.0, 0.0], [10.0, 10.0]]), ('control #15', [[[[0, 0], [10, 0], [0, 10]], [[10, 10], [-10, 0], [0, -10]], [[10, 10], [5, 0], [0, -10]], [[15, 0], [-5, 0]], [[0, 10], [0, 5], [10, 0], [0, -5]]], [0.1, 0.1, -1.0, 2.0], [3, -3, 1]], [[0.5, 2.0], [0.0, 2.0], [0.5, 3.0], [0.0, 3.0], [-1.0, 3.0], [-1.0, 2.0]]), ('regression #16', [[[[3, 4], [2, 0], [0, 2], [-2, -2]]], [1.0, 2.0, 0.0, 0.0], [0]], [[3.0, 8.0], [5.0, 8.0], [5.0, 12.0], [3.0, 8.0]]), ('regression #17', [[[[3, 4], [2, 0], [0, 2], [-2, -2]]], [1.0, 2.0, 0.0, 0.0], [-1]], [[3.0, 8.0], [5.0, 12.0], [5.0, 8.0], [3.0, 8.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 | [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5], [100.0, 202.5], [100.0, 200.0]] | [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5], [100.0, 202.5], [100.0, 200.0]] | Passed |
| control #1 | [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5], [100.0, 202.5], [100.0, 200.0]] | [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5], [100.0, 202.5], [100.0, 200.0]] | Passed |
| control #2 | [[100.0, 200.0], [100.0, 202.5], [105.0, 202.5], [105.0, 200.0], [100.0, 200.0]] | [[100.0, 200.0], [100.0, 202.5], [105.0, 202.5], [105.0, 200.0], [100.0, 200.0]] | Passed |
| control #3 | [[105.0, 202.5], [107.5, 202.5], [107.5, 200.0], [105.0, 200.0], [105.0, 200.0], [100.0, 200.0]] | [[105.0, 202.5], [107.5, 202.5], [107.5, 200.0], [105.0, 200.0], [105.0, 200.0], [100.0, 200.0]] | Passed |
| control #4 | [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5], [107.5, 202.5], [105.0, 202.5], [107.5, 200.0]] | [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5], [107.5, 202.5], [105.0, 202.5], [107.5, 200.0]] | Passed |
| boundary #12 | [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5]] | [[100.0, 200.0], [105.0, 200.0], [105.0, 202.5]] | Passed |
| boundary #13 | [[105.0, 202.5], [105.0, 200.0], [100.0, 200.0]] | [[105.0, 202.5], [105.0, 200.0], [100.0, 200.0]] | Passed |
| regression #16 | [[3.0, 8.0], [5.0, 8.0], [5.0, 12.0], [3.0, 8.0]] | [[3.0, 8.0], [5.0, 8.0], [5.0, 12.0], [3.0, 8.0]] | Passed |
SHA-256 / 8a4c1f22d2c4d4d9e4b5b5fc16123d9f4ee86ca10e43aaf7ea63b8cc308c17e0
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.205186+00:00.
Case digest / 677fe3cfd246c17e8f564834b3ab012e74e5817ca4e5258ede3ca1571b258165