FAILURE MAP
← Case archive

FA-88691 / Mesh topology invariants / Open access

Kill-edge-make-ring removes a loop instead of adding one · case 01

Creating an inner ring breaks the Euler-Poincare relation.

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

ROOT CAUSE

The kemr delta decrements L.

THE FAILURE

The kemr delta decrements L.

Unsuccessful approach: Adding the edge back while adding the loop describes mekr inverted.

Case contract

Input: list of Euler operator names applied to counts [V,E,F,L,S,G] starting at zero. Deltas: mvfs(+V,+F,+L,+S), mev(+V,+E), mef(+E,+F,+L), kemr(-E,+L), mekr(+E,-L), kfmrh(-F,+G) and their inverses kvfs, kev, kef, mfkrh. After each op: an unknown name returns ["unknown", i]; a negative count or fewer loops than faces returns ["invalid", i]; a violated Euler-Poincare relation V-E+F-(L-F)=2(S-G) returns ["broken-invariant", i]. Return the final counts.

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):
    ops=x
    V=E=Fc=L=S=G=0
    D={'mvfs':(1,0,1,1,1,0),'kvfs':(-1,0,-1,-1,-1,0),'mev':(1,1,0,0,0,0),'kev':(-1,-1,0,0,0,0),
       'mef':(0,1,1,1,0,0),'kef':(0,-1,-1,-1,0,0),'kemr':(0,-1,0,-1,0,0),'mekr':(0,1,0,-1,0,0),
       'kfmrh':(0,0,-1,0,0,1),'mfkrh':(0,0,1,0,0,-1)}
    for i,op in enumerate(ops):
        if op not in D: return ['unknown',i]
        d=D[op]
        V,E,Fc,L,S,G=V+d[0],E+d[1],Fc+d[2],L+d[3],S+d[4],G+d[5]
        if min(V,E,Fc,L,S,G)<0 or L<Fc: return ['invalid',i]
        if V-E+Fc-(L-Fc)!=2*(S-G): return ['broken-invariant',i]
    return [V,E,Fc,L,S,G]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['triangle lamina', [['mvfs', 'mev', 'mev', 'mef']], [3, 3, 2, 2, 1, 0]], ['tetrahedron', [['mvfs', 'mev', 'mev', 'mef', 'mev', 'mef', 'mef']], [4, 6, 4, 4, 1, 0]], ['square with hole ring', [['mvfs', 'mev', 'mev', 'mev', 'mef', 'mev', 'mev', 'mev', 'mef', 'kemr']], [7, 7, 3, 4, 1, 0]], ['torus handle', [['mvfs', 'mev', 'mev', 'mev', 'mef', 'mev', 'mev', 'mev', 'mef', 'kemr', 'kfmrh']], [7, 7, 2, 4, 1, 1]], ['undo handle', [['mvfs', 'mev', 'mev', 'mev', 'mef', 'mev', 'mev', 'mev', 'mef', 'kemr', 'kfmrh', 'mfkrh']], [7, 7, 3, 4, 1, 0]], ['ring then remake edge', [['mvfs', 'mev', 'mev', 'mef', 'mev', 'kemr', 'mekr']], [4, 4, 2, 2, 1, 0]], ['kill edge on empty', [['mvfs', 'kev']], ['invalid', 1]]], [['torus handle', [['mvfs', 'mev', 'mev', 'mev', 'mef', 'mev', 'mev', 'mev', 'mef', 'kemr', 'kfmrh']], [7, 7, 2, 4, 1, 1]], ['undo handle', [['mvfs', 'mev', 'mev', 'mev', 'mef', 'mev', 'mev', 'mev', 'mef', 'kemr', 'kfmrh', 'mfkrh']], [7, 7, 3, 4, 1, 0]], ['ring then remake edge', [['mvfs', 'mev', 'mev', 'mef', 'mev', 'kemr', 'mekr']], [4, 4, 2, 2, 1, 0]], ['kill edge on empty', [['mvfs', 'kev']], ['invalid', 1]], ['unknown op', [['mvfs', 'mev', 'split']], ['unknown', 2]], ['uppercase op', [['mvfs', 'MEV']], ['unknown', 1]], ['loop deficit', [['mvfs', 'mev', 'mekr']], ['invalid', 2]]], [['undo handle', [['mvfs', 'mev', 'mev', 'mev', 'mef', 'mev', 'mev', 'mev', 'mef', 'kemr', 'kfmrh', 'mfkrh']], [7, 7, 3, 4, 1, 0]], ['unknown op', [['mvfs', 'mev', 'split']], ['unknown', 2]], ['uppercase op', [['mvfs', 'MEV']], ['unknown', 1]], ['loop deficit', [['mvfs', 'mev', 'mekr']], ['invalid', 2]], ['two shells', [['mvfs', 'mev', 'mvfs', 'mev', 'mev', 'mef']], [5, 4, 3, 3, 2, 0]], ['face without loop', [['mvfs', 'mfkrh']], ['invalid', 1]], ['build and kill', [['mvfs', 'mev', 'mev', 'mef', 'kef', 'kev', 'kev', 'kvfs']], [0, 0, 0, 0, 0, 0]]], [['triangle lamina', [['mvfs', 'mev', 'mev', 'mef']], [3, 3, 2, 2, 1, 0]], ['tetrahedron', [['mvfs', 'mev', 'mev', 'mef', 'mev', 'mef', 'mef']], [4, 6, 4, 4, 1, 0]], ['ring then remake edge', [['mvfs', 'mev', 'mev', 'mef', 'mev', 'kemr', 'mekr']], [4, 4, 2, 2, 1, 0]], ['two shells', [['mvfs', 'mev', 'mvfs', 'mev', 'mev', 'mef']], [5, 4, 3, 3, 2, 0]], ['face without loop', [['mvfs', 'mfkrh']], ['invalid', 1]], ['build and kill', [['mvfs', 'mev', 'mev', 'mef', 'kef', 'kev', 'kev', 'kvfs']], [0, 0, 0, 0, 0, 0]], ['hole into lamina', [['mvfs', 'mev', 'mev', 'mef', 'mev', 'mev', 'mev', 'mef', 'kemr', 'kfmrh', 'mev']], [7, 7, 2, 4, 1, 1]]], [['triangle lamina', [['mvfs', 'mev', 'mev', 'mef']], [3, 3, 2, 2, 1, 0]], ['tetrahedron', [['mvfs', 'mev', 'mev', 'mef', 'mev', 'mef', 'mef']], [4, 6, 4, 4, 1, 0]], ['square with hole ring', [['mvfs', 'mev', 'mev', 'mev', 'mef', 'mev', 'mev', 'mev', 'mef', 'kemr']], [7, 7, 3, 4, 1, 0]], ['torus handle', [['mvfs', 'mev', 'mev', 'mev', 'mef', 'mev', 'mev', 'mev', 'mef', 'kemr', 'kfmrh']], [7, 7, 2, 4, 1, 1]], ['undo handle', [['mvfs', 'mev', 'mev', 'mev', 'mef', 'mev', 'mev', 'mev', 'mef', 'kemr', 'kfmrh', 'mfkrh']], [7, 7, 3, 4, 1, 0]], ['build and kill', [['mvfs', 'mev', 'mev', 'mef', 'kef', 'kev', 'kev', 'kvfs']], [0, 0, 0, 0, 0, 0]], ['hole into lamina', [['mvfs', 'mev', 'mev', 'mef', 'mev', 'mev', 'mev', 'mef', 'kemr', 'kfmrh', 'mev']], [7, 7, 2, 4, 1, 1]]]]
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
triangle lamina[3, 3, 2, 2, 1, 0][3, 3, 2, 2, 1, 0]Passed
tetrahedron[4, 6, 4, 4, 1, 0][4, 6, 4, 4, 1, 0]Passed
square with hole ring['invalid', 9][7, 7, 3, 4, 1, 0]Failed
torus handle['invalid', 9][7, 7, 2, 4, 1, 1]Failed
undo handle['invalid', 9][7, 7, 3, 4, 1, 0]Failed
ring then remake edge['invalid', 5][4, 4, 2, 2, 1, 0]Failed
kill edge on empty['invalid', 1]['invalid', 1]Passed

SHA-256 / f43e21818209cfda079cce863ed2e7a4040f1b67af14970483d928d2a79cde40

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(x):
    ops=x
    V=E=Fc=L=S=G=0
    D={'mvfs':(1,0,1,1,1,0),'kvfs':(-1,0,-1,-1,-1,0),'mev':(1,1,0,0,0,0),'kev':(-1,-1,0,0,0,0),
       'mef':(0,1,1,1,0,0),'kef':(0,-1,-1,-1,0,0),'kemr':(0,1,0,1,0,0),'mekr':(0,1,0,-1,0,0),
       'kfmrh':(0,0,-1,0,0,1),'mfkrh':(0,0,1,0,0,-1)}
    for i,op in enumerate(ops):
        if op not in D: return ['unknown',i]
        d=D[op]
        V,E,Fc,L,S,G=V+d[0],E+d[1],Fc+d[2],L+d[3],S+d[4],G+d[5]
        if min(V,E,Fc,L,S,G)<0 or L<Fc: return ['invalid',i]
        if V-E+Fc-(L-Fc)!=2*(S-G): return ['broken-invariant',i]
    return [V,E,Fc,L,S,G]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['triangle lamina', [['mvfs', 'mev', 'mev', 'mef']], [3, 3, 2, 2, 1, 0]], ['tetrahedron', [['mvfs', 'mev', 'mev', 'mef', 'mev', 'mef', 'mef']], [4, 6, 4, 4, 1, 0]], ['square with hole ring', [['mvfs', 'mev', 'mev', 'mev', 'mef', 'mev', 'mev', 'mev', 'mef', 'kemr']], [7, 7, 3, 4, 1, 0]], ['torus handle', [['mvfs', 'mev', 'mev', 'mev', 'mef', 'mev', 'mev', 'mev', 'mef', 'kemr', 'kfmrh']], [7, 7, 2, 4, 1, 1]], ['undo handle', [['mvfs', 'mev', 'mev', 'mev', 'mef', 'mev', 'mev', 'mev', 'mef', 'kemr', 'kfmrh', 'mfkrh']], [7, 7, 3, 4, 1, 0]], ['ring then remake edge', [['mvfs', 'mev', 'mev', 'mef', 'mev', 'kemr', 'mekr']], [4, 4, 2, 2, 1, 0]], ['kill edge on empty', [['mvfs', 'kev']], ['invalid', 1]]], [['torus handle', [['mvfs', 'mev', 'mev', 'mev', 'mef', 'mev', 'mev', 'mev', 'mef', 'kemr', 'kfmrh']], [7, 7, 2, 4, 1, 1]], ['undo handle', [['mvfs', 'mev', 'mev', 'mev', 'mef', 'mev', 'mev', 'mev', 'mef', 'kemr', 'kfmrh', 'mfkrh']], [7, 7, 3, 4, 1, 0]], ['ring then remake edge', [['mvfs', 'mev', 'mev', 'mef', 'mev', 'kemr', 'mekr']], [4, 4, 2, 2, 1, 0]], ['kill edge on empty', [['mvfs', 'kev']], ['invalid', 1]], ['unknown op', [['mvfs', 'mev', 'split']], ['unknown', 2]], ['uppercase op', [['mvfs', 'MEV']], ['unknown', 1]], ['loop deficit', [['mvfs', 'mev', 'mekr']], ['invalid', 2]]], [['undo handle', [['mvfs', 'mev', 'mev', 'mev', 'mef', 'mev', 'mev', 'mev', 'mef', 'kemr', 'kfmrh', 'mfkrh']], [7, 7, 3, 4, 1, 0]], ['unknown op', [['mvfs', 'mev', 'split']], ['unknown', 2]], ['uppercase op', [['mvfs', 'MEV']], ['unknown', 1]], ['loop deficit', [['mvfs', 'mev', 'mekr']], ['invalid', 2]], ['two shells', [['mvfs', 'mev', 'mvfs', 'mev', 'mev', 'mef']], [5, 4, 3, 3, 2, 0]], ['face without loop', [['mvfs', 'mfkrh']], ['invalid', 1]], ['build and kill', [['mvfs', 'mev', 'mev', 'mef', 'kef', 'kev', 'kev', 'kvfs']], [0, 0, 0, 0, 0, 0]]], [['triangle lamina', [['mvfs', 'mev', 'mev', 'mef']], [3, 3, 2, 2, 1, 0]], ['tetrahedron', [['mvfs', 'mev', 'mev', 'mef', 'mev', 'mef', 'mef']], [4, 6, 4, 4, 1, 0]], ['ring then remake edge', [['mvfs', 'mev', 'mev', 'mef', 'mev', 'kemr', 'mekr']], [4, 4, 2, 2, 1, 0]], ['two shells', [['mvfs', 'mev', 'mvfs', 'mev', 'mev', 'mef']], [5, 4, 3, 3, 2, 0]], ['face without loop', [['mvfs', 'mfkrh']], ['invalid', 1]], ['build and kill', [['mvfs', 'mev', 'mev', 'mef', 'kef', 'kev', 'kev', 'kvfs']], [0, 0, 0, 0, 0, 0]], ['hole into lamina', [['mvfs', 'mev', 'mev', 'mef', 'mev', 'mev', 'mev', 'mef', 'kemr', 'kfmrh', 'mev']], [7, 7, 2, 4, 1, 1]]], [['triangle lamina', [['mvfs', 'mev', 'mev', 'mef']], [3, 3, 2, 2, 1, 0]], ['tetrahedron', [['mvfs', 'mev', 'mev', 'mef', 'mev', 'mef', 'mef']], [4, 6, 4, 4, 1, 0]], ['square with hole ring', [['mvfs', 'mev', 'mev', 'mev', 'mef', 'mev', 'mev', 'mev', 'mef', 'kemr']], [7, 7, 3, 4, 1, 0]], ['torus handle', [['mvfs', 'mev', 'mev', 'mev', 'mef', 'mev', 'mev', 'mev', 'mef', 'kemr', 'kfmrh']], [7, 7, 2, 4, 1, 1]], ['undo handle', [['mvfs', 'mev', 'mev', 'mev', 'mef', 'mev', 'mev', 'mev', 'mef', 'kemr', 'kfmrh', 'mfkrh']], [7, 7, 3, 4, 1, 0]], ['build and kill', [['mvfs', 'mev', 'mev', 'mef', 'kef', 'kev', 'kev', 'kvfs']], [0, 0, 0, 0, 0, 0]], ['hole into lamina', [['mvfs', 'mev', 'mev', 'mef', 'mev', 'mev', 'mev', 'mef', 'kemr', 'kfmrh', 'mev']], [7, 7, 2, 4, 1, 1]]]]
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
triangle lamina[3, 3, 2, 2, 1, 0][3, 3, 2, 2, 1, 0]Passed
tetrahedron[4, 6, 4, 4, 1, 0][4, 6, 4, 4, 1, 0]Passed
square with hole ring['broken-invariant', 9][7, 7, 3, 4, 1, 0]Failed
torus handle['broken-invariant', 9][7, 7, 2, 4, 1, 1]Failed
undo handle['broken-invariant', 9][7, 7, 3, 4, 1, 0]Failed
ring then remake edge['broken-invariant', 5][4, 4, 2, 2, 1, 0]Failed
kill edge on empty['invalid', 1]['invalid', 1]Passed

SHA-256 / c43cc7f991b120a2d4b59bb1eb7de63ab9de79729217358bbebdbcd367005a15

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 7 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

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

Case digest / 3765beff1b13ca54f9154866538d41c89f33e917730f3ee9d4273bfb4527672e