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
Store the dense block caches sparsely, dropping the Union element type
Only the blocks at or above dense_threshold get a LinearSolve cache;
everything narrower uses the built-in kernel. That is the overwhelming
majority - 0.6 % of supernodes are cached on poisson2d_256 and 1.3 % on
poisson3d_28, where the median supernode is 5 and 1 columns wide - so a
full-length Vector{Union{Nothing,C}} was 99 % empty and forced a
nullability check on every lookup.
bcaches now holds only the blocks that have a cache, with
bcacheidx[s] indexing into it (0 = use the built-in kernel). The element
type is plainly concrete rather than a two-member union, the lookup is an
integer test, and the factorization type stays inferable from its inputs
(return_type(snlu, ...) concrete). For element types that never cache a
block it degenerates to an empty Vector{Nothing} with an all-zero index.
Caching every supernode instead was considered and rejected on the
numbers: a default-solver cache costs ~1476 B even for a 4x4 block, so
poisson2d_256 alone would spend ~8 MB to make small blocks slower than
the built-in kernel - the same size effect that motivates
PANEL_BLAS_CUTOFF in the solve sweeps.
GROUP=Core and GROUP=QA both pass.
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
0 commit comments