gpuweb / cts

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

test validation of "one-handed rules": error required based on value of 1 arg when the operation has 2 or more (or K, and N>K) #3778

Open dneto0 opened 3 weeks ago

dneto0 commented 3 weeks ago

Example: Integer division e1 / e2 has rules like this:

If T is a signed integer scalar type, evaluates to:

We need CTS coverage for cases where e1 is a runtime expression, and e2 is const-expression 0 or override-expression 0. Those should trigger an error:

Example:

override zero = 0;
fn foo() {
  let a = 1;
  let b = a / 0; // shader-creation error
  let c = a / zero; // pipeline-creation error if foo is in the shader stage and 'zero' is not substituted at pipeline creation time.
}

Partial eval locations:

dneto0 commented 3 weeks ago

We first need a survey of which operations/builtins have such "one-handed" rules.

example:

alan-baker commented 3 weeks ago

I believe these are the instances where there are errors without full information:

Some of these might already be validated.