-
Notifications
You must be signed in to change notification settings - Fork 344
Description
Device loss can cause async pipeline creation to succeed (vacuously) when it would normally have failed. The spec should require a reasonable ordering of device loss and async pipeline promises in this case.
Currently the "Promise Ordering" section says:
WebGPU does not make any guarantees about the order in which these promises settle (resolve or reject), except for the following:
- For some GPUQueue q, if p1 = q.onSubmittedWorkDone() is called before p2 = q.onSubmittedWorkDone(), then p1 must settle before p2.
- For some GPUQueue q and GPUBuffer b on the same GPUDevice, if p1 = b.mapAsync() is called before p2 = q.onSubmittedWorkDone(), then p1 must settle before p2.
Applications must not rely on any other promise settlement ordering.
However the list is not complete because in cases where the device becomes lost, GPUDevice.lost is always guaranteed to settle before any other promise. This is easily observable if device.destroy() is called before any of the other methods that return a promise.
Some relevant CTS tests:
https://gpuweb.github.io/cts/standalone/?q=webgpu:api,validation,state,device_lost,destroy:createComputePipelineAsync:*
https://gpuweb.github.io/cts/standalone/?q=webgpu:api,validation,state,device_lost,destroy:createRenderPipelineAsync:*