[PR #5262] [MERGED] F3 debug entries: draw the lines and renderers Horizon never had #6174

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/5262
Author: @some-du6e
Created: 10/31/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @ludovic111

Base: main ← Head: feat/debug-entries-content


📝 Commits (3)

  • daed0b5 F3 debug entries: draw the lines and renderers Horizon never had
  • 07a7721 Merge main into #5262 (main builds again after #5251)
  • cc008d9 Merge main into #5262; the F3 Density line moves into debug_entry_lines

📊 Changes

16 files changed (+1417 additions, -84 deletions)

View changed files

📝 crates/horizon-client-render/src/audio.rs (+7 -0)
📝 crates/horizon-client/src/debug_chart.rs (+1 -1)
📝 crates/horizon-client/src/debug_entries.rs (+77 -1)
📝 crates/horizon-client/src/debug_overlay.rs (+333 -4)
📝 crates/horizon-client/src/game.rs (+27 -0)
📝 crates/horizon-client/src/game/boats.rs (+7 -1)
📝 crates/horizon-client/src/game/creatures.rs (+2 -0)
📝 crates/horizon-client/src/game/debug_keys.rs (+11 -74)
➕ crates/horizon-client/src/game/debug_lines.rs (+574 -0)
📝 crates/horizon-client/src/game/debug_options.rs (+30 -2)
➕ crates/horizon-client/src/game/debug_renderers.rs (+292 -0)
📝 crates/horizon-client/src/game/integrated.rs (+36 -1)
📝 crates/horizon-client/src/game/levels.rs (+1 -0)
📝 crates/horizon-client/src/game/natural_spawning.rs (+4 -0)
📝 crates/horizon-client/src/game/remote.rs (+10 -0)
📝 crates/horizon-client/src/mobs/spawn_selection.rs (+5 -0)

📄 Description

Follows https://github.com/horizon-rust/horizon/pull/5222 (the F3+F6 debug options screen, #5219) and is stacked on it. Until #5222 merges, this PR also contains its commit (e47213a98); only the top commit (daed0b5e2) is new here.

#5222 lets players turn each of vanilla's 46 debug entries off, on in the overlay or always on. About 30 of those entries still did nothing, because Horizon had never drawn their lines or renderers. Dragging the list's scrollbar didn't work either, and an old debug-profile.json loaded without vanilla's datafixes. This PR fills those gaps.

Overlay text (game/debug_lines.rs, formatting in debug_overlay.rs). Each DebugEntry* class is ported with vanilla's line text and its priority/line/group placement. The entries now run in DebugScreenEntryList's order (sorted by identifier), so groups and the column split land where vanilla puts them. Legacy § codes are drawn, which gives the underlined "Targeted Block" and the green true / red false properties.

Entry Source
looking_at_block_state / _tags, looking_at_fluid_state / _tags 20-block pick from the camera; fluids as minecraft:water / flowing_water with falling / level; block and fluid tags (sorted, since vanilla walks a hash set)
looking_at_entity / _tags nearest entity under the crosshair (mobs, boats, carts, armor stands, frames, paintings, the dragon, LAN guests); entity type tags
biome, light_levels, day_count, player_speed, particle_render_stats, post_effects client level, getKnownSpeed, the particle engine, the requested post effects
heightmap CH from the client chunk; SH from the server chunk in single player, ?? on other servers (as vanilla)
local_difficulty, entity_spawn_counts the integrated server: it computes them after the player's level ticks, while the window has them enabled. On other servers they don't show (as vanilla)
chunk_source_stats Chunks[C] (storage size from the server's view distance, loaded chunks, entities), plus Chunks[S] from the integrated server
chunk_render_stats, entity_render_stats sections drawn of the view area, mesh queue; mobs drawn of all entities, the server's simulation distance (now kept from login and SetSimulationDistance)
sound_mood, sound_cache the sound engine's channels (247 + 8), the ambience mood, the decoded sound cache
gpu_utilization last timed frame's GPU time over its CPU time
memory see below

Where Horizon has no equivalent:

  • memory: Horizon has no JVM heap. On Linux it reads the process from /proc: anonymous RSS as "used", all RSS as "allocated", physical memory as "max", and the allocation rate twice a second. Other platforms show no memory lines yet.
  • detailed_memory (JVM memory pools) and chunk_generation_stats (the noise router's debug functions and the biome builder's debug strings, a worldgen port of its own) draw nothing.
  • Approximations: aB: (free section buffers) is always 00 because Horizon has no buffer pool. The E: counts of the chunk source lines come from the entities Horizon keeps, not from vanilla's entity section managers. entity_render_stats counts drawn mobs only.

Renderers (game/debug_renderers.rs). Ported:

  • visualize_water_levels: fill to each water block's height, with its amount
  • visualize_heightmap: client heightmaps of the 5×5 chunks, vanilla's colours
  • visualize_collision_boxes: white block collision boxes within 6 of the player
  • visualize_block_light_levels and visualize_sky_light_levels: per-block numbers in vanilla's lerped colours
  • visualize_solid_faces: translucent red sturdy faces

These stay no-ops for want of the data:

  • chunk_section_paths, chunk_section_octree, chunk_section_visibility: Horizon culls on the GPU, with no section occlusion graph or octree
  • visualize_chunks_on_server: the server's chunk statuses
  • visualize_sky_light_sections: the light engine's section data (the sky section text LightDebugRenderer draws is left out for the same reason)
  • visualize_entity_supporting_blocks: mainSupportingBlockPos isn't exposed for entities

Scrollbar: a press on the debug options list's scrollbar holds it and dragging follows ui::Scroll::press/drag/release, as on the statistics screen.

Datafixes: debug-profile.json is upgraded by its DataVersion (4649 when missing), as DataFixers registers them:

  • 4650 DebugProfileOverlayReferenceFix: inF3 → inOverlay
  • 4763 DebugProfileLookingAtSplitFix: looking_at_block / looking_at_fluid → _state, and a key that is already there wins
  • 5001 DebugProfileRenameEntryFix: post_effect → post_effects

Checked in the game (server thread, Xvfb). I wrote an old debug-profile.json without DataVersion and with looking_at_block and post_effect: the targeted block and post lines showed, and the file saved back with the new keys and DataVersion 5023. With a pig and a lit furnace in view, the targeted entity, block, tags, server heightmaps, spawn counts and local difficulty all drew. Dragging the scrollbar moved the list to the renderers section, and the water, heightmap, light and solid face renderers drew round the player. Unit tests cover the line formats and the datafixes.

Something I noticed but didn't change: HudBatch::fill takes ABGR, and test_instance_marker_geometry hands it the ARGB ERROR_MARKER_FILL. If that's right, test error markers draw blue rather than red. The renderers here convert with abgr().

pr_ready

pr_ready (tools/pr_ready.py --quick on swiss, against origin/main at 19021623b, 2 min 50 s; the scope counts #5222's commit too: this commit alone is 16 files, +1389 −57)

Check Result
Scope ⚠️ 22 files, +2402 −88; 2490 lines of code: over 500, split it if it can ship in parts
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 487 passed (52 s)
rustfmt ✅ (10 s)
clippy ✅ (35 s)
tests: horizon-client, horizon-client-render ✅ 2026 passed (1 min 9 s)
doc tests ✅ 0 passed (4 s)
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses

Note

Filed by Opus 5.5 using 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/5262 **Author:** [@some-du6e](https://github.com/some-du6e) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/debug-entries-content` --- ### 📝 Commits (3) - [`daed0b5`](https://github.com/horizon-rust/horizon/commit/daed0b5e2ddcb4e68316e44ee5ad52946a679d1a) F3 debug entries: draw the lines and renderers Horizon never had - [`07a7721`](https://github.com/horizon-rust/horizon/commit/07a7721fd6124d5bb97c36d2f92a31b755cf4df0) Merge main into #5262 (main builds again after #5251) - [`cc008d9`](https://github.com/horizon-rust/horizon/commit/cc008d9526ce8f537843f0ffeb009d7035570fa3) Merge main into #5262; the F3 Density line moves into debug_entry_lines ### 📊 Changes **16 files changed** (+1417 additions, -84 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/audio.rs` (+7 -0) 📝 `crates/horizon-client/src/debug_chart.rs` (+1 -1) 📝 `crates/horizon-client/src/debug_entries.rs` (+77 -1) 📝 `crates/horizon-client/src/debug_overlay.rs` (+333 -4) 📝 `crates/horizon-client/src/game.rs` (+27 -0) 📝 `crates/horizon-client/src/game/boats.rs` (+7 -1) 📝 `crates/horizon-client/src/game/creatures.rs` (+2 -0) 📝 `crates/horizon-client/src/game/debug_keys.rs` (+11 -74) ➕ `crates/horizon-client/src/game/debug_lines.rs` (+574 -0) 📝 `crates/horizon-client/src/game/debug_options.rs` (+30 -2) ➕ `crates/horizon-client/src/game/debug_renderers.rs` (+292 -0) 📝 `crates/horizon-client/src/game/integrated.rs` (+36 -1) 📝 `crates/horizon-client/src/game/levels.rs` (+1 -0) 📝 `crates/horizon-client/src/game/natural_spawning.rs` (+4 -0) 📝 `crates/horizon-client/src/game/remote.rs` (+10 -0) 📝 `crates/horizon-client/src/mobs/spawn_selection.rs` (+5 -0) </details> ### 📄 Description Follows https://github.com/horizon-rust/horizon/pull/5222 (the F3+F6 debug options screen, #5219) and is stacked on it. Until #5222 merges, this PR also contains its commit (e47213a98); only the top commit (daed0b5e2) is new here. #5222 lets players turn each of vanilla's 46 debug entries off, on in the overlay or always on. About 30 of those entries still did nothing, because Horizon had never drawn their lines or renderers. Dragging the list's scrollbar didn't work either, and an old `debug-profile.json` loaded without vanilla's datafixes. This PR fills those gaps. **Overlay text** (`game/debug_lines.rs`, formatting in `debug_overlay.rs`). Each `DebugEntry*` class is ported with vanilla's line text and its priority/line/group placement. The entries now run in `DebugScreenEntryList`'s order (sorted by identifier), so groups and the column split land where vanilla puts them. Legacy `§` codes are drawn, which gives the underlined "Targeted Block" and the green `true` / red `false` properties. | Entry | Source | | --- | --- | | `looking_at_block_state` / `_tags`, `looking_at_fluid_state` / `_tags` | 20-block pick from the camera; fluids as `minecraft:water` / `flowing_water` with `falling` / `level`; block and fluid tags (sorted, since vanilla walks a hash set) | | `looking_at_entity` / `_tags` | nearest entity under the crosshair (mobs, boats, carts, armor stands, frames, paintings, the dragon, LAN guests); entity type tags | | `biome`, `light_levels`, `day_count`, `player_speed`, `particle_render_stats`, `post_effects` | client level, `getKnownSpeed`, the particle engine, the requested post effects | | `heightmap` | `CH` from the client chunk; `SH` from the server chunk in single player, `??` on other servers (as vanilla) | | `local_difficulty`, `entity_spawn_counts` | the integrated server: it computes them after the player's level ticks, while the window has them enabled. On other servers they don't show (as vanilla) | | `chunk_source_stats` | `Chunks[C]` (storage size from the server's view distance, loaded chunks, entities), plus `Chunks[S]` from the integrated server | | `chunk_render_stats`, `entity_render_stats` | sections drawn of the view area, mesh queue; mobs drawn of all entities, the server's simulation distance (now kept from login and `SetSimulationDistance`) | | `sound_mood`, `sound_cache` | the sound engine's channels (247 + 8), the ambience mood, the decoded sound cache | | `gpu_utilization` | last timed frame's GPU time over its CPU time | | `memory` | see below | Where Horizon has no equivalent: - `memory`: Horizon has no JVM heap. On Linux it reads the process from `/proc`: anonymous RSS as "used", all RSS as "allocated", physical memory as "max", and the allocation rate twice a second. Other platforms show no memory lines yet. - `detailed_memory` (JVM memory pools) and `chunk_generation_stats` (the noise router's debug functions and the biome builder's debug strings, a worldgen port of its own) draw nothing. - Approximations: `aB:` (free section buffers) is always `00` because Horizon has no buffer pool. The `E:` counts of the chunk source lines come from the entities Horizon keeps, not from vanilla's entity section managers. `entity_render_stats` counts drawn mobs only. **Renderers** (`game/debug_renderers.rs`). Ported: - `visualize_water_levels`: fill to each water block's height, with its amount - `visualize_heightmap`: client heightmaps of the 5×5 chunks, vanilla's colours - `visualize_collision_boxes`: white block collision boxes within 6 of the player - `visualize_block_light_levels` and `visualize_sky_light_levels`: per-block numbers in vanilla's lerped colours - `visualize_solid_faces`: translucent red sturdy faces These stay no-ops for want of the data: - `chunk_section_paths`, `chunk_section_octree`, `chunk_section_visibility`: Horizon culls on the GPU, with no section occlusion graph or octree - `visualize_chunks_on_server`: the server's chunk statuses - `visualize_sky_light_sections`: the light engine's section data (the sky section text `LightDebugRenderer` draws is left out for the same reason) - `visualize_entity_supporting_blocks`: `mainSupportingBlockPos` isn't exposed for entities **Scrollbar**: a press on the debug options list's scrollbar holds it and dragging follows `ui::Scroll::press/drag/release`, as on the statistics screen. **Datafixes**: `debug-profile.json` is upgraded by its `DataVersion` (4649 when missing), as `DataFixers` registers them: - 4650 `DebugProfileOverlayReferenceFix`: `inF3` → `inOverlay` - 4763 `DebugProfileLookingAtSplitFix`: `looking_at_block` / `looking_at_fluid` → `_state`, and a key that is already there wins - 5001 `DebugProfileRenameEntryFix`: `post_effect` → `post_effects` Checked in the game (server thread, Xvfb). I wrote an old `debug-profile.json` without `DataVersion` and with `looking_at_block` and `post_effect`: the targeted block and post lines showed, and the file saved back with the new keys and `DataVersion` 5023. With a pig and a lit furnace in view, the targeted entity, block, tags, server heightmaps, spawn counts and local difficulty all drew. Dragging the scrollbar moved the list to the renderers section, and the water, heightmap, light and solid face renderers drew round the player. Unit tests cover the line formats and the datafixes. Something I noticed but didn't change: `HudBatch::fill` takes ABGR, and `test_instance_marker_geometry` hands it the ARGB `ERROR_MARKER_FILL`. If that's right, test error markers draw blue rather than red. The renderers here convert with `abgr()`. <details><summary>pr_ready</summary> **pr_ready** (`tools/pr_ready.py --quick` on swiss, against origin/main at 19021623b, 2 min 50 s; the scope counts #5222's commit too: this commit alone is 16 files, +1389 −57) | Check | Result | | --- | --- | | Scope | ⚠️ 22 files, +2402 −88; 2490 lines of code: over 500, split it if it can ship in parts | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 487 passed (52 s) | | rustfmt | ✅ (10 s) | | clippy | ✅ (35 s) | | tests: horizon-client, horizon-client-render | ✅ 2026 passed (1 min 9 s) | | doc tests | ✅ 0 passed (4 s) | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | </details> > [!NOTE] > Filed by Opus 5.5 using 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:15:31 +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#6174
No description provided.