Open Bug 1848857 (webgpu-commenc-valid-time) Opened 2 years ago Updated 11 months ago

`GPUCommandEncoder` commands generate validation error on call, instead of deferring to `GPUCommandEncoder.finish`

Categories

(Core :: Graphics: WebGPU, defect, P2)

defect

Tracking

()

People

(Reporter: ErichDonGubler, Unassigned)

References

(Depends on 1 open bug, Blocks 2 open bugs)

Details

According to the current draft of WebGPU v1 spec., Firefox's implementation generates validation errors at the wrong time for GPUCommandEncoder commands:

Currently, Firefox implementation emits validation errors when a command that invalidates the command encoder is issued. However, the current v1 spec. draft states that an invalid command should only invalidate the command buffer. In the draft, the following language is used for validation checks with each command:

If any of the following conditions are unsatisfied, make this invalid and stop. …

GPUCommandEncoder.finish()'s entry in the spec. states that validation error should only be generated once is called:

Device timeline finish steps:

  1. Let validationSucceeded be true if all of the following requirements are met, and false otherwise.

    • this must be valid.
  2. If validationSucceeded is false, then:

    1. Generate a validation error.

    2. Return a new invalid GPUCommandBuffer.

Steps to reproduce

  1. Apply (maybe WIP) patch(es) currently attached to bug 1848866.

  2. With a fully built checkout of Firefox Nightly, run the following test command:

    ./mach wpt '/_mozilla/webgpu/chunked/16/cts.https.html?q=webgpu:api,validation,encoding,cmds,copyTextureToTexture:copy_ranges:*'
    
Severity: -- → S3
Priority: -- → P2

:jgilbert has noted that this may not actually be desirable spec. behavior, and is lobbying to change it to specify an eager generation of a GPUValidationError (our current behavior) and invalidating the command encoder, instead of only invalidating: https://github.com/gpuweb/gpuweb/issues/4269

See Also: → 1848866
Depends on: 1848866

Assigning to :jgilbert for now, since she'll be bringing this up the W3C spec. meeting tomorrow.

Assignee: nobody → jgilbert
Status: NEW → ASSIGNED

Decision from today's WebGPU team sync: We'll be using this issue to become spec-compliant, regardless of the outcome of gpuweb#4269. If and when a change to the spec. happens because of our advocacy for a better API, we will create a separate follow-up issue for it.

Un-assigning from :jgilbert, since we have decoupled the original reason for assigning this bug to her from blocking this issue.

Assignee: jgilbert → nobody
Status: ASSIGNED → NEW
Summary: `GPUCommandEncoder` commands generate validation error on call, instead of deferring to `GPUCommandEncoder.finish` per WebGPU v1 spec. → `GPUCommandEncoder` commands generate validation error on call, instead of deferring to `GPUCommandEncoder.finish`
You need to log in before you can comment on or make changes to this bug.