FAILURE MAP
← Case archive

FA-88631 / Mesh topology invariants / Open access

Triangulated edge set is keyed by direction · case 01

Edge growth counts each shared triangle edge twice.

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

ROOT CAUSE

The post-triangulation edge set stores directed pairs while the original set is undirected.

VERIFIED REPAIR

Key both edge sets by undirected pairs.

Unsuccessful approach: Making both sets directed still counts interior edges twice.

Case contract

Input: polygon faces. A face with fewer than 3 corners returns ["bad-face", face]. Triangulate each face as a fan [f0, fi, fi+1] for i=1..n-2 (orientation preserved, anchor first). Return [triangles, diagonals added (sum n-3), growth in distinct undirected edge count].

Why this case matters

Mesh processing pipelines (remeshing, export, simulation, printing) trust these topological counts and adjacency answers; a wrong invariant silently accepts broken meshes or rejects valid ones.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(x):
    faces=x
    tris=[]
    diag=0
    for f in faces:
        n=len(f)
        if n<3: return ['bad-face',f]
        for i in range(1,n-1):
            tris.append([f[0],f[i],f[i+1]])
        diag+=n-3
    E=set()
    for f in faces:
        n=len(f)
        for i in range(n):
            a,b=f[i],f[(i+1)%n]
            E.add((min(a,b),max(a,b)))
    E2=set()
    for t in tris:
        for i in range(3):
            a,b=t[i],t[(i+1)%3]
            E2.add((a,b))
    return [tris,diag,len(E2)-len(E)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['quad grid', [[[0, 1, 4, 3], [1, 2, 5, 4]]], [[[0, 1, 4], [0, 4, 3], [1, 2, 5], [1, 5, 4]], 2, 2]], ['pentagon', [[[0, 1, 2, 3, 4]]], [[[0, 1, 2], [0, 2, 3], [0, 3, 4]], 2, 2]], ['triangles only', [[[0, 1, 2], [2, 1, 3]]], [[[0, 1, 2], [2, 1, 3]], 0, 0]], ['cube', [[[0, 3, 2, 1], [4, 5, 6, 7], [0, 1, 5, 4], [1, 2, 6, 5], [2, 3, 7, 6], [3, 0, 4, 7]]], [[[0, 3, 2], [0, 2, 1], [4, 5, 6], [4, 6, 7], [0, 1, 5], [0, 5, 4], [1, 2, 6], [1, 6, 5], [2, 3, 7], [2, 7, 6], [3, 0, 4], [3, 4, 7]], 6, 6]], ['two-corner face', [[[0, 1, 2, 3], [4, 5]]], ['bad-face', [4, 5]]], ['mixed', [[[0, 1, 2, 3], [3, 2, 4]]], [[[0, 1, 2], [0, 2, 3], [3, 2, 4]], 1, 1]], ['diagonal already an edge', [[[0, 1, 2, 3], [0, 2, 5]]], [[[0, 1, 2], [0, 2, 3], [0, 2, 5]], 1, 0]]], [['pentagon', [[[0, 1, 2, 3, 4]]], [[[0, 1, 2], [0, 2, 3], [0, 3, 4]], 2, 2]], ['two-corner face', [[[0, 1, 2, 3], [4, 5]]], ['bad-face', [4, 5]]], ['mixed', [[[0, 1, 2, 3], [3, 2, 4]]], [[[0, 1, 2], [0, 2, 3], [3, 2, 4]], 1, 1]], ['diagonal already an edge', [[[0, 1, 2, 3], [0, 2, 5]]], [[[0, 1, 2], [0, 2, 3], [0, 2, 5]], 1, 0]], ['hexagon', [[[5, 4, 3, 2, 1, 0]]], [[[5, 4, 3], [5, 3, 2], [5, 2, 1], [5, 1, 0]], 3, 3]], ['triangle with bad face later', [[[0, 1, 2], [2, 1]]], ['bad-face', [2, 1]]], ['quad torus', [[[0, 3, 4, 1], [1, 4, 5, 2], [2, 5, 3, 0], [3, 6, 7, 4], [4, 7, 8, 5], [5, 8, 6, 3], [6, 0, 1, 7], [7, 1, 2, 8], [8, 2, 0, 6]]], [[[0, 3, 4], [0, 4, 1], [1, 4, 5], [1, 5, 2], [2, 5, 3], [2, 3, 0], [3, 6, 7], [3, 7, 4], [4, 7, 8], [4, 8, 5], [5, 8, 6], [5, 6, 3], [6, 0, 1], [6, 1, 7], [7, 1, 2], [7, 2, 8], [8, 2, 0], [8, 0, 6]], 9, 9]]], [['quad grid', [[[0, 1, 4, 3], [1, 2, 5, 4]]], [[[0, 1, 4], [0, 4, 3], [1, 2, 5], [1, 5, 4]], 2, 2]], ['pentagon', [[[0, 1, 2, 3, 4]]], [[[0, 1, 2], [0, 2, 3], [0, 3, 4]], 2, 2]], ['triangles only', [[[0, 1, 2], [2, 1, 3]]], [[[0, 1, 2], [2, 1, 3]], 0, 0]], ['cube', [[[0, 3, 2, 1], [4, 5, 6, 7], [0, 1, 5, 4], [1, 2, 6, 5], [2, 3, 7, 6], [3, 0, 4, 7]]], [[[0, 3, 2], [0, 2, 1], [4, 5, 6], [4, 6, 7], [0, 1, 5], [0, 5, 4], [1, 2, 6], [1, 6, 5], [2, 3, 7], [2, 7, 6], [3, 0, 4], [3, 4, 7]], 6, 6]], ['triangle with bad face later', [[[0, 1, 2], [2, 1]]], ['bad-face', [2, 1]]], ['quad torus', [[[0, 3, 4, 1], [1, 4, 5, 2], [2, 5, 3, 0], [3, 6, 7, 4], [4, 7, 8, 5], [5, 8, 6, 3], [6, 0, 1, 7], [7, 1, 2, 8], [8, 2, 0, 6]]], [[[0, 3, 4], [0, 4, 1], [1, 4, 5], [1, 5, 2], [2, 5, 3], [2, 3, 0], [3, 6, 7], [3, 7, 4], [4, 7, 8], [4, 8, 5], [5, 8, 6], [5, 6, 3], [6, 0, 1], [6, 1, 7], [7, 1, 2], [7, 2, 8], [8, 2, 0], [8, 0, 6]], 9, 9]], ['single quad', [[[7, 3, 5, 1]]], [[[7, 3, 5], [7, 5, 1]], 1, 1]]], [['quad grid', [[[0, 1, 4, 3], [1, 2, 5, 4]]], [[[0, 1, 4], [0, 4, 3], [1, 2, 5], [1, 5, 4]], 2, 2]], ['pentagon', [[[0, 1, 2, 3, 4]]], [[[0, 1, 2], [0, 2, 3], [0, 3, 4]], 2, 2]], ['triangles only', [[[0, 1, 2], [2, 1, 3]]], [[[0, 1, 2], [2, 1, 3]], 0, 0]], ['cube', [[[0, 3, 2, 1], [4, 5, 6, 7], [0, 1, 5, 4], [1, 2, 6, 5], [2, 3, 7, 6], [3, 0, 4, 7]]], [[[0, 3, 2], [0, 2, 1], [4, 5, 6], [4, 6, 7], [0, 1, 5], [0, 5, 4], [1, 2, 6], [1, 6, 5], [2, 3, 7], [2, 7, 6], [3, 0, 4], [3, 4, 7]], 6, 6]], ['two-corner face', [[[0, 1, 2, 3], [4, 5]]], ['bad-face', [4, 5]]], ['mixed', [[[0, 1, 2, 3], [3, 2, 4]]], [[[0, 1, 2], [0, 2, 3], [3, 2, 4]], 1, 1]], ['diagonal already an edge', [[[0, 1, 2, 3], [0, 2, 5]]], [[[0, 1, 2], [0, 2, 3], [0, 2, 5]], 1, 0]]], [['cube', [[[0, 3, 2, 1], [4, 5, 6, 7], [0, 1, 5, 4], [1, 2, 6, 5], [2, 3, 7, 6], [3, 0, 4, 7]]], [[[0, 3, 2], [0, 2, 1], [4, 5, 6], [4, 6, 7], [0, 1, 5], [0, 5, 4], [1, 2, 6], [1, 6, 5], [2, 3, 7], [2, 7, 6], [3, 0, 4], [3, 4, 7]], 6, 6]], ['two-corner face', [[[0, 1, 2, 3], [4, 5]]], ['bad-face', [4, 5]]], ['mixed', [[[0, 1, 2, 3], [3, 2, 4]]], [[[0, 1, 2], [0, 2, 3], [3, 2, 4]], 1, 1]], ['diagonal already an edge', [[[0, 1, 2, 3], [0, 2, 5]]], [[[0, 1, 2], [0, 2, 3], [0, 2, 5]], 1, 0]], ['hexagon', [[[5, 4, 3, 2, 1, 0]]], [[[5, 4, 3], [5, 3, 2], [5, 2, 1], [5, 1, 0]], 3, 3]], ['triangle with bad face later', [[[0, 1, 2], [2, 1]]], ['bad-face', [2, 1]]], ['quad torus', [[[0, 3, 4, 1], [1, 4, 5, 2], [2, 5, 3, 0], [3, 6, 7, 4], [4, 7, 8, 5], [5, 8, 6, 3], [6, 0, 1, 7], [7, 1, 2, 8], [8, 2, 0, 6]]], [[[0, 3, 4], [0, 4, 1], [1, 4, 5], [1, 5, 2], [2, 5, 3], [2, 3, 0], [3, 6, 7], [3, 7, 4], [4, 7, 8], [4, 8, 5], [5, 8, 6], [5, 6, 3], [6, 0, 1], [6, 1, 7], [7, 1, 2], [7, 2, 8], [8, 2, 0], [8, 0, 6]], 9, 9]]]]
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
quad grid[[[0, 1, 4], [0, 4, 3], [1, 2, 5], [1, 5, 4]], 2, 5][[[0, 1, 4], [0, 4, 3], [1, 2, 5], [1, 5, 4]], 2, 2]Failed
pentagon[[[0, 1, 2], [0, 2, 3], [0, 3, 4]], 2, 4][[[0, 1, 2], [0, 2, 3], [0, 3, 4]], 2, 2]Failed
triangles only[[[0, 1, 2], [2, 1, 3]], 0, 1][[[0, 1, 2], [2, 1, 3]], 0, 0]Failed
cube[[[0, 3, 2], [0, 2, 1], [4, 5, 6], [4, 6, 7], [0, 1, 5], [0, 5, 4], [1, 2, 6], [1, 6, 5], [2, 3, 7], [2, 7, 6], [3, 0, 4], [3, 4, 7]], 6, 24][[[0, 3, 2], [0, 2, 1], [4, 5, 6], [4, 6, 7], [0, 1, 5], [0, 5, 4], [1, 2, 6], [1, 6, 5], [2, 3, 7], [2, 7, 6], [3, 0, 4], [3, 4, 7]], 6, 6]Failed
two-corner face['bad-face', [4, 5]]['bad-face', [4, 5]]Passed
mixed[[[0, 1, 2], [0, 2, 3], [3, 2, 4]], 1, 3][[[0, 1, 2], [0, 2, 3], [3, 2, 4]], 1, 1]Failed
diagonal already an edge[[[0, 1, 2], [0, 2, 3], [0, 2, 5]], 1, 1][[[0, 1, 2], [0, 2, 3], [0, 2, 5]], 1, 0]Failed

SHA-256 / fe326ce2422b9a3ef9136b5880242929633debbad02531686564fd4503c10023

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(x):
    faces=x
    tris=[]
    diag=0
    for f in faces:
        n=len(f)
        if n<3: return ['bad-face',f]
        for i in range(1,n-1):
            tris.append([f[0],f[i],f[i+1]])
        diag+=n-3
    E=set()
    for f in faces:
        n=len(f)
        for i in range(n):
            a,b=f[i],f[(i+1)%n]
            E.add((a,b))
    E2=set()
    for t in tris:
        for i in range(3):
            a,b=t[i],t[(i+1)%3]
            E2.add((a,b))
    return [tris,diag,len(E2)-len(E)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['quad grid', [[[0, 1, 4, 3], [1, 2, 5, 4]]], [[[0, 1, 4], [0, 4, 3], [1, 2, 5], [1, 5, 4]], 2, 2]], ['pentagon', [[[0, 1, 2, 3, 4]]], [[[0, 1, 2], [0, 2, 3], [0, 3, 4]], 2, 2]], ['triangles only', [[[0, 1, 2], [2, 1, 3]]], [[[0, 1, 2], [2, 1, 3]], 0, 0]], ['cube', [[[0, 3, 2, 1], [4, 5, 6, 7], [0, 1, 5, 4], [1, 2, 6, 5], [2, 3, 7, 6], [3, 0, 4, 7]]], [[[0, 3, 2], [0, 2, 1], [4, 5, 6], [4, 6, 7], [0, 1, 5], [0, 5, 4], [1, 2, 6], [1, 6, 5], [2, 3, 7], [2, 7, 6], [3, 0, 4], [3, 4, 7]], 6, 6]], ['two-corner face', [[[0, 1, 2, 3], [4, 5]]], ['bad-face', [4, 5]]], ['mixed', [[[0, 1, 2, 3], [3, 2, 4]]], [[[0, 1, 2], [0, 2, 3], [3, 2, 4]], 1, 1]], ['diagonal already an edge', [[[0, 1, 2, 3], [0, 2, 5]]], [[[0, 1, 2], [0, 2, 3], [0, 2, 5]], 1, 0]]], [['pentagon', [[[0, 1, 2, 3, 4]]], [[[0, 1, 2], [0, 2, 3], [0, 3, 4]], 2, 2]], ['two-corner face', [[[0, 1, 2, 3], [4, 5]]], ['bad-face', [4, 5]]], ['mixed', [[[0, 1, 2, 3], [3, 2, 4]]], [[[0, 1, 2], [0, 2, 3], [3, 2, 4]], 1, 1]], ['diagonal already an edge', [[[0, 1, 2, 3], [0, 2, 5]]], [[[0, 1, 2], [0, 2, 3], [0, 2, 5]], 1, 0]], ['hexagon', [[[5, 4, 3, 2, 1, 0]]], [[[5, 4, 3], [5, 3, 2], [5, 2, 1], [5, 1, 0]], 3, 3]], ['triangle with bad face later', [[[0, 1, 2], [2, 1]]], ['bad-face', [2, 1]]], ['quad torus', [[[0, 3, 4, 1], [1, 4, 5, 2], [2, 5, 3, 0], [3, 6, 7, 4], [4, 7, 8, 5], [5, 8, 6, 3], [6, 0, 1, 7], [7, 1, 2, 8], [8, 2, 0, 6]]], [[[0, 3, 4], [0, 4, 1], [1, 4, 5], [1, 5, 2], [2, 5, 3], [2, 3, 0], [3, 6, 7], [3, 7, 4], [4, 7, 8], [4, 8, 5], [5, 8, 6], [5, 6, 3], [6, 0, 1], [6, 1, 7], [7, 1, 2], [7, 2, 8], [8, 2, 0], [8, 0, 6]], 9, 9]]], [['quad grid', [[[0, 1, 4, 3], [1, 2, 5, 4]]], [[[0, 1, 4], [0, 4, 3], [1, 2, 5], [1, 5, 4]], 2, 2]], ['pentagon', [[[0, 1, 2, 3, 4]]], [[[0, 1, 2], [0, 2, 3], [0, 3, 4]], 2, 2]], ['triangles only', [[[0, 1, 2], [2, 1, 3]]], [[[0, 1, 2], [2, 1, 3]], 0, 0]], ['cube', [[[0, 3, 2, 1], [4, 5, 6, 7], [0, 1, 5, 4], [1, 2, 6, 5], [2, 3, 7, 6], [3, 0, 4, 7]]], [[[0, 3, 2], [0, 2, 1], [4, 5, 6], [4, 6, 7], [0, 1, 5], [0, 5, 4], [1, 2, 6], [1, 6, 5], [2, 3, 7], [2, 7, 6], [3, 0, 4], [3, 4, 7]], 6, 6]], ['triangle with bad face later', [[[0, 1, 2], [2, 1]]], ['bad-face', [2, 1]]], ['quad torus', [[[0, 3, 4, 1], [1, 4, 5, 2], [2, 5, 3, 0], [3, 6, 7, 4], [4, 7, 8, 5], [5, 8, 6, 3], [6, 0, 1, 7], [7, 1, 2, 8], [8, 2, 0, 6]]], [[[0, 3, 4], [0, 4, 1], [1, 4, 5], [1, 5, 2], [2, 5, 3], [2, 3, 0], [3, 6, 7], [3, 7, 4], [4, 7, 8], [4, 8, 5], [5, 8, 6], [5, 6, 3], [6, 0, 1], [6, 1, 7], [7, 1, 2], [7, 2, 8], [8, 2, 0], [8, 0, 6]], 9, 9]], ['single quad', [[[7, 3, 5, 1]]], [[[7, 3, 5], [7, 5, 1]], 1, 1]]], [['quad grid', [[[0, 1, 4, 3], [1, 2, 5, 4]]], [[[0, 1, 4], [0, 4, 3], [1, 2, 5], [1, 5, 4]], 2, 2]], ['pentagon', [[[0, 1, 2, 3, 4]]], [[[0, 1, 2], [0, 2, 3], [0, 3, 4]], 2, 2]], ['triangles only', [[[0, 1, 2], [2, 1, 3]]], [[[0, 1, 2], [2, 1, 3]], 0, 0]], ['cube', [[[0, 3, 2, 1], [4, 5, 6, 7], [0, 1, 5, 4], [1, 2, 6, 5], [2, 3, 7, 6], [3, 0, 4, 7]]], [[[0, 3, 2], [0, 2, 1], [4, 5, 6], [4, 6, 7], [0, 1, 5], [0, 5, 4], [1, 2, 6], [1, 6, 5], [2, 3, 7], [2, 7, 6], [3, 0, 4], [3, 4, 7]], 6, 6]], ['two-corner face', [[[0, 1, 2, 3], [4, 5]]], ['bad-face', [4, 5]]], ['mixed', [[[0, 1, 2, 3], [3, 2, 4]]], [[[0, 1, 2], [0, 2, 3], [3, 2, 4]], 1, 1]], ['diagonal already an edge', [[[0, 1, 2, 3], [0, 2, 5]]], [[[0, 1, 2], [0, 2, 3], [0, 2, 5]], 1, 0]]], [['cube', [[[0, 3, 2, 1], [4, 5, 6, 7], [0, 1, 5, 4], [1, 2, 6, 5], [2, 3, 7, 6], [3, 0, 4, 7]]], [[[0, 3, 2], [0, 2, 1], [4, 5, 6], [4, 6, 7], [0, 1, 5], [0, 5, 4], [1, 2, 6], [1, 6, 5], [2, 3, 7], [2, 7, 6], [3, 0, 4], [3, 4, 7]], 6, 6]], ['two-corner face', [[[0, 1, 2, 3], [4, 5]]], ['bad-face', [4, 5]]], ['mixed', [[[0, 1, 2, 3], [3, 2, 4]]], [[[0, 1, 2], [0, 2, 3], [3, 2, 4]], 1, 1]], ['diagonal already an edge', [[[0, 1, 2, 3], [0, 2, 5]]], [[[0, 1, 2], [0, 2, 3], [0, 2, 5]], 1, 0]], ['hexagon', [[[5, 4, 3, 2, 1, 0]]], [[[5, 4, 3], [5, 3, 2], [5, 2, 1], [5, 1, 0]], 3, 3]], ['triangle with bad face later', [[[0, 1, 2], [2, 1]]], ['bad-face', [2, 1]]], ['quad torus', [[[0, 3, 4, 1], [1, 4, 5, 2], [2, 5, 3, 0], [3, 6, 7, 4], [4, 7, 8, 5], [5, 8, 6, 3], [6, 0, 1, 7], [7, 1, 2, 8], [8, 2, 0, 6]]], [[[0, 3, 4], [0, 4, 1], [1, 4, 5], [1, 5, 2], [2, 5, 3], [2, 3, 0], [3, 6, 7], [3, 7, 4], [4, 7, 8], [4, 8, 5], [5, 8, 6], [5, 6, 3], [6, 0, 1], [6, 1, 7], [7, 1, 2], [7, 2, 8], [8, 2, 0], [8, 0, 6]], 9, 9]]]]
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
quad grid[[[0, 1, 4], [0, 4, 3], [1, 2, 5], [1, 5, 4]], 2, 4][[[0, 1, 4], [0, 4, 3], [1, 2, 5], [1, 5, 4]], 2, 2]Failed
pentagon[[[0, 1, 2], [0, 2, 3], [0, 3, 4]], 2, 4][[[0, 1, 2], [0, 2, 3], [0, 3, 4]], 2, 2]Failed
triangles only[[[0, 1, 2], [2, 1, 3]], 0, 0][[[0, 1, 2], [2, 1, 3]], 0, 0]Passed
cube[[[0, 3, 2], [0, 2, 1], [4, 5, 6], [4, 6, 7], [0, 1, 5], [0, 5, 4], [1, 2, 6], [1, 6, 5], [2, 3, 7], [2, 7, 6], [3, 0, 4], [3, 4, 7]], 6, 12][[[0, 3, 2], [0, 2, 1], [4, 5, 6], [4, 6, 7], [0, 1, 5], [0, 5, 4], [1, 2, 6], [1, 6, 5], [2, 3, 7], [2, 7, 6], [3, 0, 4], [3, 4, 7]], 6, 6]Failed
two-corner face['bad-face', [4, 5]]['bad-face', [4, 5]]Passed
mixed[[[0, 1, 2], [0, 2, 3], [3, 2, 4]], 1, 2][[[0, 1, 2], [0, 2, 3], [3, 2, 4]], 1, 1]Failed
diagonal already an edge[[[0, 1, 2], [0, 2, 3], [0, 2, 5]], 1, 1][[[0, 1, 2], [0, 2, 3], [0, 2, 5]], 1, 0]Failed

SHA-256 / 3b61e96948688877bca95b0a92a6daaad045486971407fda9f0b2e0d60354683

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(x):
    faces=x
    tris=[]
    diag=0
    for f in faces:
        n=len(f)
        if n<3: return ['bad-face',f]
        for i in range(1,n-1):
            tris.append([f[0],f[i],f[i+1]])
        diag+=n-3
    E=set()
    for f in faces:
        n=len(f)
        for i in range(n):
            a,b=f[i],f[(i+1)%n]
            E.add((min(a,b),max(a,b)))
    E2=set()
    for t in tris:
        for i in range(3):
            a,b=t[i],t[(i+1)%3]
            E2.add((min(a,b),max(a,b)))
    return [tris,diag,len(E2)-len(E)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['quad grid', [[[0, 1, 4, 3], [1, 2, 5, 4]]], [[[0, 1, 4], [0, 4, 3], [1, 2, 5], [1, 5, 4]], 2, 2]], ['pentagon', [[[0, 1, 2, 3, 4]]], [[[0, 1, 2], [0, 2, 3], [0, 3, 4]], 2, 2]], ['triangles only', [[[0, 1, 2], [2, 1, 3]]], [[[0, 1, 2], [2, 1, 3]], 0, 0]], ['cube', [[[0, 3, 2, 1], [4, 5, 6, 7], [0, 1, 5, 4], [1, 2, 6, 5], [2, 3, 7, 6], [3, 0, 4, 7]]], [[[0, 3, 2], [0, 2, 1], [4, 5, 6], [4, 6, 7], [0, 1, 5], [0, 5, 4], [1, 2, 6], [1, 6, 5], [2, 3, 7], [2, 7, 6], [3, 0, 4], [3, 4, 7]], 6, 6]], ['two-corner face', [[[0, 1, 2, 3], [4, 5]]], ['bad-face', [4, 5]]], ['mixed', [[[0, 1, 2, 3], [3, 2, 4]]], [[[0, 1, 2], [0, 2, 3], [3, 2, 4]], 1, 1]], ['diagonal already an edge', [[[0, 1, 2, 3], [0, 2, 5]]], [[[0, 1, 2], [0, 2, 3], [0, 2, 5]], 1, 0]]], [['pentagon', [[[0, 1, 2, 3, 4]]], [[[0, 1, 2], [0, 2, 3], [0, 3, 4]], 2, 2]], ['two-corner face', [[[0, 1, 2, 3], [4, 5]]], ['bad-face', [4, 5]]], ['mixed', [[[0, 1, 2, 3], [3, 2, 4]]], [[[0, 1, 2], [0, 2, 3], [3, 2, 4]], 1, 1]], ['diagonal already an edge', [[[0, 1, 2, 3], [0, 2, 5]]], [[[0, 1, 2], [0, 2, 3], [0, 2, 5]], 1, 0]], ['hexagon', [[[5, 4, 3, 2, 1, 0]]], [[[5, 4, 3], [5, 3, 2], [5, 2, 1], [5, 1, 0]], 3, 3]], ['triangle with bad face later', [[[0, 1, 2], [2, 1]]], ['bad-face', [2, 1]]], ['quad torus', [[[0, 3, 4, 1], [1, 4, 5, 2], [2, 5, 3, 0], [3, 6, 7, 4], [4, 7, 8, 5], [5, 8, 6, 3], [6, 0, 1, 7], [7, 1, 2, 8], [8, 2, 0, 6]]], [[[0, 3, 4], [0, 4, 1], [1, 4, 5], [1, 5, 2], [2, 5, 3], [2, 3, 0], [3, 6, 7], [3, 7, 4], [4, 7, 8], [4, 8, 5], [5, 8, 6], [5, 6, 3], [6, 0, 1], [6, 1, 7], [7, 1, 2], [7, 2, 8], [8, 2, 0], [8, 0, 6]], 9, 9]]], [['quad grid', [[[0, 1, 4, 3], [1, 2, 5, 4]]], [[[0, 1, 4], [0, 4, 3], [1, 2, 5], [1, 5, 4]], 2, 2]], ['pentagon', [[[0, 1, 2, 3, 4]]], [[[0, 1, 2], [0, 2, 3], [0, 3, 4]], 2, 2]], ['triangles only', [[[0, 1, 2], [2, 1, 3]]], [[[0, 1, 2], [2, 1, 3]], 0, 0]], ['cube', [[[0, 3, 2, 1], [4, 5, 6, 7], [0, 1, 5, 4], [1, 2, 6, 5], [2, 3, 7, 6], [3, 0, 4, 7]]], [[[0, 3, 2], [0, 2, 1], [4, 5, 6], [4, 6, 7], [0, 1, 5], [0, 5, 4], [1, 2, 6], [1, 6, 5], [2, 3, 7], [2, 7, 6], [3, 0, 4], [3, 4, 7]], 6, 6]], ['triangle with bad face later', [[[0, 1, 2], [2, 1]]], ['bad-face', [2, 1]]], ['quad torus', [[[0, 3, 4, 1], [1, 4, 5, 2], [2, 5, 3, 0], [3, 6, 7, 4], [4, 7, 8, 5], [5, 8, 6, 3], [6, 0, 1, 7], [7, 1, 2, 8], [8, 2, 0, 6]]], [[[0, 3, 4], [0, 4, 1], [1, 4, 5], [1, 5, 2], [2, 5, 3], [2, 3, 0], [3, 6, 7], [3, 7, 4], [4, 7, 8], [4, 8, 5], [5, 8, 6], [5, 6, 3], [6, 0, 1], [6, 1, 7], [7, 1, 2], [7, 2, 8], [8, 2, 0], [8, 0, 6]], 9, 9]], ['single quad', [[[7, 3, 5, 1]]], [[[7, 3, 5], [7, 5, 1]], 1, 1]]], [['quad grid', [[[0, 1, 4, 3], [1, 2, 5, 4]]], [[[0, 1, 4], [0, 4, 3], [1, 2, 5], [1, 5, 4]], 2, 2]], ['pentagon', [[[0, 1, 2, 3, 4]]], [[[0, 1, 2], [0, 2, 3], [0, 3, 4]], 2, 2]], ['triangles only', [[[0, 1, 2], [2, 1, 3]]], [[[0, 1, 2], [2, 1, 3]], 0, 0]], ['cube', [[[0, 3, 2, 1], [4, 5, 6, 7], [0, 1, 5, 4], [1, 2, 6, 5], [2, 3, 7, 6], [3, 0, 4, 7]]], [[[0, 3, 2], [0, 2, 1], [4, 5, 6], [4, 6, 7], [0, 1, 5], [0, 5, 4], [1, 2, 6], [1, 6, 5], [2, 3, 7], [2, 7, 6], [3, 0, 4], [3, 4, 7]], 6, 6]], ['two-corner face', [[[0, 1, 2, 3], [4, 5]]], ['bad-face', [4, 5]]], ['mixed', [[[0, 1, 2, 3], [3, 2, 4]]], [[[0, 1, 2], [0, 2, 3], [3, 2, 4]], 1, 1]], ['diagonal already an edge', [[[0, 1, 2, 3], [0, 2, 5]]], [[[0, 1, 2], [0, 2, 3], [0, 2, 5]], 1, 0]]], [['cube', [[[0, 3, 2, 1], [4, 5, 6, 7], [0, 1, 5, 4], [1, 2, 6, 5], [2, 3, 7, 6], [3, 0, 4, 7]]], [[[0, 3, 2], [0, 2, 1], [4, 5, 6], [4, 6, 7], [0, 1, 5], [0, 5, 4], [1, 2, 6], [1, 6, 5], [2, 3, 7], [2, 7, 6], [3, 0, 4], [3, 4, 7]], 6, 6]], ['two-corner face', [[[0, 1, 2, 3], [4, 5]]], ['bad-face', [4, 5]]], ['mixed', [[[0, 1, 2, 3], [3, 2, 4]]], [[[0, 1, 2], [0, 2, 3], [3, 2, 4]], 1, 1]], ['diagonal already an edge', [[[0, 1, 2, 3], [0, 2, 5]]], [[[0, 1, 2], [0, 2, 3], [0, 2, 5]], 1, 0]], ['hexagon', [[[5, 4, 3, 2, 1, 0]]], [[[5, 4, 3], [5, 3, 2], [5, 2, 1], [5, 1, 0]], 3, 3]], ['triangle with bad face later', [[[0, 1, 2], [2, 1]]], ['bad-face', [2, 1]]], ['quad torus', [[[0, 3, 4, 1], [1, 4, 5, 2], [2, 5, 3, 0], [3, 6, 7, 4], [4, 7, 8, 5], [5, 8, 6, 3], [6, 0, 1, 7], [7, 1, 2, 8], [8, 2, 0, 6]]], [[[0, 3, 4], [0, 4, 1], [1, 4, 5], [1, 5, 2], [2, 5, 3], [2, 3, 0], [3, 6, 7], [3, 7, 4], [4, 7, 8], [4, 8, 5], [5, 8, 6], [5, 6, 3], [6, 0, 1], [6, 1, 7], [7, 1, 2], [7, 2, 8], [8, 2, 0], [8, 0, 6]], 9, 9]]]]
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
quad grid[[[0, 1, 4], [0, 4, 3], [1, 2, 5], [1, 5, 4]], 2, 2][[[0, 1, 4], [0, 4, 3], [1, 2, 5], [1, 5, 4]], 2, 2]Passed
pentagon[[[0, 1, 2], [0, 2, 3], [0, 3, 4]], 2, 2][[[0, 1, 2], [0, 2, 3], [0, 3, 4]], 2, 2]Passed
triangles only[[[0, 1, 2], [2, 1, 3]], 0, 0][[[0, 1, 2], [2, 1, 3]], 0, 0]Passed
cube[[[0, 3, 2], [0, 2, 1], [4, 5, 6], [4, 6, 7], [0, 1, 5], [0, 5, 4], [1, 2, 6], [1, 6, 5], [2, 3, 7], [2, 7, 6], [3, 0, 4], [3, 4, 7]], 6, 6][[[0, 3, 2], [0, 2, 1], [4, 5, 6], [4, 6, 7], [0, 1, 5], [0, 5, 4], [1, 2, 6], [1, 6, 5], [2, 3, 7], [2, 7, 6], [3, 0, 4], [3, 4, 7]], 6, 6]Passed
two-corner face['bad-face', [4, 5]]['bad-face', [4, 5]]Passed
mixed[[[0, 1, 2], [0, 2, 3], [3, 2, 4]], 1, 1][[[0, 1, 2], [0, 2, 3], [3, 2, 4]], 1, 1]Passed
diagonal already an edge[[[0, 1, 2], [0, 2, 3], [0, 2, 5]], 1, 0][[[0, 1, 2], [0, 2, 3], [0, 2, 5]], 1, 0]Passed

SHA-256 / 26c01e070ea320589f17607772d9d04a4d38b29c784f8aea38e6d79c25d42ad1

Verification & scope

Pure combinatorial teaching model over integer face lists with a stipulated contract; no geometry kernel or file format is implied. 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:51:09.949902+00:00.

Case digest / 30dbcde69f8581bb5e95ec8f2865afd2e36078970594cb991712c5e334f40f92