Me1062 — duplicate_polygons swap_to_end: 3 duplicates at non-contiguous positions 0,2,5; swap_position diverges from polygon_to_remove_pos (Branch 9)

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

spec-violation

Sources

Description

A 6-triangle soup with 3 copies of triangle (0,1,2) at non-contiguous positions 0, 2, and 5. The swap_to_end mechanism starts swap_position at the last index and moves backward; each duplicate at polygon_to_remove_pos is swapped with the current swap_position so that duplicates accumulate at the back partition. Because the duplicates are non-contiguous, the swap_position and polygon_to_remove_pos differ on each swap, fully exercising std::swap(polygons[swap_position], polygons[polygon_to_remove_pos]).

Reproducer recipe

tri order = dup(0), clean, dup(2), clean, clean, dup(5); three swap operations move them to back positions 3,4,5; erase shrinks from 6 to 3.

Expected kernel behavior

3 swaps with divergent indices; after erase the 3 surviving triangles are the clean ones.

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      0.5,
30      -1.0,
31      0.0
32    ]
33  ],
34  "triangles": [
35    [
36      0,
37      1,
38      2
39    ],
40    [
41      1,
42      3,
43      2
44    ],
45    [
46      0,
47      1,
48      2
49    ],
50    [
51      3,
52      4,
53      2
54    ],
55    [
56      0,
57      5,
58      1
59    ],
60    [
61      0,
62      1,
63      2
64    ]
65  ],
66  "metadata": {
67    "id": "Me1062",
68    "schema_version": 0,
69    "defect_class": "duplicate_triangles",
70    "title": "duplicate_polygons swap_to_end: 3 duplicates at non-contiguous positions 0,2,5",
71    "assertions": [
72      {
73        "kind": "duplicate_polygon_group",
74        "triangles": [
75          0,
76          2,
77          5
78        ],
79        "n": 3
80      }
81    ]
82  }
83}