WebNN: Build services/webnn/host as a component to fix duplicate singleton [chromium/src : main]

0 views
Skip to first unread message

Xu, Mingming1 (Gerrit)

unread,
Jun 24, 2026, 1:24:42 AM (9 days ago) Jun 24
to Hu, Ningxin, Rafael Cintron, Reilly Grant, Zou, Shiyi, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, Jiewei Qian
Attention needed from Hu, Ningxin, Rafael Cintron and Reilly Grant

Xu, Mingming1 added 1 comment

Patchset-level comments
File-level comment, Patchset 1 (Latest):
Xu, Mingming1 . resolved

PTAL, thanks!

Open in Gerrit

Related details

Attention is currently required from:
  • Hu, Ningxin
  • Rafael Cintron
  • Reilly Grant
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • 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: Ie4dbbe37afce5da49fc85090049c3a5070a1afc8
Gerrit-Change-Number: 7988725
Gerrit-PatchSet: 1
Gerrit-Owner: Xu, Mingming1 <mingmi...@intel.com>
Gerrit-Reviewer: Hu, Ningxin <ningx...@intel.com>
Gerrit-Reviewer: Rafael Cintron <rafael....@microsoft.com>
Gerrit-Reviewer: Reilly Grant <rei...@chromium.org>
Gerrit-Reviewer: Xu, Mingming1 <mingmi...@intel.com>
Gerrit-CC: Jiewei Qian <q...@chromium.org>
Gerrit-CC: Zou, Shiyi <shiy...@intel.com>
Gerrit-Attention: Rafael Cintron <rafael....@microsoft.com>
Gerrit-Attention: Hu, Ningxin <ningx...@intel.com>
Gerrit-Attention: Reilly Grant <rei...@chromium.org>
Gerrit-Comment-Date: Wed, 24 Jun 2026 05:24:16 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Hu, Ningxin (Gerrit)

unread,
Jun 24, 2026, 1:44:49 PM (8 days ago) Jun 24
to Xu, Mingming1, Rafael Cintron, Reilly Grant, Zou, Shiyi, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, Jiewei Qian
Attention needed from Rafael Cintron, Reilly Grant and Xu, Mingming1

Hu, Ningxin voted and added 1 comment

Votes added by Hu, Ningxin

Code-Review+1

1 comment

Patchset-level comments
Hu, Ningxin . resolved

LGTM

Open in Gerrit

Related details

Attention is currently required from:
  • Rafael Cintron
  • Reilly Grant
  • Xu, Mingming1
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement 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: Ie4dbbe37afce5da49fc85090049c3a5070a1afc8
Gerrit-Change-Number: 7988725
Gerrit-PatchSet: 1
Gerrit-Owner: Xu, Mingming1 <mingmi...@intel.com>
Gerrit-Reviewer: Hu, Ningxin <ningx...@intel.com>
Gerrit-Reviewer: Rafael Cintron <rafael....@microsoft.com>
Gerrit-Reviewer: Reilly Grant <rei...@chromium.org>
Gerrit-Reviewer: Xu, Mingming1 <mingmi...@intel.com>
Gerrit-CC: Jiewei Qian <q...@chromium.org>
Gerrit-CC: Zou, Shiyi <shiy...@intel.com>
Gerrit-Attention: Rafael Cintron <rafael....@microsoft.com>
Gerrit-Attention: Xu, Mingming1 <mingmi...@intel.com>
Gerrit-Attention: Reilly Grant <rei...@chromium.org>
Gerrit-Comment-Date: Wed, 24 Jun 2026 17:44:30 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Reilly Grant (Gerrit)

unread,
Jun 24, 2026, 4:42:49 PM (8 days ago) Jun 24
to Xu, Mingming1, Reilly Grant, Hu, Ningxin, Rafael Cintron, Zou, Shiyi, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, Jiewei Qian
Attention needed from Rafael Cintron and Xu, Mingming1

Reilly Grant voted and added 2 comments

Votes added by Reilly Grant

Code-Review+1

2 comments

Patchset-level comments
Reilly Grant . resolved

LGTM with a formatting nit

Commit Message
Reilly Grant . unresolved

Please click the "format" button underneath the commit message to rewrap the lines in this message to the correct column width.

Open in Gerrit

Related details

Attention is currently required from:
  • Rafael Cintron
  • Xu, Mingming1
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement 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: Ie4dbbe37afce5da49fc85090049c3a5070a1afc8
    Gerrit-Change-Number: 7988725
    Gerrit-PatchSet: 1
    Gerrit-Owner: Xu, Mingming1 <mingmi...@intel.com>
    Gerrit-Reviewer: Hu, Ningxin <ningx...@intel.com>
    Gerrit-Reviewer: Rafael Cintron <rafael....@microsoft.com>
    Gerrit-Reviewer: Reilly Grant <rei...@chromium.org>
    Gerrit-Reviewer: Xu, Mingming1 <mingmi...@intel.com>
    Gerrit-CC: Jiewei Qian <q...@chromium.org>
    Gerrit-CC: Zou, Shiyi <shiy...@intel.com>
    Gerrit-Attention: Rafael Cintron <rafael....@microsoft.com>
    Gerrit-Attention: Xu, Mingming1 <mingmi...@intel.com>
    Gerrit-Comment-Date: Wed, 24 Jun 2026 20:42:36 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Xu, Mingming1 (Gerrit)

    unread,
    Jun 24, 2026, 9:39:51 PM (8 days ago) Jun 24
    to Rafael Cintron, Reilly Grant, Hu, Ningxin, Zou, Shiyi, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, Jiewei Qian

    Xu, Mingming1 added 1 comment

    Commit Message
    File-level comment, Patchset 1:
    Reilly Grant . resolved

    Please click the "format" button underneath the commit message to rewrap the lines in this message to the correct column width.

    Xu, Mingming1

    Done

    Open in Gerrit

    Related details

    Attention set is empty
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement 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: Ie4dbbe37afce5da49fc85090049c3a5070a1afc8
      Gerrit-Change-Number: 7988725
      Gerrit-PatchSet: 2
      Gerrit-Owner: Xu, Mingming1 <mingmi...@intel.com>
      Gerrit-Reviewer: Hu, Ningxin <ningx...@intel.com>
      Gerrit-Reviewer: Reilly Grant <rei...@chromium.org>
      Gerrit-Reviewer: Xu, Mingming1 <mingmi...@intel.com>
      Gerrit-CC: Jiewei Qian <q...@chromium.org>
      Gerrit-CC: Rafael Cintron <rafael....@microsoft.com>
      Gerrit-Comment-Date: Thu, 25 Jun 2026 01:39:26 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Reilly Grant <rei...@chromium.org>
      satisfied_requirement
      open
      diffy

      Xu, Mingming1 (Gerrit)

      unread,
      Jun 24, 2026, 9:40:02 PM (8 days ago) Jun 24
      to Rafael Cintron, Reilly Grant, Hu, Ningxin, Zou, Shiyi, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, Jiewei Qian

      Xu, Mingming1 voted Commit-Queue+2

      Commit-Queue+2
      Gerrit-Comment-Date: Thu, 25 Jun 2026 01:39:38 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      open
      diffy

      Chromium LUCI CQ (Gerrit)

      unread,
      Jun 24, 2026, 10:00:37 PM (8 days ago) Jun 24
      to Xu, Mingming1, Rafael Cintron, Reilly Grant, Hu, Ningxin, Zou, Shiyi, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, Jiewei Qian

      Chromium LUCI CQ submitted the change

      Unreviewed changes

      1 is the latest approved patch-set.
      No files were changed between the latest approved patch-set and the submitted one.

      Change information

      Commit message:
      WebNN: Build services/webnn/host as a component to fix duplicate singleton

      Fixes a browser-process crash on Windows during WebNN ORT context
      creation:

      [WebNN] [OpenVINOExecutionProvider] is already in ready state before
      `EnsureReadyAsync()` is called.

      `ExecutionProviderInitializer` is a process-wide singleton whose state
      machine is designed to run `Initialize()` exactly once: the first
      `EnsureExecutionProvidersReady()` call activates the EP catalog and
      posts `Initialize()`, which calls `EnsureReadyAsync()` on each provider
      and drives it to the Ready state.

      But `services/webnn/host` was a `source_set`, which in a component build
      is statically linked into every dependent component. It is depended on
      by both `content.dll` and `components_viz_host.dll`, and the browser
      process loads both, so each got its own copy of the singleton's `static`
      storage -- two `ExecutionProviderInitializer` instances in one process
      (observed as two distinct `this` pointers on the same thread).

      Both instances ran `Initialize()`. The first drove the providers to the
      Ready state; the second then found a provider already Ready before it
      had called `EnsureReadyAsync()` and hit the `LOG(FATAL)`, crashing the
      browser.

      Build `//services/webnn/host` as a `component()` instead of a
      `source_set()` and export its public symbols with
      `COMPONENT_EXPORT(WEBNN_HOST)`. As a component it links into its own
      shared library, so `content.dll` and `components_viz_host.dll` share a
      single copy of the code and thus a single
      `ExecutionProviderInitializer`. `Initialize()` now runs exactly once.
      Bug: 527089999
      Change-Id: Ie4dbbe37afce5da49fc85090049c3a5070a1afc8
      Reviewed-by: Reilly Grant <rei...@chromium.org>
      Commit-Queue: Xu, Mingming1 <mingmi...@intel.com>
      Reviewed-by: Hu, Ningxin <ningx...@intel.com>
      Cr-Commit-Position: refs/heads/main@{#1652122}
      Files:
      • M services/webnn/host/BUILD.gn
      • M services/webnn/host/execution_provider_initializer.h
      • M services/webnn/host/weights_file_creator_impl.h
      • M services/webnn/host/weights_file_provider.h
      Change size: S
      Delta: 4 files changed, 14 insertions(+), 2 deletions(-)
      Branch: refs/heads/main
      Submit Requirements:
      • requirement satisfiedCode-Review: +1 by Reilly Grant, +1 by Hu, Ningxin
      Open in Gerrit
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: merged
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ie4dbbe37afce5da49fc85090049c3a5070a1afc8
      Gerrit-Change-Number: 7988725
      Gerrit-PatchSet: 3
      Gerrit-Owner: Xu, Mingming1 <mingmi...@intel.com>
      Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
      Gerrit-Reviewer: Hu, Ningxin <ningx...@intel.com>
      Gerrit-Reviewer: Reilly Grant <rei...@chromium.org>
      Gerrit-Reviewer: Xu, Mingming1 <mingmi...@intel.com>
      open
      diffy
      satisfied_requirement
      Reply all
      Reply to author
      Forward
      0 new messages