Closed Bug 1630089 Opened 5 years ago Closed 2 years ago

[macOS] navigator.hardwareConcurrency reports physical cores instead of logical since Bug 1546544

Categories

(Core :: DOM: Core & HTML, defect, P2)

Unspecified
macOS
defect

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: dveditz, Unassigned, NeedInfo)

References

(Regression)

Details

(Keywords: regression, Whiteboard: intentional)

Apparently navigator.hardwareConcurrency reports physical cores ("2" on my mac). The spec, MDN, and Chrome's implementation report logical cores ("4" on my mac).

There was some discussion about this in bug 1008453 and it looked like it was going toward reporting logical, but the code didn't change that before landing. Might be Mac only -- there's platform-specific code and I haven't tested elsewhere.

Thanks, Spectre.

(In reply to Daniel Veditz [:dveditz] from comment #0)

Might be Mac only -- there's platform-specific code and I haven't tested elsewhere.

On my Windows 10 laptop, both Firefox and Chrome report navigator.hardwareConcurrency == 12. Windows Task Manager and System Information confirm I have 6 physical cores and 12 logical processors.

Priority: -- → P2
OS: Unspecified → macOS
Regressed by: CVE-2019-9815
Summary: navigator.hardwareConcurrency reports physical cores, spec says logical → [macOS] navigator.hardwareConcurrency reports physical cores instead of logical since Bug 1546544
Whiteboard: intentional
Has Regression Range: --- → yes

This is due to the Mac-specific mitigation added in the same bug. We intentionally reduced navigator.hardwareConcurrency when the mitigation is enabled because it effectively disabled hyperthreading and navigator.hardwareConcurrency is meant to reflect the number of logical processors.

There is a Chromium bug filed[1] requesting hardwareConcurrency report the lower number like the Firefox implementation, but the bug hasn't had any activity since September so we need to ask about it.

:drno recently reached out to Google about a Hangouts issue where Hangouts was using navigator.hardwareConcurrency so we're looking into normalizing this behavior.

  1. Issue 1002584: Update the value of Navigator.hardwareConcurrency to reflect tcsm_enable
    https://bugs.chromium.org/p/chromium/issues/detail?id=1002584
See Also: → 1728741

Friendly ping! What is the status here?

On a test M1 Pro machine: navigator.hardwareConcurrency in Firefox Nightly 102 reports 2. In latest stable Safari, Chrome, and Edge, it reports 8.

Google Meet doesn't work in HD (720p) anymore and shows lower resolution video of all participants. Maybe because of this?
However it works well in 720p in Chrome, Safari, and Edge.

(In reply to Sagar from comment #5)

Friendly ping! What is the status here?

On a test M1 Pro machine: navigator.hardwareConcurrency in Firefox Nightly 102 reports 2. In latest stable Safari, Chrome, and Edge, it reports 8.

Google Meet doesn't work in HD (720p) anymore and shows lower resolution video of all participants. Maybe because of this?
However it works well in 720p in Chrome, Safari, and Edge.

@Sagar, could you confirm you're seeing navigator.hardwareConcurrency as being 2 on the M1 Pro? And that this is not in a VM?

It would also help if you could provide a screenshot or copy-and-paste of the data from About this Mac -> System Report... -> Hardware Overview. Just the part with the CPU information such as

Hardware Overview:

  Model Name:	MacBook Pro
  Model Identifier:	MacBookPro17,1
  Chip:	Apple M1
  Total Number of Cores:	8 (4 performance and 4 efficiency)

Thanks!

Sagar, have you enabled the privacy.resistFingerprinting pref?

I wonder if the timer mitigations from bug 1546544 are still necessary now that we've shipped Fission (on desktop).

Flags: needinfo?(bugzilla.mozilla)

@Sagar, see the two questions above in comment 6 and comment 7. Thanks.

Unfortunately this is not actionable without more information from the reporter.

Dear reporter,
Please feel free to reopen this, when you have a chance to get back here form comment 6 and comment 7. Thank you.

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.