You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AdaptiveKernel::in_sphere() already uses Simulation of Simplicity (SoS) to deterministically resolve cospherical ties (never returns 0). However, AdaptiveKernel::orientation() intentionally preserves orientation == 0 for truly degenerate inputs, relying on algorithm-level coordinate perturbation retries to handle degeneracies.
This is inconsistent and less scientifically correct than applying SoS uniformly to both predicates, as CGAL does. For a library supporting quantum gravity research (CDT, Regge calculus), the triangulation is the spacetime — perturbation-based retries introduce a non-physical, non-deterministic source of randomness into the ensemble. SoS eliminates this: same input → same triangulation, always.
Current behavior
AdaptiveKernel::orientation(): exact via Bareiss, returns 0 for truly degenerate input (line 493-496 of kernel.rs: "No SoS: orientation must reflect true geometry so that zero-volume (degenerate) cells are detected, not masked.")
AdaptiveKernel::in_sphere(): exact + SoS fallback, never returns 0
Algorithm-level handling: insert_transactional() retries with coordinate perturbation when is_retryable() returns true (includes DegenerateOrientation)
Proposed change
Apply SoS to AdaptiveKernel::orientation() so it never returns 0, matching the insphere behavior. This requires:
AdaptiveKernel::orientation(): call sos_orientation_sign() when exact determinant is 0
Separate degeneracy detection: add explicit volume/degeneracy checks where the algorithm currently relies on orientation == 0:
build_initial_simplex — reject collinear/coplanar input via volume check
Blocks refactor: orthogonalize the error hierarchy #262 (error hierarchy orthogonalization): the error hierarchy should reflect the actual failure modes after SoS is applied, not the current perturbation-retry design
References: Edelsbrunner & Mücke, "Simulation of Simplicity" (1990); Seidel, "The Nature and Meaning of Perturbations in Geometric Computing" (1998)
Summary
AdaptiveKernel::in_sphere()already uses Simulation of Simplicity (SoS) to deterministically resolve cospherical ties (never returns 0). However,AdaptiveKernel::orientation()intentionally preservesorientation == 0for truly degenerate inputs, relying on algorithm-level coordinate perturbation retries to handle degeneracies.This is inconsistent and less scientifically correct than applying SoS uniformly to both predicates, as CGAL does. For a library supporting quantum gravity research (CDT, Regge calculus), the triangulation is the spacetime — perturbation-based retries introduce a non-physical, non-deterministic source of randomness into the ensemble. SoS eliminates this: same input → same triangulation, always.
Current behavior
AdaptiveKernel::orientation(): exact via Bareiss, returns 0 for truly degenerate input (line 493-496 ofkernel.rs: "No SoS: orientation must reflect true geometry so that zero-volume (degenerate) cells are detected, not masked.")AdaptiveKernel::in_sphere(): exact + SoS fallback, never returns 0insert_transactional()retries with coordinate perturbation whenis_retryable()returns true (includesDegenerateOrientation)Proposed change
Apply SoS to
AdaptiveKernel::orientation()so it never returns 0, matching the insphere behavior. This requires:AdaptiveKernel::orientation(): callsos_orientation_sign()when exact determinant is 0orientation == 0:build_initial_simplex— reject collinear/coplanar input via volume checkfind_visible_boundary_facets— hull coplanarity detectionapply_bistellar_flip_with_k— zero-volume cell prevention (currentlyFlipError::DegenerateCell)canonicalize_positive_orientation_for_cells— currently skipsorientation == 0cellsGeometricError::DegenerateOrientationbecomes unreachable forAdaptiveKernelusers; the retryable error category shrinksMotivation
is_retryable()logicRelationship to other issues
Files most affected
src/geometry/kernel.rs—AdaptiveKernel::orientation()src/geometry/sos.rs— already implementssos_orientation_sign()src/core/triangulation.rs— orientation canonicalization, validationsrc/core/algorithms/flips.rs—resolve_zero_orientation,DegenerateCellsrc/core/algorithms/incremental_insertion.rs— hull extension visibilitysrc/core/delaunay_triangulation.rs— construction pathsCo-Authored-By: Oz oz-agent@warp.dev