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

Fix a bad slice operation in image_copy stencil tests #3083

Merged
merged 2 commits into from
Oct 23, 2023
Merged

Conversation

toji
Copy link
Member

@toji toji commented Oct 23, 2023

Found that in the checkStencilTextureContent() method of the image_copy tests an ArrayBuffer.slice() is being used that was passing arguments as if they were (offset, length), when in fact they must be (start, end). This was causing any tests with a buffer offset other than 0 to pass even where there was an error because the arrays that were being compared were zero length.

After correcting this issue I also found that a separate buffer offset needed to be passed to the expectGPUBufferValuesEqual() method to account for the offset of the row being tested. This was preventing anything other than the first row from being compared properly, though that didn't cause an error due to the aforementioned slice() issue.

Once these two fixes are in place the test can now properly check all subcases. Confirmed passing on Chrome.


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.)

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.

@toji toji requested review from kainino0x and austinEng October 23, 2023 22:38
@toji
Copy link
Member Author

toji commented Oct 23, 2023

Oh, and for what it's worth I did a quick scan of other instances of slice() in the CTS codebase. None of the other uses appear to have this same argument mixup. (It's mostly called without arguments to clone the array)

@toji toji enabled auto-merge (rebase) October 23, 2023 22:51
@toji toji merged commit 3fe36f2 into main Oct 23, 2023
2 checks passed
@toji toji deleted the stencil-test-fix branch October 23, 2023 22:59
@github-actions
Copy link

Previews, as seen when this build job started (974437a):
Run tests | View tsdoc

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.

2 participants