{"abstract":"Output faces start at an arbitrary corner.","category":"Mesh topology invariants","checks":7,"contract":"Input: tetrahedra [a,b,c,d] (positively oriented). A tet with repeated vertices returns [\"degenerate\", i]. Outward faces are (b,c,d),(a,d,c),(a,b,d),(a,c,b). Faces are matched by their vertex set; a set used once is boundary (kept with its first orientation, rotated to start at its smallest vertex); used more than twice returns [\"non-manifold\", sorted vertices]. Output boundary faces in increasing sorted-vertex-set order.","contract_signature":"x","evaluation_group":"w2-mesh_topology_invariants-tet-boundary-surface","failed_approach":"Sorting the corners destroys the outward orientation.","family":"w2-mesh_topology_invariants-tet-boundary-surface-face-rotation","id":"FA-88731","implementations":{"attempt":{"sha256":"cb11c539efdafe7139cf066a9374a1f18bc3fa9c3806c05f7557fb2986ff9962","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(x):\n    tets=x\n    cnt={}\n    first={}\n    for i,t in enumerate(tets):\n        if len(set(t))<4: return ['degenerate',i]\n        a,b,c,d=t\n        for f in ((b,c,d),(a,d,c),(a,b,d),(a,c,b)):\n            k=tuple(sorted(f))\n            cnt[k]=cnt.get(k,0)+1\n            if k not in first: first[k]=f\n    out=[]\n    for k in sorted(cnt):\n        if cnt[k]==1:\n            f=first[k]\n            m=f.index(min(f))\n            out.append(sorted(f))\n        elif cnt[k]>2: return ['non-manifold',list(k)]\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['single tet', [[[0, 1, 2, 3]]], [[0, 2, 1], [0, 1, 3], [0, 3, 2], [1, 2, 3]]], ['two tets sharing a face', [[[0, 1, 2, 3], [1, 0, 2, 4]]], [[0, 1, 3], [0, 4, 1], [0, 3, 2], [0, 2, 4], [1, 2, 3], [1, 4, 2]]], ['three tets around an edge', [[[0, 1, 2, 3], [0, 1, 3, 4], [0, 1, 4, 2]]], [[0, 3, 2], [0, 2, 4], [0, 4, 3], [1, 2, 3], [1, 4, 2], [1, 3, 4]]], ['fin face', [[[0, 1, 2, 3], [1, 0, 2, 4], [0, 1, 2, 5]]], ['non-manifold', [0, 1, 2]]], ['degenerate tet', [[[0, 1, 2, 3], [4, 5, 5, 6]]], ['degenerate', 1]], ['degenerate first pair', [[[2, 2, 3, 4]]], ['degenerate', 0]], ['degenerate late pair', [[[0, 1, 2, 2]]], ['degenerate', 0]]], [['two tets sharing a face', [[[0, 1, 2, 3], [1, 0, 2, 4]]], [[0, 1, 3], [0, 4, 1], [0, 3, 2], [0, 2, 4], [1, 2, 3], [1, 4, 2]]], ['degenerate tet', [[[0, 1, 2, 3], [4, 5, 5, 6]]], ['degenerate', 1]], ['degenerate first pair', [[[2, 2, 3, 4]]], ['degenerate', 0]], ['degenerate late pair', [[[0, 1, 2, 2]]], ['degenerate', 0]], ['rotated labels', [[[3, 1, 0, 2]]], [[0, 2, 1], [0, 1, 3], [0, 3, 2], [1, 2, 3]]], ['large labels', [[[10, 7, 9, 8], [7, 10, 9, 11]]], [[7, 9, 8], [7, 8, 10], [7, 11, 9], [7, 10, 11], [8, 9, 10], [9, 11, 10]]], ['two separate tets', [[[0, 1, 2, 3], [4, 5, 6, 7]]], [[0, 2, 1], [0, 1, 3], [0, 3, 2], [1, 2, 3], [4, 6, 5], [4, 5, 7], [4, 7, 6], [5, 6, 7]]]], [['single tet', [[[0, 1, 2, 3]]], [[0, 2, 1], [0, 1, 3], [0, 3, 2], [1, 2, 3]]], ['two tets sharing a face', [[[0, 1, 2, 3], [1, 0, 2, 4]]], [[0, 1, 3], [0, 4, 1], [0, 3, 2], [0, 2, 4], [1, 2, 3], [1, 4, 2]]], ['three tets around an edge', [[[0, 1, 2, 3], [0, 1, 3, 4], [0, 1, 4, 2]]], [[0, 3, 2], [0, 2, 4], [0, 4, 3], [1, 2, 3], [1, 4, 2], [1, 3, 4]]], ['fin face', [[[0, 1, 2, 3], [1, 0, 2, 4], [0, 1, 2, 5]]], ['non-manifold', [0, 1, 2]]], ['rotated labels', [[[3, 1, 0, 2]]], [[0, 2, 1], [0, 1, 3], [0, 3, 2], [1, 2, 3]]], ['large labels', [[[10, 7, 9, 8], [7, 10, 9, 11]]], [[7, 9, 8], [7, 8, 10], [7, 11, 9], [7, 10, 11], [8, 9, 10], [9, 11, 10]]], ['two separate tets', [[[0, 1, 2, 3], [4, 5, 6, 7]]], [[0, 2, 1], [0, 1, 3], [0, 3, 2], [1, 2, 3], [4, 6, 5], [4, 5, 7], [4, 7, 6], [5, 6, 7]]]], [['two tets sharing a face', [[[0, 1, 2, 3], [1, 0, 2, 4]]], [[0, 1, 3], [0, 4, 1], [0, 3, 2], [0, 2, 4], [1, 2, 3], [1, 4, 2]]], ['three tets around an edge', [[[0, 1, 2, 3], [0, 1, 3, 4], [0, 1, 4, 2]]], [[0, 3, 2], [0, 2, 4], [0, 4, 3], [1, 2, 3], [1, 4, 2], [1, 3, 4]]], ['fin face', [[[0, 1, 2, 3], [1, 0, 2, 4], [0, 1, 2, 5]]], ['non-manifold', [0, 1, 2]]], ['degenerate tet', [[[0, 1, 2, 3], [4, 5, 5, 6]]], ['degenerate', 1]], ['degenerate first pair', [[[2, 2, 3, 4]]], ['degenerate', 0]], ['degenerate late pair', [[[0, 1, 2, 2]]], ['degenerate', 0]], ['rotated labels', [[[3, 1, 0, 2]]], [[0, 2, 1], [0, 1, 3], [0, 3, 2], [1, 2, 3]]]], [['single tet', [[[0, 1, 2, 3]]], [[0, 2, 1], [0, 1, 3], [0, 3, 2], [1, 2, 3]]], ['degenerate tet', [[[0, 1, 2, 3], [4, 5, 5, 6]]], ['degenerate', 1]], ['degenerate first pair', [[[2, 2, 3, 4]]], ['degenerate', 0]], ['degenerate late pair', [[[0, 1, 2, 2]]], ['degenerate', 0]], ['rotated labels', [[[3, 1, 0, 2]]], [[0, 2, 1], [0, 1, 3], [0, 3, 2], [1, 2, 3]]], ['large labels', [[[10, 7, 9, 8], [7, 10, 9, 11]]], [[7, 9, 8], [7, 8, 10], [7, 11, 9], [7, 10, 11], [8, 9, 10], [9, 11, 10]]], ['two separate tets', [[[0, 1, 2, 3], [4, 5, 6, 7]]], [[0, 2, 1], [0, 1, 3], [0, 3, 2], [1, 2, 3], [4, 6, 5], [4, 5, 7], [4, 7, 6], [5, 6, 7]]]]]\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":"70aee4399e011fc27061ee0d08a5d8ffea4b59fdd6a52158d9327f954b1f76ba","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(x):\n    tets=x\n    cnt={}\n    first={}\n    for i,t in enumerate(tets):\n        if len(set(t))<4: return ['degenerate',i]\n        a,b,c,d=t\n        for f in ((b,c,d),(a,d,c),(a,b,d),(a,c,b)):\n            k=tuple(sorted(f))\n            cnt[k]=cnt.get(k,0)+1\n            if k not in first: first[k]=f\n    out=[]\n    for k in sorted(cnt):\n        if cnt[k]==1:\n            f=first[k]\n            m=f.index(min(f))\n            out.append(list(f))\n        elif cnt[k]>2: return ['non-manifold',list(k)]\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['single tet', [[[0, 1, 2, 3]]], [[0, 2, 1], [0, 1, 3], [0, 3, 2], [1, 2, 3]]], ['two tets sharing a face', [[[0, 1, 2, 3], [1, 0, 2, 4]]], [[0, 1, 3], [0, 4, 1], [0, 3, 2], [0, 2, 4], [1, 2, 3], [1, 4, 2]]], ['three tets around an edge', [[[0, 1, 2, 3], [0, 1, 3, 4], [0, 1, 4, 2]]], [[0, 3, 2], [0, 2, 4], [0, 4, 3], [1, 2, 3], [1, 4, 2], [1, 3, 4]]], ['fin face', [[[0, 1, 2, 3], [1, 0, 2, 4], [0, 1, 2, 5]]], ['non-manifold', [0, 1, 2]]], ['degenerate tet', [[[0, 1, 2, 3], [4, 5, 5, 6]]], ['degenerate', 1]], ['degenerate first pair', [[[2, 2, 3, 4]]], ['degenerate', 0]], ['degenerate late pair', [[[0, 1, 2, 2]]], ['degenerate', 0]]], [['two tets sharing a face', [[[0, 1, 2, 3], [1, 0, 2, 4]]], [[0, 1, 3], [0, 4, 1], [0, 3, 2], [0, 2, 4], [1, 2, 3], [1, 4, 2]]], ['degenerate tet', [[[0, 1, 2, 3], [4, 5, 5, 6]]], ['degenerate', 1]], ['degenerate first pair', [[[2, 2, 3, 4]]], ['degenerate', 0]], ['degenerate late pair', [[[0, 1, 2, 2]]], ['degenerate', 0]], ['rotated labels', [[[3, 1, 0, 2]]], [[0, 2, 1], [0, 1, 3], [0, 3, 2], [1, 2, 3]]], ['large labels', [[[10, 7, 9, 8], [7, 10, 9, 11]]], [[7, 9, 8], [7, 8, 10], [7, 11, 9], [7, 10, 11], [8, 9, 10], [9, 11, 10]]], ['two separate tets', [[[0, 1, 2, 3], [4, 5, 6, 7]]], [[0, 2, 1], [0, 1, 3], [0, 3, 2], [1, 2, 3], [4, 6, 5], [4, 5, 7], [4, 7, 6], [5, 6, 7]]]], [['single tet', [[[0, 1, 2, 3]]], [[0, 2, 1], [0, 1, 3], [0, 3, 2], [1, 2, 3]]], ['two tets sharing a face', [[[0, 1, 2, 3], [1, 0, 2, 4]]], [[0, 1, 3], [0, 4, 1], [0, 3, 2], [0, 2, 4], [1, 2, 3], [1, 4, 2]]], ['three tets around an edge', [[[0, 1, 2, 3], [0, 1, 3, 4], [0, 1, 4, 2]]], [[0, 3, 2], [0, 2, 4], [0, 4, 3], [1, 2, 3], [1, 4, 2], [1, 3, 4]]], ['fin face', [[[0, 1, 2, 3], [1, 0, 2, 4], [0, 1, 2, 5]]], ['non-manifold', [0, 1, 2]]], ['rotated labels', [[[3, 1, 0, 2]]], [[0, 2, 1], [0, 1, 3], [0, 3, 2], [1, 2, 3]]], ['large labels', [[[10, 7, 9, 8], [7, 10, 9, 11]]], [[7, 9, 8], [7, 8, 10], [7, 11, 9], [7, 10, 11], [8, 9, 10], [9, 11, 10]]], ['two separate tets', [[[0, 1, 2, 3], [4, 5, 6, 7]]], [[0, 2, 1], [0, 1, 3], [0, 3, 2], [1, 2, 3], [4, 6, 5], [4, 5, 7], [4, 7, 6], [5, 6, 7]]]], [['two tets sharing a face', [[[0, 1, 2, 3], [1, 0, 2, 4]]], [[0, 1, 3], [0, 4, 1], [0, 3, 2], [0, 2, 4], [1, 2, 3], [1, 4, 2]]], ['three tets around an edge', [[[0, 1, 2, 3], [0, 1, 3, 4], [0, 1, 4, 2]]], [[0, 3, 2], [0, 2, 4], [0, 4, 3], [1, 2, 3], [1, 4, 2], [1, 3, 4]]], ['fin face', [[[0, 1, 2, 3], [1, 0, 2, 4], [0, 1, 2, 5]]], ['non-manifold', [0, 1, 2]]], ['degenerate tet', [[[0, 1, 2, 3], [4, 5, 5, 6]]], ['degenerate', 1]], ['degenerate first pair', [[[2, 2, 3, 4]]], ['degenerate', 0]], ['degenerate late pair', [[[0, 1, 2, 2]]], ['degenerate', 0]], ['rotated labels', [[[3, 1, 0, 2]]], [[0, 2, 1], [0, 1, 3], [0, 3, 2], [1, 2, 3]]]], [['single tet', [[[0, 1, 2, 3]]], [[0, 2, 1], [0, 1, 3], [0, 3, 2], [1, 2, 3]]], ['degenerate tet', [[[0, 1, 2, 3], [4, 5, 5, 6]]], ['degenerate', 1]], ['degenerate first pair', [[[2, 2, 3, 4]]], ['degenerate', 0]], ['degenerate late pair', [[[0, 1, 2, 2]]], ['degenerate', 0]], ['rotated labels', [[[3, 1, 0, 2]]], [[0, 2, 1], [0, 1, 3], [0, 3, 2], [1, 2, 3]]], ['large labels', [[[10, 7, 9, 8], [7, 10, 9, 11]]], [[7, 9, 8], [7, 8, 10], [7, 11, 9], [7, 10, 11], [8, 9, 10], [9, 11, 10]]], ['two separate tets', [[[0, 1, 2, 3], [4, 5, 6, 7]]], [[0, 2, 1], [0, 1, 3], [0, 3, 2], [1, 2, 3], [4, 6, 5], [4, 5, 7], [4, 7, 6], [5, 6, 7]]]]]\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-tet-boundary-surface-face-rotation","generated_at":"2026-09-29T14:51:10.896475+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.","root_cause":"The face is output exactly as generated.","sha256":"63dc157da78d9536feb199b16e85fab04a3e8f5f8707393d369e925fa8aa09a7","title":"Boundary face is emitted without canonical rotation · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":39.476,"exit_code":1,"observations":[{"actual":[[0,1,2],[0,1,3],[0,2,3],[1,2,3]],"check":"single tet","expected":[[0,2,1],[0,1,3],[0,3,2],[1,2,3]],"passed":false},{"actual":[[0,1,3],[0,1,4],[0,2,3],[0,2,4],[1,2,3],[1,2,4]],"check":"two tets sharing a face","expected":[[0,1,3],[0,4,1],[0,3,2],[0,2,4],[1,2,3],[1,4,2]],"passed":false},{"actual":[[0,2,3],[0,2,4],[0,3,4],[1,2,3],[1,2,4],[1,3,4]],"check":"three tets around an edge","expected":[[0,3,2],[0,2,4],[0,4,3],[1,2,3],[1,4,2],[1,3,4]],"passed":false},{"actual":["non-manifold",[0,1,2]],"check":"fin face","expected":["non-manifold",[0,1,2]],"passed":true},{"actual":["degenerate",1],"check":"degenerate tet","expected":["degenerate",1],"passed":true},{"actual":["degenerate",0],"check":"degenerate first pair","expected":["degenerate",0],"passed":true},{"actual":["degenerate",0],"check":"degenerate late pair","expected":["degenerate",0],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"single tet\", \"actual\": [[0, 1, 2], [0, 1, 3], [0, 2, 3], [1, 2, 3]], \"expected\": [[0, 2, 1], [0, 1, 3], [0, 3, 2], [1, 2, 3]], \"passed\": false}, {\"check\": \"two tets sharing a face\", \"actual\": [[0, 1, 3], [0, 1, 4], [0, 2, 3], [0, 2, 4], [1, 2, 3], [1, 2, 4]], \"expected\": [[0, 1, 3], [0, 4, 1], [0, 3, 2], [0, 2, 4], [1, 2, 3], [1, 4, 2]], \"passed\": false}, {\"check\": \"three tets around an edge\", \"actual\": [[0, 2, 3], [0, 2, 4], [0, 3, 4], [1, 2, 3], [1, 2, 4], [1, 3, 4]], \"expected\": [[0, 3, 2], [0, 2, 4], [0, 4, 3], [1, 2, 3], [1, 4, 2], [1, 3, 4]], \"passed\": false}, {\"check\": \"fin face\", \"actual\": [\"non-manifold\", [0, 1, 2]], \"expected\": [\"non-manifold\", [0, 1, 2]], \"passed\": true}, {\"check\": \"degenerate tet\", \"actual\": [\"degenerate\", 1], \"expected\": [\"degenerate\", 1], \"passed\": true}, {\"check\": \"degenerate first pair\", \"actual\": [\"degenerate\", 0], \"expected\": [\"degenerate\", 0], \"passed\": true}, {\"check\": \"degenerate late pair\", \"actual\": [\"degenerate\", 0], \"expected\": [\"degenerate\", 0], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":38.788,"exit_code":1,"observations":[{"actual":[[0,2,1],[0,1,3],[0,3,2],[1,2,3]],"check":"single tet","expected":[[0,2,1],[0,1,3],[0,3,2],[1,2,3]],"passed":true},{"actual":[[0,1,3],[1,0,4],[0,3,2],[0,2,4],[1,2,3],[1,4,2]],"check":"two tets sharing a face","expected":[[0,1,3],[0,4,1],[0,3,2],[0,2,4],[1,2,3],[1,4,2]],"passed":false},{"actual":[[0,3,2],[0,2,4],[0,4,3],[1,2,3],[1,4,2],[1,3,4]],"check":"three tets around an edge","expected":[[0,3,2],[0,2,4],[0,4,3],[1,2,3],[1,4,2],[1,3,4]],"passed":true},{"actual":["non-manifold",[0,1,2]],"check":"fin face","expected":["non-manifold",[0,1,2]],"passed":true},{"actual":["degenerate",1],"check":"degenerate tet","expected":["degenerate",1],"passed":true},{"actual":["degenerate",0],"check":"degenerate first pair","expected":["degenerate",0],"passed":true},{"actual":["degenerate",0],"check":"degenerate late pair","expected":["degenerate",0],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"single tet\", \"actual\": [[0, 2, 1], [0, 1, 3], [0, 3, 2], [1, 2, 3]], \"expected\": [[0, 2, 1], [0, 1, 3], [0, 3, 2], [1, 2, 3]], \"passed\": true}, {\"check\": \"two tets sharing a face\", \"actual\": [[0, 1, 3], [1, 0, 4], [0, 3, 2], [0, 2, 4], [1, 2, 3], [1, 4, 2]], \"expected\": [[0, 1, 3], [0, 4, 1], [0, 3, 2], [0, 2, 4], [1, 2, 3], [1, 4, 2]], \"passed\": false}, {\"check\": \"three tets around an edge\", \"actual\": [[0, 3, 2], [0, 2, 4], [0, 4, 3], [1, 2, 3], [1, 4, 2], [1, 3, 4]], \"expected\": [[0, 3, 2], [0, 2, 4], [0, 4, 3], [1, 2, 3], [1, 4, 2], [1, 3, 4]], \"passed\": true}, {\"check\": \"fin face\", \"actual\": [\"non-manifold\", [0, 1, 2]], \"expected\": [\"non-manifold\", [0, 1, 2]], \"passed\": true}, {\"check\": \"degenerate tet\", \"actual\": [\"degenerate\", 1], \"expected\": [\"degenerate\", 1], \"passed\": true}, {\"check\": \"degenerate first pair\", \"actual\": [\"degenerate\", 0], \"expected\": [\"degenerate\", 0], \"passed\": true}, {\"check\": \"degenerate late pair\", \"actual\": [\"degenerate\", 0], \"expected\": [\"degenerate\", 0], \"passed\": true}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}