Open Bug 2008822 Opened 3 days ago Updated 2 hours ago

[wpt-sync] Sync PR 57024 - WebNN: Replace null characters in operand names for ORT backend

Categories

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

task

Tracking

(Not tracked)

People

(Reporter: wpt-sync, Unassigned)

References

(Depends on 1 open bug, )

Details

(Whiteboard: [wptsync downstream])

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

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

Miao Bin <bin.miao@intel.com> wrote:

WebNN: Replace null characters in operand names for ORT backend

Input and output operand names starting with null characters ('\0')
cause ORT's CreateValueInfo API to fail with "name cannot be null or
empty string" error [1], leading to context lost.

Furthermore, ORT's C API truncates at any '\0' and this happens before
we append the operand id. For example, both 'input\0a_1' and
'input\0b_2' would become 'input', which will lead to “Duplicate
definition-site for (input)” error.

This CL replaces all '\0' characters with '_' in operand names to ensure
compatibility with ORT's C API (name collisions are prevented by the
joined unique operand id).

This CL also adds WPT tests to cover null characters in different
positions.

[1] https://github.com/microsoft/onnxruntime/blob/7b5a93ef5f71ca58a1b6e4ae81b250e767756c68/onnxruntime/core/session/model_editor_c_api.cc#L29

Bug: 470831369
Change-Id: I3f833d2398ecd8cd3e5b4f106fb0b7c1b25f2485

Reviewed-on: https://chromium-review.googlesource.com/7298368
WPT-Export-Revision: 2bec750fc9e0393ab1759ee0960848b43ad71196

CI Results

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

Total 3 tests and 9 subtests

Status Summary

Firefox

ERROR : 3
NOTRUN: 27

Chrome

OK : 3
PASS : 27

Safari

ERROR : 3
NOTRUN: 27

Links

GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

'"<\webnn': NOTRUN (Chrome: PASS, Safari: NOTRUN)

  • abs input with special character name '<': NOTRUN (Chrome: PASS, Safari: NOTRUN)
  • abs input with special character name '<startWithNullCharacter': NOTRUN (Chrome: PASS, Safari: NOTRUN)
  • abs input with special character name 'AAA': NOTRUN (Chrome: PASS, Safari: NOTRUN)
  • abs input with special character name '©©♥…': NOTRUN (Chrome: PASS, Safari: NOTRUN)
  • abs input with special character name 'U0001F600': NOTRUN (Chrome: PASS, Safari: NOTRUN)
  • [add] inputs with null character name in the middle: NOTRUN (Chrome: PASS, Safari: NOTRUN)
  • /webnn/conformance_tests/inputs-with-special-names.https.any.html?gpu [wpt.fyi]: ERROR (Chrome: OK, Safari: ERROR)
    • abs input with special character name '12-L#!.☺': NOTRUN (Chrome: PASS, Safari: NOTRUN)
    • abs input with special character name '🤦🏼‍♂️124DS#!F': NOTRUN (Chrome: PASS, Safari: NOTRUN)
    • abs input with special character name 'hello

'"<\webnn': NOTRUN (Chrome: PASS, Safari: NOTRUN)

  • abs input with special character name '<': NOTRUN (Chrome: PASS, Safari: NOTRUN)
  • abs input with special character name '<startWithNullCharacter': NOTRUN (Chrome: PASS, Safari: NOTRUN)
  • abs input with special character name 'AAA': NOTRUN (Chrome: PASS, Safari: NOTRUN)
  • abs input with special character name '©©♥…': NOTRUN (Chrome: PASS, Safari: NOTRUN)
  • abs input with special character name 'U0001F600': NOTRUN (Chrome: PASS, Safari: NOTRUN)
  • [add] inputs with null character name in the middle: NOTRUN (Chrome: PASS, Safari: NOTRUN)
  • /webnn/conformance_tests/inputs-with-special-names.https.any.html?cpu [wpt.fyi]: ERROR (Chrome: OK, Safari: ERROR)
    • abs input with special character name '12-L#!.☺': NOTRUN (Chrome: PASS, Safari: NOTRUN)
    • abs input with special character name '🤦🏼‍♂️124DS#!F': NOTRUN (Chrome: PASS, Safari: NOTRUN)
    • abs input with special character name 'hello

'"<\webnn': NOTRUN (Chrome: PASS, Safari: NOTRUN)

  • abs input with special character name '<': NOTRUN (Chrome: PASS, Safari: NOTRUN)
  • abs input with special character name '<startWithNullCharacter': NOTRUN (Chrome: PASS, Safari: NOTRUN)
  • abs input with special character name 'AAA': NOTRUN (Chrome: PASS, Safari: NOTRUN)
  • abs input with special character name '©©♥…': NOTRUN (Chrome: PASS, Safari: NOTRUN)
  • abs input with special character name 'U0001F600': NOTRUN (Chrome: PASS, Safari: NOTRUN)
  • [add] inputs with null character name in the middle: NOTRUN (Chrome: PASS, Safari: NOTRUN)
Pushed by wptsync@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/126d02deb1c1 https://hg.mozilla.org/integration/autoland/rev/b3a0cc391af3 [wpt PR 57024] - WebNN: Replace null characters in operand names for ORT backend, a=testonly
You need to log in before you can comment on or make changes to this bug.