Skip to content

Fix DefaultsLoading test: sparse BigFloat defaults to PureKLU (not Sparspak) since #1037#1043

Merged
ChrisRackauckas merged 2 commits into
SciML:mainfrom
ChrisRackauckas-Claude:fix-defaultsloading-sparspak-puklu
Jun 14, 2026
Merged

Fix DefaultsLoading test: sparse BigFloat defaults to PureKLU (not Sparspak) since #1037#1043
ChrisRackauckas merged 2 commits into
SciML:mainfrom
ChrisRackauckas-Claude:fix-defaultsloading-sparspak-puklu

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Contributor

Fixes #1042 — a stale test failing on main/CI in the DefaultsLoading group.

Problem

test/defaultsloading/defaults_loading.jl:30 asserted, via @test_throws, that solving a sparse BigFloat LinearProblem before using Sparspak raises "SparspakFactorization required ... using Sparspak". That fails on main with "No exception thrown":

Defaults Loading Tests: Test Failed at .../defaults_loading.jl:30
  Expression: sol = (solve(prob)).u
    Expected: ["SparspakFactorization required", "using Sparspak"]
  No exception thrown

Cause

#1037 (52ebf258, "Default to PureKLU for generic-eltype sparse LU") intentionally changed the default sparse LU for generic (non-BLAS) element types from SparspakFactorization to PureKLU — a pure-Julia hard dependency — and removed the "SparspakFactorization required" error branch from defaultalg. So that error path is unreachable now, and the @test_throws never fires. The test simply wasn't updated alongside the routing change.

Fix

Update the test to the new intended behavior: a generic-eltype (BigFloat) sparse problem routes to KLUFactorization and solves without using Sparspak.

@test Base.get_extension(LinearSolve, :LinearSolveSparspakExt) === nothing
@test LinearSolve.defaultalg(mat, rhs).alg ===
    LinearSolve.DefaultAlgorithmChoice.KLUFactorization
sol = solve(prob).u
@test sol isa Vector{BigFloat}

Verification

Ran the full test/defaultsloading/defaults_loading.jl locally (Julia 1.12 / Linux, with Sparspak + STRUMPACK_jll available) — passes, no failures. Runic --check clean.


Please ignore until reviewed by @ChrisRackauckas.

🤖 Generated with Claude Code

… Sparspak

SciML#1037 changed the default sparse LU for generic (non-BLAS) element types from
SparspakFactorization to PureKLU (a hard dependency), removing the
"SparspakFactorization required" error branch from `defaultalg`. The
DefaultsLoading test still asserted that error was thrown when solving a sparse
BigFloat problem before `using Sparspak`, so it failed on master with
"No exception thrown" (defaults_loading.jl:30).

Update the test to the new intended behavior: a generic-eltype sparse problem
now routes to `KLUFactorization` and solves without Sparspak loaded. Closes the
`@test_throws` into a positive assertion (defaultalg === KLUFactorization, solve
returns Vector{BigFloat}).

Fixes SciML#1042.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Comment thread test/defaultsloading/defaults_loading.jl Outdated
@ChrisRackauckas ChrisRackauckas marked this pull request as ready for review June 14, 2026 09:15
@ChrisRackauckas ChrisRackauckas merged commit 524fb52 into SciML:main Jun 14, 2026
7 of 13 checks passed
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.

DefaultsLoading test fails: sparse BigFloat no longer requires Sparspak after #1037 (defaults_loading.jl:30)

2 participants