Skip to content

Test swizzle assignment eval order#4608

Open
sudonatalie wants to merge 2 commits intogpuweb:mainfrom
sudonatalie:swizzle-eval-order
Open

Test swizzle assignment eval order#4608
sudonatalie wants to merge 2 commits intogpuweb:mainfrom
sudonatalie:swizzle-eval-order

Conversation

@sudonatalie
Copy link
Contributor

Test that the lhs swizzle's vector pointer is evaluated before the rhs. For a regular assignment, the vector value can be loaded after rhs evaluation (because rhs side effects on the target components will be overwritten anyways). However for a compound assignment, the lhs value of the swizzle must be loaded before rhs evaluation, and the vector should be re-loaded after rhs evaluation for use as the "old components" in the store of the whole result vector, because side effects from the rhs on non-swizzled components should persist.


Requirements for PR author:

  • All missing test coverage is tracked with "TODO" or .unimplemented().
  • New helpers are /** documented */ and new helper files are found in helper_index.txt.
  • Test behaves as expected in a WebGPU implementation. (If not passing, explain above.)
  • Test have be tested with compatibility mode validation enabled and behave as expected. (If not passing, explain above.)

Requirements for reviewer sign-off:

  • Tests are properly located.
  • Test descriptions are accurate and complete.
  • Tests provide complete coverage (including validation control cases). Missing coverage MUST be covered by TODOs.
  • Tests avoid over-parameterization (see case count report).

When landing this PR, be sure to make any necessary issue status updates.

Test that the lhs is evaluated before the rhs in a compound assignment
statement.
Test that the lhs swizzle's vector pointer is evaluated before the rhs,
and that it's value as a swizzle is loaded before rhs. Then check that
it is re-loaded after rhs evaluation for use in the store of the whole
swizzle assignment vector, because side effects from the rhs on
non-swizzled components should persist.
@sudonatalie sudonatalie requested a review from dneto0 February 26, 2026 22:05
@github-actions
Copy link

Results for build job (at a72a5dd):

+webgpu:shader,execution,statement,swizzle_assignment:eval_order:* - 1 cases, 1 subcases (~1/case)
+webgpu:shader,execution,statement,swizzle_assignment:compound_eval_order:* - 1 cases, 1 subcases (~1/case)
-TOTAL: 280593 cases, 2321592 subcases
+TOTAL: 280595 cases, 2321594 subcases

copybara-service bot pushed a commit to google/dawn that referenced this pull request Feb 28, 2026
Fix the order of evaluation for swizzle assignment so the lhs vector
pointer is evaluated before the right hand side.

Note that for the case of a compound swizzle assignment, the lhs is
loaded twice, to account for the fact that the lhs may be modified in
the evaluation of the rhs.

CTS: gpuweb/cts#4608

Fixes: 486839102
Change-Id: I1ca154b23938eebfc02ad8b29e55343aa12bdc01
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/293835
Commit-Queue: Natalie Chouinard <chouinard@google.com>
Reviewed-by: James Price <jrprice@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant