[PR #946] [MERGED] Coordinate concurrent neighbour cache misses by chunk key #2930

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/946
Author: @rdbtCVS
Created: 10/18/2026
Status: ✅ Merged
Merged: 10/19/2026
Merged by: @ludovic111

Base: main ← Head: t3/dedup-neighbour-computation


📝 Commits (1)

  • 6a4bed4 Coordinate concurrent neighbour cache misses by chunk key

📊 Changes

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

View changed files

📝 crates/horizon-world/src/worldgen/generator.rs (+148 -0)
📝 crates/horizon-world/src/worldgen/generator_structures.rs (+12 -1)

📄 Description

Concurrent adjacent chunk generation can compute the same missing biome volume or structure starts more than once. Coordinate cache misses by exact chunk key and recheck the existing cache after acquiring the key lock. Cache hits retain their current path.

Weak lock entries retain no computed values; bounded cleanup preserves every active builder/waiter. Shared stronghold-ring work finishes before acquiring a key lock. Existing resolver calls, first-inserted structure-piece sharing, cache eviction thresholds and in-flight insertion after forget_starts remain unchanged.

Validation:

  • Eight complete byte-exact baseline/candidate terrain and decorated output comparisons: both benchmark sites, size 16, 1/6 workers.
  • Resource-enabled concurrent same-key sharing, cold rings, forced biome eviction and structure invalidation test; weak-lock cleanup/lifetime and existing first-insertion tests pass.
  • Fresh pinned client/server biome-generation parity: 396 fixtures, 834,080 matching lines per side. Structure-density parity: 183 fixtures, 1,360,095 matching lines per side.
  • python3 tools/pr_ready.py --base origin/main --quick passes public-tree checks, formatting, workspace clippy and 188 world tests. The quick check leaves 307 broader affected parity suites to CI; the scoped fresh suites and full differential corpus above do not claim universal parity.

Performance exploration is not an acceptance claim: exact-key size-16 three-pair screening was +2.54%/+2.16% terrain; size-32 five-pair medians were +7.08%/+0.33%. The requested stop ended further benchmarking, so no eight-pair confirmation, scaling or single-worker timing guard is claimed for this variant. Independent change from f422cbb7; no carver-cache changes included.


🔄 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/946 **Author:** [@rdbtCVS](https://github.com/rdbtCVS) **Created:** 10/18/2026 **Status:** ✅ Merged **Merged:** 10/19/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `t3/dedup-neighbour-computation` --- ### 📝 Commits (1) - [`6a4bed4`](https://github.com/horizon-rust/horizon/commit/6a4bed4744eeb1b1e905ca2bab29ca7e9a5c399a) Coordinate concurrent neighbour cache misses by chunk key ### 📊 Changes **2 files changed** (+160 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-world/src/worldgen/generator.rs` (+148 -0) 📝 `crates/horizon-world/src/worldgen/generator_structures.rs` (+12 -1) </details> ### 📄 Description Concurrent adjacent chunk generation can compute the same missing biome volume or structure starts more than once. Coordinate cache misses by exact chunk key and recheck the existing cache after acquiring the key lock. Cache hits retain their current path. Weak lock entries retain no computed values; bounded cleanup preserves every active builder/waiter. Shared stronghold-ring work finishes before acquiring a key lock. Existing resolver calls, first-inserted structure-piece sharing, cache eviction thresholds and in-flight insertion after `forget_starts` remain unchanged. Validation: - Eight complete byte-exact baseline/candidate terrain and decorated output comparisons: both benchmark sites, size 16, 1/6 workers. - Resource-enabled concurrent same-key sharing, cold rings, forced biome eviction and structure invalidation test; weak-lock cleanup/lifetime and existing first-insertion tests pass. - Fresh pinned client/server biome-generation parity: 396 fixtures, 834,080 matching lines per side. Structure-density parity: 183 fixtures, 1,360,095 matching lines per side. - `python3 tools/pr_ready.py --base origin/main --quick` passes public-tree checks, formatting, workspace clippy and 188 world tests. The quick check leaves 307 broader affected parity suites to CI; the scoped fresh suites and full differential corpus above do not claim universal parity. Performance exploration is not an acceptance claim: exact-key size-16 three-pair screening was +2.54%/+2.16% terrain; size-32 five-pair medians were +7.08%/+0.33%. The requested stop ended further benchmarking, so no eight-pair confirmation, scaling or single-worker timing guard is claimed for this variant. Independent change from f422cbb7; no carver-cache changes included. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 16:00:11 +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#2930
No description provided.