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

Error scopes should be handled in device timeline (wgpu thread) #32297

Open
sagudev opened this issue May 15, 2024 · 2 comments
Open

Error scopes should be handled in device timeline (wgpu thread) #32297

sagudev opened this issue May 15, 2024 · 2 comments
Labels
A-content/webgpu The WebGPU implementation.

Comments

@sagudev
Copy link
Member

sagudev commented May 15, 2024

Currently they are handled in script thread, which causes problems on some tests now that we have parallel poller. In tests webgpu:shader,execution,expression,constructor,* we get very flaky results (sometimes passing test, although we shouldn't), because in attemptEndTestScope when popping validation error scope, promise does not get resolved to error (we have yet to handle validation error in handle_msg_from_webgpu_server).

SPEC: https://www.w3.org/TR/webgpu/#dom-gpudevice-poperrorscope

@sagudev sagudev added the A-content/webgpu The WebGPU implementation. label May 15, 2024
@sagudev
Copy link
Member Author

sagudev commented May 15, 2024

Given that all gpu errors are sent to script thread, we could just send poperrorscope to script thread to so it gets picked up from handle_msg_from_webgpu_server after all validation errors that needed to be in that scope are handled, but then we would be sending to same thread (I think) and we do not want that.

So if we move most error scopes handling to wgpu thread, we use ordering of messages to ensure error scopes contain all their messages. I think this way we can also reduce amount of messages send back to script thread (although https://www.w3.org/TR/webgpu/#gpuuncapturederrorevent still exists). This would also align us with specs.

Unresolved questions:

  • callbacks returning gpu errors?
  • validation errors from script thread (we can always just add new msg for it, but are they even needed as all validation should (but currently does not) happen in wgpu-core)

@sagudev
Copy link
Member Author

sagudev commented May 19, 2024

validation errors from script thread (we can always just add new msg for it, but are they even needed as all validation should (but currently does not) happen in wgpu-core)

Validation errors should indeed be raised from wgpu-core, but JS errors (Operation, TypeError) are actually in our domain, so not all validation can be moved to wgpu-core ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-content/webgpu The WebGPU implementation.
Projects
Status: To do
Development

No branches or pull requests

1 participant