Skip to content

perf(solve): optimize exact and factorized solve kernels#152

Merged
acgetchell merged 1 commit into
mainfrom
perf/146-small-dim-solve-kernels
Jun 9, 2026
Merged

perf(solve): optimize exact and factorized solve kernels#152
acgetchell merged 1 commit into
mainfrom
perf/146-small-dim-solve-kernels

Conversation

@acgetchell

@acgetchell acgetchell commented Jun 9, 2026

Copy link
Copy Markdown
Owner
  • Split LU and LDLT solve paths so tiny matrices keep the direct kernels while larger fixed dimensions avoid extra substitution work.
  • Convert dyadic exact solve results directly to finite f64 and preserve UnrepresentableReason recovery semantics on strict conversion failures.
  • Modernize release branch commands and keep just recipes sorted.

Summary by CodeRabbit

Release Notes

  • Documentation

    • Updated release process guide with refined Git command recommendations.
  • Bug Fixes

    • Improved validation of exact solutions to correctly identify and reject non-dyadic denominators.
    • Enhanced overflow detection and error reporting in linear system solving.

- Split LU and LDLT solve paths so tiny matrices keep the direct kernels while larger fixed dimensions avoid extra substitution work.
- Convert dyadic exact solve results directly to finite f64 and preserve UnrepresentableReason recovery semantics on strict conversion failures.
- Modernize release branch commands and keep just recipes sorted.
@acgetchell acgetchell self-assigned this Jun 9, 2026
@coderabbitai

coderabbitai Bot commented Jun 9, 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: bd169edd-777c-4508-aaa1-f5af6a2c30d4

📥 Commits

Reviewing files that changed from the base of the PR and between 6d819df and 1690355.

📒 Files selected for processing (5)
  • docs/RELEASING.md
  • justfile
  • src/exact.rs
  • src/ldlt.rs
  • src/lu.rs

📝 Walkthrough

Walkthrough

This PR consolidates infrastructure updates, algorithmic refinements, and enhanced error handling across the linear algebra solver library. Documentation is modernized, build recipes reorganized, exact arithmetic conversion strengthened to enforce dyadic denominators, and LU/LDLT solvers optimized with dimension-aware substitution paths that maintain comprehensive non-finite overflow detection.

Changes

Linear algebra solver library improvements and maintenance

Layer / File(s) Summary
Release process documentation updates
docs/RELEASING.md
Git branch switching instructions updated from git checkout to git switch at initial main sync, release branch creation, and post-merge synchronization.
Build tooling recipe reorganization
justfile
Benchmark, GitHub Actions performance, shell, TOML validation, and citation-checking recipes are reorganized into logical sections, preserving all command invocations and parameters.
Exact-to-f64 conversion refactoring with index threading
src/exact.rs
exact_rational_to_finite_f64 enforces dyadic-only denominators and classifies failures by reason code. bigint_exp_to_finite_f64 now threads index: Option<usize> into all LaError::Unrepresentable results. New tests verify non-dyadic rejection and smallest subnormal acceptance.
LU solver forward-substitution dimension optimization
src/lu.rs
solve_finite uses dimension-dependent branches: small (D ≤ 4) materializes pivoted RHS separately; large (D > 4) fuses RHS reads into the substitution loop. Overflow detection and error reporting unchanged. New test covers fused path with engineered overflow.
LDLT solver back-substitution dimension optimization
src/ldlt.rs
solve_finite uses dimension-dependent strategies: small (D ≤ 4) direct summation over Lᵀ; large (D > 4) row-prefix scatter updates. Non-finite checks preserved. New test exercises scatter-based path with constructed overflow.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • acgetchell/la-stack#48: Introduces solve_exact_f64 whose exact-to-f64 conversion and error handling this PR refactors and re-parameterizes with index threading and dyadic enforcement.
  • acgetchell/la-stack#141: Modifies bigint_exp_to_finite_f64 and integer exponent handling in the exact feature; this PR extends its signature to thread component indices into unrepresentable errors.
  • acgetchell/la-stack#95: Modifies LU/LDLT forward and back-substitution paths; this PR optimizes those same paths with dimension-dependent branches and adds corresponding non-finite overflow tests.

Suggested labels

rust, enhancement, testing, documentation

Poem

🐰 Git switches forth on branches clean,
While recipes organize the build machine,
Dyadics dance in perfect form,
And solvers adapt to the norm,
Testing every overflow's might—
Another loop brings things just right! ✨

🚥 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 title clearly and accurately summarizes the main changes: performance optimizations to solve kernels (LU, LDLT, exact conversions) with dimension-dependent implementations.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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.

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

✨ 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 perf/146-small-dim-solve-kernels

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

@codecov

codecov Bot commented Jun 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.48936% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 98.14%. Comparing base (6d819df) to head (1690355).

Files with missing lines Patch % Lines
src/exact.rs 76.00% 12 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #152      +/-   ##
==========================================
- Coverage   98.25%   98.14%   -0.11%     
==========================================
  Files           7        7              
  Lines        3264     3343      +79     
==========================================
+ Hits         3207     3281      +74     
- Misses         57       62       +5     
Flag Coverage Δ
unittests 98.14% <91.48%> (-0.11%) ⬇️

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.

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

@acgetchell acgetchell merged commit 57809b2 into main Jun 9, 2026
18 checks passed
@acgetchell acgetchell deleted the perf/146-small-dim-solve-kernels branch June 9, 2026 03:24
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.

1 participant