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 test about creating pipeline layout with null bind group layout #4076

Merged
merged 7 commits into from
Dec 18, 2024

Conversation

Jiawei-Shao
Copy link
Collaborator

Issue: #4075


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.

@Jiawei-Shao
Copy link
Collaborator Author

Hi @jzm-intel and @kainino0x ,

With latest webgpu/types I cannot test undefined as a member of GPUPipelineLayoutDescriptor.bindGroupLayouts so I only test null in this PR. I've raised this issue as gpuweb/types#162.

PTAL, thanks!

Copy link
Collaborator

@kainino0x kainino0x left a comment

Choose a reason for hiding this comment

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

Optional nits but feel free to land with or without!

src/webgpu/api/validation/createPipelineLayout.spec.ts Outdated Show resolved Hide resolved
src/webgpu/api/validation/createPipelineLayout.spec.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@jiangzhaoming jiangzhaoming left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks!

@Jiawei-Shao Jiawei-Shao merged commit 7eedd5a into gpuweb:main Dec 18, 2024
1 check passed
@@ -162,3 +163,96 @@ g.test('bind_group_layouts,device_mismatch')
t.device.createPipelineLayout({ bindGroupLayouts: [layout0, layout1] });
}, mismatched);
});

const MaybeNullBindGroupLayoutTypes = ['Null', 'Undefined', 'Empty', 'NonEmpty'] 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.

Combinatorially adding undefined increases the subcase count from 90 to 310, but I think that's a bit too many. This test is not that slow, but our combinatorial explosions in the CTS overall are quite out of hand so I'd like to be more cautious when we're adding new tests.

The null vs undefined thing is a trivial WebIDL check and we really just need one tiny test that makes sure null and undefined behave the same way.

That's a bit of extra work though. Would we get complete coverage by testing only the cases that have exactly one Null/Undefined/Empty? This reduces the whole thing to just 30 subcases without having to write another test.

See #4107

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