Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add validation tests for Multi-Draw Indirect #3962

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

beaufortfrancois
Copy link
Collaborator

This PR adds validation tests for the experimental Multi-Draw Indirect feature that can be tested in Chrome Canary behind the "Unsafe WebGPU support" flag at chrome://flag#enable-unsafe-webgpu

Issue: #3961

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.)
  • 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.

Copy link

@Sirtsu55 Sirtsu55 left a comment

Choose a reason for hiding this comment

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

Apart from the stylistic nitpick, LGTM.

u.expandWithParams(() => {
return [
// In bounds
{ bufferSize: 4, indirectOffset: 0, _valid: true },

Choose a reason for hiding this comment

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

nit: Could we combine these test cases with the ones below as a variable? If I didn't miss anything these cases seem similar with small differences, and combining them would be cleaner/more readable.

Copy link
Collaborator

Choose a reason for hiding this comment

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

+1, if possible store this array as a variable and use it twice. A pattern we use elsewhere to make this work is instead of having bufferSize as a parameter, have something like bufferExtraSize which has negative, zero, and positive cases (4 + (-1) = 3 for indirect, 5 + (-1) = 4 for indexed indirect)

And if there are any cases that are specific to one or the other then you can do:

const kIndirectOffsetOOBCommonCases = [
  /* ... */
] as const;

/* ... */
  .combineWithParams([
    ...kIndirectOffsetOOBCommonCases,
    /* any additional cases which are not common between the two */
  ])

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've hopefully addressed your feedback in latest patch. Please have a look!

@Sirtsu55
Copy link

Sirtsu55 commented Oct 28, 2024

FYI @beaufortfrancois , I'm working on #3970 to add more rendering tests. Should we incrementally add rendering tests to this branch or should submit all of the rendering tests at once?

@beaufortfrancois
Copy link
Collaborator Author

FYI @beaufortfrancois , I'm working on #3962 to add more rendering tests. Should we incrementally add rendering tests to this branch or should submit all of the rendering tests at once?

I'll let @kainino0x weigh in as I don't have strong preferences.

u.expandWithParams(() => {
return [
// In bounds
{ bufferSize: 4, indirectOffset: 0, _valid: true },
Copy link
Collaborator

Choose a reason for hiding this comment

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

+1, if possible store this array as a variable and use it twice. A pattern we use elsewhere to make this work is instead of having bufferSize as a parameter, have something like bufferExtraSize which has negative, zero, and positive cases (4 + (-1) = 3 for indirect, 5 + (-1) = 4 for indexed indirect)

And if there are any cases that are specific to one or the other then you can do:

const kIndirectOffsetOOBCommonCases = [
  /* ... */
] as const;

/* ... */
  .combineWithParams([
    ...kIndirectOffsetOOBCommonCases,
    /* any additional cases which are not common between the two */
  ])

@kainino0x
Copy link
Collaborator

kainino0x commented Nov 4, 2024

FYI @beaufortfrancois , I'm working on #3962 to add more rendering tests. Should we incrementally add rendering tests to this branch or should submit all of the rendering tests at once?

I'll let @kainino0x weigh in as I don't have strong preferences.

IMO land tests as soon as they're landable. It's easy enough to modify tests after they land.

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