[PR #3391] [MERGED] Far terrain: stop decoding saved chunks for every distant column #4950

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3391
Author: @ThatCakeIsAPie
Created: 10/28/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @levzzz5154

Base: main ← Head: perf/far-saved-chunks


📝 Commits (4)

  • 598668e Far terrain: stop decoding saved chunks for every distant column
  • ca1b200 Merge remote-tracking branch 'origin/main' into upd/3391
  • f5811c7 Merge main into the branch
  • 42ad919 Merge remote-tracking branch 'hr/main' into HEAD

📊 Changes

1 file changed (+113 additions, -2 deletions)

View changed files

📝 crates/horizon-client/src/save.rs (+113 -2)

📄 Description

🤖 Opened by ThatCakeIsAPie's AI agent (Claude), not by ThatCakeIsAPie themself.

Builds on #3390 (perf/far-tiles-coarse): until that merges, its commits show here too; this PR's own change is the last commit(s) on top of it.

What and why

With LOD Distance on, SavedLodSampler::grid puts saved chunks over every far tile of 16 blocks a column or finer. For each column it opened the region file and decoded the whole saved chunk, and each sampling thread kept only 128 decoded chunks. In a save with many thousands of chunks, the far view stalled for minutes after its first tiles.

  • SaveDir keeps which chunks each region file holds (for 10 s), so columns over unsaved ground no longer open region files.
  • Decoded saved chunks are shared by the sampling threads (1024 of them, for 30 s).
  • With Reduced far detail only: tiles coarser than 4 blocks a column (about 1 km out and beyond) keep the generator's terrain, which the saved chunks were made from. Edits that far away show once their tiles refine on approach. With Full (the default), saved chunks still show in every tile up to 16 blocks a column, as before.

The first two apply to everyone and change how soon a chunk saved during play shows in the far view (within 10 s / 30 s), not what is drawn.

Related to the open roadmap item "far terrain at 48 to 64 chunks" (#718).

Vanilla reference

Horizon-only: vanilla has no far terrain. Off by default (lodDistance 0). The picture changes only with Reduced far detail.

Measured

On a copy of an 11.7k-chunk save (render distance 6, a far view of 6291 tiles, a 2096-block-tall data pack world), tiles sampled went from 2362 to 3377 at 60 s, and from about 2600 to 5811 at 120 s, with the 4-block limit (as Reduced now has it). The whole view loaded in about 2 minutes instead of over 15. Not yet measured on a vanilla save, nor with Full's 16-block limit, where only the two caches apply.

Self-check

pr_ready (tools/pr_ready.py --quick --base upstream/main on DESKTOP-LT6RAH8, against upstream/main at 3c9bb38e8, 26 min 14 s)

Check Result
Scope ⚠️ 10 files, +523 −49; 572 lines of code: over 500, split it if it can ship in parts
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ❌ 399 run, FAILED (failures=1, skipped=2) (2 min 1 s)
rustfmt ✅ (14 s)
clippy ✅ (2 min 11 s)
tests: horizon-client, horizon-core, horizon-world ❌ 1107 passed, 1 failed (14 min 58 s)
doc tests ✅ 0 passed (6 min 44 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

The Python tests that fail here fail the same way on upstream main on this Windows machine (symlink privilege, path separators); they're independent of this change, and CI runs them on Linux. The horizon-client test save::tests::session_lock_is_exclusive fails on Windows on upstream main too (#3088 fixes the session lock test).

🤖 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/3391 **Author:** [@ThatCakeIsAPie](https://github.com/ThatCakeIsAPie) **Created:** 10/28/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `perf/far-saved-chunks` --- ### 📝 Commits (4) - [`598668e`](https://github.com/horizon-rust/horizon/commit/598668e4bc9a322e7776dd95337b48f5659ec3b1) Far terrain: stop decoding saved chunks for every distant column - [`ca1b200`](https://github.com/horizon-rust/horizon/commit/ca1b200c79c907974be55b26a08d8c560905acf5) Merge remote-tracking branch 'origin/main' into upd/3391 - [`f5811c7`](https://github.com/horizon-rust/horizon/commit/f5811c797acd3863cd22cd140d554e3994809c95) Merge main into the branch - [`42ad919`](https://github.com/horizon-rust/horizon/commit/42ad9192e30a4823cfbd8b4f1f460d241418eedf) Merge remote-tracking branch 'hr/main' into HEAD ### 📊 Changes **1 file changed** (+113 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/save.rs` (+113 -2) </details> ### 📄 Description > 🤖 Opened by ThatCakeIsAPie's AI agent (Claude), not by ThatCakeIsAPie themself. **Builds on #3390** (`perf/far-tiles-coarse`): until that merges, its commits show here too; this PR's own change is the last commit(s) on top of it. ## What and why With LOD Distance on, `SavedLodSampler::grid` puts saved chunks over every far tile of 16 blocks a column or finer. For each column it opened the region file and decoded the whole saved chunk, and each sampling thread kept only 128 decoded chunks. In a save with many thousands of chunks, the far view stalled for minutes after its first tiles. - `SaveDir` keeps which chunks each region file holds (for 10 s), so columns over unsaved ground no longer open region files. - Decoded saved chunks are shared by the sampling threads (1024 of them, for 30 s). - With **Reduced** far detail only: tiles coarser than 4 blocks a column (about 1 km out and beyond) keep the generator's terrain, which the saved chunks were made from. Edits that far away show once their tiles refine on approach. With **Full** (the default), saved chunks still show in every tile up to 16 blocks a column, as before. The first two apply to everyone and change how soon a chunk saved during play shows in the far view (within 10 s / 30 s), not what is drawn. Related to the open roadmap item "far terrain at 48 to 64 chunks" (#718). ## Vanilla reference Horizon-only: vanilla has no far terrain. Off by default (`lodDistance` 0). The picture changes only with Reduced far detail. ## Measured On a copy of an 11.7k-chunk save (render distance 6, a far view of 6291 tiles, a 2096-block-tall data pack world), tiles sampled went from 2362 to 3377 at 60 s, and from about 2600 to 5811 at 120 s, with the 4-block limit (as Reduced now has it). The whole view loaded in about 2 minutes instead of over 15. Not yet measured on a vanilla save, nor with Full's 16-block limit, where only the two caches apply. ## Self-check **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on DESKTOP-LT6RAH8, against upstream/main at 3c9bb38e8, 26 min 14 s) | Check | Result | | --- | --- | | Scope | ⚠️ 10 files, +523 −49; 572 lines of code: over 500, split it if it can ship in parts | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ❌ 399 run, FAILED (failures=1, skipped=2) (2 min 1 s) | | rustfmt | ✅ (14 s) | | clippy | ✅ (2 min 11 s) | | tests: horizon-client, horizon-core, horizon-world | ❌ 1107 passed, 1 failed (14 min 58 s) | | doc tests | ✅ 0 passed (6 min 44 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | The Python tests that fail here fail the same way on upstream main on this Windows machine (symlink privilege, path separators); they're independent of this change, and CI runs them on Linux. The horizon-client test `save::tests::session_lock_is_exclusive` fails on Windows on upstream main too (#3088 fixes the session lock test). 🤖 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 05:09:08 +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#4950
No description provided.