uniformity: test uniformity when a loop body only returns (#4477)

Consider: loop { s1 continuing { s2 } }

If the statement behaviour of s1 is exactly {Return}, then the statement
behaviour of the entire loop is {Return}. In particular, nonuniformity
effects do not leak out from s2 to the context after or outside of the
whole loop.

See the WGSL spec fix for https://github.com/gpuweb/gpuweb/issues/5100

Test three new statement scenarios, each where s1 starts with `return;`,
but varying where a collective operation is placed:
 - immediately after the return statement
 - in the continuing block of the same loop
 - immediately after the loop, where the continuing block in the loop
   has a break-if. This case requires the analysis to avoid using a
   Next behaviour from the overall loop.
 - immediately after the loop

Also test similar variants where we use `break` instead of `return`.

Also test loop constructs:
 - for with a condition: desugars to loop with initial `if !(cond) { break;}`
 - for without a condition: desugars to loop without that initial
   conditional break.
 - while loop

Fixed: #4476
1 file changed
tree: 06d7cfc98f09973980cac27c8168de366b06368e
  1. .github/
  2. .vscode/
  3. docs/
  4. src/
  5. standalone/
  6. tools/
  7. .eslint-resolver.js
  8. .eslintignore
  9. .eslintrc.json
  10. .gitattributes
  11. .gitignore
  12. babel.config.js
  13. CONTRIBUTING.md
  14. cts.code-workspace
  15. deploy_key.enc
  16. Gruntfile.js
  17. LICENSE.txt
  18. node.tsconfig.json
  19. package-lock.json
  20. package.json
  21. prettier.config.js
  22. README.md
  23. tsconfig.json
  24. w3c.json
README.md

WebGPU Conformance Test Suite

This is the conformance test suite for WebGPU. It tests the behaviors defined by the WebGPU specification.

The contents of this test suite are considered normative; implementations must pass them to be WebGPU-conformant. Mismatches between the specification and tests are bugs.

This test suite can be embedded inside WPT or run in standalone.

Launch the standalone CTS runner / test plan viewer

Contributing

Please read the introductory guidelines before contributing. Other documentation may be found in docs/ and in the helper index (source).

Read CONTRIBUTING.md on licensing.

For realtime communication about WebGPU spec and test, join the #WebGPU:matrix.org room on Matrix.