Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto
#2,265 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
54/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
wasm

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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?

Lenguaje dominante
WebAssembly
Estrellas
3.5k
Forks
539
Merge medio
10 h 24 min
PR fusionados (30 d)
11

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de WebAssembly/spec

Todos los issues de WebAssembly/spec

Issues similares

Más issues de Documentation

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.