Repository navigation
Make min/max on Dual consistent with isless - #869
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #869 +/- ##
==========================================
- Coverage 91.14% 91.06% -0.08%
==========================================
Files 11 11
Lines 1084 1086 +2
==========================================
+ Hits 988 989 +1
- Misses 96 97 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Looks right to me and behaves like #695. A case worth a test: under nesting, master's It may also deserve a line in the release notes, since derivatives at exact ties |
|
Not clear to me why GitHub isn't showing the "Update PR" button now that #875 has been merged. |
you mean "Update branch"? Is "Always suggest updating pull request branches" on for this repo? Settings, General, Pull Requests. |
bac4b93 to
96dd848
Compare
|
I was trying out the new "Overview page" view, and apparently they haven't implemented the "Update PR" button yet. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This reverts commit 6c93fd3. Without these methods, `min`/`max` on `Dual` fall back to Base's `min(x::T, y::T) where {T<:Real}`, which uses `<` instead of `isless` and returns the first argument whenever a NaN is involved. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
96dd848 to
1aeb58b
Compare
|
FYI the segfault on Julia 1.14 on windows is tracked upstream: JuliaLang/julia#64013 |


Fixes #868.
min/maxonDualwere generated from DiffRules. Those rules choose the partials by value only, so on a tie in value the result depended on the argument order rather than onisless, which breaks ties on the partials since #695:No DiffRules rule can express this tie-breaking, since a rule only sees the values. So this PR stops generating
min/maxfrom DiffRules and defines them in terms ofisless. Likemin/maxon floats, they propagate NaN values. MixedDual/Realarguments are promoted by Base'smin(::Real, ::Real).🤖 Generated with Claude Code