Skip to content

fix: specialize A*sol to use sol.u for AbstractNoTimeSolution - #1363

Merged
ChrisRackauckas merged 1 commit into
SciML:masterfrom
Mxyank24:fix/abstract-no-time-solution-mul
May 21, 2026
Merged

ChrisRackauckas merged 1 commit into
SciML:masterfrom
Mxyank24:fix/abstract-no-time-solution-mul

Conversation

@Mxyank24

Copy link
Copy Markdown
Contributor

Ax where x is an AbstractNoTimeSolution was hitting a slow generic
fallback. Added a Base.:
method that unwraps sol.u directly.

@ChrisRackauckas
ChrisRackauckas merged commit 1a03b8c into SciML:master May 21, 2026
@ChrisRackauckas

Copy link
Copy Markdown
Member

thanks!

ChrisRackauckas-Claude pushed a commit to ChrisRackauckas-Claude/SciMLBase.jl that referenced this pull request May 26, 2026
…oTimeSolution)`

The broad `*(A::AbstractMatrix, sol::AbstractNoTimeSolution) = A * sol.u`
method introduced in SciML#1363 had unresolved ambiguities with LinearAlgebra's
specialized methods (Diagonal, AbstractTriangular, Adjoint/Transpose-of-vector)
that surfaced as Aqua `detect_ambiguities` failures and a MethodError in
LinearSolve.jl's static_arrays test.

Add disambiguators in solution_interface.jl that forward each conflicting
signature to `A * sol.u`, preserving the LinearAlgebra fast paths. Also
broaden the StaticArrays extension to cover both N=1 and N=2 sol shapes
(StaticMatrix * AbstractMatrix exists in StaticArrays too).

Verified locally: `Test.detect_ambiguities(SciMLBase)` returns empty on both
Julia 1.10 and 1.12 with these methods.

Co-Authored-By: Chris Rackauckas <[email protected]>
ChrisRackauckas added a commit that referenced this pull request May 26, 2026
…tractNoTimeSolution)`

After #1363 added `Base.:*(A::AbstractMatrix, sol::AbstractNoTimeSolution) = A * sol.u`,
LinearSolve's `test/nopre/static_arrays.jl` started failing with a MethodError ambiguity
between that method and StaticArrays' `*(::StaticMatrix, ::AbstractVector)`. This adds
a weakdep extension on StaticArrays that defines the disambiguating method
`*(::StaticMatrix, ::AbstractNoTimeSolution{<:Any, 1})`, which Julia's dispatcher
selects unambiguously.

Co-Authored-By: Chris Rackauckas <[email protected]>
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.

2 participants