[PR #6499] [MERGED] Skip per-section fade work while nothing fades #6914

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6499
Author: @ludovic111
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: perf/fade-idle-skip


📝 Commits (1)

  • e296a7e Skip per-section fade work while nothing fades

📊 Changes

1 file changed (+55 additions, -12 deletions)

View changed files

📝 crates/horizon-client-render/src/gfx.rs (+55 -12)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

Why

#4810 (vanilla's chunkSectionFadeInTime) and #4159 (the far terrain dither fade) look up every visible section's upload time and fade state each frame, even when nothing has been uploaded or started fading for a while: a hash lookup per section per frame, and a block entity filter that reads it too.

What it does

  • The renderer remembers when the newest section was uploaded (newest_upload) and when the newest one began to fade over far terrain (newest_lod_fade), both reset with the sections.
  • While no section is younger than the fade-in time, every section's visibility is 1.0 without a lookup, and block entities are all drawn without the filter.
  • While no section fades over far terrain (none retiring or leaving, none started within lod::FADE), every fade code is 0 without calling SectionGpu::fade.
  • With the fade-in set to 0 (vanilla's default off), nothing of it runs.

Nothing changes on screen: the skipped values are the ones the lookups returned (1.0 and 0).

Measurements

Mac mini M4 Pro, 1920×1080 offscreen, --profile fast, same seed, spot and settings, alternating runs, median of the runs' median frames (horizon-ctl bench):

Scene before after
RD 32, far terrain 256 CPU 2.91 ms 2.88 ms
GPU 4.45 ms 4.39 ms
RD 32, no far terrain CPU 1.61 ms 1.54 ms
render phase 1.11 ms 1.03 ms

Small, as expected: it removes per-section work that scales with render distance. #6500 (the fix for #6005's double draw on Metal) is stacked on it.

Self-check

pr_ready (tools/pr_ready.py --quick on ludovics-mac-mini, against origin/main at dd289c890, 8 min 15 s)

Check Result
Scope ✅ 1 files, +55 −12
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 594 passed (3 min 38 s)
rustfmt ✅ (9 s)
clippy ✅ (2 min 30 s)
tests: horizon-client-render ✅ 975 passed (1 min 9 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 ➖ 132 affected, to run in CI (--quick): ambient_sound, armor_stand_frost, arrow, arrow_wind_charge, audio_attributes, auto_jump, block_entity_anim, block_entity_render, block_entity_tickers, block_particles, block_removal, block_tint and 120 more
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/6499 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `perf/fade-idle-skip` --- ### 📝 Commits (1) - [`e296a7e`](https://github.com/horizon-rust/horizon/commit/e296a7ee388407b3e8a2bab5de2a142ad96338e6) Skip per-section fade work while nothing fades ### 📊 Changes **1 file changed** (+55 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/gfx.rs` (+55 -12) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## Why #4810 (vanilla's `chunkSectionFadeInTime`) and #4159 (the far terrain dither fade) look up every visible section's upload time and fade state each frame, even when nothing has been uploaded or started fading for a while: a hash lookup per section per frame, and a block entity filter that reads it too. ## What it does - The renderer remembers when the newest section was uploaded (`newest_upload`) and when the newest one began to fade over far terrain (`newest_lod_fade`), both reset with the sections. - While no section is younger than the fade-in time, every section's visibility is 1.0 without a lookup, and block entities are all drawn without the filter. - While no section fades over far terrain (none retiring or leaving, none started within `lod::FADE`), every fade code is 0 without calling `SectionGpu::fade`. - With the fade-in set to 0 (vanilla's default off), nothing of it runs. Nothing changes on screen: the skipped values are the ones the lookups returned (1.0 and 0). ## Measurements Mac mini M4 Pro, 1920×1080 offscreen, `--profile fast`, same seed, spot and settings, alternating runs, median of the runs' median frames (`horizon-ctl bench`): | Scene | | before | after | |---|---|---|---| | RD 32, far terrain 256 | CPU | 2.91 ms | 2.88 ms | | | GPU | 4.45 ms | 4.39 ms | | RD 32, no far terrain | CPU | 1.61 ms | 1.54 ms | | | render phase | 1.11 ms | 1.03 ms | Small, as expected: it removes per-section work that scales with render distance. #6500 (the fix for #6005's double draw on Metal) is stacked on it. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on ludovics-mac-mini, against origin/main at dd289c890, 8 min 15 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +55 −12 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 594 passed (3 min 38 s) | | rustfmt | ✅ (9 s) | | clippy | ✅ (2 min 30 s) | | tests: horizon-client-render | ✅ 975 passed (1 min 9 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 | ➖ 132 affected, to run in CI (--quick): ambient_sound, armor_stand_frost, arrow, arrow_wind_charge, audio_attributes, auto_jump, block_entity_anim, block_entity_render, block_entity_tickers, block_particles, block_removal, block_tint and 120 more | | 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 06:29:09 +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#6914
No description provided.