FAILURE MAP
← Case archive

FA-70736 / GIS polygon topology / Open access

Bounded face count of an arc-node topology: euler relation · case 01

Topologies with several disconnected islands report too few faces.

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

ROOT CAUSE

The face count assumes a single connected component.

VERIFIED REPAIR

At the euler relation step restore `return [V, E, C, E - V + C]`, leaving the rest of the model unchanged.

Unsuccessful approach: Adding 2 counts the unbounded outer face as well.

Case contract

Input [nodes, arcs] for a planar, fully noded arc-node graph. arcs are [arc_id, from, to]; the same arc_id may be listed more than once (once per adjacent polygon) and counts once, while distinct ids between the same nodes are distinct parallel arcs. A loop arc (from == to) is an arc. Nodes listed in nodes but used by no arc are isolated nodes. Return [V, E, C, F] with V nodes, E distinct arcs, C connected components and F = E - V + C bounded faces.

Why this case matters

Topology builders check face counts against Euler characteristic to detect missing or doubled arcs after edits.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(x):
    nodes, arcs = x
    uniq = {}
    for aid, u, v in arcs:
        uniq[aid] = (u, v)
    parent = {n: n for n in nodes}
    for u, v in uniq.values():
        parent.setdefault(u, u)
        parent.setdefault(v, v)
    def find(a):
        while parent[a] != a:
            a = parent[a]
        return a
    for u, v in uniq.values():
        ru, rv = find(u), find(v)
        if ru != rv:
            parent[ru] = rv
    V = len(parent)
    E = len(uniq)
    C = len({find(n) for n in parent})
    return [V, E, C, E - V + 1]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('control #0', [[1, 2, 3, 4], [[10, 1, 2], [11, 2, 3], [12, 3, 4], [13, 4, 1]]], [4, 4, 1, 1]), ('control #1', [[1, 2, 3, 4], [[10, 1, 2], [11, 2, 3], [12, 3, 4], [13, 4, 1], [14, 1, 3]]], [4, 5, 1, 2]), ('regression #2', [[1, 2, 3, 4], [[10, 1, 2], [11, 2, 3], [12, 3, 4], [13, 4, 1], [10, 1, 2], [12, 3, 4]]], [4, 4, 1, 1]), ('regression #3', [[1, 2], [[20, 1, 2], [21, 1, 2]]], [2, 2, 1, 1]), ('regression #4', [[1, 2], [[20, 1, 2], [21, 2, 1], [22, 1, 2]]], [2, 3, 1, 2]), ('regression #5', [[1, 2, 3, 9], [[10, 1, 2], [11, 2, 3], [12, 3, 1]]], [4, 3, 2, 1]), ('regression #6', [[1, 2, 3, 8, 9], [[10, 1, 2], [11, 2, 3], [12, 3, 1]]], [5, 3, 3, 1]), ('regression #7', [[5], [[30, 5, 5]]], [1, 1, 1, 1])], [('control #1', [[1, 2, 3, 4], [[10, 1, 2], [11, 2, 3], [12, 3, 4], [13, 4, 1], [14, 1, 3]]], [4, 5, 1, 2]), ('regression #4', [[1, 2], [[20, 1, 2], [21, 2, 1], [22, 1, 2]]], [2, 3, 1, 2]), ('regression #5', [[1, 2, 3, 9], [[10, 1, 2], [11, 2, 3], [12, 3, 1]]], [4, 3, 2, 1]), ('regression #6', [[1, 2, 3, 8, 9], [[10, 1, 2], [11, 2, 3], [12, 3, 1]]], [5, 3, 3, 1]), ('regression #7', [[5], [[30, 5, 5]]], [1, 1, 1, 1]), ('regression #8', [[5, 6], [[30, 5, 5], [31, 5, 6], [32, 6, 6]]], [2, 3, 1, 2]), ('regression #9', [[1, 2, 3, 4, 5, 6], [[1, 1, 2], [2, 2, 3], [3, 3, 1], [4, 4, 5], [5, 5, 6], [6, 6, 4]]], [6, 6, 2, 2]), ('regression #10', [[1, 2, 3, 4, 5, 6], [[1, 1, 2], [2, 2, 3], [3, 3, 1], [4, 4, 5], [5, 5, 6], [6, 6, 4], [7, 3, 4]]], [6, 7, 1, 2])], [('regression #2', [[1, 2, 3, 4], [[10, 1, 2], [11, 2, 3], [12, 3, 4], [13, 4, 1], [10, 1, 2], [12, 3, 4]]], [4, 4, 1, 1]), ('regression #7', [[5], [[30, 5, 5]]], [1, 1, 1, 1]), ('regression #8', [[5, 6], [[30, 5, 5], [31, 5, 6], [32, 6, 6]]], [2, 3, 1, 2]), ('regression #9', [[1, 2, 3, 4, 5, 6], [[1, 1, 2], [2, 2, 3], [3, 3, 1], [4, 4, 5], [5, 5, 6], [6, 6, 4]]], [6, 6, 2, 2]), ('regression #10', [[1, 2, 3, 4, 5, 6], [[1, 1, 2], [2, 2, 3], [3, 3, 1], [4, 4, 5], [5, 5, 6], [6, 6, 4], [7, 3, 4]]], [6, 7, 1, 2]), ('boundary #11', [[1], []], [1, 0, 1, 0]), ('boundary #12', [[], []], [0, 0, 0, 0]), ('control #13', [[1, 2, 3], [[1, 1, 2], [2, 2, 3]]], [3, 2, 1, 0])], [('control #0', [[1, 2, 3, 4], [[10, 1, 2], [11, 2, 3], [12, 3, 4], [13, 4, 1]]], [4, 4, 1, 1]), ('regression #3', [[1, 2], [[20, 1, 2], [21, 1, 2]]], [2, 2, 1, 1]), ('regression #10', [[1, 2, 3, 4, 5, 6], [[1, 1, 2], [2, 2, 3], [3, 3, 1], [4, 4, 5], [5, 5, 6], [6, 6, 4], [7, 3, 4]]], [6, 7, 1, 2]), ('boundary #11', [[1], []], [1, 0, 1, 0]), ('boundary #12', [[], []], [0, 0, 0, 0]), ('control #13', [[1, 2, 3], [[1, 1, 2], [2, 2, 3]]], [3, 2, 1, 0]), ('regression #14', [[1, 2, 3, 4], [[1, 1, 2], [2, 3, 4], [3, 2, 1], [4, 4, 3]]], [4, 4, 2, 2]), ('control #15', [[1, 2, 3, 4, 5], [[1, 1, 2], [2, 2, 3], [3, 3, 4], [4, 4, 5], [5, 5, 1], [6, 1, 3], [7, 3, 5]]], [5, 7, 1, 3])], [('control #0', [[1, 2, 3, 4], [[10, 1, 2], [11, 2, 3], [12, 3, 4], [13, 4, 1]]], [4, 4, 1, 1]), ('control #1', [[1, 2, 3, 4], [[10, 1, 2], [11, 2, 3], [12, 3, 4], [13, 4, 1], [14, 1, 3]]], [4, 5, 1, 2]), ('regression #2', [[1, 2, 3, 4], [[10, 1, 2], [11, 2, 3], [12, 3, 4], [13, 4, 1], [10, 1, 2], [12, 3, 4]]], [4, 4, 1, 1]), ('regression #3', [[1, 2], [[20, 1, 2], [21, 1, 2]]], [2, 2, 1, 1]), ('regression #4', [[1, 2], [[20, 1, 2], [21, 2, 1], [22, 1, 2]]], [2, 3, 1, 2]), ('control #13', [[1, 2, 3], [[1, 1, 2], [2, 2, 3]]], [3, 2, 1, 0]), ('regression #14', [[1, 2, 3, 4], [[1, 1, 2], [2, 3, 4], [3, 2, 1], [4, 4, 3]]], [4, 4, 2, 2]), ('control #15', [[1, 2, 3, 4, 5], [[1, 1, 2], [2, 2, 3], [3, 3, 4], [4, 4, 5], [5, 5, 1], [6, 1, 3], [7, 3, 5]]], [5, 7, 1, 3])]]
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[4, 4, 1, 1][4, 4, 1, 1]Passed
control #1[4, 5, 1, 2][4, 5, 1, 2]Passed
regression #2[4, 4, 1, 1][4, 4, 1, 1]Passed
regression #3[2, 2, 1, 1][2, 2, 1, 1]Passed
regression #4[2, 3, 1, 2][2, 3, 1, 2]Passed
regression #5[4, 3, 2, 0][4, 3, 2, 1]Failed
regression #6[5, 3, 3, -1][5, 3, 3, 1]Failed
regression #7[1, 1, 1, 1][1, 1, 1, 1]Passed

SHA-256 / 012ef3393536e321a1c74a7cf00492dce75b581c53a8a8163085ab138508c10b

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(x):
    nodes, arcs = x
    uniq = {}
    for aid, u, v in arcs:
        uniq[aid] = (u, v)
    parent = {n: n for n in nodes}
    for u, v in uniq.values():
        parent.setdefault(u, u)
        parent.setdefault(v, v)
    def find(a):
        while parent[a] != a:
            a = parent[a]
        return a
    for u, v in uniq.values():
        ru, rv = find(u), find(v)
        if ru != rv:
            parent[ru] = rv
    V = len(parent)
    E = len(uniq)
    C = len({find(n) for n in parent})
    return [V, E, C, E - V + 2]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('control #0', [[1, 2, 3, 4], [[10, 1, 2], [11, 2, 3], [12, 3, 4], [13, 4, 1]]], [4, 4, 1, 1]), ('control #1', [[1, 2, 3, 4], [[10, 1, 2], [11, 2, 3], [12, 3, 4], [13, 4, 1], [14, 1, 3]]], [4, 5, 1, 2]), ('regression #2', [[1, 2, 3, 4], [[10, 1, 2], [11, 2, 3], [12, 3, 4], [13, 4, 1], [10, 1, 2], [12, 3, 4]]], [4, 4, 1, 1]), ('regression #3', [[1, 2], [[20, 1, 2], [21, 1, 2]]], [2, 2, 1, 1]), ('regression #4', [[1, 2], [[20, 1, 2], [21, 2, 1], [22, 1, 2]]], [2, 3, 1, 2]), ('regression #5', [[1, 2, 3, 9], [[10, 1, 2], [11, 2, 3], [12, 3, 1]]], [4, 3, 2, 1]), ('regression #6', [[1, 2, 3, 8, 9], [[10, 1, 2], [11, 2, 3], [12, 3, 1]]], [5, 3, 3, 1]), ('regression #7', [[5], [[30, 5, 5]]], [1, 1, 1, 1])], [('control #1', [[1, 2, 3, 4], [[10, 1, 2], [11, 2, 3], [12, 3, 4], [13, 4, 1], [14, 1, 3]]], [4, 5, 1, 2]), ('regression #4', [[1, 2], [[20, 1, 2], [21, 2, 1], [22, 1, 2]]], [2, 3, 1, 2]), ('regression #5', [[1, 2, 3, 9], [[10, 1, 2], [11, 2, 3], [12, 3, 1]]], [4, 3, 2, 1]), ('regression #6', [[1, 2, 3, 8, 9], [[10, 1, 2], [11, 2, 3], [12, 3, 1]]], [5, 3, 3, 1]), ('regression #7', [[5], [[30, 5, 5]]], [1, 1, 1, 1]), ('regression #8', [[5, 6], [[30, 5, 5], [31, 5, 6], [32, 6, 6]]], [2, 3, 1, 2]), ('regression #9', [[1, 2, 3, 4, 5, 6], [[1, 1, 2], [2, 2, 3], [3, 3, 1], [4, 4, 5], [5, 5, 6], [6, 6, 4]]], [6, 6, 2, 2]), ('regression #10', [[1, 2, 3, 4, 5, 6], [[1, 1, 2], [2, 2, 3], [3, 3, 1], [4, 4, 5], [5, 5, 6], [6, 6, 4], [7, 3, 4]]], [6, 7, 1, 2])], [('regression #2', [[1, 2, 3, 4], [[10, 1, 2], [11, 2, 3], [12, 3, 4], [13, 4, 1], [10, 1, 2], [12, 3, 4]]], [4, 4, 1, 1]), ('regression #7', [[5], [[30, 5, 5]]], [1, 1, 1, 1]), ('regression #8', [[5, 6], [[30, 5, 5], [31, 5, 6], [32, 6, 6]]], [2, 3, 1, 2]), ('regression #9', [[1, 2, 3, 4, 5, 6], [[1, 1, 2], [2, 2, 3], [3, 3, 1], [4, 4, 5], [5, 5, 6], [6, 6, 4]]], [6, 6, 2, 2]), ('regression #10', [[1, 2, 3, 4, 5, 6], [[1, 1, 2], [2, 2, 3], [3, 3, 1], [4, 4, 5], [5, 5, 6], [6, 6, 4], [7, 3, 4]]], [6, 7, 1, 2]), ('boundary #11', [[1], []], [1, 0, 1, 0]), ('boundary #12', [[], []], [0, 0, 0, 0]), ('control #13', [[1, 2, 3], [[1, 1, 2], [2, 2, 3]]], [3, 2, 1, 0])], [('control #0', [[1, 2, 3, 4], [[10, 1, 2], [11, 2, 3], [12, 3, 4], [13, 4, 1]]], [4, 4, 1, 1]), ('regression #3', [[1, 2], [[20, 1, 2], [21, 1, 2]]], [2, 2, 1, 1]), ('regression #10', [[1, 2, 3, 4, 5, 6], [[1, 1, 2], [2, 2, 3], [3, 3, 1], [4, 4, 5], [5, 5, 6], [6, 6, 4], [7, 3, 4]]], [6, 7, 1, 2]), ('boundary #11', [[1], []], [1, 0, 1, 0]), ('boundary #12', [[], []], [0, 0, 0, 0]), ('control #13', [[1, 2, 3], [[1, 1, 2], [2, 2, 3]]], [3, 2, 1, 0]), ('regression #14', [[1, 2, 3, 4], [[1, 1, 2], [2, 3, 4], [3, 2, 1], [4, 4, 3]]], [4, 4, 2, 2]), ('control #15', [[1, 2, 3, 4, 5], [[1, 1, 2], [2, 2, 3], [3, 3, 4], [4, 4, 5], [5, 5, 1], [6, 1, 3], [7, 3, 5]]], [5, 7, 1, 3])], [('control #0', [[1, 2, 3, 4], [[10, 1, 2], [11, 2, 3], [12, 3, 4], [13, 4, 1]]], [4, 4, 1, 1]), ('control #1', [[1, 2, 3, 4], [[10, 1, 2], [11, 2, 3], [12, 3, 4], [13, 4, 1], [14, 1, 3]]], [4, 5, 1, 2]), ('regression #2', [[1, 2, 3, 4], [[10, 1, 2], [11, 2, 3], [12, 3, 4], [13, 4, 1], [10, 1, 2], [12, 3, 4]]], [4, 4, 1, 1]), ('regression #3', [[1, 2], [[20, 1, 2], [21, 1, 2]]], [2, 2, 1, 1]), ('regression #4', [[1, 2], [[20, 1, 2], [21, 2, 1], [22, 1, 2]]], [2, 3, 1, 2]), ('control #13', [[1, 2, 3], [[1, 1, 2], [2, 2, 3]]], [3, 2, 1, 0]), ('regression #14', [[1, 2, 3, 4], [[1, 1, 2], [2, 3, 4], [3, 2, 1], [4, 4, 3]]], [4, 4, 2, 2]), ('control #15', [[1, 2, 3, 4, 5], [[1, 1, 2], [2, 2, 3], [3, 3, 4], [4, 4, 5], [5, 5, 1], [6, 1, 3], [7, 3, 5]]], [5, 7, 1, 3])]]
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[4, 4, 1, 2][4, 4, 1, 1]Failed
control #1[4, 5, 1, 3][4, 5, 1, 2]Failed
regression #2[4, 4, 1, 2][4, 4, 1, 1]Failed
regression #3[2, 2, 1, 2][2, 2, 1, 1]Failed
regression #4[2, 3, 1, 3][2, 3, 1, 2]Failed
regression #5[4, 3, 2, 1][4, 3, 2, 1]Passed
regression #6[5, 3, 3, 0][5, 3, 3, 1]Failed
regression #7[1, 1, 1, 2][1, 1, 1, 1]Failed

SHA-256 / 9af97e674ee6bd69e5fa4f73d53264ff0285bd409ac5fe2f104e2f2871b4db10

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(x):
    nodes, arcs = x
    uniq = {}
    for aid, u, v in arcs:
        uniq[aid] = (u, v)
    parent = {n: n for n in nodes}
    for u, v in uniq.values():
        parent.setdefault(u, u)
        parent.setdefault(v, v)
    def find(a):
        while parent[a] != a:
            a = parent[a]
        return a
    for u, v in uniq.values():
        ru, rv = find(u), find(v)
        if ru != rv:
            parent[ru] = rv
    V = len(parent)
    E = len(uniq)
    C = len({find(n) for n in parent})
    return [V, E, C, E - V + C]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('control #0', [[1, 2, 3, 4], [[10, 1, 2], [11, 2, 3], [12, 3, 4], [13, 4, 1]]], [4, 4, 1, 1]), ('control #1', [[1, 2, 3, 4], [[10, 1, 2], [11, 2, 3], [12, 3, 4], [13, 4, 1], [14, 1, 3]]], [4, 5, 1, 2]), ('regression #2', [[1, 2, 3, 4], [[10, 1, 2], [11, 2, 3], [12, 3, 4], [13, 4, 1], [10, 1, 2], [12, 3, 4]]], [4, 4, 1, 1]), ('regression #3', [[1, 2], [[20, 1, 2], [21, 1, 2]]], [2, 2, 1, 1]), ('regression #4', [[1, 2], [[20, 1, 2], [21, 2, 1], [22, 1, 2]]], [2, 3, 1, 2]), ('regression #5', [[1, 2, 3, 9], [[10, 1, 2], [11, 2, 3], [12, 3, 1]]], [4, 3, 2, 1]), ('regression #6', [[1, 2, 3, 8, 9], [[10, 1, 2], [11, 2, 3], [12, 3, 1]]], [5, 3, 3, 1]), ('regression #7', [[5], [[30, 5, 5]]], [1, 1, 1, 1])], [('control #1', [[1, 2, 3, 4], [[10, 1, 2], [11, 2, 3], [12, 3, 4], [13, 4, 1], [14, 1, 3]]], [4, 5, 1, 2]), ('regression #4', [[1, 2], [[20, 1, 2], [21, 2, 1], [22, 1, 2]]], [2, 3, 1, 2]), ('regression #5', [[1, 2, 3, 9], [[10, 1, 2], [11, 2, 3], [12, 3, 1]]], [4, 3, 2, 1]), ('regression #6', [[1, 2, 3, 8, 9], [[10, 1, 2], [11, 2, 3], [12, 3, 1]]], [5, 3, 3, 1]), ('regression #7', [[5], [[30, 5, 5]]], [1, 1, 1, 1]), ('regression #8', [[5, 6], [[30, 5, 5], [31, 5, 6], [32, 6, 6]]], [2, 3, 1, 2]), ('regression #9', [[1, 2, 3, 4, 5, 6], [[1, 1, 2], [2, 2, 3], [3, 3, 1], [4, 4, 5], [5, 5, 6], [6, 6, 4]]], [6, 6, 2, 2]), ('regression #10', [[1, 2, 3, 4, 5, 6], [[1, 1, 2], [2, 2, 3], [3, 3, 1], [4, 4, 5], [5, 5, 6], [6, 6, 4], [7, 3, 4]]], [6, 7, 1, 2])], [('regression #2', [[1, 2, 3, 4], [[10, 1, 2], [11, 2, 3], [12, 3, 4], [13, 4, 1], [10, 1, 2], [12, 3, 4]]], [4, 4, 1, 1]), ('regression #7', [[5], [[30, 5, 5]]], [1, 1, 1, 1]), ('regression #8', [[5, 6], [[30, 5, 5], [31, 5, 6], [32, 6, 6]]], [2, 3, 1, 2]), ('regression #9', [[1, 2, 3, 4, 5, 6], [[1, 1, 2], [2, 2, 3], [3, 3, 1], [4, 4, 5], [5, 5, 6], [6, 6, 4]]], [6, 6, 2, 2]), ('regression #10', [[1, 2, 3, 4, 5, 6], [[1, 1, 2], [2, 2, 3], [3, 3, 1], [4, 4, 5], [5, 5, 6], [6, 6, 4], [7, 3, 4]]], [6, 7, 1, 2]), ('boundary #11', [[1], []], [1, 0, 1, 0]), ('boundary #12', [[], []], [0, 0, 0, 0]), ('control #13', [[1, 2, 3], [[1, 1, 2], [2, 2, 3]]], [3, 2, 1, 0])], [('control #0', [[1, 2, 3, 4], [[10, 1, 2], [11, 2, 3], [12, 3, 4], [13, 4, 1]]], [4, 4, 1, 1]), ('regression #3', [[1, 2], [[20, 1, 2], [21, 1, 2]]], [2, 2, 1, 1]), ('regression #10', [[1, 2, 3, 4, 5, 6], [[1, 1, 2], [2, 2, 3], [3, 3, 1], [4, 4, 5], [5, 5, 6], [6, 6, 4], [7, 3, 4]]], [6, 7, 1, 2]), ('boundary #11', [[1], []], [1, 0, 1, 0]), ('boundary #12', [[], []], [0, 0, 0, 0]), ('control #13', [[1, 2, 3], [[1, 1, 2], [2, 2, 3]]], [3, 2, 1, 0]), ('regression #14', [[1, 2, 3, 4], [[1, 1, 2], [2, 3, 4], [3, 2, 1], [4, 4, 3]]], [4, 4, 2, 2]), ('control #15', [[1, 2, 3, 4, 5], [[1, 1, 2], [2, 2, 3], [3, 3, 4], [4, 4, 5], [5, 5, 1], [6, 1, 3], [7, 3, 5]]], [5, 7, 1, 3])], [('control #0', [[1, 2, 3, 4], [[10, 1, 2], [11, 2, 3], [12, 3, 4], [13, 4, 1]]], [4, 4, 1, 1]), ('control #1', [[1, 2, 3, 4], [[10, 1, 2], [11, 2, 3], [12, 3, 4], [13, 4, 1], [14, 1, 3]]], [4, 5, 1, 2]), ('regression #2', [[1, 2, 3, 4], [[10, 1, 2], [11, 2, 3], [12, 3, 4], [13, 4, 1], [10, 1, 2], [12, 3, 4]]], [4, 4, 1, 1]), ('regression #3', [[1, 2], [[20, 1, 2], [21, 1, 2]]], [2, 2, 1, 1]), ('regression #4', [[1, 2], [[20, 1, 2], [21, 2, 1], [22, 1, 2]]], [2, 3, 1, 2]), ('control #13', [[1, 2, 3], [[1, 1, 2], [2, 2, 3]]], [3, 2, 1, 0]), ('regression #14', [[1, 2, 3, 4], [[1, 1, 2], [2, 3, 4], [3, 2, 1], [4, 4, 3]]], [4, 4, 2, 2]), ('control #15', [[1, 2, 3, 4, 5], [[1, 1, 2], [2, 2, 3], [3, 3, 4], [4, 4, 5], [5, 5, 1], [6, 1, 3], [7, 3, 5]]], [5, 7, 1, 3])]]
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[4, 4, 1, 1][4, 4, 1, 1]Passed
control #1[4, 5, 1, 2][4, 5, 1, 2]Passed
regression #2[4, 4, 1, 1][4, 4, 1, 1]Passed
regression #3[2, 2, 1, 1][2, 2, 1, 1]Passed
regression #4[2, 3, 1, 2][2, 3, 1, 2]Passed
regression #5[4, 3, 2, 1][4, 3, 2, 1]Passed
regression #6[5, 3, 3, 1][5, 3, 3, 1]Passed
regression #7[1, 1, 1, 1][1, 1, 1, 1]Passed

SHA-256 / 989b4b376ebbe7d09fbe5fd765c8e92a9a4078faee735e60b78ee6d1954017df

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

Case digest / 3b1c4682d1c222dd2ceb031ceb4faaa4b513f6ea7204016ad6a8cf8e882a9f97