Skip to content

Include every Windows processor when counting physical cores - #89

Open
OskarEichler wants to merge 2 commits into
rdp:masterfrom
OskarEichler:codex/count-all-windows-processors
Open

OskarEichler wants to merge 2 commits into
rdp:masterfrom
OskarEichler:codex/count-all-windows-processors

Conversation

@OskarEichler

Copy link
Copy Markdown

Summary

The WMI query returns one row per physical processor, but cpu_count only reads the first row. Sum NumberOfCores across all rows, retaining the existing physical-core meaning.

Reproduction and verification

Checked one-, two- and three-processor WMI fixtures, including unequal core counts. Native Windows/WMI execution remains for upstream CI; local checks use stubs.

  • External focused repro corpus: 5 checks pass against this isolated branch, under rbenv Ruby 4.0.6.
  • Existing upstream suite: 36 examples, zero failures before and after the patch (RBENV_VERSION=4.0.6 rbenv exec rspec -Ilib -Ispec).
  • Source-only change; no existing tests modified or new test files added, per the contributor's task constraint. The focused corpus lives outside the repository.
  • Local verification was on macOS. Other Ruby versions and native operating systems were not executed. Upstream RuboCop configuration cannot load its legacy rubocop-lts1_8.yml, including after installing current rubocop-lts; lint status is not represented as passing.

Breaking-change notes

No API removal. Multi-socket Windows machines report the total physical cores instead of only the first socket. Logical/hyperthread count semantics are unchanged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant