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

Adds validation tests for count* builtin functions. #3498

Merged
merged 10 commits into from
Apr 3, 2024

Conversation

lokokung
Copy link
Contributor

Piggy-backing off of Brandon's PR at , also implementing something a bit simpler to test the waters. As Brandon points out in his PR for min/max, some tests (these included) are VERY similar, to a point where pretty much the only difference is the first line of the test files, so I'm also wondering whether this is fine or whether there's precedence for what to do.

More specific to this suite of tests though, the WGSL spec for these count* builtins does not explicitly state that AbstractInts are a part of the parameterization, but during my testing, I noticed that passing an AbstractInt does not fail compilation because of how overload resolution handles it. As a result, I decided to not have a specific test checking that AbstractInt works or fails. Feel free to let me know if that's not what we want.


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.

@lokokung lokokung requested a review from dneto0 March 13, 2024 23:48
Copy link
Contributor

@dneto0 dneto0 left a comment

Choose a reason for hiding this comment

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

My advice: you don't have to test the good cases such as AbstractInt because that should already be covered by the execution cases.

regarding apparent duplication / DRY, we discussed and decided the duplication is useful because it makes it trivial to see and verify coverage for each given builtin.

@lokokung lokokung requested a review from dneto0 March 25, 2024 22:08
@lokokung
Copy link
Contributor Author

lokokung commented Apr 2, 2024

Updated the tests according to comments in #3565. PTAL! (Also adding Dan as a reviewer since a lot of those comments were from him.)

@lokokung lokokung requested a review from dj2 April 2, 2024 21:27
@lokokung lokokung enabled auto-merge (squash) April 3, 2024 20:21
Copy link
Contributor

@dneto0 dneto0 left a comment

Choose a reason for hiding this comment

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

Thanks! Sorry for the delay

@lokokung lokokung merged commit a2b7c58 into gpuweb:main Apr 3, 2024
1 check passed
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