Closed Bug 1842020 Opened 1 year ago Closed 1 year ago

OOM on `GPUDevice.createBuffer` should throw a `RangeError`, not an `AbortError`

Categories

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

defect

Tracking

()

RESOLVED FIXED
117 Branch
Tracking Status
firefox117 --- fixed

People

(Reporter: ErichDonGubler, Assigned: ErichDonGubler)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

In cases where we actually try to allocate a Shmem instance from a user-provided buffer size, we currently throw an AbortError instead of a RangeError. The WebGPU spec. states the definition of GPUBuffer that we should use a RangeError in all OOM cases:

Let data be ? CreateByteDataBlock(size).

Note: This may result in a RangeError being thrown. For consistency and predictability: …

Step to reproduce

  1. Create a 64-bit (but not 32-bit) build of Firefox based on changes from bug 1838694 or later.

  2. Run ./mach wpt '/_mozilla/webgpu/chunked/1/cts.https.html?q=webgpu:api,operation,buffers,map_oom:mappedAtCreation:*'. Observe that oom=true test cases fail with an error like as follows:

    EXPECTATION FAILED: subcase: usage=1
    THREW AbortError, instead of RangeError: AbortError: GPUDevice.createBuffer: Unable to allocate shmem of size 9007199254740984
    shouldThrow@https://gpuweb.github.io/cts/out/common/framework/fixture.js:266:50
    @https://gpuweb.github.io/cts/out/webgpu/api/operation/buffers/map_oom.spec.js:42:7
    

    Alternatively, one can currently use https://gpuweb.github.io/cts/standalone/?q=webgpu:api,operation,buffers,map_oom:mappedAtCreation:oom=true;* to reproduce.

Pushed by egubler@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f27563eb1417 fix(webgpu): s/AbortError/RangeError on OOM in `GPUDevice.createBuffer` r=webgpu-reviewers,nical
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 117 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: