FA-88561 / Mesh topology invariants / Open access
Compaction keeps faces that collapse to a line · case 01
Faces with repeated corners survive and keep otherwise unused vertices alive.
ROOT CAUSE
The drop test checks the corner count rather than the number of distinct vertices.
VERIFIED REPAIR
Drop faces with fewer than 3 distinct vertices.
Unsuccessful approach: Dropping every face with any repeated vertex also removes valid polygons.
Case contract
Input [verts, faces]: drop faces with fewer than 3 distinct vertices, then keep only vertices referenced by remaining faces, renumbered 0-based in increasing old-index order. Faces keep their corner order. Return [kept vertex payloads, remapped faces].
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):
verts,faces=x
keep=[]
for f in faces:
if len(f)<3: continue
keep.append(f)
used=sorted({v for f in keep for v in f})
remap={old:new for new,old in enumerate(used)}
return [[verts[o] for o in used],[[remap[v] for v in f] for f in keep]]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['gap and degenerate', [[['a', 'b', 'c', 'd', 'e', 'f'], [[0, 2, 3], [3, 3, 5], [2, 4, 3]]]], [['a', 'c', 'd', 'e'], [[0, 1, 2], [1, 3, 2]]]], ['repeated but valid quad', [[['p', 'q', 'r', 's'], [[0, 1, 1, 2], [2, 1, 3]]]], [['p', 'q', 'r', 's'], [[0, 1, 1, 2], [2, 1, 3]]]], ['first use differs from index order', [[['v0', 'v1', 'v2', 'v3', 'v4'], [[4, 2, 3], [3, 2, 0]]]], [['v0', 'v2', 'v3', 'v4'], [[3, 1, 2], [2, 1, 0]]]], ['only degenerate', [[['x', 'y', 'z'], [[0, 0, 1], [1, 2, 2]]]], [[], []]], ['two-corner face', [[['x', 'y', 'z', 'w'], [[0, 1], [1, 2, 3]]]], [['y', 'z', 'w'], [[0, 1, 2]]]], ['no gaps', [[['a', 'b', 'c', 'd'], [[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2]]]], [['a', 'b', 'c', 'd'], [[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2]]]], ['high gap', [[['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'], [[5, 6, 7], [7, 6, 5, 1]]]], [['b', 'f', 'g', 'h'], [[1, 2, 3], [3, 2, 1, 0]]]]], [['only degenerate', [[['x', 'y', 'z'], [[0, 0, 1], [1, 2, 2]]]], [[], []]], ['two-corner face', [[['x', 'y', 'z', 'w'], [[0, 1], [1, 2, 3]]]], [['y', 'z', 'w'], [[0, 1, 2]]]], ['no gaps', [[['a', 'b', 'c', 'd'], [[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2]]]], [['a', 'b', 'c', 'd'], [[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2]]]], ['high gap', [[['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'], [[5, 6, 7], [7, 6, 5, 1]]]], [['b', 'f', 'g', 'h'], [[1, 2, 3], [3, 2, 1, 0]]]], ['degenerate references isolated vertex', [[['a', 'b', 'c', 'd', 'e'], [[1, 2, 3], [0, 0, 4]]]], [['b', 'c', 'd'], [[0, 1, 2]]]], ['polygon with non-consecutive repeat', [[['a', 'b', 'c', 'd', 'e'], [[1, 2, 1, 3], [4, 3, 2]]]], [['b', 'c', 'd', 'e'], [[0, 1, 0, 2], [3, 2, 1]]]], ['single triangle offset', [[['a', 'b', 'c', 'd', 'e', 'f'], [[3, 4, 5]]]], [['d', 'e', 'f'], [[0, 1, 2]]]]], [['gap and degenerate', [[['a', 'b', 'c', 'd', 'e', 'f'], [[0, 2, 3], [3, 3, 5], [2, 4, 3]]]], [['a', 'c', 'd', 'e'], [[0, 1, 2], [1, 3, 2]]]], ['repeated but valid quad', [[['p', 'q', 'r', 's'], [[0, 1, 1, 2], [2, 1, 3]]]], [['p', 'q', 'r', 's'], [[0, 1, 1, 2], [2, 1, 3]]]], ['first use differs from index order', [[['v0', 'v1', 'v2', 'v3', 'v4'], [[4, 2, 3], [3, 2, 0]]]], [['v0', 'v2', 'v3', 'v4'], [[3, 1, 2], [2, 1, 0]]]], ['high gap', [[['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'], [[5, 6, 7], [7, 6, 5, 1]]]], [['b', 'f', 'g', 'h'], [[1, 2, 3], [3, 2, 1, 0]]]], ['degenerate references isolated vertex', [[['a', 'b', 'c', 'd', 'e'], [[1, 2, 3], [0, 0, 4]]]], [['b', 'c', 'd'], [[0, 1, 2]]]], ['polygon with non-consecutive repeat', [[['a', 'b', 'c', 'd', 'e'], [[1, 2, 1, 3], [4, 3, 2]]]], [['b', 'c', 'd', 'e'], [[0, 1, 0, 2], [3, 2, 1]]]], ['single triangle offset', [[['a', 'b', 'c', 'd', 'e', 'f'], [[3, 4, 5]]]], [['d', 'e', 'f'], [[0, 1, 2]]]]], [['gap and degenerate', [[['a', 'b', 'c', 'd', 'e', 'f'], [[0, 2, 3], [3, 3, 5], [2, 4, 3]]]], [['a', 'c', 'd', 'e'], [[0, 1, 2], [1, 3, 2]]]], ['repeated but valid quad', [[['p', 'q', 'r', 's'], [[0, 1, 1, 2], [2, 1, 3]]]], [['p', 'q', 'r', 's'], [[0, 1, 1, 2], [2, 1, 3]]]], ['only degenerate', [[['x', 'y', 'z'], [[0, 0, 1], [1, 2, 2]]]], [[], []]], ['two-corner face', [[['x', 'y', 'z', 'w'], [[0, 1], [1, 2, 3]]]], [['y', 'z', 'w'], [[0, 1, 2]]]], ['no gaps', [[['a', 'b', 'c', 'd'], [[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2]]]], [['a', 'b', 'c', 'd'], [[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2]]]], ['high gap', [[['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'], [[5, 6, 7], [7, 6, 5, 1]]]], [['b', 'f', 'g', 'h'], [[1, 2, 3], [3, 2, 1, 0]]]], ['degenerate references isolated vertex', [[['a', 'b', 'c', 'd', 'e'], [[1, 2, 3], [0, 0, 4]]]], [['b', 'c', 'd'], [[0, 1, 2]]]]], [['gap and degenerate', [[['a', 'b', 'c', 'd', 'e', 'f'], [[0, 2, 3], [3, 3, 5], [2, 4, 3]]]], [['a', 'c', 'd', 'e'], [[0, 1, 2], [1, 3, 2]]]], ['only degenerate', [[['x', 'y', 'z'], [[0, 0, 1], [1, 2, 2]]]], [[], []]], ['two-corner face', [[['x', 'y', 'z', 'w'], [[0, 1], [1, 2, 3]]]], [['y', 'z', 'w'], [[0, 1, 2]]]], ['high gap', [[['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'], [[5, 6, 7], [7, 6, 5, 1]]]], [['b', 'f', 'g', 'h'], [[1, 2, 3], [3, 2, 1, 0]]]], ['degenerate references isolated vertex', [[['a', 'b', 'c', 'd', 'e'], [[1, 2, 3], [0, 0, 4]]]], [['b', 'c', 'd'], [[0, 1, 2]]]], ['polygon with non-consecutive repeat', [[['a', 'b', 'c', 'd', 'e'], [[1, 2, 1, 3], [4, 3, 2]]]], [['b', 'c', 'd', 'e'], [[0, 1, 0, 2], [3, 2, 1]]]], ['single triangle offset', [[['a', 'b', 'c', 'd', 'e', 'f'], [[3, 4, 5]]]], [['d', 'e', 'f'], [[0, 1, 2]]]]]]
for label, args, expected in fixtures[N-1]:
check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| gap and degenerate | [['a', 'c', 'd', 'e', 'f'], [[0, 1, 2], [2, 2, 4], [1, 3, 2]]] | [['a', 'c', 'd', 'e'], [[0, 1, 2], [1, 3, 2]]] | Failed |
| repeated but valid quad | [['p', 'q', 'r', 's'], [[0, 1, 1, 2], [2, 1, 3]]] | [['p', 'q', 'r', 's'], [[0, 1, 1, 2], [2, 1, 3]]] | Passed |
| first use differs from index order | [['v0', 'v2', 'v3', 'v4'], [[3, 1, 2], [2, 1, 0]]] | [['v0', 'v2', 'v3', 'v4'], [[3, 1, 2], [2, 1, 0]]] | Passed |
| only degenerate | [['x', 'y', 'z'], [[0, 0, 1], [1, 2, 2]]] | [[], []] | Failed |
| two-corner face | [['y', 'z', 'w'], [[0, 1, 2]]] | [['y', 'z', 'w'], [[0, 1, 2]]] | Passed |
| no gaps | [['a', 'b', 'c', 'd'], [[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2]]] | [['a', 'b', 'c', 'd'], [[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2]]] | Passed |
| high gap | [['b', 'f', 'g', 'h'], [[1, 2, 3], [3, 2, 1, 0]]] | [['b', 'f', 'g', 'h'], [[1, 2, 3], [3, 2, 1, 0]]] | Passed |
SHA-256 / 1b925ade7f6108c61120755733bf05e89537edcef8ad9d32ece767fd232ecb77
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(x):
verts,faces=x
keep=[]
for f in faces:
if len(set(f))<len(f): continue
keep.append(f)
used=sorted({v for f in keep for v in f})
remap={old:new for new,old in enumerate(used)}
return [[verts[o] for o in used],[[remap[v] for v in f] for f in keep]]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['gap and degenerate', [[['a', 'b', 'c', 'd', 'e', 'f'], [[0, 2, 3], [3, 3, 5], [2, 4, 3]]]], [['a', 'c', 'd', 'e'], [[0, 1, 2], [1, 3, 2]]]], ['repeated but valid quad', [[['p', 'q', 'r', 's'], [[0, 1, 1, 2], [2, 1, 3]]]], [['p', 'q', 'r', 's'], [[0, 1, 1, 2], [2, 1, 3]]]], ['first use differs from index order', [[['v0', 'v1', 'v2', 'v3', 'v4'], [[4, 2, 3], [3, 2, 0]]]], [['v0', 'v2', 'v3', 'v4'], [[3, 1, 2], [2, 1, 0]]]], ['only degenerate', [[['x', 'y', 'z'], [[0, 0, 1], [1, 2, 2]]]], [[], []]], ['two-corner face', [[['x', 'y', 'z', 'w'], [[0, 1], [1, 2, 3]]]], [['y', 'z', 'w'], [[0, 1, 2]]]], ['no gaps', [[['a', 'b', 'c', 'd'], [[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2]]]], [['a', 'b', 'c', 'd'], [[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2]]]], ['high gap', [[['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'], [[5, 6, 7], [7, 6, 5, 1]]]], [['b', 'f', 'g', 'h'], [[1, 2, 3], [3, 2, 1, 0]]]]], [['only degenerate', [[['x', 'y', 'z'], [[0, 0, 1], [1, 2, 2]]]], [[], []]], ['two-corner face', [[['x', 'y', 'z', 'w'], [[0, 1], [1, 2, 3]]]], [['y', 'z', 'w'], [[0, 1, 2]]]], ['no gaps', [[['a', 'b', 'c', 'd'], [[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2]]]], [['a', 'b', 'c', 'd'], [[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2]]]], ['high gap', [[['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'], [[5, 6, 7], [7, 6, 5, 1]]]], [['b', 'f', 'g', 'h'], [[1, 2, 3], [3, 2, 1, 0]]]], ['degenerate references isolated vertex', [[['a', 'b', 'c', 'd', 'e'], [[1, 2, 3], [0, 0, 4]]]], [['b', 'c', 'd'], [[0, 1, 2]]]], ['polygon with non-consecutive repeat', [[['a', 'b', 'c', 'd', 'e'], [[1, 2, 1, 3], [4, 3, 2]]]], [['b', 'c', 'd', 'e'], [[0, 1, 0, 2], [3, 2, 1]]]], ['single triangle offset', [[['a', 'b', 'c', 'd', 'e', 'f'], [[3, 4, 5]]]], [['d', 'e', 'f'], [[0, 1, 2]]]]], [['gap and degenerate', [[['a', 'b', 'c', 'd', 'e', 'f'], [[0, 2, 3], [3, 3, 5], [2, 4, 3]]]], [['a', 'c', 'd', 'e'], [[0, 1, 2], [1, 3, 2]]]], ['repeated but valid quad', [[['p', 'q', 'r', 's'], [[0, 1, 1, 2], [2, 1, 3]]]], [['p', 'q', 'r', 's'], [[0, 1, 1, 2], [2, 1, 3]]]], ['first use differs from index order', [[['v0', 'v1', 'v2', 'v3', 'v4'], [[4, 2, 3], [3, 2, 0]]]], [['v0', 'v2', 'v3', 'v4'], [[3, 1, 2], [2, 1, 0]]]], ['high gap', [[['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'], [[5, 6, 7], [7, 6, 5, 1]]]], [['b', 'f', 'g', 'h'], [[1, 2, 3], [3, 2, 1, 0]]]], ['degenerate references isolated vertex', [[['a', 'b', 'c', 'd', 'e'], [[1, 2, 3], [0, 0, 4]]]], [['b', 'c', 'd'], [[0, 1, 2]]]], ['polygon with non-consecutive repeat', [[['a', 'b', 'c', 'd', 'e'], [[1, 2, 1, 3], [4, 3, 2]]]], [['b', 'c', 'd', 'e'], [[0, 1, 0, 2], [3, 2, 1]]]], ['single triangle offset', [[['a', 'b', 'c', 'd', 'e', 'f'], [[3, 4, 5]]]], [['d', 'e', 'f'], [[0, 1, 2]]]]], [['gap and degenerate', [[['a', 'b', 'c', 'd', 'e', 'f'], [[0, 2, 3], [3, 3, 5], [2, 4, 3]]]], [['a', 'c', 'd', 'e'], [[0, 1, 2], [1, 3, 2]]]], ['repeated but valid quad', [[['p', 'q', 'r', 's'], [[0, 1, 1, 2], [2, 1, 3]]]], [['p', 'q', 'r', 's'], [[0, 1, 1, 2], [2, 1, 3]]]], ['only degenerate', [[['x', 'y', 'z'], [[0, 0, 1], [1, 2, 2]]]], [[], []]], ['two-corner face', [[['x', 'y', 'z', 'w'], [[0, 1], [1, 2, 3]]]], [['y', 'z', 'w'], [[0, 1, 2]]]], ['no gaps', [[['a', 'b', 'c', 'd'], [[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2]]]], [['a', 'b', 'c', 'd'], [[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2]]]], ['high gap', [[['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'], [[5, 6, 7], [7, 6, 5, 1]]]], [['b', 'f', 'g', 'h'], [[1, 2, 3], [3, 2, 1, 0]]]], ['degenerate references isolated vertex', [[['a', 'b', 'c', 'd', 'e'], [[1, 2, 3], [0, 0, 4]]]], [['b', 'c', 'd'], [[0, 1, 2]]]]], [['gap and degenerate', [[['a', 'b', 'c', 'd', 'e', 'f'], [[0, 2, 3], [3, 3, 5], [2, 4, 3]]]], [['a', 'c', 'd', 'e'], [[0, 1, 2], [1, 3, 2]]]], ['only degenerate', [[['x', 'y', 'z'], [[0, 0, 1], [1, 2, 2]]]], [[], []]], ['two-corner face', [[['x', 'y', 'z', 'w'], [[0, 1], [1, 2, 3]]]], [['y', 'z', 'w'], [[0, 1, 2]]]], ['high gap', [[['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'], [[5, 6, 7], [7, 6, 5, 1]]]], [['b', 'f', 'g', 'h'], [[1, 2, 3], [3, 2, 1, 0]]]], ['degenerate references isolated vertex', [[['a', 'b', 'c', 'd', 'e'], [[1, 2, 3], [0, 0, 4]]]], [['b', 'c', 'd'], [[0, 1, 2]]]], ['polygon with non-consecutive repeat', [[['a', 'b', 'c', 'd', 'e'], [[1, 2, 1, 3], [4, 3, 2]]]], [['b', 'c', 'd', 'e'], [[0, 1, 0, 2], [3, 2, 1]]]], ['single triangle offset', [[['a', 'b', 'c', 'd', 'e', 'f'], [[3, 4, 5]]]], [['d', 'e', 'f'], [[0, 1, 2]]]]]]
for label, args, expected in fixtures[N-1]:
check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| gap and degenerate | [['a', 'c', 'd', 'e'], [[0, 1, 2], [1, 3, 2]]] | [['a', 'c', 'd', 'e'], [[0, 1, 2], [1, 3, 2]]] | Passed |
| repeated but valid quad | [['q', 'r', 's'], [[1, 0, 2]]] | [['p', 'q', 'r', 's'], [[0, 1, 1, 2], [2, 1, 3]]] | Failed |
| first use differs from index order | [['v0', 'v2', 'v3', 'v4'], [[3, 1, 2], [2, 1, 0]]] | [['v0', 'v2', 'v3', 'v4'], [[3, 1, 2], [2, 1, 0]]] | Passed |
| only degenerate | [[], []] | [[], []] | Passed |
| two-corner face | [['x', 'y', 'z', 'w'], [[0, 1], [1, 2, 3]]] | [['y', 'z', 'w'], [[0, 1, 2]]] | Failed |
| no gaps | [['a', 'b', 'c', 'd'], [[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2]]] | [['a', 'b', 'c', 'd'], [[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2]]] | Passed |
| high gap | [['b', 'f', 'g', 'h'], [[1, 2, 3], [3, 2, 1, 0]]] | [['b', 'f', 'g', 'h'], [[1, 2, 3], [3, 2, 1, 0]]] | Passed |
SHA-256 / 83ef51434672568ab8f018b070fffee9286af361fd8e34b094502f8b712b9369
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(x):
verts,faces=x
keep=[]
for f in faces:
if len(set(f))<3: continue
keep.append(f)
used=sorted({v for f in keep for v in f})
remap={old:new for new,old in enumerate(used)}
return [[verts[o] for o in used],[[remap[v] for v in f] for f in keep]]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['gap and degenerate', [[['a', 'b', 'c', 'd', 'e', 'f'], [[0, 2, 3], [3, 3, 5], [2, 4, 3]]]], [['a', 'c', 'd', 'e'], [[0, 1, 2], [1, 3, 2]]]], ['repeated but valid quad', [[['p', 'q', 'r', 's'], [[0, 1, 1, 2], [2, 1, 3]]]], [['p', 'q', 'r', 's'], [[0, 1, 1, 2], [2, 1, 3]]]], ['first use differs from index order', [[['v0', 'v1', 'v2', 'v3', 'v4'], [[4, 2, 3], [3, 2, 0]]]], [['v0', 'v2', 'v3', 'v4'], [[3, 1, 2], [2, 1, 0]]]], ['only degenerate', [[['x', 'y', 'z'], [[0, 0, 1], [1, 2, 2]]]], [[], []]], ['two-corner face', [[['x', 'y', 'z', 'w'], [[0, 1], [1, 2, 3]]]], [['y', 'z', 'w'], [[0, 1, 2]]]], ['no gaps', [[['a', 'b', 'c', 'd'], [[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2]]]], [['a', 'b', 'c', 'd'], [[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2]]]], ['high gap', [[['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'], [[5, 6, 7], [7, 6, 5, 1]]]], [['b', 'f', 'g', 'h'], [[1, 2, 3], [3, 2, 1, 0]]]]], [['only degenerate', [[['x', 'y', 'z'], [[0, 0, 1], [1, 2, 2]]]], [[], []]], ['two-corner face', [[['x', 'y', 'z', 'w'], [[0, 1], [1, 2, 3]]]], [['y', 'z', 'w'], [[0, 1, 2]]]], ['no gaps', [[['a', 'b', 'c', 'd'], [[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2]]]], [['a', 'b', 'c', 'd'], [[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2]]]], ['high gap', [[['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'], [[5, 6, 7], [7, 6, 5, 1]]]], [['b', 'f', 'g', 'h'], [[1, 2, 3], [3, 2, 1, 0]]]], ['degenerate references isolated vertex', [[['a', 'b', 'c', 'd', 'e'], [[1, 2, 3], [0, 0, 4]]]], [['b', 'c', 'd'], [[0, 1, 2]]]], ['polygon with non-consecutive repeat', [[['a', 'b', 'c', 'd', 'e'], [[1, 2, 1, 3], [4, 3, 2]]]], [['b', 'c', 'd', 'e'], [[0, 1, 0, 2], [3, 2, 1]]]], ['single triangle offset', [[['a', 'b', 'c', 'd', 'e', 'f'], [[3, 4, 5]]]], [['d', 'e', 'f'], [[0, 1, 2]]]]], [['gap and degenerate', [[['a', 'b', 'c', 'd', 'e', 'f'], [[0, 2, 3], [3, 3, 5], [2, 4, 3]]]], [['a', 'c', 'd', 'e'], [[0, 1, 2], [1, 3, 2]]]], ['repeated but valid quad', [[['p', 'q', 'r', 's'], [[0, 1, 1, 2], [2, 1, 3]]]], [['p', 'q', 'r', 's'], [[0, 1, 1, 2], [2, 1, 3]]]], ['first use differs from index order', [[['v0', 'v1', 'v2', 'v3', 'v4'], [[4, 2, 3], [3, 2, 0]]]], [['v0', 'v2', 'v3', 'v4'], [[3, 1, 2], [2, 1, 0]]]], ['high gap', [[['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'], [[5, 6, 7], [7, 6, 5, 1]]]], [['b', 'f', 'g', 'h'], [[1, 2, 3], [3, 2, 1, 0]]]], ['degenerate references isolated vertex', [[['a', 'b', 'c', 'd', 'e'], [[1, 2, 3], [0, 0, 4]]]], [['b', 'c', 'd'], [[0, 1, 2]]]], ['polygon with non-consecutive repeat', [[['a', 'b', 'c', 'd', 'e'], [[1, 2, 1, 3], [4, 3, 2]]]], [['b', 'c', 'd', 'e'], [[0, 1, 0, 2], [3, 2, 1]]]], ['single triangle offset', [[['a', 'b', 'c', 'd', 'e', 'f'], [[3, 4, 5]]]], [['d', 'e', 'f'], [[0, 1, 2]]]]], [['gap and degenerate', [[['a', 'b', 'c', 'd', 'e', 'f'], [[0, 2, 3], [3, 3, 5], [2, 4, 3]]]], [['a', 'c', 'd', 'e'], [[0, 1, 2], [1, 3, 2]]]], ['repeated but valid quad', [[['p', 'q', 'r', 's'], [[0, 1, 1, 2], [2, 1, 3]]]], [['p', 'q', 'r', 's'], [[0, 1, 1, 2], [2, 1, 3]]]], ['only degenerate', [[['x', 'y', 'z'], [[0, 0, 1], [1, 2, 2]]]], [[], []]], ['two-corner face', [[['x', 'y', 'z', 'w'], [[0, 1], [1, 2, 3]]]], [['y', 'z', 'w'], [[0, 1, 2]]]], ['no gaps', [[['a', 'b', 'c', 'd'], [[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2]]]], [['a', 'b', 'c', 'd'], [[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2]]]], ['high gap', [[['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'], [[5, 6, 7], [7, 6, 5, 1]]]], [['b', 'f', 'g', 'h'], [[1, 2, 3], [3, 2, 1, 0]]]], ['degenerate references isolated vertex', [[['a', 'b', 'c', 'd', 'e'], [[1, 2, 3], [0, 0, 4]]]], [['b', 'c', 'd'], [[0, 1, 2]]]]], [['gap and degenerate', [[['a', 'b', 'c', 'd', 'e', 'f'], [[0, 2, 3], [3, 3, 5], [2, 4, 3]]]], [['a', 'c', 'd', 'e'], [[0, 1, 2], [1, 3, 2]]]], ['only degenerate', [[['x', 'y', 'z'], [[0, 0, 1], [1, 2, 2]]]], [[], []]], ['two-corner face', [[['x', 'y', 'z', 'w'], [[0, 1], [1, 2, 3]]]], [['y', 'z', 'w'], [[0, 1, 2]]]], ['high gap', [[['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'], [[5, 6, 7], [7, 6, 5, 1]]]], [['b', 'f', 'g', 'h'], [[1, 2, 3], [3, 2, 1, 0]]]], ['degenerate references isolated vertex', [[['a', 'b', 'c', 'd', 'e'], [[1, 2, 3], [0, 0, 4]]]], [['b', 'c', 'd'], [[0, 1, 2]]]], ['polygon with non-consecutive repeat', [[['a', 'b', 'c', 'd', 'e'], [[1, 2, 1, 3], [4, 3, 2]]]], [['b', 'c', 'd', 'e'], [[0, 1, 0, 2], [3, 2, 1]]]], ['single triangle offset', [[['a', 'b', 'c', 'd', 'e', 'f'], [[3, 4, 5]]]], [['d', 'e', 'f'], [[0, 1, 2]]]]]]
for label, args, expected in fixtures[N-1]:
check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| gap and degenerate | [['a', 'c', 'd', 'e'], [[0, 1, 2], [1, 3, 2]]] | [['a', 'c', 'd', 'e'], [[0, 1, 2], [1, 3, 2]]] | Passed |
| repeated but valid quad | [['p', 'q', 'r', 's'], [[0, 1, 1, 2], [2, 1, 3]]] | [['p', 'q', 'r', 's'], [[0, 1, 1, 2], [2, 1, 3]]] | Passed |
| first use differs from index order | [['v0', 'v2', 'v3', 'v4'], [[3, 1, 2], [2, 1, 0]]] | [['v0', 'v2', 'v3', 'v4'], [[3, 1, 2], [2, 1, 0]]] | Passed |
| only degenerate | [[], []] | [[], []] | Passed |
| two-corner face | [['y', 'z', 'w'], [[0, 1, 2]]] | [['y', 'z', 'w'], [[0, 1, 2]]] | Passed |
| no gaps | [['a', 'b', 'c', 'd'], [[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2]]] | [['a', 'b', 'c', 'd'], [[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2]]] | Passed |
| high gap | [['b', 'f', 'g', 'h'], [[1, 2, 3], [3, 2, 1, 0]]] | [['b', 'f', 'g', 'h'], [[1, 2, 3], [3, 2, 1, 0]]] | Passed |
SHA-256 / 66357ec15bf343a13b81299cec4c4b47a1a344bf58f4845fc0cbf81b4587737a
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.291878+00:00.
Case digest / 09afd1c4f680c9763cdd3ad051be9ea04e879ee74b12b717d49dcc445e61ae32