Skip to content

Additional test cases for encoder states #4401

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

andyleiserson
Copy link
Contributor

@andyleiserson andyleiserson commented Jun 3, 2025

Additional tests related to encoder states.

  • In the encoder_open_state tests, add the case of attempting to record commands onto a finished pass while the encoder is still open. Previously, the test only covered the case where both the pass and the encoder are finished.
  • In the call_after_successful_finish test, add the case where the call made after the successful finish is another call to finish. This is motivated by a bug in Firefox.
  • Test that it is possible to open passes on an invalid encoder.

The following tests are failing:

  • In Chrome, the encoder_open_state tests for both render and compute passes. I noted this issue in Error reporting for unbalanced compute/render passes does not match implementations gpuweb#5207 (comment). The issue description is a more convoluted case that is covered by an existing test, but this case is pretty much the same issue so I noted it in a comment. I also added a TODO on the other, existing test.
  • In Safari, the encoder_open_state:render_pass_commands tests for the debug commands. Unlike the rest of the render pass commands, these cases were previously encoding the command onto the parent encoder rather than the render pass. This seemed unintentional, so I changed it, but maybe there's a special case here I'm not aware of.

I am not sure how to turn on "compatibility mode validation". I did try the tests in compatibility mode, if that's all this is.


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.)
  • Test have be tested with compatibility mode validation enabled and behave as expected. (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.

@andyleiserson andyleiserson marked this pull request as ready for review June 26, 2025 00:51
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.

1 participant