← Chrome 152 reference

v152 · webgpu · wgsl · shipped

WebGPU: Subgroup Size Control

Limited availability

  • Chrome · enabled by default 152
  • Edge · mirrors Chrome (Chromium)
  • Firefox · positive position, support unrecorded
  • Safari · positive position, support unrecorded

Not on the Baseline register: webstatus.dev has no entry for this feature (the related webgpu-subgroups feature is Baseline limited), and the ChromeStatus record marks its Web Feature ID “Missing feature” (verified 2026-07-29).

The optional GPU feature "subgroup-size-control" lets a compute shader declare its subgroup size explicitly with the WGSL @subgroup_size attribute, instead of accepting whatever size the GPU driver picks. Ships in Chrome 152 on desktop, Android, and WebView, enabled by default.

No supported-size query — validate at pipeline creation

There is deliberately no API to enumerate the set of subgroup sizes an adapter accepts: the WebGPU working group considered explicit limits (explicitComputeSubgroupMinSize/MaxSize, maxComputeWorkgroupSubgroups) and decided against exposing them (gpuweb#6241), because expert users know their target sizes and native limit ranges do not reliably describe what is actually requestable. In practice:

Source: subgroup-size-control proposal — Native API Availability; gpuweb issue #6241 (limits declined); WGSL — @subgroup_size

at a glance

What it isAn optional GPUFeatureName, "subgroup-size-control", that enables the WGSL subgroup_size_control extension and its @subgroup_size attribute on compute shader entry points
Milestone listingChrome 152 — Enabled by default (milestone=152 listing, verified 2026-07-29; the listing is authoritative per gendn invariant #2)
PlatformsDesktop, Android, WebView — all 152 (Intent to Ship; “Will ship enabled for all users”, no about://flags entry, no Finch gate)
API surface addedNone beyond the feature name itself — the spec records “This feature adds no optional API surfaces”. All behavior is in WGSL and pipeline validation
WGSL surfaceenable subgroup_size_control; extension + @subgroup_size(<expr>) attribute — full contract on the attribute page
Spec statusMerged into the WebGPU and WGSL specifications via gpuweb/gpuweb PR #5578 (merged 2026-06-23)
ChromeStatus5077657663438848 — WebGPU: Subgroup Size Control (tracking bug 463721943)
Source: WebGPU spec — "subgroup-size-control"; chromestatus.com/feature/5077657663438848; Intent to Ship

why it exists

Without this feature, a compute shader can only read the subgroup size the driver happened to choose (the subgroup_size built-in). On platforms whose GPUs support several subgroup sizes that creates three concrete problems, per the proposal:

  1. Untestable code paths — correctness requires a path per possible size, but the developer cannot force a given size to test it.
  2. Suboptimal performance — the driver-chosen size is not always the best for a given workload (the motivating use case is AI/compute-heavy shaders tuned per subgroup width).
  3. Oversized derived parameters — workgroup sizes and workgroup-memory array sizes must be sized for the largest possible subgroup, wasting resources when a smaller size would do.

The native equivalents already existed: Vulkan's VK_EXT_subgroup_size_control (or Vulkan 1.3) and HLSL's [WaveSize()] (Shader Model 6.6). This feature brings the same control to WebGPU. Metal has no equivalent.

Source: subgroup-size-control proposal — Motivation + Native API Availability

how it works

  1. The page requests a device with "subgroup-size-control" in requiredFeatures. Per the spec, enabling this feature at device creation also enables "subgroups" on the device automatically.
  2. A WGSL module gains enable subgroup_size_control; — valid only when the device has the feature, and only alongside enable subgroups;.
  3. The compute entry point declares @subgroup_size(N). The pipeline will run with exactly that subgroup size, and the subgroup_size built-in always equals N.
  4. Validation happens at shader creation (const-expression violations) and pipeline creation (range, workgroup-divisibility, and implementability checks) — see the error taxonomy.
Source: WebGPU spec — "subgroup-size-control"; WGSL — subgroup_size_control extension

syntax

The feature is a string in the GPUFeatureName enum — present verbatim in the spec's feature index and in Chromium's gpu_supported_features.idl:

// GPUFeatureName (spec feature index §25.23)
"subgroup-size-control"

Feature detection and device request follow the standard WebGPU pattern:

const adapter = await navigator.gpu.requestAdapter();

const requestedFeatures = [];
if (adapter.features.has("subgroup-size-control")) {
  requestedFeatures.push("subgroup-size-control");
} else {
  // Use an alternate code path (driver-chosen subgroup size).
}

const device = await adapter.requestDevice({ requiredFeatures });
Source: WebGPU spec — "subgroup-size-control"; Chromium gpu_supported_features.idl; proposal — example usage

inputs

InputContract
adapter.featuresA GPUSupportedFeatures set; has("subgroup-size-control") tells whether this adapter can grant the feature. Passing an unknown string to has() returns false — safe on browsers that predate the enum value
descriptor.requiredFeaturesInclude "subgroup-size-control" to grant it. There are no accompanying limits or descriptors — the feature has no optional API surface and exposes no new GPUAdapterInfo fields (explicit limits were considered and declined, gpuweb#6241)
Implicit companionRequesting "subgroup-size-control" implicitly enables "subgroups" on the device; it does not need to be listed separately
Source: WebGPU spec — GPUAdapter.requestDevice(); WebGPU spec — "subgroup-size-control"; gpuweb#6241

outputs

Source: WebGPU spec — "subgroup-size-control"; WGSL — @subgroup_size

errors

SituationBehavior
requiredFeatures contains "subgroup-size-control" but the adapter lacks itrequestDevice() rejects with a TypeError — deliberately the same error as for a feature name the browser does not know at all, “converging” unknown-name and unsupported-adapter behavior so sites must feature-detect rather than branch on error types
Feature not requested, but WGSL uses @subgroup_sizeShader-creation error (the subgroup_size_control extension is not enabled)
Feature requested, WGSL enables subgroup_size_control without subgroupsShader-creation error — the two must be enabled together
Attribute value out of range / not a power of two / pipeline not creatableSee the attribute error taxonomy (shader-creation vs pipeline-creation vs uncategorized error, by expression kind)
Source: WebGPU spec — requestDevice() device-timeline steps; WGSL — subgroup_size_control extension

context and exposure

Source: WebGPU spec — GPU interface exposure; proposal — Native API Availability (Metal); WGSL — @subgroup_size

lifecycle

StageWhat happens
1. Queryadapter.features.has("subgroup-size-control") — static per adapter
2. GrantrequestDevice({requiredFeatures: ["subgroup-size-control"]}) — one-time; the adapter is consumed; "subgroups" enabled alongside
3. Shader authoringenable subgroup_size_control; + @subgroup_size(N) on a compute entry point; const-expression values are validated at shader creation
4. Pipeline creationRange (subgroupMinSize..subgroupMaxSize), power-of-two (override-expressions), workgroup-divisibility, and implementability are validated; failures surface as pipeline-creation errors (or uncategorized errors for hardware limits)
5. DispatchThe pipeline always runs at subgroup size N; the subgroup_size built-in equals N. The choice is immutable for the pipeline's lifetime — a different size means a new pipeline
Source: WebGPU spec — requestDevice(); WGSL — @subgroup_size; proposal — Behavior

examples

Feature-detect, request, and use (JS + WGSL, per the proposal):

const adapter = await navigator.gpu.requestAdapter();
const requestedFeatures = [];
if (adapter.features.has("subgroup-size-control")) {
  requestedFeatures.push("subgroup-size-control");
} else {
  // Fall back to a driver-sized variant of the shader.
}
const device = await adapter.requestDevice({ requiredFeatures });
enable subgroups;
enable subgroup_size_control;

@compute @workgroup_size(64, 1, 1) @subgroup_size(32)
fn main(@builtin(subgroup_invocation_id) sg_id : u32,
        @builtin(subgroup_size) sg_size : u32) {
    // sg_size is guaranteed to be 32 in this pipeline.
}
Live example from the Chrome Platform Showcase (route HEAD-checked 200, 2026-07-29). Requires a browser with WebGPU; the demo feature-detects and reports when the GPU lacks the feature.Source: chrome-platform-showcase — WebGPU: Subgroup Size Control
Source: proposal — example usage

tests

WebGPU conformance lives in the gpuweb/cts test suite rather than upstream WPT directories. A search of the CTS operation, shader-execution, and validation trees found no dedicated subgroup-size-control tests at fetch time (2026-07-29); the Intent to Ship does not record a WPT/CTS row beyond the standard process. Treat behavior as spec-defined but conformance-unverified in public test suites.

Source: gpuweb/cts repository (operation/execution/validation trees searched 2026-07-29); Intent to Ship

browser compatibility

Interim table. BCD has no entry for this feature — api/GPUSupportedFeatures.json carries feature_subgroups but no feature_subgroup-size-control key, and there is no @subgroup_size WGSL entry (verified 2026-07-29). Rows below are compiled from the linked primary sources, not from BCD.

BrowserSupportEvidence
ChromeEnabled by default from 152 (desktop, Android, WebView)milestone=152 listing; Intent to Ship; gpu_supported_features.idl (enum value present at trunk)
EdgeMirrors Chrome (Chromium)Chromium-based; no separate record
FirefoxStandards position positive; shipped support not recorded in public dataIntent thread — “Gecko: Positive … Feedback indicated via WebGPU standardization process”. BCD records Firefox 141 for the related subgroupMinSize/subgroupMaxSize queries, not for this feature
SafariStandards position positive; shipped support not recorded in public dataIntent thread — “WebKit: Positive … Specification approval constitutes a positive signal”. BCD records Safari as not supporting the subgroup size queries at all (2026-07-29)
Source: BCD api/GPUSupportedFeatures.json; BCD api/GPUAdapterInfo.json; chromestatus.com/feature/5077657663438848

security and privacy

Source: gpuweb#6241; proposal — Native API Availability; WebGPU spec — "subgroup-size-control"

specifications

DocumentStatus
WebGPU — feature index, "subgroup-size-control"Merged (PR #5578, 2026-06-23): enables the WGSL attribute; auto-enables "subgroups"; no optional API surfaces
WGSL — subgroup_size_control enable extension + @subgroup_size attributeMerged (same PR): grammar, parameter contract, and the full error taxonomy — detailed on the attribute page
subgroup-size-control proposalStatus “Merged”; motivation, native-API mapping (Vulkan/HLSL/Metal), behavior notes. The proposal text says “not been approved by the working group yet” — superseded by the merged spec; noted for provenance
Vulkan VK_EXT_subgroup_size_control · HLSL WaveSize (SM 6.6)Native equivalents the design maps to (Metal: no equivalent)
Source: repository and spec contents fetched 2026-07-29

see also