Skip to content

chore: bump MSRV to Rust 1.95 and adopt new stable features#91

Merged
acgetchell merged 2 commits intomainfrom
chose/67-bump-msrv-1.95
Apr 20, 2026
Merged

chore: bump MSRV to Rust 1.95 and adopt new stable features#91
acgetchell merged 2 commits intomainfrom
chose/67-bump-msrv-1.95

Conversation

@acgetchell
Copy link
Copy Markdown
Owner

@acgetchell acgetchell commented Apr 20, 2026

Closes #67

  • Bump rust-version to 1.95 in Cargo.toml
  • Bump channel to 1.95.0 in rust-toolchain.toml
  • Add core::hint::cold_path() hints at cold/error branches:
    • src/exact.rs: validate_finite, validate_finite_vec, gauss_solve singular return, det_exact_f64 / solve_exact_f64 overflow returns, det_sign_exact Stage 2 Bareiss fallback
    • src/lu.rs: Lu::factor and Lu::solve_vec NonFinite / Singular returns
    • src/ldlt.rs: Ldlt::factor and Ldlt::solve_vec NonFinite / Singular returns
    • src/matrix.rs: det_direct D >= 5 fallback arm (legal because cold_path is const fn in 1.95) and det NonFinite / overflow scan
  • Refactor det_sign_exact Stage 1 fast filter to use match + if let guard with let-chain, replacing the tuple destructure; semantics unchanged

Test results (local just ci):

  • cargo fmt --all -- --check: clean
  • cargo clippy --workspace --all-targets --all-features -D warnings -W clippy::pedantic -W clippy::nursery -W clippy::cargo: clean
  • cargo test --features exact --lib: 258 passed, 0 failed
  • cargo test --features exact (doctests + examples): 31 passed, 0 failed
  • RUSTDOCFLAGS='-D warnings' cargo doc --no-deps --features exact: clean
  • python tests: 101 passed

Summary by CodeRabbit

Chores

  • Updated minimum required Rust toolchain version from 1.94 to 1.95.0. Users must upgrade their Rust installation before updating to this release.
  • Implemented compiler-level performance optimizations on error handling and fallback paths across matrix operations to improve runtime efficiency when encountering invalid inputs or edge cases.

Closes #67

- Bump rust-version to 1.95 in Cargo.toml
- Bump channel to 1.95.0 in rust-toolchain.toml
- Add core::hint::cold_path() hints at cold/error branches:
  - src/exact.rs: validate_finite, validate_finite_vec, gauss_solve
    singular return, det_exact_f64 / solve_exact_f64 overflow returns,
    det_sign_exact Stage 2 Bareiss fallback
  - src/lu.rs: Lu::factor and Lu::solve_vec NonFinite / Singular returns
  - src/ldlt.rs: Ldlt::factor and Ldlt::solve_vec NonFinite / Singular
    returns
  - src/matrix.rs: det_direct D >= 5 fallback arm (legal because
    cold_path is const fn in 1.95) and det NonFinite / overflow scan
- Refactor det_sign_exact Stage 1 fast filter to use match + if let
  guard with let-chain, replacing the tuple destructure; semantics
  unchanged

Test results (local `just ci`):
- cargo fmt --all -- --check: clean
- cargo clippy --workspace --all-targets --all-features
  -D warnings -W clippy::pedantic -W clippy::nursery -W clippy::cargo:
  clean
- cargo test --features exact --lib: 258 passed, 0 failed
- cargo test --features exact (doctests + examples): 31 passed, 0 failed
- RUSTDOCFLAGS='-D warnings' cargo doc --no-deps --features exact: clean
- python tests: 101 passed

Co-Authored-By: Oz <oz-agent@warp.dev>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 20, 2026

Warning

Rate limit exceeded

@acgetchell has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 38 minutes and 59 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 38 minutes and 59 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e194fdbd-0646-42ef-bab2-795018c530d5

📥 Commits

Reviewing files that changed from the base of the PR and between 0ab3c33 and f763b11.

📒 Files selected for processing (3)
  • src/ldlt.rs
  • src/lu.rs
  • src/matrix.rs
📝 Walkthrough

Walkthrough

Bumped minimum Rust version from 1.94 to 1.95 across toolchain configuration. Added core::hint::cold_path() compiler hints to error-return and fallback paths in matrix determinant and linear solver implementations to optimize common-case execution.

Changes

Cohort / File(s) Summary
Toolchain version bump
Cargo.toml, rust-toolchain.toml
Updated MSRV from Rust 1.94 to 1.95 in both configuration files.
Cold-path hints in exact determinant/solver
src/exact.rs
Added cold_path() calls on non-finite validation errors, refactored det_sign_exact Stage 1 from tuple destructuring to match with guard, unconditionally marked Bareiss fallback as cold path in Stage 2.
Cold-path hints in LU factorization/solve
src/lu.rs
Added cold_path() import and calls on all error-return paths for non-finite pivot/multiplier/sum detection and singular pivot checks.
Cold-path hints in LDLT factorization/solve
src/ldlt.rs
Added cold_path() calls immediately before non-finite and singular error returns during factorization and solve phases.
Cold-path hints in determinant computation
src/matrix.rs
Added cold_path() calls in det_direct() D≥5 fallback arm and before non-finite element scanning in det().

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related issues

  • Issue #67 directly describes this work: bumping MSRV to 1.95 and adopting core::hint::cold_path() for compiler hint optimization of error/fallback paths.

Possibly related PRs

  • PR #73: Modifies src/exact.rs det_sign_exact control flow and Bareiss path, directly overlaps with this PR's refactoring of the same function.
  • PR #34: Changes Matrix::det_direct behavior in src/matrix.rs, overlaps with this PR's det_direct cold-path additions.
  • PR #45: Adjusts det_sign_exact usage of det_errbound() and related control flow, directly related to this PR's refactoring of Stage 1.

Suggested labels

rust, performance, enhancement, optimization

Poem

🐰 A hop and a skip to Rust forty-five!
Cold paths now whisper when errors arrive,
The hot path runs swift while exceptions freeze—
Determinants dance through optimization's breeze.
Cheers to the hints that help compilers see. 🎉

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately summarizes the main changes: bumping MSRV to Rust 1.95 and adopting new stable features (cold_path, if-let guards), which are the primary focus across all modified files.
Linked Issues check ✅ Passed The PR successfully implements all core coding requirements from issue #67: bumped rust-version to 1.95, added cold_path() hints across exact/lu/ldlt/matrix modules on error paths and cold fallbacks, and refactored det_sign_exact Stage 1 with if-let guards.
Out of Scope Changes check ✅ Passed All changes are within scope of issue #67: Cargo.toml/rust-toolchain.toml toolchain updates, cold_path() additions across specified modules, and det_sign_exact refactoring. No unrelated modifications are present.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chose/67-bump-msrv-1.95

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 20, 2026

Codecov Report

❌ Patch coverage is 57.57576% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.58%. Comparing base (7f3d2e1) to head (f763b11).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
src/ldlt.rs 0.00% 9 Missing ⚠️
src/lu.rs 66.66% 3 Missing ⚠️
src/exact.rs 90.90% 1 Missing ⚠️
src/matrix.rs 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #91      +/-   ##
==========================================
- Coverage   90.26%   88.58%   -1.68%     
==========================================
  Files           5        5              
  Lines         452      482      +30     
==========================================
+ Hits          408      427      +19     
- Misses         44       55      +11     
Flag Coverage Δ
unittests 88.58% <57.57%> (-1.68%) ⬇️

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Add test cases to verify that LDLT and LU solvers, as well as determinant
calculations, correctly detect and return `LaError::NonFinite` when
intermediate calculations overflow to infinity despite having finite
inputs.

Refs: #67
@acgetchell acgetchell self-assigned this Apr 20, 2026
@acgetchell acgetchell added this to the v0.4.1 milestone Apr 20, 2026
@acgetchell acgetchell merged commit 56973bc into main Apr 20, 2026
10 checks passed
@acgetchell acgetchell deleted the chose/67-bump-msrv-1.95 branch April 20, 2026 18:27
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.

chore: bump MSRV to Rust 1.95 and adopt new stable features

1 participant