gpuweb / cts

WebGPU Conformance Test Suite
https://gpuweb.github.io/cts/
BSD 3-Clause "New" or "Revised" License
121 stars 72 forks source link

Failing matrix multiplication tests #3765

Closed sudonatalie closed 4 weeks ago

sudonatalie commented 4 weeks ago

The webgpu:shader,validation,expression,matrix,mul:overflow_vec_f16:rhs=1;* tests fail in dawn due to unexpected overflow (the cases where compilation is expected to succeed). It looks like the test case should be modified so these cases no longer cause overflow.

Test file: https://github.com/gpuweb/cts/blob/main/src/webgpu/shader/validation/expression/matrix/mul.spec.ts

Example failure:

webgpu:shader,validation,expression,matrix,mul:overflow_vec_f16:rhs=1;c=2;r=2 - fail:
  - VALIDATION FAILED: Unexpected compilationInfo 'error' message.
    5:15: error: '65504.0 + 65504.0' cannot be represented as 'f16'

    ---- shader ----

    enable f16;
    @compute @workgroup_size(1)
    fn main() {
      const foo = mat2x2h(65504,65504,65504,65504,) * vec2h(1);
    }

      at (elided: below max severity)
  - EXCEPTION: Error: Unexpected validation error occurred: Error while parsing WGSL: :5:15 error: '65504.0 + 65504.0' cannot be represented as 'f16'
      const foo = mat2x2h(65504,65504,65504,65504,) * vec2h(1);
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^