Repository navigation
perf: accelerate triangular rational solves - #278
Merged
Merged
Conversation
- Recognize upper and lower triangular systems through row permutations and solve by exact substitution with one reduction per component. - Preserve the general Bareiss path, canonical rational inputs, and typed singularity diagnostics without changing the public API. - Add permanent structured benchmarks and retain Rust 1.99 measurements: 11.15x faster prepared solves and 4.26x faster full adapters at D=8 on the reproduced triangular family. - Refresh the staged cc, syn, uv, Ruff, and Ty dependency/tooling pins. - Validation: just ci passes, including 1,002 Rust tests, 371 Python tests, doctests, examples, and benchmark compilation. Closes #246
Contributor
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #278 +/- ##
==========================================
+ Coverage 98.12% 98.14% +0.01%
==========================================
Files 14 14
Lines 7112 7160 +48
==========================================
+ Hits 6979 7027 +48
Misses 133 133
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
1 of 8 tasks
- Plan the stable-Rust v0.5.0 release sequence and conditional algebraic floating-point adoption, with compatible follow-up work in v0.5.1. - Defer expanded const generics until the required Generic Const Arguments capabilities are stable. - Clarify that research-repo-tools is a contributor development dependency. - Describe dense benchmark controls as row-permuted while preserving measured inputs and retained performance evidence. Refs #123, #246, #250
acgetchell
marked this pull request as ready for review
October 11, 2026 00:28
acgetchell
enabled auto-merge
October 11, 2026 00:28
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RationalMatrix::solvepreviously performed fraction-free elimination even when a row permutation made the system triangular. This adds structure recognition and direct exact substitution, reducing each solution component once. General and singular inputs retain the existing Bareiss path and typed singularity diagnostics. The public API, rational validation, and shared integer backend are unchanged.Permanent benchmarks cover diagonal, upper/lower triangular, row-permuted triangular, sparse, and dense systems through D=8 with dyadic and non-dyadic coefficients. Regressions check exact residuals and independent Gaussian agreement through D=0–8, including arbitrary permutations, wide rationals, mixed signs, zero RHS, and singular inputs.
On the reproduced row-permuted triangular family, comparable Rust 1.99 measurements on an Apple M4 Max give:
The full adapter beats the captured legacy Gaussian reference at every size 2–8, with non-overlapping marginal 95% intervals. The dense Hilbert solve is effectively unchanged; the dyadic dense control increases 0.73% for prepared solves and 1.77% for the full adapter. These are synthetic fixture results, with no whole-triangulation performance claim.
The performance study retains all measurements, raw samples, commands, source hashes, and limitations. Both timing phases used the same baseline lockfile. This PR also includes the staged
cc/synlockfile refresh and uv/Ruff/Ty updates; those later updates were not part of the timing runs.Validation:
just cipasses on the final dependency set, including 1,002 Rust tests, 371 Python tests, default/exact doctests, Clippy, documentation, examples, and benchmark compilation. Markdown and spelling checks pass; retained source and measurement hashes were verified.Closes #246
Summary by CodeRabbit