Skip to content

Add validation test about creating pipeline layout with null bind group layout#4076

Merged
Jiawei-Shao merged 7 commits intogpuweb:mainfrom
Jiawei-Shao:test-create-pl-null-bgl
Dec 18, 2024
Merged

Add validation test about creating pipeline layout with null bind group layout#4076
Jiawei-Shao merged 7 commits intogpuweb:mainfrom
Jiawei-Shao:test-create-pl-null-bgl

Conversation

@Jiawei-Shao
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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!

Comment thread src/webgpu/api/validation/createPipelineLayout.spec.ts Outdated
Comment thread src/webgpu/api/validation/createPipelineLayout.spec.ts Outdated
Copy link
Copy Markdown
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!

}, mismatched);
});

const MaybeNullBindGroupLayoutTypes = ['Null', 'Undefined', 'Empty', 'NonEmpty'] as const;
Copy link
Copy Markdown
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