[PR #274] [MERGED] Mesh columns loaded past the render distance once they come in range (#228) #2452

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

📋 Pull Request Information

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

Base: main ← Head: fix/mesh-out-of-range


📝 Commits (1)

  • 4901bdf Mesh sections of columns that load past the render distance once in range (#228)

📊 Changes

2 files changed (+137 additions, -2 deletions)

View changed files

📝 crates/horizon-client/src/streaming.rs (+35 -2)
➕ crates/horizon-client/tests/streaming_meshes.rs (+102 -0)

📄 Description

Fixes #228.

What

Sections that were dirty while their column sat past the render distance are now set aside instead of dropped, and they are meshed once the player comes close enough.

Why

The mesh loop in Streaming::update removed every dirty section of a loaded column outside in_main_range(x, z, 0). Columns load up to three chunks past the render distance.

  • Generated column: its neighbours' light jobs re-dirty the 3x3 around it later, which mostly hid the drop.
  • Column loaded from a save with its light (light_loaded): it runs no light job, so nothing asks for its sections again. When the player walks or flies toward it, it stays invisible (or keeps stale holes) until a block in it changes. That is the "lost render continuity until the chunk is updated" in the report.

The fix:

  • Parks those sections in waiting.
  • Puts back the ones now within range into dirty_sections whenever the centre, radius or forced set changes.
  • Prunes waiting when columns unload or are forgotten.

rdbtCVS's meshing/visibility perf PRs were checked as suspects: #243 merged after the issue was filed, and #233 and #239 are unmerged. None of them is involved; the drop predates them.

How tested

  • New crates/horizon-client/tests/streaming_meshes.rs:
    • Columns load with their light, as saved chunks do.
    • The test settles at (0, 0), moves to (3, 0), and checks that every section of the 49 columns within radius 4 was uploaded.
    • It fails on origin/main ("section 3 0 -4 is in range but was never meshed") and passes with the fix.
  • Self-check:
cargo fmt --all -- --check                            OK
cargo clippy --workspace --all-targets -D warnings    exit 0
cargo test -p horizon-client -p horizon-world         804 passed, 0 failed

Needs Ludovic

Nothing. Merge this before #249's PR (saving every generated chunk): it makes most chunks load with their light, which would expose this bug everywhere.

🤖 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/274 **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:** `fix/mesh-out-of-range` --- ### 📝 Commits (1) - [`4901bdf`](https://github.com/horizon-rust/horizon/commit/4901bdf231a2cb90a04ac555c75ae8a734ab630c) Mesh sections of columns that load past the render distance once in range (#228) ### 📊 Changes **2 files changed** (+137 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/streaming.rs` (+35 -2) ➕ `crates/horizon-client/tests/streaming_meshes.rs` (+102 -0) </details> ### 📄 Description Fixes #228. ## What Sections that were dirty while their column sat past the render distance are now set aside instead of dropped, and they are meshed once the player comes close enough. ## Why The mesh loop in `Streaming::update` removed every dirty section of a loaded column outside `in_main_range(x, z, 0)`. Columns load up to three chunks past the render distance. - **Generated column:** its neighbours' light jobs re-dirty the 3x3 around it later, which mostly hid the drop. - **Column loaded from a save with its light (`light_loaded`):** it runs no light job, so nothing asks for its sections again. When the player walks or flies toward it, it stays invisible (or keeps stale holes) until a block in it changes. That is the "lost render continuity until the chunk is updated" in the report. The fix: - Parks those sections in `waiting`. - Puts back the ones now within range into `dirty_sections` whenever the centre, radius or forced set changes. - Prunes `waiting` when columns unload or are forgotten. rdbtCVS's meshing/visibility perf PRs were checked as suspects: #243 merged after the issue was filed, and #233 and #239 are unmerged. None of them is involved; the drop predates them. ## How tested - New `crates/horizon-client/tests/streaming_meshes.rs`: - Columns load with their light, as saved chunks do. - The test settles at (0, 0), moves to (3, 0), and checks that every section of the 49 columns within radius 4 was uploaded. - It fails on `origin/main` ("section 3 0 -4 is in range but was never meshed") and passes with the fix. - Self-check: ``` cargo fmt --all -- --check OK cargo clippy --workspace --all-targets -D warnings exit 0 cargo test -p horizon-client -p horizon-world 804 passed, 0 failed ``` ## Needs Ludovic Nothing. Merge this before #249's PR (saving every generated chunk): it makes most chunks load with their light, which would expose this bug everywhere. 🤖 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:17 +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#2452
No description provided.