fix edge case in inline linear solve - #97
Conversation
|
Nice finds! |
|
Tested this on the model behind #95 ( 1. As-is, the PR OOMs on this model
Fix that worked for me — a structural-zero hook instead of # StateSelection, src/math/sparsematrixclil.jl
cheap_iszero(x) = iszero(x)
# ... in dropzeros!(S::SparseMatrixCLIL):
cheap_iszero(vals[k]) && continue
# ModelingToolkitTearing (has the Symbolics dep)
StateSelection.CLIL.cheap_iszero(x::Num) = SU._iszero(Symbolics.unwrap(x))
StateSelection.CLIL.cheap_iszero(x::SymbolicT) = SU._iszero(x)Explicit stored zeros produced by 2. With that fixed, the PR is behavior-neutral on this modelIdentical before/after: emitted block sizes ( 3. Incidental finding while measuring (separate issue material)With a rank-revealing runtime solve in place of i.e. the inline-linear-SCC contract "the emitted |
|
Okay wow |
Fix 2 minor bugs found by Fable.
I think this may help with #95