Fix PureKLU Dual-A dispatch stolen by DualBLinearProblem opt-out#1073
Merged
ChrisRackauckas merged 1 commit intoJul 3, 2026
Merged
Conversation
DualBLinearProblem's A slot is `Union{Number, AbstractArray}`, which a
Dual-eltype A also matches, so `DualLinearProblem <: DualBLinearProblem`.
The b-only PureKLU opt-out introduced in SciML#1069 is more specific in the alg
argument than the general dual-path `init`, so both-Dual PureKLU problems
were routed to a plain `LinearCache` and `solve!` then failed with a
FieldError on `dual_linear_cache` (test/Core/forwarddiff_overloads.jl
"PureKLU direct dual path reuses inner LinearCache"). Add a more-specific
`DualLinearProblem` method restoring the direct dual path; the mixed-type
ldiv! only covers primal A.
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYp371jx6LurezUDhKcYRh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a test failure present on unmodified
main(found while testing #1072, verified pre-existing by reverting and rerunning):test/Core/forwarddiff_overloads.jl"PureKLU direct dual path reuses inner LinearCache" errors.Bisected to aabf007 (#1069, 2026-06-30):
DualBLinearProblem'sAslot isUnion{Number, AbstractArray}, so Dual-A problems also match it, and the b-only PureKLU opt-out steals the both-Dual dispatch, returning a plainLinearCacheinstead of routing through__dual_init.Fix restores the
DualLinearProblem → __dual_initroute for PureKLU. Verified: 119/119 inforwarddiff_overloads.jlon Julia 1.12.4 and 1.10.11.🤖 Generated with Claude Code