{"abstract":"Non-manifold fins are counted as boundary loops.","category":"Mesh topology invariants","checks":7,"contract":"Input: list of polygon faces (vertex index lists). V counts referenced vertices, E distinct undirected edges (closing edge included), F faces, chi=V-E+F, C connected components (via edges), B boundary loops = components of the graph of edges used by exactly one face. Return [V,E,F,chi,C,B,genus] with genus=(2C-chi-B)/2 or null when that numerator is odd (non-orientable signal).","evaluation_group":"w2-mesh_topology_invariants-euler-genus","failed_approach":"Using odd incidence still treats three-face edges as boundary.","family":"w2-mesh_topology_invariants-euler-genus-boundary-edge-incidence","id":"FA-88356","implementations":{"attempt":{"sha256":"d37f2edc9d95f33155ff8f6d1115cf83729c89e5a11fb5c1d2539e8b8edf1e02","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(x):\n    faces=x\n    edges={}\n    for f in faces:\n        n=len(f)\n        for i in range(n):\n            a,b=f[i],f[(i+1)%n]\n            k=(min(a,b),max(a,b))\n            edges[k]=edges.get(k,0)+1\n    verts=sorted({v for f in faces for v in f})\n    V=len(verts)\n    E=len(edges)\n    Fc=len(faces)\n    chi=V-E+Fc\n    parent={v:v for v in verts}\n    def find(v):\n        while parent[v]!=v:\n            v=parent[v]\n        return v\n    for a,b in edges:\n        ra,rb=find(a),find(b)\n        if ra!=rb: parent[ra]=rb\n    comps=len({find(v) for v in verts})\n    bpar={}\n    def bfind(v):\n        while bpar[v]!=v:\n            v=bpar[v]\n        return v\n    for (a,b),c in edges.items():\n        if c%2==1:\n            bpar.setdefault(a,a)\n            bpar.setdefault(b,b)\n            ra,rb=bfind(a),bfind(b)\n            if ra!=rb: bpar[ra]=rb\n    loops=len({bfind(v) for v in bpar})\n    g=2*comps-chi-loops\n    genus=None if g%2 else g//2\n    return [V,E,Fc,chi,comps,loops,genus]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['tetrahedron', [[[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2]]], [4, 6, 4, 2, 1, 0, 0]], ['cube quads', [[[0, 3, 2, 1], [4, 5, 6, 7], [0, 1, 5, 4], [1, 2, 6, 5], [2, 3, 7, 6], [3, 0, 4, 7]]], [8, 12, 6, 2, 1, 0, 0]], ['octahedron', [[[0, 1, 2], [0, 2, 3], [0, 3, 4], [0, 4, 1], [5, 2, 1], [5, 3, 2], [5, 4, 3], [5, 1, 4]]], [6, 12, 8, 2, 1, 0, 0]], ['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]]], [9, 18, 9, 0, 1, 0, 1]], ['triangle torus', [[[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, 27, 18, 0, 1, 0, 1]], ['disk fan', [[[0, 1, 2], [0, 2, 3], [0, 3, 4], [0, 4, 5], [0, 5, 1]]], [6, 10, 5, 1, 1, 1, 0]], ['tetrahedra sharing a face', [[[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2], [0, 1, 4], [1, 2, 4], [0, 4, 2]]], [5, 9, 7, 3, 1, 0, None]]], [['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]]], [9, 18, 9, 0, 1, 0, 1]], ['triangle torus', [[[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, 27, 18, 0, 1, 0, 1]], ['disk fan', [[[0, 1, 2], [0, 2, 3], [0, 3, 4], [0, 4, 5], [0, 5, 1]]], [6, 10, 5, 1, 1, 1, 0]], ['quad annulus', [[[0, 3, 4, 1], [1, 4, 5, 2], [2, 5, 3, 0]]], [6, 9, 3, 0, 1, 2, 0]], ['mobius strip', [[[0, 3, 4, 1], [1, 4, 5, 2], [2, 5, 0, 3]]], [6, 9, 3, 0, 1, 1, None]], ['projective plane', [[[0, 1, 2], [0, 2, 3], [0, 3, 4], [0, 4, 5], [0, 5, 1], [1, 2, 4], [2, 3, 5], [3, 4, 1], [4, 5, 2], [5, 1, 3]]], [6, 15, 10, 1, 1, 0, None]], ['tetrahedra sharing a face', [[[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2], [0, 1, 4], [1, 2, 4], [0, 4, 2]]], [5, 9, 7, 3, 1, 0, None]]], [['quad annulus', [[[0, 3, 4, 1], [1, 4, 5, 2], [2, 5, 3, 0]]], [6, 9, 3, 0, 1, 2, 0]], ['mobius strip', [[[0, 3, 4, 1], [1, 4, 5, 2], [2, 5, 0, 3]]], [6, 9, 3, 0, 1, 1, None]], ['projective plane', [[[0, 1, 2], [0, 2, 3], [0, 3, 4], [0, 4, 5], [0, 5, 1], [1, 2, 4], [2, 3, 5], [3, 4, 1], [4, 5, 2], [5, 1, 3]]], [6, 15, 10, 1, 1, 0, None]], ['two tetrahedra', [[[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2], [4, 6, 5], [4, 5, 7], [5, 6, 7], [4, 7, 6]]], [8, 12, 8, 4, 2, 0, 0]], ['gapped indices', [[[0, 1, 5], [1, 7, 5]]], [4, 5, 2, 1, 1, 1, 0]], ['open cylinder', [[[0, 1, 5], [0, 5, 4], [1, 2, 6], [1, 6, 5], [2, 3, 7], [2, 7, 6], [3, 0, 4], [3, 4, 7]]], [8, 16, 8, 0, 1, 2, 0]], ['tetrahedra sharing a face', [[[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2], [0, 1, 4], [1, 2, 4], [0, 4, 2]]], [5, 9, 7, 3, 1, 0, None]]], [['two tetrahedra', [[[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2], [4, 6, 5], [4, 5, 7], [5, 6, 7], [4, 7, 6]]], [8, 12, 8, 4, 2, 0, 0]], ['gapped indices', [[[0, 1, 5], [1, 7, 5]]], [4, 5, 2, 1, 1, 1, 0]], ['open cylinder', [[[0, 1, 5], [0, 5, 4], [1, 2, 6], [1, 6, 5], [2, 3, 7], [2, 7, 6], [3, 0, 4], [3, 4, 7]]], [8, 16, 8, 0, 1, 2, 0]], ['book of three pages', [[[0, 1, 2], [1, 0, 3], [0, 1, 4]]], [5, 7, 3, 1, 1, 1, 0]], ['quad grid', [[[0, 1, 4, 3], [1, 2, 5, 4], [3, 4, 7, 6], [4, 5, 8, 7]]], [9, 12, 4, 1, 1, 1, 0]], ['mixed quad and triangle', [[[0, 1, 2, 3], [3, 2, 4]]], [5, 6, 2, 1, 1, 1, 0]], ['tetrahedra sharing a face', [[[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2], [0, 1, 4], [1, 2, 4], [0, 4, 2]]], [5, 9, 7, 3, 1, 0, None]]], [['tetrahedron', [[[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2]]], [4, 6, 4, 2, 1, 0, 0]], ['cube quads', [[[0, 3, 2, 1], [4, 5, 6, 7], [0, 1, 5, 4], [1, 2, 6, 5], [2, 3, 7, 6], [3, 0, 4, 7]]], [8, 12, 6, 2, 1, 0, 0]], ['book of three pages', [[[0, 1, 2], [1, 0, 3], [0, 1, 4]]], [5, 7, 3, 1, 1, 1, 0]], ['quad grid', [[[0, 1, 4, 3], [1, 2, 5, 4], [3, 4, 7, 6], [4, 5, 8, 7]]], [9, 12, 4, 1, 1, 1, 0]], ['mixed quad and triangle', [[[0, 1, 2, 3], [3, 2, 4]]], [5, 6, 2, 1, 1, 1, 0]], ['tetra plus disk', [[[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2], [10, 11, 12], [10, 12, 13], [10, 13, 14], [10, 14, 15], [10, 15, 11]]], [10, 16, 9, 3, 2, 1, 0]], ['tetrahedra sharing a face', [[[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2], [0, 1, 4], [1, 2, 4], [0, 4, 2]]], [5, 9, 7, 3, 1, 0, None]]]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"bad96ca59f229e57758d6723595f94f0d55673c7cc948c278128f08e67743de1","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(x):\n    faces=x\n    edges={}\n    for f in faces:\n        n=len(f)\n        for i in range(n):\n            a,b=f[i],f[(i+1)%n]\n            k=(min(a,b),max(a,b))\n            edges[k]=edges.get(k,0)+1\n    verts=sorted({v for f in faces for v in f})\n    V=len(verts)\n    E=len(edges)\n    Fc=len(faces)\n    chi=V-E+Fc\n    parent={v:v for v in verts}\n    def find(v):\n        while parent[v]!=v:\n            v=parent[v]\n        return v\n    for a,b in edges:\n        ra,rb=find(a),find(b)\n        if ra!=rb: parent[ra]=rb\n    comps=len({find(v) for v in verts})\n    bpar={}\n    def bfind(v):\n        while bpar[v]!=v:\n            v=bpar[v]\n        return v\n    for (a,b),c in edges.items():\n        if c!=2:\n            bpar.setdefault(a,a)\n            bpar.setdefault(b,b)\n            ra,rb=bfind(a),bfind(b)\n            if ra!=rb: bpar[ra]=rb\n    loops=len({bfind(v) for v in bpar})\n    g=2*comps-chi-loops\n    genus=None if g%2 else g//2\n    return [V,E,Fc,chi,comps,loops,genus]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['tetrahedron', [[[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2]]], [4, 6, 4, 2, 1, 0, 0]], ['cube quads', [[[0, 3, 2, 1], [4, 5, 6, 7], [0, 1, 5, 4], [1, 2, 6, 5], [2, 3, 7, 6], [3, 0, 4, 7]]], [8, 12, 6, 2, 1, 0, 0]], ['octahedron', [[[0, 1, 2], [0, 2, 3], [0, 3, 4], [0, 4, 1], [5, 2, 1], [5, 3, 2], [5, 4, 3], [5, 1, 4]]], [6, 12, 8, 2, 1, 0, 0]], ['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]]], [9, 18, 9, 0, 1, 0, 1]], ['triangle torus', [[[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, 27, 18, 0, 1, 0, 1]], ['disk fan', [[[0, 1, 2], [0, 2, 3], [0, 3, 4], [0, 4, 5], [0, 5, 1]]], [6, 10, 5, 1, 1, 1, 0]], ['tetrahedra sharing a face', [[[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2], [0, 1, 4], [1, 2, 4], [0, 4, 2]]], [5, 9, 7, 3, 1, 0, None]]], [['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]]], [9, 18, 9, 0, 1, 0, 1]], ['triangle torus', [[[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, 27, 18, 0, 1, 0, 1]], ['disk fan', [[[0, 1, 2], [0, 2, 3], [0, 3, 4], [0, 4, 5], [0, 5, 1]]], [6, 10, 5, 1, 1, 1, 0]], ['quad annulus', [[[0, 3, 4, 1], [1, 4, 5, 2], [2, 5, 3, 0]]], [6, 9, 3, 0, 1, 2, 0]], ['mobius strip', [[[0, 3, 4, 1], [1, 4, 5, 2], [2, 5, 0, 3]]], [6, 9, 3, 0, 1, 1, None]], ['projective plane', [[[0, 1, 2], [0, 2, 3], [0, 3, 4], [0, 4, 5], [0, 5, 1], [1, 2, 4], [2, 3, 5], [3, 4, 1], [4, 5, 2], [5, 1, 3]]], [6, 15, 10, 1, 1, 0, None]], ['tetrahedra sharing a face', [[[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2], [0, 1, 4], [1, 2, 4], [0, 4, 2]]], [5, 9, 7, 3, 1, 0, None]]], [['quad annulus', [[[0, 3, 4, 1], [1, 4, 5, 2], [2, 5, 3, 0]]], [6, 9, 3, 0, 1, 2, 0]], ['mobius strip', [[[0, 3, 4, 1], [1, 4, 5, 2], [2, 5, 0, 3]]], [6, 9, 3, 0, 1, 1, None]], ['projective plane', [[[0, 1, 2], [0, 2, 3], [0, 3, 4], [0, 4, 5], [0, 5, 1], [1, 2, 4], [2, 3, 5], [3, 4, 1], [4, 5, 2], [5, 1, 3]]], [6, 15, 10, 1, 1, 0, None]], ['two tetrahedra', [[[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2], [4, 6, 5], [4, 5, 7], [5, 6, 7], [4, 7, 6]]], [8, 12, 8, 4, 2, 0, 0]], ['gapped indices', [[[0, 1, 5], [1, 7, 5]]], [4, 5, 2, 1, 1, 1, 0]], ['open cylinder', [[[0, 1, 5], [0, 5, 4], [1, 2, 6], [1, 6, 5], [2, 3, 7], [2, 7, 6], [3, 0, 4], [3, 4, 7]]], [8, 16, 8, 0, 1, 2, 0]], ['tetrahedra sharing a face', [[[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2], [0, 1, 4], [1, 2, 4], [0, 4, 2]]], [5, 9, 7, 3, 1, 0, None]]], [['two tetrahedra', [[[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2], [4, 6, 5], [4, 5, 7], [5, 6, 7], [4, 7, 6]]], [8, 12, 8, 4, 2, 0, 0]], ['gapped indices', [[[0, 1, 5], [1, 7, 5]]], [4, 5, 2, 1, 1, 1, 0]], ['open cylinder', [[[0, 1, 5], [0, 5, 4], [1, 2, 6], [1, 6, 5], [2, 3, 7], [2, 7, 6], [3, 0, 4], [3, 4, 7]]], [8, 16, 8, 0, 1, 2, 0]], ['book of three pages', [[[0, 1, 2], [1, 0, 3], [0, 1, 4]]], [5, 7, 3, 1, 1, 1, 0]], ['quad grid', [[[0, 1, 4, 3], [1, 2, 5, 4], [3, 4, 7, 6], [4, 5, 8, 7]]], [9, 12, 4, 1, 1, 1, 0]], ['mixed quad and triangle', [[[0, 1, 2, 3], [3, 2, 4]]], [5, 6, 2, 1, 1, 1, 0]], ['tetrahedra sharing a face', [[[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2], [0, 1, 4], [1, 2, 4], [0, 4, 2]]], [5, 9, 7, 3, 1, 0, None]]], [['tetrahedron', [[[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2]]], [4, 6, 4, 2, 1, 0, 0]], ['cube quads', [[[0, 3, 2, 1], [4, 5, 6, 7], [0, 1, 5, 4], [1, 2, 6, 5], [2, 3, 7, 6], [3, 0, 4, 7]]], [8, 12, 6, 2, 1, 0, 0]], ['book of three pages', [[[0, 1, 2], [1, 0, 3], [0, 1, 4]]], [5, 7, 3, 1, 1, 1, 0]], ['quad grid', [[[0, 1, 4, 3], [1, 2, 5, 4], [3, 4, 7, 6], [4, 5, 8, 7]]], [9, 12, 4, 1, 1, 1, 0]], ['mixed quad and triangle', [[[0, 1, 2, 3], [3, 2, 4]]], [5, 6, 2, 1, 1, 1, 0]], ['tetra plus disk', [[[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2], [10, 11, 12], [10, 12, 13], [10, 13, 14], [10, 14, 15], [10, 15, 11]]], [10, 16, 9, 3, 2, 1, 0]], ['tetrahedra sharing a face', [[[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2], [0, 1, 4], [1, 2, 4], [0, 4, 2]]], [5, 9, 7, 3, 1, 0, None]]]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"fixed":{"sha256":"0385236f776c486b8d6d570b4399c05915cef67b698844cdfa30eb010bc452bb","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(x):\n    faces=x\n    edges={}\n    for f in faces:\n        n=len(f)\n        for i in range(n):\n            a,b=f[i],f[(i+1)%n]\n            k=(min(a,b),max(a,b))\n            edges[k]=edges.get(k,0)+1\n    verts=sorted({v for f in faces for v in f})\n    V=len(verts)\n    E=len(edges)\n    Fc=len(faces)\n    chi=V-E+Fc\n    parent={v:v for v in verts}\n    def find(v):\n        while parent[v]!=v:\n            v=parent[v]\n        return v\n    for a,b in edges:\n        ra,rb=find(a),find(b)\n        if ra!=rb: parent[ra]=rb\n    comps=len({find(v) for v in verts})\n    bpar={}\n    def bfind(v):\n        while bpar[v]!=v:\n            v=bpar[v]\n        return v\n    for (a,b),c in edges.items():\n        if c==1:\n            bpar.setdefault(a,a)\n            bpar.setdefault(b,b)\n            ra,rb=bfind(a),bfind(b)\n            if ra!=rb: bpar[ra]=rb\n    loops=len({bfind(v) for v in bpar})\n    g=2*comps-chi-loops\n    genus=None if g%2 else g//2\n    return [V,E,Fc,chi,comps,loops,genus]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['tetrahedron', [[[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2]]], [4, 6, 4, 2, 1, 0, 0]], ['cube quads', [[[0, 3, 2, 1], [4, 5, 6, 7], [0, 1, 5, 4], [1, 2, 6, 5], [2, 3, 7, 6], [3, 0, 4, 7]]], [8, 12, 6, 2, 1, 0, 0]], ['octahedron', [[[0, 1, 2], [0, 2, 3], [0, 3, 4], [0, 4, 1], [5, 2, 1], [5, 3, 2], [5, 4, 3], [5, 1, 4]]], [6, 12, 8, 2, 1, 0, 0]], ['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]]], [9, 18, 9, 0, 1, 0, 1]], ['triangle torus', [[[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, 27, 18, 0, 1, 0, 1]], ['disk fan', [[[0, 1, 2], [0, 2, 3], [0, 3, 4], [0, 4, 5], [0, 5, 1]]], [6, 10, 5, 1, 1, 1, 0]], ['tetrahedra sharing a face', [[[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2], [0, 1, 4], [1, 2, 4], [0, 4, 2]]], [5, 9, 7, 3, 1, 0, None]]], [['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]]], [9, 18, 9, 0, 1, 0, 1]], ['triangle torus', [[[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, 27, 18, 0, 1, 0, 1]], ['disk fan', [[[0, 1, 2], [0, 2, 3], [0, 3, 4], [0, 4, 5], [0, 5, 1]]], [6, 10, 5, 1, 1, 1, 0]], ['quad annulus', [[[0, 3, 4, 1], [1, 4, 5, 2], [2, 5, 3, 0]]], [6, 9, 3, 0, 1, 2, 0]], ['mobius strip', [[[0, 3, 4, 1], [1, 4, 5, 2], [2, 5, 0, 3]]], [6, 9, 3, 0, 1, 1, None]], ['projective plane', [[[0, 1, 2], [0, 2, 3], [0, 3, 4], [0, 4, 5], [0, 5, 1], [1, 2, 4], [2, 3, 5], [3, 4, 1], [4, 5, 2], [5, 1, 3]]], [6, 15, 10, 1, 1, 0, None]], ['tetrahedra sharing a face', [[[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2], [0, 1, 4], [1, 2, 4], [0, 4, 2]]], [5, 9, 7, 3, 1, 0, None]]], [['quad annulus', [[[0, 3, 4, 1], [1, 4, 5, 2], [2, 5, 3, 0]]], [6, 9, 3, 0, 1, 2, 0]], ['mobius strip', [[[0, 3, 4, 1], [1, 4, 5, 2], [2, 5, 0, 3]]], [6, 9, 3, 0, 1, 1, None]], ['projective plane', [[[0, 1, 2], [0, 2, 3], [0, 3, 4], [0, 4, 5], [0, 5, 1], [1, 2, 4], [2, 3, 5], [3, 4, 1], [4, 5, 2], [5, 1, 3]]], [6, 15, 10, 1, 1, 0, None]], ['two tetrahedra', [[[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2], [4, 6, 5], [4, 5, 7], [5, 6, 7], [4, 7, 6]]], [8, 12, 8, 4, 2, 0, 0]], ['gapped indices', [[[0, 1, 5], [1, 7, 5]]], [4, 5, 2, 1, 1, 1, 0]], ['open cylinder', [[[0, 1, 5], [0, 5, 4], [1, 2, 6], [1, 6, 5], [2, 3, 7], [2, 7, 6], [3, 0, 4], [3, 4, 7]]], [8, 16, 8, 0, 1, 2, 0]], ['tetrahedra sharing a face', [[[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2], [0, 1, 4], [1, 2, 4], [0, 4, 2]]], [5, 9, 7, 3, 1, 0, None]]], [['two tetrahedra', [[[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2], [4, 6, 5], [4, 5, 7], [5, 6, 7], [4, 7, 6]]], [8, 12, 8, 4, 2, 0, 0]], ['gapped indices', [[[0, 1, 5], [1, 7, 5]]], [4, 5, 2, 1, 1, 1, 0]], ['open cylinder', [[[0, 1, 5], [0, 5, 4], [1, 2, 6], [1, 6, 5], [2, 3, 7], [2, 7, 6], [3, 0, 4], [3, 4, 7]]], [8, 16, 8, 0, 1, 2, 0]], ['book of three pages', [[[0, 1, 2], [1, 0, 3], [0, 1, 4]]], [5, 7, 3, 1, 1, 1, 0]], ['quad grid', [[[0, 1, 4, 3], [1, 2, 5, 4], [3, 4, 7, 6], [4, 5, 8, 7]]], [9, 12, 4, 1, 1, 1, 0]], ['mixed quad and triangle', [[[0, 1, 2, 3], [3, 2, 4]]], [5, 6, 2, 1, 1, 1, 0]], ['tetrahedra sharing a face', [[[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2], [0, 1, 4], [1, 2, 4], [0, 4, 2]]], [5, 9, 7, 3, 1, 0, None]]], [['tetrahedron', [[[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2]]], [4, 6, 4, 2, 1, 0, 0]], ['cube quads', [[[0, 3, 2, 1], [4, 5, 6, 7], [0, 1, 5, 4], [1, 2, 6, 5], [2, 3, 7, 6], [3, 0, 4, 7]]], [8, 12, 6, 2, 1, 0, 0]], ['book of three pages', [[[0, 1, 2], [1, 0, 3], [0, 1, 4]]], [5, 7, 3, 1, 1, 1, 0]], ['quad grid', [[[0, 1, 4, 3], [1, 2, 5, 4], [3, 4, 7, 6], [4, 5, 8, 7]]], [9, 12, 4, 1, 1, 1, 0]], ['mixed quad and triangle', [[[0, 1, 2, 3], [3, 2, 4]]], [5, 6, 2, 1, 1, 1, 0]], ['tetra plus disk', [[[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2], [10, 11, 12], [10, 12, 13], [10, 13, 14], [10, 14, 15], [10, 15, 11]]], [10, 16, 9, 3, 2, 1, 0]], ['tetrahedra sharing a face', [[[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2], [0, 1, 4], [1, 2, 4], [0, 4, 2]]], [5, 9, 7, 3, 1, 0, None]]]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w2-mesh_topology_invariants-euler-genus-boundary-edge-incidence","generated_at":"2026-09-29T14:51:07.472355+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"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.","repair":"Only edges used by exactly one face are boundary.","root_cause":"An edge is treated as boundary whenever its use count is not exactly 2.","sha256":"100ef65b3e9a44072a1e76dab9c07f1451be061a2a9314d266bc83753f93b9c2","title":"Boundary loops include edges shared by three faces · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":41.961,"exit_code":1,"observations":[{"actual":[4,6,4,2,1,0,0],"check":"tetrahedron","expected":[4,6,4,2,1,0,0],"passed":true},{"actual":[8,12,6,2,1,0,0],"check":"cube quads","expected":[8,12,6,2,1,0,0],"passed":true},{"actual":[6,12,8,2,1,0,0],"check":"octahedron","expected":[6,12,8,2,1,0,0],"passed":true},{"actual":[9,18,9,0,1,0,1],"check":"quad torus","expected":[9,18,9,0,1,0,1],"passed":true},{"actual":[9,27,18,0,1,0,1],"check":"triangle torus","expected":[9,27,18,0,1,0,1],"passed":true},{"actual":[6,10,5,1,1,1,0],"check":"disk fan","expected":[6,10,5,1,1,1,0],"passed":true},{"actual":[5,9,7,3,1,1,-1],"check":"tetrahedra sharing a face","expected":[5,9,7,3,1,0,null],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"tetrahedron\", \"actual\": [4, 6, 4, 2, 1, 0, 0], \"expected\": [4, 6, 4, 2, 1, 0, 0], \"passed\": true}, {\"check\": \"cube quads\", \"actual\": [8, 12, 6, 2, 1, 0, 0], \"expected\": [8, 12, 6, 2, 1, 0, 0], \"passed\": true}, {\"check\": \"octahedron\", \"actual\": [6, 12, 8, 2, 1, 0, 0], \"expected\": [6, 12, 8, 2, 1, 0, 0], \"passed\": true}, {\"check\": \"quad torus\", \"actual\": [9, 18, 9, 0, 1, 0, 1], \"expected\": [9, 18, 9, 0, 1, 0, 1], \"passed\": true}, {\"check\": \"triangle torus\", \"actual\": [9, 27, 18, 0, 1, 0, 1], \"expected\": [9, 27, 18, 0, 1, 0, 1], \"passed\": true}, {\"check\": \"disk fan\", \"actual\": [6, 10, 5, 1, 1, 1, 0], \"expected\": [6, 10, 5, 1, 1, 1, 0], \"passed\": true}, {\"check\": \"tetrahedra sharing a face\", \"actual\": [5, 9, 7, 3, 1, 1, -1], \"expected\": [5, 9, 7, 3, 1, 0, null], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.473,"exit_code":1,"observations":[{"actual":[4,6,4,2,1,0,0],"check":"tetrahedron","expected":[4,6,4,2,1,0,0],"passed":true},{"actual":[8,12,6,2,1,0,0],"check":"cube quads","expected":[8,12,6,2,1,0,0],"passed":true},{"actual":[6,12,8,2,1,0,0],"check":"octahedron","expected":[6,12,8,2,1,0,0],"passed":true},{"actual":[9,18,9,0,1,0,1],"check":"quad torus","expected":[9,18,9,0,1,0,1],"passed":true},{"actual":[9,27,18,0,1,0,1],"check":"triangle torus","expected":[9,27,18,0,1,0,1],"passed":true},{"actual":[6,10,5,1,1,1,0],"check":"disk fan","expected":[6,10,5,1,1,1,0],"passed":true},{"actual":[5,9,7,3,1,1,-1],"check":"tetrahedra sharing a face","expected":[5,9,7,3,1,0,null],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"tetrahedron\", \"actual\": [4, 6, 4, 2, 1, 0, 0], \"expected\": [4, 6, 4, 2, 1, 0, 0], \"passed\": true}, {\"check\": \"cube quads\", \"actual\": [8, 12, 6, 2, 1, 0, 0], \"expected\": [8, 12, 6, 2, 1, 0, 0], \"passed\": true}, {\"check\": \"octahedron\", \"actual\": [6, 12, 8, 2, 1, 0, 0], \"expected\": [6, 12, 8, 2, 1, 0, 0], \"passed\": true}, {\"check\": \"quad torus\", \"actual\": [9, 18, 9, 0, 1, 0, 1], \"expected\": [9, 18, 9, 0, 1, 0, 1], \"passed\": true}, {\"check\": \"triangle torus\", \"actual\": [9, 27, 18, 0, 1, 0, 1], \"expected\": [9, 27, 18, 0, 1, 0, 1], \"passed\": true}, {\"check\": \"disk fan\", \"actual\": [6, 10, 5, 1, 1, 1, 0], \"expected\": [6, 10, 5, 1, 1, 1, 0], \"passed\": true}, {\"check\": \"tetrahedra sharing a face\", \"actual\": [5, 9, 7, 3, 1, 1, -1], \"expected\": [5, 9, 7, 3, 1, 0, null], \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":41.877,"exit_code":0,"observations":[{"actual":[4,6,4,2,1,0,0],"check":"tetrahedron","expected":[4,6,4,2,1,0,0],"passed":true},{"actual":[8,12,6,2,1,0,0],"check":"cube quads","expected":[8,12,6,2,1,0,0],"passed":true},{"actual":[6,12,8,2,1,0,0],"check":"octahedron","expected":[6,12,8,2,1,0,0],"passed":true},{"actual":[9,18,9,0,1,0,1],"check":"quad torus","expected":[9,18,9,0,1,0,1],"passed":true},{"actual":[9,27,18,0,1,0,1],"check":"triangle torus","expected":[9,27,18,0,1,0,1],"passed":true},{"actual":[6,10,5,1,1,1,0],"check":"disk fan","expected":[6,10,5,1,1,1,0],"passed":true},{"actual":[5,9,7,3,1,0,null],"check":"tetrahedra sharing a face","expected":[5,9,7,3,1,0,null],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"tetrahedron\", \"actual\": [4, 6, 4, 2, 1, 0, 0], \"expected\": [4, 6, 4, 2, 1, 0, 0], \"passed\": true}, {\"check\": \"cube quads\", \"actual\": [8, 12, 6, 2, 1, 0, 0], \"expected\": [8, 12, 6, 2, 1, 0, 0], \"passed\": true}, {\"check\": \"octahedron\", \"actual\": [6, 12, 8, 2, 1, 0, 0], \"expected\": [6, 12, 8, 2, 1, 0, 0], \"passed\": true}, {\"check\": \"quad torus\", \"actual\": [9, 18, 9, 0, 1, 0, 1], \"expected\": [9, 18, 9, 0, 1, 0, 1], \"passed\": true}, {\"check\": \"triangle torus\", \"actual\": [9, 27, 18, 0, 1, 0, 1], \"expected\": [9, 27, 18, 0, 1, 0, 1], \"passed\": true}, {\"check\": \"disk fan\", \"actual\": [6, 10, 5, 1, 1, 1, 0], \"expected\": [6, 10, 5, 1, 1, 1, 0], \"passed\": true}, {\"check\": \"tetrahedra sharing a face\", \"actual\": [5, 9, 7, 3, 1, 0, null], \"expected\": [5, 9, 7, 3, 1, 0, null], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}