cpu_performance: Improve the default implementation [chromium/src : main]

0 views
Skip to first unread message

Nikolaos Papaspyrou (Gerrit)

unread,
Feb 4, 2026, 9:27:33 AM (3 days ago) Feb 4
to Dave Tapuska, Michael Lippautz, Chromium LUCI CQ, chromium...@chromium.org
Attention needed from Dave Tapuska and Michael Lippautz

Nikolaos Papaspyrou voted and added 1 comment

Votes added by Nikolaos Papaspyrou

Commit-Queue+1

1 comment

Patchset-level comments
File-level comment, Patchset 2 (Latest):
Nikolaos Papaspyrou . resolved

PTAL, thank you!
It would be great if we could land this before the M146 cut.

Open in Gerrit

Related details

Attention is currently required from:
  • Dave Tapuska
  • Michael Lippautz
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: I5cd341d1273077fb3a19f13477c4620c5b7d4d9d
Gerrit-Change-Number: 7532183
Gerrit-PatchSet: 2
Gerrit-Owner: Nikolaos Papaspyrou <niko...@chromium.org>
Gerrit-Reviewer: Dave Tapuska <dtap...@chromium.org>
Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
Gerrit-Reviewer: Nikolaos Papaspyrou <niko...@chromium.org>
Gerrit-Attention: Michael Lippautz <mlip...@chromium.org>
Gerrit-Attention: Dave Tapuska <dtap...@chromium.org>
Gerrit-Comment-Date: Wed, 04 Feb 2026 14:27:17 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Dave Tapuska (Gerrit)

unread,
Feb 4, 2026, 9:39:59 AM (3 days ago) Feb 4
to Nikolaos Papaspyrou, Mark Mentovai, Michael Lippautz, Chromium LUCI CQ, chromium...@chromium.org
Attention needed from Mark Mentovai, Michael Lippautz and Nikolaos Papaspyrou

Dave Tapuska added 1 comment

Patchset-level comments
Dave Tapuska . unresolved

I do not love this regular expression at all.

Is there not something we can do with x86 process_type and family/stepping. Those are widely available to be read across platforms.

And on ARM there are certainly similar things to read directly from cpu info.

Adding Mark because this seems like it should be using base directly and we should add functions there that expose the information we want about CPU info if they already do not exist.

Open in Gerrit

Related details

Attention is currently required from:
  • Mark Mentovai
  • Michael Lippautz
  • Nikolaos Papaspyrou
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: I5cd341d1273077fb3a19f13477c4620c5b7d4d9d
    Gerrit-Change-Number: 7532183
    Gerrit-PatchSet: 2
    Gerrit-Owner: Nikolaos Papaspyrou <niko...@chromium.org>
    Gerrit-Reviewer: Dave Tapuska <dtap...@chromium.org>
    Gerrit-Reviewer: Mark Mentovai <ma...@chromium.org>
    Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
    Gerrit-Reviewer: Nikolaos Papaspyrou <niko...@chromium.org>
    Gerrit-Attention: Mark Mentovai <ma...@chromium.org>
    Gerrit-Attention: Nikolaos Papaspyrou <niko...@chromium.org>
    Gerrit-Attention: Michael Lippautz <mlip...@chromium.org>
    Gerrit-Comment-Date: Wed, 04 Feb 2026 14:39:54 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Mark Mentovai (Gerrit)

    unread,
    Feb 4, 2026, 10:31:55 AM (3 days ago) Feb 4
    to Nikolaos Papaspyrou, Dave Tapuska, Michael Lippautz, Chromium LUCI CQ, chromium...@chromium.org
    Attention needed from Michael Lippautz and Nikolaos Papaspyrou

    Mark Mentovai added 2 comments

    Patchset-level comments
    Mark Mentovai . unresolved

    I agree with Dave. The list of regexes will be very fragile.

    Even if you need to introspect on a per-model basis in order to classify things into tiers, I think it’d be better do do with structured data such as what you might obtain from an OS or hardware interface, or ideally, a wrapper like base/cpu.h.

    Here are a few key points that I see missing from the design (https://github.com/WICG/cpu-performance) that might help guide this in productive direction.

    1. Are all browsers that implement this expected to map the same CPUs into the same tiers? (I think that “implementation-specific” means “no”, but I’m not positive—it might mean something else, or more, or less. Certainly the tier number is of less utility if the web is expected to implement things like the doc’s example switch block, but each browser assigns its own tiers.)

    2. How will newly introduced CPUs be assigned a tier and make their way into whatever logic is implemented (regexes, structured cpuinfo, or otherwise).

    3. There will inevitably be bugs where a CPU will be mis-classified into an inappropriate live tier (not tier 0). This might happen as a result of a newly introduced CPU that doesn’t map to the existing logic (especially if regex-oriented as here), or it might happen as a result of bugs introduced as this code is maintained. A CPU isn’t supposed to move between tiers. What happens now?

    4. The design is very heavily motivated by a single use case, video calls. CPU performance is only one aspect of a system’s suitability for this application—some tasks crucial to its performance might be offloaded off-CPU, while other aspects of suitability might be hard-gated on other aspects of system design or configuration. I’ll assume that there are other interfaces to get that information, so, fine, we can focus on just the CPU here. There’s still trouble: an assigned CPU tier that focuses too heavily on an application such as video calling might prioritize a CPU that has certain hardware tuning beneficial for audio/video encode/decode despite otherwise being a mediocre performer. That makes the interface’s applicability far less general than the doc purports to provide. In that case, it might not be “navigator.cpuPerformance” at all, but “navigator.cpuPerformanceForVp9EncodeAndDecodeAndNothingMore”.

    File content/browser/cpu_performance/cpu_performance.cc
    Line 158, Patchset 2 (Latest): // Post the task that will update the tier asynchronously, using the more
    // accurate (but potentially blocking) implementation.
    base::ThreadPool::PostTask(
    FROM_HERE, {base::MayBlock(), base::TaskPriority::USER_VISIBLE},
    base::BindOnce([]() {
    Tier tier = GetTierFromCpuInfo(base::SysInfo::CPUModelName(),
    base::SysInfo::NumberOfProcessors());
    g_tier_cached.store(tier);
    }));
    }
    Mark Mentovai . unresolved

    Can you call out what’s blocking? As written below, I don‘t see it. It looks like a long chain of regexes.

    Slow? Maybe. But blocking?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Michael Lippautz
    • Nikolaos Papaspyrou
    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: I5cd341d1273077fb3a19f13477c4620c5b7d4d9d
    Gerrit-Change-Number: 7532183
    Gerrit-PatchSet: 2
    Gerrit-Owner: Nikolaos Papaspyrou <niko...@chromium.org>
    Gerrit-Reviewer: Dave Tapuska <dtap...@chromium.org>
    Gerrit-Reviewer: Mark Mentovai <ma...@chromium.org>
    Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
    Gerrit-Reviewer: Nikolaos Papaspyrou <niko...@chromium.org>
    Gerrit-Attention: Nikolaos Papaspyrou <niko...@chromium.org>
    Gerrit-Attention: Michael Lippautz <mlip...@chromium.org>
    Gerrit-Comment-Date: Wed, 04 Feb 2026 15:31:49 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Nikolaos Papaspyrou (Gerrit)

    unread,
    Feb 4, 2026, 11:03:16 AM (3 days ago) Feb 4
    to Mark Mentovai, Dave Tapuska, Michael Lippautz, Chromium LUCI CQ, chromium...@chromium.org
    Attention needed from Mark Mentovai and Michael Lippautz

    Nikolaos Papaspyrou added 1 comment

    File content/browser/cpu_performance/cpu_performance.cc
    Line 158, Patchset 2 (Latest): // Post the task that will update the tier asynchronously, using the more
    // accurate (but potentially blocking) implementation.
    base::ThreadPool::PostTask(
    FROM_HERE, {base::MayBlock(), base::TaskPriority::USER_VISIBLE},
    base::BindOnce([]() {
    Tier tier = GetTierFromCpuInfo(base::SysInfo::CPUModelName(),
    base::SysInfo::NumberOfProcessors());
    g_tier_cached.store(tier);
    }));
    }
    Mark Mentovai . unresolved

    Can you call out what’s blocking? As written below, I don‘t see it. It looks like a long chain of regexes.

    Slow? Maybe. But blocking?

    Nikolaos Papaspyrou

    This was made an async task because `base::SysInfo::CPUModelName()` may be blocking the UI thread, at least on Linux where it reads `/proc/cpuinfo`. PS #1 failed for this reason.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Mark Mentovai
    • Michael Lippautz
    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: I5cd341d1273077fb3a19f13477c4620c5b7d4d9d
    Gerrit-Change-Number: 7532183
    Gerrit-PatchSet: 2
    Gerrit-Owner: Nikolaos Papaspyrou <niko...@chromium.org>
    Gerrit-Reviewer: Dave Tapuska <dtap...@chromium.org>
    Gerrit-Reviewer: Mark Mentovai <ma...@chromium.org>
    Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
    Gerrit-Reviewer: Nikolaos Papaspyrou <niko...@chromium.org>
    Gerrit-Attention: Mark Mentovai <ma...@chromium.org>
    Gerrit-Attention: Michael Lippautz <mlip...@chromium.org>
    Gerrit-Comment-Date: Wed, 04 Feb 2026 16:03:02 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Mark Mentovai <ma...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Mark Mentovai (Gerrit)

    unread,
    Feb 4, 2026, 11:18:54 AM (3 days ago) Feb 4
    to Nikolaos Papaspyrou, Dave Tapuska, Michael Lippautz, Chromium LUCI CQ, chromium...@chromium.org
    Attention needed from Michael Lippautz and Nikolaos Papaspyrou

    Mark Mentovai added 1 comment

    File content/browser/cpu_performance/cpu_performance.cc
    Line 158, Patchset 2 (Latest): // Post the task that will update the tier asynchronously, using the more
    // accurate (but potentially blocking) implementation.
    base::ThreadPool::PostTask(
    FROM_HERE, {base::MayBlock(), base::TaskPriority::USER_VISIBLE},
    base::BindOnce([]() {
    Tier tier = GetTierFromCpuInfo(base::SysInfo::CPUModelName(),
    base::SysInfo::NumberOfProcessors());
    g_tier_cached.store(tier);
    }));
    }
    Mark Mentovai . unresolved

    Can you call out what’s blocking? As written below, I don‘t see it. It looks like a long chain of regexes.

    Slow? Maybe. But blocking?

    Nikolaos Papaspyrou

    This was made an async task because `base::SysInfo::CPUModelName()` may be blocking the UI thread, at least on Linux where it reads `/proc/cpuinfo`. PS #1 failed for this reason.

    Mark Mentovai

    This was made an async task because `base::SysInfo::CPUModelName()` may be blocking the UI thread, at least on Linux where it reads `/proc/cpuinfo`. PS #1 failed for this reason.

    Oh.

    /proc reads don’t really block, but going through the filesystem interface, we don’t really have any way to see that.

    I see. OK. I’d ask that the comment clarify that /proc/cpuinfo is the whole reason for this.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Michael Lippautz
    • Nikolaos Papaspyrou
    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: I5cd341d1273077fb3a19f13477c4620c5b7d4d9d
    Gerrit-Change-Number: 7532183
    Gerrit-PatchSet: 2
    Gerrit-Owner: Nikolaos Papaspyrou <niko...@chromium.org>
    Gerrit-Reviewer: Dave Tapuska <dtap...@chromium.org>
    Gerrit-Reviewer: Mark Mentovai <ma...@chromium.org>
    Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
    Gerrit-Reviewer: Nikolaos Papaspyrou <niko...@chromium.org>
    Gerrit-Attention: Nikolaos Papaspyrou <niko...@chromium.org>
    Gerrit-Attention: Michael Lippautz <mlip...@chromium.org>
    Gerrit-Comment-Date: Wed, 04 Feb 2026 16:18:49 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Mark Mentovai <ma...@chromium.org>
    Comment-In-Reply-To: Nikolaos Papaspyrou <niko...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Nikolaos Papaspyrou (Gerrit)

    unread,
    Feb 4, 2026, 11:54:36 AM (3 days ago) Feb 4
    to Mark Mentovai, Dave Tapuska, Michael Lippautz, Chromium LUCI CQ, chromium...@chromium.org
    Attention needed from Mark Mentovai and Michael Lippautz

    Nikolaos Papaspyrou added 1 comment

    File content/browser/cpu_performance/cpu_performance.cc
    Line 158, Patchset 2 (Latest): // Post the task that will update the tier asynchronously, using the more
    // accurate (but potentially blocking) implementation.
    base::ThreadPool::PostTask(
    FROM_HERE, {base::MayBlock(), base::TaskPriority::USER_VISIBLE},
    base::BindOnce([]() {
    Tier tier = GetTierFromCpuInfo(base::SysInfo::CPUModelName(),
    base::SysInfo::NumberOfProcessors());
    g_tier_cached.store(tier);
    }));
    }
    Mark Mentovai . unresolved

    Can you call out what’s blocking? As written below, I don‘t see it. It looks like a long chain of regexes.

    Slow? Maybe. But blocking?

    Nikolaos Papaspyrou

    This was made an async task because `base::SysInfo::CPUModelName()` may be blocking the UI thread, at least on Linux where it reads `/proc/cpuinfo`. PS #1 failed for this reason.

    Mark Mentovai

    This was made an async task because `base::SysInfo::CPUModelName()` may be blocking the UI thread, at least on Linux where it reads `/proc/cpuinfo`. PS #1 failed for this reason.

    Oh.

    /proc reads don’t really block, but going through the filesystem interface, we don’t really have any way to see that.

    I see. OK. I’d ask that the comment clarify that /proc/cpuinfo is the whole reason for this.

    Nikolaos Papaspyrou

    OK, I will update the comment to make this clear. Thank you!

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Mark Mentovai
    • Michael Lippautz
    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: I5cd341d1273077fb3a19f13477c4620c5b7d4d9d
    Gerrit-Change-Number: 7532183
    Gerrit-PatchSet: 2
    Gerrit-Owner: Nikolaos Papaspyrou <niko...@chromium.org>
    Gerrit-Reviewer: Dave Tapuska <dtap...@chromium.org>
    Gerrit-Reviewer: Mark Mentovai <ma...@chromium.org>
    Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
    Gerrit-Reviewer: Nikolaos Papaspyrou <niko...@chromium.org>
    Gerrit-Attention: Mark Mentovai <ma...@chromium.org>
    Gerrit-Attention: Michael Lippautz <mlip...@chromium.org>
    Gerrit-Comment-Date: Wed, 04 Feb 2026 16:54:25 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Chen Xing (Gerrit)

    unread,
    Feb 4, 2026, 1:38:12 PM (3 days ago) Feb 4
    to Nikolaos Papaspyrou, Mark Mentovai, Dave Tapuska, Michael Lippautz, Chromium LUCI CQ, chromium...@chromium.org
    Attention needed from Mark Mentovai, Michael Lippautz and Nikolaos Papaspyrou

    Chen Xing added 3 comments

    File content/browser/cpu_performance/cpu_performance.cc
    Line 51, Patchset 2 (Latest): if (Search(cpu_model, "(?i)\\b(AMD|Athlon)\\b")) {
    Chen Xing . unresolved

    As far as I can tell, there's no valid AMD CPU model string that doesn't contain the word "AMD". There are a handful of instances of "Athlon" strings without "AMD" but all of them seem to come from corruptions (or manually modified strings) rather than something that the OS will legitimately return by default.

    Line 197, Patchset 2 (Latest): auto [manufacturer, model] = SplitCpuModel(cpu_model);
    Chen Xing . unresolved

    `SplitCpuModel()` has only been verified to produce an accurate "model" string for Apple/AMD/Intel CPUs. In particular: It produces the wrong result for Qualcomm CPUs and will possibly also return "model strings with garbage text" for other manufacturers.

    File content/browser/cpu_performance/cpu_performance_unittest.cc
    Line 39, Patchset 2 (Latest): tests = {{"Intel(R) Core(TM) i7-10700K CPU @ 3.80GHz",
    Chen Xing . unresolved

    Ensure that the unit tests results in 100% code coverage?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Mark Mentovai
    • Michael Lippautz
    • Nikolaos Papaspyrou
    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: I5cd341d1273077fb3a19f13477c4620c5b7d4d9d
    Gerrit-Change-Number: 7532183
    Gerrit-PatchSet: 2
    Gerrit-Owner: Nikolaos Papaspyrou <niko...@chromium.org>
    Gerrit-Reviewer: Dave Tapuska <dtap...@chromium.org>
    Gerrit-Reviewer: Mark Mentovai <ma...@chromium.org>
    Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
    Gerrit-Reviewer: Nikolaos Papaspyrou <niko...@chromium.org>
    Gerrit-CC: Chen Xing <ch...@google.com>
    Gerrit-Attention: Mark Mentovai <ma...@chromium.org>
    Gerrit-Attention: Nikolaos Papaspyrou <niko...@chromium.org>
    Gerrit-Attention: Michael Lippautz <mlip...@chromium.org>
    Gerrit-Comment-Date: Wed, 04 Feb 2026 18:37:55 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Nikolaos Papaspyrou (Gerrit)

    unread,
    Feb 6, 2026, 6:02:22 PM (19 hours ago) Feb 6
    to Chen Xing, Mark Mentovai, Dave Tapuska, Michael Lippautz, Chromium LUCI CQ, chromium...@chromium.org
    Attention needed from Dave Tapuska, Mark Mentovai and Michael Lippautz

    Nikolaos Papaspyrou added 4 comments

    File content/browser/cpu_performance/cpu_performance.cc
    Line 51, Patchset 2: if (Search(cpu_model, "(?i)\\b(AMD|Athlon)\\b")) {
    Chen Xing . resolved

    As far as I can tell, there's no valid AMD CPU model string that doesn't contain the word "AMD". There are a handful of instances of "Athlon" strings without "AMD" but all of them seem to come from corruptions (or manually modified strings) rather than something that the OS will legitimately return by default.

    Nikolaos Papaspyrou

    I am removing "Athlon" from the regex, thanks for noticing!

    Line 158, Patchset 2: // Post the task that will update the tier asynchronously, using the more

    // accurate (but potentially blocking) implementation.
    base::ThreadPool::PostTask(
    FROM_HERE, {base::MayBlock(), base::TaskPriority::USER_VISIBLE},
    base::BindOnce([]() {
    Tier tier = GetTierFromCpuInfo(base::SysInfo::CPUModelName(),
    base::SysInfo::NumberOfProcessors());
    g_tier_cached.store(tier);
    }));
    }
    Mark Mentovai . resolved

    Can you call out what’s blocking? As written below, I don‘t see it. It looks like a long chain of regexes.

    Slow? Maybe. But blocking?

    Nikolaos Papaspyrou

    This was made an async task because `base::SysInfo::CPUModelName()` may be blocking the UI thread, at least on Linux where it reads `/proc/cpuinfo`. PS #1 failed for this reason.

    Mark Mentovai

    This was made an async task because `base::SysInfo::CPUModelName()` may be blocking the UI thread, at least on Linux where it reads `/proc/cpuinfo`. PS #1 failed for this reason.

    Oh.

    /proc reads don’t really block, but going through the filesystem interface, we don’t really have any way to see that.

    I see. OK. I’d ask that the comment clarify that /proc/cpuinfo is the whole reason for this.

    Nikolaos Papaspyrou

    OK, I will update the comment to make this clear. Thank you!

    Nikolaos Papaspyrou

    Done

    Line 197, Patchset 2: auto [manufacturer, model] = SplitCpuModel(cpu_model);
    Chen Xing . resolved

    `SplitCpuModel()` has only been verified to produce an accurate "model" string for Apple/AMD/Intel CPUs. In particular: It produces the wrong result for Qualcomm CPUs and will possibly also return "model strings with garbage text" for other manufacturers.

    Nikolaos Papaspyrou

    For manufacturers other than AMD, Apple and Intel, `SplitCpuModel` just performs some basic cleanup:

    • sanitizes whitespace
    • removes parentheses
    • removes special characters
    • removes GHz information
    • removes filler words (CPU, Mobile, Processor, Silicon, SOC, Technology)

    It then returns the manufacturer and the resulting CPU model text. For manufacturers other than AMD, Apple and Intel, this text is not further used. I do not see how it can produce the wrong manufacturer or garbage text.

    Let us continue this discussion offline.

    File content/browser/cpu_performance/cpu_performance_unittest.cc
    Line 39, Patchset 2: tests = {{"Intel(R) Core(TM) i7-10700K CPU @ 3.80GHz",
    Chen Xing . resolved

    Ensure that the unit tests results in 100% code coverage?

    Nikolaos Papaspyrou

    I added more tests to increase the 90%.
    Thank you for suggesting.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Dave Tapuska
    • Mark Mentovai
    • Michael Lippautz
    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: I5cd341d1273077fb3a19f13477c4620c5b7d4d9d
    Gerrit-Change-Number: 7532183
    Gerrit-PatchSet: 5
    Gerrit-Owner: Nikolaos Papaspyrou <niko...@chromium.org>
    Gerrit-Reviewer: Dave Tapuska <dtap...@chromium.org>
    Gerrit-Reviewer: Mark Mentovai <ma...@chromium.org>
    Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
    Gerrit-Reviewer: Nikolaos Papaspyrou <niko...@chromium.org>
    Gerrit-CC: Chen Xing <ch...@google.com>
    Gerrit-Attention: Mark Mentovai <ma...@chromium.org>
    Gerrit-Attention: Michael Lippautz <mlip...@chromium.org>
    Gerrit-Attention: Dave Tapuska <dtap...@chromium.org>
    Gerrit-Comment-Date: Fri, 06 Feb 2026 23:02:04 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Mark Mentovai <ma...@chromium.org>
    Comment-In-Reply-To: Nikolaos Papaspyrou <niko...@chromium.org>
    Comment-In-Reply-To: Chen Xing <ch...@google.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Chen Xing (Gerrit)

    unread,
    Feb 6, 2026, 7:14:00 PM (18 hours ago) Feb 6
    to Nikolaos Papaspyrou, Mark Mentovai, Dave Tapuska, Michael Lippautz, Chromium LUCI CQ, chromium...@chromium.org
    Attention needed from Dave Tapuska, Mark Mentovai, Michael Lippautz and Nikolaos Papaspyrou

    Chen Xing added 1 comment

    File content/browser/cpu_performance/cpu_performance.cc
    Line 197, Patchset 2: auto [manufacturer, model] = SplitCpuModel(cpu_model);
    Chen Xing . unresolved

    `SplitCpuModel()` has only been verified to produce an accurate "model" string for Apple/AMD/Intel CPUs. In particular: It produces the wrong result for Qualcomm CPUs and will possibly also return "model strings with garbage text" for other manufacturers.

    Nikolaos Papaspyrou

    For manufacturers other than AMD, Apple and Intel, `SplitCpuModel` just performs some basic cleanup:

    • sanitizes whitespace
    • removes parentheses
    • removes special characters
    • removes GHz information
    • removes filler words (CPU, Mobile, Processor, Silicon, SOC, Technology)

    It then returns the manufacturer and the resulting CPU model text. For manufacturers other than AMD, Apple and Intel, this text is not further used. I do not see how it can produce the wrong manufacturer or garbage text.

    Let us continue this discussion offline.

    Chen Xing

    The text is currently not used any further but it leaves a tripwire for future developers since `auto [manufacturer, model] = SplitCpuModel(cpu_model);` makes it look as though the function has done the extra care to do a proper split for other manufacturers.

    This is for example noticeable in one of the unit tests where `Snapdragon(R) X Elite - X1E78100 - Qualcomm(R) Oryon(TM) CPU` returns Manufacturer::kQualcomm + "Snapdragon X Elite - X1E78100 - Oryon". The latter is almost certainly not the preferred format of the returned model string.

    I think the fix is quite simple here. When in doubt, simply return the empty string. E.g. `Snapdragon(R) X Elite - X1E78100 - Qualcomm(R) Oryon(TM) CPU` might as well return Manufacturer::kQualcomm + "" and it will remove that risk completely. :-)

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Dave Tapuska
    • Mark Mentovai
    • Michael Lippautz
    • Nikolaos Papaspyrou
    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: I5cd341d1273077fb3a19f13477c4620c5b7d4d9d
    Gerrit-Change-Number: 7532183
    Gerrit-PatchSet: 5
    Gerrit-Owner: Nikolaos Papaspyrou <niko...@chromium.org>
    Gerrit-Reviewer: Dave Tapuska <dtap...@chromium.org>
    Gerrit-Reviewer: Mark Mentovai <ma...@chromium.org>
    Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
    Gerrit-Reviewer: Nikolaos Papaspyrou <niko...@chromium.org>
    Gerrit-CC: Chen Xing <ch...@google.com>
    Gerrit-Attention: Mark Mentovai <ma...@chromium.org>
    Gerrit-Attention: Nikolaos Papaspyrou <niko...@chromium.org>
    Gerrit-Attention: Michael Lippautz <mlip...@chromium.org>
    Gerrit-Attention: Dave Tapuska <dtap...@chromium.org>
    Gerrit-Comment-Date: Sat, 07 Feb 2026 00:13:42 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Nikolaos Papaspyrou (Gerrit)

    unread,
    5:13 AM (8 hours ago) 5:13 AM
    to Chen Xing, Mark Mentovai, Dave Tapuska, Michael Lippautz, Chromium LUCI CQ, chromium...@chromium.org
    Attention needed from Dave Tapuska, Mark Mentovai and Michael Lippautz

    Nikolaos Papaspyrou voted and added 1 comment

    Votes added by Nikolaos Papaspyrou

    Commit-Queue+1

    1 comment

    File content/browser/cpu_performance/cpu_performance.cc
    Line 197, Patchset 2: auto [manufacturer, model] = SplitCpuModel(cpu_model);
    Chen Xing . unresolved

    `SplitCpuModel()` has only been verified to produce an accurate "model" string for Apple/AMD/Intel CPUs. In particular: It produces the wrong result for Qualcomm CPUs and will possibly also return "model strings with garbage text" for other manufacturers.

    Nikolaos Papaspyrou

    For manufacturers other than AMD, Apple and Intel, `SplitCpuModel` just performs some basic cleanup:

    • sanitizes whitespace
    • removes parentheses
    • removes special characters
    • removes GHz information
    • removes filler words (CPU, Mobile, Processor, Silicon, SOC, Technology)

    It then returns the manufacturer and the resulting CPU model text. For manufacturers other than AMD, Apple and Intel, this text is not further used. I do not see how it can produce the wrong manufacturer or garbage text.

    Let us continue this discussion offline.

    Chen Xing

    The text is currently not used any further but it leaves a tripwire for future developers since `auto [manufacturer, model] = SplitCpuModel(cpu_model);` makes it look as though the function has done the extra care to do a proper split for other manufacturers.

    This is for example noticeable in one of the unit tests where `Snapdragon(R) X Elite - X1E78100 - Qualcomm(R) Oryon(TM) CPU` returns Manufacturer::kQualcomm + "Snapdragon X Elite - X1E78100 - Oryon". The latter is almost certainly not the preferred format of the returned model string.

    I think the fix is quite simple here. When in doubt, simply return the empty string. E.g. `Snapdragon(R) X Elite - X1E78100 - Qualcomm(R) Oryon(TM) CPU` might as well return Manufacturer::kQualcomm + "" and it will remove that risk completely. :-)

    Nikolaos Papaspyrou

    As it's something used internally and there's a comment warning that the implementation "is experimental and subject to change", I don't see a problem with this. We'll fix the model for these manufacturers when there's reason to do so.

    I'm happy to return "" instead, if the reviewers agree.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Dave Tapuska
    • Mark Mentovai
    • Michael Lippautz
    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: I5cd341d1273077fb3a19f13477c4620c5b7d4d9d
    Gerrit-Change-Number: 7532183
    Gerrit-PatchSet: 6
    Gerrit-Owner: Nikolaos Papaspyrou <niko...@chromium.org>
    Gerrit-Reviewer: Dave Tapuska <dtap...@chromium.org>
    Gerrit-Reviewer: Mark Mentovai <ma...@chromium.org>
    Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
    Gerrit-Reviewer: Nikolaos Papaspyrou <niko...@chromium.org>
    Gerrit-CC: Chen Xing <ch...@google.com>
    Gerrit-Attention: Mark Mentovai <ma...@chromium.org>
    Gerrit-Attention: Michael Lippautz <mlip...@chromium.org>
    Gerrit-Attention: Dave Tapuska <dtap...@chromium.org>
    Gerrit-Comment-Date: Sat, 07 Feb 2026 10:12:48 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages