Skip to content

Fix symbolic rounding with ForwardDiff 1.4.5 - #1948

Merged
ChrisRackauckas merged 1 commit into
JuliaSymbolics:masterfrom
ChrisRackauckas-Claude:agent/forwarddiff-symbolic-rounding-20260808
Aug 9, 2026
Merged

Fix symbolic rounding with ForwardDiff 1.4.5#1948
ChrisRackauckas merged 1 commit into
JuliaSymbolics:masterfrom
ChrisRackauckas-Claude:agent/forwarddiff-symbolic-rounding-20260808

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

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

Summary

Restore symbolic floor and ceil differentiation after ForwardDiff 1.4.5 switched Dual rounding to Base's round(x, ::RoundingMode) interface.

The compatibility methods are confined to SymbolicsForwardDiffExt and only apply when the dual primal is Num. The regression test directly checks both symbolic discontinuities.

Regression boundary

Clean Symbolics master at 30e97f6b5:

  • ForwardDiff 1.4.4: test/forwarddiff_symbolic_dual_ops.jl passes
  • ForwardDiff 1.4.5: fails at ceil(Dual{...,Num}) because ForwardDiff calls round(::Num, RoundUp)

The behavior changed in ForwardDiff PR #829 / commit 569af35:
JuliaDiff/ForwardDiff.jl#829

ForwardDiff's new method is correct for its rounding interface. Symbolics owns the cross-package compatibility because Num supports symbolic floor and ceil without implementing every Base rounding mode.

Local verification

Julia 1.12.6, ForwardDiff 1.4.5:

  • focused ForwardDiff extension test: passes, including the two new assertions
  • full GROUP=Core Pkg.test(): 17,105 passed, 355 pre-existing broken, exit 0

Julia 1.10.11, ForwardDiff 1.4.5:

  • focused ForwardDiff extension test: passes, including the two new assertions

Additional:

  • Runic.jl 1.7.0 was run in-place on every changed line and made no changes
  • git diff --check: passes

The clean-default failure was reproduced before this branch was created; no changes from the public fixpoint_sub PR are included here.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member Author

CI dependency note:

Merge/rebase order: #1946, #1947, then rebase this PR onto the resulting master.

@codecov-commenter

codecov-commenter commented Aug 8, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.29%. Comparing base (1a5328d) to head (fbc41dc).
⚠️ Report is 1 commits behind head on master.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff             @@
##           master    #1948       +/-   ##
===========================================
+ Coverage   23.43%   80.29%   +56.86%     
===========================================
  Files          61       61               
  Lines        5995     6086       +91     
===========================================
+ Hits         1405     4887     +3482     
+ Misses       4590     1199     -3391     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ChrisRackauckas
ChrisRackauckas marked this pull request as ready for review August 9, 2026 03:12
@ChrisRackauckas
ChrisRackauckas merged commit f18fb78 into JuliaSymbolics:master Aug 9, 2026
22 of 24 checks passed
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