Skip to content

Bound KdV KenCarp step sizes - #1685

Closed
ChrisRackauckas-Claude wants to merge 1 commit into
SciML:fix/simplehandwrittenpde-runtimefrom
ChrisRackauckas-Claude:fix/kdv-fdm-newton-stall
Closed

ChrisRackauckas-Claude wants to merge 1 commit into
SciML:fix/simplehandwrittenpde-runtimefrom
ChrisRackauckas-Claude:fix/kdv-fdm-newton-stall

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

Ignore this PR until it has been reviewed by @ChrisRackauckas.

This is a one-commit patch stacked on #1672. Merge it into fix/simplehandwrittenpde-runtime before merging that PR.

What changed and why

The KdV SplitODEProblem lets the adaptive KenCarp methods enter a Newton solve whose default matrix-free GMRES path does not return. This is the reason the remaining kdv_fdm_wpd.jmd CI job has run for more than 41 hours.

Cap each KenCarp method at the largest locally verified stable step size: 0.015 for KenCarp3, 0.03 for KenCarp4, and 0.00875 for KenCarp5. These caps preserve tolerance-dependent work counts. The labels no longer call the default linear solver “dense”; the observed default path is Krylov GMRES.

Verification

Failing before

A minimized solve using the benchmark's exact SplitODEProblem, KenCarp3(), abstol=1e-7, and reltol=1e-4 did not return in the deliberately short immediate-hang check:

$ timeout 60 julia +1.10 --project=benchmarks/SimpleHandwrittenPDE scratch/kdv_fdm_probe.jl default
starting mode=default
[1150676] signal (15): Terminated
...
gmres! at Krylov/src/gmres.jl:121
compute_step! at OrdinaryDiffEqNonlinearSolve/src/newton.jl:323
Allocations: 31282594 ...
exit status: 124

The temporary probe was removed before committing.

Passing after

The same problem with the final caps returned Success at every benchmark tolerance:

KenCarp3 dtmax=0.015:   accepted steps 69, 126, 280
KenCarp4 dtmax=0.03:    accepted steps 59, 117, 184
KenCarp5 dtmax=0.00875: accepted steps 115, 115, 155
9/9 solves: Success

Nearby larger coarse-tolerance caps reproduced the hang: KenCarp3 at 0.02, KenCarp4 at 0.04, and the uncapped KenCarp5 path. This is why the values are method-specific.

The exact final benchmark file completed locally:

$ timeout 3600 .github/scripts/build_benchmark.sh benchmarks/SimpleHandwrittenPDE/kdv_fdm_wpd.jmd
...
KenCarp3
KenCarp4
KenCarp5
ARKODE3 (Krylov)
ARKODE4 (Krylov)
ARKODE5 (Krylov)
 97.842728 seconds (...)
...
[ Info: Weaved all chunks
└   progress = 1
[ Info: Weaved to .../markdown/SimpleHandwrittenPDE/kdv_fdm_wpd.md
exit status: 0

The unchanged final ARKODE comparison emitted one Instability detected warning and still generated its plot. The full folder was not run; only the CI target changed here was weaved.

Formatting and spelling checks completed with no output and exit status 0:

git ls-files -z -- '*.jl' | xargs -0 --no-run-if-empty julia +1.12 --startup-file=no -m Runic --check --diff
typos benchmarks/SimpleHandwrittenPDE/kdv_fdm_wpd.jmd
git diff --check

Root QA reproduced the known base-branch metadata failures and no others:

$ GROUP=QA julia +1.10 --project=. -e 'using Pkg; Pkg.test()'
QA | 16 passed, 3 failed, 19 total

The failures are stale root dependencies and missing stdlib/Test compat entries. They reproduce on master and are fixed separately by #1683 (19/19 locally). Direct docs/make.jl is inapplicable in this source checkout; docs are copied to and built from SciMLBenchmarksOutput. No GPU or downstream jobs were run.

🤖 Generated with Claude Code
https://chatgpt.com/codex/tasks/01a03a17-ad6f-7131-82fc-d0fd57ea6512

@ChrisRackauckas-Claude

ChrisRackauckas-Claude commented Aug 25, 2026 •

Copy link
Copy Markdown
Member Author

Upstream tracking issue: SciML/OrdinaryDiffEq.jl#4378. The standalone N=32 SplitODEProblem control completed in 16.62 s with explicit GMRES, while the default solver path did not complete within 3,600 s. The issue also records the identity-preconditioner control and the likely missing-preconditioner mechanism.

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member Author

The step-size-cap workaround should remain closed. The benchmark symptom reduces to the default linear-solver path on a SplitODEProblem with a MatrixOperator; the updated 8-state MWE and cross-version evidence are in SciML/OrdinaryDiffEq.jl#4378.

I also tested SciML/SciMLBase.jl#1520 rather than inferring from its diff:

  • Its fix works for direct combined SplitFunction calls: prob.u0 is no longer aliased or mutated.
  • It does not fix an OrdinaryDiffEq solve. With that merge commit, the reduced default KenCarp case was still in Krylov.gmres! after 13 minutes.
  • Backporting only its two-line cache fix onto SciMLBase 3.39.1 leaves the original KS explicit-GMRES result unchanged: accepted=152, nf=495423, nsolve=15761.

The exact KdV construction now completes on the dependency stack merged by #1678: 32.61 seconds without SciMLBase PR 1520 and 33.27 seconds with it. That comparison does not support PR 1520 as the runtime fix.

https://chatgpt.com/codex/tasks/01a03a17-ad6f-7131-82fc-d0fd57ea6512

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