Skip to content

Say why the linear path ignores new_W_dt_cutoff - #4527

Merged
ChrisRackauckas merged 2 commits into
SciML:masterfrom
ChrisRackauckas-Claude:linear-w-cutoff-comment
Sep 12, 2026
Merged

ChrisRackauckas merged 2 commits into
SciML:masterfrom
ChrisRackauckas-Claude:linear-w-cutoff-comment

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

Stacks on #4470 — please ignore until reviewed by @ChrisRackauckas.

This branch is #4470 rebased onto current master, plus one commit. Review only
the second commit (Say why the linear path ignores new_W_dt_cutoff); the
first is #4470 unchanged. If #4470 merges first, this rebases down to the
comment and the version bump.

What changed and why

#4470 justifies taking every γdt change on the islin branch of do_newJW
with:

rebuilding W = J - M/(γdt) is a refactorization with no Jacobian evaluation
and there is nothing for new_W_dt_cutoff to amortize

That is backwards. The refactorization is exactly what new_W_dt_cutoff
amortizes — its docstring is "relative change in γΔt above which W is
refactorized", not anything about Jacobian evaluations.

The real reason the cutoff is not worth taking on this path is the linear
solver: defaultalg answers LHLFactorization for a split WOperator, and
LHL absorbs a new γdt by re-shifting the Hessenberg form in O(n²) while the
O(n³) reduction stays put — cheap precisely because J never moves on a linear
function. The comment now says that, with the O(n³) case a reader hits by
pinning a factorization noted in parentheses.

No behavior change: comment text plus a version bump.

Verification

The claim in the new comment, checked at runtime rather than read off the
source (I first read a stale copy of default.jl and got this wrong):

sparse N=800:  CHOICE = LHLFactorization | W.J = MatrixOperator{Float64, SparseMatrixCSC{Float64, Int64}, …} | lhl_defaultable = true
dense  N=1000: CHOICE = LHLFactorization | W.J = MatrixOperator{Float64, Matrix{Float64}, …} | lhl_defaultable = true

for ODEProblem(ODEFunction(MatrixOperator(A)), u0, tspan) under SDIRK2,
reading integrator.cache.nlsolver.cache.linsolve.alg.alg after two steps.

$ julia --project=@runic -m Runic --check --diff lib/OrdinaryDiffEqDifferentiation/src/derivative_utils.jl
(no output, exit 0)
$ typos lib/OrdinaryDiffEqDifferentiation/src/derivative_utils.jl lib/OrdinaryDiffEqDifferentiation/Project.toml
(no output, exit 0)

Version bump

3.11.5 → 3.11.6. #4470 bumps to 3.11.5, which master has since released, so
that bump collides as-is.

What I did not verify

No failing-before/passing-after evidence, because there is no behavior change
to discriminate — the only executable change is the version string. The
OrdinaryDiffEqDifferentiation suite is running locally and I will post the
result; #4470's own CI is 184/184 green on the identical code. I did not run
QA, the docs build (no docstrings touched), GPU, or downstream.

Worth pushing back on

The parenthetical about a pinned factorization paying O(n³) is mine, not
#4470's reasoning — drop it if you think it invites the wrong question. That
case is real (measured nw 49 → 602 on a dense N=300 LUFactorization() run)
but it is not the default path.

🤖 Generated with Claude Code (model: claude-opus-5[1m])

https://claude.ai/code/session_01D1XiWgJ1PJFDLAWTM1583M

singhharsh1708 and others added 2 commits September 12, 2026 11:30
The comment on the `islin` branch of `do_newJW` justified taking every γdt
change with "there is nothing for `new_W_dt_cutoff` to amortize", which is
backwards: the refactorization is exactly what that cutoff amortizes. The
reason the cutoff is not worth taking here is that `defaultalg` answers
`LHLFactorization` for this split `W`, and LHL absorbs a new γdt by
re-shifting the Hessenberg form in O(n²) with the reduction untouched —
cheap precisely because `J` never moves on a linear function.

Verified at runtime that the default is LHL for this path, dense and sparse
`J` alike: `_lhl_defaultable` is true and `DefaultLinearSolver.alg` is
`LHLFactorization` for `ODEFunction(MatrixOperator(A))` at n = 800 sparse and
n = 1000 dense.

Also bumps OrdinaryDiffEqDifferentiation to 3.11.6: SciML#4470 bumped to 3.11.5,
which master has since released.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Agent-Harness: Claude Code 2.1.269
Agent-Model: claude-opus-5[1m]
Agent-Session: https://claude.ai/code/session_01D1XiWgJ1PJFDLAWTM1583M
Claude-Session: https://claude.ai/code/session_01D1XiWgJ1PJFDLAWTM1583M
@ChrisRackauckas
ChrisRackauckas marked this pull request as ready for review September 12, 2026 15:50
@ChrisRackauckas
ChrisRackauckas merged commit 7d31728 into SciML:master Sep 12, 2026
17 of 22 checks passed
ChrisRackauckas added a commit that referenced this pull request Sep 13, 2026
- OrdinaryDiffEqDefault: require OrdinaryDiffEqCore 4.17.1 (#4520)
- Add adaptive step size control to SDC (#4346)
- Allow JET 0.12 in every QA test environment (#4513)
- Resolve OrdinaryDiffEqDefault against the local sublibraries (#4514)
- NonlinearSolveAlg: stale-Jacobian retry + rejected-step W reassembly (carries #4282 to current master) (#4505)
- Do not seed a retry from the previous-step interpolant (#4473)
- Say why the linear path ignores new_W_dt_cutoff (#4527)
- Carry the QNDF2 difference array across steps (#4526)
- Pass Θ = 0, not the absolute time, to the AN5 startup interpolant (#4534)
- Make the stabilized-RK step cap and eigenvalue tolerance direction-agnostic (#4536)



Agent-Harness: Claude Code
Agent-Model: claude-opus-5[1m]
Claude-Session: https://claude.ai/code/session_014FEzNTLFutCmTEAZ3zBg5R

Co-authored-by: Claude Opus 5 (1M context) <[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.

3 participants