[PR #5629] [MERGED] Light views of proto chunks: copy their blocks only #6398

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/5629
Author: @ludovic111
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: perf/light-view-blocks


📝 Commits (1)

  • 8e5ab9e Light views of proto chunks: their blocks only

📊 Changes

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

View changed files

📝 crates/horizon-client/src/vanillagen.rs (+28 -15)

📄 Description

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

A finished column at the edge of the generated area is lit against its decorated proto neighbours. Each neighbour is copied into a column on the server thread by light_view, and the light engine (light_chunk) reads only the blocks of those neighbours. The copy also rebuilt, for every proto:

  • each section's biomes: 64 biome lookups and a palette per section, 24 sections;
  • the scheduled ticks;
  • the post-processing marks;
  • the structure references.

light_view now copies only the blocks (block_column). The final column (finish → column) still gets everything, unchanged.

How it was found: I split streaming into bench-only sub-spans (branch bench/sp2-stream-spans, not for merge) on playhorizon with 20 mixed bots. Building and submitting the light jobs took 1.45 ms of the 5 ms streaming span. It was CPU time, not waiting, about 8 columns per tick.

Measurement

playhorizon (EPYC, CPUs 0-3, exclusive), server_bench.py horizon, 20 mixed bots, warm-up 60 s, 120 s window, 3 alternated rounds. Base is main d0ce8fa54, this branch is 8e5ab9ec6.

streaming span (ms/tick) round 1 round 2 round 3 median
main 4.82 4.84 4.69 4.82
this PR 4.64 4.64 4.47 4.64 (−3.7 %)

MSPT stays within noise: 28.5 / 28.7 / 28.0 against 28.6 / 29.2 / 31.0. It follows the mob count, and tick_mobs and tick_lan, which this change does not touch, moved the same way. The streaming span fell in every round.

Checks

  • pr_ready --quick: pass. Results: fmt, clippy -D warnings, 1577 horizon-client tests, 510 Python tests. The 34 affected harnesses run in CI.
  • Lighting results stay the same: light_chunk reads only sections[..].blocks and light of the neighbours. A view never had light, and biomes are never read.

🤖 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/5629 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `perf/light-view-blocks` --- ### 📝 Commits (1) - [`8e5ab9e`](https://github.com/horizon-rust/horizon/commit/8e5ab9ec63779b17b761ee1f254a6de92647bec6) Light views of proto chunks: their blocks only ### 📊 Changes **1 file changed** (+28 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/vanillagen.rs` (+28 -15) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. A finished column at the edge of the generated area is lit against its decorated proto neighbours. Each neighbour is copied into a column on the server thread by `light_view`, and the light engine (`light_chunk`) reads only the blocks of those neighbours. The copy also rebuilt, for every proto: - each section's biomes: 64 biome lookups and a palette per section, 24 sections; - the scheduled ticks; - the post-processing marks; - the structure references. `light_view` now copies only the blocks (`block_column`). The final column (`finish` → `column`) still gets everything, unchanged. How it was found: I split `streaming` into bench-only sub-spans (branch `bench/sp2-stream-spans`, not for merge) on playhorizon with 20 mixed bots. Building and submitting the light jobs took 1.45 ms of the 5 ms `streaming` span. It was CPU time, not waiting, about 8 columns per tick. ### Measurement playhorizon (EPYC, CPUs 0-3, exclusive), `server_bench.py` horizon, 20 mixed bots, warm-up 60 s, 120 s window, 3 alternated rounds. Base is main d0ce8fa54, this branch is 8e5ab9ec6. | `streaming` span (ms/tick) | round 1 | round 2 | round 3 | median | |---|---|---|---|---| | main | 4.82 | 4.84 | 4.69 | 4.82 | | this PR | 4.64 | 4.64 | 4.47 | **4.64 (−3.7 %)** | MSPT stays within noise: 28.5 / 28.7 / 28.0 against 28.6 / 29.2 / 31.0. It follows the mob count, and `tick_mobs` and `tick_lan`, which this change does not touch, moved the same way. The `streaming` span fell in every round. ### Checks - `pr_ready --quick`: pass. Results: fmt, clippy -D warnings, 1577 horizon-client tests, 510 Python tests. The 34 affected harnesses run in CI. - Lighting results stay the same: `light_chunk` reads only `sections[..].blocks` and light of the neighbours. A view never had light, and biomes are never read. 🤖 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 06:19:56 +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#6398
No description provided.