[PR #1275] [MERGED] perf_bench: wait for Horizon to actually load before timing a scene #3476

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

📋 Pull Request Information

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

Base: main ← Head: fix/perf-bench-readiness


📝 Commits (2)

  • 7eded53 perf_bench: wait for Horizon to actually load before timing a scene
  • 9e1c3ec perf_bench: the readiness gate only with a chunk target; a test for the quiet start

📊 Changes

2 files changed (+32 additions, -5 deletions)

View changed files

📝 tests/test_perf_bench.py (+14 -2)
📝 tools/perf_bench.py (+18 -3)

📄 Description

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

What

Fixes a timing bug in tools/perf_bench.py's wait_loaded() for Horizon. Right after a teleport, and at spawn, Horizon v2026.10.22.04 reports nothing queued and steady chunk counts for more than a second before it starts loading. The harness treated that as "loaded" and stopped the clock with 0–3 sections meshed. So scene loads came out at about 0.1 s, and the flights ran over empty terrain: the frame rates measured nearly nothing.

What changes in the wait (vanilla's path is untouched):

  • the chunk counts must change at least once since the wait began, or stay at the full view for 5 s;
  • the resident chunks must reach 80% of the view circle (view_chunks(rd) = 0.8·π·rd²; Horizon keeps 637 columns at RD 12 and 3725 at RD 32);
  • only then does a steady second count as loaded.

Why

The numbers on the website's Benchmarks page (#1274) were measured with this fix. Without it, Horizon's load times and frame rates are wrong.

How tested

  • Before the fix, ThinkPad runs had Horizon at load 0.1 s with ≤3 meshes. Those reports were thrown away.
  • With the fix, Horizon loads on the Mac mini take 7–23 s per scene at RD 12/32, and on the ThinkPad 42–81 s at RD 12, with 15–18k sections meshed. The flights now run over loaded terrain.
  • An earlier version of the fix, which waited for 95% of the square, timed out at RD 32. That is why it uses 80% of the circle.
  • tests/test_perf_bench.py: a new case scripts a quiet start before the load. Without a target (the old call), behaviour is unchanged, which the old-builds case checks. python3 -m unittest tests.test_perf_bench: 7 OK. CI verify passes.
  • Note: at RD 32, a 4-thread laptop needs --timeout above the default 300 s to load the spawn.

Needs Ludovic

Nothing. Label skip-release (a tool only).

🤖 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/1275 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/22/2026 **Status:** ✅ Merged **Merged:** 10/23/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/perf-bench-readiness` --- ### 📝 Commits (2) - [`7eded53`](https://github.com/horizon-rust/horizon/commit/7eded537d6b69c98e4f8476360feaa3359395b74) perf_bench: wait for Horizon to actually load before timing a scene - [`9e1c3ec`](https://github.com/horizon-rust/horizon/commit/9e1c3ec860c0961385a2f2b77d13d4627b9ea833) perf_bench: the readiness gate only with a chunk target; a test for the quiet start ### 📊 Changes **2 files changed** (+32 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_perf_bench.py` (+14 -2) 📝 `tools/perf_bench.py` (+18 -3) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## What Fixes a timing bug in `tools/perf_bench.py`'s `wait_loaded()` for Horizon. Right after a teleport, and at spawn, Horizon v2026.10.22.04 reports nothing queued and steady chunk counts for more than a second **before** it starts loading. The harness treated that as "loaded" and stopped the clock with 0–3 sections meshed. So scene loads came out at about 0.1 s, and the flights ran over empty terrain: the frame rates measured nearly nothing. What changes in the wait (vanilla's path is untouched): - the chunk counts must change at least once since the wait began, or stay at the full view for 5 s; - the resident chunks must reach 80% of the view circle (`view_chunks(rd)` = 0.8·π·rd²; Horizon keeps 637 columns at RD 12 and 3725 at RD 32); - only then does a steady second count as loaded. ## Why The numbers on the website's Benchmarks page (#1274) were measured with this fix. Without it, Horizon's load times and frame rates are wrong. ## How tested - Before the fix, ThinkPad runs had Horizon at load 0.1 s with ≤3 meshes. Those reports were thrown away. - With the fix, Horizon loads on the Mac mini take 7–23 s per scene at RD 12/32, and on the ThinkPad 42–81 s at RD 12, with 15–18k sections meshed. The flights now run over loaded terrain. - An earlier version of the fix, which waited for 95% of the square, timed out at RD 32. That is why it uses 80% of the circle. - `tests/test_perf_bench.py`: a new case scripts a quiet start before the load. Without a target (the old call), behaviour is unchanged, which the old-builds case checks. `python3 -m unittest tests.test_perf_bench`: 7 OK. CI verify passes. - Note: at RD 32, a 4-thread laptop needs `--timeout` above the default 300 s to load the spawn. ## Needs Ludovic Nothing. Label `skip-release` (a tool only). 🤖 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:48 +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#3476
No description provided.