Add SciML test setup and correctness tests#2
Merged
Conversation
Restructure test/ around a GROUP env split (Core/QA, plus per-factorization subgroups), add Aqua + ExplicitImports QA, SafeTestsets isolation, and a GitHub Actions CI matrix. Substantially expands correctness coverage for cs_qr, cs_lu, cs_cholesky: known-answer matrices, identity / diagonal / tridiagonal cases, n=1 trivial case, input-matrix immutability, rhs immutability, multiple solves on one factorization, idempotent explicit finalize, cross-factorization consistency (QR vs LU on non-singular, QR vs LU vs Cholesky on SPD), LU pivoting on a zero-diagonal matrix, Hermitian (non-symmetric) Cholesky with complex off-diagonals, and overdetermined least-squares coefficient match against dense backslash. Two QA-driven source/compat fixes: - src/CXSparse.jl: `using LinearAlgebra` -> explicit `using LinearAlgebra: LinearAlgebra, ldiv!` (ExplicitImports). - Project.toml: add compat for Random and Test (Aqua). Bump julia compat 1.10 -> 1.11 to match the actual CXSparse_jll v4 SuiteSparse_jll requirement (resolver fails on 1.10). 626 tests pass on Julia 1.11. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
CXSparse_jll has two distinct version series in the General registry:
- 4.4.x — uses the upstream CXSparse 4.4 release version directly
- 400.400.200 — uses the SuiteSparse-bundle version scheme (4.4.0 → 400.400.200)
with looser SuiteSparse_jll compat that admits 7.7 and 7.8
The previous compat `"4"` selected only the 4.4.x series, which pins
SuiteSparse_jll ~7.7. Julia 1.12 ships SuiteSparse_jll 7.8.3 in its stdlib,
so resolution fails on 1.12 (CI was red on every Julia 1 / 1.12 job).
Allowing both series ("4, 400") lets the resolver pick the appropriate one
per Julia version. Tests pass on Julia 1.11 (v4.4.0) and Julia 1.12
(v400.400.200), 626 tests each.
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
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.
Summary
test/around aGROUPenv split (Core/QA, plus per-factorization subgroupsQR/LU/Cholesky/Cross)GROUP=QASafeTestsetsisolation for each test filecs_qr,cs_lu,cs_choleskyNew correctness tests
For each factorization and each
(Tv, Ti) ∈ {Float64, ComplexF64} × {Int32, Int64}:[2 1; 0 3] \ [4; 6] = [1; 2])n = 1trivial caseA.colptr/rowval/nzvalsnapshot equals post-factorization and post-solve statebis unchanged afterF \ bandldiv!(x, F, b)ldiv!returns the destination (identity test)finalize(F)is safe and idempotent (no double-free)cs_qr ≈ cs_lu ≈ dense\; on an SPD matrixcs_qr ≈ cs_lu ≈ cs_cholesky ≈ dense\tortol=1e-9Factorization-specific:
Adense \ b(the existing test only compared residual norms)QA-driven source/compat fixes
src/CXSparse.jl:using LinearAlgebra→using LinearAlgebra: LinearAlgebra, ldiv!(ExplicitImports flagged the implicit import; the qualifiedLinearAlgebra.ldiv!calls in the body still work).Project.toml:RandomandTest(Aqua flagged them as extras-without-compat)juliacompat1.10→1.11. The package's actual minimum is 1.11:CXSparse_jll@4requiresSuiteSparse_jll ≥ 7.7, but Julia 1.10 stdlib pinsSuiteSparse_jll 7.2.1. Resolver fails on 1.10 (confirmed locally), so the previous claim was incorrect.Test plan
Pkg.test()passes locally on Julia 1.11 (626 tests, no failures)GROUP=Coreruns only factorization testsGROUP=QAruns only Aqua + ExplicitImportsGROUP=QR/LU/Cholesky/Crosssubset selectors work🤖 Generated with Claude Code