[PR #7530] [MERGED] perf(render): a teleport's column removal starts the occlusion graph over #7650

Closed
opened 2026-11-03 07:21:22 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: perf/remove-columns-bulk


📝 Commits (1)

  • 15db677 perf(render): a teleport's column removal starts the occlusion graph over

📊 Changes

2 files changed (+55 additions, -1 deletions)

View changed files

📝 crates/horizon-client-render/src/gfx.rs (+1 -1)
📝 crates/horizon-client-render/src/gfx/occlusion.rs (+54 -0)

📄 Description

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

What

A far teleport drops every column of the view at once. Renderer::remove_columns_at_once called Occlusion::remove_column for each one, which pushed one see-through edit per non-open section: some 27 000 at render distance 32 in the model below, more in real terrain. The next frame then propagated all of them into the old graph, which update drops right after because it no longer holds the camera.

Occlusion::remove_columns(&gone) now checks whether gone covers every column the store holds. If it does, the store starts over as clear does: one Edit::Clear, no graph, and frustum culling until the new search lands. That is also what the old path ended with. A partial removal still goes column by column.

A/B (render-thread CPU, thread CPU clock)

This is a temporary ignored test on playhorizon (not committed), run for 6 rounds. The world is a circle of 3,409 columns at render distance 32, 24 sections each, with caves below y 64, as in search_cost. The test removes every column, then runs update at a far camera.

removal next frame's update total
main 1.07–1.21 ms 2.54–2.59 ms ~3.7 ms over 2 frames
this PR 0.13–0.21 ms 0.001–0.011 ms ~0.2 ms

I measured this on the CPU because the Mac is loaded by other sessions. The swapchain acquire waits at teleport turned out to be external GPU load: they also happen while standing still, up to 100 ms, while Horizon's own GPU frames stay at 2–4 ms.

Test

removed_columns_leave_the_graph_of_a_world_without_them covers two cases:

  • Some columns removed: the graph is the one of a fresh store that never had those columns.
  • All columns removed (teleport): no stale graph culls anything, and the next search over newly arrived columns is the one of a fresh store.

pr_ready

pr_ready (tools/pr_ready.py --quick on playhorizon, against origin/main at b09827e93, 10 min 13 s)

Check Result
Scope ✅ 2 files, +55 −1
Cargo.lock ✅ unchanged
Public tree ✅ (1 s)
Python tests ✅ 614 passed (1 min 15 s)
rustfmt ✅ (17 s)
clippy ✅ (5 min 13 s)
tests: horizon-client-render ❌ failed (2 min 39 s)
doc tests ✅ 0 passed (2 s)
content root tests ➖ content root untouched
mod API up to date ➖ native hooks untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 141 affected, to run in CI (--quick): ambient_sound, anvil_turtle_egg, armor_stand_frost, armor_stand_turtle_egg, arrow, arrow_wind_charge, audio_attributes, auto_jump, blending, block_entity_anim, block_entity_render, block_entity_tickers and 129 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

The render lib's ❌ is the known llvmpipe SIGSEGV when tests run in parallel. Run single-threaded on the same checkout it passes: cargo test -p horizon-client-render --lib -- --test-threads=1 → 1163 passed, 0 failed.

🤖 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/7530 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `perf/remove-columns-bulk` --- ### 📝 Commits (1) - [`15db677`](https://github.com/horizon-rust/horizon/commit/15db6773cbb4a0c55e7b0d5138676f3e6d6c29a3) perf(render): a teleport's column removal starts the occlusion graph over ### 📊 Changes **2 files changed** (+55 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/gfx.rs` (+1 -1) 📝 `crates/horizon-client-render/src/gfx/occlusion.rs` (+54 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## What A far teleport drops every column of the view at once. `Renderer::remove_columns_at_once` called `Occlusion::remove_column` for each one, which pushed one see-through edit per non-open section: some 27 000 at render distance 32 in the model below, more in real terrain. The next frame then propagated all of them into the old graph, which `update` drops right after because it no longer holds the camera. `Occlusion::remove_columns(&gone)` now checks whether `gone` covers every column the store holds. If it does, the store starts over as `clear` does: one `Edit::Clear`, no graph, and frustum culling until the new search lands. That is also what the old path ended with. A partial removal still goes column by column. ## A/B (render-thread CPU, thread CPU clock) This is a temporary ignored test on playhorizon (not committed), run for 6 rounds. The world is a circle of 3,409 columns at render distance 32, 24 sections each, with caves below y 64, as in `search_cost`. The test removes every column, then runs `update` at a far camera. | | removal | next frame's `update` | total | |---|---|---|---| | main | 1.07–1.21 ms | 2.54–2.59 ms | ~3.7 ms over 2 frames | | this PR | 0.13–0.21 ms | 0.001–0.011 ms | ~0.2 ms | I measured this on the CPU because the Mac is loaded by other sessions. The swapchain acquire waits at teleport turned out to be external GPU load: they also happen while standing still, up to 100 ms, while Horizon's own GPU frames stay at 2–4 ms. ## Test `removed_columns_leave_the_graph_of_a_world_without_them` covers two cases: - **Some columns removed:** the graph is the one of a fresh store that never had those columns. - **All columns removed (teleport):** no stale graph culls anything, and the next search over newly arrived columns is the one of a fresh store. ## pr_ready **pr_ready** (`tools/pr_ready.py --quick` on playhorizon, against origin/main at b09827e93, 10 min 13 s) | Check | Result | | --- | --- | | Scope | ✅ 2 files, +55 −1 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ (1 s) | | Python tests | ✅ 614 passed (1 min 15 s) | | rustfmt | ✅ (17 s) | | clippy | ✅ (5 min 13 s) | | tests: horizon-client-render | ❌ failed (2 min 39 s) | | doc tests | ✅ 0 passed (2 s) | | content root tests | ➖ content root untouched | | mod API up to date | ➖ native hooks untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 141 affected, to run in CI (--quick): ambient_sound, anvil_turtle_egg, armor_stand_frost, armor_stand_turtle_egg, arrow, arrow_wind_charge, audio_attributes, auto_jump, blending, block_entity_anim, block_entity_render, block_entity_tickers and 129 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | The render lib's ❌ is the known llvmpipe SIGSEGV when tests run in parallel. Run single-threaded on the same checkout it passes: `cargo test -p horizon-client-render --lib -- --test-threads=1` → 1163 passed, 0 failed. 🤖 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 07:21:22 +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#7650
No description provided.