Skip to content

Add test to verify all the valid subgroup sizes work for subgroup size attribute#4666

Open
Jiawei-Shao wants to merge 4 commits into
gpuweb:mainfrom
Jiawei-Shao:test-all-subgroup-size
Open

Add test to verify all the valid subgroup sizes work for subgroup size attribute#4666
Jiawei-Shao wants to merge 4 commits into
gpuweb:mainfrom
Jiawei-Shao:test-all-subgroup-size

Conversation

@Jiawei-Shao

@Jiawei-Shao Jiawei-Shao commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

This patch adds an execution test to verify all the power-of-two values in [SubgroupMinSize, SubgroupMaxSize] can be used as @subgroup_size attribute in a simple compute pipeline.

This patch also adds a validation test that a pipeline creation error occurs when the subgroup size is smaller than
SubgroupMinSize or greater than SubgroupMaxSize.

Issue: #4640


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.

…e attribute

This patch adds an execution test to verify all the power-of-two values
in [SubgroupMinSize, SubgroupMaxSize] can be used as @subgroup_size
attribute in a simple compute pipeline.
@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown

Results for build job (at c729f59):

-webgpu:shader,execution,shader_io,compute_builtins:subgroup_size_attribute:* - 6 cases, 6 subcases (~1/case)
+webgpu:shader,execution,shader_io,compute_builtins:subgroup_size_attribute:* - 36 cases, 36 subcases (~1/case)
-TOTAL: 283009 cases, 2325912 subcases
+TOTAL: 283039 cases, 2325942 subcases

@Jiawei-Shao

Copy link
Copy Markdown
Collaborator Author

@jrprice @kainino0x PTAL, thanks!

new Uint32Array([...iterRange(numInvocations, x => 0)]),
GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_SRC | GPUBufferUsage.COPY_DST
);
t.trackForCleanup(outputBuffer);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

existing nit: not needed, makeBufferWithContents does it already.

@Jiawei-Shao Jiawei-Shao Jun 22, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done.

Note that the added test about subgroup_size == 8 will fail on Intel Gen12 GPUs using D3D12 driver.

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.

3 participants