You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cache dense blocks with LinearSolve's own default solver
Follow-up on the concrete-typing commit: instead of resolving a dense
algorithm ourselves and parameterising on the resulting cache type, each
cached block now uses LinearSolve's default solver directly
(`init(prob, nothing)`).
Its cache type is
`LinearCache{..., DefaultLinearSolver, DefaultLinearSolverInit{...}}`,
which holds a slot for every candidate algorithm and picks between them
with a runtime enum - so the type depends only on the element type, not
on which algorithm the default happens to select on this machine. That
makes the whole factorization type inferable from its inputs:
`Core.Compiler.return_type(snlu, Tuple{SparseMatrixCSC{Float64,Int}})`
is now concrete, and JET reports 0 runtime dispatches for construction
as well as for solve! and snlu! (construction was 3 before).
It is also simply what "use the LinearSolve default" should mean: the
bespoke `_resolve_dense_alg` probe is gone.
The extra slots cost nothing measurable - the block buffer dominates:
35 796 B vs 34 264 B at np = 64, and 2 112 724 B vs 2 105 816 B at
np = 512.
The factorization behind a block cache is pulled out of the slot the
enum names, written as a literal-symbol chain so every branch stays
concrete. src/SupernodalLU is now included after src/default.jl, since
it references DefaultLinearSolver{,Init}.
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
0 commit comments