Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

NaN propagation: `nans_N` side condition and deterministic-profile sentence regressed

Aperta
#2,265 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
54/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
wasm
Ambito
documentation

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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:

  1. the ∀ ±NAN(n) ∈ z*, n = canon_N condition and its counterpart ∃ ±NAN(n) ∈ z*, n ≠ canon_N

  2. 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?

Lingua principale
WebAssembly
Stelle
3.5k
Fork
539
Merge medio
10h 24m
PR unite (30g)
11

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di WebAssembly/spec

Tutte le issue di WebAssembly/spec

Issue simili

Altre issue su Documentation

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.