Me044 — duplicate_polygons swap_to_end: duplicate swapped to back then erased

§12.14 mesh defects (sub-class: topology/duplicate)

spec-violation

Sources

Description

5-triangle soup with 3 copies of (0,1,2) interleaved with 2 clean triangles. Each duplicate copy is moved to the back partition via std::swap before erase(), so after swapping a clean polygon fills the old duplicate slot. Tests the swap mechanism's correctness in a non-contiguous duplicate layout.

Reproducer recipe

tri order = dup, clean, dup, clean, dup; duplicates at positions 0, 2, 4; swaps move them to back.

Expected kernel behavior

3 swaps move duplicates to positions 2,3,4 (back region); erase shrinks from 5 to 2.

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      0.5,
15      1.0,
16      0.0
17    ],
18    [
19      1.5,
20      1.0,
21      0.0
22    ],
23    [
24      2.0,
25      0.0,
26      0.0
27    ]
28  ],
29  "triangles": [
30    [
31      0,
32      1,
33      2
34    ],
35    [
36      1,
37      3,
38      2
39    ],
40    [
41      0,
42      1,
43      2
44    ],
45    [
46      1,
47      4,
48      3
49    ],
50    [
51      0,
52      1,
53      2
54    ]
55  ],
56  "metadata": {
57    "id": "Me044",
58    "schema_version": 0,
59    "defect_class": "duplicate_triangles",
60    "title": "duplicate_polygons swap_to_end: duplicate swapped to back then erased",
61    "assertions": [
62      {
63        "kind": "duplicate_polygon_group",
64        "triangles": [
65          0,
66          2,
67          4
68        ],
69        "n": 3
70      }
71    ]
72  }
73}