webnn: Introduce MLNumber [chromium/src : main]

0 views
Skip to first unread message

Lisha Guo (Gerrit)

unread,
May 23, 2025, 4:55:08 AMMay 23
to ningxin hu, Junwei Fu, Chromium LUCI CQ, Austin Sullivan, Shiyi Zou, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, Jiewei Qian, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
Attention needed from ningxin hu

Lisha Guo added 1 comment

Patchset-level comments
File-level comment, Patchset 9 (Latest):
Lisha Guo . resolved

This CL is based on another CL- https://chromium-review.googlesource.com/c/chromium/src/+/5466806 from @asu...@chromium.org. This new CL fixed the remaining issues with the bindings code interpreting numbers as BigInts and added Clamp MLNumber supporting for different backends.

Open in Gerrit

Related details

Attention is currently required from:
  • ningxin hu
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ibe63d38b9e617b98fb01fb877a55a73053c1c353
Gerrit-Change-Number: 6565815
Gerrit-PatchSet: 9
Gerrit-Owner: Lisha Guo <lish...@intel.com>
Gerrit-Reviewer: Lisha Guo <lish...@intel.com>
Gerrit-Reviewer: ningxin hu <ningx...@intel.com>
Gerrit-CC: Austin Sullivan <asu...@chromium.org>
Gerrit-CC: Jiewei Qian <q...@chromium.org>
Gerrit-CC: Junwei Fu <junw...@intel.com>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-CC: Shiyi Zou <shiy...@intel.com>
Gerrit-Attention: ningxin hu <ningx...@intel.com>
Gerrit-Comment-Date: Fri, 23 May 2025 08:54:54 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

ningxin hu (Gerrit)

unread,
May 28, 2025, 10:04:02 PMMay 28
to Lisha Guo, Austin Sullivan, Reilly Grant, Dwayne Robinson, AyeAye, Junwei Fu, Chromium LUCI CQ, Shiyi Zou, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, Jiewei Qian, mac-r...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
Attention needed from Austin Sullivan and Lisha Guo

ningxin hu added 1 comment

Patchset-level comments
Lisha Guo . resolved

This CL is based on another CL- https://chromium-review.googlesource.com/c/chromium/src/+/5466806 from @asu...@chromium.org. This new CL fixed the remaining issues with the bindings code interpreting numbers as BigInts and added Clamp MLNumber supporting for different backends.

ningxin hu

Thanks @asu...@chromium.org for offering a formal review!

Open in Gerrit

Related details

Attention is currently required from:
  • Austin Sullivan
  • Lisha Guo
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ibe63d38b9e617b98fb01fb877a55a73053c1c353
Gerrit-Change-Number: 6565815
Gerrit-PatchSet: 17
Gerrit-Owner: Lisha Guo <lish...@intel.com>
Gerrit-Reviewer: Austin Sullivan <asu...@chromium.org>
Gerrit-Reviewer: Lisha Guo <lish...@intel.com>
Gerrit-Reviewer: ningxin hu <ningx...@intel.com>
Gerrit-CC: Dwayne Robinson <dwa...@microsoft.com>
Gerrit-CC: Jiewei Qian <q...@chromium.org>
Gerrit-CC: Junwei Fu <junw...@intel.com>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-CC: Reilly Grant <rei...@chromium.org>
Gerrit-CC: Shiyi Zou <shiy...@intel.com>
Gerrit-Attention: Austin Sullivan <asu...@chromium.org>
Gerrit-Attention: Lisha Guo <lish...@intel.com>
Gerrit-Comment-Date: Thu, 29 May 2025 02:03:52 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Lisha Guo <lish...@intel.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Austin Sullivan (Gerrit)

unread,
May 28, 2025, 11:02:50 PMMay 28
to Lisha Guo, Reilly Grant, Dwayne Robinson, AyeAye, ningxin hu, Junwei Fu, Chromium LUCI CQ, Shiyi Zou, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, Jiewei Qian, mac-r...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
Attention needed from Lisha Guo

Austin Sullivan added 2 comments

Patchset-level comments
File-level comment, Patchset 17 (Latest):
Austin Sullivan . unresolved

What are the high-level diffs between this CL and https://crrev.com/c/5466806?

File third_party/blink/web_tests/platform/mac-mac15-arm64/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/clamp.https.any_cpu-expected.txt
Line 25, Patchset 17 (Latest):[FAIL] minValue as Infinity
promise_test: Unhandled rejection with value: object "UnknownError: Failed to execute 'build' on 'MLGraphBuilder': Model compilation error."
Austin Sullivan . unresolved

Hmm ideally we shouldn't be running into model compilation errors. Do you know what's causing this?

Open in Gerrit

Related details

Attention is currently required from:
  • Lisha Guo
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ibe63d38b9e617b98fb01fb877a55a73053c1c353
    Gerrit-Change-Number: 6565815
    Gerrit-PatchSet: 17
    Gerrit-Owner: Lisha Guo <lish...@intel.com>
    Gerrit-Reviewer: Austin Sullivan <asu...@chromium.org>
    Gerrit-Reviewer: Lisha Guo <lish...@intel.com>
    Gerrit-Reviewer: ningxin hu <ningx...@intel.com>
    Gerrit-CC: Dwayne Robinson <dwa...@microsoft.com>
    Gerrit-CC: Jiewei Qian <q...@chromium.org>
    Gerrit-CC: Junwei Fu <junw...@intel.com>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-CC: Reilly Grant <rei...@chromium.org>
    Gerrit-CC: Shiyi Zou <shiy...@intel.com>
    Gerrit-Attention: Lisha Guo <lish...@intel.com>
    Gerrit-Comment-Date: Thu, 29 May 2025 03:02:35 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Austin Sullivan (Gerrit)

    unread,
    May 28, 2025, 11:11:19 PMMay 28
    to Lisha Guo, Reilly Grant, Dwayne Robinson, AyeAye, ningxin hu, Junwei Fu, Chromium LUCI CQ, Shiyi Zou, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, Jiewei Qian, mac-r...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Lisha Guo

    Austin Sullivan added 1 comment

    File third_party/blink/web_tests/platform/win/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/mlNumber.https.any_gpu-expected.txt
    Line 3, Patchset 17 (Latest): assert_less_than_equal: assert_array_approx_equals_ulp: test clamp int64 actual 9223372036854775807 should be close enough to expected 9223372036854776000 by ULP distance: expected a number less than or equal to 0n but got 1n
    Austin Sullivan . unresolved

    Hmm why is this value expected? Is the expected value being implicitly casted somewhere?

    Also should we be using ULP to compare integers?

    (same thing with 18446744073709552000 below)

    Gerrit-Comment-Date: Thu, 29 May 2025 03:11:07 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Austin Sullivan (Gerrit)

    unread,
    May 28, 2025, 11:27:55 PMMay 28
    to Lisha Guo, Reilly Grant, Dwayne Robinson, AyeAye, ningxin hu, Junwei Fu, Chromium LUCI CQ, Shiyi Zou, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, Jiewei Qian, mac-r...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Lisha Guo

    Austin Sullivan added 3 comments

    Patchset-level comments
    Austin Sullivan . resolved

    Took a look and overall everything seems reasonable other than the few comments I've already left. This is a big CL but I understand that it will be hard to meaningfully split up. If we add more unit test coverage then we could try to merge e.g. the BigInt changes separately? Not sure whether splitting just that off is worth the effort, and the other code is all quite intertwined unfortunately

    File services/webnn/public/cpp/ml_number.h
    Line 17, Patchset 17 (Latest):class COMPONENT_EXPORT(WEBNN_PUBLIC_CPP) MLNumber {
    Austin Sullivan . unresolved

    Let's consider adding unit tests for this class? Most things here are straightforward but it would be nice to have some coverage for the non-trivial methods like `IsGreaterThan` and handling of infinities

    File third_party/blink/renderer/platform/bindings/bigint.h
    Line 58, Patchset 17 (Latest): // Best-effort cast to a double. This is generally not recommended.
    double ToDoubleLossy() const;
    Austin Sullivan . unresolved

    Let's add unit tests for this class, too? Especially for this method

    Gerrit-Comment-Date: Thu, 29 May 2025 03:27:46 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Lisha Guo (Gerrit)

    unread,
    May 28, 2025, 11:32:29 PMMay 28
    to Austin Sullivan, Reilly Grant, Dwayne Robinson, AyeAye, ningxin hu, Junwei Fu, Chromium LUCI CQ, Shiyi Zou, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, Jiewei Qian, mac-r...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Austin Sullivan

    Lisha Guo added 5 comments

    Patchset-level comments
    Austin Sullivan . unresolved

    What are the high-level diffs between this CL and https://crrev.com/c/5466806?

    Lisha Guo

    The main diff lies in the implementation of BigInt::Toxxxx of bigInt.cc. Besides, I also added MLNumber support for clamp for CoreML and DirectML.

    File services/webnn/public/cpp/ml_number.h
    Line 17, Patchset 17 (Latest):class COMPONENT_EXPORT(WEBNN_PUBLIC_CPP) MLNumber {
    Austin Sullivan . unresolved

    Let's consider adding unit tests for this class? Most things here are straightforward but it would be nice to have some coverage for the non-trivial methods like `IsGreaterThan` and handling of infinities

    Lisha Guo

    Sure. I will add related unit tests for the non-trivial methods.

    File third_party/blink/renderer/platform/bindings/bigint.h
    Line 58, Patchset 17 (Latest): // Best-effort cast to a double. This is generally not recommended.
    double ToDoubleLossy() const;
    Austin Sullivan . unresolved

    Let's add unit tests for this class, too? Especially for this method

    Lisha Guo

    Sure. I will add related unit tests.

    File third_party/blink/web_tests/platform/mac-mac15-arm64/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/clamp.https.any_cpu-expected.txt
    Line 25, Patchset 17 (Latest):[FAIL] minValue as Infinity
    promise_test: Unhandled rejection with value: object "UnknownError: Failed to execute 'build' on 'MLGraphBuilder': Model compilation error."
    Austin Sullivan . unresolved

    Hmm ideally we shouldn't be running into model compilation errors. Do you know what's causing this?

    Lisha Guo

    I also see these model compilation errors, and it only appears on macOS. Since I don't have a Mac machine at hand, I haven't found the reason yet.

    File third_party/blink/web_tests/platform/win/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/mlNumber.https.any_gpu-expected.txt
    Line 3, Patchset 17 (Latest): assert_less_than_equal: assert_array_approx_equals_ulp: test clamp int64 actual 9223372036854775807 should be close enough to expected 9223372036854776000 by ULP distance: expected a number less than or equal to 0n but got 1n
    Austin Sullivan . unresolved

    Hmm why is this value expected? Is the expected value being implicitly casted somewhere?

    Also should we be using ULP to compare integers?

    (same thing with 18446744073709552000 below)

    Lisha Guo

    Also should we be using ULP to compare integers?

    Here, I set ULP = 0 for integers compare.

    Is the expected value being implicitly casted somewhere?

    I am not sure whether is caused by int64/uint64 precision issue of DirectML clamp op.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Austin Sullivan
    Gerrit-Attention: Austin Sullivan <asu...@chromium.org>
    Gerrit-Comment-Date: Thu, 29 May 2025 03:32:12 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Austin Sullivan <asu...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Austin Sullivan (Gerrit)

    unread,
    May 28, 2025, 11:52:56 PMMay 28
    to Lisha Guo, Reilly Grant, Dwayne Robinson, AyeAye, ningxin hu, Junwei Fu, Chromium LUCI CQ, Shiyi Zou, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, Jiewei Qian, mac-r...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Lisha Guo

    Austin Sullivan added 1 comment

    File third_party/blink/web_tests/platform/win/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/mlNumber.https.any_gpu-expected.txt
    Line 3, Patchset 17 (Latest): assert_less_than_equal: assert_array_approx_equals_ulp: test clamp int64 actual 9223372036854775807 should be close enough to expected 9223372036854776000 by ULP distance: expected a number less than or equal to 0n but got 1n
    Austin Sullivan . unresolved

    Hmm why is this value expected? Is the expected value being implicitly casted somewhere?

    Also should we be using ULP to compare integers?

    (same thing with 18446744073709552000 below)

    Lisha Guo

    Also should we be using ULP to compare integers?

    Here, I set ULP = 0 for integers compare.

    Is the expected value being implicitly casted somewhere?

    I am not sure whether is caused by int64/uint64 precision issue of DirectML clamp op.

    Austin Sullivan

    Just to clarify, my comment is about the _expected_ value seeming off - which might indicate an issue with our testing code somewhere. The `actual 9223372036854775807` matches the value of `"expectedOutputs"` in the test file

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Lisha Guo
    Gerrit-Attention: Lisha Guo <lish...@intel.com>
    Gerrit-Comment-Date: Thu, 29 May 2025 03:52:44 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Austin Sullivan <asu...@chromium.org>
    Comment-In-Reply-To: Lisha Guo <lish...@intel.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Lisha Guo (Gerrit)

    unread,
    May 29, 2025, 4:02:36 AMMay 29
    to Austin Sullivan, Reilly Grant, Dwayne Robinson, AyeAye, ningxin hu, Junwei Fu, Chromium LUCI CQ, Shiyi Zou, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, Jiewei Qian, mac-r...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Austin Sullivan

    Lisha Guo added 1 comment

    File third_party/blink/web_tests/platform/mac-mac15-arm64/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/clamp.https.any_cpu-expected.txt
    Line 25, Patchset 17 (Latest):[FAIL] minValue as Infinity
    promise_test: Unhandled rejection with value: object "UnknownError: Failed to execute 'build' on 'MLGraphBuilder': Model compilation error."
    Austin Sullivan . unresolved

    Hmm ideally we shouldn't be running into model compilation errors. Do you know what's causing this?

    Lisha Guo

    I also see these model compilation errors, and it only appears on macOS. Since I don't have a Mac machine at hand, I haven't found the reason yet.

    Lisha Guo

    All these fail test cases with model compilation errors all set the same minValue and maxValue. It seems CoreML can't support same minValue and maxValue for clamp.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Austin Sullivan
    Gerrit-Attention: Austin Sullivan <asu...@chromium.org>
    Gerrit-Comment-Date: Thu, 29 May 2025 08:02:19 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Lisha Guo (Gerrit)

    unread,
    May 29, 2025, 4:27:27 AMMay 29
    to Phillis Tang, Austin Sullivan, Reilly Grant, Dwayne Robinson, AyeAye, ningxin hu, Junwei Fu, Chromium LUCI CQ, Shiyi Zou, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, Jiewei Qian, mac-r...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Austin Sullivan and Phillis Tang

    Lisha Guo added 1 comment

    File third_party/blink/web_tests/platform/mac-mac15-arm64/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/clamp.https.any_cpu-expected.txt
    Line 25, Patchset 17 (Latest):[FAIL] minValue as Infinity
    promise_test: Unhandled rejection with value: object "UnknownError: Failed to execute 'build' on 'MLGraphBuilder': Model compilation error."
    Austin Sullivan . unresolved

    Hmm ideally we shouldn't be running into model compilation errors. Do you know what's causing this?

    Lisha Guo

    I also see these model compilation errors, and it only appears on macOS. Since I don't have a Mac machine at hand, I haven't found the reason yet.

    Lisha Guo

    All these fail test cases with model compilation errors all set the same minValue and maxValue. It seems CoreML can't support same minValue and maxValue for clamp.

    Lisha Guo

    We can use `min` and `max` to emulation for these case. @phi...@chromium.org WDYT?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Austin Sullivan
    • Phillis Tang
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ibe63d38b9e617b98fb01fb877a55a73053c1c353
    Gerrit-Change-Number: 6565815
    Gerrit-PatchSet: 17
    Gerrit-Owner: Lisha Guo <lish...@intel.com>
    Gerrit-Reviewer: Austin Sullivan <asu...@chromium.org>
    Gerrit-Reviewer: Lisha Guo <lish...@intel.com>
    Gerrit-Reviewer: ningxin hu <ningx...@intel.com>
    Gerrit-CC: Dwayne Robinson <dwa...@microsoft.com>
    Gerrit-CC: Jiewei Qian <q...@chromium.org>
    Gerrit-CC: Junwei Fu <junw...@intel.com>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Phillis Tang <phi...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-CC: Reilly Grant <rei...@chromium.org>
    Gerrit-CC: Shiyi Zou <shiy...@intel.com>
    Gerrit-Attention: Austin Sullivan <asu...@chromium.org>
    Gerrit-Attention: Phillis Tang <phi...@chromium.org>
    Gerrit-Comment-Date: Thu, 29 May 2025 08:27:12 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Phillis Tang (Gerrit)

    unread,
    May 29, 2025, 1:01:21 PMMay 29
    to Lisha Guo, Austin Sullivan, Reilly Grant, Dwayne Robinson, AyeAye, ningxin hu, Junwei Fu, Chromium LUCI CQ, Shiyi Zou, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, Jiewei Qian, mac-r...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Austin Sullivan and Lisha Guo

    Phillis Tang added 1 comment

    File third_party/blink/web_tests/platform/mac-mac15-arm64/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/clamp.https.any_cpu-expected.txt
    Line 25, Patchset 17 (Latest):[FAIL] minValue as Infinity
    promise_test: Unhandled rejection with value: object "UnknownError: Failed to execute 'build' on 'MLGraphBuilder': Model compilation error."
    Austin Sullivan . unresolved

    Hmm ideally we shouldn't be running into model compilation errors. Do you know what's causing this?

    Lisha Guo

    I also see these model compilation errors, and it only appears on macOS. Since I don't have a Mac machine at hand, I haven't found the reason yet.

    Lisha Guo

    All these fail test cases with model compilation errors all set the same minValue and maxValue. It seems CoreML can't support same minValue and maxValue for clamp.

    Lisha Guo

    We can use `min` and `max` to emulation for these case. @phi...@chromium.org WDYT?

    Phillis Tang

    SG, you can create a crbug for that.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Austin Sullivan
    • Lisha Guo
    Gerrit-Attention: Lisha Guo <lish...@intel.com>
    Gerrit-Comment-Date: Thu, 29 May 2025 17:01:11 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Austin Sullivan (Gerrit)

    unread,
    May 29, 2025, 5:40:29 PMMay 29
    to Lisha Guo, Phillis Tang, Reilly Grant, Dwayne Robinson, AyeAye, ningxin hu, Junwei Fu, Chromium LUCI CQ, Shiyi Zou, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, Jiewei Qian, mac-r...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Lisha Guo

    Austin Sullivan added 4 comments

    Patchset-level comments
    Austin Sullivan . resolved

    What are the high-level diffs between this CL and https://crrev.com/c/5466806?

    Lisha Guo

    The main diff lies in the implementation of BigInt::Toxxxx of bigInt.cc. Besides, I also added MLNumber support for clamp for CoreML and DirectML.

    Austin Sullivan

    Ack thanks for the context

    File third_party/blink/renderer/platform/bindings/bigint.cc
    Line 34, Patchset 17 (Latest): if (sign_bit_) {
    Austin Sullivan . unresolved

    nit: use `IsNegative()`

    Line 40, Patchset 17 (Latest): } else {
    Austin Sullivan . unresolved

    This `else` block can be un-nested because all code paths in the preceding `if` block `return`

    Line 53, Patchset 17 (Latest): !base::IsValueInRangeForNumericType<uint8_t>(words_[0])) {
    Austin Sullivan . unresolved

    Hmm why is is that we're only checking this for the unsigned types?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Lisha Guo
    Gerrit-Attention: Lisha Guo <lish...@intel.com>
    Gerrit-Comment-Date: Thu, 29 May 2025 21:40:20 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Lisha Guo (Gerrit)

    unread,
    Jun 2, 2025, 9:25:28 PMJun 2
    to Phillis Tang, Austin Sullivan, Reilly Grant, Dwayne Robinson, AyeAye, ningxin hu, Junwei Fu, Chromium LUCI CQ, Shiyi Zou, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, Jiewei Qian, mac-r...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Austin Sullivan

    Lisha Guo added 2 comments

    File third_party/blink/renderer/platform/bindings/bigint.cc
    Austin Sullivan . unresolved

    This `else` block can be un-nested because all code paths in the preceding `if` block `return`

    Lisha Guo

    Good catch. I will remove `else`.

    Line 53, Patchset 17 (Latest): !base::IsValueInRangeForNumericType<uint8_t>(words_[0])) {
    Austin Sullivan . unresolved

    Hmm why is is that we're only checking this for the unsigned types?

    Lisha Guo
    For signed types, we need to check the valid range according to 'sign_bits_`. For example,
    ```
    if (sign_bit_) {
    if (value >
    static_cast<uint64_t>(std::abs(std::numeric_limits<int8_t>::min()))) {
    return std::nullopt;
    }
    } else {
    if (value > static_cast<uint64_t>(std::numeric_limits<int8_t>::max())) {
    return std::nullopt;
    }
    ```

    Am I right?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Austin Sullivan
    Gerrit-Attention: Austin Sullivan <asu...@chromium.org>
    Gerrit-Comment-Date: Tue, 03 Jun 2025 01:25:12 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Lisha Guo (Gerrit)

    unread,
    Jun 2, 2025, 9:52:53 PMJun 2
    to Phillis Tang, Austin Sullivan, Reilly Grant, Dwayne Robinson, AyeAye, ningxin hu, Junwei Fu, Chromium LUCI CQ, Shiyi Zou, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, Jiewei Qian, mac-r...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Austin Sullivan and Phillis Tang

    Lisha Guo added 1 comment

    File third_party/blink/web_tests/platform/mac-mac15-arm64/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/clamp.https.any_cpu-expected.txt
    Line 25, Patchset 17 (Latest):[FAIL] minValue as Infinity
    promise_test: Unhandled rejection with value: object "UnknownError: Failed to execute 'build' on 'MLGraphBuilder': Model compilation error."
    Austin Sullivan . unresolved

    Hmm ideally we shouldn't be running into model compilation errors. Do you know what's causing this?

    Lisha Guo

    I also see these model compilation errors, and it only appears on macOS. Since I don't have a Mac machine at hand, I haven't found the reason yet.

    Lisha Guo

    All these fail test cases with model compilation errors all set the same minValue and maxValue. It seems CoreML can't support same minValue and maxValue for clamp.

    Lisha Guo

    We can use `min` and `max` to emulation for these case. @phi...@chromium.org WDYT?

    Phillis Tang

    SG, you can create a crbug for that.

    Lisha Guo

    related [issue](https://issues.chromium.org/issues/421927615) has been created. And I suppose we can create another new CL to solve this issue.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Austin Sullivan
    • Phillis Tang
    Gerrit-Attention: Phillis Tang <phi...@chromium.org>
    Gerrit-Comment-Date: Tue, 03 Jun 2025 01:52:37 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Austin Sullivan <asu...@chromium.org>
    Comment-In-Reply-To: Phillis Tang <phi...@chromium.org>
    Comment-In-Reply-To: Lisha Guo <lish...@intel.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Lisha Guo (Gerrit)

    unread,
    Jun 3, 2025, 4:07:27 AMJun 3
    to Phillis Tang, Austin Sullivan, Reilly Grant, Dwayne Robinson, AyeAye, ningxin hu, Junwei Fu, Chromium LUCI CQ, Shiyi Zou, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, Jiewei Qian, mac-r...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Austin Sullivan

    Lisha Guo added 3 comments

    File third_party/blink/renderer/platform/bindings/bigint.cc
    Line 34, Patchset 17: if (sign_bit_) {
    Austin Sullivan . resolved

    nit: use `IsNegative()`

    Lisha Guo

    Done

    Line 40, Patchset 17: } else {
    Austin Sullivan . resolved

    This `else` block can be un-nested because all code paths in the preceding `if` block `return`

    Lisha Guo

    Good catch. I will remove `else`.

    Lisha Guo

    Done

    File third_party/blink/web_tests/platform/win/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/mlNumber.https.any_gpu-expected.txt
    Line 3, Patchset 17: assert_less_than_equal: assert_array_approx_equals_ulp: test clamp int64 actual 9223372036854775807 should be close enough to expected 9223372036854776000 by ULP distance: expected a number less than or equal to 0n but got 1n
    Austin Sullivan . unresolved

    Hmm why is this value expected? Is the expected value being implicitly casted somewhere?

    Also should we be using ULP to compare integers?

    (same thing with 18446744073709552000 below)

    Lisha Guo

    Also should we be using ULP to compare integers?

    Here, I set ULP = 0 for integers compare.

    Is the expected value being implicitly casted somewhere?

    I am not sure whether is caused by int64/uint64 precision issue of DirectML clamp op.

    Austin Sullivan

    Just to clarify, my comment is about the _expected_ value seeming off - which might indicate an issue with our testing code somewhere. The `actual 9223372036854775807` matches the value of `"expectedOutputs"` in the test file

    Lisha Guo

    For JS, we use `Float64Array` to store expected data for default. The actual data `9223372036854775807` is large than the largest data `9223372036854776000` it can hold. To solve this accuracy loss, we can use `9223372036854775807n` instead of `9223372036854775807` for expected data. WDYT?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Austin Sullivan
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ibe63d38b9e617b98fb01fb877a55a73053c1c353
    Gerrit-Change-Number: 6565815
    Gerrit-PatchSet: 18
    Gerrit-Owner: Lisha Guo <lish...@intel.com>
    Gerrit-Reviewer: Austin Sullivan <asu...@chromium.org>
    Gerrit-Reviewer: Lisha Guo <lish...@intel.com>
    Gerrit-Reviewer: ningxin hu <ningx...@intel.com>
    Gerrit-CC: Dwayne Robinson <dwa...@microsoft.com>
    Gerrit-CC: Jiewei Qian <q...@chromium.org>
    Gerrit-CC: Junwei Fu <junw...@intel.com>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Phillis Tang <phi...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-CC: Reilly Grant <rei...@chromium.org>
    Gerrit-CC: Shiyi Zou <shiy...@intel.com>
    Gerrit-Attention: Austin Sullivan <asu...@chromium.org>
    Gerrit-Comment-Date: Tue, 03 Jun 2025 08:07:15 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Austin Sullivan <asu...@chromium.org>
    Comment-In-Reply-To: Lisha Guo <lish...@intel.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Austin Sullivan (Gerrit)

    unread,
    Jun 3, 2025, 5:39:57 PMJun 3
    to Lisha Guo, Phillis Tang, Reilly Grant, Dwayne Robinson, AyeAye, ningxin hu, Junwei Fu, Chromium LUCI CQ, Shiyi Zou, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, Jiewei Qian, mac-r...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Lisha Guo

    Austin Sullivan added 3 comments

    File third_party/blink/renderer/platform/bindings/bigint.cc
    Line 53, Patchset 17: !base::IsValueInRangeForNumericType<uint8_t>(words_[0])) {
    Austin Sullivan . unresolved

    Hmm why is is that we're only checking this for the unsigned types?

    Lisha Guo
    For signed types, we need to check the valid range according to 'sign_bits_`. For example,
    ```
    if (sign_bit_) {
    if (value >
    static_cast<uint64_t>(std::abs(std::numeric_limits<int8_t>::min()))) {
    return std::nullopt;
    }
    } else {
    if (value > static_cast<uint64_t>(std::numeric_limits<int8_t>::max())) {
    return std::nullopt;
    }
    ```

    Am I right?

    Austin Sullivan

    Ah right. Thoughts on pulling this out into a templated helper? Something like this:

    ```
    template <typename DstT>
    requires(std::is_signed_v<DstT> && std::is_integral_v<DstT>)
    std::optional<DstT> GetValueIfInRange(uint64_t value, bool is_negative) {
    if (is_negative) {
    if (value >
    static_cast<uint64_t>(std::abs(std::numeric_limits<DstT>::min()))) {
    return std::nullopt;
    }
    return -static_cast<DstT>(value);
    }
      if (value > static_cast<uint64_t>(std::numeric_limits<DstT>::max())) {
    return std::nullopt;
    }
    return static_cast<DstT>(value);
    }
    ```
    File third_party/blink/web_tests/platform/mac-mac15-arm64/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/clamp.https.any_cpu-expected.txt
    Line 25, Patchset 17:[FAIL] minValue as Infinity

    promise_test: Unhandled rejection with value: object "UnknownError: Failed to execute 'build' on 'MLGraphBuilder': Model compilation error."
    Austin Sullivan . unresolved

    Hmm ideally we shouldn't be running into model compilation errors. Do you know what's causing this?

    Lisha Guo

    I also see these model compilation errors, and it only appears on macOS. Since I don't have a Mac machine at hand, I haven't found the reason yet.

    Lisha Guo

    All these fail test cases with model compilation errors all set the same minValue and maxValue. It seems CoreML can't support same minValue and maxValue for clamp.

    Lisha Guo

    We can use `min` and `max` to emulation for these case. @phi...@chromium.org WDYT?

    Phillis Tang

    SG, you can create a crbug for that.

    Lisha Guo

    related [issue](https://issues.chromium.org/issues/421927615) has been created. And I suppose we can create another new CL to solve this issue.

    Austin Sullivan

    Ack. Let's tag that bug to the CL footer?

    File third_party/blink/web_tests/platform/win/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/mlNumber.https.any_gpu-expected.txt
    Line 3, Patchset 17: assert_less_than_equal: assert_array_approx_equals_ulp: test clamp int64 actual 9223372036854775807 should be close enough to expected 9223372036854776000 by ULP distance: expected a number less than or equal to 0n but got 1n
    Austin Sullivan . unresolved

    Hmm why is this value expected? Is the expected value being implicitly casted somewhere?

    Also should we be using ULP to compare integers?

    (same thing with 18446744073709552000 below)

    Lisha Guo

    Also should we be using ULP to compare integers?

    Here, I set ULP = 0 for integers compare.

    Is the expected value being implicitly casted somewhere?

    I am not sure whether is caused by int64/uint64 precision issue of DirectML clamp op.

    Austin Sullivan

    Just to clarify, my comment is about the _expected_ value seeming off - which might indicate an issue with our testing code somewhere. The `actual 9223372036854775807` matches the value of `"expectedOutputs"` in the test file

    Lisha Guo

    For JS, we use `Float64Array` to store expected data for default. The actual data `9223372036854775807` is large than the largest data `9223372036854776000` it can hold. To solve this accuracy loss, we can use `9223372036854775807n` instead of `9223372036854775807` for expected data. WDYT?

    Austin Sullivan

    SGTM thanks

    (resolve once completed)

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Lisha Guo
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ibe63d38b9e617b98fb01fb877a55a73053c1c353
    Gerrit-Change-Number: 6565815
    Gerrit-PatchSet: 19
    Gerrit-Owner: Lisha Guo <lish...@intel.com>
    Gerrit-Reviewer: Austin Sullivan <asu...@chromium.org>
    Gerrit-Reviewer: Lisha Guo <lish...@intel.com>
    Gerrit-Reviewer: ningxin hu <ningx...@intel.com>
    Gerrit-CC: Dwayne Robinson <dwa...@microsoft.com>
    Gerrit-CC: Jiewei Qian <q...@chromium.org>
    Gerrit-CC: Junwei Fu <junw...@intel.com>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Phillis Tang <phi...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-CC: Reilly Grant <rei...@chromium.org>
    Gerrit-CC: Shiyi Zou <shiy...@intel.com>
    Gerrit-Attention: Lisha Guo <lish...@intel.com>
    Gerrit-Comment-Date: Tue, 03 Jun 2025 21:39:47 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Austin Sullivan <asu...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Dwayne Robinson (Gerrit)

    unread,
    Jun 3, 2025, 9:00:18 PMJun 3
    to Lisha Guo, Phillis Tang, Austin Sullivan, Reilly Grant, AyeAye, ningxin hu, Junwei Fu, Chromium LUCI CQ, Shiyi Zou, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, Jiewei Qian, mac-r...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Lisha Guo

    Dwayne Robinson added 9 comments

    Patchset-level comments
    File-level comment, Patchset 19 (Latest):
    Dwayne Robinson . resolved

    Thanks for resurrecting this old change Lisha.

    File services/webnn/dml/graph_impl_dml.cc
    Line 1723, Patchset 19 (Latest): switch (output_tensor_desc.GetDataType()) {
    Dwayne Robinson . unresolved

    `ToScalarUnion` already exists - do we need this separate `switch` statement?

    ```c++
    auto data_type = output_tensor_desc.GetDataType();
    clamp_operator_desc.Min = ToScalarUnion(clamp->min_value, data_type);
    clamp_operator_desc.Max = ToScalarUnion(clamp->max_value, data_type);
    ```

    File services/webnn/tflite/graph_builder_tflite.cc
    Line 3420, Patchset 19 (Latest): const float min_value = clamp.min_value.AsFloat32();
    Dwayne Robinson . unresolved

    (already existing - can open separate Chromium issue for it)

    Won't coercing to float lose precision for integers? 16777217 would be treated as if 16777216. I see `tfl.minimum` supports u/int32 and u/int64 [here](https://www.tensorflow.org/mlir/tfl_ops#tflminimum_tflminimumop), and so integers *should* be supportable too.

    File services/webnn/webnn_graph_builder_impl.cc
    Line 107, Patchset 19 (Latest): return (!clamp.min_value.IsGreaterThan(clamp.max_value, data_type));
    Dwayne Robinson . unresolved
    ```suggestion
    return !clamp.min_value.IsGreaterThan(clamp.max_value, data_type);
    ```
    File third_party/blink/renderer/modules/ml/webnn/ml_graph_type_converter.cc
    Line 1557, Patchset 19 (Latest): LOG(ERROR) << "bigint.ToInt64(): " << *int64;
    Dwayne Robinson . unresolved

    Why is this case an error? 🤔 Is this debugging litter?

    File third_party/blink/web_tests/external/wpt/webnn/conformance_tests/clamp.https.any.js
    Line 382, Patchset 19 (Latest): // 'data': [295n, 127n, 5n, 0n],
    Dwayne Robinson . unresolved

    Meant to delete?

    Line 1981, Patchset 19 (Latest): 'name': 'minValue as BitInt == maxValue as BigInt',
    Dwayne Robinson . unresolved

    `BigInt`

    Line 2018, Patchset 19 (Latest): {'input': 'clampInput'}, {'options': {'minValue': 1, 'maxValue': 1n}}
    Dwayne Robinson . unresolved

    `1n`? If `1` is intended for a heterogeneous case, then I propose updating the test case title just to be clear:

    `minValue as Number == maxValue as BigInt`

    File third_party/blink/web_tests/platform/win11-arm64/svg/text/bidi-textlength-expected.png
    File-level comment, Patchset 19 (Latest):
    Dwayne Robinson . unresolved

    Should be reverted.

    Gerrit-Comment-Date: Wed, 04 Jun 2025 01:00:11 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Lisha Guo (Gerrit)

    unread,
    Jun 3, 2025, 11:12:48 PMJun 3
    to Phillis Tang, Austin Sullivan, Reilly Grant, Dwayne Robinson, AyeAye, ningxin hu, Junwei Fu, Chromium LUCI CQ, Shiyi Zou, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, Jiewei Qian, mac-r...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Austin Sullivan and Dwayne Robinson

    Lisha Guo added 10 comments

    File services/webnn/dml/graph_impl_dml.cc
    Line 1723, Patchset 19: switch (output_tensor_desc.GetDataType()) {
    Dwayne Robinson . unresolved

    `ToScalarUnion` already exists - do we need this separate `switch` statement?

    ```c++
    auto data_type = output_tensor_desc.GetDataType();
    clamp_operator_desc.Min = ToScalarUnion(clamp->min_value, data_type);
    clamp_operator_desc.Max = ToScalarUnion(clamp->max_value, data_type);
    ```

    Lisha Guo

    Hmm, when FL < 5.0, I suppose `clamp_operator_desc.Min` can't accept a `DML_SCALAR_UNION`.

    File services/webnn/tflite/graph_builder_tflite.cc
    Line 3420, Patchset 19: const float min_value = clamp.min_value.AsFloat32();
    Dwayne Robinson . resolved

    (already existing - can open separate Chromium issue for it)

    Won't coercing to float lose precision for integers? 16777217 would be treated as if 16777216. I see `tfl.minimum` supports u/int32 and u/int64 [here](https://www.tensorflow.org/mlir/tfl_ops#tflminimum_tflminimumop), and so integers *should* be supportable too.

    Lisha Guo

    Left a TODO here.

    File services/webnn/webnn_graph_builder_impl.cc
    Line 107, Patchset 19: return (!clamp.min_value.IsGreaterThan(clamp.max_value, data_type));
    Dwayne Robinson . resolved
    ```suggestion
    return !clamp.min_value.IsGreaterThan(clamp.max_value, data_type);
    ```
    Lisha Guo

    Done

    File third_party/blink/renderer/modules/ml/webnn/ml_graph_type_converter.cc
    Line 1557, Patchset 19: LOG(ERROR) << "bigint.ToInt64(): " << *int64;
    Dwayne Robinson . resolved

    Why is this case an error? 🤔 Is this debugging litter?

    Lisha Guo

    Good catch. Removed this debugging litter.

    File third_party/blink/web_tests/external/wpt/webnn/conformance_tests/clamp.https.any.js
    Line 382, Patchset 19: // 'data': [295n, 127n, 5n, 0n],
    Dwayne Robinson . resolved

    Meant to delete?

    Lisha Guo

    Done

    Line 1981, Patchset 19: 'name': 'minValue as BitInt == maxValue as BigInt',
    Dwayne Robinson . resolved

    `BigInt`

    Lisha Guo

    Done

    Line 2018, Patchset 19: {'input': 'clampInput'}, {'options': {'minValue': 1, 'maxValue': 1n}}
    Dwayne Robinson . resolved

    `1n`? If `1` is intended for a heterogeneous case, then I propose updating the test case title just to be clear:

    `minValue as Number == maxValue as BigInt`

    Lisha Guo

    Done

    File third_party/blink/web_tests/platform/mac-mac15-arm64/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/clamp.https.any_cpu-expected.txt
    Line 25, Patchset 17:[FAIL] minValue as Infinity
    promise_test: Unhandled rejection with value: object "UnknownError: Failed to execute 'build' on 'MLGraphBuilder': Model compilation error."
    Austin Sullivan . unresolved

    Hmm ideally we shouldn't be running into model compilation errors. Do you know what's causing this?

    Lisha Guo

    I also see these model compilation errors, and it only appears on macOS. Since I don't have a Mac machine at hand, I haven't found the reason yet.

    Lisha Guo

    All these fail test cases with model compilation errors all set the same minValue and maxValue. It seems CoreML can't support same minValue and maxValue for clamp.

    Lisha Guo

    We can use `min` and `max` to emulation for these case. @phi...@chromium.org WDYT?

    Phillis Tang

    SG, you can create a crbug for that.

    Lisha Guo

    related [issue](https://issues.chromium.org/issues/421927615) has been created. And I suppose we can create another new CL to solve this issue.

    Austin Sullivan

    Ack. Let's tag that bug to the CL footer?

    Lisha Guo

    Ack. Let's tag that bug to the CL footer?

    How about leave a TODO in `graph_builder_coreml.cc` file instead of tagging this bug to the CL footer since I intend to solve this bug in another CL?

    File third_party/blink/web_tests/platform/win/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/mlNumber.https.any_gpu-expected.txt
    Line 3, Patchset 17: assert_less_than_equal: assert_array_approx_equals_ulp: test clamp int64 actual 9223372036854775807 should be close enough to expected 9223372036854776000 by ULP distance: expected a number less than or equal to 0n but got 1n
    Austin Sullivan . resolved

    Hmm why is this value expected? Is the expected value being implicitly casted somewhere?

    Also should we be using ULP to compare integers?

    (same thing with 18446744073709552000 below)

    Lisha Guo

    Also should we be using ULP to compare integers?

    Here, I set ULP = 0 for integers compare.

    Is the expected value being implicitly casted somewhere?

    I am not sure whether is caused by int64/uint64 precision issue of DirectML clamp op.

    Austin Sullivan

    Just to clarify, my comment is about the _expected_ value seeming off - which might indicate an issue with our testing code somewhere. The `actual 9223372036854775807` matches the value of `"expectedOutputs"` in the test file

    Lisha Guo

    For JS, we use `Float64Array` to store expected data for default. The actual data `9223372036854775807` is large than the largest data `9223372036854776000` it can hold. To solve this accuracy loss, we can use `9223372036854775807n` instead of `9223372036854775807` for expected data. WDYT?

    Austin Sullivan

    SGTM thanks

    (resolve once completed)

    Lisha Guo

    Since these two test cases both passed in latest CL, resolve this issue.

    File third_party/blink/web_tests/platform/win11-arm64/svg/text/bidi-textlength-expected.png
    File-level comment, Patchset 19:
    Dwayne Robinson . resolved

    Should be reverted.

    Lisha Guo

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Austin Sullivan
    • Dwayne Robinson
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ibe63d38b9e617b98fb01fb877a55a73053c1c353
    Gerrit-Change-Number: 6565815
    Gerrit-PatchSet: 20
    Gerrit-Owner: Lisha Guo <lish...@intel.com>
    Gerrit-Reviewer: Austin Sullivan <asu...@chromium.org>
    Gerrit-Reviewer: Lisha Guo <lish...@intel.com>
    Gerrit-Reviewer: ningxin hu <ningx...@intel.com>
    Gerrit-CC: Dwayne Robinson <dwa...@microsoft.com>
    Gerrit-CC: Jiewei Qian <q...@chromium.org>
    Gerrit-CC: Junwei Fu <junw...@intel.com>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Phillis Tang <phi...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-CC: Reilly Grant <rei...@chromium.org>
    Gerrit-CC: Shiyi Zou <shiy...@intel.com>
    Gerrit-Attention: Dwayne Robinson <dwa...@microsoft.com>
    Gerrit-Attention: Austin Sullivan <asu...@chromium.org>
    Gerrit-Comment-Date: Wed, 04 Jun 2025 03:12:28 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Dwayne Robinson <dwa...@microsoft.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Austin Sullivan (Gerrit)

    unread,
    Jun 3, 2025, 11:42:52 PMJun 3
    to Lisha Guo, Phillis Tang, Reilly Grant, Dwayne Robinson, AyeAye, ningxin hu, Junwei Fu, Chromium LUCI CQ, Shiyi Zou, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, Jiewei Qian, mac-r...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Dwayne Robinson and Lisha Guo

    Austin Sullivan added 1 comment

    File third_party/blink/web_tests/platform/mac-mac15-arm64/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/clamp.https.any_cpu-expected.txt
    Line 25, Patchset 17:[FAIL] minValue as Infinity
    promise_test: Unhandled rejection with value: object "UnknownError: Failed to execute 'build' on 'MLGraphBuilder': Model compilation error."
    Austin Sullivan . unresolved

    Hmm ideally we shouldn't be running into model compilation errors. Do you know what's causing this?

    Lisha Guo

    I also see these model compilation errors, and it only appears on macOS. Since I don't have a Mac machine at hand, I haven't found the reason yet.

    Lisha Guo

    All these fail test cases with model compilation errors all set the same minValue and maxValue. It seems CoreML can't support same minValue and maxValue for clamp.

    Lisha Guo

    We can use `min` and `max` to emulation for these case. @phi...@chromium.org WDYT?

    Phillis Tang

    SG, you can create a crbug for that.

    Lisha Guo

    related [issue](https://issues.chromium.org/issues/421927615) has been created. And I suppose we can create another new CL to solve this issue.

    Austin Sullivan

    Ack. Let's tag that bug to the CL footer?

    Lisha Guo

    Ack. Let's tag that bug to the CL footer?

    How about leave a TODO in `graph_builder_coreml.cc` file instead of tagging this bug to the CL footer since I intend to solve this bug in another CL?

    Austin Sullivan

    Sure, that works too

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Dwayne Robinson
    • Lisha Guo
    Gerrit-Attention: Lisha Guo <lish...@intel.com>
    Gerrit-Comment-Date: Wed, 04 Jun 2025 03:42:46 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Dwayne Robinson (Gerrit)

    unread,
    Jun 4, 2025, 5:10:05 PMJun 4
    to Lisha Guo, Phillis Tang, Austin Sullivan, Reilly Grant, AyeAye, ningxin hu, Junwei Fu, Chromium LUCI CQ, Shiyi Zou, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, Jiewei Qian, mac-r...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Lisha Guo

    Dwayne Robinson added 2 comments

    Patchset-level comments
    File-level comment, Patchset 21 (Latest):
    Dwayne Robinson . resolved

    👍

    File services/webnn/dml/graph_impl_dml.cc
    Line 1723, Patchset 19: switch (output_tensor_desc.GetDataType()) {
    Dwayne Robinson . resolved

    `ToScalarUnion` already exists - do we need this separate `switch` statement?

    ```c++
    auto data_type = output_tensor_desc.GetDataType();
    clamp_operator_desc.Min = ToScalarUnion(clamp->min_value, data_type);
    clamp_operator_desc.Max = ToScalarUnion(clamp->max_value, data_type);
    ```

    Lisha Guo

    Hmm, when FL < 5.0, I suppose `clamp_operator_desc.Min` can't accept a `DML_SCALAR_UNION`.

    Dwayne Robinson

    Doh, yes, lines 1710 and 1713 already handle the `DML_FEATURE_LEVEL_5_0` case.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Lisha Guo
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ibe63d38b9e617b98fb01fb877a55a73053c1c353
    Gerrit-Change-Number: 6565815
    Gerrit-PatchSet: 21
    Gerrit-Owner: Lisha Guo <lish...@intel.com>
    Gerrit-Reviewer: Austin Sullivan <asu...@chromium.org>
    Gerrit-Reviewer: Lisha Guo <lish...@intel.com>
    Gerrit-Reviewer: ningxin hu <ningx...@intel.com>
    Gerrit-CC: Dwayne Robinson <dwa...@microsoft.com>
    Gerrit-CC: Jiewei Qian <q...@chromium.org>
    Gerrit-CC: Junwei Fu <junw...@intel.com>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Phillis Tang <phi...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-CC: Reilly Grant <rei...@chromium.org>
    Gerrit-CC: Shiyi Zou <shiy...@intel.com>
    Gerrit-Attention: Lisha Guo <lish...@intel.com>
    Gerrit-Comment-Date: Wed, 04 Jun 2025 21:09:52 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Dwayne Robinson <dwa...@microsoft.com>
    Comment-In-Reply-To: Lisha Guo <lish...@intel.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Lisha Guo (Gerrit)

    unread,
    Jun 5, 2025, 1:36:14 AMJun 5
    to Phillis Tang, Austin Sullivan, Reilly Grant, Dwayne Robinson, AyeAye, ningxin hu, Junwei Fu, Chromium LUCI CQ, Shiyi Zou, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, Jiewei Qian, mac-r...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Austin Sullivan

    Lisha Guo added 3 comments

    File services/webnn/public/cpp/ml_number.h
    Line 17, Patchset 17:class COMPONENT_EXPORT(WEBNN_PUBLIC_CPP) MLNumber {
    Austin Sullivan . unresolved

    Let's consider adding unit tests for this class? Most things here are straightforward but it would be nice to have some coverage for the non-trivial methods like `IsGreaterThan` and handling of infinities

    Lisha Guo

    Sure. I will add related unit tests for the non-trivial methods.

    Lisha Guo

    Added `ml_number_unittest.cc` to cover more methods. PTAL. Thanks!

    File third_party/blink/renderer/platform/bindings/bigint.cc
    Line 53, Patchset 17: !base::IsValueInRangeForNumericType<uint8_t>(words_[0])) {
    Austin Sullivan . resolved

    Hmm why is is that we're only checking this for the unsigned types?

    Lisha Guo
    For signed types, we need to check the valid range according to 'sign_bits_`. For example,
    ```
    if (sign_bit_) {
    if (value >
    static_cast<uint64_t>(std::abs(std::numeric_limits<int8_t>::min()))) {
    return std::nullopt;
    }
    } else {
    if (value > static_cast<uint64_t>(std::numeric_limits<int8_t>::max())) {
    return std::nullopt;
    }
    ```

    Am I right?

    Austin Sullivan

    Ah right. Thoughts on pulling this out into a templated helper? Something like this:

    ```
    template <typename DstT>
    requires(std::is_signed_v<DstT> && std::is_integral_v<DstT>)
    std::optional<DstT> GetValueIfInRange(uint64_t value, bool is_negative) {
    if (is_negative) {
    if (value >
    static_cast<uint64_t>(std::abs(std::numeric_limits<DstT>::min()))) {
    return std::nullopt;
    }
    return -static_cast<DstT>(value);
    }
      if (value > static_cast<uint64_t>(std::numeric_limits<DstT>::max())) {
    return std::nullopt;
    }
    return static_cast<DstT>(value);
    }
    ```
    Lisha Guo

    Done

    File third_party/blink/web_tests/platform/mac-mac15-arm64/virtual/webnn-service-on-cpu/external/wpt/webnn/conformance_tests/clamp.https.any_cpu-expected.txt
    Line 25, Patchset 17:[FAIL] minValue as Infinity
    promise_test: Unhandled rejection with value: object "UnknownError: Failed to execute 'build' on 'MLGraphBuilder': Model compilation error."
    Austin Sullivan . resolved

    Hmm ideally we shouldn't be running into model compilation errors. Do you know what's causing this?

    Lisha Guo

    I also see these model compilation errors, and it only appears on macOS. Since I don't have a Mac machine at hand, I haven't found the reason yet.

    Lisha Guo

    All these fail test cases with model compilation errors all set the same minValue and maxValue. It seems CoreML can't support same minValue and maxValue for clamp.

    Lisha Guo

    We can use `min` and `max` to emulation for these case. @phi...@chromium.org WDYT?

    Phillis Tang

    SG, you can create a crbug for that.

    Lisha Guo

    related [issue](https://issues.chromium.org/issues/421927615) has been created. And I suppose we can create another new CL to solve this issue.

    Austin Sullivan

    Ack. Let's tag that bug to the CL footer?

    Lisha Guo

    Ack. Let's tag that bug to the CL footer?

    How about leave a TODO in `graph_builder_coreml.cc` file instead of tagging this bug to the CL footer since I intend to solve this bug in another CL?

    Austin Sullivan

    Sure, that works too

    Lisha Guo

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Austin Sullivan
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ibe63d38b9e617b98fb01fb877a55a73053c1c353
    Gerrit-Change-Number: 6565815
    Gerrit-PatchSet: 22
    Gerrit-Owner: Lisha Guo <lish...@intel.com>
    Gerrit-Reviewer: Austin Sullivan <asu...@chromium.org>
    Gerrit-Reviewer: Lisha Guo <lish...@intel.com>
    Gerrit-Reviewer: ningxin hu <ningx...@intel.com>
    Gerrit-CC: Dwayne Robinson <dwa...@microsoft.com>
    Gerrit-CC: Jiewei Qian <q...@chromium.org>
    Gerrit-CC: Junwei Fu <junw...@intel.com>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Phillis Tang <phi...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-CC: Reilly Grant <rei...@chromium.org>
    Gerrit-CC: Shiyi Zou <shiy...@intel.com>
    Gerrit-Attention: Austin Sullivan <asu...@chromium.org>
    Gerrit-Comment-Date: Thu, 05 Jun 2025 05:35:59 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Austin Sullivan (Gerrit)

    unread,
    Jun 5, 2025, 12:39:03 PMJun 5
    to Lisha Guo, Phillis Tang, Reilly Grant, Dwayne Robinson, AyeAye, ningxin hu, Junwei Fu, Chromium LUCI CQ, Shiyi Zou, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, Jiewei Qian, mac-r...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Lisha Guo

    Austin Sullivan added 3 comments

    File services/webnn/public/cpp/ml_number.h
    Line 17, Patchset 17:class COMPONENT_EXPORT(WEBNN_PUBLIC_CPP) MLNumber {
    Austin Sullivan . resolved

    Let's consider adding unit tests for this class? Most things here are straightforward but it would be nice to have some coverage for the non-trivial methods like `IsGreaterThan` and handling of infinities

    Lisha Guo

    Sure. I will add related unit tests for the non-trivial methods.

    Lisha Guo

    Added `ml_number_unittest.cc` to cover more methods. PTAL. Thanks!

    Austin Sullivan

    LGTM % a couple comments. Thanks!

    File services/webnn/public/cpp/ml_number_unittest.cc
    Line 11, Patchset 23 (Latest):class MLNumberTest : public testing::Test {};
    Austin Sullivan . unresolved

    Since this class isn't doing anything, you could alternatively remove it and use `TEST` instead of `TEST_F`

    Line 127, Patchset 23 (Latest):
    TEST_F(MLNumberTest, IsGreaterThanForFloat16) {
    MLNumber a = MLNumber::FromFloat16(12324);
    MLNumber b = MLNumber::FromFloat16(-3421);
    EXPECT_TRUE(a.IsGreaterThan(b, OperandDataType::kFloat16));
    EXPECT_FALSE(b.IsGreaterThan(a, OperandDataType::kFloat16));
    }
    Austin Sullivan . unresolved

    Let's also test float vs int comparisions?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Lisha Guo
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ibe63d38b9e617b98fb01fb877a55a73053c1c353
    Gerrit-Change-Number: 6565815
    Gerrit-PatchSet: 23
    Gerrit-Owner: Lisha Guo <lish...@intel.com>
    Gerrit-Reviewer: Austin Sullivan <asu...@chromium.org>
    Gerrit-Reviewer: Lisha Guo <lish...@intel.com>
    Gerrit-Reviewer: ningxin hu <ningx...@intel.com>
    Gerrit-CC: Dwayne Robinson <dwa...@microsoft.com>
    Gerrit-CC: Jiewei Qian <q...@chromium.org>
    Gerrit-CC: Junwei Fu <junw...@intel.com>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Phillis Tang <phi...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-CC: Reilly Grant <rei...@chromium.org>
    Gerrit-CC: Shiyi Zou <shiy...@intel.com>
    Gerrit-Attention: Lisha Guo <lish...@intel.com>
    Gerrit-Comment-Date: Thu, 05 Jun 2025 16:38:54 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Austin Sullivan <asu...@chromium.org>
    Comment-In-Reply-To: Lisha Guo <lish...@intel.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Lisha Guo (Gerrit)

    unread,
    Jun 6, 2025, 4:31:03 AMJun 6
    to Phillis Tang, Austin Sullivan, Reilly Grant, Dwayne Robinson, AyeAye, ningxin hu, Junwei Fu, Chromium LUCI CQ, Shiyi Zou, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, Jiewei Qian, mac-r...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Austin Sullivan

    Lisha Guo added 1 comment

    File third_party/blink/renderer/platform/bindings/bigint.h
    Line 58, Patchset 17: // Best-effort cast to a double. This is generally not recommended.
    double ToDoubleLossy() const;
    Austin Sullivan . unresolved

    Let's add unit tests for this class, too? Especially for this method

    Lisha Guo

    Sure. I will add related unit tests.

    Lisha Guo
    As I understand, if we want to add unit tests here for bigint, we need to construct a `bigint` firstly something like below
    ```
    int64_t data = 123;
    v8::Local<v8::BigInt> v8_bigint = v8::BigInt::New(isolate, data);
    BigInt bigint(v8_bigint);
    ```
    When try to construct a V8 object, we need a `v8::isolate`. For `blink_platform_unittests`, I tried several way to get `v8::isolate`. However, they all failed.
    ```
    V8TestingScope scope;
    v8::Isolate* isolate = scope.GetIsolate();
    ```
    or
    ```
    test::TaskEnvironment task_environment_;
    v8::Isolate* isolate = task_environment_.isolate();
    ```
    It seems `blink_platform_unittests` lacks of v8 enviroment to construct a v8 object. But it's easy to create for `blink_unittests`. I also tried to load V8 using `gin::V8Initializer::LoadV8Snapshot(kSnapshotType);` it also failed.
    @asu...@chromium.org Did I miss something important for `blink_platform_unittests`.
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Austin Sullivan
    Gerrit-Attention: Austin Sullivan <asu...@chromium.org>
    Gerrit-Comment-Date: Fri, 06 Jun 2025 08:30:51 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    ningxin hu (Gerrit)

    unread,
    Jun 9, 2025, 3:37:14 AMJun 9
    to Lisha Guo, Phillis Tang, Austin Sullivan, Reilly Grant, Dwayne Robinson, AyeAye, Junwei Fu, Chromium LUCI CQ, Shiyi Zou, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, Jiewei Qian, mac-r...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Austin Sullivan and Lisha Guo

    ningxin hu added 6 comments

    File third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.cc
    Line 8, Patchset 23 (Latest):#include <iostream>
    ningxin hu . unresolved

    Is this header necessary?

    File third_party/blink/renderer/modules/ml/webnn/ml_graph_type_converter.cc
    Line 9, Patchset 23 (Latest):#include <iostream>
    ningxin hu . unresolved

    Is this header necessary?

    Line 1529, Patchset 23 (Latest): case webnn::OperandDataType::kFloat32:
    // Implicit double -> float conversion.
    return webnn::MLNumber::FromFloat32(bigint.ToDoubleLossy());
    case webnn::OperandDataType::kFloat16:
    // double (-> float, implicitly) -> fp16 (as uint16_t).
    return webnn::MLNumber::FromFloat16(
    fp16_ieee_from_fp32_value(bigint.ToDoubleLossy()));

    case webnn::OperandDataType::kInt32: {
    if (auto int32 = bigint.ToInt32()) {
    return webnn::MLNumber::FromInt32(*int32);
    } else {
    return webnn::MLNumber::FromInt32(
    bigint.IsNegative() ? std::numeric_limits<int32_t>::min()
    : std::numeric_limits<int32_t>::max());
    }
    }
    case webnn::OperandDataType::kUint32: {
    if (auto uint32 = bigint.ToUInt32()) {
    return webnn::MLNumber::FromUint32(*uint32);
    } else {
    return webnn::MLNumber::FromUint32(
    bigint.IsNegative() ? std::numeric_limits<uint32_t>::min()
    : std::numeric_limits<uint32_t>::max());
    }
    }
    ningxin hu . unresolved

    Should we report an error? I suppose user code should only use BigInt for "int64" and "uint64" data types.

    Line 1614, Patchset 23 (Latest): case webnn::OperandDataType::kInt64:
    return webnn::MLNumber::FromInt64(
    base::saturated_cast<int64_t>(unrestricted_double));
    case webnn::OperandDataType::kUint64:
    return webnn::MLNumber::FromUint64(
    base::saturated_cast<uint64_t>(unrestricted_double));
    ningxin hu . unresolved

    Same here, should we report an error? Number should not be used for "int64" and "uint64" data types?

    Line 1598, Patchset 23 (Latest): const double unrestricted_double = number.GetAsUnrestrictedDouble();
    switch (type) {
    case webnn::OperandDataType::kFloat32:
    // Implicit double -> float conversion.
    return webnn::MLNumber::FromFloat32(unrestricted_double);
    case webnn::OperandDataType::kFloat16:
    // double (-> float, implicitly) -> fp16 (as uint16_t).
    return webnn::MLNumber::FromFloat16(
    fp16_ieee_from_fp32_value(unrestricted_double));

    case webnn::OperandDataType::kInt32:
    return webnn::MLNumber::FromInt32(
    base::saturated_cast<int32_t>(unrestricted_double));
    case webnn::OperandDataType::kUint32:
    return webnn::MLNumber::FromUint32(
    base::saturated_cast<uint32_t>(unrestricted_double));
    case webnn::OperandDataType::kInt64:
    return webnn::MLNumber::FromInt64(
    base::saturated_cast<int64_t>(unrestricted_double));
    case webnn::OperandDataType::kUint64:
    return webnn::MLNumber::FromUint64(
    base::saturated_cast<uint64_t>(unrestricted_double));
    case webnn::OperandDataType::kInt8:
    return webnn::MLNumber::FromInt8(
    base::saturated_cast<int8_t>(unrestricted_double));
    case webnn::OperandDataType::kUint8:
    return webnn::MLNumber::FromUint8(
    base::saturated_cast<uint8_t>(unrestricted_double));
    case webnn::OperandDataType::kInt4:
    case webnn::OperandDataType::kUint4:
    NOTREACHED();
    }
    ningxin hu . unresolved
    Could we just construct a `webnn::Number` with the `unrestricted_double` value? `webnn::Number` can hold a double and convert to destination data types at the backends. Conversions here seem to be unnecessary. Did I miss anything?
    ```suggestion
    return webnn::MLNumber::FromFloat64(number.GetAsUnrestrictedDouble());
    ```
    File third_party/blink/renderer/platform/bindings/bigint.cc
    Line 128, Patchset 23 (Latest): pow(18446744073709551616.0, i);
    ningxin hu . unresolved

    Use `std::numeric_limits<uint64_t>::max() + 1`?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Austin Sullivan
    • Lisha Guo
    Gerrit-Attention: Lisha Guo <lish...@intel.com>
    Gerrit-Comment-Date: Mon, 09 Jun 2025 07:37:05 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Dwayne Robinson (Gerrit)

    unread,
    Jun 9, 2025, 8:34:10 PMJun 9
    to Lisha Guo, Phillis Tang, Austin Sullivan, Reilly Grant, AyeAye, ningxin hu, Junwei Fu, Chromium LUCI CQ, Shiyi Zou, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, Jiewei Qian, mac-r...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Austin Sullivan and Lisha Guo

    Dwayne Robinson added 2 comments

    File third_party/blink/renderer/modules/ml/webnn/ml_graph_type_converter.cc
    Line 1529, Patchset 23 (Latest): case webnn::OperandDataType::kFloat32:
    // Implicit double -> float conversion.
    return webnn::MLNumber::FromFloat32(bigint.ToDoubleLossy());
    case webnn::OperandDataType::kFloat16:
    // double (-> float, implicitly) -> fp16 (as uint16_t).
    return webnn::MLNumber::FromFloat16(
    fp16_ieee_from_fp32_value(bigint.ToDoubleLossy()));

    case webnn::OperandDataType::kInt32: {
    if (auto int32 = bigint.ToInt32()) {
    return webnn::MLNumber::FromInt32(*int32);
    } else {
    return webnn::MLNumber::FromInt32(
    bigint.IsNegative() ? std::numeric_limits<int32_t>::min()
    : std::numeric_limits<int32_t>::max());
    }
    }
    case webnn::OperandDataType::kUint32: {
    if (auto uint32 = bigint.ToUInt32()) {
    return webnn::MLNumber::FromUint32(*uint32);
    } else {
    return webnn::MLNumber::FromUint32(
    bigint.IsNegative() ? std::numeric_limits<uint32_t>::min()
    : std::numeric_limits<uint32_t>::max());
    }
    }
    ningxin hu . unresolved

    Should we report an error? I suppose user code should only use BigInt for "int64" and "uint64" data types.

    Dwayne Robinson

    This is great that a user can easily pass an ordinary Number for int64 tensors (which helps generic caller code regardless of the tensor type, such as a lower bound to `clamp`), instead of needing to clumsily work-around that awkward faux pas of Javascript where int64 usage needs to use a completely different and incompatible type from all other JS math.

    Dwayne Robinson

    It's robust that all this saturation logic is consolidated in one place, rather than each backend needing to gingerly consistently replicate it (subject to their own truncation logic).

    Gerrit-Comment-Date: Tue, 10 Jun 2025 00:34:00 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: ningxin hu <ningx...@intel.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    ningxin hu (Gerrit)

    unread,
    Jun 9, 2025, 9:28:54 PMJun 9
    to Lisha Guo, Phillis Tang, Austin Sullivan, Reilly Grant, Dwayne Robinson, AyeAye, Junwei Fu, Chromium LUCI CQ, Shiyi Zou, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, Jiewei Qian, mac-r...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Austin Sullivan and Lisha Guo

    ningxin hu added 2 comments

    File third_party/blink/renderer/modules/ml/webnn/ml_graph_type_converter.cc

    needing to clumsily work-around that awkward faux pas of Javascript where int64 usage needs to use a completely different and incompatible type from all other JS math.

    I suppose this is JavaScript convention. For example you have to use BigInt for BigInt64Array/BigUint64Array. For all other typed arrays, you just use Number.

    Because MLNumber is just a union of BigInt and Number, it would be good that user can specify its usage explicitly: BigInt for "int64" and "uint64", Number for all the others. We also check the type of typed array when passing it to `MLGraphBuilder.constant()`.

    It's robust that all this saturation logic is consolidated in one place

    I agreed. I meant backends can use `webnn::MLNumber::As<DstType>()`. Because the `webnn::Number` actually carries the `std::variant<double, int64_t, uint64_t> number_`, I suppose conversion during the construction is unnecessary.

    Gerrit-Comment-Date: Tue, 10 Jun 2025 01:28:44 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Dwayne Robinson <dwa...@microsoft.com>
    Comment-In-Reply-To: ningxin hu <ningx...@intel.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Dwayne Robinson (Gerrit)

    unread,
    Jun 9, 2025, 11:08:09 PMJun 9
    to Lisha Guo, Phillis Tang, Austin Sullivan, Reilly Grant, AyeAye, ningxin hu, Junwei Fu, Chromium LUCI CQ, Shiyi Zou, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, Jiewei Qian, mac-r...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Austin Sullivan and Lisha Guo

    Dwayne Robinson added 3 comments

    Patchset-level comments
    File-level comment, Patchset 23 (Latest):
    Dwayne Robinson . resolved

    👀

    File third_party/blink/renderer/modules/ml/webnn/ml_graph_type_converter.cc
    Dwayne Robinson

    Consider the following generic caller code, which returns a new tensor (be it int32, int64, float32...) with the bounds between 0 and 6.

    ```js
    function emulateRelu6(graphBuilder, inputTensor)
    {
    return graphBuilder.clamp(inputTensor, {minValue: 0, maxValue: 6});
    }
    function multiplyByTwo(graphBuilder, inputTensor)
    {
    const twoFactor = graphBuilder.constant(inputTensor.dataType, 2);
    return graphBuilder.mul(inputTensor, twoFactor);
    }
    ```

    With such a requirement imposed, then it would have to be more like...

    ```js
    function emulateRelu6(graphBuilder, inputTensor)
    {
    bool is64BitDataType = (inputTensor.dataType == "uint64")
    || (inputTensor.dataType == "int64");
    return graphBuilder.clamp(
    inputTensor,
    {
    minValue: is64BitDataType ? 0: 0n,
    maxValue: is64BitDataType ? 6: 6n
    }
    );
    }

    function multiplyByTwo(graphBuilder, inputTensor) ...
    ```

    ...which makes WebNN a clumsier API for callers.

    Another reason to support `Number` for `minValue` and `maxValue` with int64 tensors is compat. Before, `clamp` took float32 `minValue` and `maxValue`, and generic code would work okay with {int8, int32, **int64**, float32} tensors, and of course, not all possible int64 values were expressible (which is why `MLNumber` was added), but of the subset of int64 values that *were* expressible, you could pass them in generically (like relu6's 0 and 6), and such code would still work after Lisha's change.

    The last reason is regularity. Wouldn't it be really weird if say the "int8" data type required a special literal suffix? e.g.:

    ```js
    graphBuilder.constant("int8" , 42c); // <<<<
    graphBuilder.constant("int16", 42);
    graphBuilder.constant("int32", 42);
    graphBuilder.constant("int64", 42);
    ```

    Conversely, if that is weird, then it's also weird that int64 requires a different literal suffix:

    ```
    graphBuilder.constant("int8" , 42);
    graphBuilder.constant("int16", 42);
    graphBuilder.constant("int32", 42);
    graphBuilder.constant("int64", 42n); // <<<<
    ```

    We just might not see it as weird because we've become used to (and blind to) it's aberrance, but it increases the coupling between separate things (the dataType string and its value.

    So, I welcome potential simplifications to this conversion function, but from the WebNN caller perspective, this *would* be niceness 😉.

    Dwayne Robinson

    suppose conversion during the construction is unnecessary

    True. As long as this saturation functionality is still consolidated and easily callable from each of backends (if a backend wants to coerce from float32 to float32), then I don't mind deferring that saturation until later.

    Gerrit-Comment-Date: Tue, 10 Jun 2025 03:07:58 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Lisha Guo (Gerrit)

    unread,
    Jun 9, 2025, 11:37:55 PMJun 9
    to Phillis Tang, Austin Sullivan, Reilly Grant, Dwayne Robinson, AyeAye, ningxin hu, Junwei Fu, Chromium LUCI CQ, Shiyi Zou, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, Jiewei Qian, mac-r...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Austin Sullivan, Dwayne Robinson and ningxin hu

    Lisha Guo added 1 comment

    File third_party/blink/renderer/modules/ml/webnn/ml_graph_type_converter.cc
    Lisha Guo

    This method is used for comparing `min` and `max` value by `isGreaterThan()` method in `ml_graph_builder.cc` file. Currently, webnn doesn't support float64 data type.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Austin Sullivan
    • Dwayne Robinson
    • ningxin hu
    Gerrit-Attention: Dwayne Robinson <dwa...@microsoft.com>
    Gerrit-Attention: Austin Sullivan <asu...@chromium.org>
    Gerrit-Attention: ningxin hu <ningx...@intel.com>
    Gerrit-Comment-Date: Tue, 10 Jun 2025 03:37:38 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    ningxin hu (Gerrit)

    unread,
    Jun 10, 2025, 1:36:07 AMJun 10
    to Lisha Guo, Phillis Tang, Austin Sullivan, Reilly Grant, Dwayne Robinson, AyeAye, Junwei Fu, Chromium LUCI CQ, Shiyi Zou, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, Jiewei Qian, mac-r...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Austin Sullivan, Dwayne Robinson and Lisha Guo

    ningxin hu added 3 comments

    File third_party/blink/renderer/modules/ml/webnn/ml_graph_type_converter.cc
    Line 1529, Patchset 23 (Latest): case webnn::OperandDataType::kFloat32:

    // Implicit double -> float conversion.
    return webnn::MLNumber::FromFloat32(bigint.ToDoubleLossy());

    case webnn::OperandDataType::kFloat16:
    // double (-> float, implicitly) -> fp16 (as uint16_t).
    return webnn::MLNumber::FromFloat16(
    ningxin hu

    @dwa...@microsoft.com

    generic code would work okay with {int8, int32, int64, float32} tensors

    I agreed. My comment here is more about BigInt usage. I propose we should restrict BigInt is only used for "int64" and "uint64", when users want to set the values larger than Number.MAX_SAFE_INTEGER. I don't think using BigInt for other data types, like "float32", makes much sense.

    It would also help to simplify the BigInt modification in this CL, it doesn't require to implement `ToInt8()`, `ToInt32()`, `ToUInt8()`, `ToUInt32()` and `ToDoubleLossy()`.

    Line 1614, Patchset 23 (Latest): case webnn::OperandDataType::kInt64:

    return webnn::MLNumber::FromInt64(
    base::saturated_cast<int64_t>(unrestricted_double));
    case webnn::OperandDataType::kUint64:
    return webnn::MLNumber::FromUint64(
    base::saturated_cast<uint64_t>(unrestricted_double));
    ningxin hu . resolved

    Same here, should we report an error? Number should not be used for "int64" and "uint64" data types?

    ningxin hu

    Resolving this comment, as I agreed with @dwa...@microsoft.com, allowing Number for "int64" and "uint64" would be useful.

    ningxin hu

    `IsGreaterThan()` is a `webnn::MLNumber` method. It convert to destination data type for comparison internally: https://chromium-review.googlesource.com/c/chromium/src/+/6565815/23/services/webnn/public/cpp/ml_number.cc#102

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Austin Sullivan
    • Dwayne Robinson
    • Lisha Guo
    Gerrit-Attention: Lisha Guo <lish...@intel.com>
    Gerrit-Comment-Date: Tue, 10 Jun 2025 05:35:57 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Dwayne Robinson <dwa...@microsoft.com>
    Comment-In-Reply-To: ningxin hu <ningx...@intel.com>
    Comment-In-Reply-To: Lisha Guo <lish...@intel.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Dwayne Robinson (Gerrit)

    unread,
    Jun 10, 2025, 2:07:06 AMJun 10
    to Lisha Guo, Phillis Tang, Austin Sullivan, Reilly Grant, AyeAye, ningxin hu, Junwei Fu, Chromium LUCI CQ, Shiyi Zou, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, Jiewei Qian, mac-r...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Austin Sullivan and Lisha Guo

    Dwayne Robinson added 2 comments

    Patchset-level comments
    Dwayne Robinson . resolved

    👍

    File third_party/blink/renderer/modules/ml/webnn/ml_graph_type_converter.cc
    Dwayne Robinson

    I propose we should restrict BigInt is only used for "int64" and "uint64" ... I don't think using BigInt for other data types, like "float32", makes much sense.

    Hmm, well it's nice to be generic and symmetric (because someone could pass `BigInt(42n)`, which is perfectly representable as `float32`), but yeah, I don't really care about that case, because if someone *explicitly* passed `BigInt`, then it's quite likely it's because they also passed an int64 tensor anyway. Proposal = 👍.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Austin Sullivan
    • Lisha Guo
    Gerrit-Attention: Austin Sullivan <asu...@chromium.org>
    Gerrit-Attention: Lisha Guo <lish...@intel.com>
    Gerrit-Comment-Date: Tue, 10 Jun 2025 06:06:57 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Lisha Guo (Gerrit)

    unread,
    Jun 10, 2025, 3:04:04 AMJun 10
    to Phillis Tang, Austin Sullivan, Reilly Grant, Dwayne Robinson, AyeAye, ningxin hu, Junwei Fu, Chromium LUCI CQ, Shiyi Zou, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, Jiewei Qian, mac-r...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Austin Sullivan, Dwayne Robinson and ningxin hu

    Lisha Guo added 2 comments

    File third_party/blink/renderer/modules/ml/webnn/ml_graph_type_converter.cc
    Lisha Guo
     I propose we should restrict BigInt is only used for "int64" and "uint64", when users want to set the values larger than Number.MAX_SAFE_INTEGER. 

    Sounds good. @asu...@chromium.org WDYT?

    const double unrestricted_double = number.GetAsUnrestrictedDouble();
    switch (type) {

    case webnn::OperandDataType::kFloat32:
    // Implicit double -> float conversion.
    return webnn::MLNumber::FromFloat32(unrestricted_double);

    case webnn::OperandDataType::kFloat16:
    // double (-> float, implicitly) -> fp16 (as uint16_t).
    return webnn::MLNumber::FromFloat16(
    Lisha Guo
     It convert to destination data type for comparison internally...

    You are right. Agree to just return `webnn::MLNumber::FromFloat64(number.GetAsUnrestrictedDouble());` for double.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Austin Sullivan
    • Dwayne Robinson
    • ningxin hu
    Gerrit-Attention: Dwayne Robinson <dwa...@microsoft.com>
    Gerrit-Attention: Austin Sullivan <asu...@chromium.org>
    Gerrit-Attention: ningxin hu <ningx...@intel.com>
    Gerrit-Comment-Date: Tue, 10 Jun 2025 07:03:51 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Dwayne Robinson <dwa...@microsoft.com>
    Comment-In-Reply-To: ningxin hu <ningx...@intel.com>
    Comment-In-Reply-To: Lisha Guo <lish...@intel.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Austin Sullivan (Gerrit)

    unread,
    Jun 17, 2025, 7:03:52 PMJun 17
    to Lisha Guo, Phillis Tang, Reilly Grant, Dwayne Robinson, AyeAye, ningxin hu, Junwei Fu, Chromium LUCI CQ, Shiyi Zou, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, Jiewei Qian, mac-r...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Dwayne Robinson, Lisha Guo and ningxin hu

    Austin Sullivan added 3 comments

    Patchset-level comments
    Austin Sullivan . resolved

    Apologies for the delay!

    File third_party/blink/renderer/modules/ml/webnn/ml_graph_type_converter.cc
    Austin Sullivan

    I was trying to remember why I had initially decided that we should be able to convert a `BigInt` to any other data type, and I think the primary reason was because at that time `clamp()` was an `MLActivation` and [the data type of an `MLActivation` depended on the operator it was passed to](https://github.com/webmachinelearning/webnn/pull/647#discussion_r1571435646)

    But `MLActivation` doesn't exist anymore, so AFAIK we don't _need_ this functionality. You could argue it would be nice to have and I acknowledge the concern from @dwa...@microsoft.com that this may lead to uglier code from callers, but I'd lean towards removing it. Removal would simplify this CL and we could easily add this functionality back later if needed

    File third_party/blink/renderer/platform/bindings/bigint.h
    Line 58, Patchset 17: // Best-effort cast to a double. This is generally not recommended.
    double ToDoubleLossy() const;
    Austin Sullivan . unresolved

    Let's add unit tests for this class, too? Especially for this method

    Lisha Guo

    Sure. I will add related unit tests.

    Lisha Guo
    As I understand, if we want to add unit tests here for bigint, we need to construct a `bigint` firstly something like below
    ```
    int64_t data = 123;
    v8::Local<v8::BigInt> v8_bigint = v8::BigInt::New(isolate, data);
    BigInt bigint(v8_bigint);
    ```
    When try to construct a V8 object, we need a `v8::isolate`. For `blink_platform_unittests`, I tried several way to get `v8::isolate`. However, they all failed.
    ```
    V8TestingScope scope;
    v8::Isolate* isolate = scope.GetIsolate();
    ```
    or
    ```
    test::TaskEnvironment task_environment_;
    v8::Isolate* isolate = task_environment_.isolate();
    ```
    It seems `blink_platform_unittests` lacks of v8 enviroment to construct a v8 object. But it's easy to create for `blink_unittests`. I also tried to load V8 using `gin::V8Initializer::LoadV8Snapshot(kSnapshotType);` it also failed.
    @asu...@chromium.org Did I miss something important for `blink_platform_unittests`.
    Austin Sullivan

    These tests are no longer needed if we only support `BigInt` for 64-bit ints

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Dwayne Robinson
    • Lisha Guo
    • ningxin hu
    Gerrit-Attention: ningxin hu <ningx...@intel.com>
    Gerrit-Attention: Lisha Guo <lish...@intel.com>
    Gerrit-Comment-Date: Tue, 17 Jun 2025 23:03:40 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Dwayne Robinson <dwa...@microsoft.com>
    Comment-In-Reply-To: Austin Sullivan <asu...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Lisha Guo (Gerrit)

    unread,
    Jun 25, 2025, 3:38:24 AMJun 25
    to ningxin hu, Phillis Tang, Austin Sullivan, Reilly Grant, Dwayne Robinson, AyeAye, Junwei Fu, Chromium LUCI CQ, Shiyi Zou, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, Jiewei Qian, mac-r...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Austin Sullivan, Dwayne Robinson and ningxin hu

    Lisha Guo added 8 comments

    File services/webnn/public/cpp/ml_number_unittest.cc
    Line 11, Patchset 23:class MLNumberTest : public testing::Test {};
    Austin Sullivan . resolved

    Since this class isn't doing anything, you could alternatively remove it and use `TEST` instead of `TEST_F`


    TEST_F(MLNumberTest, IsGreaterThanForFloat16) {
    MLNumber a = MLNumber::FromFloat16(12324);
    MLNumber b = MLNumber::FromFloat16(-3421);
    EXPECT_TRUE(a.IsGreaterThan(b, OperandDataType::kFloat16));
    EXPECT_FALSE(b.IsGreaterThan(a, OperandDataType::kFloat16));
    }
    Austin Sullivan . resolved

    Let's also test float vs int comparisions?

    Lisha Guo

    Done

    File third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.cc
    Line 8, Patchset 23:#include <iostream>
    ningxin hu . resolved

    Is this header necessary?

    Lisha Guo

    Done

    File third_party/blink/renderer/modules/ml/webnn/ml_graph_type_converter.cc
    Line 9, Patchset 23:#include <iostream>
    ningxin hu . resolved

    Is this header necessary?

    Lisha Guo

    Done

    Line 1529, Patchset 23: case webnn::OperandDataType::kFloat32:
    Lisha Guo

    Restrict BigInt is only used for "int64" and "uint64" in latest CL.

    Line 1598, Patchset 23: const double unrestricted_double = number.GetAsUnrestrictedDouble();
    switch (type) {

    case webnn::OperandDataType::kFloat32:
    // Implicit double -> float conversion.
    return webnn::MLNumber::FromFloat32(unrestricted_double);

    case webnn::OperandDataType::kFloat16:
    // double (-> float, implicitly) -> fp16 (as uint16_t).
    return webnn::MLNumber::FromFloat16(
    fp16_ieee_from_fp32_value(unrestricted_double));

    case webnn::OperandDataType::kInt32:
    return webnn::MLNumber::FromInt32(
    base::saturated_cast<int32_t>(unrestricted_double));
    case webnn::OperandDataType::kUint32:
    return webnn::MLNumber::FromUint32(
    base::saturated_cast<uint32_t>(unrestricted_double));
    case webnn::OperandDataType::kInt64:
    return webnn::MLNumber::FromInt64(
    base::saturated_cast<int64_t>(unrestricted_double));
    case webnn::OperandDataType::kUint64:
    return webnn::MLNumber::FromUint64(
    base::saturated_cast<uint64_t>(unrestricted_double));
    case webnn::OperandDataType::kInt8:
    return webnn::MLNumber::FromInt8(
    base::saturated_cast<int8_t>(unrestricted_double));
    case webnn::OperandDataType::kUint8:
    return webnn::MLNumber::FromUint8(
    base::saturated_cast<uint8_t>(unrestricted_double));
    case webnn::OperandDataType::kInt4:
    case webnn::OperandDataType::kUint4:
    NOTREACHED();
    }
    ningxin hu . resolved
    Could we just construct a `webnn::Number` with the `unrestricted_double` value? `webnn::Number` can hold a double and convert to destination data types at the backends. Conversions here seem to be unnecessary. Did I miss anything?
    ```suggestion
    return webnn::MLNumber::FromFloat64(number.GetAsUnrestrictedDouble());
    ```
    Dwayne Robinson

    It's robust that all this saturation logic is consolidated in one place, rather than each backend needing to gingerly consistently replicate it (subject to their own truncation logic).

    ningxin hu

    @dwa...@microsoft.com

    It's robust that all this saturation logic is consolidated in one place

    I agreed. I meant backends can use `webnn::MLNumber::As<DstType>()`. Because the `webnn::Number` actually carries the `std::variant<double, int64_t, uint64_t> number_`, I suppose conversion during the construction is unnecessary.

    Dwayne Robinson

    suppose conversion during the construction is unnecessary

    True. As long as this saturation functionality is still consolidated and easily callable from each of backends (if a backend wants to coerce from float32 to float32), then I don't mind deferring that saturation until later.

    Lisha Guo

    This method is used for comparing `min` and `max` value by `isGreaterThan()` method in `ml_graph_builder.cc` file. Currently, webnn doesn't support float64 data type.

    ningxin hu

    `IsGreaterThan()` is a `webnn::MLNumber` method. It convert to destination data type for comparison internally: https://chromium-review.googlesource.com/c/chromium/src/+/6565815/23/services/webnn/public/cpp/ml_number.cc#102

    Lisha Guo
     It convert to destination data type for comparison internally...

    You are right. Agree to just return `webnn::MLNumber::FromFloat64(number.GetAsUnrestrictedDouble());` for double.

    Lisha Guo

    Done

    File third_party/blink/renderer/platform/bindings/bigint.h
    Line 58, Patchset 17: // Best-effort cast to a double. This is generally not recommended.
    double ToDoubleLossy() const;
    Austin Sullivan . resolved

    Let's add unit tests for this class, too? Especially for this method

    Lisha Guo

    Sure. I will add related unit tests.

    Lisha Guo
    As I understand, if we want to add unit tests here for bigint, we need to construct a `bigint` firstly something like below
    ```
    int64_t data = 123;
    v8::Local<v8::BigInt> v8_bigint = v8::BigInt::New(isolate, data);
    BigInt bigint(v8_bigint);
    ```
    When try to construct a V8 object, we need a `v8::isolate`. For `blink_platform_unittests`, I tried several way to get `v8::isolate`. However, they all failed.
    ```
    V8TestingScope scope;
    v8::Isolate* isolate = scope.GetIsolate();
    ```
    or
    ```
    test::TaskEnvironment task_environment_;
    v8::Isolate* isolate = task_environment_.isolate();
    ```
    It seems `blink_platform_unittests` lacks of v8 enviroment to construct a v8 object. But it's easy to create for `blink_unittests`. I also tried to load V8 using `gin::V8Initializer::LoadV8Snapshot(kSnapshotType);` it also failed.
    @asu...@chromium.org Did I miss something important for `blink_platform_unittests`.
    Austin Sullivan

    These tests are no longer needed if we only support `BigInt` for 64-bit ints

    Lisha Guo

    Done

    File third_party/blink/renderer/platform/bindings/bigint.cc
    Line 128, Patchset 23: pow(18446744073709551616.0, i);
    ningxin hu . resolved

    Use `std::numeric_limits<uint64_t>::max() + 1`?

    Lisha Guo

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Austin Sullivan
    • Dwayne Robinson
    • ningxin hu
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ibe63d38b9e617b98fb01fb877a55a73053c1c353
    Gerrit-Change-Number: 6565815
    Gerrit-PatchSet: 25
    Gerrit-Owner: Lisha Guo <lish...@intel.com>
    Gerrit-Reviewer: Austin Sullivan <asu...@chromium.org>
    Gerrit-Reviewer: Lisha Guo <lish...@intel.com>
    Gerrit-CC: Dwayne Robinson <dwa...@microsoft.com>
    Gerrit-CC: Jiewei Qian <q...@chromium.org>
    Gerrit-CC: Junwei Fu <junw...@intel.com>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Phillis Tang <phi...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-CC: Reilly Grant <rei...@chromium.org>
    Gerrit-CC: Shiyi Zou <shiy...@intel.com>
    Gerrit-CC: ningxin hu <ningx...@intel.com>
    Gerrit-Attention: Dwayne Robinson <dwa...@microsoft.com>
    Gerrit-Attention: Austin Sullivan <asu...@chromium.org>
    Gerrit-Attention: ningxin hu <ningx...@intel.com>
    Gerrit-Comment-Date: Wed, 25 Jun 2025 07:38:07 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Lisha Guo (Gerrit)

    unread,
    Jun 25, 2025, 4:18:25 AMJun 25
    to Kentaro Hara, ningxin hu, Phillis Tang, Austin Sullivan, Reilly Grant, Dwayne Robinson, AyeAye, Junwei Fu, Chromium LUCI CQ, Shiyi Zou, chromium...@chromium.org, Raphael Kubo da Costa, Jiewei Qian, mac-r...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Austin Sullivan, Dwayne Robinson, Kentaro Hara and ningxin hu

    Lisha Guo added 1 comment

    Patchset-level comments
    File-level comment, Patchset 26 (Latest):
    Lisha Guo . resolved

    @har...@chromium.org Could you please help to review these files? third_party/blink/renderer/bindings/scripts/bind_gen/union.py
    third_party/blink/renderer/platform/bindings/bigint.h
    third_party/blink/renderer/platform/bindings/bigint.cc. Thanks!

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Austin Sullivan
    • Dwayne Robinson
    • Kentaro Hara
    • ningxin hu
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ibe63d38b9e617b98fb01fb877a55a73053c1c353
    Gerrit-Change-Number: 6565815
    Gerrit-PatchSet: 26
    Gerrit-Owner: Lisha Guo <lish...@intel.com>
    Gerrit-Reviewer: Austin Sullivan <asu...@chromium.org>
    Gerrit-Reviewer: Kentaro Hara <har...@chromium.org>
    Gerrit-Reviewer: Lisha Guo <lish...@intel.com>
    Gerrit-Reviewer: ningxin hu <ningx...@intel.com>
    Gerrit-CC: Dwayne Robinson <dwa...@microsoft.com>
    Gerrit-CC: Jiewei Qian <q...@chromium.org>
    Gerrit-CC: Junwei Fu <junw...@intel.com>
    Gerrit-CC: Phillis Tang <phi...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-CC: Reilly Grant <rei...@chromium.org>
    Gerrit-CC: Shiyi Zou <shiy...@intel.com>
    Gerrit-Attention: Kentaro Hara <har...@chromium.org>
    Gerrit-Attention: Dwayne Robinson <dwa...@microsoft.com>
    Gerrit-Attention: Austin Sullivan <asu...@chromium.org>
    Gerrit-Attention: ningxin hu <ningx...@intel.com>
    Gerrit-Comment-Date: Wed, 25 Jun 2025 08:18:13 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Kentaro Hara (Gerrit)

    unread,
    Jun 25, 2025, 4:48:31 AMJun 25
    to Lisha Guo, Yuki Shiino, ningxin hu, Phillis Tang, Austin Sullivan, Reilly Grant, Dwayne Robinson, AyeAye, Junwei Fu, Chromium LUCI CQ, Shiyi Zou, chromium...@chromium.org, Raphael Kubo da Costa, Jiewei Qian, mac-r...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Austin Sullivan, Dwayne Robinson, Lisha Guo, Yuki Shiino and ningxin hu

    Kentaro Hara added 1 comment

    Patchset-level comments
    File-level comment, Patchset 27 (Latest):
    Kentaro Hara . resolved

    yukishiino: Would you take a look at binding changes?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Austin Sullivan
    • Dwayne Robinson
    • Lisha Guo
    • Yuki Shiino
    • ningxin hu
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ibe63d38b9e617b98fb01fb877a55a73053c1c353
    Gerrit-Change-Number: 6565815
    Gerrit-PatchSet: 27
    Gerrit-Owner: Lisha Guo <lish...@intel.com>
    Gerrit-Reviewer: Austin Sullivan <asu...@chromium.org>
    Gerrit-Reviewer: Lisha Guo <lish...@intel.com>
    Gerrit-Reviewer: Yuki Shiino <yukis...@chromium.org>
    Gerrit-Reviewer: ningxin hu <ningx...@intel.com>
    Gerrit-CC: Dwayne Robinson <dwa...@microsoft.com>
    Gerrit-CC: Jiewei Qian <q...@chromium.org>
    Gerrit-CC: Junwei Fu <junw...@intel.com>
    Gerrit-CC: Phillis Tang <phi...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-CC: Reilly Grant <rei...@chromium.org>
    Gerrit-CC: Shiyi Zou <shiy...@intel.com>
    Gerrit-Attention: Dwayne Robinson <dwa...@microsoft.com>
    Gerrit-Attention: Austin Sullivan <asu...@chromium.org>
    Gerrit-Attention: ningxin hu <ningx...@intel.com>
    Gerrit-Attention: Yuki Shiino <yukis...@chromium.org>
    Gerrit-Attention: Lisha Guo <lish...@intel.com>
    Gerrit-Comment-Date: Wed, 25 Jun 2025 08:48:04 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Yuki Shiino (Gerrit)

    unread,
    Jun 25, 2025, 7:37:59 AMJun 25
    to Lisha Guo, Yuki Shiino, ningxin hu, Phillis Tang, Austin Sullivan, Reilly Grant, Dwayne Robinson, AyeAye, Junwei Fu, Chromium LUCI CQ, Shiyi Zou, chromium...@chromium.org, Raphael Kubo da Costa, Jiewei Qian, mac-r...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Austin Sullivan, Dwayne Robinson, Lisha Guo and ningxin hu

    Yuki Shiino added 3 comments

    Patchset-level comments
    File-level comment, Patchset 28 (Latest):
    Yuki Shiino . resolved

    bindings/ mostly LGTM, but I'd recommend checking whether we can leverage base::CheckedNumeric<T>.

    File third_party/blink/renderer/platform/bindings/bigint.cc
    Line 35, Patchset 28 (Latest):
    Yuki Shiino . unresolved

    super nit: Better to remove this empty line as it looks inconsistent with other code blocks.

    Line 39, Patchset 28 (Latest): return static_cast<int64_t>(value);
    Yuki Shiino . unresolved

    Overall, it looks better to use CheckedNumeric<int64_t> if possible, avoiding the reinvention.

    I think we can have something like the following code:
    ```
    base::CheckedNumeric<int64_t> value(words_[0]);
    if (!value.IsValid()) [[unlikely]] {
    return std::nullopt;
    }
    return value.ValueOrDie();
    ```
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Austin Sullivan
    • Dwayne Robinson
    • Lisha Guo
    • ningxin hu
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ibe63d38b9e617b98fb01fb877a55a73053c1c353
    Gerrit-Change-Number: 6565815
    Gerrit-PatchSet: 28
    Gerrit-Owner: Lisha Guo <lish...@intel.com>
    Gerrit-Reviewer: Austin Sullivan <asu...@chromium.org>
    Gerrit-Reviewer: Lisha Guo <lish...@intel.com>
    Gerrit-Reviewer: Yuki Shiino <yukis...@chromium.org>
    Gerrit-Reviewer: ningxin hu <ningx...@intel.com>
    Gerrit-CC: Dwayne Robinson <dwa...@microsoft.com>
    Gerrit-CC: Jiewei Qian <q...@chromium.org>
    Gerrit-CC: Junwei Fu <junw...@intel.com>
    Gerrit-CC: Phillis Tang <phi...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-CC: Reilly Grant <rei...@chromium.org>
    Gerrit-CC: Shiyi Zou <shiy...@intel.com>
    Gerrit-Attention: Dwayne Robinson <dwa...@microsoft.com>
    Gerrit-Attention: Austin Sullivan <asu...@chromium.org>
    Gerrit-Attention: ningxin hu <ningx...@intel.com>
    Gerrit-Attention: Lisha Guo <lish...@intel.com>
    Gerrit-Comment-Date: Wed, 25 Jun 2025 11:37:38 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Yuki Shiino (Gerrit)

    unread,
    Jun 25, 2025, 9:56:58 AMJun 25
    to Lisha Guo, Yuki Shiino, ningxin hu, Phillis Tang, Austin Sullivan, Reilly Grant, Dwayne Robinson, AyeAye, Junwei Fu, Chromium LUCI CQ, Shiyi Zou, chromium...@chromium.org, Raphael Kubo da Costa, Jiewei Qian, mac-r...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Austin Sullivan, Dwayne Robinson, Lisha Guo and ningxin hu

    Yuki Shiino added 3 comments

    File third_party/blink/renderer/platform/bindings/bigint.cc
    Line 30, Patchset 28 (Latest): static_cast<uint64_t>(std::abs(std::numeric_limits<int64_t>::min()))) {
    Yuki Shiino . unresolved

    std::numeric_limits::min() returns a negative value, and in two's complement representation, the absolute value of that negative value cannot be represented in the same type. E.g. in case of signed char, min = -128 and max = 127, and abs(-128) cannot be represented in signed char.

    I'm afraid that this code doesn't work as expected. It's nice to have a unittest to prove the behaviors in corner cases (with UB sanitizer).

    https://en.cppreference.com/w/cpp/numeric/math/abs
    > The behavior is undefined if the result cannot be represented by the return type.

    and

    In 2's complement systems, the absolute value of the most-negative value is out of range, e.g. for 32-bit 2's complement type int, INT_MIN is -2147483648, but the would-be result 2147483648 is greater than INT_MAX, which is 2147483647.

    Line 33, Patchset 28 (Latest): return -static_cast<int64_t>(value);
    Yuki Shiino . unresolved

    Probably we can implement this as UB-free based on the followings. We need to be extra-careful. Maybe better to be implemented in //base and reviewed by experts.

    C++ 7.8 Integral conversions [conv.integral]
    > 2 If the destination type is unsigned, the resulting value is the least unsigned integer congruent to the source integer (modulo 2^n where n is the number of bits used to represent the unsigned type). [ Note: In a two’s complement representation, this conversion is conceptual and there is no change in the bit pattern (if there is no truncation). — end note ]

    3 If the destination type is signed, the value is unchanged if it can be represented in the destination type; otherwise, the value is implementation-defined.

    5 The conversions allowed as integral promotions are excluded from the set of integral conversions.

    C++ 8.5.2.1 Unary operators [expr.unary.op]
    > 8 The operand of the unary - operator shall have arithmetic or unscoped enumeration type and the result is the negation of its operand. Integral promotion is performed on integral or enumeration operands. The negative of an unsigned quantity is computed by subtracting its value from 2^n, where n is the number of bits in the promoted operand. The type of the result is the type of the promoted operand.

    Line 39, Patchset 28 (Latest): return static_cast<int64_t>(value);
    Yuki Shiino . unresolved

    Overall, it looks better to use CheckedNumeric<int64_t> if possible, avoiding the reinvention.

    I think we can have something like the following code:
    ```
    base::CheckedNumeric<int64_t> value(words_[0]);
    if (!value.IsValid()) [[unlikely]] {
    return std::nullopt;
    }
    return value.ValueOrDie();
    ```
    Yuki Shiino

    I overlooked the complexities in the negative cases. It seems that we have to write some amount of code like yours. However, it'd be worth trying to avoid custom code and re-use CheckedNumeric and/or its family as much as possible. E.g. when positive, we may be able to leverage CheckedNumeric.

    Gerrit-Comment-Date: Wed, 25 Jun 2025 13:56:33 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Yuki Shiino <yukis...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Austin Sullivan (Gerrit)

    unread,
    Jun 25, 2025, 5:49:16 PMJun 25
    to Lisha Guo, Yuki Shiino, ningxin hu, Phillis Tang, Reilly Grant, Dwayne Robinson, AyeAye, Junwei Fu, Chromium LUCI CQ, Shiyi Zou, chromium...@chromium.org, Raphael Kubo da Costa, Jiewei Qian, mac-r...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Dwayne Robinson, Lisha Guo and ningxin hu

    Austin Sullivan voted and added 4 comments

    Votes added by Austin Sullivan

    Code-Review+1

    4 comments

    Patchset-level comments
    Austin Sullivan . resolved

    WebNN changes LGTM

    File third_party/blink/renderer/modules/ml/webnn/ml_graph_type_converter.cc
    Line 59, Patchset 28 (Latest):#include "third_party/fp16/src/include/fp16.h"
    Austin Sullivan . unresolved

    nit: is this needed anymore?

    Line 1529, Patchset 23: case webnn::OperandDataType::kFloat32:
    // Implicit double -> float conversion.
    return webnn::MLNumber::FromFloat32(bigint.ToDoubleLossy());
    case webnn::OperandDataType::kFloat16:
    // double (-> float, implicitly) -> fp16 (as uint16_t).
    return webnn::MLNumber::FromFloat16(
    fp16_ieee_from_fp32_value(bigint.ToDoubleLossy()));

    case webnn::OperandDataType::kInt32: {
    if (auto int32 = bigint.ToInt32()) {
    return webnn::MLNumber::FromInt32(*int32);
    } else {
    return webnn::MLNumber::FromInt32(
    bigint.IsNegative() ? std::numeric_limits<int32_t>::min()
    : std::numeric_limits<int32_t>::max());
    }
    }
    case webnn::OperandDataType::kUint32: {
    if (auto uint32 = bigint.ToUInt32()) {
    return webnn::MLNumber::FromUint32(*uint32);
    } else {
    return webnn::MLNumber::FromUint32(
    bigint.IsNegative() ? std::numeric_limits<uint32_t>::min()
    : std::numeric_limits<uint32_t>::max());
    }
    }
    ningxin hu . resolved
    Austin Sullivan

    Acknowledged

    File third_party/blink/web_tests/VirtualTestSuites
    Line 5955, Patchset 28 (Latest):]
    Austin Sullivan . unresolved

    was this change intentional?

    Open in Gerrit

    Related details

    Attention is currently required from:
    Gerrit-Attention: ningxin hu <ningx...@intel.com>
    Gerrit-Attention: Lisha Guo <lish...@intel.com>
    Gerrit-Comment-Date: Wed, 25 Jun 2025 21:49:05 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    ningxin hu (Gerrit)

    unread,
    Jun 25, 2025, 11:10:50 PMJun 25
    to Lisha Guo, Austin Sullivan, Yuki Shiino, Phillis Tang, Reilly Grant, Dwayne Robinson, AyeAye, Junwei Fu, Chromium LUCI CQ, Shiyi Zou, chromium...@chromium.org, Raphael Kubo da Costa, Jiewei Qian, mac-r...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Lisha Guo

    ningxin hu added 5 comments

    File services/webnn/dml/graph_impl_dml.cc

    auto data_type = output_tensor_desc.GetDataType();
    clamp_operator_desc.Min = ToScalarUnion(clamp->min_value, data_type);
    clamp_operator_desc.Max = ToScalarUnion(clamp->max_value, data_type);
    */
    ningxin hu . unresolved

    Remove the unused code.

    File services/webnn/public/cpp/ml_number.h
    Line 25, Patchset 28 (Latest): static MLNumber FromFloat16(uint16_t number);
    static MLNumber FromFloat32(float number);
    static MLNumber FromFloat64(double number);

    static MLNumber FromInt8(int8_t number);
    static MLNumber FromUint8(uint8_t number);
    static MLNumber FromInt32(int32_t number);
    static MLNumber FromUint32(uint32_t number);
    static MLNumber FromInt64(int64_t number);
    static MLNumber FromUint64(uint64_t number);
    ningxin hu . unresolved

    Only `FromFloat64`, `FromInt64` and `FromUint64` are useful now, you may want to delete the others.

    File services/webnn/webnn_graph_builder_impl.cc
    Line 105, Patchset 28 (Latest):bool ValidateClampAttributes(const mojom::Clamp& clamp,
    webnn::OperandDataType data_type) {
    return !clamp.min_value.IsGreaterThan(clamp.max_value, data_type);
    }
    ningxin hu . unresolved

    This helper seems to be trivial now. You may want to inline it.

    File third_party/blink/renderer/modules/ml/webnn/ml_graph_type_converter.cc
    Line 18, Patchset 28 (Latest):#include "services/webnn/public/cpp/ml_number.h"
    #include "services/webnn/public/cpp/operand_descriptor.h"
    ningxin hu . unresolved

    These two headers are already included in ml_graph_type_converter.h

    File third_party/blink/renderer/platform/bindings/bigint.cc
    Line 39, Patchset 28 (Latest): return static_cast<int64_t>(value);
    Yuki Shiino . unresolved

    Overall, it looks better to use CheckedNumeric<int64_t> if possible, avoiding the reinvention.

    I think we can have something like the following code:
    ```
    base::CheckedNumeric<int64_t> value(words_[0]);
    if (!value.IsValid()) [[unlikely]] {
    return std::nullopt;
    }
    return value.ValueOrDie();
    ```
    Yuki Shiino

    I overlooked the complexities in the negative cases. It seems that we have to write some amount of code like yours. However, it'd be worth trying to avoid custom code and re-use CheckedNumeric and/or its family as much as possible. E.g. when positive, we may be able to leverage CheckedNumeric.

    ningxin hu

    We may want to follow v8 `BigInt::AsInt64()` implementation: https://source.chromium.org/chromium/chromium/src/+/main:v8/src/objects/bigint.cc;l=1438;drc=a533a36dfe878045cd210166b8c3f1678fc987e7

    Something like
    ```
    uint64_t raw = words_[0];
    // Simulate two's complement.
    uint64_t raw = IsNegative() ? ((~raw) + 1u) : raw;
    int64_t result = static_cast<int64_t>(raw);
    if ((result < 0) != IsNegative()) return std::nullopt;
    return result
    ```

    @asu...@chromium.org, as you implemented the first version, please also take a look.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Lisha Guo
    Gerrit-Attention: Lisha Guo <lish...@intel.com>
    Gerrit-Comment-Date: Thu, 26 Jun 2025 03:10:38 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Austin Sullivan (Gerrit)

    unread,
    Jun 27, 2025, 12:48:47 AMJun 27
    to Lisha Guo, Yuki Shiino, ningxin hu, Phillis Tang, Reilly Grant, Dwayne Robinson, AyeAye, Junwei Fu, Chromium LUCI CQ, Shiyi Zou, chromium...@chromium.org, Raphael Kubo da Costa, Jiewei Qian, mac-r...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Lisha Guo

    Austin Sullivan added 2 comments

    File third_party/blink/renderer/platform/bindings/bigint.cc
    Line 30, Patchset 28: static_cast<uint64_t>(std::abs(std::numeric_limits<int64_t>::min()))) {
    Yuki Shiino . unresolved

    std::numeric_limits::min() returns a negative value, and in two's complement representation, the absolute value of that negative value cannot be represented in the same type. E.g. in case of signed char, min = -128 and max = 127, and abs(-128) cannot be represented in signed char.

    I'm afraid that this code doesn't work as expected. It's nice to have a unittest to prove the behaviors in corner cases (with UB sanitizer).

    https://en.cppreference.com/w/cpp/numeric/math/abs
    > The behavior is undefined if the result cannot be represented by the return type.

    and

    In 2's complement systems, the absolute value of the most-negative value is out of range, e.g. for 32-bit 2's complement type int, INT_MIN is -2147483648, but the would-be result 2147483648 is greater than INT_MAX, which is 2147483647.

    Austin Sullivan
     It's nice to have a unittest to prove the behaviors in corner cases (with UB sanitizer).

    +1 and apologies for my earlier comment on https://chromium-review.googlesource.com/c/chromium/src/+/6565815/comment/ee5c20ae_83fc719c/ - I forgot about the complexities involved with handling `IsNegative()`

    @yukis...@chromium.org could you take a look at that thread and provide guidance on how to construct unit tests for this class, given the v8 complexities?

    Line 39, Patchset 28: return static_cast<int64_t>(value);
    Yuki Shiino . unresolved

    Overall, it looks better to use CheckedNumeric<int64_t> if possible, avoiding the reinvention.

    I think we can have something like the following code:
    ```
    base::CheckedNumeric<int64_t> value(words_[0]);
    if (!value.IsValid()) [[unlikely]] {
    return std::nullopt;
    }
    return value.ValueOrDie();
    ```
    Yuki Shiino

    I overlooked the complexities in the negative cases. It seems that we have to write some amount of code like yours. However, it'd be worth trying to avoid custom code and re-use CheckedNumeric and/or its family as much as possible. E.g. when positive, we may be able to leverage CheckedNumeric.

    ningxin hu

    We may want to follow v8 `BigInt::AsInt64()` implementation: https://source.chromium.org/chromium/chromium/src/+/main:v8/src/objects/bigint.cc;l=1438;drc=a533a36dfe878045cd210166b8c3f1678fc987e7

    Something like
    ```
    uint64_t raw = words_[0];
    // Simulate two's complement.
    uint64_t raw = IsNegative() ? ((~raw) + 1u) : raw;
    int64_t result = static_cast<int64_t>(raw);
    if ((result < 0) != IsNegative()) return std::nullopt;
    return result
    ```

    @asu...@chromium.org, as you implemented the first version, please also take a look.

    Austin Sullivan

    it'd be worth trying to avoid custom code and re-use CheckedNumeric and/or its family as much as possible

    +1

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Lisha Guo
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ibe63d38b9e617b98fb01fb877a55a73053c1c353
    Gerrit-Change-Number: 6565815
    Gerrit-PatchSet: 29
    Gerrit-Owner: Lisha Guo <lish...@intel.com>
    Gerrit-Reviewer: Austin Sullivan <asu...@chromium.org>
    Gerrit-Reviewer: Lisha Guo <lish...@intel.com>
    Gerrit-Reviewer: Yuki Shiino <yukis...@chromium.org>
    Gerrit-Reviewer: ningxin hu <ningx...@intel.com>
    Gerrit-CC: Dwayne Robinson <dwa...@microsoft.com>
    Gerrit-CC: Jiewei Qian <q...@chromium.org>
    Gerrit-CC: Junwei Fu <junw...@intel.com>
    Gerrit-CC: Phillis Tang <phi...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-CC: Reilly Grant <rei...@chromium.org>
    Gerrit-CC: Shiyi Zou <shiy...@intel.com>
    Gerrit-Attention: Lisha Guo <lish...@intel.com>
    Gerrit-Comment-Date: Fri, 27 Jun 2025 04:48:30 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: ningxin hu <ningx...@intel.com>
    Comment-In-Reply-To: Yuki Shiino <yukis...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Lisha Guo (Gerrit)

    unread,
    Jun 27, 2025, 1:49:26 AMJun 27
    to Austin Sullivan, Yuki Shiino, ningxin hu, Phillis Tang, Reilly Grant, Dwayne Robinson, AyeAye, Junwei Fu, Chromium LUCI CQ, Shiyi Zou, chromium...@chromium.org, Raphael Kubo da Costa, Jiewei Qian, mac-r...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Austin Sullivan, Yuki Shiino and ningxin hu

    Lisha Guo added 7 comments

    File services/webnn/dml/graph_impl_dml.cc

    auto data_type = output_tensor_desc.GetDataType();
    clamp_operator_desc.Min = ToScalarUnion(clamp->min_value, data_type);
    clamp_operator_desc.Max = ToScalarUnion(clamp->max_value, data_type);
    */
    ningxin hu . resolved

    Remove the unused code.

    Lisha Guo

    Done

    File services/webnn/public/cpp/ml_number.h
    Line 25, Patchset 28: static MLNumber FromFloat16(uint16_t number);

    static MLNumber FromFloat32(float number);
    static MLNumber FromFloat64(double number);

    static MLNumber FromInt8(int8_t number);
    static MLNumber FromUint8(uint8_t number);
    static MLNumber FromInt32(int32_t number);
    static MLNumber FromUint32(uint32_t number);
    static MLNumber FromInt64(int64_t number);
    static MLNumber FromUint64(uint64_t number);
    ningxin hu . resolved

    Only `FromFloat64`, `FromInt64` and `FromUint64` are useful now, you may want to delete the others.

    Lisha Guo

    Done

    File services/webnn/webnn_graph_builder_impl.cc
    Line 105, Patchset 28:bool ValidateClampAttributes(const mojom::Clamp& clamp,

    webnn::OperandDataType data_type) {
    return !clamp.min_value.IsGreaterThan(clamp.max_value, data_type);
    }
    ningxin hu . resolved

    This helper seems to be trivial now. You may want to inline it.

    Lisha Guo

    Done

    File third_party/blink/renderer/modules/ml/webnn/ml_graph_type_converter.cc
    Line 18, Patchset 28:#include "services/webnn/public/cpp/ml_number.h"
    #include "services/webnn/public/cpp/operand_descriptor.h"
    ningxin hu . resolved

    These two headers are already included in ml_graph_type_converter.h

    Lisha Guo

    Done

    Line 59, Patchset 28:#include "third_party/fp16/src/include/fp16.h"
    Austin Sullivan . resolved

    nit: is this needed anymore?

    Lisha Guo

    Done

    File third_party/blink/renderer/platform/bindings/bigint.cc
    Line 30, Patchset 28: static_cast<uint64_t>(std::abs(std::numeric_limits<int64_t>::min()))) {
    Yuki Shiino . unresolved

    std::numeric_limits::min() returns a negative value, and in two's complement representation, the absolute value of that negative value cannot be represented in the same type. E.g. in case of signed char, min = -128 and max = 127, and abs(-128) cannot be represented in signed char.

    I'm afraid that this code doesn't work as expected. It's nice to have a unittest to prove the behaviors in corner cases (with UB sanitizer).

    https://en.cppreference.com/w/cpp/numeric/math/abs
    > The behavior is undefined if the result cannot be represented by the return type.

    and

    In 2's complement systems, the absolute value of the most-negative value is out of range, e.g. for 32-bit 2's complement type int, INT_MIN is -2147483648, but the would-be result 2147483648 is greater than INT_MAX, which is 2147483647.

    Austin Sullivan
     It's nice to have a unittest to prove the behaviors in corner cases (with UB sanitizer).

    +1 and apologies for my earlier comment on https://chromium-review.googlesource.com/c/chromium/src/+/6565815/comment/ee5c20ae_83fc719c/ - I forgot about the complexities involved with handling `IsNegative()`

    @yukis...@chromium.org could you take a look at that thread and provide guidance on how to construct unit tests for this class, given the v8 complexities?

    Lisha Guo

    In 2's complement systems, the absolute value of the most-negative value is out of range, e.g. for 32-bit 2's complement type int, INT_MIN is -2147483648, but the would-be result 2147483648 is greater than INT_MAX, which is 2147483647.

    @yukis...@chromium.org Maybe `base::SafeUnsignedAbs()` https://source.chromium.org/chromium/chromium/src/+/main:base/numerics/safe_conversions_impl.h;l=64 could solve this overflow issue?

    Or we use the solution proposed by @ningx...@intel.com which following v8 BigInt::AsInt64() implementation?

    File third_party/blink/web_tests/VirtualTestSuites
    Austin Sullivan . unresolved

    was this change intentional?

    Lisha Guo

    No, it was deleted by accident. Added newlinear at end of the file back.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Austin Sullivan
    • Yuki Shiino
    • ningxin hu
    Gerrit-Attention: Austin Sullivan <asu...@chromium.org>
    Gerrit-Attention: ningxin hu <ningx...@intel.com>
    Gerrit-Attention: Yuki Shiino <yukis...@chromium.org>
    Gerrit-Comment-Date: Fri, 27 Jun 2025 05:49:09 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Austin Sullivan <asu...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Lisha Guo (Gerrit)

    unread,
    Jun 27, 2025, 1:50:23 AMJun 27
    to Austin Sullivan, Yuki Shiino, ningxin hu, Phillis Tang, Reilly Grant, Dwayne Robinson, AyeAye, Junwei Fu, Chromium LUCI CQ, Shiyi Zou, chromium...@chromium.org, Raphael Kubo da Costa, Jiewei Qian, mac-r...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Austin Sullivan, Yuki Shiino and ningxin hu

    Lisha Guo added 2 comments

    File third_party/blink/renderer/platform/bindings/bigint.cc
    Line 35, Patchset 28:
    Yuki Shiino . resolved

    super nit: Better to remove this empty line as it looks inconsistent with other code blocks.

    Lisha Guo

    Done

    File third_party/blink/web_tests/VirtualTestSuites
    Line 5955, Patchset 28:]
    Austin Sullivan . resolved

    was this change intentional?

    Lisha Guo

    No, it was deleted by accident. Added newlinear at end of the file back.

    Lisha Guo

    Done

    Gerrit-Comment-Date: Fri, 27 Jun 2025 05:50:02 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Austin Sullivan <asu...@chromium.org>
    Comment-In-Reply-To: Yuki Shiino <yukis...@chromium.org>
    Comment-In-Reply-To: Lisha Guo <lish...@intel.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Yuki Shiino (Gerrit)

    unread,
    Jun 27, 2025, 5:11:16 AMJun 27
    to Lisha Guo, Austin Sullivan, Yuki Shiino, ningxin hu, Phillis Tang, Reilly Grant, Dwayne Robinson, AyeAye, Junwei Fu, Chromium LUCI CQ, Shiyi Zou, chromium...@chromium.org, Raphael Kubo da Costa, Jiewei Qian, mac-r...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Austin Sullivan, Lisha Guo and ningxin hu

    Yuki Shiino added 1 comment

    File third_party/blink/renderer/platform/bindings/bigint.cc
    Line 30, Patchset 28: static_cast<uint64_t>(std::abs(std::numeric_limits<int64_t>::min()))) {
    Yuki Shiino . unresolved

    std::numeric_limits::min() returns a negative value, and in two's complement representation, the absolute value of that negative value cannot be represented in the same type. E.g. in case of signed char, min = -128 and max = 127, and abs(-128) cannot be represented in signed char.

    I'm afraid that this code doesn't work as expected. It's nice to have a unittest to prove the behaviors in corner cases (with UB sanitizer).

    https://en.cppreference.com/w/cpp/numeric/math/abs
    > The behavior is undefined if the result cannot be represented by the return type.

    and

    In 2's complement systems, the absolute value of the most-negative value is out of range, e.g. for 32-bit 2's complement type int, INT_MIN is -2147483648, but the would-be result 2147483648 is greater than INT_MAX, which is 2147483647.

    Austin Sullivan
     It's nice to have a unittest to prove the behaviors in corner cases (with UB sanitizer).

    +1 and apologies for my earlier comment on https://chromium-review.googlesource.com/c/chromium/src/+/6565815/comment/ee5c20ae_83fc719c/ - I forgot about the complexities involved with handling `IsNegative()`

    @yukis...@chromium.org could you take a look at that thread and provide guidance on how to construct unit tests for this class, given the v8 complexities?

    Lisha Guo

    In 2's complement systems, the absolute value of the most-negative value is out of range, e.g. for 32-bit 2's complement type int, INT_MIN is -2147483648, but the would-be result 2147483648 is greater than INT_MAX, which is 2147483647.

    @yukis...@chromium.org Maybe `base::SafeUnsignedAbs()` https://source.chromium.org/chromium/chromium/src/+/main:base/numerics/safe_conversions_impl.h;l=64 could solve this overflow issue?

    Or we use the solution proposed by @ningx...@intel.com which following v8 BigInt::AsInt64() implementation?

    Yuki Shiino

    Given that we've already had a good implementation at `v8::internal::BigInt::AsInt64`, I don't think we need another approach (like using base::CheckedNumeric and/or base::SafeUnsignedAbs). I think it's best to copy the V8 impl into Blink unless we come up with a better one. \[[Cast from unsigned to signed](https://source.chromium.org/chromium/chromium/src/+/main:v8/src/objects/bigint.cc;drc=a533a36dfe878045cd210166b8c3f1678fc987e7;l=1440) is an implementation-defined behavior though, I think it's acceptable as we never support 1's complement representation. It's not an undefined behavior.\]

    About unittests, please add unittests in //third_party/blink/renderer/bindings/core/v8/, where you can use `V8TestingScope`. We already had such cases; the implementation lives in .../platform/bindings/ and its tests live in .../bindings/core/v8/, due to the exact same reason. It's fine.

    I suppose that V8 may have good test cases already. Probably you can copy not only the implementation but also the test cases, too.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Austin Sullivan
    • Lisha Guo
    • ningxin hu
    Gerrit-Attention: Lisha Guo <lish...@intel.com>
    Gerrit-Comment-Date: Fri, 27 Jun 2025 09:10:48 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Austin Sullivan <asu...@chromium.org>
    Comment-In-Reply-To: Lisha Guo <lish...@intel.com>
    Comment-In-Reply-To: Yuki Shiino <yukis...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    ningxin hu (Gerrit)

    unread,
    Jul 8, 2025, 10:32:20 AMJul 8
    to Lisha Guo, Wei4 Wang, Austin Sullivan, Yuki Shiino, Phillis Tang, Reilly Grant, Dwayne Robinson, AyeAye, Junwei Fu, Chromium LUCI CQ, Shiyi Zou, chromium...@chromium.org, Raphael Kubo da Costa, Jiewei Qian, mac-r...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Austin Sullivan and Lisha Guo

    ningxin hu added 1 comment

    Patchset-level comments
    File-level comment, Patchset 29 (Latest):
    ningxin hu . resolved

    Lisha has another plan and @wei4...@intel.com will pick up this work. Thanks both Lisha and Wei! Wei's first CL is ready for review: https://chromium-review.googlesource.com/c/chromium/src/+/6713775

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Austin Sullivan
    • Lisha Guo
    Gerrit-CC: Wei4 Wang <wei4...@intel.com>
    Gerrit-Attention: Austin Sullivan <asu...@chromium.org>
    Gerrit-Attention: Lisha Guo <lish...@intel.com>
    Gerrit-Comment-Date: Tue, 08 Jul 2025 14:32:09 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Dwayne Robinson (Gerrit)

    unread,
    Oct 29, 2025, 1:21:58 AM (4 days ago) Oct 29
    to Lisha Guo, Wei4 Wang, Austin Sullivan, Yuki Shiino, ningxin hu, Phillis Tang, Reilly Grant, AyeAye, Junwei Fu, Chromium LUCI CQ, Shiyi Zou, chromium...@chromium.org, Raphael Kubo da Costa, Jiewei Qian, mac-r...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Austin Sullivan and Lisha Guo

    Dwayne Robinson added 1 comment

    Patchset-level comments

    Related details

    Attention is currently required from:
    • Austin Sullivan
    • Lisha Guo
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ibe63d38b9e617b98fb01fb877a55a73053c1c353
      Gerrit-Change-Number: 6565815
      Gerrit-PatchSet: 29
      Gerrit-Owner: Lisha Guo <lish...@intel.com>
      Gerrit-Reviewer: Austin Sullivan <asu...@google.com>
      Gerrit-Reviewer: Lisha Guo <lish...@intel.com>
      Gerrit-Reviewer: Yuki Shiino <yukis...@chromium.org>
      Gerrit-Reviewer: ningxin hu <ningx...@intel.com>
      Gerrit-CC: Dwayne Robinson <dwa...@microsoft.com>
      Gerrit-CC: Jiewei Qian <q...@chromium.org>
      Gerrit-CC: Junwei Fu <junw...@intel.com>
      Gerrit-CC: Phillis Tang <phi...@chromium.org>
      Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
      Gerrit-CC: Reilly Grant <rei...@chromium.org>
      Gerrit-CC: Shiyi Zou <shiy...@intel.com>
      Gerrit-CC: Wei4 Wang <wei4...@intel.com>
      Gerrit-Attention: Lisha Guo <lish...@intel.com>
      Gerrit-Attention: Austin Sullivan <asu...@google.com>
      Gerrit-Comment-Date: Wed, 29 Oct 2025 05:21:53 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Dwayne Robinson (Gerrit)

      unread,
      Oct 29, 2025, 1:23:07 AM (4 days ago) Oct 29
      to Lisha Guo, Wei4 Wang, Austin Sullivan, Yuki Shiino, ningxin hu, Phillis Tang, Reilly Grant, AyeAye, Junwei Fu, Chromium LUCI CQ, Shiyi Zou, chromium...@chromium.org, Raphael Kubo da Costa, Jiewei Qian, mac-r...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
      Attention needed from Austin Sullivan and Lisha Guo

      Dwayne Robinson added 1 comment

      Patchset-level comments
      Dwayne Robinson . resolved

      Abandon since https://chromium-review.googlesource.com/c/chromium/src/+/6713775 went in?

      Gerrit-Comment-Date: Wed, 29 Oct 2025 05:23:02 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Dwayne Robinson <dwa...@microsoft.com>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      ningxin hu (Gerrit)

      unread,
      Oct 29, 2025, 1:45:23 AM (4 days ago) Oct 29
      to Lisha Guo, Wei4 Wang, Austin Sullivan, Yuki Shiino, Phillis Tang, Reilly Grant, Dwayne Robinson, AyeAye, Junwei Fu, Chromium LUCI CQ, Shiyi Zou, chromium...@chromium.org, Raphael Kubo da Costa, Jiewei Qian, mac-r...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
      Attention needed from Austin Sullivan, Dwayne Robinson and Lisha Guo

      ningxin hu added 1 comment

      Patchset-level comments
      ningxin hu

      Yes, this one was abandoned.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Austin Sullivan
      • Dwayne Robinson
      • Lisha Guo
      Gerrit-Attention: Dwayne Robinson <dwa...@microsoft.com>
      Gerrit-Attention: Austin Sullivan <asu...@google.com>
      Gerrit-Comment-Date: Wed, 29 Oct 2025 05:45:17 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      ningxin hu (Gerrit)

      unread,
      Oct 29, 2025, 1:46:09 AM (4 days ago) Oct 29
      to Lisha Guo, Wei4 Wang, Austin Sullivan, Yuki Shiino, Phillis Tang, Reilly Grant, Dwayne Robinson, AyeAye, Junwei Fu, Chromium LUCI CQ, Shiyi Zou, chromium...@chromium.org, Raphael Kubo da Costa, Jiewei Qian, mac-r...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org

      ningxin hu abandoned this change

      Related details

      Attention set is empty
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: abandon
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy
      Reply all
      Reply to author
      Forward
      0 new messages