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

Rejection on createComputePipelineAsnyc causes timout in tests #3809

Closed
sagudev opened this issue Jun 23, 2024 · 5 comments
Closed

Rejection on createComputePipelineAsnyc causes timout in tests #3809

sagudev opened this issue Jun 23, 2024 · 5 comments

Comments

@sagudev
Copy link
Collaborator

sagudev commented Jun 23, 2024

this happens because rejection is not handled. Example:

const pipeline = await t.device.createComputePipelineAsync({

(there are more such places).

You can see live example here: https://sagudev.github.io/cts/standalone/?runnow=1&q=webgpu:shader,execution,expression,binary,f32_subtraction:scalar_vector:inputSource=%22const%22;* which has rejection hard-coded sagudev@615b943 (reproducible on Edge).

This is problem in servo because some things are not supported yet (so promise does reject).

@sagudev
Copy link
Collaborator Author

sagudev commented Jun 23, 2024

related #3157

@kainino0x
Copy link
Collaborator

Thanks for the report, definitely something going wrong here.

Because the promise is created before it's awaited, this is causing an unhandledrejection (see #3159). I don't know why that results in a hang, though - the intent was that it would eventually reach the await Promise.all(pendingBatches) line and the test should fail.

@sagudev
Copy link
Collaborator Author

sagudev commented Jun 28, 2024

It looks like that we never reach await Promise.all(pendingBatches) on rejection, because if (batchesInFlight > maxBatchesInFlight) { happens. I think the main reason hang happens is because void t.queue.onSubmittedWorkDone().finally(batchFinishedCallback); is never called when const checkBatch = await submitBatch(t, shaderBuilder, shaderBuilderParams, pipelineCache); rejects.

@sagudev
Copy link
Collaborator Author

sagudev commented Jul 7, 2024

So the timeout was caused by never resolving

resolvePromiseBlockingBatch = resolve;
as batchFinishedCallback was never called, due to rejection on
const checkBatch = await submitBatch(t, shaderBuilder, shaderBuilderParams, pipelineCache);
the solution is to move the callback to
pendingBatches.push(processBatch(batchCases));
(and it also belongs there conceptually, as it only deals with decreasing batchesInFlight); see #3844.

@sagudev
Copy link
Collaborator Author

sagudev commented Jul 17, 2024

Fixed in #3844.

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

No branches or pull requests

2 participants