Skip to content

Conversation

@beaufortfrancois
Copy link
Collaborator

Spec PR: gpuweb/gpuweb#5193

image


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.) They pass in a Chromium build patched with https://chromium-review.googlesource.com/c/chromium/src/+/6549638
  • 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 in the test tree.
  • Test descriptions allow a reader to "read only the test plans and evaluate coverage completeness", and accurately reflect the test code.
  • Tests provide complete coverage (including validation control cases). Missing coverage MUST be covered by TODOs.
  • Helpers and types promote readability and maintainability.

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

@beaufortfrancois beaufortfrancois force-pushed the buffer-binding-resource branch from 023a862 to 54eb9da Compare May 21, 2025 13:19
.fn(t => {
const { offset, size, bufferSize, bindBufferResource } = t.params;

const bufferData = new Uint8Array(bufferSize);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
const bufferData = new Uint8Array(bufferSize);
const bufferData = new Uint32Array(bufferSize / 4);

Copy link
Collaborator

Choose a reason for hiding this comment

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

optional nit

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This forces me to add / 4 in other places so if that's okay, I'll leave it as is.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sounds good.

)
.paramsSubcasesOnly(u =>
u //
.combine('bindBufferResource', [false, true] as const)
Copy link
Collaborator

Choose a reason for hiding this comment

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

We could avoid generating the subcases with offset / size when bindBufferResource is true. Also bufferSize could be extraBufferSize: [0, 8] and the computation done in the test.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

kainino0x pushed a commit to gpuweb/types that referenced this pull request May 28, 2025
This PR reflects changes from the following spec PRs:
* gpuweb/gpuweb#5193
* gpuweb/gpuweb#5160

Please publish new version after it's merged so that we can add tests in
the CTS as in gpuweb/cts#4390
@beaufortfrancois beaufortfrancois removed the request for review from greggman May 28, 2025 06:12
@greggman
Copy link
Contributor

just a nit but I'd never guess to look for binding buffer tests in src/webgpu/api/operation/compute/basic.spec.ts. Should we move them somewhere else or are they fine here?

@Kangz
Copy link
Collaborator

Kangz commented May 29, 2025

Ah yeah that's super odd.

@beaufortfrancois
Copy link
Collaborator Author

Where would you move them? Something like a new file called src/webgpu/api/operation/buffers/createBindGroup.ts?

@Kangz
Copy link
Collaborator

Kangz commented Jun 2, 2025

Sure that would work.

@beaufortfrancois
Copy link
Collaborator Author

@Kangz Done

@beaufortfrancois
Copy link
Collaborator Author

@greggman I'd like to roll gpuweb/types#182 into the CTS but I'd like to avoid defining texture formats for texture-formats-tier1. Do you know if there's a way to override GPUTextureFormats type to say "exclude r16unorm, etc" for now?

@greggman
Copy link
Contributor

greggman commented Jun 2, 2025

@greggman I'd like to roll gpuweb/types#182 into the CTS but I'd like to avoid defining texture formats for texture-formats-tier1. Do you know if there's a way to override GPUTextureFormats type to say "exclude r16unorm, etc" for now?

That doesn't appear to be possible and it's not entirely clear we want to make it possible. There are compile time checks that all the GPUTextureFormat formats have corresponding data. We'd have to removing those checks to make it possible.

I'll try to put up a PR that rolls the types and adds what's needed to keep running.

@greggman
Copy link
Contributor

greggman commented Jun 3, 2025

pr to roll types #4400

@beaufortfrancois
Copy link
Collaborator Author

pr to roll types #4400

Thank you very much @greggman!

@beaufortfrancois beaufortfrancois merged commit 566aba1 into main Jun 3, 2025
1 check passed
@beaufortfrancois beaufortfrancois deleted the buffer-binding-resource branch June 3, 2025 07:03
ErichDonGubler added a commit to erichdongubler-mozilla/firefox that referenced this pull request Jul 17, 2025
…` r=#webgpu-reviewers!

This change to upstream IDL happened at [gpuweb#5193](gpuweb/gpuweb#5193).  Test coverage was added in [gpuweb/cts#4390](gpuweb/cts#4390).

Differential Revision: https://phabricator.services.mozilla.com/D257634
lando-prod-mozilla bot pushed a commit to mozilla-firefox/firefox that referenced this pull request Jul 17, 2025
…` r=webgpu-reviewers,webidl,teoxoy,emilio

This change to upstream IDL happened at [gpuweb#5193](gpuweb/gpuweb#5193).  Test coverage was added in [gpuweb/cts#4390](gpuweb/cts#4390).

Differential Revision: https://phabricator.services.mozilla.com/D257634
i3roly pushed a commit to i3roly/firefox-dynasty that referenced this pull request Jul 21, 2025
…` r=webgpu-reviewers,webidl,teoxoy,emilio

This change to upstream IDL happened at [gpuweb#5193](gpuweb/gpuweb#5193).  Test coverage was added in [gpuweb/cts#4390](gpuweb/cts#4390).

Differential Revision: https://phabricator.services.mozilla.com/D257634
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.

4 participants