{"abstract":"Every face degree is one too high.","category":"Mesh topology invariants","checks":7,"contract":"Input: polygon faces. Two faces are adjacent when they share an undirected edge (fins give every pair on the edge). Return [distinct adjacent face count per face, number of adjacent face pairs].","contract_signature":"x","evaluation_group":"w2-mesh_topology_invariants-face-adjacency-degree","failed_approach":"Keeping only later faces halves the adjacency of earlier faces.","family":"w2-mesh_topology_invariants-face-adjacency-degree-self-adjacency","id":"FA-88826","implementations":{"attempt":{"sha256":"78c28cc2e139d6916272aac4cbbef74a96c0216e78bae0536ef8ca23d03f3312","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(x):\n    faces=x\n    ef={}\n    for fi,f in enumerate(faces):\n        n=len(f)\n        for i in range(n):\n            a,b=f[i],f[(i+1)%n]\n            ef.setdefault((min(a,b),max(a,b)),[]).append(fi)\n    deg=[]\n    for fi,f in enumerate(faces):\n        n=len(f)\n        nbs=set()\n        for i in range(n):\n            a,b=f[i],f[(i+1)%n]\n            for g in ef[(min(a,b),max(a,b))]:\n                if g>fi: nbs.add(g)\n        deg.append(len(nbs))\n    return [deg,sum(deg)//2]\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]]], [[3, 3, 3, 3], 6]], ['book', [[[0, 1, 2], [1, 0, 3], [0, 1, 4]]], [[2, 2, 2], 3]], ['flipped pair', [[[0, 1, 2], [0, 1, 3]]], [[1, 1], 1]], ['two triangles sharing two edges', [[[0, 1, 2], [1, 0, 2]]], [[1, 1], 1]], ['quad grid', [[[0, 1, 4, 3], [1, 2, 5, 4], [3, 4, 7, 6], [4, 5, 8, 7]]], [[2, 2, 2, 2], 4]], ['disk', [[[0, 1, 2], [0, 2, 3], [0, 3, 4], [0, 4, 5], [0, 5, 1]]], [[2, 2, 2, 2, 2], 5]], ['cube', [[[0, 3, 2, 1], [4, 5, 6, 7], [0, 1, 5, 4], [1, 2, 6, 5], [2, 3, 7, 6], [3, 0, 4, 7]]], [[4, 4, 4, 4, 4, 4], 12]]], [['book', [[[0, 1, 2], [1, 0, 3], [0, 1, 4]]], [[2, 2, 2], 3]], ['quad grid', [[[0, 1, 4, 3], [1, 2, 5, 4], [3, 4, 7, 6], [4, 5, 8, 7]]], [[2, 2, 2, 2], 4]], ['disk', [[[0, 1, 2], [0, 2, 3], [0, 3, 4], [0, 4, 5], [0, 5, 1]]], [[2, 2, 2, 2, 2], 5]], ['cube', [[[0, 3, 2, 1], [4, 5, 6, 7], [0, 1, 5, 4], [1, 2, 6, 5], [2, 3, 7, 6], [3, 0, 4, 7]]], [[4, 4, 4, 4, 4, 4], 12]], ['bowtie', [[[0, 1, 2], [0, 3, 4]]], [[0, 0], 0]], ['mobius', [[[0, 3, 4, 1], [1, 4, 5, 2], [2, 5, 0, 3]]], [[2, 2, 2], 3]], ['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]]], [[4, 4, 4, 4, 4, 4, 4, 4, 4], 18]]], [['tetrahedron', [[[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2]]], [[3, 3, 3, 3], 6]], ['book', [[[0, 1, 2], [1, 0, 3], [0, 1, 4]]], [[2, 2, 2], 3]], ['flipped pair', [[[0, 1, 2], [0, 1, 3]]], [[1, 1], 1]], ['bowtie', [[[0, 1, 2], [0, 3, 4]]], [[0, 0], 0]], ['mobius', [[[0, 3, 4, 1], [1, 4, 5, 2], [2, 5, 0, 3]]], [[2, 2, 2], 3]], ['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]]], [[4, 4, 4, 4, 4, 4, 4, 4, 4], 18]], ['single face', [[[0, 1, 2]]], [[0], 0]]], [['tetrahedron', [[[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2]]], [[3, 3, 3, 3], 6]], ['book', [[[0, 1, 2], [1, 0, 3], [0, 1, 4]]], [[2, 2, 2], 3]], ['flipped pair', [[[0, 1, 2], [0, 1, 3]]], [[1, 1], 1]], ['two triangles sharing two edges', [[[0, 1, 2], [1, 0, 2]]], [[1, 1], 1]], ['quad grid', [[[0, 1, 4, 3], [1, 2, 5, 4], [3, 4, 7, 6], [4, 5, 8, 7]]], [[2, 2, 2, 2], 4]], ['disk', [[[0, 1, 2], [0, 2, 3], [0, 3, 4], [0, 4, 5], [0, 5, 1]]], [[2, 2, 2, 2, 2], 5]], ['single face', [[[0, 1, 2]]], [[0], 0]]], [['flipped pair', [[[0, 1, 2], [0, 1, 3]]], [[1, 1], 1]], ['two triangles sharing two edges', [[[0, 1, 2], [1, 0, 2]]], [[1, 1], 1]], ['quad grid', [[[0, 1, 4, 3], [1, 2, 5, 4], [3, 4, 7, 6], [4, 5, 8, 7]]], [[2, 2, 2, 2], 4]], ['disk', [[[0, 1, 2], [0, 2, 3], [0, 3, 4], [0, 4, 5], [0, 5, 1]]], [[2, 2, 2, 2, 2], 5]], ['cube', [[[0, 3, 2, 1], [4, 5, 6, 7], [0, 1, 5, 4], [1, 2, 6, 5], [2, 3, 7, 6], [3, 0, 4, 7]]], [[4, 4, 4, 4, 4, 4], 12]], ['bowtie', [[[0, 1, 2], [0, 3, 4]]], [[0, 0], 0]], ['mobius', [[[0, 3, 4, 1], [1, 4, 5, 2], [2, 5, 0, 3]]], [[2, 2, 2], 3]]]]\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":"15175c595868548e7854a8cc961c58858d26c7c0f87efa52fe4fa2ed4765bbc6","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(x):\n    faces=x\n    ef={}\n    for fi,f in enumerate(faces):\n        n=len(f)\n        for i in range(n):\n            a,b=f[i],f[(i+1)%n]\n            ef.setdefault((min(a,b),max(a,b)),[]).append(fi)\n    deg=[]\n    for fi,f in enumerate(faces):\n        n=len(f)\n        nbs=set()\n        for i in range(n):\n            a,b=f[i],f[(i+1)%n]\n            for g in ef[(min(a,b),max(a,b))]:\n                nbs.add(g)\n        deg.append(len(nbs))\n    return [deg,sum(deg)//2]\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]]], [[3, 3, 3, 3], 6]], ['book', [[[0, 1, 2], [1, 0, 3], [0, 1, 4]]], [[2, 2, 2], 3]], ['flipped pair', [[[0, 1, 2], [0, 1, 3]]], [[1, 1], 1]], ['two triangles sharing two edges', [[[0, 1, 2], [1, 0, 2]]], [[1, 1], 1]], ['quad grid', [[[0, 1, 4, 3], [1, 2, 5, 4], [3, 4, 7, 6], [4, 5, 8, 7]]], [[2, 2, 2, 2], 4]], ['disk', [[[0, 1, 2], [0, 2, 3], [0, 3, 4], [0, 4, 5], [0, 5, 1]]], [[2, 2, 2, 2, 2], 5]], ['cube', [[[0, 3, 2, 1], [4, 5, 6, 7], [0, 1, 5, 4], [1, 2, 6, 5], [2, 3, 7, 6], [3, 0, 4, 7]]], [[4, 4, 4, 4, 4, 4], 12]]], [['book', [[[0, 1, 2], [1, 0, 3], [0, 1, 4]]], [[2, 2, 2], 3]], ['quad grid', [[[0, 1, 4, 3], [1, 2, 5, 4], [3, 4, 7, 6], [4, 5, 8, 7]]], [[2, 2, 2, 2], 4]], ['disk', [[[0, 1, 2], [0, 2, 3], [0, 3, 4], [0, 4, 5], [0, 5, 1]]], [[2, 2, 2, 2, 2], 5]], ['cube', [[[0, 3, 2, 1], [4, 5, 6, 7], [0, 1, 5, 4], [1, 2, 6, 5], [2, 3, 7, 6], [3, 0, 4, 7]]], [[4, 4, 4, 4, 4, 4], 12]], ['bowtie', [[[0, 1, 2], [0, 3, 4]]], [[0, 0], 0]], ['mobius', [[[0, 3, 4, 1], [1, 4, 5, 2], [2, 5, 0, 3]]], [[2, 2, 2], 3]], ['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]]], [[4, 4, 4, 4, 4, 4, 4, 4, 4], 18]]], [['tetrahedron', [[[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2]]], [[3, 3, 3, 3], 6]], ['book', [[[0, 1, 2], [1, 0, 3], [0, 1, 4]]], [[2, 2, 2], 3]], ['flipped pair', [[[0, 1, 2], [0, 1, 3]]], [[1, 1], 1]], ['bowtie', [[[0, 1, 2], [0, 3, 4]]], [[0, 0], 0]], ['mobius', [[[0, 3, 4, 1], [1, 4, 5, 2], [2, 5, 0, 3]]], [[2, 2, 2], 3]], ['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]]], [[4, 4, 4, 4, 4, 4, 4, 4, 4], 18]], ['single face', [[[0, 1, 2]]], [[0], 0]]], [['tetrahedron', [[[0, 2, 1], [0, 1, 3], [1, 2, 3], [0, 3, 2]]], [[3, 3, 3, 3], 6]], ['book', [[[0, 1, 2], [1, 0, 3], [0, 1, 4]]], [[2, 2, 2], 3]], ['flipped pair', [[[0, 1, 2], [0, 1, 3]]], [[1, 1], 1]], ['two triangles sharing two edges', [[[0, 1, 2], [1, 0, 2]]], [[1, 1], 1]], ['quad grid', [[[0, 1, 4, 3], [1, 2, 5, 4], [3, 4, 7, 6], [4, 5, 8, 7]]], [[2, 2, 2, 2], 4]], ['disk', [[[0, 1, 2], [0, 2, 3], [0, 3, 4], [0, 4, 5], [0, 5, 1]]], [[2, 2, 2, 2, 2], 5]], ['single face', [[[0, 1, 2]]], [[0], 0]]], [['flipped pair', [[[0, 1, 2], [0, 1, 3]]], [[1, 1], 1]], ['two triangles sharing two edges', [[[0, 1, 2], [1, 0, 2]]], [[1, 1], 1]], ['quad grid', [[[0, 1, 4, 3], [1, 2, 5, 4], [3, 4, 7, 6], [4, 5, 8, 7]]], [[2, 2, 2, 2], 4]], ['disk', [[[0, 1, 2], [0, 2, 3], [0, 3, 4], [0, 4, 5], [0, 5, 1]]], [[2, 2, 2, 2, 2], 5]], ['cube', [[[0, 3, 2, 1], [4, 5, 6, 7], [0, 1, 5, 4], [1, 2, 6, 5], [2, 3, 7, 6], [3, 0, 4, 7]]], [[4, 4, 4, 4, 4, 4], 12]], ['bowtie', [[[0, 1, 2], [0, 3, 4]]], [[0, 0], 0]], ['mobius', [[[0, 3, 4, 1], [1, 4, 5, 2], [2, 5, 0, 3]]], [[2, 2, 2], 3]]]]\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-face-adjacency-degree-self-adjacency","generated_at":"2026-09-29T14:51:11.677873+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 itself is not excluded from the edge incidence list.","sha256":"bfd18978a1805687beda7f1625369ddf0c9f7ed3330bbdb315b312927414b900","title":"Face is counted as its own neighbour · 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.223,"exit_code":1,"observations":[{"actual":[[3,2,1,0],3],"check":"tetrahedron","expected":[[3,3,3,3],6],"passed":false},{"actual":[[2,1,0],1],"check":"book","expected":[[2,2,2],3],"passed":false},{"actual":[[1,0],0],"check":"flipped pair","expected":[[1,1],1],"passed":false},{"actual":[[1,0],0],"check":"two triangles sharing two edges","expected":[[1,1],1],"passed":false},{"actual":[[2,1,1,0],2],"check":"quad grid","expected":[[2,2,2,2],4],"passed":false},{"actual":[[2,1,1,1,0],2],"check":"disk","expected":[[2,2,2,2,2],5],"passed":false},{"actual":[[4,4,2,1,1,0],6],"check":"cube","expected":[[4,4,4,4,4,4],12],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"tetrahedron\", \"actual\": [[3, 2, 1, 0], 3], \"expected\": [[3, 3, 3, 3], 6], \"passed\": false}, {\"check\": \"book\", \"actual\": [[2, 1, 0], 1], \"expected\": [[2, 2, 2], 3], \"passed\": false}, {\"check\": \"flipped pair\", \"actual\": [[1, 0], 0], \"expected\": [[1, 1], 1], \"passed\": false}, {\"check\": \"two triangles sharing two edges\", \"actual\": [[1, 0], 0], \"expected\": [[1, 1], 1], \"passed\": false}, {\"check\": \"quad grid\", \"actual\": [[2, 1, 1, 0], 2], \"expected\": [[2, 2, 2, 2], 4], \"passed\": false}, {\"check\": \"disk\", \"actual\": [[2, 1, 1, 1, 0], 2], \"expected\": [[2, 2, 2, 2, 2], 5], \"passed\": false}, {\"check\": \"cube\", \"actual\": [[4, 4, 2, 1, 1, 0], 6], \"expected\": [[4, 4, 4, 4, 4, 4], 12], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.253,"exit_code":1,"observations":[{"actual":[[4,4,4,4],8],"check":"tetrahedron","expected":[[3,3,3,3],6],"passed":false},{"actual":[[3,3,3],4],"check":"book","expected":[[2,2,2],3],"passed":false},{"actual":[[2,2],2],"check":"flipped pair","expected":[[1,1],1],"passed":false},{"actual":[[2,2],2],"check":"two triangles sharing two edges","expected":[[1,1],1],"passed":false},{"actual":[[3,3,3,3],6],"check":"quad grid","expected":[[2,2,2,2],4],"passed":false},{"actual":[[3,3,3,3,3],7],"check":"disk","expected":[[2,2,2,2,2],5],"passed":false},{"actual":[[5,5,5,5,5,5],15],"check":"cube","expected":[[4,4,4,4,4,4],12],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"tetrahedron\", \"actual\": [[4, 4, 4, 4], 8], \"expected\": [[3, 3, 3, 3], 6], \"passed\": false}, {\"check\": \"book\", \"actual\": [[3, 3, 3], 4], \"expected\": [[2, 2, 2], 3], \"passed\": false}, {\"check\": \"flipped pair\", \"actual\": [[2, 2], 2], \"expected\": [[1, 1], 1], \"passed\": false}, {\"check\": \"two triangles sharing two edges\", \"actual\": [[2, 2], 2], \"expected\": [[1, 1], 1], \"passed\": false}, {\"check\": \"quad grid\", \"actual\": [[3, 3, 3, 3], 6], \"expected\": [[2, 2, 2, 2], 4], \"passed\": false}, {\"check\": \"disk\", \"actual\": [[3, 3, 3, 3, 3], 7], \"expected\": [[2, 2, 2, 2, 2], 5], \"passed\": false}, {\"check\": \"cube\", \"actual\": [[5, 5, 5, 5, 5, 5], 15], \"expected\": [[4, 4, 4, 4, 4, 4], 12], \"passed\": false}], \"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."}}