Skip to content

Rejection on createComputePipelineAsnyc causes timout in tests #3809

Closed

Description

@sagudev

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).

Activity

  1. sagudev commented on Jun 23, 2024

    @sagudev
    CollaboratorAuthor

    related #3157

  2. kainino0x commented on Jun 24, 2024

    @kainino0x
    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.

  3. sagudev commented on Jun 28, 2024

    @sagudev
    CollaboratorAuthor

    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.

  4. sagudev commented on Jul 7, 2024

    @sagudev
    CollaboratorAuthor

    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.

  5. sagudev commented on Jul 17, 2024

    @sagudev
    CollaboratorAuthor

    Fixed in #3844.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions