[PR #267] [MERGED] Mesh each column once its neighbours' light has settled #2450

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

📋 Pull Request Information

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

Base: main ← Head: feat/perf-mesh-once


📝 Commits (2)

  • 4f3326e Mesh a column once its neighbours' light has settled
  • 78f206b Mesh only when no neighbour is being lit; skip columns that can't be lit yet

📊 Changes

1 file changed (+15 additions, -5 deletions)

View changed files

📝 crates/horizon-client/src/streaming.rs (+15 -5)

📄 Description

Streaming meshed a column as soon as its own light job finished, and every later light job in the 3×3 around it dirtied its sections again, so most sections were meshed two to four times while a world loaded. A column is now meshed once no neighbour is still waiting for light, and columns whose neighbours can't be lit yet are skipped.

A/B (Mac mini M4 Pro, offscreen, perf_bench.py --distances 16 --scenes village,mountain --repeats 3)

main this PR
sections meshed, village 147,704 ± 12,878 122,864 ± 21,817 (−17%)
sections meshed, mountain 178,254 ± 12,979 124,314 ± 29,624 (−30%)
load to settled, village 116.4 s (107.1–121.7) 112.0 s (104.1–117.7)
load to settled, mountain 124.7 s (106.9–153.0) 99.9 s (73.6–130.0)
1-min load average at start 30.0 43.9

The machine was shared with CI (load 30–50), so the timings are noisy; the mesh counts are the reliable part. A spawn at RD12 run three times on each build: 93,321 → 72,697, 102,761 → 81,892 and 123,255 → 99,621 meshes (−21% to −22%), with settle times within run-to-run noise.

Same pixels

Screenshots after the world settles (offscreen, animated textures off, chat faded), main twice (A, A2) and this branch (B): A–A2 differ by 25,602 / 23,614 / 16,935 px, A–B by 15,471 / 39,991 / 27,022 px. Both are clouds and the same few vegetation spots, so the frame matches main within main's own run-to-run noise.

Checks

  • tools/parity.py section_mesh light: green on the Mac mini.
  • cargo fmt --check, cargo clippy --workspace --all-targets -D warnings, cargo test -p horizon-client pass (front::tests::horizon_world_delete_confirms… failed once and passed on rerun; it does not touch streaming).

Part of the benchmark work (features item 6).

🤖 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/267 **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/perf-mesh-once` --- ### 📝 Commits (2) - [`4f3326e`](https://github.com/horizon-rust/horizon/commit/4f3326e983eb19f945b7b4654640523695b993f6) Mesh a column once its neighbours' light has settled - [`78f206b`](https://github.com/horizon-rust/horizon/commit/78f206bc223ec4c80378f2840db4d979598fada8) Mesh only when no neighbour is being lit; skip columns that can't be lit yet ### 📊 Changes **1 file changed** (+15 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/streaming.rs` (+15 -5) </details> ### 📄 Description Streaming meshed a column as soon as its own light job finished, and every later light job in the 3×3 around it dirtied its sections again, so most sections were meshed two to four times while a world loaded. A column is now meshed once no neighbour is still waiting for light, and columns whose neighbours can't be lit yet are skipped. ## A/B (Mac mini M4 Pro, offscreen, `perf_bench.py --distances 16 --scenes village,mountain --repeats 3`) | | main | this PR | |---|---|---| | sections meshed, village | 147,704 ± 12,878 | **122,864** ± 21,817 (−17%) | | sections meshed, mountain | 178,254 ± 12,979 | **124,314** ± 29,624 (−30%) | | load to settled, village | 116.4 s (107.1–121.7) | 112.0 s (104.1–117.7) | | load to settled, mountain | 124.7 s (106.9–153.0) | 99.9 s (73.6–130.0) | | 1-min load average at start | 30.0 | 43.9 | The machine was shared with CI (load 30–50), so the timings are noisy; the mesh counts are the reliable part. A spawn at RD12 run three times on each build: 93,321 → 72,697, 102,761 → 81,892 and 123,255 → 99,621 meshes (−21% to −22%), with settle times within run-to-run noise. ## Same pixels Screenshots after the world settles (offscreen, animated textures off, chat faded), main twice (A, A2) and this branch (B): A–A2 differ by 25,602 / 23,614 / 16,935 px, A–B by 15,471 / 39,991 / 27,022 px. Both are clouds and the same few vegetation spots, so the frame matches main within main's own run-to-run noise. ## Checks - `tools/parity.py section_mesh light`: green on the Mac mini. - `cargo fmt --check`, `cargo clippy --workspace --all-targets -D warnings`, `cargo test -p horizon-client` pass (`front::tests::horizon_world_delete_confirms…` failed once and passed on rerun; it does not touch streaming). Part of the benchmark work (features item 6). 🤖 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:15 +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#2450
No description provided.