[webgpu][blink] Adds the capability to enable multithread GPU replies. [chromium/src : main]

0 views
Skip to first unread message

Loko Kung (Gerrit)

unread,
Dec 2, 2025, 2:57:15 AMDec 2
to Daniel Cheng, Kai Ninomiya, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Stephen Chenney, gavinp...@chromium.org, jmedle...@chromium.org, blink-re...@chromium.org, blink-reviews-p...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, cwalle...@chromium.org, drott+bl...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, kainin...@chromium.org, kinuko...@chromium.org
Attention needed from Daniel Cheng and Kai Ninomiya

Loko Kung voted Commit-Queue+1

Commit-Queue+1
Open in Gerrit

Related details

Attention is currently required from:
  • Daniel Cheng
  • Kai Ninomiya
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: I540c9c5752261490eed9ee20a0a69bb3d5947d93
Gerrit-Change-Number: 7080760
Gerrit-PatchSet: 13
Gerrit-Owner: Loko Kung <loko...@google.com>
Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
Gerrit-Reviewer: Kai Ninomiya <kai...@chromium.org>
Gerrit-Reviewer: Loko Kung <loko...@google.com>
Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
Gerrit-CC: Stephen Chenney <sche...@chromium.org>
Gerrit-Attention: Kai Ninomiya <kai...@chromium.org>
Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
Gerrit-Comment-Date: Tue, 02 Dec 2025 07:57:04 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Kai Ninomiya (Gerrit)

unread,
Dec 5, 2025, 4:54:41 PMDec 5
to Loko Kung, Code Review Nudger, Daniel Cheng, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Stephen Chenney, gavinp...@chromium.org, jmedle...@chromium.org, blink-re...@chromium.org, blink-reviews-p...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, cwalle...@chromium.org, drott+bl...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, kainin...@chromium.org, kinuko...@chromium.org
Attention needed from Daniel Cheng and Loko Kung

Kai Ninomiya voted and added 4 comments

Votes added by Kai Ninomiya

Code-Review+1

4 comments

File third_party/blink/public/platform/platform.h
Line 533, Patchset 13 (Latest): base::StrongAlias<class WebGPUHandleGPUReplyOnIOThreadTag, bool>;
Kai Ninomiya . resolved

I had no idea base had this (and IdType), this is good to know about! chrome graphics code needs a LOT of these...

File third_party/blink/renderer/modules/webgpu/dawn_object.h
Line 58, Patchset 13 (Latest): wgpu::WaitStatus WaitAny(
Kai Ninomiya . unresolved

It's a bit odd to put this publicly on DawnObjectBase because it kind of sounds like it matters which object you call WaitAny on. Could make it `protected` but how about just having (public) `DawnObjectBase::GetInstance()` and make callers call through that? (This would get rid of the default timeout but it doesn't seem to be used.)

File third_party/blink/renderer/platform/graphics/gpu/webgpu_callback.h
Line 35, Patchset 13 (Latest): // Function pointer type must be a raw pointer.
Kai Ninomiya . unresolved

nit: Could the struct use `raw_ptr` and just make the caller use `.get()`?

Line 33, Patchset 13 (Latest):struct WGPUOnceCallbackInfo {
Kai Ninomiya . unresolved

nit: make this non-copyable

Open in Gerrit

Related details

Attention is currently required from:
  • Daniel Cheng
  • Loko Kung
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not 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: I540c9c5752261490eed9ee20a0a69bb3d5947d93
    Gerrit-Change-Number: 7080760
    Gerrit-PatchSet: 13
    Gerrit-Owner: Loko Kung <loko...@google.com>
    Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
    Gerrit-Reviewer: Kai Ninomiya <kai...@chromium.org>
    Gerrit-Reviewer: Loko Kung <loko...@google.com>
    Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
    Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
    Gerrit-CC: Stephen Chenney <sche...@chromium.org>
    Gerrit-Attention: Loko Kung <loko...@google.com>
    Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
    Gerrit-Comment-Date: Fri, 05 Dec 2025 21:54:26 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Daniel Cheng (Gerrit)

    unread,
    Dec 8, 2025, 11:16:04 PM (11 days ago) Dec 8
    to Loko Kung, Dominic Farolino, Kai Ninomiya, Code Review Nudger, Daniel Cheng, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Stephen Chenney, gavinp...@chromium.org, jmedle...@chromium.org, blink-re...@chromium.org, blink-reviews-p...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, cwalle...@chromium.org, drott+bl...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, kainin...@chromium.org, kinuko...@chromium.org
    Attention needed from Dominic Farolino and Loko Kung

    Daniel Cheng added 1 comment

    Patchset-level comments
    File-level comment, Patchset 13 (Latest):
    Daniel Cheng . resolved

    Sorry I've been a bit late here. +dom@ for a first pass on public

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Dominic Farolino
    • Loko Kung
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not 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: I540c9c5752261490eed9ee20a0a69bb3d5947d93
    Gerrit-Change-Number: 7080760
    Gerrit-PatchSet: 13
    Gerrit-Owner: Loko Kung <loko...@google.com>
    Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
    Gerrit-Reviewer: Dominic Farolino <d...@chromium.org>
    Gerrit-Reviewer: Kai Ninomiya <kai...@chromium.org>
    Gerrit-Reviewer: Loko Kung <loko...@google.com>
    Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
    Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
    Gerrit-CC: Stephen Chenney <sche...@chromium.org>
    Gerrit-Attention: Dominic Farolino <d...@chromium.org>
    Gerrit-Attention: Loko Kung <loko...@google.com>
    Gerrit-Comment-Date: Tue, 09 Dec 2025 04:15:50 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Dominic Farolino (Gerrit)

    unread,
    Dec 9, 2025, 10:56:54 AM (11 days ago) Dec 9
    to Loko Kung, Kai Ninomiya, Code Review Nudger, Daniel Cheng, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Stephen Chenney, gavinp...@chromium.org, jmedle...@chromium.org, blink-re...@chromium.org, blink-reviews-p...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, cwalle...@chromium.org, drott+bl...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, kainin...@chromium.org, kinuko...@chromium.org
    Attention needed from Loko Kung

    Dominic Farolino added 1 comment

    File third_party/blink/public/platform/platform.h
    Line 533, Patchset 13 (Latest): base::StrongAlias<class WebGPUHandleGPUReplyOnIOThreadTag, bool>;
    Dominic Farolino . unresolved

    Why is this better than just a boolean? Is there any special risk of it being confused for, or assigned to, something else by mistake? I guess I'm trying to ask if this is better that just annotating in code comments `/*arg_name=*/false`. StrongAlias seems most useful when there are multiple differently-named types with the same backing type in close proximity.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Loko Kung
    Gerrit-Attention: Loko Kung <loko...@google.com>
    Gerrit-Comment-Date: Tue, 09 Dec 2025 15:56:44 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Kai Ninomiya (Gerrit)

    unread,
    Dec 9, 2025, 6:06:28 PM (11 days ago) Dec 9
    to Loko Kung, Dominic Farolino, Code Review Nudger, Daniel Cheng, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Stephen Chenney, gavinp...@chromium.org, jmedle...@chromium.org, blink-re...@chromium.org, blink-reviews-p...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, cwalle...@chromium.org, drott+bl...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, kainin...@chromium.org, kinuko...@chromium.org
    Attention needed from Loko Kung

    Kai Ninomiya added 1 comment

    File third_party/blink/public/platform/platform.h
    Line 533, Patchset 13 (Latest): base::StrongAlias<class WebGPUHandleGPUReplyOnIOThreadTag, bool>;
    Dominic Farolino . unresolved

    Why is this better than just a boolean? Is there any special risk of it being confused for, or assigned to, something else by mistake? I guess I'm trying to ask if this is better that just annotating in code comments `/*arg_name=*/false`. StrongAlias seems most useful when there are multiple differently-named types with the same backing type in close proximity.

    Kai Ninomiya

    I personally think it's good because it's passed through many layers of the stack. I don't see neighboring bool arguments in any of the functions where it's used but there are still opportunities to mix it up.

    Does Chromium have a lint that checks `/*arg_name=*/` comments are correct? I think it does; if so then bool is totally fine. (We usually work in Dawn and we don't often use that pattern.)

    Gerrit-Comment-Date: Tue, 09 Dec 2025 23:06:16 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Dominic Farolino <d...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Dominic Farolino (Gerrit)

    unread,
    Dec 10, 2025, 12:29:19 PM (10 days ago) Dec 10
    to Loko Kung, Kai Ninomiya, Code Review Nudger, Daniel Cheng, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Stephen Chenney, gavinp...@chromium.org, jmedle...@chromium.org, blink-re...@chromium.org, blink-reviews-p...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, cwalle...@chromium.org, drott+bl...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, kainin...@chromium.org, kinuko...@chromium.org
    Attention needed from Loko Kung

    Dominic Farolino voted and added 2 comments

    Votes added by Dominic Farolino

    Code-Review+1

    2 comments

    Patchset-level comments
    Dominic Farolino . resolved

    lgtm; off to dcheng@

    File third_party/blink/public/platform/platform.h
    Line 533, Patchset 13 (Latest): base::StrongAlias<class WebGPUHandleGPUReplyOnIOThreadTag, bool>;
    Dominic Farolino . resolved

    Why is this better than just a boolean? Is there any special risk of it being confused for, or assigned to, something else by mistake? I guess I'm trying to ask if this is better that just annotating in code comments `/*arg_name=*/false`. StrongAlias seems most useful when there are multiple differently-named types with the same backing type in close proximity.

    Kai Ninomiya

    I personally think it's good because it's passed through many layers of the stack. I don't see neighboring bool arguments in any of the functions where it's used but there are still opportunities to mix it up.

    Does Chromium have a lint that checks `/*arg_name=*/` comments are correct? I think it does; if so then bool is totally fine. (We usually work in Dawn and we don't often use that pattern.)

    Dominic Farolino

    I don't think Chromium has such a lint check, at least not that I've experienced recently. I don't feel strongly against this, though I feel like it's slightly overkill.

    Gerrit-Comment-Date: Wed, 10 Dec 2025 17:29:11 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Dominic Farolino <d...@chromium.org>
    Comment-In-Reply-To: Kai Ninomiya <kai...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Kai Ninomiya (Gerrit)

    unread,
    Dec 10, 2025, 7:06:12 PM (10 days ago) Dec 10
    to Loko Kung, Dominic Farolino, Code Review Nudger, Daniel Cheng, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Stephen Chenney, gavinp...@chromium.org, jmedle...@chromium.org, blink-re...@chromium.org, blink-reviews-p...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, cwalle...@chromium.org, drott+bl...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, kainin...@chromium.org, kinuko...@chromium.org
    Attention needed from Loko Kung

    Kai Ninomiya added 1 comment

    File third_party/blink/public/platform/platform.h
    Line 533, Patchset 13 (Latest): base::StrongAlias<class WebGPUHandleGPUReplyOnIOThreadTag, bool>;
    Dominic Farolino . unresolved

    Why is this better than just a boolean? Is there any special risk of it being confused for, or assigned to, something else by mistake? I guess I'm trying to ask if this is better that just annotating in code comments `/*arg_name=*/false`. StrongAlias seems most useful when there are multiple differently-named types with the same backing type in close proximity.

    Kai Ninomiya

    I personally think it's good because it's passed through many layers of the stack. I don't see neighboring bool arguments in any of the functions where it's used but there are still opportunities to mix it up.

    Does Chromium have a lint that checks `/*arg_name=*/` comments are correct? I think it does; if so then bool is totally fine. (We usually work in Dawn and we don't often use that pattern.)

    Dominic Farolino

    I don't think Chromium has such a lint check, at least not that I've experienced recently. I don't feel strongly against this, though I feel like it's slightly overkill.

    Kai Ninomiya

    Tested and unfortunately there isn't an _enforced_ lint, but there _is_ a clang-tidy warning that will at least alert about this on Gerrit! https://chromium-review.googlesource.com/c/chromium/src/+/7247461/2/services/viz/public/cpp/gpu/gpu.cc

    Regardless I'm OK either way but I'll leave this open for Loko to look at when he's back.

    Gerrit-Comment-Date: Thu, 11 Dec 2025 00:06:00 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Daniel Cheng (Gerrit)

    unread,
    Dec 11, 2025, 2:46:46 AM (9 days ago) Dec 11
    to Loko Kung, Dominic Farolino, Kai Ninomiya, Code Review Nudger, Daniel Cheng, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Stephen Chenney, gavinp...@chromium.org, jmedle...@chromium.org, blink-re...@chromium.org, blink-reviews-p...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, cwalle...@chromium.org, drott+bl...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, kainin...@chromium.org, kinuko...@chromium.org
    Attention needed from Loko Kung

    Daniel Cheng added 6 comments

    File third_party/blink/public/platform/platform.h
    Line 533, Patchset 13 (Latest): base::StrongAlias<class WebGPUHandleGPUReplyOnIOThreadTag, bool>;
    Dominic Farolino . unresolved

    Why is this better than just a boolean? Is there any special risk of it being confused for, or assigned to, something else by mistake? I guess I'm trying to ask if this is better that just annotating in code comments `/*arg_name=*/false`. StrongAlias seems most useful when there are multiple differently-named types with the same backing type in close proximity.

    Kai Ninomiya

    I personally think it's good because it's passed through many layers of the stack. I don't see neighboring bool arguments in any of the functions where it's used but there are still opportunities to mix it up.

    Does Chromium have a lint that checks `/*arg_name=*/` comments are correct? I think it does; if so then bool is totally fine. (We usually work in Dawn and we don't often use that pattern.)

    Dominic Farolino

    I don't think Chromium has such a lint check, at least not that I've experienced recently. I don't feel strongly against this, though I feel like it's slightly overkill.

    Kai Ninomiya

    Tested and unfortunately there isn't an _enforced_ lint, but there _is_ a clang-tidy warning that will at least alert about this on Gerrit! https://chromium-review.googlesource.com/c/chromium/src/+/7247461/2/services/viz/public/cpp/gpu/gpu.cc

    Regardless I'm OK either way but I'll leave this open for Loko to look at when he's back.

    Daniel Cheng

    I'd suggest just using an enum class here. It'll be almost as compact, and it's part of the official Blink guidelines.

    Though... I didn't realize that the guidelines changed to allow StrongAlias here too: https://chromium.googlesource.com/chromium/src/+/main/styleguide/c++/blink-c++.md#prefer-enums-or-strongaliases-to-bare-bools-for-function-parameters

    My personal feeling is enums are still better for readability but I'm not going to push strongly on this.

    File third_party/blink/renderer/modules/webgpu/dawn_object.h
    Line 60, Patchset 13 (Latest): uint64_t timeout_ns = std::numeric_limits<uint64_t>::max());
    Daniel Cheng . unresolved

    Does it add a lot of plumbing to use `base::TimeDelta` and only convert to nanoseconds where needed to interact with dawn?

    File third_party/blink/renderer/modules/webgpu/gpu.cc
    Line 391, Patchset 13 (Latest): &dawn_options, callback_info.mode, callback_info.callback,
    callback_info.userdata);
    Daniel Cheng . unresolved

    Seeing this makes me wonder if we should just be passing `callback_info` as a bundle here.

    File third_party/blink/renderer/modules/webgpu/gpu_device.cc
    Line 813, Patchset 13 (Latest): // Set the uncaptured error callback first because it's ownership will be
    Daniel Cheng . unresolved

    Nit: its

    Line 817, Patchset 13 (Latest): // whether we are being handled off the main thread, if so, we proxy to the
    Daniel Cheng . unresolved

    Nit: handed?

    File third_party/blink/renderer/platform/graphics/gpu/webgpu_callback.h
    Line 35, Patchset 13 (Latest): // Function pointer type must be a raw pointer.
    Kai Ninomiya . unresolved

    nit: Could the struct use `raw_ptr` and just make the caller use `.get()`?

    Daniel Cheng

    Function pointers are supposed to be excluded from this check by default.

    Are we using this to hold non-function-pointer things, or is the plugin getting confused?

    Gerrit-Comment-Date: Thu, 11 Dec 2025 07:46:34 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Kai Ninomiya (Gerrit)

    unread,
    Dec 11, 2025, 5:04:59 PM (9 days ago) Dec 11
    to Loko Kung, Dominic Farolino, Code Review Nudger, Daniel Cheng, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Stephen Chenney, gavinp...@chromium.org, jmedle...@chromium.org, blink-re...@chromium.org, blink-reviews-p...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, cwalle...@chromium.org, drott+bl...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, kainin...@chromium.org, kinuko...@chromium.org
    Attention needed from Loko Kung

    Kai Ninomiya added 3 comments

    File third_party/blink/public/platform/platform.h
    Line 533, Patchset 13 (Latest): base::StrongAlias<class WebGPUHandleGPUReplyOnIOThreadTag, bool>;
    Dominic Farolino . unresolved

    Why is this better than just a boolean? Is there any special risk of it being confused for, or assigned to, something else by mistake? I guess I'm trying to ask if this is better that just annotating in code comments `/*arg_name=*/false`. StrongAlias seems most useful when there are multiple differently-named types with the same backing type in close proximity.

    Kai Ninomiya

    I personally think it's good because it's passed through many layers of the stack. I don't see neighboring bool arguments in any of the functions where it's used but there are still opportunities to mix it up.

    Does Chromium have a lint that checks `/*arg_name=*/` comments are correct? I think it does; if so then bool is totally fine. (We usually work in Dawn and we don't often use that pattern.)

    Dominic Farolino

    I don't think Chromium has such a lint check, at least not that I've experienced recently. I don't feel strongly against this, though I feel like it's slightly overkill.

    Kai Ninomiya

    Tested and unfortunately there isn't an _enforced_ lint, but there _is_ a clang-tidy warning that will at least alert about this on Gerrit! https://chromium-review.googlesource.com/c/chromium/src/+/7247461/2/services/viz/public/cpp/gpu/gpu.cc

    Regardless I'm OK either way but I'll leave this open for Loko to look at when he's back.

    Daniel Cheng

    I'd suggest just using an enum class here. It'll be almost as compact, and it's part of the official Blink guidelines.

    Though... I didn't realize that the guidelines changed to allow StrongAlias here too: https://chromium.googlesource.com/chromium/src/+/main/styleguide/c++/blink-c++.md#prefer-enums-or-strongaliases-to-bare-bools-for-function-parameters

    My personal feeling is enums are still better for readability but I'm not going to push strongly on this.

    Kai Ninomiya

    Good point, an enum with "IOThread" and "MainThread" would make sense.

    File third_party/blink/renderer/modules/webgpu/gpu.cc
    Line 391, Patchset 13 (Latest): &dawn_options, callback_info.mode, callback_info.callback,
    callback_info.userdata);
    Daniel Cheng . unresolved

    Seeing this makes me wonder if we should just be passing `callback_info` as a bundle here.

    Kai Ninomiya

    This would require a Dawn change, but agree it's probably something we should do later. Dawn's C API _does_ now take it as a bundle, we just haven't changed the C++ API to match.

    File third_party/blink/renderer/modules/webgpu/gpu_device.cc
    Line 817, Patchset 13 (Latest): // whether we are being handled off the main thread, if so, we proxy to the
    Daniel Cheng . unresolved

    Nit: handed?

    Kai Ninomiya

    "handled" is correct since it's talking about where gpu->renderer messages are handled. Maybe wording of this sentence could be a bit clearer

    Gerrit-Comment-Date: Thu, 11 Dec 2025 22:04:46 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Dominic Farolino <d...@chromium.org>
    Comment-In-Reply-To: Kai Ninomiya <kai...@chromium.org>
    Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Loko Kung (Gerrit)

    unread,
    Dec 18, 2025, 12:57:51 PM (2 days ago) Dec 18
    to Dominic Farolino, Kai Ninomiya, Code Review Nudger, Daniel Cheng, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Stephen Chenney, gavinp...@chromium.org, jmedle...@chromium.org, blink-re...@chromium.org, blink-reviews-p...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, cwalle...@chromium.org, drott+bl...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, kainin...@chromium.org, kinuko...@chromium.org
    Attention needed from Daniel Cheng, Dominic Farolino and Kai Ninomiya

    Loko Kung added 8 comments

    File third_party/blink/public/platform/platform.h
    Line 533, Patchset 13: base::StrongAlias<class WebGPUHandleGPUReplyOnIOThreadTag, bool>;
    Dominic Farolino . resolved

    Why is this better than just a boolean? Is there any special risk of it being confused for, or assigned to, something else by mistake? I guess I'm trying to ask if this is better that just annotating in code comments `/*arg_name=*/false`. StrongAlias seems most useful when there are multiple differently-named types with the same backing type in close proximity.

    Kai Ninomiya

    I personally think it's good because it's passed through many layers of the stack. I don't see neighboring bool arguments in any of the functions where it's used but there are still opportunities to mix it up.

    Does Chromium have a lint that checks `/*arg_name=*/` comments are correct? I think it does; if so then bool is totally fine. (We usually work in Dawn and we don't often use that pattern.)

    Dominic Farolino

    I don't think Chromium has such a lint check, at least not that I've experienced recently. I don't feel strongly against this, though I feel like it's slightly overkill.

    Kai Ninomiya

    Tested and unfortunately there isn't an _enforced_ lint, but there _is_ a clang-tidy warning that will at least alert about this on Gerrit! https://chromium-review.googlesource.com/c/chromium/src/+/7247461/2/services/viz/public/cpp/gpu/gpu.cc

    Regardless I'm OK either way but I'll leave this open for Loko to look at when he's back.

    Daniel Cheng

    I'd suggest just using an enum class here. It'll be almost as compact, and it's part of the official Blink guidelines.

    Though... I didn't realize that the guidelines changed to allow StrongAlias here too: https://chromium.googlesource.com/chromium/src/+/main/styleguide/c++/blink-c++.md#prefer-enums-or-strongaliases-to-bare-bools-for-function-parameters

    My personal feeling is enums are still better for readability but I'm not going to push strongly on this.

    Kai Ninomiya

    Good point, an enum with "IOThread" and "MainThread" would make sense.

    Loko Kung

    Done using enums.

    File third_party/blink/renderer/modules/webgpu/dawn_object.h
    Line 60, Patchset 13: uint64_t timeout_ns = std::numeric_limits<uint64_t>::max());
    Daniel Cheng . resolved

    Does it add a lot of plumbing to use `base::TimeDelta` and only convert to nanoseconds where needed to interact with dawn?

    Loko Kung

    No longer applicable.

    Line 58, Patchset 13: wgpu::WaitStatus WaitAny(
    Kai Ninomiya . resolved

    It's a bit odd to put this publicly on DawnObjectBase because it kind of sounds like it matters which object you call WaitAny on. Could make it `protected` but how about just having (public) `DawnObjectBase::GetInstance()` and make callers call through that? (This would get rid of the default timeout but it doesn't seem to be used.)

    Loko Kung

    Done

    File third_party/blink/renderer/modules/webgpu/gpu.cc
    Line 391, Patchset 13: &dawn_options, callback_info.mode, callback_info.callback,
    callback_info.userdata);
    Daniel Cheng . resolved

    Seeing this makes me wonder if we should just be passing `callback_info` as a bundle here.

    Kai Ninomiya

    This would require a Dawn change, but agree it's probably something we should do later. Dawn's C API _does_ now take it as a bundle, we just haven't changed the C++ API to match.

    Loko Kung

    Acknowledged

    File third_party/blink/renderer/modules/webgpu/gpu_device.cc
    Line 813, Patchset 13: // Set the uncaptured error callback first because it's ownership will be
    Daniel Cheng . resolved

    Nit: its

    Loko Kung

    Done

    Line 817, Patchset 13: // whether we are being handled off the main thread, if so, we proxy to the
    Daniel Cheng . resolved

    Nit: handed?

    Kai Ninomiya

    "handled" is correct since it's talking about where gpu->renderer messages are handled. Maybe wording of this sentence could be a bit clearer

    Loko Kung

    Acknowledged

    File third_party/blink/renderer/platform/graphics/gpu/webgpu_callback.h
    Line 35, Patchset 13: // Function pointer type must be a raw pointer.
    Kai Ninomiya . resolved

    nit: Could the struct use `raw_ptr` and just make the caller use `.get()`?

    Daniel Cheng

    Function pointers are supposed to be excluded from this check by default.

    Are we using this to hold non-function-pointer things, or is the plugin getting confused?

    Loko Kung

    No longer applicable.

    Line 33, Patchset 13:struct WGPUOnceCallbackInfo {
    Kai Ninomiya . resolved

    nit: make this non-copyable

    Loko Kung

    No longer applicable.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Daniel Cheng
    • Dominic Farolino
    • Kai Ninomiya
    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: I540c9c5752261490eed9ee20a0a69bb3d5947d93
      Gerrit-Change-Number: 7080760
      Gerrit-PatchSet: 16
      Gerrit-Owner: Loko Kung <loko...@google.com>
      Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
      Gerrit-Reviewer: Dominic Farolino <d...@chromium.org>
      Gerrit-Reviewer: Kai Ninomiya <kai...@chromium.org>
      Gerrit-Reviewer: Loko Kung <loko...@google.com>
      Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
      Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
      Gerrit-CC: Stephen Chenney <sche...@chromium.org>
      Gerrit-Attention: Dominic Farolino <d...@chromium.org>
      Gerrit-Attention: Kai Ninomiya <kai...@chromium.org>
      Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
      Gerrit-Comment-Date: Thu, 18 Dec 2025 17:57:44 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Kai Ninomiya (Gerrit)

      unread,
      Dec 18, 2025, 2:28:41 PM (2 days ago) Dec 18
      to Loko Kung, Dominic Farolino, Code Review Nudger, Daniel Cheng, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Stephen Chenney, gavinp...@chromium.org, jmedle...@chromium.org, blink-re...@chromium.org, blink-reviews-p...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, cwalle...@chromium.org, drott+bl...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, kainin...@chromium.org, kinuko...@chromium.org
      Attention needed from Daniel Cheng, Dominic Farolino and Loko Kung

      Kai Ninomiya voted Code-Review+1

      Code-Review+1
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Daniel Cheng
      • Dominic Farolino
      • Loko Kung
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not 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: I540c9c5752261490eed9ee20a0a69bb3d5947d93
        Gerrit-Change-Number: 7080760
        Gerrit-PatchSet: 16
        Gerrit-Owner: Loko Kung <loko...@google.com>
        Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
        Gerrit-Reviewer: Dominic Farolino <d...@chromium.org>
        Gerrit-Reviewer: Kai Ninomiya <kai...@chromium.org>
        Gerrit-Reviewer: Loko Kung <loko...@google.com>
        Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
        Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
        Gerrit-CC: Stephen Chenney <sche...@chromium.org>
        Gerrit-Attention: Dominic Farolino <d...@chromium.org>
        Gerrit-Attention: Loko Kung <loko...@google.com>
        Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
        Gerrit-Comment-Date: Thu, 18 Dec 2025 19:28:35 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Daniel Cheng (Gerrit)

        unread,
        Dec 19, 2025, 3:54:36 PM (17 hours ago) Dec 19
        to Loko Kung, Daniel Cheng, Kai Ninomiya, Dominic Farolino, Code Review Nudger, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Stephen Chenney, gavinp...@chromium.org, jmedle...@chromium.org, blink-re...@chromium.org, blink-reviews-p...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, cwalle...@chromium.org, drott+bl...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, kainin...@chromium.org, kinuko...@chromium.org
        Attention needed from Dominic Farolino and Loko Kung

        Daniel Cheng voted and added 5 comments

        Votes added by Daniel Cheng

        Code-Review+1

        5 comments

        Patchset-level comments
        File-level comment, Patchset 16 (Latest):
        Daniel Cheng . resolved

        LGTM w/nits addressed–apologies for the delay.

        Addressing the nits may wipe the CR+1 bit, sorry :(

        File content/renderer/renderer_blink_platform_impl.cc
        Line 846, Patchset 16 (Latest): ipc_task_runner);
        Daniel Cheng . unresolved

        Nit: std::move() here.

        File third_party/blink/public/platform/DEPS
        Line 28, Patchset 16 (Latest): "+base/types/strong_alias.h",
        Daniel Cheng . unresolved

        Probably not needed anymore

        File third_party/blink/public/platform/platform.h
        Line 46, Patchset 16 (Latest):#include "base/types/strong_alias.h"
        Daniel Cheng . unresolved

        Same here; I think this can be removed.

        File third_party/blink/renderer/modules/webgpu/gpu_device.cc
        Line 339, Patchset 16 (Latest): String message) {
        Daniel Cheng . unresolved

        Nit: pass by const ref here since we're not passing ownership. While `String` is cheap to copy as a ref-counted wrapper around the actual `StringImpl`, not bumping refcount at all is free (...ish, of course there's a pointer indirection :)

        (We could, but none of the constructors take `message` by value–and even if they did, we still need to reference `message` after calling the constructor for the error)

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Dominic Farolino
        • Loko Kung
        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: I540c9c5752261490eed9ee20a0a69bb3d5947d93
        Gerrit-Change-Number: 7080760
        Gerrit-PatchSet: 16
        Gerrit-Owner: Loko Kung <loko...@google.com>
        Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
        Gerrit-Reviewer: Dominic Farolino <d...@chromium.org>
        Gerrit-Reviewer: Kai Ninomiya <kai...@chromium.org>
        Gerrit-Reviewer: Loko Kung <loko...@google.com>
        Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
        Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
        Gerrit-CC: Stephen Chenney <sche...@chromium.org>
        Gerrit-Attention: Dominic Farolino <d...@chromium.org>
        Gerrit-Attention: Loko Kung <loko...@google.com>
        Gerrit-Comment-Date: Fri, 19 Dec 2025 20:54:19 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy
        Reply all
        Reply to author
        Forward
        0 new messages