Commit ed4ca38
Fix linear-problem fast path and DelayDiffEq @test_broken
_rosenbrock_jac_reuse_decision was returning (true, true) for linear
operator ODEs with a WOperator-wrapped W because the WOperator check
fired before the linear-function check. That made Rosenbrock23 rebuild
J and W every step on ODEFunction(::MatrixOperator) problems (seen as
nw = 628 / 454 in lib/OrdinaryDiffEqNonlinearSolve linear_solver_tests
expecting nw == 1), instead of building W once and reusing it.
Reorder the decision so the linear-function branch fires immediately
after the iter<=1 check, matching the pre-reuse do_newJW behavior:
- iter <= 1 -> (true, true) [first step must build W]
- islin -> (false, false) [reuse afterwards, regardless of W type]
- non-adaptive / WOperator / mass-matrix / composite checks follow
Also flip DelayDiffEq jacobian.jl:57 from @test_broken to @test — the
nWfact_ts[] == njacs[] assertion now passes with the Rosenbrock J/W
accounting from this PR.
Verified locally:
Rosenbrock23 on ODEFunction(MatrixOperator, mass_matrix=...): nw=1
Rodas5P+KrylovJL convergence test: L2 order 5.004 (tight reltol)
Rosenbrock23 convergence on prob_ode_2Dlinear: order 1.996
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 88400a3 commit ed4ca38
2 files changed
Lines changed: 17 additions & 13 deletions
File tree
- lib
- DelayDiffEq/test/interface
- OrdinaryDiffEqDifferentiation/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| |||
Lines changed: 16 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
49 | 65 | | |
50 | 66 | | |
51 | 67 | | |
| |||
61 | 77 | | |
62 | 78 | | |
63 | 79 | | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | 80 | | |
72 | 81 | | |
73 | 82 | | |
| |||
81 | 90 | | |
82 | 91 | | |
83 | 92 | | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | 93 | | |
90 | 94 | | |
91 | 95 | | |
| |||
0 commit comments