Skip to content

Test more error paths and refactorization, and update the docs - #54

Merged
ViralBShah merged 1 commit into
mainfrom
test-coverage-and-docs
Oct 30, 2026
Merged

ViralBShah merged 1 commit into
mainfrom
test-coverage-and-docs

Conversation

@ViralBShah

Copy link
Copy Markdown
Member

Follows a review of test quality and coverage on main. Merged across Julia 1.10 and 1.13, line coverage of src/KLU.jl goes from 91.4% to 95.8%. The more important gap is one line coverage can't show: no test checked a dimension mismatch, because each check and its throw share a line. #53 fixes the bugs the review found.

Tests

These are folded into existing testsets:

  • DimensionMismatch from klu, ldiv! and klu!, for plain, adjoint and transposed solves
  • The klu! pattern check, including that a failure leaves the factorization usable
  • Singular refactorization with each of check and allowsingular, and recovery from it
  • Complex matrices as right-hand sides of a real factorization
  • klu_refactor!, K.R, propertynames(K, true), trylock, show on an unfactored object, and the kluerror codes

Docs

  • Add sections on reusing and checking a factorization, and list klu_factor! and copy in the API
  • Fix the dead KLU User Guide links, which returned 404, and the Float64 cross-reference warnings
  • Correct the documented relation between K and A: Rs needs Diagonal, and p and q are the row and column permutations
  • Fix the klu! arguments, which listed forms it doesn't accept, and some typos

The new section says klu! computes the first factorization after klu(A; full_factor = false), which needs #53. Merge #53 first.

Still uncovered

What remains is mostly kluerror branches for libklu failures that are hard to trigger, along with dead code: increment and the Base.adjoint method for Julia before 1.10. The klu! methods that convert nzval from other element types are covered once #53's test is in.

src/wrappers.jl is at 39%. It's generated, and most of its functions are never called, which is what pulls Codecov's project figure down to about 52%.

Testing

The full suite passes locally on Linux with Julia 1.13 and 1.10 at -t 2. The docs build with no warnings or errors, other than the expected note that deployment is skipped locally.

🤖 Generated with Claude Code

Line coverage hides that no test checked a dimension mismatch, since a check and its throw
share a line. Also cover the pattern check of klu!, singular refactorization and recovery,
complex matrices as right-hand sides, klu_refactor!, and error codes.

Docs: add sections on reusing and checking a factorization, list klu_factor! and copy in the
API, fix the dead KLU User Guide links and the Float64 cross-reference warnings, correct the
relation between K and A, and fix the klu! arguments and typos.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ViralBShah
ViralBShah force-pushed the test-coverage-and-docs branch from 3738fb1 to 3966679 Compare October 30, 2026 21:17
@codecov

codecov Bot commented Oct 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.17%. Comparing base (56b9e81) to head (3966679).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #54      +/-   ##
==========================================
+ Coverage   71.26%   73.17%   +1.90%     
==========================================
  Files           2        2              
  Lines         630      630              
==========================================
+ Hits          449      461      +12     
+ Misses        181      169      -12     

☔ 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.

@ViralBShah
ViralBShah merged commit 1c872bf into main Oct 30, 2026
8 checks passed
@ViralBShah
ViralBShah deleted the test-coverage-and-docs branch October 30, 2026 21:20
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