Fix WGSL runtime on WASM - #1619
Open
ArthurBrussee wants to merge 5 commits into
Open
ArthurBrussee wants to merge 5 commits into
ArthurBrussee wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Direct subgroup builtin usage can still generate WGSL without the required subgroups enable directive.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Fixes WGSL execution on WebAssembly by retaining operation interfaces, conditionally enabling subgroup support, and avoiding unsupported synchronous probes.
Changes:
- Root WGSL operation registrations in WASM binaries.
- Enable WGSL subgroups only for tagged plane operations.
- Return
Unsupportedfor throughput probes on WASM.
File summaries
| File | Description |
|---|---|
compiler/wgsl/to_wgsl.rs |
Adds the WASM inventory-root macro. |
compiler/wgsl/compiler.rs |
Invokes inventory roots during WASM compilation. |
compiler/wgsl/ops/mod.rs |
Aggregates operation-module roots. |
compiler/wgsl/ops/atomic.rs |
Roots atomic registrations. |
compiler/wgsl/ops/bitwise.rs |
Roots bitwise registrations. |
compiler/wgsl/ops/branch.rs |
Roots branch registrations. |
compiler/wgsl/ops/cmp.rs |
Roots comparison registrations. |
compiler/wgsl/ops/general.rs |
Roots general registrations. |
compiler/wgsl/ops/math.rs |
Roots math registrations. |
compiler/wgsl/ops/memory.rs |
Roots memory registrations. |
compiler/wgsl/ops/plane.rs |
Roots plane registrations and tags subgroup operations. |
compiler/wgsl/ops/sync.rs |
Roots synchronization registrations. |
compiler/wgsl/ops/vector.rs |
Roots vector registrations. |
throughput/base.rs |
Disables synchronous probes on WASM. |
Review details
- Files reviewed: 14/14 changed files
- Comments generated: 2
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
ArthurBrussee
force-pushed
the
fix/webgpu-wasm-runtime
branch
from
September 8, 2026 20:14
b563e28 to
828bb56
Compare
| }; | ||
| } | ||
|
|
||
| requires_subgroups!( |
Member
There was a problem hiding this comment.
The compiler now does't work when we pass enable subgroups on wgpu native for all plane ops.
| if let Some(builtin) = op.get_arg_attr::<BuiltInAttr>(ctx, i, &ATTR_BUILTIN) | ||
| && matches!( | ||
| builtin.0, | ||
| BuiltIn::SubgroupSize | BuiltIn::SubgroupId | BuiltIn::SubgroupInvocationId |
Member
There was a problem hiding this comment.
Those are availalbe even if plane ops aren't I believe.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
subgroupsextension only for subgroup operationsThis makes Brush runnable again on WebGPU + WASM