-
Notifications
You must be signed in to change notification settings - Fork 933
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
Should we unwind the pledge to "lose the device" on device drop? #5049
Comments
I don't remember off the top of my head what the current state of the world is, but I don't think this is our decision to make- this is either a webgpu problem or a webgpu.h problem. I believe the ladder currently expects that the device lost call back is called on drop. |
At the I still think that at least the low level APIs should guarantee that the callback is called (with an appropriate status code), so that the memory management of the C callback and what it holds on to remains sane. |
Alright, we'll keep wgpu behavior as-is ("lose the device" on device drop) and it will be up to user agents on how to handle that. Since drop may happen during Garbage Collection and/or Cycle Collection in some embeddings, it's up to the user agent on whether or how to expose the device lost promise in such a situation. If there's a desire to add a new enum |
Discussed in #5048
Originally posted by bradwerth January 11, 2024
I've become convinced that the motivating case for the drop-must-lose-device is not strong enough to overcome the severe weirdness this could introduce. Behold!
In such a case, either the device is never dropped and therefore the code hangs (confusing for the developer), or the device is dropped and the promise brings it temporarily back to life (crazy hard for the embedder to implement correctly). I don't think this is going anywhere good and the initial claim that we need this behavior just to support memory management for C-based user agents is not a strong enough motivator. I'm strongly tempted to unwind the changes made in #4862 and abandon the cleanup in #5032. Any objections?
The text was updated successfully, but these errors were encountered: