Skip to content

buffer_view CTS#4652

Merged
alan-baker merged 13 commits into
gpuweb:mainfrom
alan-baker:buffer-view
Jul 14, 2026
Merged

buffer_view CTS#4652
alan-baker merged 13 commits into
gpuweb:mainfrom
alan-baker:buffer-view

Conversation

@alan-baker

@alan-baker alan-baker commented May 30, 2026

Copy link
Copy Markdown
Contributor

buffer_view validation and execution CTS tests.

Issue: #


Requirements for PR author:

  • All missing test coverage is tracked with "TODO" or .unimplemented().
  • New helpers are /** documented */ and new helper files are found in helper_index.txt.
  • Test behaves as expected in a WebGPU implementation. (If not passing, explain above.)
  • Test have be tested with compatibility mode validation enabled and behave as expected. (If not passing, explain above.)

Requirements for reviewer sign-off:

  • Tests are properly located.
  • Test descriptions are accurate and complete.
  • Tests provide complete coverage (including validation control cases). Missing coverage MUST be covered by TODOs.
  • Tests avoid over-parameterization (see case count report).

When landing this PR, be sure to make any necessary issue status updates.

@alan-baker
alan-baker requested review from dneto0 and jrprice May 30, 2026 20:09
@github-actions

github-actions Bot commented May 30, 2026

Copy link
Copy Markdown

Results for build job (at 0857a08):

+webgpu:api,validation,dispatch:shader_required_buffer_size:* - 23 cases, 92 subcases (~4/case)
+webgpu:api,validation,min_buffer_binding_size:compute,shader_required_buffer_size:* - 23 cases, 92 subcases (~4/case)
+webgpu:api,validation,min_buffer_binding_size:render,shader_required_buffer_size:* - 4 cases, 16 subcases (~4/case)
+webgpu:shader,execution,expression,call,builtin,bufferArrayView:array_length:* - 78 cases, 832 subcases (~11/case)
+webgpu:shader,execution,expression,call,builtin,bufferArrayView:array_length,functions:* - 78 cases, 1560 subcases (~20/case)
+webgpu:shader,execution,expression,call,builtin,bufferArrayView:read_layout:* - 35 cases, 604 subcases (~17/case)
+webgpu:shader,execution,expression,call,builtin,bufferArrayView:write_layout:* - 35 cases, 604 subcases (~17/case)
+webgpu:shader,execution,expression,call,builtin,bufferArrayView:read:* - 4 cases, 744 subcases (~186/case)
+webgpu:shader,execution,expression,call,builtin,bufferArrayView:write:* - 4 cases, 1224 subcases (~306/case)
+webgpu:shader,execution,expression,call,builtin,bufferLength:sized_buffer:* - 5 cases, 120 subcases (~24/case)
+webgpu:shader,execution,expression,call,builtin,bufferLength:unsized_buffer:* - 5 cases, 80 subcases (~16/case)
+webgpu:shader,execution,expression,call,builtin,bufferLength:max_size_buffer:* - 6 cases, 6 subcases (~1/case)
+webgpu:shader,execution,expression,call,builtin,bufferView:array_length:* - 78 cases, 832 subcases (~11/case)
+webgpu:shader,execution,expression,call,builtin,bufferView:array_length,functions:* - 78 cases, 2056 subcases (~26/case)
+webgpu:shader,execution,expression,call,builtin,bufferView:read_layout:* - 35 cases, 604 subcases (~17/case)
+webgpu:shader,execution,expression,call,builtin,bufferView:write_layout:* - 35 cases, 604 subcases (~17/case)
+webgpu:shader,execution,expression,call,builtin,bufferView:read:* - 4 cases, 856 subcases (~214/case)
+webgpu:shader,execution,expression,call,builtin,bufferView:write:* - 4 cases, 1224 subcases (~306/case)
 [snip - full report in action logs]
-TOTAL: 283854 cases, 2329266 subcases
+TOTAL: 285236 cases, 2346080 subcases

@alan-baker
alan-baker marked this pull request as ready for review June 17, 2026 15:20

@dneto0 dneto0 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

only partway reviewed

Comment thread src/webgpu/api/validation/dispatch.spec.ts
Comment thread src/webgpu/api/validation/dispatch.spec.ts
Comment thread src/webgpu/api/validation/dispatch.spec.ts
Comment thread src/webgpu/shader/execution/expression/call/builtin/buffer_view_utils.ts Outdated
Comment thread src/webgpu/shader/validation/decl/let.spec.ts Outdated
Comment thread src/webgpu/shader/validation/decl/let.spec.ts

@dneto0 dneto0 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Finished reviewing. This is a very impressive suite. Thanks for creating it!

I also suggest adding additional validation test cases for arrayLength, i.e. in src/webgpu/shader/validation/expression/call/arrayLength. Sized and unsized buffer types should be tested.

Comment thread src/webgpu/shader/validation/types/buffer.spec.ts Outdated
Comment thread src/webgpu/shader/validation/types/buffer.spec.ts
Comment thread src/webgpu/api/validation/dispatch.spec.ts
Comment thread src/webgpu/shader/validation/types/buffer.spec.ts
Comment thread src/webgpu/shader/validation/functions/restrictions.spec.ts
* Validation of buffer type and related builtin functions
* Tests for
  * bufferLength
  * bufferView
  * bufferArrayView

@dneto0 dneto0 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You've addressed all my feedback.

Please add a test case (that you mentioned offline) for dispatch validation:

  • in a render pipeline, when vertex and fragment use the same unsized buffer, the min size is the larger of the two uses.

I looked for it in webgpu:api,validation,dispatch:shader_required_buffer_size but it's fine for it to be in a new test, to avoid complicating that one.

@alan-baker
alan-baker requested a review from dneto0 July 13, 2026 20:27
@alan-baker

Copy link
Copy Markdown
Contributor Author

You've addressed all my feedback.

Please add a test case (that you mentioned offline) for dispatch validation:

  • in a render pipeline, when vertex and fragment use the same unsized buffer, the min size is the larger of the two uses.

I looked for it in webgpu:api,validation,dispatch:shader_required_buffer_size but it's fine for it to be in a new test, to avoid complicating that one.

I've added some simple tests for this. I moved them all to a new file. There's no point checking uniform since it must be sized and that will take precedence.

@dneto0 dneto0 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM! Thank you.
(with one nit)

Comment thread src/webgpu/api/validation/min_buffer_binding_size.spec.ts Outdated
@alan-baker
alan-baker enabled auto-merge (squash) July 14, 2026 19:48
@alan-baker
alan-baker merged commit af9a578 into gpuweb:main Jul 14, 2026
1 check passed
@alan-baker
alan-baker deleted the buffer-view branch July 14, 2026 19:58
beckysiegel pushed a commit to chromium/chromium that referenced this pull request Jul 15, 2026
Spec: gpuweb/gpuweb#6291
CTS: gpuweb/cts#4652

Both were approved and landed.

Bug: 506523117
Change-Id: I7a6ad45f4b3a637eb4f7cf015c5729f4ac38f5ea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8086445
Commit-Queue: Alan Baker <alanbaker@google.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1662578}
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.

3 participants