Skip to content

Conversation

@sudonatalie
Copy link
Contributor

Add some initial valid swizzle assignment tests on basic var vectors.

These tests pass on my current WIP implementation of the feature locally.

Issue: #4579


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.

@github-actions
Copy link

github-actions bot commented Jan 30, 2026

Results for build job (at 8ef7fcf):

+webgpu:shader,execution,statement,swizzle_assignment:swizzle_assignment:* - 11 cases, 11 subcases (~1/case)
-webgpu:shader,validation,parse,requires:wgsl_matches_api:* - 8 cases, 8 subcases (~1/case)
+webgpu:shader,validation,parse,requires:wgsl_matches_api:* - 9 cases, 9 subcases (~1/case)
-TOTAL: 285934 cases, 2344827 subcases
+TOTAL: 285946 cases, 2344839 subcases

Copy link
Contributor

@alan-baker alan-baker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add TODOs or unimplemented test suites for the following:

  • Other address spaces (only function is tested currently)
  • Chained swizzles
  • Pointer to swizzle


// Store result to Output
for (var i = 0; i < ${vecSize}; i++) {
outputs.data[count] = v[i];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is count necessary? Couldn't this just be i?

expected: readonly number[];
}

const kSwizzleAssignmentCases: SwizzleAssignmentCase[] = [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a boolean vector case or two? You'd need to modify the shader to use a different output type.

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.

2 participants