Repository navigation
Add floating point execution rules - #1743
Conversation
Fixes gpuweb#1716 * Describes deviations from IEEE 754 * Adds tables defining accuracy of operations
dneto0
left a comment
There was a problem hiding this comment.
Looking good.
Thanks for doing this. It's important work.
* improve note about no nans or infinities * changed units of least precision to units in the last place * removed bullets about min/max of zeroes * clarified reassociation
| The rounding mode is unspecified for [SHORTNAME]. | ||
| If the result, `x`, is exactly representable in floating point, then `x` must be | ||
| returned. | ||
| Otherwise, a floating point value closest to `x`, either no less than `x` |
There was a problem hiding this comment.
I don't understand the "either not less or no greater than". Does it have a specific meaning here?
There was a problem hiding this comment.
Hm. Right, that phrase seems to provide no value.
I checked the IEEE 754 wording and it's pretty straightforward. Mostly it deals with the different prescribed rounding modes, but WGSL doesn't specify rounding mode or a way to set it.
So I think this sentence can be simplified.
Otherwise, the result is a floating point value closest to
x.
and maybe:
Note: When two floating point values are equally close to
x, the result can be either.
| or no greater than `x` must be returned. | ||
|
|
||
| The units in the last place, <dfn noexport>ULP</dfn>, for a floating point | ||
| number `x` is the minimum distance between two non-equal floating point numbers |
There was a problem hiding this comment.
"The units ... is the minimum". Should this be singular "The unit"?
| <tr><td>`distance(x, y)`<td>Inherited from `length(x - y)` | ||
| <tr><td>`exp(x)`<td>3 + 2 * |x| ULP | ||
| <tr><td>`exp2(x)`<td>3 + 2 * |x| ULP | ||
| <tr><td class="nowrap">`faceForward(x, y, z)`<td>Inherited from `dot(z, y) < 0.0 ? x : -x` |
There was a problem hiding this comment.
nit: we don't have ternary operators in WGSL
| The rounding mode is unspecified for [SHORTNAME]. | ||
| If the result, `x`, is exactly representable in floating point, then `x` must be | ||
| returned. | ||
| Otherwise, a floating point value closest to `x`, either no less than `x` |
There was a problem hiding this comment.
Hm. Right, that phrase seems to provide no value.
I checked the IEEE 754 wording and it's pretty straightforward. Mostly it deals with the different prescribed rounding modes, but WGSL doesn't specify rounding mode or a way to set it.
So I think this sentence can be simplified.
Otherwise, the result is a floating point value closest to
x.
and maybe:
Note: When two floating point values are equally close to
x, the result can be either.
* Clarify returned value for correctly rounded * Replace use of ternary operator with select builtin function
WGSL meeting minutes 2021-05-25
|
This PR adds beginComputePass.spec.ts file, then add compute_pass_descriptor_location test in order to test the validation of beginComputePass and its GPUComputePassDescriptor as a parameter. Issue: gpuweb#1743
* Add a query_set_type test to beginComputePass tests This PR adds a `timestampWrites,query_set_type` test to beginComputePass.spec.ts in order to check if a validation error is generated when all query types are not timestamp. Additionally, this PR adds tryComputePass utility method to avoid using duplicated validation checks. Issue: gpuweb#1743 * Add a query_index_count test to beginComputePass tests This PR adds a timestampWrites,query_index_count test to beginComputePass.spec.ts in order to check if a validation error is generated when querySet.count is not greater than timestampWrite.queryIndex. Issue: gpuweb#1743
Fixes #1716