Skip to content

feat(validation)!: add certified realization intersection fast paths - #531

Merged
acgetchell merged 3 commits into
mainfrom
fix/506-release-audit
Jul 26, 2026
Merged

feat(validation)!: add certified realization intersection fast paths#531
acgetchell merged 3 commits into
mainfrom
fix/506-release-audit

Conversation

@acgetchell

Copy link
Copy Markdown
Owner

BREAKING CHANGE: Rust 1.97.1 is now the minimum supported Rust version.

Closes #506

- Add orientation, shared-face, and exact linear-program certificates before the conservative active-set fallback.
- Dispatch finite floating-point systems through la-stack's exact Bareiss solver while preserving rational fallbacks and typed witnesses.
- Bound the 4D and 5D release regressions and document the broader evidence deferred to #482 and #483.
- Align release documentation and tooling with Rust 1.97.1.
- Refresh pinned development tools and override Semgrep's vulnerable MCP dependency with the patched release.
- Harden Tectonic dependency discovery across supported development environments.

BREAKING CHANGE: Rust 1.97.1 is now the minimum supported Rust version.

Closes #506
@acgetchell acgetchell self-assigned this Jul 26, 2026
@acgetchell
acgetchell enabled auto-merge (squash) July 26, 2026 05:49
@coderabbitai

coderabbitai Bot commented Jul 26, 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: 5e76f268-1faa-4ce3-b9f3-33d08e842b1a

📥 Commits

Reviewing files that changed from the base of the PR and between c348d83 and 75ea22f.

📒 Files selected for processing (2)
  • src/geometry/realization.rs
  • src/geometry/util/simplex_lp.rs
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/geometry/realization.rs
  • src/geometry/util/simplex_lp.rs

Walkthrough

The PR standardizes the Rust 1.97.1 baseline, locks Semgrep execution, updates Tectonic and paper artifact tooling, adds exact Level-4 simplex intersection validation, and bounds high-dimensional regression tests.

Changes

Release validation and tooling

Layer / File(s) Summary
Rust 1.97.1 baseline
Cargo.toml, rust-toolchain.toml, README.md, AGENTS.md, clippy.toml, docs/roadmap.md, papers/ARTIFACT.md
Rust metadata, toolchain configuration, release documentation, and roadmap references now use Rust 1.97.1.
Locked analysis and native tool setup
.github/workflows/semgrep-sarif.yml, justfile, pyproject.toml, semgrep.yaml, scripts/*.py, tests/semgrep/..., docs/dev/*
Semgrep uses locked dependencies, Python annotation rules and fixtures are added, and Tectonic setup expands native dependency discovery and installation handling.
Reference PDF artifact validation
scripts/paper_check.py, scripts/tests/test_paper_check.py, .github/workflows/papers.yml, justfile, docs/dev/commands.md
Paper checks compare generated and tracked PDFs page-by-page using extracted text and page geometry, with CI validation for generated assets.

Geometry validation

Layer / File(s) Summary
Exact simplex intersection validation
src/geometry/matrix.rs, src/geometry/realization.rs, src/geometry/util/simplex_lp.rs, src/lib.rs, papers/validation.tex, docs/architecture/module_map.md
Runtime exact solving, orientation-based exits, confinement certificates, revised-simplex LP classification, rational fallbacks, and Level-4 validation documentation are added or revised.
Validation coverage and bounded scales
tests/large_scale_debug.rs, .config/nextest.toml, docs/limitations.md, scripts/tests/test_benchmark_models.py, justfile
4D/5D slow-test defaults are reduced and scheduled with the full worker pool, while malformed benchmark interval cases receive additional rejection coverage.

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

Sequence Diagram(s)

sequenceDiagram
  participant Validator as simplex intersection validator
  participant Confinement as shared-face confinement
  participant LP as revised-simplex LP solver
  participant ExactSolver as exact runtime solver
  Validator->>Confinement: test shared-face confinement
  Validator->>LP: classify intersection constraints
  LP->>ExactSolver: solve exact basis systems
  ExactSolver-->>LP: return rational solution or error
  LP-->>Validator: return classification or witness
Loading

Possibly related issues

Possibly related PRs

Suggested labels: enhancement, rust, geometry

Poem

A rabbit checks each simplex face,
While locked tools hop into place.
Rust pins shine in orderly rows,
And bounded slow tests gently close.
Exact paths guard geometry.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: certified realization intersection fast paths.
Description check ✅ Passed The description matches the PR’s core changes and release/tooling updates.
Linked Issues check ✅ Passed The changes address #506’s core release, MSRV, validation, documentation, and tooling requirements.
Out of Scope Changes check ✅ Passed I don't see unrelated changes; the edits stay within release, validation, tooling, and docs work.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 100.00%.
✨ 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/506-release-audit

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

@codacy-production

codacy-production Bot commented Jul 26, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 312 complexity

Metric Results
Complexity 312

View in Codacy

🟢 Coverage 83.73% diff coverage · -0.19% coverage variation

Metric Results
Coverage variation -0.19% coverage variation (-1.00%)
Diff coverage 83.73% diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (91efa35) 80351 73552 91.54%
Head commit (75ea22f) 81860 (+1509) 74775 (+1223) 91.34% (-0.19%)

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 (#531) 1727 1446 83.73%

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 enhancement New feature or request geometry Geometry-related issues rust Pull requests that update rust code labels Jul 26, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (2)
src/geometry/realization.rs (2)

1025-1152: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoff

Consider moving the LP machinery into its own module.

realization.rs now carries a complete revised-simplex implementation (exact + provisional f64 phases, artificial-variable handling, dual certificates, matrix helpers) alongside realization validation. A src/geometry/simplex_lp.rs (or similar) submodule with a narrow intersection_via_linear_program surface would keep the validator readable and let the solver be unit-tested independently.

Also applies to: 1154-1432

🤖 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/realization.rs` around lines 1025 - 1152, Move the
revised-simplex LP implementation and its supporting exact/provisional phases,
artificial-variable handling, dual certificates, and matrix helpers from
realization.rs into a dedicated geometry submodule such as simplex_lp.rs. Keep
intersection_via_linear_program as the narrow public-facing surface used by
realization validation, update imports and visibility accordingly, and preserve
the existing LP behavior while making the solver independently testable.

2622-2660: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Extend the new LP tests beyond D=2.

All three new intersection_via_linear_program cases are 2D triangles, so the Phase I/II paths, the dual certificate, and exact_axis_through_shared_face are only exercised at the smallest dimension where most fast paths short-circuit early. Adding a 3D shared-facet case and a 3D crossing case (and ideally 4D/5D) would cover the code that this PR is actually optimizing.

As per coding guidelines, "dimension-generic tests should cover dimensions 2 through 5 whenever feasible".

Also applies to: 2780-2800

🤖 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/realization.rs` around lines 2622 - 2660, Extend the tests for
intersection_via_linear_program beyond 2D triangles to cover dimensions 3
through 5 where feasible. Add explicit 3D shared-facet and crossing cases, and
include analogous higher-dimensional cases when practical, while preserving
assertions for valid intersections and exercising Phase I/II, dual-certificate,
and exact_axis_through_shared_face paths.

Source: Coding guidelines

🤖 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 `@justfile`:
- Around line 1143-1214: Update ensure_tectonic_build_dependencies and its
required_pkg_config_packages logic in justfile (1143-1214) to apply Tectonic’s
platform-specific prerequisites: do not require fontconfig on macOS, and require
openssl on non-Apple platforms. Update the corresponding prerequisite
documentation in docs/dev/commands.md (635-645) to describe the same conditional
requirements.

In `@papers/validation.tex`:
- Around line 48-64: Resolve the authorship conflict in the introduction around
the paragraphs beginning “Applications such as Causal Dynamical Triangulation”
and “Delaunay is a Rust library”: if the prose is not authored by Adam, replace
both narrative paragraphs with concise \AuthorTodo{...} prompts, preserving the
intended topics and outline structure; otherwise leave the prose unchanged.

---

Nitpick comments:
In `@src/geometry/realization.rs`:
- Around line 1025-1152: Move the revised-simplex LP implementation and its
supporting exact/provisional phases, artificial-variable handling, dual
certificates, and matrix helpers from realization.rs into a dedicated geometry
submodule such as simplex_lp.rs. Keep intersection_via_linear_program as the
narrow public-facing surface used by realization validation, update imports and
visibility accordingly, and preserve the existing LP behavior while making the
solver independently testable.
- Around line 2622-2660: Extend the tests for intersection_via_linear_program
beyond 2D triangles to cover dimensions 3 through 5 where feasible. Add explicit
3D shared-facet and crossing cases, and include analogous higher-dimensional
cases when practical, while preserving assertions for valid intersections and
exercising Phase I/II, dual-certificate, and exact_axis_through_shared_face
paths.
🪄 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: c3b197b9-c823-40b7-98b3-ed326b485db1

📥 Commits

Reviewing files that changed from the base of the PR and between 91efa35 and 35167ec.

⛔ Files ignored due to path filters (2)
  • papers/validation.pdf is excluded by !**/*.pdf
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (19)
  • .config/nextest.toml
  • .github/workflows/semgrep-sarif.yml
  • AGENTS.md
  • Cargo.toml
  • README.md
  • clippy.toml
  • docs/dev/commands.md
  • docs/dev/tooling-alignment.md
  • docs/limitations.md
  • docs/roadmap.md
  • justfile
  • papers/ARTIFACT.md
  • papers/validation.tex
  • pyproject.toml
  • rust-toolchain.toml
  • scripts/tests/test_benchmark_models.py
  • src/geometry/matrix.rs
  • src/geometry/realization.rs
  • tests/large_scale_debug.rs

Comment thread justfile Outdated
Comment thread papers/validation.tex
@codecov

codecov Bot commented Jul 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.72901% with 281 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.32%. Comparing base (91efa35) to head (75ea22f).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/geometry/util/simplex_lp.rs 82.79% 274 Missing ⚠️
src/geometry/realization.rs 93.96% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #531      +/-   ##
==========================================
- Coverage   91.51%   91.32%   -0.20%     
==========================================
  Files          87       88       +1     
  Lines       80140    81649    +1509     
==========================================
+ Hits        73343    74566    +1223     
- Misses       6797     7083     +286     
Flag Coverage Δ
unittests 91.32% <83.72%> (-0.20%) ⬇️

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.

- Move exact revised-simplex intersection solving behind a private geometry
  utility while preserving fallback and certificate behavior.
- Harden Level 4 shared-facet and crossing classification through 5D,
  including singular and high-range barycentric systems.
- Compare paper artifacts structurally across platforms and align Tectonic
  prerequisites without pkgx.
- Refresh validation artifacts and uv notebook dependencies, and enforce
  native Python 3.14 annotation semantics.

Closes #506

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 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 `@src/geometry/realization.rs`:
- Around line 695-727: Update intersection_is_confined_by_orientation to first
require coordinate identity for all shared labels, reusing the existing
coordinates_are_identical check and matching the simplex_lp.rs behavior. Return
false when shared-label coordinates differ, before applying the orientation
shortcut; preserve the current orientation logic for identical coordinates.

In `@src/geometry/util/simplex_lp.rs`:
- Around line 1370-1400: Guard all non-finite intermediates before calling
rational_from_f64 in the shared-coordinate confinement path: validate each axis
value after 1024 scaling and validate the dot-product-derived provisional affine
values before conversion, returning None on failure. Mirror the post-scaling
finiteness validation used by filtered_single_shared_vertex_confinement, while
preserving the existing successful affine computation.
🪄 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: a7b3c88e-9894-45c1-ad16-344f6405ac2f

📥 Commits

Reviewing files that changed from the base of the PR and between 35167ec and c348d83.

⛔ Files ignored due to path filters (8)
  • docs/assets/validation/validation_hierarchy.png is excluded by !**/*.png
  • docs/assets/validation/validation_level_1_element_validity.png is excluded by !**/*.png
  • docs/assets/validation/validation_level_2_combinatorial_consistency.png is excluded by !**/*.png
  • docs/assets/validation/validation_level_3_intrinsic_pl_topology.png is excluded by !**/*.png
  • docs/assets/validation/validation_level_4_valid_realization.png is excluded by !**/*.png
  • docs/assets/validation/validation_level_5_geometric_predicates.png is excluded by !**/*.png
  • papers/validation.pdf is excluded by !**/*.pdf
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (17)
  • .github/workflows/papers.yml
  • docs/architecture/module_map.md
  • docs/dev/commands.md
  • docs/dev/tooling-alignment.md
  • justfile
  • pyproject.toml
  • scripts/check_docs_version_sync.py
  • scripts/paper_check.py
  • scripts/tag_release.py
  • scripts/tests/test_check_docs_version_sync.py
  • scripts/tests/test_paper_check.py
  • semgrep.yaml
  • src/geometry/matrix.rs
  • src/geometry/realization.rs
  • src/geometry/util/simplex_lp.rs
  • src/lib.rs
  • tests/semgrep/scripts/tests/python_style.py
💤 Files with no reviewable changes (3)
  • scripts/tag_release.py
  • scripts/check_docs_version_sync.py
  • scripts/tests/test_check_docs_version_sync.py
🚧 Files skipped from review as they are similar to previous changes (2)
  • pyproject.toml
  • docs/dev/tooling-alignment.md

Comment thread src/geometry/realization.rs
Comment thread src/geometry/util/simplex_lp.rs
- Require coordinate-identical shared vertices before using orientation confinement.
- Reject non-finite scaled axes and affine offsets before exact conversion.
@acgetchell
acgetchell merged commit 36e68ab into main Jul 26, 2026
25 checks passed
@acgetchell
acgetchell deleted the fix/506-release-audit branch July 26, 2026 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request geometry Geometry-related issues rust Pull requests that update rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Finalize v0.8.0 release after Rust 1.97 dependency upgrades

1 participant