FAILURE MAP
← Case archive

FA-70466 / GIS polygon topology / Open access

TopoJSON arc stitching into rings: reversed arc index · case 01

Reversed arcs pull in the neighbouring arc.

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

ROOT CAUSE

A negative reference is decoded with arithmetic negation instead of bitwise complement, off by one.

VERIFIED REPAIR

At the reversed arc index step restore `idx = ~ref if ref < 0 else ref`, leaving the rest of the model unchanged.

Unsuccessful approach: The complement arithmetic is right for negatives but the <= 0 guard maps a forward reference to arc 0 onto the last arc.

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]]), ('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 #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]]), ('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]]), ('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 #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]]), ('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 #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 #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]]), ('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]]), ('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]]), ('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 #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]]), ('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]]), ('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 #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 #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 #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 #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 #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]]), ('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]]), ('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]])]]
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 fixtureActualExpectedOutcome
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[[107.5, 200.0], [107.5, 202.5], [105.0, 202.5], [100.0, 202.5], [105.0, 202.5]][[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], [100.0, 202.5], [105.0, 202.5]][[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], [105.0, 203.75], [100.0, 203.75], [100.0, 202.5]][[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
control #6[[105.0, 202.5], [100.0, 202.5], [100.0, 200.0], [100.0, 203.75], [105.0, 203.75], [105.0, 202.5]][[105.0, 202.5], [100.0, 202.5], [100.0, 200.0], [100.0, 203.75], [105.0, 203.75], [105.0, 202.5]]Passed
control #10[[10, 10], [0, 10], [0, 0], [0, 15], [10, 15], [10, 10]][[10, 10], [0, 10], [0, 0], [0, 15], [10, 15], [10, 10]]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 / 7427523629da0a61b6c7ae22d64cbb581c578cab064b831c707c697c331356ed

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 - 1 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]]), ('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 #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]]), ('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]]), ('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 #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]]), ('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 #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 #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]]), ('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]]), ('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]]), ('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 #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]]), ('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]]), ('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 #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 #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 #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 #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 #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]]), ('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]]), ('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]])]]
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 fixtureActualExpectedOutcome
control #0[[100.0, 202.5], [100.0, 203.75], [105.0, 203.75], [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]]Failed
control #1[[100.0, 202.5], [100.0, 203.75], [105.0, 203.75], [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]]Failed
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, 202.5], [100.0, 203.75], [105.0, 203.75], [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]]Failed
control #6[[105.0, 202.5], [100.0, 202.5], [100.0, 200.0], [100.0, 203.75], [105.0, 203.75], [105.0, 202.5]][[105.0, 202.5], [100.0, 202.5], [100.0, 200.0], [100.0, 203.75], [105.0, 203.75], [105.0, 202.5]]Passed
control #10[[10, 10], [0, 10], [0, 0], [0, 15], [10, 15], [10, 10]][[10, 10], [0, 10], [0, 0], [0, 15], [10, 15], [10, 10]]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 / b99d161a97ebe01b1a37245bc587b8a9cb32aa9fa641bce955defde9add85ef7

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]]), ('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 #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]]), ('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]]), ('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 #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]]), ('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 #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 #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]]), ('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]]), ('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]]), ('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 #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]]), ('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]]), ('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 #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 #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 #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 #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 #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]]), ('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]]), ('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]])]]
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 fixtureActualExpectedOutcome
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
control #6[[105.0, 202.5], [100.0, 202.5], [100.0, 200.0], [100.0, 203.75], [105.0, 203.75], [105.0, 202.5]][[105.0, 202.5], [100.0, 202.5], [100.0, 200.0], [100.0, 203.75], [105.0, 203.75], [105.0, 202.5]]Passed
control #10[[10, 10], [0, 10], [0, 0], [0, 15], [10, 15], [10, 10]][[10, 10], [0, 10], [0, 0], [0, 15], [10, 15], [10, 10]]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 / 8355e18678f2a8867cf823758ab23dc9bded5a77052d3051e9447775cbbe74c6

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

Case digest / f8c18235e93bc637b4245165f2e4ed631427e775b17842cc8a7cf553566c6339