Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

`min` does not return the minimum with respect to `isless` when values tie

オープン
#868 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@devmotion がすでに取り組んでいます。

2026年10月26日 から。

  • #869 @devmotion による — オープン

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
julia
領域
backend

調査の方向性

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 を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

JuliaDiff/ForwardDiff.jl のほかの issue

JuliaDiff/ForwardDiff.jl の issue をすべて見る

似ている issue

Julia の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。