Skip to content

Add unary, function, and uniformity tests for WGSL immediate pointers#4677

Open
shaoboyan091 wants to merge 4 commits into
gpuweb:mainfrom
shaoboyan091:pr/immediate-unary-fn-uniformity
Open

Add unary, function, and uniformity tests for WGSL immediate pointers#4677
shaoboyan091 wants to merge 4 commits into
gpuweb:mainfrom
shaoboyan091:pr/immediate-unary-fn-uniformity

Conversation

@shaoboyan091

Copy link
Copy Markdown
Contributor

Adds WGSL immediate address space coverage to three more validation areas, continuing #4658, #4661, and #4675:

  • expression/unary/address_of_and_indirection.spec.ts: include immediate in the address-of / dereference basic and composite cases (immediate excludes bool and arrays).
  • functions/restrictions.spec.ts: add ptr<immediate, u32> parameter (valid with unrestricted_pointer_parameters), invalid immediate access-mode parameters, and the matching argument case.
  • uniformity/uniformity.spec.ts: add a uniform_immediate condition — reads from an immediate variable are uniform.

This patch extends address-of and indirection validation to
`var<immediate>`.

The new cases verify that shaders can take the address of immediate
variables, read through `ptr<immediate>` values, and reject writes
through those pointers. The generated matrix is limited to store types
that are valid for `immediate`; invalid store types are covered by the
declaration and pointer type suites.
This patch extends function restriction tests for
`ptr<immediate, u32>` parameters.

The new cases verify that immediate pointer parameters follow the
`unrestricted_pointer_parameters` language feature gate, that calls can
pass the address of a `var<immediate>` to a matching parameter, and
that explicit read and write access modes on immediate pointer
parameters are rejected.
This patch adds `var<immediate>` reads as a uniform condition source
in the uniformity suite.

The coverage verifies that control flow depending on immediate data is
treated as uniform in the baseline uniformity cases and in the subgroup
variants. The cases are skipped unless immediate data support is
exposed by the browser.
@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown

Results for build job (at b03b79b):

-webgpu:shader,validation,expression,unary,address_of_and_indirection:basic:* - 88 cases, 88 subcases (~1/case)
-webgpu:shader,validation,expression,unary,address_of_and_indirection:composite:* - 76 cases, 608 subcases (~8/case)
+webgpu:shader,validation,expression,unary,address_of_and_indirection:basic:* - 104 cases, 104 subcases (~1/case)
+webgpu:shader,validation,expression,unary,address_of_and_indirection:composite:* - 86 cases, 688 subcases (~8/case)
-webgpu:shader,validation,functions,restrictions:function_parameter_types:* - 60 cases, 60 subcases (~1/case)
-webgpu:shader,validation,functions,restrictions:function_parameter_matching:* - 47 cases, 6063 subcases (~129/case)
+webgpu:shader,validation,functions,restrictions:function_parameter_types:* - 64 cases, 64 subcases (~1/case)
+webgpu:shader,validation,functions,restrictions:function_parameter_matching:* - 48 cases, 6240 subcases (~130/case)
-webgpu:shader,validation,uniformity,uniformity:basics:* - 135 cases, 46170 subcases (~342/case)
-webgpu:shader,validation,uniformity,uniformity:basics,subgroups:* - 135 cases, 133380 subcases (~988/case)
+webgpu:shader,validation,uniformity,uniformity:basics:* - 135 cases, 48600 subcases (~360/case)
+webgpu:shader,validation,uniformity,uniformity:basics,subgroups:* - 135 cases, 140400 subcases (~1040/case)
-TOTAL: 283187 cases, 2326095 subcases
+TOTAL: 283218 cases, 2335822 subcases

@shaoboyan091 shaoboyan091 requested a review from jrprice July 1, 2026 03:36
@shaoboyan091

Copy link
Copy Markdown
Contributor Author

PTAL, only webgpu:shader,validation,expression,unary,address_of_and_indirection:composite: and webgpu:shader,validation,expression,unary,address_of_and_indirection:basic:* fails in f16 type cases.

@shaoboyan091

Copy link
Copy Markdown
Contributor Author

@jrprice softly ping for review :)

@shaoboyan091

Copy link
Copy Markdown
Contributor Author

softly ping for review :)

@dj2

dj2 commented Jul 6, 2026

Copy link
Copy Markdown
Member

Sorry for the slow reply, James is out on vacation at the moment.

@shaoboyan091

Copy link
Copy Markdown
Contributor Author

Thanks for reviewing!

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