Repository navigation
Fix crashes on unfactored objects and bad permutations, and keep the singular status - #53
Merged
Merged
Conversation
…singular status - Reading K.p, K.q or K.Rs before factoring crashed in libklu. - klu_analyze! with permutations that are not zero-based crashed in libklu. The test for this never reached libklu, as klu_analyze! returns early on an analyzed object. - Solves and reading the factors reset common.status, so a singular factorization reported issuccess(F) == true afterwards, even after just printing it. - klu(...; check = false) threw on an invalid pattern. - klu! after klu(A; full_factor = false) failed and left the object unusable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #53 +/- ##
==========================================
+ Coverage 69.29% 71.26% +1.97%
==========================================
Files 2 2
Lines 622 630 +8
==========================================
+ Hits 431 449 +18
+ Misses 191 181 -10 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This was referenced Oct 30, 2026
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.
Fixes bugs found while reviewing test coverage on
main. Each one reproduced before the fix:KLUFactorization(A).p,.qor.Rs, or the same afterklu(A; full_factor = false)klu_sortArgumentErrorklu_analyze!(K, P, Q)with 1-based or invalid permutationsbtf_strongcompArgumentErrorklu(S; allowsingular = true)issuccessbecomestrueKLU_SINGULARklu(n, colptr, rowval, nzval; check = false)with an invalid patternKLU_INVALIDklu!(klu(A; full_factor = false), nzval)The lost status is the same bug as
rgrowthin #43: libklu resetscommon.statuson entry. It matters becausesolve!'s docs tell users to check that status.The existing "Permutation vectors" test passed 1-based vectors but never reached libklu, because
klu_analyze!returns early on an analyzed object. It now analyzes a new object with zero-based permutations, and the docstring says they're zero-based.Testing
The tests are folded into the existing testsets. The full suite passes locally on Linux with Julia 1.13 and 1.10 at
-t 2, and Aqua passes.🤖 Generated with Claude Code