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 countLeadingZeros
tests
#1001
Conversation
Previews, as seen when this build job started (72e2a97): |
72e2a97
to
6c1be57
Compare
Previews, as seen when this build job started (6c1be57): |
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.
So the actual tests look good to me, there is just some process side issues.
This builtin doesn't exist for the specURL, since it is a older revision. I have commented an updated stanza that links to a version of the spec that contains the builtin.
The larger issue I noticed is that currently the spec specifies the u32
and i32
cases in the same rule, which means there is only one .uniqueID(71610deeeb6a9fd3)
for both tests. Other builtins, like clamp
have seperate u32
and i32
cases in the spec, thus separate uniqueIDs
. I am honestly not sure how much of a mechanical problem this is, i.e. if it is going to cause some tooling to break, but I suspect this is something that someone will have to cleanup in the future if we just used it twice, since it is supposed to unique.
That being said, I can think of two immediate solutions, a high road a low road one.
High road:
Update the spec to have separate u32
and i32
rules, so there are two unique IDs. I would probably update the other rules you are writing test for also in one PR, so they all have separate IDs.
Low Road:
Merge the two test in the CTS into one uber test that does both. This strikes me a potentially fraught though, since the framework distinguishes between u32
and i32
inputs, so we would need some sort of cludge to allow both, which doesn't seem like a desired feature.
Also there isn't a tracking bug filed for this and the other tests you are adding. I needed to update the specURL in my local checkout of get-test-plan to generate the rules so I could grab the unique IDs, etc. I can file the issues if you want, once we figure out the uniqueID situation.
|
||
g.test('integer_builtin_functions,countLeadingZeros_unsigned') | ||
.uniqueId('xxxxxxxxxxxxxxxx') | ||
.specURL('https://www.w3.org/TR/2021/WD-WGSL-20210929/#integer-builtin-functions') |
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.
.specURL(https://www.w3.org/TR/2022/WD-WGSL-20220223/#integer-builtin-functions), since this doesn't exist in the older spec
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.
Note: this matches the URL of all the other test plans, which will also need bulk updating.
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.
Example:
.specURL('https://www.w3.org/TR/2021/WD-WGSL-20210929/#integer-builtin-functions') |
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.
I don't feel particularly strongly about this, since as you pointed out it matches the existing tests and likely needs a bulk update across the code base.
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.
Let's land these then, and I'll do a bulk update of all of these in a single atomic commit.
|
||
g.test('integer_builtin_functions,countLeadingZeros_signed') | ||
.uniqueId('xxxxxxxxxxxxxxxx') | ||
.specURL('https://www.w3.org/TR/2021/WD-WGSL-20210929/#integer-builtin-functions') |
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.
Looking at the spec again, it looks like all of the older integer builtins have distinct |
Talked with Ben about this out of band, and I think it is fine to leave this PR as-is other than the invalid URL, which I commented on. We will need to resolve some of the tooling and style questions in the future, but nothing automated is going to break, so it isn't worth slowing down getting tests right now. |
Issue: #
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.