github web-platform-tests/wpt merge_pr_47046

latest releases: merge_pr_49470, epochs/three_hourly/2024-12-03_06H, epochs/six_hourly/2024-12-03_06H...
14 months ago

Reland "WebNN: Handle WebNN context lost error"

This is a reland of commit a240af8bb2c11c08a6649388afdd4896818bf336

Included needed fix:

  1. Move calling ID3D12Device::GetDeviceRemovedReason before
    calling WebNNContextImpl::OnLost which will release the context to
    avoid UAF for Adapter. Because the Adapter is referenced by
    contexts, it will be released when all contexts are released.
  2. Remove two invalid cases for MLContext::writeBuffer which will
    call ID3D12Device::CreateCommittedResource on DirectML with size 0
    to avoid crash.

Original change's description:

WebNN: Handle WebNN context lost error

This CL is to handle the WebNN context lost error and has implemented
for DirectML backend.

  1. Defined MLContextLostInfo dictionary in the WebIDL to expose the
    context lost information.
  2. Defined Promise<MLContextLostInfo> lost of MLContext interface
    in the WebIDL, when the lost error is captured, the promise will be
    resolved with the MLContextLostInfo.
  3. Defined WebNNContextClient mojom interface and it's method
    OnLost(string message) to send the context lost message to
    the renderer process when the MLContext object lost error in the
    GPU process is captured. The renderer process will override this
    method to handle the lost error.
  4. Implemented the context lost handling feature in DirectML backend.

Bug: 40281640, 41492165
Change-Id: I16775ac8cdbd508e04025c22740d13f01e591b0d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5602134
Reviewed-by: Reilly Grant reillyg@chromium.org
Reviewed-by: ningxin hu ningxin.hu@intel.com
Reviewed-by: Rafael Cintron rafael.cintron@microsoft.com
Commit-Queue: Mingming1 Xu mingming1.xu@intel.com
Cr-Commit-Position: refs/heads/main@{#1322573}

Bug: 40281640, 41492165
Change-Id: I3eaeb413c3c10e72416ab2932e182be3a01b99e0
Cq-Include-Trybots: luci.chromium.try:win11-blink-rel
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5673825
Reviewed-by: Alex Gough ajgo@chromium.org
Reviewed-by: ningxin hu ningxin.hu@intel.com
Reviewed-by: Reilly Grant reillyg@chromium.org
Commit-Queue: Mingming1 Xu mingming1.xu@intel.com
Cr-Commit-Position: refs/heads/main@{#1324640}

Don't miss a new wpt release

NewReleases is sending notifications on new releases.