Skip to content

Conversation

@AayushSabharwal
Copy link
Member

No description provided.

@ChrisRackauckas
Copy link
Member

What does this actually fix?

@AayushSabharwal
Copy link
Member Author

  1. LinearSolve’s init gets LinearProblem with duals in it
  2. LinearSolve takes the A and b of that, and makes copies that aren’t duals
  3. LinearSolve calls remake with the new A and b
  4. remake on a LinearProblem calls SciMLBase.get_new_A_b. This function is responsible for updating the A and b with the appropriate values according to the parameter object, since changing parameters must change A/b
  5. As of MTK#master, this errors since p contains duals and it tries to write to A/b with Float64 eltype. I saw this error and thought “oh, I didn’t handle changing the eltype” so if the eltypes are different, I create a similar copy with the correct eltype and return that
  6. LinearSolve takes the LinearProblem it got out of remake, expecting the A and b to be Float64 (they’re Duals) and calls init
  7. This hits step 1 again

@ChrisRackauckas
Copy link
Member

can you make an MWE?

@ChrisRackauckas ChrisRackauckas merged commit b3d4f22 into SciML:main Jan 8, 2026
136 of 141 checks passed
@AayushSabharwal AayushSabharwal deleted the as/fix-forwarddiff-ext branch January 8, 2026 12:29
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