[PR #3368] [MERGED] Far tiles: resolve each biome quart once per tile, and a far-tile bench #4935

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

📋 Pull Request Information

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

Base: main ← Head: perf/far-tiles-biome-memo


📝 Commits (3)

  • bc3a724 lod_grid_bench: far terrain sampling cost per tile level
  • 91ed783 Far tiles: resolve each biome quart once per tile
  • dffd397 Merge main into perf/far-tiles-biome-memo

📊 Changes

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

View changed files

➕ crates/horizon-world/examples/lod_grid_bench.rs (+88 -0)
📝 crates/horizon-world/src/worldgen/generator.rs (+49 -10)

📄 Description

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

What and why

Two commits:

  1. lod_grid_bench (horizon-world example): times GeneratorWorker::lod_grid the way the client's far terrain calls it (16 x 16 columns a tile) at each tile level. It prints two checksums: everything the tiles hold, and the surface and water heights alone (the terrain's shape). --dump writes each column's height, block and biome.
  2. Biome memo per tile: lod_grid paints eight depths of every far column through the surface rule, and each depth asked the biome resolver again: a full climate sample and parameter search per query, though neighbouring columns and depths share quarts. The tile now keeps the answers per quart (Biomes::Memo), for painting and for the columns' surface biome.

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

Vanilla reference

Horizon-only: vanilla has no far terrain, and it is off by default (lodDistance 0).

Measured

Measured against upstream main at 43d8bd01c; the branch is now rebased onto e1b2b0b2f, and upstream hasn't changed the code it touches in between.

lod_grid_bench, vanilla seed 1234, 25 tiles a level, 3 interleaved rounds on a quiet machine (best of 3):

ms a tile upstream main this branch
level 0 (1 block a column) 6.6 4.1
level 2 (4 blocks) 17.9 16.7
level 3 (8 blocks) 17.6 16.5
level 4 (16 blocks) 18.7 17.1
level 6 (64 blocks) 17.8 16.3

Output: surface heights, surface blocks and biomes are identical at every level (--dump, all 6400 columns a level). The full checksum is identical at levels 0 to 4. At level 6 some painted blocks below the surface differ: the tile's cached sampler context answers a repeated quart from what it sampled before, so the order of queries mattered there.

In the tall data pack world this work comes from (2096 blocks, expensive climate), this memo and the first approximation of the next PR together took tiles from 152-185 ms to 13-65 ms (levels 0-8), because biome queries were most of a tile's time there.

Self-check

pr_ready (tools/pr_ready.py --quick --base upstream/main on DESKTOP-LT6RAH8, against upstream/main at e1b2b0b2f, 7 min 11 s)

Check Result
Scope ✅ 2 files, +137 −10
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ❌ 401 run, FAILED (failures=1, errors=1, skipped=1) (3 min 7 s)
rustfmt ✅ (16 s)
clippy ✅ (2 min 29 s)
tests: horizon-world ✅ 256 passed (1 min 8 s)
doc tests ✅ 0 passed (2 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.

Label: none.

🤖 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/3368 **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-tiles-biome-memo` --- ### 📝 Commits (3) - [`bc3a724`](https://github.com/horizon-rust/horizon/commit/bc3a724c011ba987a06eb0badff809336f68d372) lod_grid_bench: far terrain sampling cost per tile level - [`91ed783`](https://github.com/horizon-rust/horizon/commit/91ed783e8dc57b89c1dd8a265ab40506281236ac) Far tiles: resolve each biome quart once per tile - [`dffd397`](https://github.com/horizon-rust/horizon/commit/dffd3973bc467342f6c56b7316604c4988be6926) Merge main into perf/far-tiles-biome-memo ### 📊 Changes **2 files changed** (+137 additions, -10 deletions) <details> <summary>View changed files</summary> ➕ `crates/horizon-world/examples/lod_grid_bench.rs` (+88 -0) 📝 `crates/horizon-world/src/worldgen/generator.rs` (+49 -10) </details> ### 📄 Description > 🤖 Opened by ThatCakeIsAPie's AI agent (Claude), not by ThatCakeIsAPie themself. ## What and why Two commits: 1. **`lod_grid_bench`** (horizon-world example): times `GeneratorWorker::lod_grid` the way the client's far terrain calls it (16 x 16 columns a tile) at each tile level. It prints two checksums: everything the tiles hold, and the surface and water heights alone (the terrain's shape). `--dump` writes each column's height, block and biome. 2. **Biome memo per tile**: `lod_grid` paints eight depths of every far column through the surface rule, and each depth asked the biome resolver again: a full climate sample and parameter search per query, though neighbouring columns and depths share quarts. The tile now keeps the answers per quart (`Biomes::Memo`), for painting and for the columns' surface biome. Related to the open roadmap item "far terrain at 48 to 64 chunks" (#718). ## Vanilla reference Horizon-only: vanilla has no far terrain, and it is off by default (`lodDistance` 0). ## Measured Measured against upstream main at 43d8bd01c; the branch is now rebased onto e1b2b0b2f, and upstream hasn't changed the code it touches in between. `lod_grid_bench`, vanilla seed 1234, 25 tiles a level, 3 interleaved rounds on a quiet machine (best of 3): | ms a tile | upstream main | this branch | |---|---|---| | level 0 (1 block a column) | 6.6 | 4.1 | | level 2 (4 blocks) | 17.9 | 16.7 | | level 3 (8 blocks) | 17.6 | 16.5 | | level 4 (16 blocks) | 18.7 | 17.1 | | level 6 (64 blocks) | 17.8 | 16.3 | Output: surface heights, surface blocks and biomes are identical at every level (`--dump`, all 6400 columns a level). The full checksum is identical at levels 0 to 4. At level 6 some painted blocks below the surface differ: the tile's cached sampler context answers a repeated quart from what it sampled before, so the order of queries mattered there. In the tall data pack world this work comes from (2096 blocks, expensive climate), this memo and the first approximation of the next PR together took tiles from 152-185 ms to 13-65 ms (levels 0-8), because biome queries were most of a tile's time there. ## Self-check **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on DESKTOP-LT6RAH8, against upstream/main at e1b2b0b2f, 7 min 11 s) | Check | Result | | --- | --- | | Scope | ✅ 2 files, +137 −10 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ❌ 401 run, FAILED (failures=1, errors=1, skipped=1) (3 min 7 s) | | rustfmt | ✅ (16 s) | | clippy | ✅ (2 min 29 s) | | tests: horizon-world | ✅ 256 passed (1 min 8 s) | | doc tests | ✅ 0 passed (2 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. Label: none. 🤖 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:02 +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#4935
No description provided.