NaN propagation: `nans_N` side condition and deterministic-profile sentence regressed
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 54/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- wasm
調査の方向性
Start with document/core/exec/numerics.rst, especially the nans_N side condition and deterministic-profile sentence cited in the issue; compare them with the formal definition and profile appendix. Then check test/core/f32.wast at the cited lines for the expected canonical-NaN behavior. Done means the wording and conditions agree with the intended semantics and the cited tests remain consistent.
索引モデルが issue の本文から書いたものです。
説明
In NaN Propagation, two changes from the relaxed-SIMD merge make the section inconsistent.
1. Non-NaN operands in nans_N
#1799 (acb599c4a) changed the side condition of nans_N from
∀ ±NAN(n) ∈ z*, n = canon_N
to
{z*} ⊆ {+NAN(canon_N), −NAN(canon_N)}
The old condition is also the one in Wasm 2.0 (∀ NAN(n) ∈ z*, n = canon_N), so this is a regression from 2.0.
The operators also pass their non-NaN operands in z* (e.g. fadd_N(±NAN(n), z_2) = nans_N{±NAN(n), z_2}), so the new condition is false whenever such an operand is present. For fadd_N(+NAN(canon_N), 1.0):
- prose and the old condition:
±NAN(canon_N) - current condition: any arithmetic NaN
With the current condition, only nans_N{} produces a canonical payload.
The test suite assumes the old meaning: f32.wast L217 and L377 expect nan:canonical from add of nan and 0x1p+0. The fdiv prose also returns nans_N{z_1, z_2} for two zeros, which now yields any arithmetic NaN for 0/0, while f32.wast L1222 expects nan:canonical.
2. Deterministic-profile sentence
The merge commit 3f0bd84d8 changed this sentence from
In the deterministic profile, only positive canonical NaN outputs are produced.
to
In the deterministic profile, however, a positive canonical NaNs is reliably produced in the latter case.
"The latter case" is the case with a non-canonical input, so the new sentence leaves the sign nondeterministic when all inputs are canonical. The formal definition and the profile appendix still say that every generated NaN is positive and canonical.
Suggested fix
I think the suggested fix is to restore the earlier text:
-
the
∀ ±NAN(n) ∈ z*, n = canon_Ncondition and its counterpart∃ ±NAN(n) ∈ z*, n ≠ canon_N -
line 1054:
* In the :ref:`deterministic profile <profile-deterministic>`, only positive canonical NaN outputs are produced.
@rossberg
Both changes come from the relaxed-SIMD merge. Could you confirm whether the old meaning is still intended?
- 主要言語
- WebAssembly
- スター
- 3.5k
- フォーク
- 539
- 平均マージ
- 10時間 24分
- マージ済み PR(30日)
- 11
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
WebAssembly/spec のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
WebAssembly/spec#2258 · コメント 4 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[js-api] A mutable global import allocates a const global before LinkError対応中かも @chicoxyzzy が 1 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
WebAssembly/spec#2253 ·
メンテナーはふだん 1 日以内に返信
-
[spectec] Wasm 1.0: `$instantiate` missing premises対応中かも @rossberg が 27 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
WebAssembly/spec#2245 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
WebAssembly/spec#2235 · コメント 9 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
WebAssembly/spec#2196 ·
メンテナーはふだん 1 日以内に返信
WebAssembly/spec の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
Juniper/ansible-junos-stdlib#904 ·
-
難易度 2/5 1時間未満 初心者へのやさしさ 75/100
googlecodelabs/feedback#2364 ·
-
area:http-gateway good first issue priority:low type:docs
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
crazy-goat/php-fpm-ng#828 ·
メンテナーはふだん 1 日以内に返信
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
danjdewhurst/story-skills#538 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
wimpysworld/sidra#290 ·
メンテナーはふだん 1 日以内に返信