Summary
During 4D 100-point batch construction, a cell (CellKey(29v7), vertices [6v1, 2v1, 9v1, 11v1, 7v1]) is created with orientation=-1 (negative geometric orientation). This cell persists throughout construction and causes 88 of 100 subsequent vertex insertions to be skipped as degeneracies.
Reproducer
DELAUNAY_LARGE_DEBUG_N_4D=100 DELAUNAY_LARGE_DEBUG_ALLOW_SKIPS=1 \
cargo test --release --test large_scale_debug debug_large_scale_4d \
-- --ignored --nocapture
- Seed:
0x9B7786C999C56A16, ball distribution (radius=100)
- Only 12 of 100 vertices inserted (12% success rate)
- All 88 skips hit the same cell with
orientation=-1
- The resulting 12-vertex triangulation passes L1–L4 validation
- In debug mode, PLManifoldStrict validation produces ~250+ identical warnings for this cell at ~2s intervals, causing extreme slowness that looks like a hang
Root Cause Hypothesis
The cell is created during Bowyer-Watson cavity filling without proper orientation normalization. In 3D, orientation is canonicalized post-insertion (cells are reordered to positive orientation), but the 4D path may be missing this normalization step.
Investigation Steps
- Trace cell creation: determine which insertion index first creates
CellKey(29v7) with negative orientation
- Check if orientation normalization (
normalize_cell_orientation or equivalent) is applied in the 4D cavity-filling code path
- Compare the 3D and 4D orientation normalization paths for discrepancies
Fix Strategy
Ensure orientation normalization is applied to all newly created cells in the cavity-filling code, regardless of dimension. This should be straightforward if the normalization exists for 3D but is missing or conditional for 4D.
Secondary Issue: Debug-Mode Warning Spam
The negative-orientation cell causes PLManifoldStrict validation to emit ~250+ identical warnings. Consider rate-limiting or deduplicating these warnings to prevent debug-mode runs from appearing hung.
References
Co-Authored-By: Oz oz-agent@warp.dev
Summary
During 4D 100-point batch construction, a cell (
CellKey(29v7), vertices[6v1, 2v1, 9v1, 11v1, 7v1]) is created withorientation=-1(negative geometric orientation). This cell persists throughout construction and causes 88 of 100 subsequent vertex insertions to be skipped as degeneracies.Reproducer
DELAUNAY_LARGE_DEBUG_N_4D=100 DELAUNAY_LARGE_DEBUG_ALLOW_SKIPS=1 \ cargo test --release --test large_scale_debug debug_large_scale_4d \ -- --ignored --nocapture0x9B7786C999C56A16, ball distribution (radius=100)orientation=-1Root Cause Hypothesis
The cell is created during Bowyer-Watson cavity filling without proper orientation normalization. In 3D, orientation is canonicalized post-insertion (cells are reordered to positive orientation), but the 4D path may be missing this normalization step.
Investigation Steps
CellKey(29v7)with negative orientationnormalize_cell_orientationor equivalent) is applied in the 4D cavity-filling code pathFix Strategy
Ensure orientation normalization is applied to all newly created cells in the cavity-filling code, regardless of dimension. This should be straightforward if the normalization exists for 3D but is missing or conditional for 4D.
Secondary Issue: Debug-Mode Warning Spam
The negative-orientation cell causes PLManifoldStrict validation to emit ~250+ identical warnings. Consider rate-limiting or deduplicating these warnings to prevent debug-mode runs from appearing hung.
References
tests/large_scale_debug.rssrc/core/algorithms/incremental_insertion.rssrc/core/triangulation.rsdocs/KNOWN_ISSUES_4D.mdCo-Authored-By: Oz oz-agent@warp.dev