[PR #206] [MERGED] Benchmark Horizon against vanilla 26.3 and vanilla + performance mods (tools/perf_bench.py, docs/benchmark.md) #2405

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

📋 Pull Request Information

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

Base: main ← Head: feat/perf-bench


📝 Commits (2)

  • b691b5e Benchmark Horizon against vanilla 26.3 and vanilla with performance mods
  • e6be303 docs/benchmark.md: no unmeasured startup figure

📊 Changes

12 files changed (+1056 additions, -4 deletions)

View changed files

📝 crates/horizon-client/src/bin/horizon-ctl/commands.rs (+2 -1)
📝 crates/horizon-client/src/control.rs (+4 -0)
📝 crates/horizon-client/src/game.rs (+8 -1)
📝 crates/horizon-client/src/game/control.rs (+9 -2)
📝 docs/README.md (+1 -0)
➕ docs/benchmark.md (+50 -0)
➕ mods/horizon/src/bench/java/dev/horizonlab/bench/VanillaBench.java (+300 -0)
➕ mods/horizon/src/bench/java/dev/horizonlab/bench/mixin/FrameHookMixin.java (+17 -0)
➕ mods/horizon/src/bench/resources/fabric.mod.json (+21 -0)
➕ mods/horizon/src/bench/resources/horizon_bench.mixins.json (+11 -0)
➕ tests/test_perf_bench.py (+35 -0)
➕ tools/perf_bench.py (+598 -0)

📄 Description

What

A fair, reproducible benchmark of Horizon against the vanilla 26.3 client and vanilla with performance mods (NEXT-VERSION §3, queue item 6). Methodology first: docs/benchmark.md.

  • tools/perf_bench.py --game horizon|vanilla|vanilla-mods: one game per render distance (8, 16, 32), each from a fresh world (seed 1234, creative), through the same steps: start → title screen, create the world, wait for the spawn area, then per scene (the four 192-block paths of graphics_bench.py) teleport, wait for every chunk, settle 2 s, fly the path in 12 s facing along it. Records start-to-title and start-to-in-world time, chunk load time per scene, every frame time of every flight, RSS (peak and steady, sampled with ps from outside), GPU memory where readable (Horizon's Vulkan allocator, nvidia-smi).
  • One stats() computes avg FPS, 1% and 0.1% lows, p50/p95/p99/p99.9 and a frame-time histogram for every game from raw frame times.
  • One options.txt for every game, vanilla's keys: vanilla's default preset (Fancy) values with the preset set to Custom so the render distance holds (Fancy otherwise forces 16 on load), unlimited FPS, no VSync, and inactivityFpsLimit:minimized (both games otherwise drop to 30 FPS after a minute without input).
  • Vanilla driver: a dev-only Fabric mod (mods/horizon/src/bench, built by the script against your own client jar; Fabric Loader only, no Fabric API). It creates the world with WorldOpenFlows.createFreshLevel as Create World does, teleports with /tp, and places the player on the path every frame as horizon-ctl fly does. Vanilla runs with the official launcher's default JVM arguments (-Xmx2G, its G1 flags), Java 25, no sound.
  • Performance mods exist for 26.3: Sodium 0.9.2, Lithium 0.26.2, FerriteCore 9.0.0, ImmediatelyFast 1.17.1 (Fabric), the versions already pinned with hashes in packs/mods.lock.json, fetched from Modrinth, never committed.
  • Horizon side (dev-only, no gameplay change): horizon-ctl fly ... PITCH raw also returns every frame time; --offscreen drives frames from the event loop instead of waiting for redraws, so it renders even when the window can't be seen (the Mac mini's session is locked: an occluded window gets no redraws).

Why

Item 6 asks for a public, fair comparison. graphics_bench.py only measured Horizon and reused the world between distances; this adds the vanilla side, fresh worlds per distance, lows down to 0.1%, startup, chunk load and memory.

Checked

  • Smoke runs on the Mac mini (M4 Pro, macOS, locked session, so Horizon offscreen; vanilla renders OpenGL 4.1 on Metal): RD 8 village/mountain: vanilla 101/403 FPS avg, Horizon 355/564 FPS avg; startup and RSS recorded. Full numbers come in a separate PR once the Mac mini is idle (CI and other agents kept its load average near 40 tonight).
  • python3 -m unittest tests.test_perf_bench (stats definitions), tools/check_public_tree.py, cargo fmt --check. The client changes built in release on the Mac mini.
  • No parity harness covers fly/--offscreen (dev-only paths); gameplay code is untouched.

🤖 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/206 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/14/2026 **Status:** ✅ Merged **Merged:** 10/15/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/perf-bench` --- ### 📝 Commits (2) - [`b691b5e`](https://github.com/horizon-rust/horizon/commit/b691b5ebaa9acee1eb4c4353ad87bc6ae63c6be8) Benchmark Horizon against vanilla 26.3 and vanilla with performance mods - [`e6be303`](https://github.com/horizon-rust/horizon/commit/e6be30351791f24224e24f53754cf7fdcc1d6e92) docs/benchmark.md: no unmeasured startup figure ### 📊 Changes **12 files changed** (+1056 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/bin/horizon-ctl/commands.rs` (+2 -1) 📝 `crates/horizon-client/src/control.rs` (+4 -0) 📝 `crates/horizon-client/src/game.rs` (+8 -1) 📝 `crates/horizon-client/src/game/control.rs` (+9 -2) 📝 `docs/README.md` (+1 -0) ➕ `docs/benchmark.md` (+50 -0) ➕ `mods/horizon/src/bench/java/dev/horizonlab/bench/VanillaBench.java` (+300 -0) ➕ `mods/horizon/src/bench/java/dev/horizonlab/bench/mixin/FrameHookMixin.java` (+17 -0) ➕ `mods/horizon/src/bench/resources/fabric.mod.json` (+21 -0) ➕ `mods/horizon/src/bench/resources/horizon_bench.mixins.json` (+11 -0) ➕ `tests/test_perf_bench.py` (+35 -0) ➕ `tools/perf_bench.py` (+598 -0) </details> ### 📄 Description ## What A fair, reproducible benchmark of Horizon against the vanilla 26.3 client and vanilla with performance mods (NEXT-VERSION §3, queue item 6). Methodology first: **[docs/benchmark.md](docs/benchmark.md)**. - `tools/perf_bench.py --game horizon|vanilla|vanilla-mods`: one game per render distance (8, 16, 32), each from a **fresh** world (seed 1234, creative), through the same steps: start → title screen, create the world, wait for the spawn area, then per scene (the four 192-block paths of `graphics_bench.py`) teleport, wait for every chunk, settle 2 s, fly the path in 12 s facing along it. Records **start-to-title and start-to-in-world time, chunk load time per scene, every frame time of every flight, RSS (peak and steady, sampled with `ps` from outside), GPU memory where readable** (Horizon's Vulkan allocator, `nvidia-smi`). - One `stats()` computes avg FPS, **1% and 0.1% lows**, p50/p95/p99/p99.9 and a frame-time histogram for every game from raw frame times. - One `options.txt` for every game, vanilla's keys: vanilla's default preset (Fancy) values with the preset set to Custom so the render distance holds (Fancy otherwise forces 16 on load), unlimited FPS, no VSync, and `inactivityFpsLimit:minimized` (both games otherwise drop to 30 FPS after a minute without input). - **Vanilla driver**: a dev-only Fabric mod (`mods/horizon/src/bench`, built by the script against *your own* client jar; Fabric Loader only, no Fabric API). It creates the world with `WorldOpenFlows.createFreshLevel` as Create World does, teleports with `/tp`, and places the player on the path every frame as `horizon-ctl fly` does. Vanilla runs with the official launcher's default JVM arguments (`-Xmx2G`, its G1 flags), Java 25, no sound. - **Performance mods exist for 26.3**: Sodium 0.9.2, Lithium 0.26.2, FerriteCore 9.0.0, ImmediatelyFast 1.17.1 (Fabric), the versions already pinned with hashes in `packs/mods.lock.json`, fetched from Modrinth, never committed. - Horizon side (dev-only, no gameplay change): `horizon-ctl fly ... PITCH raw` also returns every frame time; `--offscreen` drives frames from the event loop instead of waiting for redraws, so it renders even when the window can't be seen (the Mac mini's session is locked: an occluded window gets no redraws). ## Why Item 6 asks for a public, fair comparison. `graphics_bench.py` only measured Horizon and reused the world between distances; this adds the vanilla side, fresh worlds per distance, lows down to 0.1%, startup, chunk load and memory. ## Checked - Smoke runs on the Mac mini (M4 Pro, macOS, locked session, so Horizon offscreen; vanilla renders OpenGL 4.1 on Metal): RD 8 village/mountain: vanilla 101/403 FPS avg, Horizon 355/564 FPS avg; startup and RSS recorded. Full numbers come in a separate PR once the Mac mini is idle (CI and other agents kept its load average near 40 tonight). - `python3 -m unittest tests.test_perf_bench` (stats definitions), `tools/check_public_tree.py`, `cargo fmt --check`. The client changes built in release on the Mac mini. - No parity harness covers `fly`/`--offscreen` (dev-only paths); gameplay code is untouched. 🤖 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:55:46 +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#2405
No description provided.