Me340 — init_info_array_allocation_triangles: duplicate triangle inflates t_info allocation size

§12.14 mesh defects (sub-class: Basic_TMesh.init / info-array-allocation)

topology

Sources

Description

A 3-triangle mesh where t0 and t2 are exact duplicates of each other (same vertex set (v0,v1,v2)). The init call sizes t_info to 3 (T.numels()), but only 2 unique triangular faces exist. The inflated triangle count causes the allocated buffer to be larger than the real topology needs — an over-allocation defect triggered by duplicate triangles.

Reproducer recipe

v0=(0,0,0), v1=(1,0,0), v2=(1,1,0), v3=(0,1,0); t0=(v0,v1,v2), t1=(v0,v2,v3), t2=(v0,v1,v2); assert_duplicate_triangle_pair(0,2); edge (v0,v2) shared n=3; edge (v0,v1) shared n=2.

Expected kernel behavior

Branch 1 fires once; t_info allocated for 3 entries even though 2 unique faces exist; downstream Euler checks are off by 1.

Expected validation

Live oracle output

No live oracle data — run _run_corpus to populate.

Fixture content

Show fixture bytes
1{
2  "vertices": [
3    [
4      0.0,
5      0.0,
6      0.0
7    ],
8    [
9      1.0,
10      0.0,
11      0.0
12    ],
13    [
14      1.0,
15      1.0,
16      0.0
17    ],
18    [
19      0.0,
20      1.0,
21      0.0
22    ]
23  ],
24  "triangles": [
25    [
26      0,
27      1,
28      2
29    ],
30    [
31      0,
32      2,
33      3
34    ],
35    [
36      0,
37      1,
38      2
39    ]
40  ],
41  "metadata": {
42    "id": "Me340",
43    "schema_version": 0,
44    "defect_class": "duplicate_triangles",
45    "title": "init_info_array_allocation_triangles: duplicate triangle inflates t_info allocation size",
46    "assertions": [
47      {
48        "kind": "duplicate_triangle_pair",
49        "triangles": [
50          0,
51          2
52        ]
53      },
54      {
55        "kind": "edge_shared_by_n_triangles",
56        "edge": [
57          0,
58          2
59        ],
60        "n": 3
61      },
62      {
63        "kind": "edge_shared_by_n_triangles",
64        "edge": [
65          0,
66          1
67        ],
68        "n": 2
69      }
70    ]
71  }
72}