[PR #6054] [MERGED] Windows: benchmark reports and telemetry name the CPU by its brand #6629

Closed
opened 2026-11-03 06:24:01 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6054
Author: @mariuslozo-boop
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: fix/windows-cpu-name


📝 Commits (2)

  • 7594506 Windows: benchmark reports and telemetry name the CPU by its brand (#6032)
  • ebdd6a9 Windows CPU name: read the registry once, test it against the registry (#6032)

📊 Changes

5 files changed (+166 additions, -41 deletions)

View changed files

📝 crates/horizon-bench/src/hardware.rs (+13 -1)
📝 crates/horizon-client-render/src/crash.rs (+1 -35)
📝 crates/horizon-telemetry/src/system.rs (+148 -1)
📝 docs/benchmark-report.md (+3 -3)
📝 docs/telemetry.md (+1 -1)

📄 Description

🤖 Opened by mariuslozo-boop's AI agent (Claude Code, Claude Sonnet 5.5 + Claude Opus 5.5 review), not by mariuslozo-boop personally.

What and why

Fixes #6032. On Windows, benchmark reports (hardware.cpu) and telemetry (System.cpu) named the CPU from PROCESSOR_IDENTIFIER, which always holds the family, model and stepping (AMD64 Family 25 Model 97 Stepping 2, AuthenticAMD). The benchmark summary groups uploads by that name, so Windows rows would show that string, and chips of one family and model would share a group.

  • One reader: horizon_telemetry::system::windows_cpu() reads ProcessorNameString under HKLM\HARDWARE\DESCRIPTION\System\CentralProcessor\0 with reg query (the pattern the crash report already used), trims the registry's padding, and falls back to PROCESSOR_IDENTIFIER only when there is no name. It is read once per process (OnceLock), so telemetry items and reports don't spawn reg again.
  • Callers: horizon-bench's Windows cpu(), telemetry's cpu(), and the crash report's cpu() all use it. The crash report's own parser goes. Its result is unchanged (16x AMD Ryzen 7 7700X 8-Core Processor), but it now goes through command_output, which doesn't flash a console window. Telemetry's catch-all else no longer reads PROCESSOR_IDENTIFIER on other systems (BSD); it gives None, as horizon-bench does.
  • Parser: the line must start with ProcessorNameString and have type REG_SZ. Another value (Identifier), another type, an empty value, the key's line alone, an error message or garbage give None.
  • Placement: horizon-telemetry is where the shared hardware probes live. horizon-bench and horizon-client-render already depend on it, so there are no new dependencies and Cargo.lock is unchanged. A direct registry read would need windows-sys with the registry feature and unsafe in horizon-telemetry, for a call that takes about 5 ms once.
  • Docs: docs/telemetry.md and docs/benchmark-report.md say where the Windows name comes from, and when it is the fallback.

Already-stored uploads keep the old string on the server; this only changes new ones.

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

Horizon-only (benchmark reports and telemetry).

Other projects' code

none

Self-check

  • system::tests::the_registry_cpu_name_is_read_from_reg_query: CRLF and LF output, padded names, runs of spaces inside a name (Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz), tab-separated columns, and the 13th-gen Intel case moved from crash.rs.
  • system::tests::a_reg_query_without_a_name_gives_none: empty output, the key only, an empty value, Identifier, REG_DWORD, garbage and the reg error message. The old crash.rs parser fails it (it returns the Identifier line's family and model).
  • #[cfg(windows)] system::tests::windows_names_the_cpu_by_its_brand checks cpu() against the registry value read by PowerShell (Get-ItemProperty, not reg or the parser), or against PROCESSOR_IDENTIFIER where there is no name. hardware::tests::windows_reports_the_cpu_brand checks the report's field has no family and model. Both fail with the old PROCESSOR_IDENTIFIER read (left: "AMD64 Family 25 Model 97 Stepping 2, AuthenticAMD", right: "AMD Ryzen 7 7700X 8-Core Processor") and pass with this. No CI runner runs Windows tests (game-build.yml only builds there), so they ran locally.
  • Real report: a fast build of this branch, horizon-client --benchmark village with its own home and telemetry off, on Windows 11 with a Ryzen 7 7700X: hardware.cpu is AMD Ryzen 7 7700X 8-Core Processor (Nightly d91cab6 on the same machine: AMD64 Family 25 Model 97 Stepping 2, AuthenticAMD).

pr_ready (tools/pr_ready.py --base upstream/main on PCDKBLENDER, against upstream/main at c05ef84a5, 3 min 31 s)

Check Result
Scope ✅ 5 files, +166 −41
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 525 passed (44 s)
rustfmt ✅ (7 s)
clippy ✅ (13 s)
tests: horizon-bench, horizon-client-render, horizon-telemetry ✅ 918 passed (1 min 51 s)
doc tests ✅ 0 passed (1 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ✅ (1 s)
launcher clippy ✅ (3 s)
launcher tests ✅ 368 passed (26 s)
Parity ❌ 375 affected, (1 s)
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)
  • Parity: run on Windows, where the runner needs fcntl and can't start. The affected harnesses run in CI (run-parity).
  • RUST_TEST_THREADS=2 was set: on this machine the GPU render tests hang with more threads.

Not tested:

  • ARM64 Windows, localized Windows and multi-socket machines: no such hardware. CentralProcessor\0 holds the one brand string all cores share, and reg doesn't translate the value name or REG_SZ.
  • A Windows machine without the registry value (some VMs): only the fallback's code, no run. windows_reports_the_cpu_brand would fail there.
  • The upload and the server's grouping: read, not run.

🤖 Generated with Claude Code

https://claude.ai/code/session_01RodDbPWCByh96WKcbiEQpB


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/6054 **Author:** [@mariuslozo-boop](https://github.com/mariuslozo-boop) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/windows-cpu-name` --- ### 📝 Commits (2) - [`7594506`](https://github.com/horizon-rust/horizon/commit/7594506012c1d6b93cfbfa1b65d8cbc38e43f0db) Windows: benchmark reports and telemetry name the CPU by its brand (#6032) - [`ebdd6a9`](https://github.com/horizon-rust/horizon/commit/ebdd6a9d9a7d0134267e44a6318f5e48204cc583) Windows CPU name: read the registry once, test it against the registry (#6032) ### 📊 Changes **5 files changed** (+166 additions, -41 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-bench/src/hardware.rs` (+13 -1) 📝 `crates/horizon-client-render/src/crash.rs` (+1 -35) 📝 `crates/horizon-telemetry/src/system.rs` (+148 -1) 📝 `docs/benchmark-report.md` (+3 -3) 📝 `docs/telemetry.md` (+1 -1) </details> ### 📄 Description > 🤖 Opened by mariuslozo-boop's AI agent (Claude Code, Claude Sonnet 5.5 + Claude Opus 5.5 review), not by mariuslozo-boop personally. ## What and why Fixes #6032. On Windows, benchmark reports (`hardware.cpu`) and telemetry (`System.cpu`) named the CPU from `PROCESSOR_IDENTIFIER`, which always holds the family, model and stepping (`AMD64 Family 25 Model 97 Stepping 2, AuthenticAMD`). The benchmark summary groups uploads by that name, so Windows rows would show that string, and chips of one family and model would share a group. - **One reader:** `horizon_telemetry::system::windows_cpu()` reads `ProcessorNameString` under `HKLM\HARDWARE\DESCRIPTION\System\CentralProcessor\0` with `reg query` (the pattern the crash report already used), trims the registry's padding, and falls back to `PROCESSOR_IDENTIFIER` only when there is no name. It is read once per process (`OnceLock`), so telemetry items and reports don't spawn `reg` again. - **Callers:** `horizon-bench`'s Windows `cpu()`, telemetry's `cpu()`, and the crash report's `cpu()` all use it. The crash report's own parser goes. Its result is unchanged (`16x AMD Ryzen 7 7700X 8-Core Processor`), but it now goes through `command_output`, which doesn't flash a console window. Telemetry's catch-all `else` no longer reads `PROCESSOR_IDENTIFIER` on other systems (BSD); it gives `None`, as `horizon-bench` does. - **Parser:** the line must start with `ProcessorNameString` and have type `REG_SZ`. Another value (`Identifier`), another type, an empty value, the key's line alone, an error message or garbage give `None`. - **Placement:** `horizon-telemetry` is where the shared hardware probes live. `horizon-bench` and `horizon-client-render` already depend on it, so there are no new dependencies and `Cargo.lock` is unchanged. A direct registry read would need `windows-sys` with the registry feature and `unsafe` in `horizon-telemetry`, for a call that takes about 5 ms once. - **Docs:** `docs/telemetry.md` and `docs/benchmark-report.md` say where the Windows name comes from, and when it is the fallback. Already-stored uploads keep the old string on the server; this only changes new ones. ## Kind - [ ] parity: Horizon now does what vanilla 26.3 does - [x] bug: a crash or a breakage - [ ] perf: faster, or less memory - [ ] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [ ] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference Horizon-only (benchmark reports and telemetry). ## Other projects' code none ## Self-check - `system::tests::the_registry_cpu_name_is_read_from_reg_query`: CRLF and LF output, padded names, runs of spaces inside a name (`Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz`), tab-separated columns, and the 13th-gen Intel case moved from `crash.rs`. - `system::tests::a_reg_query_without_a_name_gives_none`: empty output, the key only, an empty value, `Identifier`, `REG_DWORD`, garbage and the `reg` error message. The old `crash.rs` parser fails it (it returns the `Identifier` line's family and model). - `#[cfg(windows)]` `system::tests::windows_names_the_cpu_by_its_brand` checks `cpu()` against the registry value read by PowerShell (`Get-ItemProperty`, not `reg` or the parser), or against `PROCESSOR_IDENTIFIER` where there is no name. `hardware::tests::windows_reports_the_cpu_brand` checks the report's field has no family and model. Both fail with the old `PROCESSOR_IDENTIFIER` read (`left: "AMD64 Family 25 Model 97 Stepping 2, AuthenticAMD"`, `right: "AMD Ryzen 7 7700X 8-Core Processor"`) and pass with this. No CI runner runs Windows tests (`game-build.yml` only builds there), so they ran locally. - Real report: a `fast` build of this branch, `horizon-client --benchmark village` with its own home and telemetry off, on Windows 11 with a Ryzen 7 7700X: `hardware.cpu` is `AMD Ryzen 7 7700X 8-Core Processor` (Nightly `d91cab6` on the same machine: `AMD64 Family 25 Model 97 Stepping 2, AuthenticAMD`). **pr_ready** (`tools/pr_ready.py --base upstream/main` on PCDKBLENDER, against upstream/main at c05ef84a5, 3 min 31 s) | Check | Result | | --- | --- | | Scope | ✅ 5 files, +166 −41 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 525 passed (44 s) | | rustfmt | ✅ (7 s) | | clippy | ✅ (13 s) | | tests: horizon-bench, horizon-client-render, horizon-telemetry | ✅ 918 passed (1 min 51 s) | | doc tests | ✅ 0 passed (1 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ✅ (1 s) | | launcher clippy | ✅ (3 s) | | launcher tests | ✅ 368 passed (26 s) | | Parity | ❌ 375 affected, (1 s) | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | - Parity: run on Windows, where the runner needs `fcntl` and can't start. The affected harnesses run in CI (`run-parity`). - `RUST_TEST_THREADS=2` was set: on this machine the GPU render tests hang with more threads. Not tested: - ARM64 Windows, localized Windows and multi-socket machines: no such hardware. `CentralProcessor\0` holds the one brand string all cores share, and `reg` doesn't translate the value name or `REG_SZ`. - A Windows machine without the registry value (some VMs): only the fallback's code, no run. `windows_reports_the_cpu_brand` would fail there. - The upload and the server's grouping: read, not run. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01RodDbPWCByh96WKcbiEQpB --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:24:01 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#6629
No description provided.