-
Notifications
You must be signed in to change notification settings - Fork 6
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
What does "consistent across runs" mean? #1
Comments
I recently discussed this topic offline with @tlively and they suggested the idea of having This is a much simpler approach than my earlier ideas. It eliminates the need for first-class |
I was still digesting your "intrinsic functions" solution, thinking of how it would work. My feeling was that it looks rather similar to Exploring this path further, I'm looking at the exception overview, |
I expect
Yes, exactly :-). |
I'm writing a description of this for the overview (WIP at https://github.com/ngzhian/relaxed-simd/blob/fpenv/proposals/relaxed-simd/Overview.md), I have a question to bring up for discussion: Is the "identity" of the fpenv the index, or the value contained within? (Based on the discussion so far I think it's the index). Here's a pseudo example:
Assume that Is it okay for the two instructions to return different results? If the "identity" is the index into the fpenv section, then it is okay to get different results. I think either way, fpenv still remains opaque, because applications don't know what |
If the So I think what we want to say is that the identity is a value encapsulated inside of |
Thanks for the explanation, I drafted a description of |
Filing this issue to track the discussions we have had over in WebAssembly/design#1401. (I tried to summarize the discussion to seed this issue with some content, any misrepresentation of the discussion that happened there is entirely my fault.)
The gist of the problem is, given an instruction that is specified to be non-deterministic (e.g. quasi-FMA (qfma)), it is valid (though unlikely in a Web VM) for two adjacent calls to the same instruction to return two different results, e.g.:
One idea from @sunfishcode WebAssembly/design#1401 (comment) is an opaque
fpenv
value that these instructions will take.Another idea from the same author is "intrinsic functions" WebAssembly/design#1401 (comment).
The key goal with both ideas is allowing applications to be able to specify this need for consistency.
One counter-argument (by @tlively) is that the usefulness of this ability to express such fine-grained intent is not worth the complexity, see WebAssembly/design#1401 (comment), especially for Web use cases.
Another issue (by @Maratyszcza) is that the fpenv/intrinsic functions will not resolve under-specified instructions like reciprocal algorithms, since they differ across processor models, and no way to emulate them. However, full emulation isn't the goal.
The text was updated successfully, but these errors were encountered: