-
Notifications
You must be signed in to change notification settings - Fork 194
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
[valid] Disallow NaNs and infinities #2508
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also document that Literal::F32
and Literal::F64
must not be nan or infinity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry - could we also get some coverage in tests/wgsl-errors.rs
?
It's not possible to spell out NaNs or infinities in WGSL though. I did run a manual test here: #2461 (comment).
Should we? I keep going back and forth on what's best for IR documentation. So far I've been of the opinion that if validation covers it there is no need to document what the validation is already doing but let me know what you think! In this case we'll also most likely get an extension + capability which will allow NaNs and infinities. |
Oh, that's true. If this change were more involved I would want to imitate the unit tests from
Yes, this is a risk. On the balance, though, I think it's really valuable to have the |
WGSL doesn't currently allow NaNs and infinities.
Resolves #2461.