Closed Bug 1912155 Opened 3 months ago Closed 3 months ago

[wpt-sync] Sync PR 47520 - WebNN: Define `MLContext::destroy` interface

Categories

(Testing :: web-platform-tests, task, P4)

task

Tracking

(firefox131 fixed)

RESOLVED FIXED
131 Branch
Tracking Status
firefox131 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 47520 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/47520
Details from upstream follow.

mingmingtasd <mingming1.xu@intel.com> wrote:

WebNN: Define MLContext::destroy interface

This CL defines MLContext::destroy interface on blink side. It's
to destroy the MLContext explicitly to let it be lost.

MLContext retains weak references to all of the MLBuffer,
MLGraph and MLGraphBuilder instances, their Mojo pipes will be
disconnected and their pending promises will be rejected at the
same time as the MLContext is destroyed. Any calls rely on the
MLContext are not allowed and will throw errors.

This CL sets disconnection handler for MLGraphBuilder to reject
pending promise of creating MLGraph.

This CL removes the unnecessary MLContext::CreateWebNNBuffer
method, refactors MLBuffer::ReadBufferImpl method to create
the resolver inside and return the promise, refactors
MLContext::CreateWebNNGraphBuilder to record the created
MLGraphBuilder into MLContext and return it.

Bug: 348904836, 354025380
Change-Id: Ia660fe2f109a089187237da9d6a0285247f19eb9
Cq-Include-Trybots: luci.chromium.try:win11-blink-rel
Reviewed-on: https://chromium-review.googlesource.com/5737474
WPT-Export-Revision: 4d8ddd6e8c3d798138866506a1e28cda16fb20e9

CI Results

Ran 9 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 2 tests and 12 subtests

Status Summary

Firefox

OK : 2
FAIL: 24

Chrome

OK : 2
FAIL: 24

Safari

OK : 2
FAIL: 24

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

  • /webnn/validation_tests/destroyContext.https.any.html [wpt.fyi]: OK [GitHub], SKIP [Gecko-android-em-7.0-x86_64-lite-qr-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview, Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-windows11-32-2009-qr-debug, Gecko-windows11-32-2009-qr-opt, Gecko-windows11-64-2009-qr-debug, Gecko-windows11-64-2009-qr-opt] (Chrome: OK, Safari: OK)
    • Context will be lost by destroyed.: FAIL (Chrome: FAIL, Safari: FAIL)
    • Context can be destroyed twice.: FAIL (Chrome: FAIL, Safari: FAIL)
    • Destroyed context can not build operator.: FAIL (Chrome: FAIL, Safari: FAIL)
    • Destroyed context can not create graph builder.: FAIL (Chrome: FAIL, Safari: FAIL)
    • Destroyed context can not build graph.: FAIL (Chrome: FAIL, Safari: FAIL)
    • Destroyed context can not compute.: FAIL (Chrome: FAIL, Safari: FAIL)
    • Destroyed context can not dispatch.: FAIL (Chrome: FAIL, Safari: FAIL)
    • Executing dispatch() before context destroyed is OK.: FAIL (Chrome: FAIL, Safari: FAIL)
    • Destroyed context can not create buffer.: FAIL (Chrome: FAIL, Safari: FAIL)
    • Destroyed context can not read buffer.: FAIL (Chrome: FAIL, Safari: FAIL)
    • Pending promise of readbuffer() will be rejected immediately when context is destroyed.: FAIL (Chrome: FAIL, Safari: FAIL)
    • Destroyed context can not write buffer.: FAIL (Chrome: FAIL, Safari: FAIL)
  • /webnn/validation_tests/destroyContext.https.any.worker.html [wpt.fyi]: OK [GitHub], SKIP [Gecko-android-em-7.0-x86_64-lite-qr-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview, Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-windows11-32-2009-qr-debug, Gecko-windows11-32-2009-qr-opt, Gecko-windows11-64-2009-qr-debug, Gecko-windows11-64-2009-qr-opt] (Chrome: OK, Safari: OK)
    • Context will be lost by destroyed.: FAIL (Chrome: FAIL, Safari: FAIL)
    • Context can be destroyed twice.: FAIL (Chrome: FAIL, Safari: FAIL)
    • Destroyed context can not build operator.: FAIL (Chrome: FAIL, Safari: FAIL)
    • Destroyed context can not create graph builder.: FAIL (Chrome: FAIL, Safari: FAIL)
    • Destroyed context can not build graph.: FAIL (Chrome: FAIL, Safari: FAIL)
    • Destroyed context can not compute.: FAIL (Chrome: FAIL, Safari: FAIL)
    • Destroyed context can not dispatch.: FAIL (Chrome: FAIL, Safari: FAIL)
    • Executing dispatch() before context destroyed is OK.: FAIL (Chrome: FAIL, Safari: FAIL)
    • Destroyed context can not create buffer.: FAIL (Chrome: FAIL, Safari: FAIL)
    • Destroyed context can not read buffer.: FAIL (Chrome: FAIL, Safari: FAIL)
    • Pending promise of readbuffer() will be rejected immediately when context is destroyed.: FAIL (Chrome: FAIL, Safari: FAIL)
    • Destroyed context can not write buffer.: FAIL (Chrome: FAIL, Safari: FAIL)

Tests Disabled in Gecko Infrastructure

  • /webnn/validation_tests/destroyContext.https.any.html [wpt.fyi]: OK [GitHub], SKIP [Gecko-android-em-7.0-x86_64-lite-qr-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview, Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-windows11-32-2009-qr-debug, Gecko-windows11-32-2009-qr-opt, Gecko-windows11-64-2009-qr-debug, Gecko-windows11-64-2009-qr-opt] (Chrome: OK, Safari: OK)
  • /webnn/validation_tests/destroyContext.https.any.worker.html [wpt.fyi]: OK [GitHub], SKIP [Gecko-android-em-7.0-x86_64-lite-qr-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview, Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-windows11-32-2009-qr-debug, Gecko-windows11-32-2009-qr-opt, Gecko-windows11-64-2009-qr-debug, Gecko-windows11-64-2009-qr-opt] (Chrome: OK, Safari: OK)
Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4037486ac22f [wpt PR 47520] - WebNN: Define `MLContext::destroy` interface, a=testonly
Status: NEW → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 131 Branch
You need to log in before you can comment on or make changes to this bug.