-
Notifications
You must be signed in to change notification settings - Fork 86
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
wgsl: Add validation test for min/max builtin functions #3497
Conversation
5b78b31
to
4cb51aa
Compare
4cb51aa
to
5a1465e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this were 3 days I ago I would have said "perfect!".
But @ben-clayton had feedback for me for how to improve this kind of test.
See updated #3496 for his feedback and how I adapted.
- combine kBadArgs and kGoodArgs into one dictionary kArgCases, where there is one good case named 'good'
- the 'bad_args' test becomes 'args'
- I also modified the must_use case to have both good and bad cases, parameterizing it on 'use' over false and true.
I don't think that's needed. As long as there's at least one bad case for each argument position, that's ok. No way we want to do the entire power set.
I like keeping the two separate. Makes it really easy to spot all (actually most) of the functionality for a given builtin. E.g. just today @jrprice told me there was already centralized must-use testing for a bunch of builtins. But when I added the dp4a validation I didn't know about it. We decided to move all must-use testing for builtins into per-builtin tests, like we have here. #3502 |
src/webgpu/shader/validation/expression/call/builtin/max.spec.ts
Outdated
Show resolved
Hide resolved
5a1465e
to
7e9fdbb
Compare
Thanks for the feedback! Updated both tests to match the newer patterns you pointed out. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
7e9fdbb
to
c16b531
Compare
0b2a499
to
84e584b
Compare
52cadd8
to
fee7357
Compare
Add validation test for min/max builtin functions
Starting off with a simple set of test to make sure I'm doing it right. :) Biggest question for me is for the bad args tests, should we be testing things like "both args are the same type and both are bad?"
Also, these two files differ by 2 chars. Feels like that should be combined, but I'm not sure what sort of patterns we have in place for doing so, or if it's actually desirable.
Requirements for PR author:
.unimplemented()
./** documented */
and new helper files are found inhelper_index.txt
.Requirements for reviewer sign-off:
When landing this PR, be sure to make any necessary issue status updates.