FAILURE MAP
← Case archive

FA-70651 / GIS polygon topology / Open access

Area-weighted centroid of a multipolygon with holes: edge moment terms · case 01

Centroid x coordinates drift along the edge direction.

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

ROOT CAUSE

The x moment uses twice the start vertex instead of the sum of both edge endpoints.

VERIFIED REPAIR

At the edge moment terms step restore `mx += (p[0] + q[0]) * c`, leaving the rest of the model unchanged.

Unsuccessful approach: Using |cross| breaks the signed moment for edges on the far side of the origin.

Case contract

Input: a multipolygon as a list of polygons, each a list of closed rings (exterior first). Ring orientation is arbitrary: every ring contributes its absolute area and matching first moments, exteriors positively and holes negatively. Moments use the shoelace terms (xi + xi+1)*cross/6. If the total area is 0 return None, else the centroid [cx, cy] rounded to 6 decimals.

Why this case matters

Label placement, zonal summaries and map joins use polygon centroids; courtyards and multi-part parcels must pull the centroid correctly.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(x):
    polys = x
    A = Cx = Cy = 0.0
    for rings in polys:
        for k, r in enumerate(rings):
            a2 = mx = my = 0.0
            for p, q in zip(r, r[1:]):
                c = p[0] * q[1] - q[0] * p[1]
                a2 += c
                mx += 2 * p[0] * c
                my += (p[1] + q[1]) * c
            sg = 1.0 if a2 >= 0 else -1.0
            w = 1.0 if k == 0 else -1.0
            A += w * sg * a2 / 2
            Cx += w * sg * mx / 6
            Cy += w * sg * my / 6
    if A == 0:
        return None
    return [round(Cx / A, 6), round(Cy / A, 6)]
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]]]], [5.0, 5.0]), ('regression #1', [[[[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]], [[0, 0], [0, 5], [5, 5], [5, 0], [0, 0]]]], [5.833333, 5.833333]), ('regression #2', [[[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]], [[6, 6], [9, 6], [9, 9], [6, 9], [6, 6]]]], [4.752747, 4.752747]), ('regression #3', [[[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]]]], [5.0, 5.0]), ('regression #4', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]]], [[[10, 0], [20, 0], [20, 10], [10, 10], [10, 0]]]], [14.461538, 4.846154]), ('regression #5', [[[[0, 0], [4, 0], [4, 4], [0, 4], [0, 0]]], [[[10, 10], [10, 12], [12, 12], [12, 10], [10, 10]]]], [3.8, 3.8]), ('boundary #6', [[[[0, 0], [5, 0], [10, 0], [0, 0]]]], None), ('boundary #10', [[[[0, 0], [4, 0], [4, 4], [0, 4], [0, 0]], [[0, 0], [0, 4], [4, 4], [4, 0], [0, 0]]]], None)], [('regression #1', [[[[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]], [[0, 0], [0, 5], [5, 5], [5, 0], [0, 0]]]], [5.833333, 5.833333]), ('regression #3', [[[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]]]], [5.0, 5.0]), ('regression #5', [[[[0, 0], [4, 0], [4, 4], [0, 4], [0, 0]]], [[[10, 10], [10, 12], [12, 12], [12, 10], [10, 10]]]], [3.8, 3.8]), ('boundary #6', [[[[0, 0], [5, 0], [10, 0], [0, 0]]]], None), ('control #7', [[[[0, 0], [9, 0], [0, 6], [0, 0]]]], [3.0, 2.0]), ('regression #8', [[[[0, 0], [12, 0], [12, 6], [0, 6], [0, 0]], [[1, 1], [1, 3], [3, 3], [3, 1], [1, 1]], [[8, 2], [8, 5], [11, 5], [11, 2], [8, 2]]]], [5.737288, 2.991525]), ('regression #9', [[[[0, 0], [12, 0], [12, 6], [0, 6], [0, 0]], [[1, 1], [3, 1], [3, 3], [1, 3], [1, 1]]], [[[20, 0], [20, 2], [22, 2], [22, 0], [20, 0]]]], [7.055556, 2.944444]), ('boundary #10', [[[[0, 0], [4, 0], [4, 4], [0, 4], [0, 0]], [[0, 0], [0, 4], [4, 4], [4, 0], [0, 0]]]], None)], [('regression #2', [[[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]], [[6, 6], [9, 6], [9, 9], [6, 9], [6, 6]]]], [4.752747, 4.752747]), ('regression #4', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]]], [[[10, 0], [20, 0], [20, 10], [10, 10], [10, 0]]]], [14.461538, 4.846154]), ('boundary #6', [[[[0, 0], [5, 0], [10, 0], [0, 0]]]], None), ('regression #8', [[[[0, 0], [12, 0], [12, 6], [0, 6], [0, 0]], [[1, 1], [1, 3], [3, 3], [3, 1], [1, 1]], [[8, 2], [8, 5], [11, 5], [11, 2], [8, 2]]]], [5.737288, 2.991525]), ('regression #9', [[[[0, 0], [12, 0], [12, 6], [0, 6], [0, 0]], [[1, 1], [3, 1], [3, 3], [1, 3], [1, 1]]], [[[20, 0], [20, 2], [22, 2], [22, 0], [20, 0]]]], [7.055556, 2.944444]), ('boundary #10', [[[[0, 0], [4, 0], [4, 4], [0, 4], [0, 0]], [[0, 0], [0, 4], [4, 4], [4, 0], [0, 0]]]], None), ('control #11', [[[[1, 1], [7, 2], [6, 8], [2, 6], [1, 1]]]], [4.121212, 4.10303]), ('regression #12', [[[[-6, -6], [0, -6], [0, 0], [-6, 0], [-6, -6]]], [[[0, 0], [3, 0], [3, 3], [0, 3], [0, 0]]], [[[5, -2], [7, -2], [7, 0], [5, 0], [5, -2]]]], [-1.438776, -2.010204])], [('control #0', [[[[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]]], [5.0, 5.0]), ('regression #3', [[[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]]]], [5.0, 5.0]), ('regression #5', [[[[0, 0], [4, 0], [4, 4], [0, 4], [0, 0]]], [[[10, 10], [10, 12], [12, 12], [12, 10], [10, 10]]]], [3.8, 3.8]), ('boundary #6', [[[[0, 0], [5, 0], [10, 0], [0, 0]]]], None), ('boundary #10', [[[[0, 0], [4, 0], [4, 4], [0, 4], [0, 0]], [[0, 0], [0, 4], [4, 4], [4, 0], [0, 0]]]], None), ('control #11', [[[[1, 1], [7, 2], [6, 8], [2, 6], [1, 1]]]], [4.121212, 4.10303]), ('regression #12', [[[[-6, -6], [0, -6], [0, 0], [-6, 0], [-6, -6]]], [[[0, 0], [3, 0], [3, 3], [0, 3], [0, 0]]], [[[5, -2], [7, -2], [7, 0], [5, 0], [5, -2]]]], [-1.438776, -2.010204]), ('regression #13', [[[[0, 0], [8, 0], [8, 8], [0, 8], [0, 0]], [[4, 4], [4, 8], [8, 8], [8, 4], [4, 4]]], [[[0, 10], [2, 10], [2, 12], [0, 12], [0, 10]]]], [3.153846, 3.923077])], [('control #0', [[[[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]]], [5.0, 5.0]), ('regression #1', [[[[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]], [[0, 0], [0, 5], [5, 5], [5, 0], [0, 0]]]], [5.833333, 5.833333]), ('regression #2', [[[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]], [[6, 6], [9, 6], [9, 9], [6, 9], [6, 6]]]], [4.752747, 4.752747]), ('regression #3', [[[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]]]], [5.0, 5.0]), ('regression #4', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]]], [[[10, 0], [20, 0], [20, 10], [10, 10], [10, 0]]]], [14.461538, 4.846154]), ('boundary #6', [[[[0, 0], [5, 0], [10, 0], [0, 0]]]], None), ('regression #8', [[[[0, 0], [12, 0], [12, 6], [0, 6], [0, 0]], [[1, 1], [1, 3], [3, 3], [3, 1], [1, 1]], [[8, 2], [8, 5], [11, 5], [11, 2], [8, 2]]]], [5.737288, 2.991525]), ('boundary #10', [[[[0, 0], [4, 0], [4, 4], [0, 4], [0, 0]], [[0, 0], [0, 4], [4, 4], [4, 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 fixtureActualExpectedOutcome
control #0[6.666667, 5.0][5.0, 5.0]Failed
regression #1[8.333333, 5.833333][5.833333, 5.833333]Failed
regression #2[2.673993, 4.752747][4.752747, 4.752747]Failed
regression #3[3.333333, 5.0][5.0, 5.0]Failed
regression #4[16.076923, 4.846154][14.461538, 4.846154]Failed
regression #5[3.6, 3.8][3.8, 3.8]Failed
boundary #6NoneNonePassed
boundary #10NoneNonePassed

SHA-256 / 41a0a563ed7ee1d2a239e5e660a0ce3104b10bbbac6f895ac0bd2fcf3fc70ccc

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(x):
    polys = x
    A = Cx = Cy = 0.0
    for rings in polys:
        for k, r in enumerate(rings):
            a2 = mx = my = 0.0
            for p, q in zip(r, r[1:]):
                c = p[0] * q[1] - q[0] * p[1]
                a2 += c
                mx += (p[0] + q[0]) * abs(c)
                my += (p[1] + q[1]) * c
            sg = 1.0 if a2 >= 0 else -1.0
            w = 1.0 if k == 0 else -1.0
            A += w * sg * a2 / 2
            Cx += w * sg * mx / 6
            Cy += w * sg * my / 6
    if A == 0:
        return None
    return [round(Cx / A, 6), round(Cy / A, 6)]
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]]]], [5.0, 5.0]), ('regression #1', [[[[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]], [[0, 0], [0, 5], [5, 5], [5, 0], [0, 0]]]], [5.833333, 5.833333]), ('regression #2', [[[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]], [[6, 6], [9, 6], [9, 9], [6, 9], [6, 6]]]], [4.752747, 4.752747]), ('regression #3', [[[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]]]], [5.0, 5.0]), ('regression #4', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]]], [[[10, 0], [20, 0], [20, 10], [10, 10], [10, 0]]]], [14.461538, 4.846154]), ('regression #5', [[[[0, 0], [4, 0], [4, 4], [0, 4], [0, 0]]], [[[10, 10], [10, 12], [12, 12], [12, 10], [10, 10]]]], [3.8, 3.8]), ('boundary #6', [[[[0, 0], [5, 0], [10, 0], [0, 0]]]], None), ('boundary #10', [[[[0, 0], [4, 0], [4, 4], [0, 4], [0, 0]], [[0, 0], [0, 4], [4, 4], [4, 0], [0, 0]]]], None)], [('regression #1', [[[[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]], [[0, 0], [0, 5], [5, 5], [5, 0], [0, 0]]]], [5.833333, 5.833333]), ('regression #3', [[[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]]]], [5.0, 5.0]), ('regression #5', [[[[0, 0], [4, 0], [4, 4], [0, 4], [0, 0]]], [[[10, 10], [10, 12], [12, 12], [12, 10], [10, 10]]]], [3.8, 3.8]), ('boundary #6', [[[[0, 0], [5, 0], [10, 0], [0, 0]]]], None), ('control #7', [[[[0, 0], [9, 0], [0, 6], [0, 0]]]], [3.0, 2.0]), ('regression #8', [[[[0, 0], [12, 0], [12, 6], [0, 6], [0, 0]], [[1, 1], [1, 3], [3, 3], [3, 1], [1, 1]], [[8, 2], [8, 5], [11, 5], [11, 2], [8, 2]]]], [5.737288, 2.991525]), ('regression #9', [[[[0, 0], [12, 0], [12, 6], [0, 6], [0, 0]], [[1, 1], [3, 1], [3, 3], [1, 3], [1, 1]]], [[[20, 0], [20, 2], [22, 2], [22, 0], [20, 0]]]], [7.055556, 2.944444]), ('boundary #10', [[[[0, 0], [4, 0], [4, 4], [0, 4], [0, 0]], [[0, 0], [0, 4], [4, 4], [4, 0], [0, 0]]]], None)], [('regression #2', [[[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]], [[6, 6], [9, 6], [9, 9], [6, 9], [6, 6]]]], [4.752747, 4.752747]), ('regression #4', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]]], [[[10, 0], [20, 0], [20, 10], [10, 10], [10, 0]]]], [14.461538, 4.846154]), ('boundary #6', [[[[0, 0], [5, 0], [10, 0], [0, 0]]]], None), ('regression #8', [[[[0, 0], [12, 0], [12, 6], [0, 6], [0, 0]], [[1, 1], [1, 3], [3, 3], [3, 1], [1, 1]], [[8, 2], [8, 5], [11, 5], [11, 2], [8, 2]]]], [5.737288, 2.991525]), ('regression #9', [[[[0, 0], [12, 0], [12, 6], [0, 6], [0, 0]], [[1, 1], [3, 1], [3, 3], [1, 3], [1, 1]]], [[[20, 0], [20, 2], [22, 2], [22, 0], [20, 0]]]], [7.055556, 2.944444]), ('boundary #10', [[[[0, 0], [4, 0], [4, 4], [0, 4], [0, 0]], [[0, 0], [0, 4], [4, 4], [4, 0], [0, 0]]]], None), ('control #11', [[[[1, 1], [7, 2], [6, 8], [2, 6], [1, 1]]]], [4.121212, 4.10303]), ('regression #12', [[[[-6, -6], [0, -6], [0, 0], [-6, 0], [-6, -6]]], [[[0, 0], [3, 0], [3, 3], [0, 3], [0, 0]]], [[[5, -2], [7, -2], [7, 0], [5, 0], [5, -2]]]], [-1.438776, -2.010204])], [('control #0', [[[[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]]], [5.0, 5.0]), ('regression #3', [[[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]]]], [5.0, 5.0]), ('regression #5', [[[[0, 0], [4, 0], [4, 4], [0, 4], [0, 0]]], [[[10, 10], [10, 12], [12, 12], [12, 10], [10, 10]]]], [3.8, 3.8]), ('boundary #6', [[[[0, 0], [5, 0], [10, 0], [0, 0]]]], None), ('boundary #10', [[[[0, 0], [4, 0], [4, 4], [0, 4], [0, 0]], [[0, 0], [0, 4], [4, 4], [4, 0], [0, 0]]]], None), ('control #11', [[[[1, 1], [7, 2], [6, 8], [2, 6], [1, 1]]]], [4.121212, 4.10303]), ('regression #12', [[[[-6, -6], [0, -6], [0, 0], [-6, 0], [-6, -6]]], [[[0, 0], [3, 0], [3, 3], [0, 3], [0, 0]]], [[[5, -2], [7, -2], [7, 0], [5, 0], [5, -2]]]], [-1.438776, -2.010204]), ('regression #13', [[[[0, 0], [8, 0], [8, 8], [0, 8], [0, 0]], [[4, 4], [4, 8], [8, 8], [8, 4], [4, 4]]], [[[0, 10], [2, 10], [2, 12], [0, 12], [0, 10]]]], [3.153846, 3.923077])], [('control #0', [[[[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]]], [5.0, 5.0]), ('regression #1', [[[[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]], [[0, 0], [0, 5], [5, 5], [5, 0], [0, 0]]]], [5.833333, 5.833333]), ('regression #2', [[[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]], [[6, 6], [9, 6], [9, 9], [6, 9], [6, 6]]]], [4.752747, 4.752747]), ('regression #3', [[[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]]]], [5.0, 5.0]), ('regression #4', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]]], [[[10, 0], [20, 0], [20, 10], [10, 10], [10, 0]]]], [14.461538, 4.846154]), ('boundary #6', [[[[0, 0], [5, 0], [10, 0], [0, 0]]]], None), ('regression #8', [[[[0, 0], [12, 0], [12, 6], [0, 6], [0, 0]], [[1, 1], [1, 3], [3, 3], [3, 1], [1, 1]], [[8, 2], [8, 5], [11, 5], [11, 2], [8, 2]]]], [5.737288, 2.991525]), ('boundary #10', [[[[0, 0], [4, 0], [4, 4], [0, 4], [0, 0]], [[0, 0], [0, 4], [4, 4], [4, 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 fixtureActualExpectedOutcome
control #0[5.0, 5.0][5.0, 5.0]Passed
regression #1[7.5, 5.833333][5.833333, 5.833333]Failed
regression #2[-8.016484, 4.752747][4.752747, 4.752747]Failed
regression #3[-5.0, 5.0][5.0, 5.0]Failed
regression #4[20.871795, 4.846154][14.461538, 4.846154]Failed
regression #5[-14.6, 3.8][3.8, 3.8]Failed
boundary #6NoneNonePassed
boundary #10NoneNonePassed

SHA-256 / 0705b2de6b9ecbd995d0d2cabcfac180d81d626522254c0fa065eec00496efcf

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(x):
    polys = x
    A = Cx = Cy = 0.0
    for rings in polys:
        for k, r in enumerate(rings):
            a2 = mx = my = 0.0
            for p, q in zip(r, r[1:]):
                c = p[0] * q[1] - q[0] * p[1]
                a2 += c
                mx += (p[0] + q[0]) * c
                my += (p[1] + q[1]) * c
            sg = 1.0 if a2 >= 0 else -1.0
            w = 1.0 if k == 0 else -1.0
            A += w * sg * a2 / 2
            Cx += w * sg * mx / 6
            Cy += w * sg * my / 6
    if A == 0:
        return None
    return [round(Cx / A, 6), round(Cy / A, 6)]
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]]]], [5.0, 5.0]), ('regression #1', [[[[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]], [[0, 0], [0, 5], [5, 5], [5, 0], [0, 0]]]], [5.833333, 5.833333]), ('regression #2', [[[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]], [[6, 6], [9, 6], [9, 9], [6, 9], [6, 6]]]], [4.752747, 4.752747]), ('regression #3', [[[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]]]], [5.0, 5.0]), ('regression #4', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]]], [[[10, 0], [20, 0], [20, 10], [10, 10], [10, 0]]]], [14.461538, 4.846154]), ('regression #5', [[[[0, 0], [4, 0], [4, 4], [0, 4], [0, 0]]], [[[10, 10], [10, 12], [12, 12], [12, 10], [10, 10]]]], [3.8, 3.8]), ('boundary #6', [[[[0, 0], [5, 0], [10, 0], [0, 0]]]], None), ('boundary #10', [[[[0, 0], [4, 0], [4, 4], [0, 4], [0, 0]], [[0, 0], [0, 4], [4, 4], [4, 0], [0, 0]]]], None)], [('regression #1', [[[[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]], [[0, 0], [0, 5], [5, 5], [5, 0], [0, 0]]]], [5.833333, 5.833333]), ('regression #3', [[[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]]]], [5.0, 5.0]), ('regression #5', [[[[0, 0], [4, 0], [4, 4], [0, 4], [0, 0]]], [[[10, 10], [10, 12], [12, 12], [12, 10], [10, 10]]]], [3.8, 3.8]), ('boundary #6', [[[[0, 0], [5, 0], [10, 0], [0, 0]]]], None), ('control #7', [[[[0, 0], [9, 0], [0, 6], [0, 0]]]], [3.0, 2.0]), ('regression #8', [[[[0, 0], [12, 0], [12, 6], [0, 6], [0, 0]], [[1, 1], [1, 3], [3, 3], [3, 1], [1, 1]], [[8, 2], [8, 5], [11, 5], [11, 2], [8, 2]]]], [5.737288, 2.991525]), ('regression #9', [[[[0, 0], [12, 0], [12, 6], [0, 6], [0, 0]], [[1, 1], [3, 1], [3, 3], [1, 3], [1, 1]]], [[[20, 0], [20, 2], [22, 2], [22, 0], [20, 0]]]], [7.055556, 2.944444]), ('boundary #10', [[[[0, 0], [4, 0], [4, 4], [0, 4], [0, 0]], [[0, 0], [0, 4], [4, 4], [4, 0], [0, 0]]]], None)], [('regression #2', [[[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]], [[6, 6], [9, 6], [9, 9], [6, 9], [6, 6]]]], [4.752747, 4.752747]), ('regression #4', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]]], [[[10, 0], [20, 0], [20, 10], [10, 10], [10, 0]]]], [14.461538, 4.846154]), ('boundary #6', [[[[0, 0], [5, 0], [10, 0], [0, 0]]]], None), ('regression #8', [[[[0, 0], [12, 0], [12, 6], [0, 6], [0, 0]], [[1, 1], [1, 3], [3, 3], [3, 1], [1, 1]], [[8, 2], [8, 5], [11, 5], [11, 2], [8, 2]]]], [5.737288, 2.991525]), ('regression #9', [[[[0, 0], [12, 0], [12, 6], [0, 6], [0, 0]], [[1, 1], [3, 1], [3, 3], [1, 3], [1, 1]]], [[[20, 0], [20, 2], [22, 2], [22, 0], [20, 0]]]], [7.055556, 2.944444]), ('boundary #10', [[[[0, 0], [4, 0], [4, 4], [0, 4], [0, 0]], [[0, 0], [0, 4], [4, 4], [4, 0], [0, 0]]]], None), ('control #11', [[[[1, 1], [7, 2], [6, 8], [2, 6], [1, 1]]]], [4.121212, 4.10303]), ('regression #12', [[[[-6, -6], [0, -6], [0, 0], [-6, 0], [-6, -6]]], [[[0, 0], [3, 0], [3, 3], [0, 3], [0, 0]]], [[[5, -2], [7, -2], [7, 0], [5, 0], [5, -2]]]], [-1.438776, -2.010204])], [('control #0', [[[[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]]], [5.0, 5.0]), ('regression #3', [[[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]]]], [5.0, 5.0]), ('regression #5', [[[[0, 0], [4, 0], [4, 4], [0, 4], [0, 0]]], [[[10, 10], [10, 12], [12, 12], [12, 10], [10, 10]]]], [3.8, 3.8]), ('boundary #6', [[[[0, 0], [5, 0], [10, 0], [0, 0]]]], None), ('boundary #10', [[[[0, 0], [4, 0], [4, 4], [0, 4], [0, 0]], [[0, 0], [0, 4], [4, 4], [4, 0], [0, 0]]]], None), ('control #11', [[[[1, 1], [7, 2], [6, 8], [2, 6], [1, 1]]]], [4.121212, 4.10303]), ('regression #12', [[[[-6, -6], [0, -6], [0, 0], [-6, 0], [-6, -6]]], [[[0, 0], [3, 0], [3, 3], [0, 3], [0, 0]]], [[[5, -2], [7, -2], [7, 0], [5, 0], [5, -2]]]], [-1.438776, -2.010204]), ('regression #13', [[[[0, 0], [8, 0], [8, 8], [0, 8], [0, 0]], [[4, 4], [4, 8], [8, 8], [8, 4], [4, 4]]], [[[0, 10], [2, 10], [2, 12], [0, 12], [0, 10]]]], [3.153846, 3.923077])], [('control #0', [[[[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]]]], [5.0, 5.0]), ('regression #1', [[[[0, 0], [10, 0], [10, 10], [0, 10], [0, 0]], [[0, 0], [0, 5], [5, 5], [5, 0], [0, 0]]]], [5.833333, 5.833333]), ('regression #2', [[[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]], [[6, 6], [9, 6], [9, 9], [6, 9], [6, 6]]]], [4.752747, 4.752747]), ('regression #3', [[[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]]]], [5.0, 5.0]), ('regression #4', [[[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]]], [[[10, 0], [20, 0], [20, 10], [10, 10], [10, 0]]]], [14.461538, 4.846154]), ('boundary #6', [[[[0, 0], [5, 0], [10, 0], [0, 0]]]], None), ('regression #8', [[[[0, 0], [12, 0], [12, 6], [0, 6], [0, 0]], [[1, 1], [1, 3], [3, 3], [3, 1], [1, 1]], [[8, 2], [8, 5], [11, 5], [11, 2], [8, 2]]]], [5.737288, 2.991525]), ('boundary #10', [[[[0, 0], [4, 0], [4, 4], [0, 4], [0, 0]], [[0, 0], [0, 4], [4, 4], [4, 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 fixtureActualExpectedOutcome
control #0[5.0, 5.0][5.0, 5.0]Passed
regression #1[5.833333, 5.833333][5.833333, 5.833333]Passed
regression #2[4.752747, 4.752747][4.752747, 4.752747]Passed
regression #3[5.0, 5.0][5.0, 5.0]Passed
regression #4[14.461538, 4.846154][14.461538, 4.846154]Passed
regression #5[3.8, 3.8][3.8, 3.8]Passed
boundary #6NoneNonePassed
boundary #10NoneNonePassed

SHA-256 / e975be97afc7707895d1ddff9e87a39a4474c8ee993b9e115d9bf17c89ac22c2

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

Case digest / 073c9c757a3e33776e9ddfd5ec53c18cac971656d0fb79cc8dec4659a3a24554