[PR #247] [MERGED] Benchmark report format v1 (docs/benchmark-report.md, crates/horizon-bench) #2435

Closed
opened 2026-11-02 15:56:06 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: feat/bench-report


📝 Commits (3)

  • e0ab3f8 Benchmark report format v1: docs/benchmark-report.md and crates/horizon-bench
  • a500e25 horizon-bench: load average, power source, RSS and CPU time probes; launcher metric names
  • 650ad39 Benchmark report uploads are dated to the day, like every telemetry item

📊 Changes

7 files changed (+860 additions, -1 deletions)

View changed files

📝 Cargo.lock (+8 -0)
📝 Cargo.toml (+1 -1)
➕ crates/horizon-bench/Cargo.toml (+10 -0)
➕ crates/horizon-bench/src/hardware.rs (+259 -0)
➕ crates/horizon-bench/src/lib.rs (+457 -0)
📝 docs/README.md (+1 -0)
➕ docs/benchmark-report.md (+124 -0)

📄 Description

What

The one JSON format every Horizon benchmark writes, put down early so the telemetry work (briefs/telemetry.md, telemetry-1) and the benchmark mode build on the same thing:

  • docs/benchmark-report.md: the schema, version 1. format/version, kind (game/launcher), app, hardware (OS, CPU, threads, RAM, GPU name/vendor/driver/backend/kind, display), conditions (what must match to compare: scenario, seed, render/simulation distance, window, vsync, FPS cap, offscreen, repeats, warm-up, power, load average), metrics (named scalars summarised over repeats: n, mean, stdev, min, max, 95% CI; the unit is the name's suffix; table of the names the tools will write, launcher ones included) and frames (per phase and repeat: avg FPS, 1% and 0.1% lows, p50/p95/p99/p99.9/max, CPU/GPU p50, and a 24-bucket histogram with edges fixed by the version so histograms from any number of reports add up).
  • crates/horizon-bench: the types (serde), Summary::of (Student's t CI), Frames::of (same definitions as tools/perf_bench.py's stats()), Hardware::detect (macOS sysctl/sw_vers, Linux /proc and os-release, Windows), Report::{new, metric, parse, for_upload, write_to}. Only serde + serde_json; the launcher can depend on it by path like horizon-theme.

Why

Ludovic (2026-10-15): benchmark everything, launcher included, every hardware, and store player data efficiently. Uploads must be small and carry no raw streams or personal data: the report has no host name, user name, path or address, and for_upload() drops the two local-only fields (label, local). Numbers are rounded to 3 decimals (short JSON, exact round trip).

Nothing uses it yet: the next PRs make horizon-client --benchmark, the launcher and tools/perf_bench.py write it.

How tested

cargo fmt --all -- --check                                   ok
cargo clippy --workspace --all-targets -- -D warnings        ok
cargo test -p horizon-bench                                  7 passed (stats, histogram edges, CI, UTC dates, round trip, upload stripping, version rejection, file naming, hardware detection on this Mac)

No harness covers this (new crate, no game code touched).

Needs Ludovic

Nothing. The telemetry agent should read docs/benchmark-report.md before defining its payload.

🤖 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/247 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/15/2026 **Status:** ✅ Merged **Merged:** 10/15/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/bench-report` --- ### 📝 Commits (3) - [`e0ab3f8`](https://github.com/horizon-rust/horizon/commit/e0ab3f8fccf9790656f85ff0983b70dfe8ffee9e) Benchmark report format v1: docs/benchmark-report.md and crates/horizon-bench - [`a500e25`](https://github.com/horizon-rust/horizon/commit/a500e2570550b4a1ce5f1186856b846228417deb) horizon-bench: load average, power source, RSS and CPU time probes; launcher metric names - [`650ad39`](https://github.com/horizon-rust/horizon/commit/650ad39d854d94b496c2306304dba5999847176a) Benchmark report uploads are dated to the day, like every telemetry item ### 📊 Changes **7 files changed** (+860 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+8 -0) 📝 `Cargo.toml` (+1 -1) ➕ `crates/horizon-bench/Cargo.toml` (+10 -0) ➕ `crates/horizon-bench/src/hardware.rs` (+259 -0) ➕ `crates/horizon-bench/src/lib.rs` (+457 -0) 📝 `docs/README.md` (+1 -0) ➕ `docs/benchmark-report.md` (+124 -0) </details> ### 📄 Description ## What The one JSON format every Horizon benchmark writes, put down early so the telemetry work (briefs/telemetry.md, telemetry-1) and the benchmark mode build on the same thing: - `docs/benchmark-report.md`: the schema, version 1. `format`/`version`, `kind` (game/launcher), `app`, `hardware` (OS, CPU, threads, RAM, GPU name/vendor/driver/backend/kind, display), `conditions` (what must match to compare: scenario, seed, render/simulation distance, window, vsync, FPS cap, offscreen, repeats, warm-up, power, load average), `metrics` (named scalars summarised over repeats: n, mean, stdev, min, max, 95% CI; the unit is the name's suffix; table of the names the tools will write, launcher ones included) and `frames` (per phase and repeat: avg FPS, 1% and 0.1% lows, p50/p95/p99/p99.9/max, CPU/GPU p50, and a 24-bucket histogram with edges fixed by the version so histograms from any number of reports add up). - `crates/horizon-bench`: the types (serde), `Summary::of` (Student's t CI), `Frames::of` (same definitions as `tools/perf_bench.py`'s `stats()`), `Hardware::detect` (macOS sysctl/sw_vers, Linux /proc and os-release, Windows), `Report::{new, metric, parse, for_upload, write_to}`. Only serde + serde_json; the launcher can depend on it by path like `horizon-theme`. ## Why Ludovic (2026-10-15): benchmark everything, launcher included, every hardware, and store player data efficiently. Uploads must be small and carry no raw streams or personal data: the report has no host name, user name, path or address, and `for_upload()` drops the two local-only fields (`label`, `local`). Numbers are rounded to 3 decimals (short JSON, exact round trip). Nothing uses it yet: the next PRs make `horizon-client --benchmark`, the launcher and `tools/perf_bench.py` write it. ## How tested ``` cargo fmt --all -- --check ok cargo clippy --workspace --all-targets -- -D warnings ok cargo test -p horizon-bench 7 passed (stats, histogram edges, CI, UTC dates, round trip, upload stripping, version rejection, file naming, hardware detection on this Mac) ``` No harness covers this (new crate, no game code touched). ## Needs Ludovic Nothing. The telemetry agent should read `docs/benchmark-report.md` before defining its payload. 🤖 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-02 15:56:06 +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#2435
No description provided.