[PR #4048] [MERGED] Fix detail requests for retiring fine LOD leaves #5378

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4048
Author: @ult1mq
Created: 10/29/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @levzzz5154

Base: main ← Head: codex/lod-retirement


📝 Commits (1)

  • db38f50 Fix detail requests for retiring fine LOD leaves

📊 Changes

1 file changed (+83 additions, -0 deletions)

View changed files

📝 crates/horizon-client-render/src/lod.rs (+83 -0)

📄 Description

🤖 Opened by ult1mq's AI agent (Codex, GPT-6), not by ult1mq personally.

What and why

When full-detail chunks leave the near view, their GPU sections remain visible until the replacement LOD tiles are filled. A retiring level-0 tile can already be ready as an empty stand-in while also being covered and absent from active. Ordinary sampling skips the ready tile, and request_detail only considers active tiles. If its visited summary is missing or has been evicted, the replacement never receives the detail required by Plan::replaces, so the old full-detail sections can remain resident indefinitely.

This change adds those planned, still-unfilled retiring fine tiles to the existing detail-request candidates. It keeps the existing distance ordering, 32-column request limit, 250 ms request cadence, and replacement/cutout publication path. Existing full-detail geometry remains available until its replacement is ready.

Fixes #4039.

Regression coverage

  • A ready but empty fine stand-in is not allowed to replace the old full-detail column.
  • Its missing detail is requested even though the tile is inactive and covered.
  • Once detail is complete, the column becomes replaceable and stops requesting detail.
  • Saved summaries, complete detail, unplanned retirees, and non-retiring columns do not consume the request budget; a partially filled mask still requests its missing detail.

Evidence and its limits

The bug was investigated on Windows 11 with an i9-13900K and RTX 3090, at 2560×1440 with Vulkan. The reproduction loads render distance 64, returns to 16, and flies the same 256-block route in both directions with simulation distance 9 and full LOD distance 64.

GPU section residency during the reproduction

The original local session retained roughly 108,000 full-detail GPU sections after returning to render distance 16. A local build containing this fix and other streaming/allocation changes eventually settled around 11,000 sections. This observation motivates the reproduction but does not isolate this PR's performance contribution. The deterministic regression tests establish the missing-request state transition independently of those other changes.

The same combined build's frame-time measurements are supporting context, not an FPS claim for this PR. The initial flight phase used a 160 FPS game cap; a later read-only driver inspection also found a global VSync override on the 165 Hz display. The submitted material should be read in terms of section residency, frame-time distributions, and the explicit test protocol rather than uncapped throughput.

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

Horizon-only LOD replacement bookkeeping. This does not change near-world block state, meshing rules, simulation, saves, or protocol behavior. The regression tests exercise Plan::replaces and the detail-request candidates using synthetic state, without Minecraft assets.

Self-check

pr_ready (tools/pr_ready.py --quick on local Windows (host name redacted), against origin/main at bd665f28a, 2 min 47 s)

Check Result
Scope ✅ 1 files, +83 −0
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ❌ 475 run, FAILED (failures=1, skipped=11) (38 s)
rustfmt ✅ (6 s)
clippy ✅ (1 min 1 s)
tests: horizon-client-render ✅ 560 passed (48 s)
doc tests ✅ 0 passed (11 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 two focused retiring_ regression tests also passed in the optimized fast profile. The Python failure is WorkspaceManifestTests.test_a_feature_of_a_workspace_crate_counts_through_its_sources; it was independently reproduced on untouched base bd665f28a on Windows (40 parity-runner tests: 1 failure, 1 skip). No Python files are changed by this PR. Affected vanilla parity harnesses were not run locally and remain for CI.

The runtime graph above comes from the older nightly baa379d, not this updated branch. The combined build also used different compiler/profile settings and started with more LOD geometry ready after the same wall-time warmup. See the sanitized dataset, reproduction/plotting scripts and full limitations for details. No world, prepared assets, raw player state or private logs are included.

Reproduction

  1. Use a disposable copy of a world, with full LOD enabled beyond the normal render distance.
  2. Load a wide full-detail area, then reduce the normal render distance.
  3. Wait for near chunks and upload queues to settle. Observe full-detail GPU-section residency while the old area should transition to LOD.
  4. Continue flying a repeated route. The old full-detail sections should be released when their replacement tiles become ready, rather than waiting for requests that cannot be scheduled.

Allow edits by maintainers is enabled.

🤖 Generated with Codex.


🔄 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/4048 **Author:** [@ult1mq](https://github.com/ult1mq) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `codex/lod-retirement` --- ### 📝 Commits (1) - [`db38f50`](https://github.com/horizon-rust/horizon/commit/db38f50b12039289255f9673501c42a6da0c7892) Fix detail requests for retiring fine LOD leaves ### 📊 Changes **1 file changed** (+83 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/lod.rs` (+83 -0) </details> ### 📄 Description > 🤖 Opened by ult1mq's AI agent (Codex, GPT-6), not by ult1mq personally. ## What and why When full-detail chunks leave the near view, their GPU sections remain visible until the replacement LOD tiles are filled. A retiring level-0 tile can already be `ready` as an empty stand-in while also being covered and absent from `active`. Ordinary sampling skips the ready tile, and `request_detail` only considers active tiles. If its visited summary is missing or has been evicted, the replacement never receives the detail required by `Plan::replaces`, so the old full-detail sections can remain resident indefinitely. This change adds those planned, still-unfilled retiring fine tiles to the existing detail-request candidates. It keeps the existing distance ordering, 32-column request limit, 250 ms request cadence, and replacement/cutout publication path. Existing full-detail geometry remains available until its replacement is ready. Fixes #4039. ### Regression coverage - A ready but empty fine stand-in is not allowed to replace the old full-detail column. - Its missing detail is requested even though the tile is inactive and covered. - Once detail is complete, the column becomes replaceable and stops requesting detail. - Saved summaries, complete detail, unplanned retirees, and non-retiring columns do not consume the request budget; a partially filled mask still requests its missing detail. ### Evidence and its limits The bug was investigated on Windows 11 with an i9-13900K and RTX 3090, at 2560×1440 with Vulkan. The reproduction loads render distance 64, returns to 16, and flies the same 256-block route in both directions with simulation distance 9 and full LOD distance 64. ![GPU section residency during the reproduction](https://raw.githubusercontent.com/ult1mq/horizon/252001fe34c5a77536886617b2e8f136ab8aee6a/reports/2026-10-flight/lod-residency.png) The original local session retained roughly 108,000 full-detail GPU sections after returning to render distance 16. A local build containing this fix **and other streaming/allocation changes** eventually settled around 11,000 sections. This observation motivates the reproduction but does **not** isolate this PR's performance contribution. The deterministic regression tests establish the missing-request state transition independently of those other changes. The same combined build's frame-time measurements are supporting context, not an FPS claim for this PR. The initial flight phase used a 160 FPS game cap; a later read-only driver inspection also found a global VSync override on the 165 Hz display. The submitted material should be read in terms of section residency, frame-time distributions, and the explicit test protocol rather than uncapped throughput. ## Kind - [ ] parity: Horizon now does what vanilla 26.3 does - [x] bug: a crash or a breakage - [ ] perf: faster, or less memory - [ ] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [ ] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference Horizon-only LOD replacement bookkeeping. This does not change near-world block state, meshing rules, simulation, saves, or protocol behavior. The regression tests exercise `Plan::replaces` and the detail-request candidates using synthetic state, without Minecraft assets. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on local Windows (host name redacted), against origin/main at bd665f28a, 2 min 47 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +83 −0 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ❌ 475 run, FAILED (failures=1, skipped=11) (38 s) | | rustfmt | ✅ (6 s) | | clippy | ✅ (1 min 1 s) | | tests: horizon-client-render | ✅ 560 passed (48 s) | | doc tests | ✅ 0 passed (11 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 two focused `retiring_` regression tests also passed in the optimized `fast` profile. The Python failure is `WorkspaceManifestTests.test_a_feature_of_a_workspace_crate_counts_through_its_sources`; it was independently reproduced on untouched base `bd665f28a` on Windows (40 parity-runner tests: 1 failure, 1 skip). No Python files are changed by this PR. Affected vanilla parity harnesses were not run locally and remain for CI. The runtime graph above comes from the older nightly `baa379d`, not this updated branch. The combined build also used different compiler/profile settings and started with more LOD geometry ready after the same wall-time warmup. See the [sanitized dataset, reproduction/plotting scripts and full limitations](https://github.com/ult1mq/horizon/tree/252001fe34c5a77536886617b2e8f136ab8aee6a/reports/2026-10-flight) for details. No world, prepared assets, raw player state or private logs are included. ## Reproduction 1. Use a disposable copy of a world, with full LOD enabled beyond the normal render distance. 2. Load a wide full-detail area, then reduce the normal render distance. 3. Wait for near chunks and upload queues to settle. Observe full-detail GPU-section residency while the old area should transition to LOD. 4. Continue flying a repeated route. The old full-detail sections should be released when their replacement tiles become ready, rather than waiting for requests that cannot be scheduled. Allow edits by maintainers is enabled. 🤖 Generated with [Codex](https://openai.com/codex/). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:12:10 +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#5378
No description provided.