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

Handle async pipeline creation errors more gracefully #3158

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

toji
Copy link
Member

@toji toji commented Nov 10, 2023

These tests used to be producing validation errors which could be caught by the normal test harness, but after my changes in #3125 they're rejecting and throwing uncaught exceptions instead. This adds some try-catches around them and does an explicit t.fail() if a GPUPipelineError is thrown.

Not landing just yet, because I haven't been able to repro original issue yet so this is just speculative. Should be easier to test early next week according to conversation in the linked issue.

Issue: #3157


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.

@ben-clayton
Copy link
Contributor

Hey @toji - is this PR ready for review? It's marked draft, but has 3 reviewers assigned.
Thanks!

@kainino0x
Copy link
Collaborator

@ben-clayton I'm seeing no reviews requested, just 3 suggestions made by GitHub.

@ben-clayton
Copy link
Contributor

Right you are. Completely unable to parse the GitHub UI

@toji toji marked this pull request as ready for review December 12, 2023 19:00
@toji toji requested a review from kainino0x December 12, 2023 22:52
@toji
Copy link
Member Author

toji commented Dec 12, 2023

I think it's worthwhile to land this. Kai, could you PTAL?

} else {
throw err;
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing fundamentally wrong with this change, but it is supposed to be totally fine to throw an exception from a test function (which awaiting a promise that rejects will do). I also don't want to cargo-cult this every place we use create*PipelineAsync if it's not necessary.

// build the shader module
const module = t.device.createShaderModule({ code: source });

// build the pipeline
return t.device.createComputePipeline({
return t.device.createComputePipelineAsync({
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just an unrelated extra switch to async, right?

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.

None yet

3 participants