[PR #4389] [MERGED] F3 shows the Density line of the noise settings' debug functions #5598

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4389
Author: @xFedeT
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @ludovic111

Base: main ← Head: feat/f3-density-line


📝 Commits (10+)

  • 8d772a9 F3 shows the Density line of the noise settings' debug functions
  • ce2e70d Merge origin/main into feat/f3-density-line
  • b387b91 F3 Density line: skip it while a long query holds the worker
  • 7749d48 Merge origin/main into feat/f3-density-line
  • 27bd4f8 Merge remote-tracking branch 'origin/main' into feat/f3-density-line
  • 6c8584a F3 Density line: sampled when the feet block changes, without the query worker
  • 50b64cd F3 Density line: nothing drawn or kept without a generator
  • b2c52b5 F3 Density line: the cache is a type with a test
  • b103e58 F3 Density line: no in-frame fallback
  • 73274bb Merge remote-tracking branch 'origin/main' into a3-pr-4389

📊 Changes

9 files changed (+258 additions, -1 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+6 -0)
📝 crates/horizon-client/src/game/debug_keys.rs (+104 -0)
📝 crates/horizon-client/src/game/integrated.rs (+17 -0)
📝 crates/horizon-client/src/mod_content_tests.rs (+38 -0)
📝 crates/horizon-client/src/vanillagen.rs (+6 -0)
📝 crates/horizon-world/src/worldgen/generator.rs (+55 -0)
📝 crates/horizon-world/src/worldgen/material_condition/library.rs (+8 -0)
📝 tools/lan_e2e.py (+23 -0)
📝 tools/port_map/levelgen-1.tsv (+1 -1)

📄 Description

🤖 Opened by xFedeT's AI agent (Claude Code, Claude Sonnet 5.5), not by xFedeT personally.

Refs #3517

What and why

Vanilla's F3 chunk generation entry (DebugEntryChunkGeneration) asks the level's generator for its debug lines. NoiseBasedChunkGenerator.addDebugScreenInfo adds one: Density followed by the label and value of each of the noise settings' debug_functions, three decimals, at the player's feet. In the overworld that is N (final density), T, V, C, E, D, W, PV, PS; in the Nether N, T, V. Horizon's F3 had no such line.

Now the generator keeps the debug_functions as compiled samplers (a registered density by name, or an inline one) and OverworldGenerator::debug_density_line samples them at a block position with the same cache context vanilla uses (SamplerContext.enableCaches). It reads the pipeline's samplers only, so F3 does not take the shared query worker that /locate biome and /place jigsaw hold: those queries never wait for a frame, and the line never drops out while one runs.

F3 shows the line, as vanilla does, only where the game runs the level's generator: in single player (the window's server thread publishes the generator of each dimension it ran; the window reads it) and not for a LAN guest or a remote server. Like DebugEntryChunkGeneration.display (lastPos and result), the line is sampled again only when the feet block or the dimension changes (DensityCache); standing still costs nothing, walking one sample per block. With no generator (a remote server, a LAN world joined, the server thread not there yet) nothing is drawn and the last line is dropped; opening another world drops it too.

Proof, from the real game

python3 tools/lan_e2e.py --server-thread --check f3_density: the host and a LAN guest each teleport to the same spot and open F3. These are the games' own screenshots:

Before (main), host After (this PR), host After, LAN guest
before after guest

After: Density N: -0.088 T: 0.070 V: 0.064 C: -0.035 E: 0.257 D: -0.053 W: 0.418 PV: 0.255 PS: 56.000 under the position block. The LAN guest, which has no world generator, shows none (the picture is a close-up of blocks: the guest landed against terrain). The check only asserts that F3 opens on both; the line is read off the screenshots. The content-root test debug_density_line_lists_the_noise_settings_functions pins the labels, their order and the three decimals; the_density_line_is_sampled_when_the_block_or_the_dimension_changes pins the caching and the clearing without a generator.

pr_ready --quick: fmt, clippy, 1656 tests, 495 python tests and the 8 content-root tests pass; parity harnesses left to CI. Row NoiseBasedChunkGenerator.addDebugScreenInfo is ported in this PR.

🤖 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/4389 **Author:** [@xFedeT](https://github.com/xFedeT) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/f3-density-line` --- ### 📝 Commits (10+) - [`8d772a9`](https://github.com/horizon-rust/horizon/commit/8d772a91d0ff2e581e6ff1ff74eed12e342e881b) F3 shows the Density line of the noise settings' debug functions - [`ce2e70d`](https://github.com/horizon-rust/horizon/commit/ce2e70d9161268c2f82a5ac882d6f4e0a3bfc8d2) Merge origin/main into feat/f3-density-line - [`b387b91`](https://github.com/horizon-rust/horizon/commit/b387b911e4e0a3fd84a8a3e732284ba4301353eb) F3 Density line: skip it while a long query holds the worker - [`7749d48`](https://github.com/horizon-rust/horizon/commit/7749d48fb73dbe0b66b7cbd92e425508552a9150) Merge origin/main into feat/f3-density-line - [`27bd4f8`](https://github.com/horizon-rust/horizon/commit/27bd4f8313165acc161297ba04ee026c980207af) Merge remote-tracking branch 'origin/main' into feat/f3-density-line - [`6c8584a`](https://github.com/horizon-rust/horizon/commit/6c8584a70dfa5c681806f182de0ea1dbddc856dd) F3 Density line: sampled when the feet block changes, without the query worker - [`50b64cd`](https://github.com/horizon-rust/horizon/commit/50b64cd00297e310902c1a1c3cc2af5cbf92109e) F3 Density line: nothing drawn or kept without a generator - [`b2c52b5`](https://github.com/horizon-rust/horizon/commit/b2c52b50369744265b797d5098a915b7a1eca168) F3 Density line: the cache is a type with a test - [`b103e58`](https://github.com/horizon-rust/horizon/commit/b103e5821bd9d4848573431f749048c5f92f6798) F3 Density line: no in-frame fallback - [`73274bb`](https://github.com/horizon-rust/horizon/commit/73274bb060f71a8785e390b2d9168a5740461eae) Merge remote-tracking branch 'origin/main' into a3-pr-4389 ### 📊 Changes **9 files changed** (+258 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+6 -0) 📝 `crates/horizon-client/src/game/debug_keys.rs` (+104 -0) 📝 `crates/horizon-client/src/game/integrated.rs` (+17 -0) 📝 `crates/horizon-client/src/mod_content_tests.rs` (+38 -0) 📝 `crates/horizon-client/src/vanillagen.rs` (+6 -0) 📝 `crates/horizon-world/src/worldgen/generator.rs` (+55 -0) 📝 `crates/horizon-world/src/worldgen/material_condition/library.rs` (+8 -0) 📝 `tools/lan_e2e.py` (+23 -0) 📝 `tools/port_map/levelgen-1.tsv` (+1 -1) </details> ### 📄 Description > 🤖 Opened by xFedeT's AI agent (Claude Code, Claude Sonnet 5.5), not by xFedeT personally. Refs #3517 ## What and why Vanilla's F3 chunk generation entry (`DebugEntryChunkGeneration`) asks the level's generator for its debug lines. `NoiseBasedChunkGenerator.addDebugScreenInfo` adds one: `Density ` followed by the label and value of each of the noise settings' `debug_functions`, three decimals, at the player's feet. In the overworld that is `N` (final density), `T`, `V`, `C`, `E`, `D`, `W`, `PV`, `PS`; in the Nether `N`, `T`, `V`. Horizon's F3 had no such line. Now the generator keeps the `debug_functions` as compiled samplers (a registered density by name, or an inline one) and `OverworldGenerator::debug_density_line` samples them at a block position with the same cache context vanilla uses (`SamplerContext.enableCaches`). It reads the pipeline's samplers only, so F3 does not take the shared query worker that `/locate biome` and `/place jigsaw` hold: those queries never wait for a frame, and the line never drops out while one runs. F3 shows the line, as vanilla does, only where the game runs the level's generator: in single player (the window's server thread publishes the generator of each dimension it ran; the window reads it) and not for a LAN guest or a remote server. Like `DebugEntryChunkGeneration.display` (`lastPos` and `result`), the line is sampled again only when the feet block or the dimension changes (`DensityCache`); standing still costs nothing, walking one sample per block. With no generator (a remote server, a LAN world joined, the server thread not there yet) nothing is drawn and the last line is dropped; opening another world drops it too. ## Proof, from the real game `python3 tools/lan_e2e.py --server-thread --check f3_density`: the host and a LAN guest each teleport to the same spot and open F3. These are the games' own screenshots: | Before (main), host | After (this PR), host | After, LAN guest | |---|---|---| | ![before](https://raw.githubusercontent.com/xFedeT/horizon/pr-screenshots/f3-density/before-host.png) | ![after](https://raw.githubusercontent.com/xFedeT/horizon/pr-screenshots/f3-density/after-host.png) | ![guest](https://raw.githubusercontent.com/xFedeT/horizon/pr-screenshots/f3-density/after-lan-guest.png) | After: `Density N: -0.088 T: 0.070 V: 0.064 C: -0.035 E: 0.257 D: -0.053 W: 0.418 PV: 0.255 PS: 56.000` under the position block. The LAN guest, which has no world generator, shows none (the picture is a close-up of blocks: the guest landed against terrain). The check only asserts that F3 opens on both; the line is read off the screenshots. The content-root test `debug_density_line_lists_the_noise_settings_functions` pins the labels, their order and the three decimals; `the_density_line_is_sampled_when_the_block_or_the_dimension_changes` pins the caching and the clearing without a generator. `pr_ready --quick`: fmt, clippy, 1656 tests, 495 python tests and the 8 content-root tests pass; parity harnesses left to CI. Row `NoiseBasedChunkGenerator.addDebugScreenInfo` is ported in this PR. 🤖 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:13:40 +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#5598
No description provided.