`relaxed_trunc`: the symbol `R` is not defined
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- wasm
- Domain
- compilers, documentation
Research direction
Read the relaxed truncation prose in document/core/exec/numerics.rst and compare it with the related SpecTec definitions in specification/wasm-latest/3.0-numerics.relaxed.spectec and 3.1-numerics.scalar.spectec. First determine the intended meaning of bold R and reconcile the parameter and result definitions with the prose. Done means the notation and SpecTec definitions consistently express the agreed behavior.
Written by the indexing model from the issue text.
Description
Since #1906, the prose says that on NaNs and out-of-range values, relaxed_trunc returns either the saturated result or $\mathbf{R}$, depending on the global parameter R_trunc_u / R_trunc_s.
$\mathbf{R}$ appears only in the sections for the unsigned and signed variants and is not defined anywhere in the document. It is also easy to confuse with the plain $R$ that the "Relaxed Operations" section uses for a global parameter in $\mathrm{relaxed}(R)[A_0, \dots, A_n] = A_R$.
Question
Is $\mathbf{R}$ the set of all values of the result type, so that each execution may return any of them?
This reading seems consistent with the "Relaxed Operations" section, which says that each parameter is an index into a sequence of possible sets of results, and that the fixed operation can still be non-deterministic. #1906 also seems to suggest it: it changed the notes to "non-deterministic" and removed the test that checked that multiple calls with the same inputs return the same result.
If so, I think the prose should define it, e.g. "where $\mathbf{R}$ is the set of all values of the result type". I'm happy to open a PR.
Related: SpecTec
The SpecTec definitions were not updated by #1906:
-
$R_trunc_uis stillrelaxed4, while the prose now restricts the parameter to{0, 1}($R_trunc_sis alreadyrelaxed2). -
$relaxed_trunc__returnsiN(N')?, which can describe at most one result. Other non-deterministic operators such as$fadd_,$frelaxed_min_and$demote__returnfN(N)*.
- Dominant language
- WebAssembly
- Stars
- 3.5k
- Forks
- 540
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 16
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from WebAssembly/spec
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
WebAssembly/spec#2258 · 4 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
[js-api] A mutable global import allocates a const global before LinkErrorPossibly taken @chicoxyzzy claimed this 7 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 58/100
WebAssembly/spec#2253 ·
Maintainers usually reply within 1 day
-
[spectec] Wasm 1.0: `$instantiate` missing premisesPossibly taken @rossberg claimed this 33 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 68/100
WebAssembly/spec#2245 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
WebAssembly/spec#2235 · 9 comments ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
WebAssembly/spec#2196 ·
Maintainers usually reply within 1 day
All issues in WebAssembly/spec
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
flang:semantics
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
llvm/llvm-project#231051 ·
Maintainers usually reply within 1 day
-
bug derived types format I/O medium priority semantics
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
webgpu-tools/wesl-rs#329 ·
Maintainers usually reply within 1 day