-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename float32
/float64
back to f32
/f64
#277
Comments
If I understand #260 correctly, they are still not exactly the same. I.e. the Canonical ABI may still deliberately randomize NaN bit patterns when crossing component boundaries. |
It's true that the process of lifting and lowering is allowed to mess with the NaN payload bits of floats, but that's independent of the set of semantically-possible float values that can cross component boundaries. (Before #260, the set-of-possible-values was smaller for If we did this, probably we would want to deploy the change incrementally (accepting both in WAT/WIT for a while so that everyone can gradually switch, and then deprecating the old names). |
I find it useful to think of the rules not as "the bits might be randomized" but instead as "component-model floating-point types only have a single NaN value", with the randomization just being an artifact of how they're encoded in core wasm. |
I think that perspective is almost equivalent, but where I think it diverges is when lifting float values that are passed out to non-wasm (and thus not randomized during lowering), you are allowed to see multiple distinct NaN payloads -- if there was only a single semantic NaN value, this wouldn't be allowed. |
Independently of what the types are named, is it desirable to allow multiple distinct NaN payloads to be observed when passing values out to non-wasm? It would seem that any code depending on that functionality would be unvirtualizable. |
The original motivation for the change was to avoid forcing an extra canonicalization pass when, e.g., passing a |
With #279, the component-level I've also now posted #288 to add more documentation. |
Yep, with those semantic changes, I think you're right. Once we merge #288, I think we can close this issue, but I'll wait a while to collect more thoughts if anyone disagrees. |
Hm, I understand the motivation, but as is I find the naming discrepancy more confusing than helpful, because there is nothing in the name which actually conveys how Feel free to ignore, but short of a more self-explanatory alternative, I think I'd prefer the short names, since the semantics still is close enough and the difference, where it matters at all, implied by context. |
I definitely like the aesthetics of |
Using |
I fully agree with @rossberg's explanation of the real main issue and @lukewagner's framing about the If we're all on the same page now, I think the main question is when/how to do this. I imagine we'll want to roll it out gradually so that for a while both are acceptable but only |
In WebAssembly/component-model#277 there seems to be consensus emerging to rename `float32`/`float64` to `f32`/`f64`. This PR just adds support for parsing `f32`/`f64`, and changes nothing else for now, to start preparing for this change.
Regardless of when we do the full switch, we should start updating tools to at least recognize |
Great, thanks for doing that. Even though this isn't a breaking binary format / runtime change, to avoid confusing/breaking folks, I suppose we should wait for that change to merge, percolate a few months, and then we can switch over the WASI proposals and Explainer.md/WIT.md in this repo. |
* Accept `f32`/`f64` as aliases for `float32`/`float64`. In WebAssembly/component-model#277 there seems to be consensus emerging to rename `float32`/`float64` to `f32`/`f64`. This PR just adds support for parsing `f32`/`f64`, and changes nothing else for now, to start preparing for this change. * Add a test for `f32`/`f64`.
The `float32` and `float64` types are being [renamed to `f32` and `f64`]. All the main tools have been updated to accept both old and new names for now, so there's no urgeny to change anything, but users who wish to can now start switching to the new `f32`/`f64` names. While here, also add some brief documentation mentioning the handling of NaNs in `f32`/`f64`. [renamed to `f32` and `f64`]: WebAssembly/component-model#277
The `float32` and `float64` types are being [renamed to `f32` and `f64`]. All the main tools have been updated to accept both old and new names for now, so there's no urgency to change anything, but users who wish to can now start switching to the new `f32`/`f64` names. [renamed to `f32` and `f64`]: WebAssembly#277
* Rename `float32`/`float64` to `f32`/`f64`. The `float32` and `float64` types are being [renamed to `f32` and `f64`]. All the main tools have been updated to accept both old and new names for now, so there's no urgeny to change anything, but users who wish to can now start switching to the new `f32`/`f64` names. While here, also add some brief documentation mentioning the handling of NaNs in `f32`/`f64`. [renamed to `f32` and `f64`]: WebAssembly/component-model#277 * Update component-model/src/design/wit.md Co-authored-by: itowlson <[email protected]> --------- Co-authored-by: itowlson <[email protected]>
The `float32` and `float64` types in Wit are being [renamed to `f32` and `f64`]. All the main tools have been updated to accept both old and new names for now, so there's no urgency to change anything, but users who wish to can now start switching to the new `f32`/`f64` names. [renamed to `f32` and `f64`]: WebAssembly/component-model#277
The `float32` and `float64` types in Wit are being [renamed to `f32` and `f64`]. All the main tools have been updated to accept both old and new names for now, so there's no urgency to change anything, but users who wish to can now start switching to the new `f32`/`f64` names. [renamed to `f32` and `f64`]: WebAssembly/component-model#277
Following up on bytecodealliance#1364 which added `f32` and `f64` parsing support, this PR renames the types `float32` and `float64` to `f32` and `f64`. The old names are still accepted for now. WebAssembly/component-model#277
As discussed [here], and following up on bytecodealliance#1364 which added `f32` and `f64` parsing support, this PR renames the types `float32` and `float64` to `f32` and `f64`. The old names are still accepted by the parser for compatibility. [here]: WebAssembly/component-model#277
As discussed [here], and following up on bytecodealliance#1364 which added `f32` and `f64` parsing support, this PR renames the types `float32` and `float64` to `f32` and `f64`. The old names are still accepted by the parser for compatibility. [here]: WebAssembly/component-model#277
As discussed [here], and following up on #1364 which added `f32` and `f64` parsing support, this PR renames the types `float32` and `float64` to `f32` and `f64`. The old names are still accepted by the parser for compatibility. [here]: WebAssembly/component-model#277
* Rename `float32`/`float64` to `f32`/`f64`. The `float32` and `float64` types are being [renamed to `f32` and `f64`]. All the main tools have been updated to accept both old and new names for now, so there's no urgency to change anything, but users who wish to can now start switching to the new `f32`/`f64` names. [renamed to `f32` and `f64`]: #277 * Rename the Canonical ABI's `Float32`/`Float64` to `F32`/`F64`.
Is there anything left to do for this change? |
I don't think so; thanks everyone! |
As of preview2, the NaN-canonicalization rules have been relaxed and so in preview 2 the set of semantic values of
float32
is the same the set for core wasmf32
(and likewise forfloat64
/f64
).Since this was the main motivator for distinguishing between core wasm
fXX
and component modelfloatXX
types, we should consider gradually renaming the component model floating point types to match core wasm again.The text was updated successfully, but these errors were encountered: