Skip to content

Add ImplicitEuler to OrdinaryDiffEqSDIRK precompile workload - #4658

Merged
ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:sdirk-precompile-implicit-euler
Sep 27, 2026
Merged

ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:sdirk-precompile-implicit-euler

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

Summary

Add ImplicitEuler() to the @compile_workload solver_list in OrdinaryDiffEqSDIRK (alongside the existing TRBDF2() / KenCarp4()). Nothing else changes.

Why: #3099 added SDIRK precompile coverage for TRBDF2 and KenCarp4 only. There is no stated reason in that PR for leaving ImplicitEuler out — it was scoped to those two “widely-used methods.” A subsequent performance audit showed user-defined in-place ImplicitEuler first solves still paying ~16 s of compile because the integrator/cache types are parameterized by the alg type.

Please ignore until reviewed by @ChrisRackauckas.

TTFS (process CPU seconds, /proc/self/stat utime+stime)

Fresh process each run; user-defined stiff f (not package lorenz). Minimum of 4 runs.

first solve master (min of 4) branch (min of 4)
user iip + ImplicitEuler() 15.55 s 0.47 s
user oop + ImplicitEuler() 9.65 s 9.09 s
user iip + TRBDF2() (control) 0.52 s 0.52 s

Command (one alg per process):

export TMPDIR=…/pr-sdirk-precompile/tmp
export JULIA_DEPOT_PATH=…/pr-sdirk-precompile/depot:$HOME/.julia
julia --project=scratch ttfs_one.jl IIP ImplicitEuler   # also OOP ImplicitEuler, IIP TRBDF2

ttfs_one.jl reads utime+stime around the first solve of a local myf! / myf.

Audit reference (same machine family): 15.95 → 0.62 s. This session: 15.55 → 0.47 s.

Precompile cost (CPU seconds via /usr/bin/time -f %U+%S)

Force recompile by appending a throwaway # force-recompile-marker … comment to OrdinaryDiffEqSDIRK.jl (Julia 1.12 keys on content), then restore. Warm sibling deps; 3 alternating A/B repeats. Values below are min of 3 of user+system.

master branch Δ
/usr/bin/time U+S (min of 3) 153.78 s 217.44 s +63.66 s
Pkg display wall for SDIRK (min of 3, informational) 139.0 s 175.8 s +36.8 s
/usr/bin/time -f '%U+%S' julia --project=scratch -e 'using Pkg; Pkg.precompile("OrdinaryDiffEqSDIRK"; strict=true)'

Budget ratio

  • TTFS saving (user iip ImplicitEuler): 15.55 − 0.47 = 15.08 s
  • Added precompile (CPU U+S min): +63.66 s
  • Ratio: 63.66 / 15.08 ≈ 4.2× — above the ~2–3× guideline when measured in process CPU seconds on this loaded box (load ~300–380).
  • Using Pkg’s displayed wall for SDIRK only: +36.8 / 15.08 ≈ 2.4× (within guideline). Prefer the CPU metric for decision-making on this machine; flagging the overrun for reviewer judgment.

#3099 note

No quote exists explaining why ImplicitEuler was omitted. The PR body only states workloads were added for TRBDF2() and KenCarp4() as widely-used methods.

Validation

  • Runic --check on the changed file: pass
  • typos on the changed file: pass
  • SDIRK has no test_groups.toml; runtests.jl always runs the four Core suites (and activates a QA env for GROUP=QA|ALL but does not include qa/*.jl)
  • Core suites (direct includes): Tableau 103 pass; Predictors 121 pass; Convergence 137 pass / 2 broken; DAE 78 pass
  • QA AllocCheck: Broken (pre-existing broken=true)
  • QA JET (mode=:typo): fail on pre-existing “local variable may be undefined” reports in generic_imex_perform_step.jl (unrelated to this one-line workload change)
  • QA Aqua/ExplicitImports: error on pre-existing stage_predictor non-public import (unrelated)

What was not verified

  • CI on GitHub (draft only)
  • Whether JET/Aqua currently pass on master in SublibraryCI (SDIRK’s runtests.jl does not include the QA files)
  • Broader TTFX across other specialization preference modes
  • Out-of-place precompile workload (still uncovered; oop TTFS unchanged as expected)

Risk assessment

  • Behavioral risk: none expected — only extends @compile_workload; no solver logic change.
  • Cost risk: package precompile CPU increases by ~64 s on this host (~4.2× the measured TTFS saving). Reviewer should decide if that trade is acceptable for covering a common stiff entry point.
  • Independent review: pending

🤖 Generated with Cursor Agent (model: auto), orchestrated by Claude Code (claude-opus-5-5[1m]) session https://claude.ai/code/session_01LPHREnnonfLg1VcE1EJovv

Made with Cursor

User-defined in-place ImplicitEuler first solves were paying ~16 s of
compile; covering it alongside TRBDF2/KenCarp4 drops that to ~0.5 s.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Cursor Agent <[email protected]>
Agent-Harness: Cursor Agent 2026.09.26-dd393fe
Agent-Model: unknown (Cursor auto)
Agent-Session: local cursor-agent session in /home/crackauc/sandbox/goals/performance/jobs/pr-sdirk-precompile/repo (log /home/crackauc/sandbox/goals/performance/jobs/pr-sdirk-precompile/log.txt)
@ChrisRackauckas
ChrisRackauckas marked this pull request as ready for review September 27, 2026 14:58
@ChrisRackauckas
ChrisRackauckas merged commit 4876407 into SciML:master Sep 27, 2026
21 of 22 checks passed
ChrisRackauckas referenced this pull request Sep 29, 2026
* Bump DiffEqBase to 7.21.3

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Agent-Harness: Devin CLI 3000.11.3 (Mac)
Agent-Model: Fusion (claude-opus-5-5 medium + swe-2 medium)
Agent-Session: local transcript ~/.local/share/devin/cli/transcripts/helpful-exception.json

* Bump OrdinaryDiffEqBDF to 2.4.12

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Agent-Harness: Devin CLI 3000.11.3 (Mac)
Agent-Model: Fusion (claude-opus-5-5 medium + swe-2 medium)
Agent-Session: local transcript ~/.local/share/devin/cli/transcripts/helpful-exception.json

* Bump OrdinaryDiffEqSDIRK to 2.9.7

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Agent-Harness: Devin CLI 3000.11.3 (Mac)
Agent-Model: Fusion (claude-opus-5-5 medium + swe-2 medium)
Agent-Session: local transcript ~/.local/share/devin/cli/transcripts/helpful-exception.json

* Bump OrdinaryDiffEqRosenbrock to 2.7.5

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Agent-Harness: Devin CLI 3000.11.3 (Mac)
Agent-Model: Fusion (claude-opus-5-5 medium + swe-2 medium)
Agent-Session: local transcript ~/.local/share/devin/cli/transcripts/helpful-exception.json

* Bump OrdinaryDiffEqLowOrderRK to 2.2.6

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Agent-Harness: Devin CLI 3000.11.3 (Mac)
Agent-Model: Fusion (claude-opus-5-5 medium + swe-2 medium)
Agent-Session: local transcript ~/.local/share/devin/cli/transcripts/helpful-exception.json

* Bump OrdinaryDiffEqTsit5 to 2.1.5

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Agent-Harness: Devin CLI 3000.11.3 (Mac)
Agent-Model: Fusion (claude-opus-5-5 medium + swe-2 medium)
Agent-Session: local transcript ~/.local/share/devin/cli/transcripts/helpful-exception.json

* Bump OrdinaryDiffEqVerner to 2.4.2

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Agent-Harness: Devin CLI 3000.11.3 (Mac)
Agent-Model: Fusion (claude-opus-5-5 medium + swe-2 medium)
Agent-Session: local transcript ~/.local/share/devin/cli/transcripts/helpful-exception.json

* Bump OrdinaryDiffEqSymplecticRK to 2.2.3

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Agent-Harness: Devin CLI 3000.11.3 (Mac)
Agent-Model: Fusion (claude-opus-5-5 medium + swe-2 medium)
Agent-Session: local transcript ~/.local/share/devin/cli/transcripts/helpful-exception.json

---------

Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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