`min` does not return the minimum with respect to `isless` when values tie
メンテナーはふだん 1 日以内に返信
評価
調査の方向性
Start by reading the min implementation and its tests, then compare its tie handling with isless as changed in #695. Reproduce the reported min(x, 48.0) and min(48.0, x) results with ForwardDiff.Dual; done means tied values are selected consistently with isless, independent of argument order, and the regression is covered by a test.
索引モデルが issue の本文から書いたものです。
説明
min is documented to "return the minimum of the arguments, with respect to isless", but for a Dual that ties in value it returns whichever argument comes first:
julia> using ForwardDiff
julia> x = ForwardDiff.Dual(48.0, 1.0);
julia> isless(48.0, x)
true
julia> min(x, 48.0)
Dual{Nothing}(48.0,1.0)
julia> min(48.0, x)
Dual{Nothing}(48.0,0.0)
Since #695, isless breaks a value tie on the partials, so 48.0 is the smaller argument here, but min(x, 48.0) returns x. min picks its argument by value only, so on a tie the result depends on argument order rather than on isless.
I ran into this through differentiating Interpolations.jl, whose linear extrapolation clamps with min and then bounds-checks the result with <=, so it throws a BoundsError under --check-bounds=yes when differentiating exactly at the last knot.
ForwardDiff 1.4.6, Julia 1.12.7.
- 主要言語
- Julia
- スター
- 1k
- フォーク
- 165
- 平均マージ
- 6時間 34分
- マージ済み PR(30日)
- 1
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
JuliaDiff/ForwardDiff.jl のほかの issue
-
missing floatmin, floatmax, and issubnormal for Dual対応中かも @devmotion が 31 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
JuliaDiff/ForwardDiff.jl#852 · コメント 6 件 ·
メンテナーはふだん 1 日以内に返信
-
Third-order derivatives of `x / y` are `Inf` or `NaN` for small `y`, e.g. in gradients of Laplace approximations対応中かも @devmotion が 5 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
JuliaDiff/ForwardDiff.jl#866 ·
メンテナーはふだん 1 日以内に返信
-
`fma` and `muladd` ignore NaN-safe mode対応中かも @devmotion が 16 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
JuliaDiff/ForwardDiff.jl#860 ·
メンテナーはふだん 1 日以内に返信
-
Enable NaN-safe mode by default対応中かも @devmotion が 18 日前に担当しました。 オープン
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
JuliaDiff/ForwardDiff.jl#857 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
JuliaDiff/ForwardDiff.jl#854 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
JuliaDiff/ForwardDiff.jl の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
documentation invalid
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
JuliaPhysics/BeamletOptics.jl#190 ·
メンテナーはふだん 1 日以内に返信
-
mul! with a Symmetric or Hermitian factor throws for a matrix view whose columns are not contiguous対応中かも @dkarrasch が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
JuliaLang/LinearAlgebra.jl#1829 ·
メンテナーはふだん 1 日以内に返信
-
`EnsembleSummary` `ci_type = :SEM` ribbon is `sqrt(N)` too wide for scalar states対応中かも @isaacsas が 2 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
SciML/SciMLBase.jl#1654 ·
メンテナーはふだん 3 日以内に返信