Repository navigation
Fix Unitful ODE_DEFAULT_NORM to compute RMS (#4596) - #4609
Merged
ChrisRackauckas merged 3 commits intoSep 27, 2026
Merged
ChrisRackauckas merged 3 commits into
ChrisRackauckas merged 3 commits into
Conversation
This was referenced Sep 23, 2026
Assert Unitful Array and AbstractArray norms match plain RMS of stripped values, currently wrong as sqrt(mean(abs)). Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Cursor Agent <[email protected]> Agent-Harness: Cursor Agent CLI 2026.09.18-9a7762b Agent-Model: auto Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/OrdinaryDiffEq.jl/jobs/4596-cursor/log.txt on amdci2.julia.csail.mit.edu
Scalar ODE_DEFAULT_NORM is abs, so summing it then taking sqrt gave sqrt(mean(|x|)). Use abs2 of stripped values to match plain-array RMS. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Cursor Agent <[email protected]> Agent-Harness: Cursor Agent CLI 2026.09.18-9a7762b Agent-Model: auto Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/OrdinaryDiffEq.jl/jobs/4596-cursor/log.txt on amdci2.julia.csail.mit.edu
ChrisRackauckas-Claude
force-pushed
the
agent/4596-unitful-rms-norm
branch
from
September 26, 2026 18:22
64a0e08 to
107347f
Compare
Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Cursor Agent <[email protected]> Agent-Harness: Cursor Agent CLI 2026.09.26-dd393fe Agent-Model: auto Agent-Session: local session, transcript at /home/crackauc/sandbox/goals/issue-backlog/adopt/SciML_OrdinaryDiffEq.jl-4609/log.txt on amdci2.julia.csail.mit.edu
ChrisRackauckas
marked this pull request as ready for review
September 27, 2026 12:14
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>
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.
Please ignore until reviewed by @ChrisRackauckas.
Summary
The Unitful
ODE_DEFAULT_NORMfor arrays wassqrt(mean(abs(value(x))))because the scalar method isabs, notabs2. It now usessqrt(mean(abs2(value(x)))), matching the plain-array RMS (e.g.[3,4]u"m"→ ≈3.5355 instead of ≈1.8708). This is a numerical change (error control / step counts for Unitful adaptive solves can change); it is not an API break and no version bump is included.@fastmathwas not touched.Verification
Fail before (buggy master behavior) / negative control
Tail:
Pass after fix
DiffEqBase Core suite
Unitful ODE solve still works (scratch env; not downstream/)
Runic
--checkandtyposon touched files: clean.Not verified
test/downstream).ODE_DEFAULT_NORMpattern may exist; out of scope for this issue).Reviewer pushback
max(length(u), 1)(aligned with plainArraynorm) is desired vs historical/ length(u).sum(ODE_DEFAULT_NORM)-on-scalars pattern need the same treatment.Fixes #4596
Please ignore this draft until reviewed by @ChrisRackauckas.
Harness: Cursor Agent CLI 2026.09.18-9a7762b; model: auto; transcript: /home/crackauc/sandbox/agent-jobs/OrdinaryDiffEq.jl/jobs/4596-cursor/log.txt on amdci2.julia.csail.mit.edu
Adoption update
Adopted the stalled PR on 2026-09-26 (Cursor Agent CLI 2026.09.26-dd393fe).
Rebase / branch
git fetch fork: nobody else pushed;HEAD..fork/agent/4596-unitful-rms-normwas empty before rebase.origin/master(f9ce35da…); no conflicts. Authorship preserved (no squash).git push --force-with-lease fork agent/4596-unitful-rms-norm.Fail-before / pass-after (regression
lib/DiffEqBase/test/unitful_ext.jl)With
DiffEqBaseUnitfulExt.jlreverted to master:(Evaluated:
1.8708286933869707 ≈ 3.5355339059327378.)With the fix restored:
Affected test group
cd lib/DiffEqBase && GROUP=Core julia +1.12 --project=. -e 'using Pkg; Pkg.test()'→Unitful extension | 9 9andTesting DiffEqBase tests passed.Runic
--checkon the three touched files: clean.CI classification (pre-rebase failures on PR)
All four red checks also fail on current
master(or share the same unrelated root cause); none are caused by this Unitful RMS change:MethodError: no constructors have been defined for Anyinconcrete_solve_derivatives.jl. Same on master: https://github.com/SciML/OrdinaryDiffEq.jl/actions/runs/36242489986/job/108415150951high_level_solve.jl:94despecialized callback kwargs (unrelated). Same on master: https://github.com/SciML/OrdinaryDiffEq.jl/actions/runs/36242489922/job/108422524630diag(::ScalarOperator)MethodError. Same on master: https://github.com/SciML/OrdinaryDiffEq.jl/actions/runs/36242489922/job/108422524661high_level_solve.jl:94failure as (2). Master Sublibrary CI does not schedule DiffEqBase unless those paths change (e.g. https://github.com/SciML/OrdinaryDiffEq.jl/actions/runs/36242490111); Julia 1 DiffEqBase Core on this PR already passed. Treated as master-preexisting / out of scope.Not verified
Risk assessment
ODE_DEFAULT_NORMfor Unitful arrays inDiffEqBase's Unitful extension. It computedsqrt(mean(abs(value(x))))and now computes the RMSsqrt(mean(abs2(value(x)))), consistent with the unitless default norm. Adaptive step control for Unitful problems changes to match the unitless solve of the same problem. Non-Unitful code paths are untouched, and there is no public API change.Risk assessment and review coordination by 🤖 Claude Code (model: claude-opus-5-5[1m]), https://claude.ai/code/session_01NdFVhANTF4nepTbqYxjfRP