Repository navigation
Fix PDIRK threading option checks - #4745
Merged
ChrisRackauckas merged 3 commits intoOct 17, 2026
Merged
ChrisRackauckas merged 3 commits into
ChrisRackauckas merged 3 commits into
Conversation
Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Codex <[email protected]> Agent-Harness: Codex CLI codex-cli 0.160.0 Agent-Model: gpt-6-luna Agent-Session: local session, transcript /home/crackauc/sandbox/goals/performance/jobs/pr-pdirk-threading/log.txt on amdci2
ChrisRackauckas-Claude
force-pushed
the
pdirk-threading-predicate
branch
from
October 7, 2026 16:20
fa9a8de to
83e6cce
Compare
Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Devin <[email protected]> Agent-Harness: Devin CLI 3000.11.3 (conflict resolution), Claude Code 2.1.285 (orchestration) Agent-Model: fusion-claude-opus-5-5-high-sidekick-swe-2-medium Agent-Session: local Claude session 3c311569-dda6-4687-bc9f-65febb212c33 (fleet master); Devin log /Users/chrisrackauckas/sandbox/master/fusion-fixes/SciML_OrdinaryDiffEq.jl-4745/log.txt
Member
Merged the default branch into this PR (clean merge, no conflicts; head 491d6c4) so CI runs on current master. Its earlier failures in SciMLSensitivity Core1 and the downgrade jobs were fixed on master after this PR's last CI run. 🤖 Posted by an AI agent — harness: Devin CLI 3000.11.3 (merge), Claude Code 2.1.285 (posting) · model: fusion-claude-opus-5-5-high-sidekick-swe-2-medium |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
alg_cachenow uses OrdinaryDiffEqCore’s publicisthreadedpredicate, matching the threading checks already used by both PDIRKperform_step!methods. The regression test constructs and solves withfalse,true,Sequential(),BaseThreads(), andPolyesterThreads(), and asserts identical final results; Polyester is declared as a test extra so its extension loads during the test.The regression fails on the unfixed code:
Sequential()throwsTypeError: non-boolean (OrdinaryDiffEqCore.Sequential) used in boolean contextfrompdirk_caches.jl. After the fix, the test file passes 13/13 assertions on Julia 1.12.4 with both default threading andJULIA_NUM_THREADS=4; the package test suite also passes on Julia 1.10.12.Pinned
@benchmarkminima (5 samples, 1 eval/sample;taskset -c 24for one Julia thread andtaskset -c 24-27for four), comparing the existingthreading=truepath with the newly enabledPolyesterThreads()path:true/ BaseThreadsPolyesterThreads()The benchmark minima varied with shared-host load; use the four-thread VdP result as indicative rather than a stable speedup estimate.
step!allocations (same order) were LIN1000 12,440→9,928 bytes and VdP 3,872→1,360 bytes at one thread; LIN1000 18,952→12,072 bytes and VdP 8,720→3,184 bytes at four threads.Validation tails:
Pkg.test()on Julia 1.12.4: SciMLBase reexport 2/2; Convergence Tests 4/4; nlsolve! Arguments 13/13; Core Interface Tests 3/3; Allocation Tests 1 existing broken check; JET Tests 1/1; Aqua 21/21; package tests passed.JULIA_NUM_THREADS=4 GROUP=Core julia --project=lib/OrdinaryDiffEqPDIRK -e 'using Pkg; Pkg.test()': package tests passed, including nlsolve! Arguments 13/13.julia --project=@runic -m Runic --inplace lib/OrdinaryDiffEqPDIRK/src/pdirk_caches.jl lib/OrdinaryDiffEqPDIRK/test/nlsolve_argument_tests.jlandtyposon all three changed files: exit 0.Not verified: downstream packages. The performance samples ran on a shared host and were not benchmarked under controlled isolation. Polyester’s upstream MIT license is compatible with this package’s license.
Please push back on whether Polyester belongs in this sublibrary’s test extras and on the interpretation of the shared-host benchmark spread.
Please ignore until reviewed by @ChrisRackauckas.
Risk assessment
🤖 Generated with Codex CLI codex-cli 0.160.0 (model: gpt-6-luna), transcript on a fleet worker host; orchestrated by Claude Code (claude-opus-5-5[1m]) https://claude.ai/code/session_01LPHREnnonfLg1VcE1EJovv
Risk assessment
Risk: low
Blast radius: Only
PDIRK44cache construction inlib/OrdinaryDiffEqPDIRK.threading = true/falsebehave as before, sinceisthreaded(::Bool)returns the Bool unchanged.Sequential(),BaseThreads()andPolyesterThreads()used to throw aTypeErrorinalg_cache; they now work and pick the same branch thatperform_step!already took. This is a fix that adds working inputs, so SemVer patch is fine. Polyester becomes a test-only extra (compat = "0.7", MIT), with no new runtime dependency.isthreadedwas already imported, andisthreaded,Sequential,BaseThreadsandPolyesterThreadsare all declaredpublicin OrdinaryDiffEqCore, so no non-public internals are used. No tests were weakened: the existing loop gains three threading options and an exact-equality check across all five.Evidence: Four checks fail on head
fa9a8de. All four also fail on the merge base217e0adand on every recent master commit that ran them (75bc9df,e70688,bd6cfb3,4a5c0e7; GPU didn't report onbd6cfb3), so all are pre-existing:Error During Testatconcrete_solve_derivatives.jl:451.lib/DiffEqBaseandlib/OrdinaryDiffEqDifferentiation: fail during downgrade resolution.None of the failure logs involve PDIRK. Every PDIRK-specific check passes: sublibrary-ci Core on Julia 1, lts and pre; QA on Julia 1; and downgrade
lib/OrdinaryDiffEqPDIRK. Runic, Typos, Documentation and the other ~120 checks pass too. The PR has no review comments. Not disclosed in the description:PDIRK44docstring still documentsthreadingas Bool-only. It doesn't mention theSequential()/BaseThreads()/PolyesterThreads()options this PR makes work.PolyesterThreads()needs Polyester to be loaded.Independent review: Devin CLI / fusion-claude-opus-5-5-high-sidekick-swe-2-medium rated it low, high confidence: a two-line swap to OrdinaryDiffEqCore's public
isthreaded, consistent with the existingperform_step!checks, with a stronger regression test and no regressions against master.Merge: auto-merge candidate. It meets the no-regression bar, but the PR is still a draft and its description says to wait for review by @ChrisRackauckas. It needs to be marked ready and that hold lifted first. A docstring update for the non-Bool
threadingoptions would be worth a follow-up.🤖 Risk assessment posted by an AI agent (fleet master) — harness: Devin CLI / fusion-claude-opus-5-5-high-sidekick-swe-2-medium; dispatched by Devin CLI 3000.11.3 fleet-master caretaker, model Fusion (claude-opus-5-5 medium + swe-2 medium)
Conversation: local session speckle-whale (no session URL)
Risk assessment (independent review, Codex gpt-6.1-sol, head 7055eba)
Sequential(),BaseThreads(), andPolyesterThreads(). This is a peripheral solver, not OrdinaryDiffEq's main lanes. Existingfalse/truecalls retain their cache selection and results. No new public names, signatures, defaults, or breaking behavior;isthreadedis public and documented. Polyester is an MIT-licensed test extra, with no new runtime dependency. No tests are skipped, removed, or loosened by the diff.pr.txt, the complete risk policy, andgit diff origin/HEAD...HEAD; inspected the cache constructors, both stage implementations, threading dispatch/extension, documentation, and package test wiring.git diff --check origin/HEAD...HEADpasses. All Julia checks used Julia 1.13.2,JULIA_NUM_THREADS=4,JULIA_NUM_PRECOMPILE_TASKS=4, the requested depot overlay,--startup-file=no --compiled-modules=existing, andtimeout 3600, serially in scratch snapshots.bash scratch/run-checks.shrecords every command and exit status inscratch/results.txt:julia --project=scratch/env-head scratch/run-functional.jl scratch/head: includes the package's officialtest/runtests.jlwithGROUP=Core, exercising every functional testset and excluding QA; 36/36 pass, including 13/13 in the changed test file (scratch/head-functional.log).julia --project=scratch/env-base scratch/run-regression.jl scratch/head/lib/OrdinaryDiffEqPDIRK/test/nlsolve_argument_tests.jl: runs the exact head regression against default-branch source at0139bdc23709266d93ebadf377d63484886d1478; exits 1, with four passing assertions followed byTypeError: non-boolean (Sequential) used in boolean contextatpdirk_caches.jl:108(scratch/base-regression.log).julia --project=scratch/env-base scratch/run-functional.jl scratch/base: unmodified default-branch functional suite 29/29 pass (scratch/base-functional.log).julia --project=scratch/env-head scratch/accuracy.jl: 114/114 pass. All five threading options, in-place and out-of-place, converge against the independently derived solutionexp(-t)/(1 + 0.1*(1-exp(-t))); measured orders are 3.9226–3.9455, with final error about 3.49e-9 atdt=0.025. Additional tests verify distinct nonlinear-solver objects and mutable buffers for threaded caches, and repeat coupled-vector solves against a matrix exponential five times per option (scratch/head-accuracy.log).julia --project=scratch/env-{head,base} scratch/bool-results.jl, run separately: both exit 0.cmp scratch/head-bool.log scratch/base-bool.logexits 0: all saved solution values match exactly for both Boolean options and both problem forms.🤖 Posted by an AI agent — harness: Codex CLI 0.162.1 · model: gpt-6.1-sol
Conversation: local headless review run (no public session URL); transcript kept by the fleet master.
Risk assessment (independent review, Claude Opus 5.5 (claude-opus-5-5), head 7055eba)
PDIRK44cache construction (in-place and out-of-place) inlib/OrdinaryDiffEqPDIRK. This is a peripheral solver, not a main lane.isthreaded(::Bool)returns the Bool unchanged, sotrue/falsecallers are unaffected. The three non-Bool options used to error and now run. There are no public signature changes and no new public names.isthreadedwas already imported from OrdinaryDiffEqCore, and the test importsSequential/BaseThreads/PolyesterThreadsfrom OrdinaryDiffEqPDIRK, which declares thempublic(src/OrdinaryDiffEqPDIRK.jl:48). Polyester (MIT) is added as a test extra only, with no new runtime dependency. A patch-level SemVer bump is appropriate.59ba40e4b(git archive). I used Julia 1.12,JULIA_NUM_THREADS=4andtimeout 3600.test/nlsolve_argument_tests.jlon head sources: exit 0, 11/11 + 2/2 pass.TypeError: non-boolean (Sequential) used in boolean context. It fails before and passes after.GROUP=Coreheadtest/runtests.jl: exit 0. SciMLBase reexport 2/2, Convergence 4/4, nlsolve! Arguments 13/13, Core Interface 3/3, Resize Cache 14/14.scratch/extra.jl, a check of my own with values the code did not produce: for each offalse,true,Sequential(),BaseThreads()andPolyesterThreads(), the error against the analytic solutionexp(-t)/(1+0.1(1-exp(-t)))at dt = 0.1/0.05/0.025 is identical across options (8.16e-7, 5.38e-8, 3.49e-9). The observed orders are 3.92 and 3.95. A 4×4 linear system was solved 5 times per option and matchedexp(A)*u0to within 1e-7. For the threaded options,cache.nlsolver[1] !== cache.nlsolver[2]and theirtmpbuffers are distinct. All 36 assertions pass.threading. PDIRK appears only in Core2 (stiff_adjoints.jl), so this PR is very unlikely to be the cause.🤖 Posted by an AI agent — harness: Claude Code · model: claude-opus-5-5
Conversation: local headless review run (no public session URL); transcript kept by the fleet master.
Risk assessment (independent review, Devin CLI 3000.11.92 / fusion-claude-opus-5-5-high-sidekick-swe-2-medium, head 7055eba)
PDIRK44cache construction (lib/OrdinaryDiffEqPDIRK), in-place and out-of-place. PDIRK44 is a peripheral, non-adaptive solver, not an OrdinaryDiffEq main lane.threading = true/false:isthreaded(::Bool)is the identity, so these go through the same code as before, and I confirmed the results are bitwise equal to base. The threeAbstractThreadingOptionvalues used to throw atinit; now they work. That is SemVer patch: no input that used to work is rejected. Polyester is added only as a test extra (compat = "0.7", MIT); there is no new runtime dependency.isthreaded,Sequential,BaseThreadsandPolyesterThreadsare allpublicin OrdinaryDiffEqCore, PDIRK already imported them at base, and they exist well below theOrdinaryDiffEqCore = "4.13"floor (isthreaded(::Sequential)goes back to 4fc9a86, 2024-08-05). No tests are skipped, removed or loosened.scratch/{head,base}; between the merge base and origin/HEAD no PDIRK/Core/NonlinearSolve/Differentiationsrcfile changes. Each snapshot got its own environment, with the local DiffEqBase, OrdinaryDiffEqCore, OrdinaryDiffEqDifferentiation, OrdinaryDiffEqNonlinearSolve and OrdinaryDiffEqPDIRK developed, plus Polyester 0.7.19 and SciMLBase 3.58.0. Everything ran on Julia 1.13.2 withJULIA_NUM_THREADS=4.test/nlsolve_argument_tests.jlrun against base source exits 1: 4 pass, thenTypeError: non-boolean (Sequential) used in boolean contextatpdirk_caches.jl:108(scratch/base-regression.log). The same file on head exits 0: 11/11 + 2/2 (scratch/head-regression.log).scratch/stress.jlon head exits 0, all testsets pass (scratch/head-stress.log). It checks three things for all five threading options, in-place and out-of-place:exp(A*T)*u0: error 1.11e-7 at dt=0.025, observed order 3.82, identical for every option.u' = B*u - u.^3solved 30 times per option at 4 threads: 0 mismatches, bitwise, against theSequential()result.init(...).cache.nlsolverhas 2 distinct nlsolvers (distincttmpandcache) for the threaded options and 1 otherwise. The Polyester extension was confirmed loaded.scratch/boolcmp.jlran on base and on head (6 solutions: three problems ×false/true). The deserialised outputs are bitwise equal (a == b→ true).lib/OrdinaryDiffEqPDIRK). The only red check isSciMLSensitivity.jl/Core4(https://github.com/SciML/OrdinaryDiffEq.jl/actions/runs/38862093679/job/116846462520):AssertionError: mi2 !== nothinginCore4/ensembles.jl:19underEnsembleThreads(), "15 passed, 0 failed, 1 errored, 2 broken". I compared it against master: the identical error and summary appear on master 8d8191b (job 117424176936) and 0139bdc (job 117316399249), and Core4 also fails on master 22da966, d727918 and 53e7d1d. So it predates this PR and has nothing to do with PDIRK.perform_step!branch, and the committed test catches it deterministically at any thread count (it errors before the fix). The test also asserts exact equality across all five options. My 4-thread repeated-solve check found no shared-buffer race.isthreadedpredicate, which makes the cache layout agree with the existingperform_step!branch. It fails before and passes after, Bool paths are bitwise unchanged, and the only red CI check also fails on master.🤖 Posted by an AI agent — harness: Devin CLI 3000.11.92 · model: fusion-claude-opus-5-5-high-sidekick-swe-2-medium
Conversation: local headless Devin review run (no public session URL); transcript kept by the fleet master.