fix(matrix): reject overflowed symmetry tolerance scaling#128
Conversation
- Enforce the tolerance contract around symmetry checks by surfacing scaled tolerance overflow as a typed non-finite intermediate error. - Document finite, non-negative tolerance requirements across tolerance-taking matrix APIs. - Add regression coverage for invalid tolerance construction and symmetry tolerance overflow. - Update exact examples to propagate typed crate errors instead of unwrapping. Closes #94
📝 WalkthroughWalkthroughThis PR enforces a unified tolerance validation contract across the crate. Tolerance parameters must be finite and non-negative; negative, NaN, and infinite values are explicitly rejected. Core library validation and tests establish the contract; matrix symmetry, decomposition, and vector operation methods document the requirement; examples convert to Result-based error handling. ChangesTolerance validation contract enforcement
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #128 +/- ##
==========================================
+ Coverage 99.45% 99.54% +0.08%
==========================================
Files 5 5
Lines 2383 2412 +29
==========================================
+ Hits 2370 2401 +31
+ Misses 13 11 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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 `@CHANGELOG.md`:
- Line 13: The CHANGELOG.md contains a manual entry ("Feat!(api): enforce
fallible numeric invariants [`adfc33b`]") that must not be edited by hand;
revert the manual edit to CHANGELOG.md and regenerate the file using the
changelog tooling (run either `just changelog` or `just changelog-unreleased
<version>` to prepend unreleased changes), then commit the regenerated
CHANGELOG.md instead of the manual change so the entry for commit adfc33b is
produced by the tool.
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: 97b22cbb-1621-4720-b8b2-0db5f0ee250e
📒 Files selected for processing (6)
CHANGELOG.mdexamples/exact_det_3x3.rsexamples/exact_solve_3x3.rssrc/lib.rssrc/matrix.rssrc/vector.rs
| ### Added | ||
|
|
||
| - Feat!(matrix): enforce fallible matrix invariants [`e26c283`](https://github.com/acgetchell/la-stack/commit/e26c28358b2358100353b2895441b68892e92cd7) | ||
| - Feat!(api): enforce fallible numeric invariants [`adfc33b`](https://github.com/acgetchell/la-stack/commit/adfc33b945b259721bd1067e797ed2e7d4ec0e6e) |
There was a problem hiding this comment.
Do not edit CHANGELOG.md manually.
This entry should be generated via the changelog tooling, not committed as a direct file edit. Please regenerate using just changelog (or just changelog-unreleased <version> for unreleased prepend) and commit the generated result instead.
Based on learnings: "Never edit CHANGELOG.md directly - it's auto-generated from git commits. Use just changelog to regenerate or just changelog-unreleased <version> to prepend unreleased changes."
🤖 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 `@CHANGELOG.md` at line 13, The CHANGELOG.md contains a manual entry
("Feat!(api): enforce fallible numeric invariants [`adfc33b`]") that must not be
edited by hand; revert the manual edit to CHANGELOG.md and regenerate the file
using the changelog tooling (run either `just changelog` or `just
changelog-unreleased <version>` to prepend unreleased changes), then commit the
regenerated CHANGELOG.md instead of the manual change so the entry for commit
adfc33b is produced by the tool.
Closes #94
Summary by CodeRabbit
New Features
Documentation
Tests