Skip to content

fix(api)!: report explicit topology preflight failures precisely - #512

Merged
acgetchell merged 1 commit into
mainfrom
fix/invariant-bugfixes
Jul 7, 2026
Merged

fix(api)!: report explicit topology preflight failures precisely#512
acgetchell merged 1 commit into
mainfrom
fix/invariant-bugfixes

Conversation

@acgetchell

Copy link
Copy Markdown
Owner
  • Add typed explicit-simplex duplicate and facet-sharing errors that preserve input simplex and vertex indices.
  • Preflight explicit topology from validated simplex specs before constructing TDS simplices.
  • Rename the Delaunay repair flip-budget fluent setters to make their repair scope explicit.
  • Repair the papers workflow TeX dependency setup for macOS runners.

BREAKING CHANGE: DelaunayRepairHeuristicConfig::with_max_flips and without_max_flips were renamed to with_delaunay_max_flips and without_delaunay_max_flips.

- Add typed explicit-simplex duplicate and facet-sharing errors that preserve input simplex and vertex indices.
- Preflight explicit topology from validated simplex specs before constructing TDS simplices.
- Rename the Delaunay repair flip-budget fluent setters to make their repair scope explicit.
- Repair the papers workflow TeX dependency setup for macOS runners.

BREAKING CHANGE: `DelaunayRepairHeuristicConfig::with_max_flips` and `without_max_flips` were renamed to `with_delaunay_max_flips` and `without_delaunay_max_flips`.
@acgetchell acgetchell self-assigned this Jul 7, 2026
@acgetchell
acgetchell enabled auto-merge (squash) July 7, 2026 15:51
@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

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: 570b08bc-79b6-4ec7-9b68-8e670f3e00e8

📥 Commits

Reviewing files that changed from the base of the PR and between 6d5020d and 1ff5859.

📒 Files selected for processing (15)
  • .github/workflows/papers.yml
  • docs/dev/commands.md
  • docs/dev/tooling-alignment.md
  • src/config.rs
  • src/core/algorithms/incremental_insertion.rs
  • src/core/tds/errors.rs
  • src/delaunay/builder.rs
  • src/delaunay/delaunayize.rs
  • src/delaunay/repair.rs
  • src/delaunay/serialization.rs
  • tests/benchmark_flip_fixtures.rs
  • tests/delaunay_repair_fallback.rs
  • tests/large_scale_debug.rs
  • tests/prelude_exports.rs
  • tests/triangulation_builder.rs

Walkthrough

Adds TdsError::DuplicateExplicitSimplices and TdsError::ExplicitFacetSharingViolation variants with corresponding TdsValidationFailure conversions, refactors explicit-topology validation in the builder to use simplex specs and index mappings, renames DelaunayRepairHeuristicConfig flip-cap methods, refactors config nonzero-count validation, and updates CI/docs/tests.

Changes

Explicit Topology Validation Errors

Layer / File(s) Summary
New TdsError variants and classification
src/core/tds/errors.rs
Adds DuplicateExplicitSimplices and ExplicitFacetSharingViolation variants with structured fields, updates TdsErrorKind classification, adds tests.
Explicit topology validation in builder
src/delaunay/builder.rs
Reworks build_explicit and validation helpers (validate_explicit_topology, reject_duplicate_explicit_simplices, reject_overshared_explicit_facets) to use simplex specs and index-to-key mapping, constructing simplices at insertion time.
TdsValidationFailure conversion and tests
src/core/algorithms/incremental_insertion.rs
Adds matching TdsValidationFailure variants, extends From<TdsError> conversion, and adds a unit test verifying preserved context.
Test suite updates for explicit errors
tests/prelude_exports.rs, tests/triangulation_builder.rs
Updates prelude export and triangulation builder tests to assert new error variants and payload fields.

Repair Heuristic Flip-Cap Rename

Layer / File(s) Summary
Builder method rename and usage
src/delaunay/repair.rs, src/delaunay/delaunayize.rs, tests/delaunay_repair_fallback.rs, tests/large_scale_debug.rs, tests/prelude_exports.rs
Renames with_max_flips/without_max_flips to with_delaunay_max_flips/without_delaunay_max_flips and updates all call sites and docs.

Nonzero Count Validation Refactor

Layer / File(s) Summary
validated_nonzero_count helper and usage
src/config.rs
Introduces a private generic validation helper and refactors GenerateConfig and PachnerStressConfig vertex-count validation to use it.

CI Tooling, Docs, and Fixture Updates

Layer / File(s) Summary
Papers workflow and docs updates
.github/workflows/papers.yml, docs/dev/commands.md, docs/dev/tooling-alignment.md
Makes chktex/basictex installation conditional and updates paper CI documentation accordingly.
Serialization test rename and new flip fixture
src/delaunay/serialization.rs, tests/benchmark_flip_fixtures.rs
Renames an internal fixture test for clarity and adds a minimal 3D k=1 flip roundtrip test.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related issues

Possibly related PRs

Suggested labels: bug, rust, breaking change, api

Poem

A rabbit hopped through explicit facets,
Found duplicates hiding in their brackets,
Renamed a flip cap, tidied a count,
Fixed the TeX build, no more surmount,
Thump thump — the tests all pass, hooray! 🐇✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: more precise reporting of explicit topology preflight failures.
Description check ✅ Passed The description accurately summarizes the typed explicit-topology errors, workflow fix, and setter rename.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ 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 fix/invariant-bugfixes

Comment @coderabbitai help to get the list of available commands.

@codacy-production

codacy-production Bot commented Jul 7, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 4 complexity

Metric Results
Complexity 4

View in Codacy

🟢 Coverage 100.00% diff coverage · +0.02% coverage variation

Metric Results
Coverage variation +0.02% coverage variation (-1.00%)
Diff coverage 100.00% diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (6d5020d) 80003 72839 91.05%
Head commit (1ff5859) 80105 (+102) 72948 (+109) 91.07% (+0.02%)

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 (#512) 149 149 100.00%

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 coderabbitai Bot added api breaking change bug Something isn't working rust Pull requests that update rust code labels Jul 7, 2026
@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.04%. Comparing base (6d5020d) to head (1ff5859).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #512      +/-   ##
==========================================
+ Coverage   91.02%   91.04%   +0.02%     
==========================================
  Files          88       88              
  Lines       79782    79884     +102     
==========================================
+ Hits        72620    72729     +109     
+ Misses       7162     7155       -7     
Flag Coverage Δ
unittests 91.04% <100.00%> (+0.02%) ⬆️

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

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

@acgetchell
acgetchell merged commit bbae9ed into main Jul 7, 2026
22 of 23 checks passed
@acgetchell
acgetchell deleted the fix/invariant-bugfixes branch July 7, 2026 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api breaking change bug Something isn't working rust Pull requests that update rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant