Skip to content

Validate Limits::max_compute_workgroup_storage_size#9732

Open
ErichDonGubler wants to merge 3 commits into
gfx-rs:trunkfrom
erichdongubler-mozilla:validate-workgroup_storage_size_limit_exceeded
Open

Validate Limits::max_compute_workgroup_storage_size#9732
ErichDonGubler wants to merge 3 commits into
gfx-rs:trunkfrom
erichdongubler-mozilla:validate-workgroup_storage_size_limit_exceeded

Conversation

@ErichDonGubler

@ErichDonGubler ErichDonGubler commented Jun 24, 2026

Copy link
Copy Markdown
Member

Connections

Implements the last bit of scope for #8946.

Conflicts with #9733. I have a resolution ready in trunk...erichdongubler-mozilla:wgpu:erichdongubler-push-uovkovyvxuzq to handle this.

Testing

Enable CTS tests.

Squash or Rebase? squashplz

Checklist

  • I self-reviewed and fully understand this PR.
  • WebGPU implementations built with wgpu may should be affected behaviorally.
  • Validation and feature gates are in place to confine behavioral changes.
  • Tests demonstrate the validation and altered logic works.
  • CHANGELOG.md entries for the user-facing effects of this change are present.
  • The PR is minimal, and doesn't make sense to land as multiple PRs.
  • Commits are logically scoped and individually reviewable.
  • The PR description has enough context to understand the motivation and solution implemented.

@ErichDonGubler ErichDonGubler self-assigned this Jun 24, 2026
@ErichDonGubler ErichDonGubler added type: bug Something isn't working area: correctness We're behaving incorrectly area: cts Issues stemming from the WebGPU Conformance Test Suite area: naga processing Passes over IR in the middle labels Jun 24, 2026
Comment thread wgpu-core/src/validation.rs Outdated
Comment on lines +1533 to +1556
let check_workgroup_sizes = |sizes,
per_dimension_limits,
per_dimension_limits_desc,
total_limit,
total_limit_desc| {
let workgroup_storage_used = entry_point.workgroup_storage_size.next_multiple_of(16);
if workgroup_storage_used > self.limits.max_compute_workgroup_storage_size {
return Err(StageError::WorkgroupStorageSizeLimitExceeded {
used: workgroup_storage_used,
limit: self.limits.max_compute_workgroup_storage_size,
limit_desc: "max_compute_workgroup_storage_size",
});
}

check_workgroup_sizes(
sizes,
per_dimension_limits,
per_dimension_limits_desc,
total_limit,
total_limit_desc,
)
.map_err(Into::into)
};

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

note: This particular hunk changes stylistically with merge conflict resolution against #9733. I recommend taking a look at that, too, if you're reviewing this, just to see if you agree with the taste.

@ErichDonGubler ErichDonGubler force-pushed the validate-workgroup_storage_size_limit_exceeded branch 2 times, most recently from c97e9eb to 65e5d81 Compare June 25, 2026 07:39
@ErichDonGubler

Copy link
Copy Markdown
Member Author

Hmm…I haven't figured out why validation is incorrect yet, but that's what's tripping up CI. We appear to be failing webgpu:api,validation,compute_pipeline:overrides,workgroup_size,limits,workgroup_storage_size:* across platforms still.

Weirdly, …:isAsync=true doesn't fail on Windows. I suspect a different bug there. @andyleiserson, have you seen something like that before?

@ErichDonGubler ErichDonGubler force-pushed the validate-workgroup_storage_size_limit_exceeded branch from 65e5d81 to 1e017ee Compare June 26, 2026 14:44
@inner-daemons

Copy link
Copy Markdown
Collaborator

I'd like to take a look at this at some point for mesh/task shader purposes, if I don't take too long can this be blocked on my review?

@inner-daemons inner-daemons self-requested a review June 29, 2026 01:38
@ErichDonGubler

ErichDonGubler commented Jun 29, 2026

Copy link
Copy Markdown
Member Author

I'd like to take a look at this at some point for mesh/task shader purposes, if I don't take too long can this be blocked on my review?

If you think it'll take no more than a day or so, that sounds fine. Otherwise, I think it'd be better to just not validate for task and mesh shader stages and iterate in a separate PR, since the impetus here is to become compliant with the WebGPU spec. (and those aren't needed for it).

@inner-daemons inner-daemons 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, at least from the perspective of mesh/task shaders

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: correctness We're behaving incorrectly area: cts Issues stemming from the WebGPU Conformance Test Suite area: naga processing Passes over IR in the middle type: bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Validate maxComputeWorkgroupSize* and maxComputeWorkgroupStorageSize

2 participants