FA-88571 / Mesh topology invariants / Open access
Compaction numbers vertices in first-use order · case 01
The output vertex order depends on face order instead of the original index order.
ROOT CAUSE
New indices follow the first appearance in faces.
VERIFIED REPAIR
Assign new indices by increasing old index.
Unsuccessful approach: Descending order reverses the vertex array.
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(set(f))<3: continue
keep.append(f)
used=list(dict.fromkeys(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]]]]], [['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]]]], ['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]]]], ['only degenerate', [[['x', 'y', 'z'], [[0, 0, 1], [1, 2, 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]]]], ['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]]]]], [['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]]]], ['degenerate references isolated vertex', [[['a', 'b', 'c', 'd', 'e'], [[1, 2, 3], [0, 0, 4]]]], [['b', 'c', 'd'], [[0, 1, 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]]]], ['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]]]]]]
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 | [['v4', 'v2', 'v3', 'v0'], [[0, 1, 2], [2, 1, 3]]] | [['v0', 'v2', 'v3', 'v4'], [[3, 1, 2], [2, 1, 0]]] | Failed |
| only degenerate | [[], []] | [[], []] | Passed |
| two-corner face | [['y', 'z', 'w'], [[0, 1, 2]]] | [['y', 'z', 'w'], [[0, 1, 2]]] | Passed |
| no gaps | [['a', 'c', 'b', 'd'], [[0, 1, 2], [0, 2, 3], [2, 1, 3], [0, 3, 1]]] | [['a', 'b', 'c', 'd'], [[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2]]] | Failed |
| high gap | [['f', 'g', 'h', 'b'], [[0, 1, 2], [2, 1, 0, 3]]] | [['b', 'f', 'g', 'h'], [[1, 2, 3], [3, 2, 1, 0]]] | Failed |
SHA-256 / 577d1757af01d29d07de74a4eeb4f6545dd612a69ac18e047091b7fc05ced4b3
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))<3: continue
keep.append(f)
used=sorted({v for f in keep for v in f},reverse=True)
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]]]]], [['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]]]], ['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]]]], ['only degenerate', [[['x', 'y', 'z'], [[0, 0, 1], [1, 2, 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]]]], ['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]]]]], [['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]]]], ['degenerate references isolated vertex', [[['a', 'b', 'c', 'd', 'e'], [[1, 2, 3], [0, 0, 4]]]], [['b', 'c', 'd'], [[0, 1, 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]]]], ['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]]]]]]
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 | [['e', 'd', 'c', 'a'], [[3, 2, 1], [2, 0, 1]]] | [['a', 'c', 'd', 'e'], [[0, 1, 2], [1, 3, 2]]] | Failed |
| repeated but valid quad | [['s', 'r', 'q', 'p'], [[3, 2, 2, 1], [1, 2, 0]]] | [['p', 'q', 'r', 's'], [[0, 1, 1, 2], [2, 1, 3]]] | Failed |
| first use differs from index order | [['v4', 'v3', 'v2', 'v0'], [[0, 2, 1], [1, 2, 3]]] | [['v0', 'v2', 'v3', 'v4'], [[3, 1, 2], [2, 1, 0]]] | Failed |
| only degenerate | [[], []] | [[], []] | Passed |
| two-corner face | [['w', 'z', 'y'], [[2, 1, 0]]] | [['y', 'z', 'w'], [[0, 1, 2]]] | Failed |
| no gaps | [['d', 'c', 'b', 'a'], [[3, 1, 2], [3, 2, 0], [2, 1, 0], [3, 0, 1]]] | [['a', 'b', 'c', 'd'], [[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2]]] | Failed |
| high gap | [['h', 'g', 'f', 'b'], [[2, 1, 0], [0, 1, 2, 3]]] | [['b', 'f', 'g', 'h'], [[1, 2, 3], [3, 2, 1, 0]]] | Failed |
SHA-256 / c5942366f0f6f8372f6661bd5dba60897185d1a22fcad1aa873bfe1d8b074c6d
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]]]]], [['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]]]], ['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]]]], ['only degenerate', [[['x', 'y', 'z'], [[0, 0, 1], [1, 2, 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]]]], ['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]]]]], [['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]]]], ['degenerate references isolated vertex', [[['a', 'b', 'c', 'd', 'e'], [[1, 2, 3], [0, 0, 4]]]], [['b', 'c', 'd'], [[0, 1, 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]]]], ['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]]]]]]
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 / a62b52aa7e433b7eb466d5b09bd4bf1658b3d2bbd5b8b2d121dfe3fce8039a7e
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.414325+00:00.
Case digest / 14552ad04f93c7930cb0e2e53ff58f1d83aed55cfe7c183ed8b20ce619ecb9b8