[PR #1337] [MERGED] Telemetry: every hardware fact players send (opt-in), broken down by class #3486

Closed
opened 2026-11-03 04:09:53 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1337
Author: @ludovic111
Created: 10/23/2026
Status: ✅ Merged
Merged: 10/23/2026
Merged by: @ludovic111

Base: main ← Head: feat/telemetry-hardware


📝 Commits (4)

  • 828398b Telemetry: every hardware fact that explains performance, broken down by class
  • a57efd4 Launcher lock file: horizon-bench now depends on horizon-telemetry
  • 75d818f Telemetry: the screen also when Wayland names it late
  • 213cffc Benchmark report: the screen read again at the end of the run

📊 Changes

27 files changed (+1272 additions, -91 deletions)

View changed files

📝 Cargo.lock (+1 -0)
📝 crates/horizon-bench/Cargo.toml (+2 -0)
📝 crates/horizon-bench/src/hardware.rs (+51 -19)
📝 crates/horizon-client/src/benchmark.rs (+19 -0)
📝 crates/horizon-client/src/game.rs (+6 -0)
📝 crates/horizon-client/src/game/control.rs (+1 -1)
📝 crates/horizon-client/src/gfx.rs (+7 -5)
📝 crates/horizon-client/src/telemetry.rs (+79 -11)
➕ crates/horizon-telemetry-server/src/classes.rs (+103 -0)
📝 crates/horizon-telemetry-server/src/lib.rs (+1 -0)
📝 crates/horizon-telemetry-server/src/store.rs (+212 -10)
📝 crates/horizon-telemetry-server/src/summary.rs (+42 -1)
📝 crates/horizon-telemetry-server/tests/server.rs (+39 -0)
📝 crates/horizon-telemetry-server/tests/summary.rs (+4 -0)
📝 crates/horizon-telemetry/src/lib.rs (+3 -2)
📝 crates/horizon-telemetry/src/payload.rs (+35 -4)
📝 crates/horizon-telemetry/src/system.rs (+481 -3)
📝 docs/benchmark-report.md (+7 -4)
📝 docs/telemetry.md (+33 -4)
📝 launcher/Cargo.lock (+1 -0)

...and 7 more files

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

What players send, when they opt in, now covers every hardware fact that can explain performance. Public output gets breakdowns by coarse hardware class, and each published class needs at least 3 different installs.

What is added (the switches are unchanged and stay off until the player turns them on)

system in perf, crash and bug items now carries these besides the OS and version, arch, CPU model, threads, RAM, GPU name, driver and backend:

Field Source
cores, cpu_base_mhz, cpu_boost_mhz Linux: /proc/cpuinfo and cpufreq (base_frequency / ACPI CPPC nominal, cpuinfo_max_freq). macOS: hw.physicalcpu and hw.cpufrequency(_max), which are 0 on Apple silicon. Windows: CIM NumberOfCores / MaxClockSpeed
gpu_vendor, gpu_kind wgpu adapter info: PCI vendor ID, then the name; integrated / discrete
vram_mb discrete GPUs only: nvidia-smi, amdgpu mem_info_vram_total, Intel lmem_total_bytes, macOS system_profiler, Windows registry qwMemorySize. Rounded up to 256 MiB
storage the drive under the game folder, nvme / ssd / hdd. Linux: mountinfo → /sys/class/block (through dm/LUKS slaves). macOS: diskutil. Windows: Get-PhysicalDisk
display the monitor the window opened on: physical size, refresh, scale (winit)
power, form ac / battery; laptop / desktop (DMI chassis type, else whether there is a battery)

Benchmark reports get the same in hardware: cpu_cores, cpu_base_mhz, cpu_boost_mhz, storage, form and gpu.vram_mb.

  • "RAM given to the game": Horizon has no Java heap to set, so peak_ram_mb (already sent) is what it used. Vanilla runs in our own benchmarks use the official launcher's -Xmx2G.
  • Not read: serial numbers, hostnames, user names, MAC addresses and paths. Only /sys class files and the commands named above are read, nothing with an ID.
  • Consent: CONSENT_VERSION goes 1 → 2, as docs/telemetry.md and the privacy page promise when what is collected changes. Players who already opted in are asked again, and nothing new is kept until they answer. The Performance switch's text lists the new fields.

Server

  • systems.extra holds the new fields as JSON. On the first start, an old database's systems table is rebuilt once with the column and keeps its ids (unit test from the old schema). Raw values stay for the 180-day retention, as now.
  • GET /v1/aggregate adds breakdowns: play sessions in the window per class of ram, vram, storage, os and gpu_kind, with installs, sessions, hours and mean p50/p99. These are computed from raw rows, so only within retention.
  • GET /v1/benchmarks/summary: each group adds breakdowns (installs per class).
  • Classes are coarse: RAM 4/8/16/32/64+ GB, VRAM shared/2/4/6/8/12/16/16+ GB, nvme/ssd/hdd, linux/macos/windows, integrated/discrete. A class shows only with ≥3 installs and a dimension without one is left out. Driver, OS version, clocks, screen and power are never published. Tests check that no raw value (exact RAM/VRAM, driver, OS version, install ID) appears in either endpoint.
  • Bug fix: summary::rejection returned None (accepted) for an app that is neither Horizon nor plain vanilla, because game(&report["app"])? used ? on the Option. It now returns "not Horizon or plain vanilla", as benchmarks.mjs does.

Site script, shared fixtures, docs

  • website/scripts/benchmarks.mjs mirrors the classes and breakdowns. The fixtures (website/scripts/fixtures/benchmarks/) give the RTX 4080 group published VRAM/OS/GPU-kind cells and suppressed RAM/drive cells (2 + 1 installs). Both the Node test and the server test check them.
  • docs/telemetry.md lists every field, the classes and what is never published. docs/benchmark-report.md has the new hardware fields. website/src/privacy.html lists every field in plain words.
  • Launcher: "View what would be sent" and horizon-launcher data show print every field. The GPU and screen are example values, marked as such, because only the game knows them. Bug reports carry the drive.

Checks

  • cargo fmt --check for the workspace, launcher and server.
  • cargo clippy -D warnings: horizon-telemetry, horizon-bench and horizon-client on macOS; horizon-telemetry and horizon-bench on Linux; the launcher on Linux (nix-shell); the server workspace.
  • cargo check --workspace --all-targets passes.
  • Tests: horizon-telemetry 34, horizon-bench, the server (lib 5, live 5, server 9, summary 4), the launcher 97+14+1+1, and the site's npm test (17).
  • On the ThinkPad, what_this_machine_sends gives cores 2, base 2700 / boost 3500 MHz, ram 31, nvme, ac, laptop. On the Mac mini: cores 14, nvme, ac, desktop, and clocks 0 (Apple silicon).

End to end (local server only, never production)

This ran on the ThinkPad inside a headless sway on its Intel GPU, with this branch's game (release), launcher and server, and HORIZON_TELEMETRY_URL=http://127.0.0.1:18432:

  1. Three fresh installs ran data allow all, which writes consent v2 and an install ID.
  2. data show printed every field.
  3. horizon-client --benchmark standard --render-distance 8 under the first install kept a benchmark and a perf item. Both carry cores 2, 2700/3500 MHz, nvme, integrated, intel, laptop, ac and the 1280x720 display.
  4. Those items were copied to the other two installs, and each launcher ran data send.
  5. /v1/benchmarks/summary gave one group with ram 32 GB, vram shared, storage nvme, os linux and gpu_kind integrated, each at 3 installs.
  6. /v1/aggregate breakdowns had the same classes, with hours and p50/p99. systems.extra holds the raw JSON.

The first run found display missing: under Wayland, current_monitor() is None until the window has been shown. Two fixes followed:

  • telemetry::monitor() falls back to the primary monitor, else the only one, and the display is read again when a session ends. Agent control's status uses the same function.
  • The benchmark asks for the display again at the end of the run.

Log: ~/code/horizon-parity/shots/desktop-bench-2026-10-23/telemetry-hw-e2e-thinkpad.log.

Needs Ludovic

  • Bumping CONSENT_VERSION re-asks everyone who already opted in. Collection launched on 2026-10-22, so few players are affected. Without the bump, the promise on the privacy page ("when what is collected changes, the launcher asks again") would be broken.

The site part (desktop results, breakdowns on /benchmarks, the RAM/VRAM-aware estimate) is in a separate PR.

pr_ready

pr_ready (tools/pr_ready.py --quick on ludovics-mac-mini, against origin/main at 8b5292972, 3 min 42 s)

Check Result
Scope ⚠️ 26 files, +1252 −90; 1248 lines of code: over 500, split it if it can ship in parts; mixes game, launcher, website
Cargo.lock ✅ changes with a Cargo.toml
Public tree ✅
Python tests ➖ no Python change
rustfmt ✅ (11 s)
clippy ✅ (2 s)
tests: workspace ✅ 1887 passed (1 min 18 s)
doc tests ✅ 1 passed (5 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ✅ (1 s)
launcher clippy ✅ (48 s)
launcher tests ✅ 97 passed (1 min 17 s)
Parity ➖ 322 affected, to run in CI (--quick): active_effect_tick, active_effects, ambient_sound, anchor, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes, auto_jump, bamboo and 310 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 Generated with Claude Code


🔄 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/1337 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/23/2026 **Status:** ✅ Merged **Merged:** 10/23/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/telemetry-hardware` --- ### 📝 Commits (4) - [`828398b`](https://github.com/horizon-rust/horizon/commit/828398b5ecc32ae782437c6f72f640464cce08c7) Telemetry: every hardware fact that explains performance, broken down by class - [`a57efd4`](https://github.com/horizon-rust/horizon/commit/a57efd4fa0a877aa285df50571d6074e6d1bcb0a) Launcher lock file: horizon-bench now depends on horizon-telemetry - [`75d818f`](https://github.com/horizon-rust/horizon/commit/75d818fad64e5347ecac7eadd1e2185d384e5b52) Telemetry: the screen also when Wayland names it late - [`213cffc`](https://github.com/horizon-rust/horizon/commit/213cffcf3eba0ff4afb7a2a6f7eb9d4c4193929c) Benchmark report: the screen read again at the end of the run ### 📊 Changes **27 files changed** (+1272 additions, -91 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+1 -0) 📝 `crates/horizon-bench/Cargo.toml` (+2 -0) 📝 `crates/horizon-bench/src/hardware.rs` (+51 -19) 📝 `crates/horizon-client/src/benchmark.rs` (+19 -0) 📝 `crates/horizon-client/src/game.rs` (+6 -0) 📝 `crates/horizon-client/src/game/control.rs` (+1 -1) 📝 `crates/horizon-client/src/gfx.rs` (+7 -5) 📝 `crates/horizon-client/src/telemetry.rs` (+79 -11) ➕ `crates/horizon-telemetry-server/src/classes.rs` (+103 -0) 📝 `crates/horizon-telemetry-server/src/lib.rs` (+1 -0) 📝 `crates/horizon-telemetry-server/src/store.rs` (+212 -10) 📝 `crates/horizon-telemetry-server/src/summary.rs` (+42 -1) 📝 `crates/horizon-telemetry-server/tests/server.rs` (+39 -0) 📝 `crates/horizon-telemetry-server/tests/summary.rs` (+4 -0) 📝 `crates/horizon-telemetry/src/lib.rs` (+3 -2) 📝 `crates/horizon-telemetry/src/payload.rs` (+35 -4) 📝 `crates/horizon-telemetry/src/system.rs` (+481 -3) 📝 `docs/benchmark-report.md` (+7 -4) 📝 `docs/telemetry.md` (+33 -4) 📝 `launcher/Cargo.lock` (+1 -0) _...and 7 more files_ </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. What players send, when they opt in, now covers every hardware fact that can explain performance. Public output gets breakdowns by coarse hardware class, and each published class needs at least 3 different installs. ## What is added (the switches are unchanged and stay off until the player turns them on) `system` in perf, crash and bug items now carries these besides the OS and version, arch, CPU model, threads, RAM, GPU name, driver and backend: | Field | Source | |---|---| | `cores`, `cpu_base_mhz`, `cpu_boost_mhz` | Linux: `/proc/cpuinfo` and cpufreq (`base_frequency` / ACPI CPPC nominal, `cpuinfo_max_freq`). macOS: `hw.physicalcpu` and `hw.cpufrequency(_max)`, which are 0 on Apple silicon. Windows: CIM `NumberOfCores` / `MaxClockSpeed` | | `gpu_vendor`, `gpu_kind` | wgpu adapter info: PCI vendor ID, then the name; `integrated` / `discrete` | | `vram_mb` | discrete GPUs only: `nvidia-smi`, amdgpu `mem_info_vram_total`, Intel `lmem_total_bytes`, macOS `system_profiler`, Windows registry `qwMemorySize`. Rounded up to 256 MiB | | `storage` | the drive under the game folder, `nvme` / `ssd` / `hdd`. Linux: mountinfo → `/sys/class/block` (through dm/LUKS slaves). macOS: `diskutil`. Windows: `Get-PhysicalDisk` | | `display` | the monitor the window opened on: physical size, refresh, scale (winit) | | `power`, `form` | `ac` / `battery`; `laptop` / `desktop` (DMI chassis type, else whether there is a battery) | Benchmark reports get the same in `hardware`: `cpu_cores`, `cpu_base_mhz`, `cpu_boost_mhz`, `storage`, `form` and `gpu.vram_mb`. - **"RAM given to the game"**: Horizon has no Java heap to set, so `peak_ram_mb` (already sent) is what it used. Vanilla runs in our own benchmarks use the official launcher's `-Xmx2G`. - **Not read**: serial numbers, hostnames, user names, MAC addresses and paths. Only `/sys` class files and the commands named above are read, nothing with an ID. - **Consent**: `CONSENT_VERSION` goes 1 → 2, as docs/telemetry.md and the privacy page promise when what is collected changes. Players who already opted in are asked again, and nothing new is kept until they answer. The Performance switch's text lists the new fields. ## Server - `systems.extra` holds the new fields as JSON. On the first start, an old database's `systems` table is rebuilt once with the column and keeps its ids (unit test from the old schema). Raw values stay for the 180-day retention, as now. - `GET /v1/aggregate` adds `breakdowns`: play sessions in the window per class of `ram`, `vram`, `storage`, `os` and `gpu_kind`, with installs, sessions, hours and mean p50/p99. These are computed from raw rows, so only within retention. - `GET /v1/benchmarks/summary`: each group adds `breakdowns` (installs per class). - Classes are coarse: RAM 4/8/16/32/64+ GB, VRAM shared/2/4/6/8/12/16/16+ GB, nvme/ssd/hdd, linux/macos/windows, integrated/discrete. A class shows only with ≥3 installs and a dimension without one is left out. Driver, OS version, clocks, screen and power are never published. Tests check that no raw value (exact RAM/VRAM, driver, OS version, install ID) appears in either endpoint. - **Bug fix**: `summary::rejection` returned `None` (accepted) for an app that is neither Horizon nor plain vanilla, because `game(&report["app"])?` used `?` on the `Option`. It now returns `"not Horizon or plain vanilla"`, as `benchmarks.mjs` does. ## Site script, shared fixtures, docs - `website/scripts/benchmarks.mjs` mirrors the classes and breakdowns. The fixtures (`website/scripts/fixtures/benchmarks/`) give the RTX 4080 group published VRAM/OS/GPU-kind cells and suppressed RAM/drive cells (2 + 1 installs). Both the Node test and the server test check them. - `docs/telemetry.md` lists every field, the classes and what is never published. `docs/benchmark-report.md` has the new `hardware` fields. `website/src/privacy.html` lists every field in plain words. - Launcher: "View what would be sent" and `horizon-launcher data show` print every field. The GPU and screen are example values, marked as such, because only the game knows them. Bug reports carry the drive. ## Checks - `cargo fmt --check` for the workspace, launcher and server. - `cargo clippy -D warnings`: horizon-telemetry, horizon-bench and horizon-client on macOS; horizon-telemetry and horizon-bench on Linux; the launcher on Linux (nix-shell); the server workspace. - `cargo check --workspace --all-targets` passes. - Tests: horizon-telemetry 34, horizon-bench, the server (lib 5, live 5, server 9, summary 4), the launcher 97+14+1+1, and the site's `npm test` (17). - On the ThinkPad, `what_this_machine_sends` gives cores 2, base 2700 / boost 3500 MHz, ram 31, `nvme`, `ac`, `laptop`. On the Mac mini: cores 14, `nvme`, `ac`, `desktop`, and clocks 0 (Apple silicon). ## End to end (local server only, never production) This ran on the ThinkPad inside a headless sway on its Intel GPU, with this branch's game (release), launcher and server, and `HORIZON_TELEMETRY_URL=http://127.0.0.1:18432`: 1. Three fresh installs ran `data allow all`, which writes consent v2 and an install ID. 2. `data show` printed every field. 3. `horizon-client --benchmark standard --render-distance 8` under the first install kept a `benchmark` and a `perf` item. Both carry cores 2, 2700/3500 MHz, `nvme`, `integrated`, `intel`, `laptop`, `ac` and the 1280x720 display. 4. Those items were copied to the other two installs, and each launcher ran `data send`. 5. `/v1/benchmarks/summary` gave one group with `ram` 32 GB, `vram` shared, `storage` nvme, `os` linux and `gpu_kind` integrated, each at 3 installs. 6. `/v1/aggregate` `breakdowns` had the same classes, with hours and p50/p99. `systems.extra` holds the raw JSON. The first run found `display` missing: under Wayland, `current_monitor()` is `None` until the window has been shown. Two fixes followed: - `telemetry::monitor()` falls back to the primary monitor, else the only one, and the display is read again when a session ends. Agent control's status uses the same function. - The benchmark asks for the display again at the end of the run. Log: `~/code/horizon-parity/shots/desktop-bench-2026-10-23/telemetry-hw-e2e-thinkpad.log`. ## Needs Ludovic - Bumping `CONSENT_VERSION` re-asks everyone who already opted in. Collection launched on 2026-10-22, so few players are affected. Without the bump, the promise on the privacy page ("when what is collected changes, the launcher asks again") would be broken. The site part (desktop results, breakdowns on /benchmarks, the RAM/VRAM-aware estimate) is in a separate PR. <details><summary>pr_ready</summary> **pr_ready** (`tools/pr_ready.py --quick` on ludovics-mac-mini, against origin/main at 8b5292972, 3 min 42 s) | Check | Result | | --- | --- | | Scope | ⚠️ 26 files, +1252 −90; 1248 lines of code: over 500, split it if it can ship in parts; mixes game, launcher, website | | Cargo.lock | ✅ changes with a Cargo.toml | | Public tree | ✅ | | Python tests | ➖ no Python change | | rustfmt | ✅ (11 s) | | clippy | ✅ (2 s) | | tests: workspace | ✅ 1887 passed (1 min 18 s) | | doc tests | ✅ 1 passed (5 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ✅ (1 s) | | launcher clippy | ✅ (48 s) | | launcher tests | ✅ 97 passed (1 min 17 s) | | Parity | ➖ 322 affected, to run in CI (--quick): active_effect_tick, active_effects, ambient_sound, anchor, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes, auto_jump, bamboo and 310 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | </details> 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:09:53 +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#3486
No description provided.