Repository navigation
Add test for out-of-bounds subgroupShuffle - #4726
Conversation
alan-baker
left a comment
There was a problem hiding this comment.
WGSL says:
An indeterminate value is returned if id does not select an active invocation.
So it feels too strong to require the result to be from within the subgroup. It would be valid for an implementation to pick an arbitrary value and return that (e.g. 0 or all ones). The best I could imagine would be:
- Setup 3 three buffers
- First and last have some random sentinel value
- Middle is filled with predictable values like your iterating 0xDEAD values
- Every invocation reads from the middle buffer (some consecutive range maybe offset from start)
- Test that no return is a outside is a value (in any buffer) outside the range read in the middle buffer
- Since all the values are unlikely to picked by an implementation this likely works (and allows things like 0)
Thoughts? You may also want variants of this test where you filter some invocations via an if statement and test the value from inactive invocations.
|
I like that approach, tried a version of it in the next patch. I'll consider inactive invocations in a follow up and keep this one narrow to address coverage for potentially security impacting OOB reads (context is: https://crbug.com/549237171). I'm not sure if it's what you meant, but my reading of the spec is that if the inactive lane within the subgroup did return some stale old data, that would be within spec. |
Add a compute test to verify that providing an OOB land ID safely clamps or wraps the read to within the workgroup.
051b58a to
81aa9a3
Compare
Add a compute test to verify that providing an OOB land ID safely clamps or wraps the read to within the workgroup.
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.