-
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
Test errors for out-of-range limit requests #3132
Conversation
? 'TypeError' | ||
: limitInfo.class === 'maximum' && value > adapter.limits[limit] | ||
? 'OperationError' | ||
: limitInfo.class === 'alignment' && (value > 2 ** 31 || !isPowerOfTwo(value)) |
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.
The spec does not actually currently say that 2**32
or 2**53
is an error for alignment limits. I'm proposing it to the spec:
gpuweb/gpuweb#4358
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 am confused. The limits tests already test trying to go over the max limit and they all pass.
const shouldReject = kMinimumLimits.has(limit) |
What is the bug this is trying to surface that wasn't already tested?
Can you just add a case there instead of making a new test?
We mishandle values ≥ 2^32 for 32-bit limit types, by
I may have missed the appropriate test to modify, but I only saw tests that used |
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.
ok, lgtm 🤷♂️
If you wanted to give it a try you could add a new limit here
export const kMaximumTestValues = ['atLimit', 'overLimit'] as const; |
atLimit, overLimit, overStorageSize
but I this fine too I guess. It tests more values.
Ack, I think I'll keep this since it can easily test a lot of values. It also does fit in with the tests next to it (even if we have some redundancy between this, those, and the limit_utils based tests). |
This could have been a 1-character fix, but I preferred to use CheckedNumeric, and also wanted to update the error message. Note this doesn't quite match the WebGPU spec - the spec technically says to allow alignments to be set to powers of 2 >= 2**32, but this disallows anything higher than 2**31. I'm going to propose to the spec to tighten this for simplicity of implementation. Test: gpuweb/cts#3132 Fixed: 1499030 Change-Id: Id2c6e56fcbc326c445b28219b724f6ae325077ed Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5002999 Auto-Submit: Kai Ninomiya <[email protected]> Reviewed-by: Brandon Jones <[email protected]> Commit-Queue: Kai Ninomiya <[email protected]> Cr-Commit-Position: refs/heads/main@{#1219757}
See https://crbug.com/1499030
Issue: None
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.