Skip to content

[WebGPU] Reserve additional keywords to avoid WGSL identifier collisions#18960

Merged
tqchen merged 1 commit intoapache:mainfrom
akaashrp:codegen
Apr 2, 2026
Merged

[WebGPU] Reserve additional keywords to avoid WGSL identifier collisions#18960
tqchen merged 1 commit intoapache:mainfrom
akaashrp:codegen

Conversation

@akaashrp
Copy link
Copy Markdown
Contributor

Compiling Qwen3.5 yielded WGSL of the following form: var<storage, read_write> storage : array<f32>; . This led to a 'cyclic dependency' error due to the identifier collision. This PR reserves keywords such as storage to avoid parsing errors.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the WebGPU code generator by reserving several WGSL keywords and access modes, such as "storage" and "read_write", to prevent name collisions during code generation. The reviewer suggests expanding this list to include a more comprehensive set of WGSL identifiers, including basic types and fundamental keywords like "fn" and "struct", to ensure greater robustness.

Comment thread src/target/source/codegen_webgpu.cc
@tqchen tqchen merged commit ad65d9f into apache:main Apr 2, 2026
11 checks 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