Skip to content

Access subgroupMinSize/subgroupMaxSize directly on GPUAdapterInfo#4663

Merged
kainino0x merged 2 commits into
gpuweb:mainfrom
gyagp:subgroup-size-direct-access
Jun 13, 2026
Merged

Access subgroupMinSize/subgroupMaxSize directly on GPUAdapterInfo#4663
kainino0x merged 2 commits into
gpuweb:mainfrom
gyagp:subgroup-size-direct-access

Conversation

@gyagp

@gyagp gyagp commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

These properties are now exposed on GPUAdapterInfo, so the local SubgroupProperties interface and the adapterInfo as SubgroupProperties casts are no longer needed. Read them directly via adapterInfo.subgroupMinSize / adapterInfo.subgroupMaxSize.

They are still declared optional in @webgpu/types (number | undefined), so a non-null assertion (!) is used at these call sites, which are all gated on the subgroups (or subgroup-size-control) feature where the values are guaranteed to be present.


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.

These properties are now exposed on GPUAdapterInfo, so the local
`SubgroupProperties` interface and the `adapterInfo as SubgroupProperties`
casts are no longer needed. Read them directly via
`adapterInfo.subgroupMinSize` / `adapterInfo.subgroupMaxSize`.

They are still declared optional in @webgpu/types (number | undefined),
so a non-null assertion (!) is used at these call sites, which are all
gated on the `subgroups` (or `subgroup-size-control`) feature where the
values are guaranteed to be present.

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
@gyagp

gyagp commented Jun 12, 2026

Copy link
Copy Markdown
Contributor Author

When working on #4656, I found subgroupMinSize/subgroupMaxSize could be accessed directly via GPUAdapterInfo. So I created this PR for cleanup. PTAL.

@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown

Results for build job (at b2cad92):

 Test case/subcase counts did not change.

@gyagp

gyagp commented Jun 13, 2026

Copy link
Copy Markdown
Contributor Author

@alan-baker, could you please review this? Thanks!

@kainino0x kainino0x left a comment

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.

LGTM, thanks!

@kainino0x kainino0x enabled auto-merge (squash) June 13, 2026 05:12
@kainino0x kainino0x merged commit 47babb2 into gpuweb:main Jun 13, 2026
1 check passed
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