[PR #1206] [MERGED] Faster Perlin volumes and climate search, same results #3421

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

📋 Pull Request Information

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

Base: main ← Head: claude/upstream-perlin-climate


📝 Commits (1)

  • dfe795b Faster Perlin volumes and climate search, same results

📊 Changes

2 files changed (+84 additions, -39 deletions)

View changed files

📝 crates/horizon-core/src/noise/perlin.rs (+43 -15)
📝 crates/horizon-world/src/worldgen/climate/index.rs (+41 -24)

📄 Description

Requested by JR

What and why

Faster Perlin volumes and climate search, same results

PerlinNoise::add_volume worked out each Y coordinate's cell, offset and
fade once per X/Z column. Every column walks the same Y coordinates, so
they are now computed once per volume. The arithmetic is unchanged, so
the output is bit for bit the same.

ClimateIndex kept its tree as nodes with a Vec of child ids each. The
built tree is now renumbered breadth first into flat arrays, so a
branch's children are one contiguous run. The search visits the same
nodes in the same order, so ties resolve exactly as before.

terrain_bench (seed 12345, 8x8 chunks, 1 thread, medians of 3 runs):
terrain 14.5 -> 12.4 ms/chunk, biomes 1.20 -> 1.06 ms/chunk.
Checked against vanilla 26.3 in-process: 2304 chunks on seeds 12345, -1
and 987654321987 identical, and the biome-source and biome-generation
parity suites (2.1M lines) match.

Vanilla reference

ImprovedNoise.noise / PerlinNoise.getValue and Climate.RTree.search: same arithmetic and the same visit order. Checked against vanilla 26.3 in-process (2304 chunks on three seeds identical). Harnesses: test_noise_parity.py, test_terrain_parity.py, test_biome_source_parity.py, test_biome_generation_parity.py.

Self-check

pr_ready (tools/pr_ready.py --base upstream/main on Mac, against upstream/main at c1b5fe95d, 1 min 58 s)

Check Result
Scope ✅ 2 files, +84 −39
Cargo.lock ✅ unchanged
Public tree ✅ (1 s)
Python tests ➖ no Python change
rustfmt ✅ (6 s)
clippy ✅ (1 min 3 s)
tests: horizon-core, horizon-world ✅ 330 passed (43 s)
doc tests ✅ 0 passed (4 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (no vanilla data here): 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)

🤖 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/1206 **Author:** [@pirut](https://github.com/pirut) **Created:** 10/22/2026 **Status:** ✅ Merged **Merged:** 10/22/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `claude/upstream-perlin-climate` --- ### 📝 Commits (1) - [`dfe795b`](https://github.com/horizon-rust/horizon/commit/dfe795bc090809090993c44c2a032f108efbf3f4) Faster Perlin volumes and climate search, same results ### 📊 Changes **2 files changed** (+84 additions, -39 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-core/src/noise/perlin.rs` (+43 -15) 📝 `crates/horizon-world/src/worldgen/climate/index.rs` (+41 -24) </details> ### 📄 Description <!-- claude-projects-attribution: {"github_login":"pirut"} --> _Requested by **JR**_ ## What and why Faster Perlin volumes and climate search, same results PerlinNoise::add_volume worked out each Y coordinate's cell, offset and fade once per X/Z column. Every column walks the same Y coordinates, so they are now computed once per volume. The arithmetic is unchanged, so the output is bit for bit the same. ClimateIndex kept its tree as nodes with a Vec of child ids each. The built tree is now renumbered breadth first into flat arrays, so a branch's children are one contiguous run. The search visits the same nodes in the same order, so ties resolve exactly as before. terrain_bench (seed 12345, 8x8 chunks, 1 thread, medians of 3 runs): terrain 14.5 -> 12.4 ms/chunk, biomes 1.20 -> 1.06 ms/chunk. Checked against vanilla 26.3 in-process: 2304 chunks on seeds 12345, -1 and 987654321987 identical, and the biome-source and biome-generation parity suites (2.1M lines) match. ## Vanilla reference `ImprovedNoise.noise` / `PerlinNoise.getValue` and `Climate.RTree.search`: same arithmetic and the same visit order. Checked against vanilla 26.3 in-process (2304 chunks on three seeds identical). Harnesses: `test_noise_parity.py`, `test_terrain_parity.py`, `test_biome_source_parity.py`, `test_biome_generation_parity.py`. ## Self-check **pr_ready** (`tools/pr_ready.py --base upstream/main` on Mac, against upstream/main at c1b5fe95d, 1 min 58 s) | Check | Result | | --- | --- | | Scope | ✅ 2 files, +84 −39 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ (1 s) | | Python tests | ➖ no Python change | | rustfmt | ✅ (6 s) | | clippy | ✅ (1 min 3 s) | | tests: horizon-core, horizon-world | ✅ 330 passed (43 s) | | doc tests | ✅ 0 passed (4 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (no vanilla data here): 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) | 🤖 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 04:09:25 +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#3421
No description provided.