Skip to content

refactor!: rename public cell APIs to simplex nomenclature#393

Merged
acgetchell merged 3 commits into
mainfrom
refactor/323-simplex-nomenclature
May 17, 2026
Merged

refactor!: rename public cell APIs to simplex nomenclature#393
acgetchell merged 3 commits into
mainfrom
refactor/323-simplex-nomenclature

Conversation

@acgetchell
Copy link
Copy Markdown
Owner

  • Replace cell-oriented public types, methods, error variants, maps, and diagnostics with simplex terminology across TDS, triangulation, construction, repair, flips, examples, benches, docs, and tests.
  • Preserve typed construction and insertion error context for cavity filling, explicit construction summaries, focused preludes, and Delaunay repair diagnostics under the simplex API.
  • Remove redundant integration tests whose coverage is now exercised by unit, property, and public API tests.
  • Move Codacy SARIF filtering into a tested support script and simplify Cargo package metadata.

BREAKING CHANGE: Cell-named public APIs are renamed to their simplex equivalents, including Cell/CellKey, cell iterators and counts, explicit cell construction, cell-oriented error variants, and cell-named topology maps.

Resolves #323

- Replace cell-oriented public types, methods, error variants, maps, and diagnostics with simplex terminology across TDS, triangulation, construction, repair, flips, examples, benches, docs, and tests.
- Preserve typed construction and insertion error context for cavity filling, explicit construction summaries, focused preludes, and Delaunay repair diagnostics under the simplex API.
- Remove redundant integration tests whose coverage is now exercised by unit, property, and public API tests.
- Move Codacy SARIF filtering into a tested support script and simplify Cargo package metadata.

BREAKING CHANGE: Cell-named public APIs are renamed to their simplex equivalents, including Cell/CellKey, cell iterators and counts, explicit cell construction, cell-oriented error variants, and cell-named topology maps.

Resolves #323
@acgetchell acgetchell self-assigned this May 17, 2026
@acgetchell acgetchell enabled auto-merge (squash) May 17, 2026 09:44
@codacy-production
Copy link
Copy Markdown

codacy-production Bot commented May 17, 2026

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 223 complexity

Metric Results
Complexity 223

View in Codacy

🟢 Coverage 90.72% diff coverage · +0.01% coverage variation

Metric Results
Coverage variation +0.01% coverage variation (-1.00%)
Diff coverage 90.72% diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (655ff4c) 61005 55190 90.47%
Head commit (e2d4979) 61626 (+621) 55757 (+567) 90.48% (+0.01%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#393) 8576 7780 90.72%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 17, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 642ebd1a-a148-451c-b0e0-a9993d8615b4

📥 Commits

Reviewing files that changed from the base of the PR and between d5080cf and e2d4979.

📒 Files selected for processing (1)
  • benches/ci_performance_suite.rs

Walkthrough

This PR adds a Codacy SARIF filtering script and workflow hook, continues the public and internal Cell-to-Simplex API migration across core geometry and triangulation code, and refreshes benchmarks, examples, tests, and repository documentation to match the renamed simplex-based interfaces.

Changes

Simplex migration and workflow updates

Layer / File(s) Summary
Codacy SARIF filtering workflow
.github/workflows/codacy.yml, scripts/ci/filter_codacy_sarif.py, scripts/tests/test_filter_codacy_sarif.py, CONTRIBUTING.md, docs/dev/tooling-alignment.md
The Codacy upload step now runs a standalone SARIF filter/split script that keeps repository-owned Opengrep findings and records upload state for later workflow steps.
Core simplex data structures and queries
src/core/adjacency.rs, src/core/boundary.rs, src/core/facet.rs, src/core/vertex.rs, src/core/collections/*, src/core/traits/*, src/core/util/{canonical_points,facet_keys,facet_utils,jaccard}.rs
Core topology types, maps, buffers, facet and boundary helpers, vertex incident tracking, and related utilities now use simplex-based names, keys, caches, and errors.
Geometry and topology simplex validation
src/geometry/..., src/topology/..., src/core/util/delaunay_validation.rs, tests/example_workflows.rs
Convex hull, predicates, quality metrics, Delaunay diagnostics, Euler counting, and topology validation/reporting now operate on simplex-based contracts and diagnostics.
Triangulation construction, repair, and edit APIs
src/triangulation/{builder,delaunayize,diagnostics,flips,locality}.rs, src/core/algorithms/pl_manifold_repair.rs, src/core/operations.rs, src/lib.rs
Explicit construction, repair budgets, flip entry points, telemetry, locality helpers, insertion hints, fallback rebuild payload handling, and crate re-exports were renamed to simplex-based APIs.
Examples, benchmarks, and validation coverage
benches/*, examples/*, tests/*
Benchmarks and examples were updated to simplex-based iteration and counts, a new triangulation-and-hull workflow example and integration test were added, and broad test coverage was migrated to simplex names and behaviors.
Repository documentation refresh
README.md, AGENTS.md, docs/*, examples/README.md, tests/README.md, Cargo.toml
Repository guides, specs, API docs, roadmap text, example listings, and packaging metadata were updated to match simplex terminology and the revised example and validation references.

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120 minutes

Possibly related issues

  • Issue 350 — benches/ci_performance_suite.rs adds convex hull query benchmarks and rewires 4D flip benchmarks around simplex-based handles in the same benchmark area.

Possibly related PRs

  • acgetchell/delaunay#301: Both PRs change src/triangulation/builder.rs explicit construction paths and related ExplicitConstructionError handling.
  • acgetchell/delaunay#346: Both PRs update src/triangulation/delaunayize.rs fallback rebuild snapshot and restore behavior for preserved payload data.
  • acgetchell/delaunay#50: Both PRs modify src/geometry/algorithms/convex_hull.rs, including hull cache and facet-adjacency handling.

Poem

🐇 I hopped through cells and found simplices bright,
Renamed the burrow paths to make them right.
SARIF got sorted in a tidy trail,
Hulls and flips now twitch without a fail.
With docs and tests in clover neatly spun,
this rabbit thumps: the refactor run is done.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/323-simplex-nomenclature

@coderabbitai coderabbitai Bot added documentation Improvements or additions to documentation enhancement New feature or request rust Pull requests that update rust code breaking change geometry Geometry-related issues api topology labels May 17, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 17, 2026

Codecov Report

❌ Patch coverage is 93.77071% with 94 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.46%. Comparing base (655ff4c) to head (e2d4979).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/triangulation/builder.rs 81.90% 38 Missing ⚠️
src/core/util/delaunay_validation.rs 92.12% 13 Missing ⚠️
src/geometry/quality.rs 90.51% 13 Missing ⚠️
src/geometry/algorithms/convex_hull.rs 82.75% 10 Missing ⚠️
src/triangulation/delaunayize.rs 93.06% 7 Missing ⚠️
src/core/algorithms/pl_manifold_repair.rs 95.52% 3 Missing ⚠️
src/triangulation/locality.rs 98.02% 3 Missing ⚠️
src/core/facet.rs 98.68% 2 Missing ⚠️
src/geometry/util/triangulation_generation.rs 75.00% 2 Missing ⚠️
src/core/traits/facet_cache.rs 93.33% 1 Missing ⚠️
... and 2 more
Additional details and impacted files
@@           Coverage Diff            @@
##             main     #393    +/-   ##
========================================
  Coverage   90.45%   90.46%            
========================================
  Files          61       61            
  Lines       60801    61422   +621     
========================================
+ Hits        55000    55567   +567     
- Misses       5801     5855    +54     
Flag Coverage Δ
unittests 90.46% <93.77%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 10

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (6)
src/core/collections/key_maps.rs (1)

138-170: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Add deprecated compatibility aliases for renamed public key-map types to provide a one-release migration path.

The BREAKING CHANGE in commit 9601f6b renamed public types from Cell* nomenclature to Simplex* without deprecated aliases, violating the guideline: "New functionality must be additive; ... never silently rename or remove a public item." Downstream users have no safe migration path. Add deprecated aliases pointing to the new names:

Compatibility shim
 pub type UuidToSimplexKeyMap = FastHashMap<Uuid, SimplexKey>;
+#[deprecated(note = "Renamed to UuidToSimplexKeyMap")]
+pub type UuidToCellKeyMap = UuidToSimplexKeyMap;
@@
 pub type SimplexKeySet = FastHashSet<SimplexKey>;
+#[deprecated(note = "Renamed to SimplexKeySet")]
+pub type CellKeySet = SimplexKeySet;
@@
 pub type KeyBasedSimplexMap<V> = FastHashMap<SimplexKey, V>;
+#[deprecated(note = "Renamed to KeyBasedSimplexMap")]
+pub type KeyBasedCellMap<V> = KeyBasedSimplexMap<V>;

Also applies to: 227-227

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/core/collections/key_maps.rs` around lines 138 - 170, Add deprecated
compatibility aliases for the renamed public types so downstream code has a
one-release migration path: add #[deprecated(note = "renamed to SimplexKeySet;
use SimplexKeySet instead")] pub type CellKeySet = SimplexKeySet; and
#[deprecated(note = "renamed to UuidToSimplexKeyMap; use UuidToSimplexKeyMap
instead")] pub type UuidToCellKeyMap = UuidToSimplexKeyMap; place these aliases
adjacent to the existing SimplexKeySet and UuidToSimplexKeyMap typedefs and
ensure they are public so consumers receive deprecation warnings but their code
continues to compile.
src/core/util/delaunay_validation.rs (1)

740-759: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Keep the debug witness search consistent with the validator.

This loop re-runs robust_insphere directly and skips the D≥4 artifact suppression in first_delaunay_violation_witness(). In near-degenerate cases the debug output can therefore report a different "offending" vertex than the validator would accept. Reuse first_offending_vertex() here and only look up the point for logging.

♻️ Suggested change
-    let mut offending: Option<(VertexKey, Point<T, D>)> = None;
-
-    for (test_vkey, test_vertex) in tds.vertices() {
-        if simplex_vertex_keys.contains(&test_vkey) {
-            continue;
-        }
-
-        match robust_insphere(&simplex_vertex_points, test_vertex.point()) {
-            Ok(InSphere::INSIDE) => {
-                offending = Some((test_vkey, *test_vertex.point()));
-                break;
-            }
-            Ok(InSphere::BOUNDARY | InSphere::OUTSIDE) => {}
-            Err(e) => {
-                tracing::warn!(
-                    "[Delaunay debug] robust_insphere error while searching for offending vertex in simplex {first_simplex_key:?}: {e}",
-                );
-            }
-        }
-    }
+    let offending = first_offending_vertex(tds, first_simplex_key)
+        .and_then(|off_vkey| tds.vertex(off_vkey).map(|v| (off_vkey, *v.point())));
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/core/util/delaunay_validation.rs` around lines 740 - 759, The loop
re-runs robust_insphere and can disagree with the validator; instead call
first_offending_vertex() (the same helper used by
first_delaunay_violation_witness()) to get the offending VertexKey for the given
simplex and tds, then only look up the Point for logging (use the returned
VertexKey to fetch the point from tds.vertices()). Replace the manual
robust_insphere iteration in this block with a call to first_offending_vertex()
and set offending to Some((vkey, *point)) only after fetching the point for
logging; preserve the existing warning path but avoid re-evaluating
robust_insphere here.
src/lib.rs (1)

996-1058: ⚠️ Potential issue | 🟠 Major | 🏗️ Heavy lift

Keep deprecated Cell* aliases in the public façades for one release.

These façade modules now only re-export the simplex names, so existing downstream imports like delaunay::tds::Cell, CellKey, FacetToCellsMap, or prelude::query::Cell hard-break immediately. Please keep deprecated aliases/re-exports here for one release so downstream users get a migration window instead of an all-at-once rename.

As per coding guidelines New functionality must be additive; use crate::prelude::* (or focused preludes like prelude::triangulation, prelude::query) for ergonomic re-exports; never silently rename or remove a public item.

Also applies to: 1113-1136, 1200-1206, 1488-1494, 1609-1625

src/triangulation/builder.rs (1)

1938-1950: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Update the Phase-2 algorithm docs to match the new quotient-selection implementation.

The code no longer just extracts a “central sub-complex” and rewires its boundary; it now normalizes lifted simplices, searches a closed candidate subset, and rebuilds quotient representatives from that selection. This block should describe that flow, and it should point back to the numbered entry in REFERENCES.md instead of relying only on raw CGAL links.

As per coding guidelines, "Algorithms must cite their source (Shewchuk, Bowyer–Watson, Edelsbrunner, Preparata–Shamos, etc.) in REFERENCES.md and document their conditioning behavior in code documentation".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/triangulation/builder.rs` around lines 1938 - 1950, Update the Phase-2
documentation block in builder.rs to reflect the new quotient-selection
implementation: replace the old "extract central sub-complex and rewire
boundary" description with steps that say you normalize lifted simplices, search
a closed candidate subset of simplices, and rebuild quotient representatives
from that selection (and then rebuild incident-simplex associations), and add a
cross-reference to the specific numbered entry in REFERENCES.md (instead of only
CGAL links); locate the Phase-2 doc block around the existing comments for the
algorithm in builder.rs and update its text accordingly so it accurately names
the normalization, candidate search, and quotient-rebuild phases.
src/geometry/algorithms/convex_hull.rs (1)

223-229: 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

Preserve the old error variant for one deprecation cycle.

Renaming ConvexHullConstructionError::AdjacentCellResolutionFailed to AdjacentSimplexResolutionFailed is a source break for downstream matches on a public enum. Please keep a deprecated compatibility variant for one release instead of removing it outright.

As per coding guidelines: New functionality must be additive; use crate::prelude::* (or focused preludes like prelude::triangulation, prelude::query) for ergonomic re-exports; never silently rename or remove a public item

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/geometry/algorithms/convex_hull.rs` around lines 223 - 229, Reintroduce
the old enum variant to maintain source compatibility: add back
ConvexHullConstructionError::AdjacentCellResolutionFailed with the same field
signature (#[source] source: TdsError) and mark it #[deprecated(note = "Renamed
to AdjacentSimplexResolutionFailed; will be removed in next release")] so
downstream match arms keep working; keep the new AdjacentSimplexResolutionFailed
variant as-is, ensure both variants use the same error text/structure, and
(optionally) add a short doc comment pointing users to the new name.
src/geometry/quality.rs (1)

474-513: ⚠️ Potential issue | 🟠 Major | 🏗️ Heavy lift

Use a dimension-consistent degeneracy threshold in normalized_volume.

Line 478 and Line 507 compare a length-scale epsilon against volume and avg_edge_length^D. In D >= 2, that makes small but well-shaped simplices fail as “degenerate”, so normalized_volume stops being scale-invariant despite the docstring. Please compare a dimensionless quantity instead, or scale the tolerance to L^D before these checks.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/geometry/quality.rs` around lines 474 - 513, The checks in
normalized_volume use a length-scale epsilon (from scale_aware_epsilon) to
compare against a D-dimensional quantity (volume and edge_length_power), causing
dimension mismatch; fix by making comparisons dimensionally consistent — either
raise epsilon to the Dth power (epsilon_pow = epsilon^D) before comparing to
volume and edge_length_power, or normalize the volume by edge_length_power
(volume / edge_length_power) and compare that dimensionless ratio to epsilon.
Concretely, in the block using scale_aware_epsilon(&points) and the variables
volume, avg_edge_length, and edge_length_power, compute a dimension-consistent
threshold (e.g., let epsilon_pow = epsilon repeated-multiply D times or compute
normalized = volume / edge_length_power) and then replace the comparisons "if
volume < epsilon" and "if edge_length_power < epsilon" with comparisons against
epsilon_pow or compare normalized against epsilon; keep the same
QualityDegeneracyMeasure variants (Volume, AverageEdgeLength, EdgeLengthPower)
and include the same diagnostic fields in the returned QualityError.
🧹 Nitpick comments (2)
src/triangulation/flips.rs (1)

19-19: ⚡ Quick win

Add a one-release deprecated alias for CellKey in this public re-export surface.

This rename is consistent, but a temporary deprecated alias here would reduce downstream breakage during migration.

♻️ Suggested compatibility shim
 pub use crate::tds::{EdgeKey, FacetHandle, SimplexKey, VertexKey};
+#[deprecated(note = "Renamed to `SimplexKey`; use `SimplexKey` instead.")]
+pub type CellKey = SimplexKey;

As per coding guidelines, “New functionality must be additive; ... never silently rename or remove a public item.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/triangulation/flips.rs` at line 19, Add a one-release deprecated public
alias named CellKey that points to the existing SimplexKey in the same re-export
surface so downstream code can continue to compile during migration;
specifically, next to the existing pub use crate::tds::{EdgeKey, FacetHandle,
SimplexKey, VertexKey} add a public re-export that aliases SimplexKey as CellKey
and mark it #[deprecated(..., since = "<next-release>")] with a note instructing
users to use SimplexKey instead, then remove the alias in the following release.
src/core/vertex.rs (1)

353-377: ⚡ Quick win

Consider a deprecated incident_cell() bridge here.

This new public accessor lands without a compatibility shim for the old name. A one-release deprecated alias would give downstream crates a migration window instead of forcing a flag-day rename.

As per coding guidelines, "New functionality must be additive; use crate::prelude::* (or focused preludes like prelude::triangulation, prelude::query) for ergonomic re-exports; never silently rename or remove a public item."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/core/vertex.rs` around lines 353 - 377, Add a one-release deprecated
bridge named incident_cell that forwards to the new incident_simplex: create a
pub const fn incident_cell(&self) -> Option<SimplexKey> that simply returns
self.incident_simplex, annotate it with #[deprecated(note = "renamed to
`incident_simplex`; will be removed in a future release")] plus the same
#[inline] and #[must_use] attributes and a doc comment pointing callers to
incident_simplex so downstream crates get a migration window while preserving
the existing API surface.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/roadmap.md`:
- Line 66: The roadmap entry incorrectly states a rename `Simplex` → `Simplex`;
update the description to reflect the intended breaking change `Cell` →
`Simplex` and adjust the surrounding sentence so it reads something like "rename
`Cell` → `Simplex` and implement unit-sphere normalization for …"; locate the
line mentioning `Simplex` → `Simplex` and replace it with `Cell` → `Simplex`,
ensuring any references to the old/new type names elsewhere in the same
paragraph are consistent with the PR objective (`#323`).

In `@src/core/algorithms/pl_manifold_repair.rs`:
- Around line 23-25: The doc comment is wrong: pick_worst_simplex() actually
sorts with b.score.total_cmp(&a.score) so higher scores win; update the
module-level comment to state the removal order is by descending quality (i.e.,
higher score first) rather than "ascending quality", and keep the rest of the
tie-breakers (canonicalized vertex tuple, simplex UUID) as-is so the description
matches pick_worst_simplex().

In `@src/core/boundary.rs`:
- Around line 170-172: The current expression using
facet_to_simplices.get(&facet_key).is_some_and(|simplices| simplices.len() == 1)
silently treats multiplicities != 1 as "not boundary"; change it to explicitly
match the entry from facet_to_simplices for facet_key and return Err(...) when
simplices.len() > 1 (a topology error), Ok(true) when len() == 1, and Ok(false)
when None; apply the same change to the other identical occurrence referenced
(the block around the second facet_to_simplices.get(&facet_key) use) so invalid
multiplicities surface as errors instead of being classified as interior.

In `@src/core/facet.rs`:
- Around line 242-246: Add the #[must_use] attribute to the public wrapper/view
types to prevent callers from accidentally ignoring returned handles/views:
annotate the FacetHandle struct and the FacetView type (or struct) with
#[must_use]; locate the declarations for FacetHandle and the public FacetView
(the second occurrence noted around the other wrapper definitions) and prepend
#[must_use] above each public type declaration so the compiler will warn when
results are discarded.

In `@src/core/traits/facet_cache.rs`:
- Around line 26-29: Update the documentation comment to use the current API
name: replace the mistaken reference to build_facet_to_simplices_hashmap() with
the actual method name build_facet_to_simplices_map() in the docs for the
FacetCache trait so readers are pointed to the correct helper.

In `@src/triangulation/builder.rs`:
- Around line 717-718: insert_simplex_with_mapping() and
assign_incident_simplices() are returning raw TriangulationConstructionError
values instead of wrapping them in the advertised explicit-construction wrapper;
change their error returns so any TriangulationConstructionError (duplicate
simplex, facet-sharing, incident-assignment failure, etc.) is converted into the
ExplicitConstruction variant (e.g.
DelaunayTriangulationConstructionError::ExplicitConstruction(...) or the
project’s ExplicitConstructionError wrapper) before being propagated. Locate
those functions and replace direct early returns or ? usages that yield
TriangulationConstructionError with mapped errors (map_err / map or equivalent)
that construct the ExplicitConstruction wrapper so callers matching on
DelaunayTriangulationConstructionError::ExplicitConstruction will observe these
cases.

In `@src/triangulation/delaunayize.rs`:
- Around line 622-635: When config.fallback_rebuild is enabled, take the
snapshot_rebuild_state from dt.as_triangulation().tds before calling
repair_facet_oversharing so the snapshot reflects the pre-repair topology; store
the (vertices, simplex_data) and then call
repair_facet_oversharing(dt.tds_mut_for_repair(), &pl_config). If
repair_facet_oversharing returns Err, use the pre-captured snapshot to drive the
fallback rebuild_preserving_data(&dt.as_triangulation().kernel, &vertices,
&simplex_data) (and return FallbackSimplexDataSnapshotFailed only if the initial
snapshot call itself failed), ensuring both the happy path and the fallback
branch reuse the same saved snapshot instead of attempting snapshotting after
mutation.

In `@src/triangulation/locality.rs`:
- Around line 19-23: Add deprecated shims for the public renames so callers
don't break: for the struct LocalConflictSeedSimplices create a
#[deprecated(note = "renamed to LocalConflictSeedSimplices; will be removed in a
future release")] pub type CellConflictSeedSimplices =
LocalConflictSeedSimplices (and analogous #[deprecated] pub fn aliases for any
renamed functions), and do the same for the other renamed public items in this
module (the later renamed types/functions referenced in the review). Ensure each
shim uses the original public name, points to the new symbol (e.g.,
LocalConflictSeedSimplices), includes a clear deprecation note, and re-export
these shims from the crate prelude (or prelude::triangulation) so downstream
callers get a one-release migration path.

In `@tests/proptest_triangulation.rs`:
- Around line 151-152: Remove the overly strict assumptions that drop valid
single-simplex cases: delete the prop_assume!(simplices_considered > 1) and
prop_assume!(matched_simplices >= 2) lines and replace them with a single
relaxed assumption prop_assume!(matched_simplices >= 1) so only at least one
matched simplex is required (refer to the prop_assume! calls and the variables
simplices_considered and matched_simplices to locate the change).

In `@tests/triangulation_builder.rs`:
- Around line 451-457: Add a precondition that the Delaunay triangulation has at
least one simplex before using Iterator::all so the test isn't vacuously true;
specifically, insert an assertion such as assert!(dt.number_of_simplices() > 0)
(or assert!(dt.simplices().count() > 0)) immediately before the existing check
that calls dt.simplices().all(...), leaving the rest of the
periodic_vertex_offsets()/number_of_vertices() assertion unchanged so the test
actually verifies per-simplex offsets were populated.

---

Outside diff comments:
In `@src/core/collections/key_maps.rs`:
- Around line 138-170: Add deprecated compatibility aliases for the renamed
public types so downstream code has a one-release migration path: add
#[deprecated(note = "renamed to SimplexKeySet; use SimplexKeySet instead")] pub
type CellKeySet = SimplexKeySet; and #[deprecated(note = "renamed to
UuidToSimplexKeyMap; use UuidToSimplexKeyMap instead")] pub type
UuidToCellKeyMap = UuidToSimplexKeyMap; place these aliases adjacent to the
existing SimplexKeySet and UuidToSimplexKeyMap typedefs and ensure they are
public so consumers receive deprecation warnings but their code continues to
compile.

In `@src/core/util/delaunay_validation.rs`:
- Around line 740-759: The loop re-runs robust_insphere and can disagree with
the validator; instead call first_offending_vertex() (the same helper used by
first_delaunay_violation_witness()) to get the offending VertexKey for the given
simplex and tds, then only look up the Point for logging (use the returned
VertexKey to fetch the point from tds.vertices()). Replace the manual
robust_insphere iteration in this block with a call to first_offending_vertex()
and set offending to Some((vkey, *point)) only after fetching the point for
logging; preserve the existing warning path but avoid re-evaluating
robust_insphere here.

In `@src/geometry/algorithms/convex_hull.rs`:
- Around line 223-229: Reintroduce the old enum variant to maintain source
compatibility: add back
ConvexHullConstructionError::AdjacentCellResolutionFailed with the same field
signature (#[source] source: TdsError) and mark it #[deprecated(note = "Renamed
to AdjacentSimplexResolutionFailed; will be removed in next release")] so
downstream match arms keep working; keep the new AdjacentSimplexResolutionFailed
variant as-is, ensure both variants use the same error text/structure, and
(optionally) add a short doc comment pointing users to the new name.

In `@src/geometry/quality.rs`:
- Around line 474-513: The checks in normalized_volume use a length-scale
epsilon (from scale_aware_epsilon) to compare against a D-dimensional quantity
(volume and edge_length_power), causing dimension mismatch; fix by making
comparisons dimensionally consistent — either raise epsilon to the Dth power
(epsilon_pow = epsilon^D) before comparing to volume and edge_length_power, or
normalize the volume by edge_length_power (volume / edge_length_power) and
compare that dimensionless ratio to epsilon. Concretely, in the block using
scale_aware_epsilon(&points) and the variables volume, avg_edge_length, and
edge_length_power, compute a dimension-consistent threshold (e.g., let
epsilon_pow = epsilon repeated-multiply D times or compute normalized = volume /
edge_length_power) and then replace the comparisons "if volume < epsilon" and
"if edge_length_power < epsilon" with comparisons against epsilon_pow or compare
normalized against epsilon; keep the same QualityDegeneracyMeasure variants
(Volume, AverageEdgeLength, EdgeLengthPower) and include the same diagnostic
fields in the returned QualityError.

In `@src/triangulation/builder.rs`:
- Around line 1938-1950: Update the Phase-2 documentation block in builder.rs to
reflect the new quotient-selection implementation: replace the old "extract
central sub-complex and rewire boundary" description with steps that say you
normalize lifted simplices, search a closed candidate subset of simplices, and
rebuild quotient representatives from that selection (and then rebuild
incident-simplex associations), and add a cross-reference to the specific
numbered entry in REFERENCES.md (instead of only CGAL links); locate the Phase-2
doc block around the existing comments for the algorithm in builder.rs and
update its text accordingly so it accurately names the normalization, candidate
search, and quotient-rebuild phases.

---

Nitpick comments:
In `@src/core/vertex.rs`:
- Around line 353-377: Add a one-release deprecated bridge named incident_cell
that forwards to the new incident_simplex: create a pub const fn
incident_cell(&self) -> Option<SimplexKey> that simply returns
self.incident_simplex, annotate it with #[deprecated(note = "renamed to
`incident_simplex`; will be removed in a future release")] plus the same
#[inline] and #[must_use] attributes and a doc comment pointing callers to
incident_simplex so downstream crates get a migration window while preserving
the existing API surface.

In `@src/triangulation/flips.rs`:
- Line 19: Add a one-release deprecated public alias named CellKey that points
to the existing SimplexKey in the same re-export surface so downstream code can
continue to compile during migration; specifically, next to the existing pub use
crate::tds::{EdgeKey, FacetHandle, SimplexKey, VertexKey} add a public re-export
that aliases SimplexKey as CellKey and mark it #[deprecated(..., since =
"<next-release>")] with a note instructing users to use SimplexKey instead, then
remove the alias in the following release.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: f2c9afde-c494-49d8-9242-3ace2b3e07f6

📥 Commits

Reviewing files that changed from the base of the PR and between 655ff4c and 9601f6b.

📒 Files selected for processing (114)
  • .github/workflows/codacy.yml
  • AGENTS.md
  • CONTRIBUTING.md
  • Cargo.toml
  • README.md
  • REFERENCES.md
  • benches/README.md
  • benches/ci_performance_suite.rs
  • benches/profiling_suite.rs
  • benches/tds_clone.rs
  • docs/ORIENTATION_SPEC.md
  • docs/api_design.md
  • docs/code_organization.md
  • docs/dev/debug_env_vars.md
  • docs/dev/rust.md
  • docs/dev/tooling-alignment.md
  • docs/diagnostics.md
  • docs/invariants.md
  • docs/numerical_robustness_guide.md
  • docs/production_review_remediation_checklist.md
  • docs/property_testing_summary.md
  • docs/roadmap.md
  • docs/topology.md
  • docs/validation.md
  • docs/workflows.md
  • examples/convex_hull_3d_1000_points.rs
  • examples/delaunayize_repair.rs
  • examples/diagnostics.rs
  • examples/memory_analysis.rs
  • examples/numerical_robustness.rs
  • examples/pachner_roundtrip_4d.rs
  • examples/topology_editing_2d_3d.rs
  • examples/triangulation_3d_1000_points.rs
  • examples/zero_allocation_iterator_demo.rs
  • scripts/ci/filter_codacy_sarif.py
  • scripts/tests/test_filter_codacy_sarif.py
  • src/core/adjacency.rs
  • src/core/algorithms/flips.rs
  • src/core/algorithms/incremental_insertion.rs
  • src/core/algorithms/locate.rs
  • src/core/algorithms/pl_manifold_repair.rs
  • src/core/boundary.rs
  • src/core/collections/aliases.rs
  • src/core/collections/buffers.rs
  • src/core/collections/helpers.rs
  • src/core/collections/key_maps.rs
  • src/core/collections/secondary_maps.rs
  • src/core/collections/triangulation_maps.rs
  • src/core/edge.rs
  • src/core/facet.rs
  • src/core/operations.rs
  • src/core/simplex.rs
  • src/core/tds.rs
  • src/core/traits/boundary_analysis.rs
  • src/core/traits/data_type.rs
  • src/core/traits/facet_cache.rs
  • src/core/triangulation.rs
  • src/core/util/canonical_points.rs
  • src/core/util/delaunay_validation.rs
  • src/core/util/facet_keys.rs
  • src/core/util/facet_utils.rs
  • src/core/util/jaccard.rs
  • src/core/vertex.rs
  • src/geometry/algorithms/convex_hull.rs
  • src/geometry/kernel.rs
  • src/geometry/predicates.rs
  • src/geometry/quality.rs
  • src/geometry/robust_predicates.rs
  • src/geometry/traits/coordinate.rs
  • src/geometry/util/triangulation_generation.rs
  • src/lib.rs
  • src/topology/characteristics/euler.rs
  • src/topology/characteristics/validation.rs
  • src/topology/manifold.rs
  • src/topology/traits/global_topology_model.rs
  • src/topology/traits/topological_space.rs
  • src/triangulation/builder.rs
  • src/triangulation/delaunay.rs
  • src/triangulation/delaunayize.rs
  • src/triangulation/diagnostics.rs
  • src/triangulation/flips.rs
  • src/triangulation/locality.rs
  • tests/README.md
  • tests/allocation_api.rs
  • tests/check_perturbation_stats.rs
  • tests/circumsphere_debug_tools.rs
  • tests/conflict_region_verification.rs
  • tests/dedup_batch_construction.rs
  • tests/delaunay_edge_cases.rs
  • tests/delaunay_incremental_insertion.rs
  • tests/delaunay_public_api_coverage.rs
  • tests/delaunay_repair_fallback.rs
  • tests/delaunayize_workflow.rs
  • tests/euler_characteristic.rs
  • tests/insert_with_statistics.rs
  • tests/k3_cycle_predicate.rs
  • tests/large_scale_debug.rs
  • tests/prelude_exports.rs
  • tests/proptest_delaunay_triangulation.proptest-regressions
  • tests/proptest_delaunay_triangulation.rs
  • tests/proptest_euler_characteristic.rs
  • tests/proptest_facet.rs
  • tests/proptest_flips.rs
  • tests/proptest_orientation.rs
  • tests/proptest_serialization.rs
  • tests/proptest_simplex.rs
  • tests/proptest_tds.rs
  • tests/proptest_triangulation.rs
  • tests/public_topology_api.rs
  • tests/regressions.rs
  • tests/semgrep/src/project_rules/rust_style.rs
  • tests/tds_orientation.rs
  • tests/trait_bound_ergonomics.rs
  • tests/triangulation_builder.rs
💤 Files with no reviewable changes (6)
  • tests/check_perturbation_stats.rs
  • Cargo.toml
  • tests/tds_orientation.rs
  • tests/conflict_region_verification.rs
  • tests/k3_cycle_predicate.rs
  • tests/delaunay_public_api_coverage.rs

Comment thread docs/roadmap.md Outdated
Comment thread src/core/algorithms/pl_manifold_repair.rs
Comment thread src/core/boundary.rs Outdated
Comment thread src/core/facet.rs
Comment thread src/core/traits/facet_cache.rs
Comment thread src/triangulation/builder.rs Outdated
Comment thread src/triangulation/delaunayize.rs
Comment thread src/triangulation/locality.rs
Comment thread tests/proptest_triangulation.rs Outdated
Comment thread tests/triangulation_builder.rs
- Report invalid boundary facet multiplicities as topology errors instead of classifying them as interior facets.
- Preserve typed explicit-construction failures for simplex creation and TDS assembly so callers can match the documented error path.
- Use pre-repair Delaunayize snapshots for fallback rebuilds and make normalized-volume degeneracy checks dimensionally consistent.
- Move benchmark-like examples into tests and benchmarks, replacing the large 3D examples with focused topology-editing and triangulation/hull workflows.

BREAKING CHANGE: ExplicitConstructionError::SimplexCreation now exposes a SimplexValidationError source, and example target names were consolidated to topology_editing and triangulation_and_hull.
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@benches/ci_performance_suite.rs`:
- Line 1080: The benchmark uses outside_point = Point::new([10.0; D]) which can
lie inside the generated hull, causing
find_visible_facets/find_nearest_visible_facet to exercise the inside-point
path; replace the hardcoded [10.0; D] with a guaranteed exterior point (e.g.,
scale coordinates beyond the input range or compute a point offset from the hull
centroid by a large radius) so outside_point is always outside the hull used by
the benchmarks, and update any related comments/tests referencing outside_point
to reflect the new construction.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 8db139b0-c748-4a8f-8921-9e0ff56121c1

📥 Commits

Reviewing files that changed from the base of the PR and between 9601f6b and d5080cf.

📒 Files selected for processing (30)
  • README.md
  • benches/ci_performance_suite.rs
  • docs/api_design.md
  • docs/code_organization.md
  • docs/roadmap.md
  • examples/README.md
  • examples/convex_hull_3d_1000_points.rs
  • examples/memory_analysis.rs
  • examples/pachner_roundtrip_4d.rs
  • examples/point_comparison_and_hashing.rs
  • examples/topology_editing.rs
  • examples/triangulation_3d_1000_points.rs
  • examples/triangulation_and_hull.rs
  • examples/zero_allocation_iterator_demo.rs
  • src/core/algorithms/pl_manifold_repair.rs
  • src/core/boundary.rs
  • src/core/facet.rs
  • src/core/traits/boundary_analysis.rs
  • src/core/traits/facet_cache.rs
  • src/core/util/delaunay_validation.rs
  • src/geometry/quality.rs
  • src/lib.rs
  • src/triangulation/builder.rs
  • src/triangulation/delaunayize.rs
  • tests/allocation_api.rs
  • tests/example_workflows.rs
  • tests/pachner_roundtrip.rs
  • tests/prelude_exports.rs
  • tests/proptest_triangulation.rs
  • tests/triangulation_builder.rs
💤 Files with no reviewable changes (5)
  • examples/triangulation_3d_1000_points.rs
  • examples/convex_hull_3d_1000_points.rs
  • examples/memory_analysis.rs
  • examples/zero_allocation_iterator_demo.rs
  • examples/pachner_roundtrip_4d.rs
✅ Files skipped from review due to trivial changes (3)
  • docs/roadmap.md
  • docs/code_organization.md
  • README.md
🚧 Files skipped from review as they are similar to previous changes (10)
  • tests/allocation_api.rs
  • docs/api_design.md
  • src/core/algorithms/pl_manifold_repair.rs
  • src/triangulation/delaunayize.rs
  • src/core/traits/facet_cache.rs
  • src/core/util/delaunay_validation.rs
  • src/core/boundary.rs
  • src/lib.rs
  • src/geometry/quality.rs
  • src/triangulation/builder.rs

Comment thread benches/ci_performance_suite.rs Outdated
- Derive convex hull query points from benchmark triangulation bounds instead of fixed coordinates.
- Preflight the computed point with ConvexHull::is_point_outside so visibility benchmarks measure the exterior path.
@acgetchell acgetchell merged commit 48935d5 into main May 17, 2026
22 checks passed
@acgetchell acgetchell deleted the refactor/323-simplex-nomenclature branch May 17, 2026 23:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api breaking change documentation Improvements or additions to documentation enhancement New feature or request geometry Geometry-related issues rust Pull requests that update rust code topology

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor!: rename Cell → Simplex to avoid std::cell::Cell confusion

1 participant