Skip to content

Fix PureKLU Dual-A dispatch stolen by DualBLinearProblem opt-out#1073

Merged
ChrisRackauckas merged 1 commit into
SciML:mainfrom
ChrisRackauckas-Claude:fix-pureklu-dual-dispatch
Jul 3, 2026
Merged

Fix PureKLU Dual-A dispatch stolen by DualBLinearProblem opt-out#1073
ChrisRackauckas merged 1 commit into
SciML:mainfrom
ChrisRackauckas-Claude:fix-pureklu-dual-dispatch

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Contributor

Please ignore until reviewed by @ChrisRackauckas. Draft; opened by an agent.

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's A slot is Union{Number, AbstractArray}, so Dual-A problems also match it, and the b-only PureKLU opt-out steals the both-Dual dispatch, returning a plain LinearCache instead of routing through __dual_init.

Fix restores the DualLinearProblem → __dual_init route for PureKLU. Verified: 119/119 in forwarddiff_overloads.jl on Julia 1.12.4 and 1.10.11.

🤖 Generated with Claude Code

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
@ChrisRackauckas ChrisRackauckas marked this pull request as ready for review July 3, 2026 18:02
@ChrisRackauckas ChrisRackauckas merged commit b59c16b into SciML:main Jul 3, 2026
49 of 56 checks passed
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