Skip to content

feat(cgal)!: modernize the CGAL 6.2 integration boundary - #124

Merged
acgetchell merged 2 commits into
mainfrom
feat/102-modernize-cgal-6-2-integration
Jul 24, 2026
Merged

feat(cgal)!: modernize the CGAL 6.2 integration boundary#124
acgetchell merged 2 commits into
mainfrom
feat/102-modernize-cgal-6-2-integration

Conversation

@acgetchell

@acgetchell acgetchell commented Jul 24, 2026

Copy link
Copy Markdown
Owner
  • require the exact CGAL baseline and its supported compiler floors
  • adopt canonical CGAL simplex types, finite ranges, and metadata safeguards
  • make optional oneTBB concurrency and lock-grid ownership explicit
  • document and benchmark the supported integration contract

BREAKING CHANGE: CDT++ now requires exactly CGAL 6.2, GCC 13.3 or Clang 22 on those toolchains, and removes the legacy Face_handle_t alias.

Closes #102

Summary by CodeRabbit

  • New Features
    • Added a new configurable CGAL benchmark (workloads adjustable) and supporting scripts/recipes.
    • Introduced stricter correctness checking APIs (structural vs diagnostics-driven validation).
  • Bug Fixes
    • Improved validation for duplicate points and out-of-range time values.
    • Strengthened guarantees around concurrent operations (failed locks leave triangulation unchanged) and label/time preservation.
  • Documentation
    • Added/updated the CGAL 6.2 integration contract and refreshed testing expectations.
  • Chores
    • Tightened build/tooling requirements (CGAL 6.2 exact, higher compiler minimums, deprecation-as-errors option, toolchain workflow updates).

- require the exact CGAL baseline and its supported compiler floors
- adopt canonical CGAL simplex types, finite ranges, and metadata safeguards
- make optional oneTBB concurrency and lock-grid ownership explicit
- document and benchmark the supported integration contract

BREAKING CHANGE: CDT++ now requires exactly CGAL 6.2, GCC 13.3 or
Clang 22 on those toolchains, and removes the legacy Face_handle_t alias.

Closes #102
@acgetchell acgetchell self-assigned this Jul 24, 2026
@acgetchell
acgetchell enabled auto-merge July 24, 2026 00:10
@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

This change pins CGAL 6.2, updates compiler and parallel-triangulation configuration, modernizes CGAL handle and range usage, strengthens metadata and derived-state validation, adds integration tests and a benchmark, and documents the supported integration contract.

Changes

CGAL integration modernization

Layer / File(s) Summary
Build and triangulation type contract
CMakeLists.txt, cmake/StandardProjectSettings.cmake, include/Triangulation_traits.hpp, include/Settings.hpp
Build options, compiler gates, exact CGAL discovery, C++23 settings, and parallel/sequential triangulation type composition are updated.
Handle traversal and invariant enforcement
include/Foliated_triangulation.hpp, include/Utilities.hpp
Core helpers use CGAL handle ranges and constrained const forward ranges, while insertion, caching, facet storage, metadata traversal, and derived-state validation are strengthened.
Integration tests and benchmark workflow
tests/CGAL_integration_test.cpp, tests/Parallel_triangulation_test.cpp, tests/CGAL_benchmark.cpp, tests/CMakeLists.txt, Justfile
CGAL 6.2 contract tests, parallel lock-contention coverage, benchmark execution, and benchmark target wiring are added or updated.
Integration documentation and developer workflows
docs/cgal-integration.md, docs/api-boundary.md, README.md, .github/CONTRIBUTING.md, scripts/*, docs/ergodic-moves.md, include/Ergodic_moves_3.hpp
The CGAL integration contract, API-boundary references, correctness semantics, test-count documentation, static-analysis setup, benchmark command, and Slurm compiler version are updated.

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

Sequence Diagram(s)

sequenceDiagram
  participant Benchmark
  participant Delaunay_state
  participant FoliatedTriangulation
  participant Manifold
  Benchmark->>Delaunay_state: Construct insertion state
  Delaunay_state->>FoliatedTriangulation: Create detached triangulation
  FoliatedTriangulation->>Manifold: Reconstruct and validate manifold
  Manifold-->>Benchmark: Return topology counts and timings
Loading

Possibly related PRs

Poem

CGAL handles march in range,
Compiler gates rearrange.
Locks contend, then leave no trace,
Benchmarks measure every phase.
Six-point spheres keep labels bright.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 5.88% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main CGAL 6.2 integration modernization.
Linked Issues check ✅ Passed The changes align with #102 by updating CGAL APIs, concurrency, build contracts, tests, docs, and support boundaries.
Out of Scope Changes check ✅ Passed No clearly unrelated changes stand out; the benchmark, docs, scripts, and build updates all support the stated CGAL boundary work.
✨ 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 feat/102-modernize-cgal-6-2-integration

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 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 `@include/Foliated_triangulation.hpp`:
- Around line 1377-1426: Add a lightweight invariant-check path for move
validation and update detail::check_move()/Manifold::is_correct() to use it,
avoiding has_consistent_derived_state() and its cache-rebuilding scans on every
move. Keep has_consistent_derived_state() available for full validation, while
the fast path verifies only the essential structural invariants needed after a
move.

In `@tests/CGAL_integration_test.cpp`:
- Around line 92-100: Extract the repeated labelled-point verification loop into
a shared test helper, such as expect_labels_preserved, reusable by both
scenarios in CGAL_integration_test.cpp and Parallel_triangulation_test.cpp. The
helper should look up each point with foliated_triangulations::find_vertex<3>,
assert the vertex exists, and verify its info() matches the expected label;
replace each duplicated loop with calls to this helper.

In `@tests/Parallel_triangulation_test.cpp`:
- Around line 139-167: Document or explicitly validate the lock-grid colocation
assumption in the contention setup around candidate, contested_point, and
could_lock_zone. Prefer asserting that both points map to the same lock-grid
cell using the existing grid-cell/index API; otherwise add a concise comment
explaining the dependency on locking_box resolution and GV_BOUNDING_BOX_SIZE so
failures clearly identify the violated prerequisite.
🪄 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.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 0c0d76de-b078-4b88-9dd6-2c901752ce8e

📥 Commits

Reviewing files that changed from the base of the PR and between 67fa87f and ae7a39b.

📒 Files selected for processing (18)
  • .github/CONTRIBUTING.md
  • CMakeLists.txt
  • Justfile
  • README.md
  • cmake/StandardProjectSettings.cmake
  • docs/api-boundary.md
  • docs/cgal-integration.md
  • include/Foliated_triangulation.hpp
  • include/Settings.hpp
  • include/Triangulation_traits.hpp
  • include/Utilities.hpp
  • scripts/clang-tidy.sh
  • scripts/slurm.sh
  • tests/CGAL_benchmark.cpp
  • tests/CGAL_integration_test.cpp
  • tests/CMakeLists.txt
  • tests/Parallel_triangulation_test.cpp
  • tests/Tetrahedron_test.cpp
💤 Files with no reviewable changes (2)
  • cmake/StandardProjectSettings.cmake
  • include/Settings.hpp

Comment thread include/Foliated_triangulation.hpp Outdated
Comment thread tests/CGAL_integration_test.cpp Outdated
Comment thread tests/Parallel_triangulation_test.cpp Outdated
- keep move validation on structural, TDS, causal, and tracked-count checks
- provide opt-in full derived-cache diagnostics outside hot paths

BREAKING CHANGE: is_correct() now checks essential structural and causal invariants only. Call is_correct_with_diagnostics() when full derived-cache
consistency is required.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 `@include/Foliated_triangulation.hpp`:
- Around line 1377-1392: Update has_consistent_structure() to directly verify
that the cached m_cells, m_faces, and m_edges counts match the corresponding
Delaunay topology counts, while retaining the existing partition and invariant
checks. Ensure these O(1) cache-size comparisons are included in the fast
validation path used by is_structurally_correct() and check_move().
🪄 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.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 0d81f899-794c-49d0-a34a-4ccd43e7f001

📥 Commits

Reviewing files that changed from the base of the PR and between ae7a39b and f574f0f.

📒 Files selected for processing (9)
  • docs/cgal-integration.md
  • docs/ergodic-moves.md
  • include/Ergodic_moves_3.hpp
  • include/Foliated_triangulation.hpp
  • include/Manifold.hpp
  • tests/Apply_move_test.cpp
  • tests/CGAL_integration_test.cpp
  • tests/CGAL_test_helpers.hpp
  • tests/Parallel_triangulation_test.cpp

Comment thread include/Foliated_triangulation.hpp
@acgetchell
acgetchell merged commit 5e2c848 into main Jul 24, 2026
13 checks passed
@acgetchell
acgetchell deleted the feat/102-modernize-cgal-6-2-integration branch July 24, 2026 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Modernize CGAL 6.2 integration for current best practices

1 participant