[PR #3186] [MERGED] Crate split B9: 80 modules move to horizon-client-render #4836

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3186
Author: @ludovic111
Created: 10/28/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @ludovic111

Base: main ← Head: refactor/horizon-client-render


📝 Commits (7)

  • f70501a Merge branch 'refactor/cut-biome-spawn-parsers' into refactor/horizon-client-render
  • a7efe59 refactor: the client's world data, rendering and screens become horizon-client-render
  • d2e7a54 rustfmt: wrap horizon-client's re-export of the render modules
  • 78e4497 Merge refactor/spawner-hive-traits (B8 with main) into refactor/horizon-client-render
  • ff85f10 refactor: datapack, audio and sound_engine join horizon-client-render
  • b1532a1 Merge origin/main into refactor/horizon-client-render
  • e037d39 rustfmt: rewrap horizon-client's re-export of the render modules

📊 Changes

186 files changed (+326 additions, -164 deletions)

View changed files

📝 AGENTS.md (+4 -2)
📝 Cargo.lock (+43 -2)
📝 Cargo.toml (+1 -0)
➕ crates/horizon-client-render/Cargo.toml (+67 -0)
📝 crates/horizon-client-render/src/assets.rs (+2 -2)
📝 crates/horizon-client-render/src/atlas_sources.rs (+0 -0)
📝 crates/horizon-client-render/src/audio.rs (+0 -0)
📝 crates/horizon-client-render/src/auth.rs (+0 -0)
📝 crates/horizon-client-render/src/bidi.rs (+0 -0)
📝 crates/horizon-client-render/src/biome.rs (+0 -0)
📝 crates/horizon-client-render/src/block_entities.rs (+0 -0)
📝 crates/horizon-client-render/src/block_entity_anim.rs (+0 -0)
📝 crates/horizon-client-render/src/block_entity_render.rs (+0 -0)
📝 crates/horizon-client-render/src/border.wgsl (+0 -0)
📝 crates/horizon-client-render/src/border_render.rs (+0 -0)
📝 crates/horizon-client-render/src/breaking.rs (+0 -0)
📝 crates/horizon-client-render/src/brewing.rs (+0 -0)
📝 crates/horizon-client-render/src/camera.rs (+0 -0)
📝 crates/horizon-client-render/src/chat.rs (+0 -0)
📝 crates/horizon-client-render/src/chat_tests.rs (+0 -0)

...and 80 more files

📄 Description

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

Step B9 of the horizon-client crate split (ci-speed, Ludovic's priority 1). B7 (#3180) and B8 (#3187) have merged, and main is merged in (c6af85743). Announced in #horizon-team on 2026-10-29 ~00:50Z.

What

A pure move. 80 modules of horizon-client's lib (83.2k lines) and its 8 WGSL shaders move with git mv to a new crate, crates/horizon-client-render. They cover chunks, meshing, light, streaming, gfx, the HUD, menus, settings, resource packs, particles and the block entity data. None of them reaches a gameplay module (checked on the lib's module graph). horizon-client re-exports each one under its old path, so horizon_client::gfx and every other path keep working.

Beyond the renames (+301 −153 over 183 files):

  • These become pub: ParsedModels, lod's Column::reduced/push, the spawner's Next, Spawner.next and Selector.current. Properties::for_tests moves behind a test-support feature.
  • crash.rs strips the new crate's path.
  • datapack.rs, audio.rs and sound_engine.rs move too (ff85f100e). They use only render-layer modules, and open PRs call them from options_ui. cpal, symphonia and the audio feature move with them (horizon-client's audio forwards to it), and sound_engine's test backend is also built for test-support.
  • Tools and docs point at the new paths. Three harnesses that hash every horizon-client source (arrow, native_scene_collision, native_scene_motion) now hash the new crate too. AGENTS.md's crate table and docs/architecture.md (new R/ and N/ prefixes) are updated.

No behaviour change. This PR is over the usual ~500 lines because it is renames plus mechanical path fixes.

Why

Every edit to horizon-client's lib re-checks the whole lib. Measured on the Mac mini (2026-10-28 ~23:40Z, -j5, incremental on, load 15-33). Each edit appends a one-line comment, two runs each. Before = B8 (ab0f59167), after = this head (78e449714):

before (B8) after (B9)
cargo build --profile fast -p horizon-client, edit mobs.rs 6.0 / 5.3 s 4.5 / 4.3 s
same, edit gfx.rs 6.6 / 6.7 s 5.0 / 5.0 s
same, edit game/tnt.rs (bin) 3.3 / 3.0 s 2.4 / 2.9 s
client lib test binary, edit mobs.rs 5.4 / 5.3 s 3.3 / 2.7 s
test loop for a render edit (gfx.rs) 4.6 / 4.6 s (whole client lib) 1.8 / 1.9 s (-p horizon-client-render --lib)
run the lib tests (built) 35.4 s, 1118 tests 32.3 s (637) + render 6.8 s (481)

The 10-28 run on a7efe597e (CARGO_INCREMENTAL=0, -j6, load 4-10) gave the same picture. Client lib build after a mobs.rs edit: 15.0-16.5 s → 8.7-8.9 s. Lib test binary: 17.8-19.3 s → 10.7 s.

Open pull requests this move affects (recomputed 2026-10-29 ~00:40Z on b1532a179)

There are 245 open PRs, and 101 of them touch a moved file or horizon-client's lib.rs (not counting this one). For each one:

  • git merge-tree with main and with this head;
  • cargo check --workspace --all-targets of this head merged with them (macOS, wasm guests excluded), in seven unions;
  • a scan of crate:: paths added in moved files.

datapack.rs, audio.rs and sound_engine.rs now move too (commit ff85f100e, a pure move), so #3325 and #3355 need nothing. Both merge cleanly with this head and build.

Need a change of their own after this PR. A pure move can't take files that exist only in their branch. Each fix was applied in a union branch, and that union builds:

  • #3015 (sprite cache): git mv crates/horizon-client/src/sprite_cache.rs crates/horizon-client-render/src/, mod sprite_cache; in the render crate's lib.rs, and drop the line from horizon-client's lib.rs (the lib.rs conflict). In union/cs2-b9v2-text.
  • #2888 (mod visual effects): move mod_emissive.rs and particles/mod_particles.rs into the render crate. Re-export mod_emissive from horizon-client's pub use horizon_client_render::{…} instead of its pub mod. Accept the new location of gfx/mod_post.{rs,wgsl}, and regenerate Cargo.lock. In union/cs2-b9v2-2888.
  • #3455 (colored hearts): git mv its new heart_colors.rs into the render crate (moved hud_layout.rs uses it), pub mod heart_colors; there, and re-export it from horizon-client. In union/cs2-b9v2-3455.
  • #3403 (winit 0.31): it bumps winit in horizon-client and horizon-client-input only. crates/horizon-client-render/Cargo.toml needs the same winit = "0.31.0-beta.4", otherwise gfx.rs and telemetry.rs see two Window types. In union/cs2-b9v2-3403. Checked with 12 other PRs in one union.

Text conflicts only. All of these are in union/cs2-b9v2-text, which builds with no warnings:

  • #3409: lib.rs, keep only pub mod item_activation;.
  • #3457: lib.rs, keep only pub mod target_info;.
  • #3089, #3167: Git asks to confirm the new location of gfx/view.rs and gfx/sunrise_fan.rs (crates/horizon-client-render/src/gfx/); accept it.
  • #3131: modify/delete on containers.rs, because its base predates B7. Merge main into it first, then it merges cleanly.

Merge cleanly and build (60): #2383 #2417 #2515 #2689 #2705 #2711 #2721 #2839 #2894 #2911 #2924 #2960 #2981 #2982 #3049 #3054 #3130 #3145 #3152 #3176 #3203 #3214 #3227 #3253 #3254 #3255 #3256 #3257 #3258 #3259 #3260 #3263 #3264 #3265 #3266 #3267 #3268 #3286 #3295 #3325 #3327 #3341 #3355 #3390 #3391 #3401 #3405 #3411 #3415 #3416 #3417 #3433 #3437 #3438 #3439 #3442 #3443 #3444 #3456 #3461.
#2937 also merges cleanly, but it already fails to build against main (main's Textures.slim, remote.rs); this PR adds nothing to that.

Already conflict with main (31), so they need a main merge anyway: #1068 #1069 #1070 #1180 #1415 #1696 #2475 #2574 #2608 #2699 #2812 #2872 #2875 #2959 #2971 #2990 #3048 #3269 #3270 #3271 #3272 #3273 #3274 #3276 #3277 #3282 #3300 #3350 #3351 #3353 #3371. This PR adds a conflict to four of them:

  • #1180 (ours): new gfx/raytrace.rs location.
  • #3048 (nightly integration): lib.rs, #3015's sprite_cache (fix above).
  • #3276: Cargo.toml, its audio feature line. It becomes audio = ["horizon-client-render/audio", "horizon-mods/audio"].
  • #3371 (ours): docs/extras.md.

The scan also finds #1068/#1069 (ours, companion drafts) reaching ui_theme/companion_options from moved files.

Not caused by this PR (found by the unions; the same happens on main):

  • #3327 with #3214 doesn't build: HudAtlas.object_skins is missing.
  • #2911 with #3258 doesn't build: folder is undefined in game/integrated.rs.
  • #3455 and #3457 conflict in extras.rs and docs/extras.md.

Checks

  • cargo check --workspace --all-targets (wasm guests excluded on macOS) is clean, with no warnings. -p horizon-client -p horizon-client-render --no-default-features --all-targets is clean too.
  • Full tools/pr_ready.py on the Mac mini, harnesses included, on b1532a179. rustfmt failed only on the wrapping of horizon-client's pub use horizon_client_render::{…} line, which the fold made longer. The next commit, e037d3931, only runs cargo fmt, and cargo fmt --all --check passes on it. The Label row is the tool's generic hint; this is a pure move, so skip-release.

pr_ready (tools/pr_ready.py on ludovics-mac-mini, against origin/main at c6af85743, 105 min 5 s)

Check Result
Scope ✅ 186 files, +326 −164
Cargo.lock ✅ changes with a Cargo.toml
Public tree ✅
Python tests ✅ 408 passed (54 s)
rustfmt ❌ failed (5 s)
clippy ✅ (55 s)
tests: workspace ✅ 2377 passed (5 min 21 s)
doc tests ✅ 2 passed (20 s)
content root tests ✅ 5 passed (1 min 43 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ✅ (1 s)
launcher clippy ✅ (49 s)
launcher tests ✅ 246 passed (1 min 14 s)
Parity ✅ 356 affected, 355 passed (93 min 43 s)
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

Parity: 0 failed.

🤖 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/3186 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/28/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `refactor/horizon-client-render` --- ### 📝 Commits (7) - [`f70501a`](https://github.com/horizon-rust/horizon/commit/f70501aa42e0ebab7b3eca7f0c22546ff2e403e2) Merge branch 'refactor/cut-biome-spawn-parsers' into refactor/horizon-client-render - [`a7efe59`](https://github.com/horizon-rust/horizon/commit/a7efe597ea83e093fb816f22c93d6bd454fb5293) refactor: the client's world data, rendering and screens become horizon-client-render - [`d2e7a54`](https://github.com/horizon-rust/horizon/commit/d2e7a54082665719f5315518e225dcf1beabaf33) rustfmt: wrap horizon-client's re-export of the render modules - [`78e4497`](https://github.com/horizon-rust/horizon/commit/78e449714a326dcb6427beedb6d879e2c5282513) Merge refactor/spawner-hive-traits (B8 with main) into refactor/horizon-client-render - [`ff85f10`](https://github.com/horizon-rust/horizon/commit/ff85f100ec2855b1ab74172a645379b2b23a99c5) refactor: datapack, audio and sound_engine join horizon-client-render - [`b1532a1`](https://github.com/horizon-rust/horizon/commit/b1532a179afb411c436b3fbfb3bb072f36c8ed93) Merge origin/main into refactor/horizon-client-render - [`e037d39`](https://github.com/horizon-rust/horizon/commit/e037d393142ad53760ffc6c1eff02f15c544859a) rustfmt: rewrap horizon-client's re-export of the render modules ### 📊 Changes **186 files changed** (+326 additions, -164 deletions) <details> <summary>View changed files</summary> 📝 `AGENTS.md` (+4 -2) 📝 `Cargo.lock` (+43 -2) 📝 `Cargo.toml` (+1 -0) ➕ `crates/horizon-client-render/Cargo.toml` (+67 -0) 📝 `crates/horizon-client-render/src/assets.rs` (+2 -2) 📝 `crates/horizon-client-render/src/atlas_sources.rs` (+0 -0) 📝 `crates/horizon-client-render/src/audio.rs` (+0 -0) 📝 `crates/horizon-client-render/src/auth.rs` (+0 -0) 📝 `crates/horizon-client-render/src/bidi.rs` (+0 -0) 📝 `crates/horizon-client-render/src/biome.rs` (+0 -0) 📝 `crates/horizon-client-render/src/block_entities.rs` (+0 -0) 📝 `crates/horizon-client-render/src/block_entity_anim.rs` (+0 -0) 📝 `crates/horizon-client-render/src/block_entity_render.rs` (+0 -0) 📝 `crates/horizon-client-render/src/border.wgsl` (+0 -0) 📝 `crates/horizon-client-render/src/border_render.rs` (+0 -0) 📝 `crates/horizon-client-render/src/breaking.rs` (+0 -0) 📝 `crates/horizon-client-render/src/brewing.rs` (+0 -0) 📝 `crates/horizon-client-render/src/camera.rs` (+0 -0) 📝 `crates/horizon-client-render/src/chat.rs` (+0 -0) 📝 `crates/horizon-client-render/src/chat_tests.rs` (+0 -0) _...and 80 more files_ </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Step B9 of the horizon-client crate split (ci-speed, Ludovic's priority 1). B7 (#3180) and B8 (#3187) have merged, and main is merged in (c6af85743). Announced in #horizon-team on 2026-10-29 ~00:50Z. ## What A pure move. 80 modules of horizon-client's lib (83.2k lines) and its 8 WGSL shaders move with `git mv` to a new crate, `crates/horizon-client-render`. They cover chunks, meshing, light, streaming, `gfx`, the HUD, menus, settings, resource packs, particles and the block entity data. None of them reaches a gameplay module (checked on the lib's module graph). horizon-client re-exports each one under its old path, so `horizon_client::gfx` and every other path keep working. Beyond the renames (+301 −153 over 183 files): - These become `pub`: `ParsedModels`, lod's `Column::reduced`/`push`, the spawner's `Next`, `Spawner.next` and `Selector.current`. `Properties::for_tests` moves behind a `test-support` feature. - `crash.rs` strips the new crate's path. - `datapack.rs`, `audio.rs` and `sound_engine.rs` move too (ff85f100e). They use only render-layer modules, and open PRs call them from `options_ui`. `cpal`, `symphonia` and the `audio` feature move with them (horizon-client's `audio` forwards to it), and `sound_engine`'s test backend is also built for `test-support`. - Tools and docs point at the new paths. Three harnesses that hash every horizon-client source (arrow, native_scene_collision, native_scene_motion) now hash the new crate too. AGENTS.md's crate table and docs/architecture.md (new `R/` and `N/` prefixes) are updated. No behaviour change. This PR is over the usual ~500 lines because it is renames plus mechanical path fixes. ## Why Every edit to horizon-client's lib re-checks the whole lib. Measured on the Mac mini (2026-10-28 ~23:40Z, `-j5`, incremental on, load 15-33). Each edit appends a one-line comment, two runs each. Before = B8 (ab0f59167), after = this head (78e449714): | | before (B8) | after (B9) | |---|---|---| | `cargo build --profile fast -p horizon-client`, edit `mobs.rs` | 6.0 / 5.3 s | **4.5 / 4.3 s** | | same, edit `gfx.rs` | 6.6 / 6.7 s | **5.0 / 5.0 s** | | same, edit `game/tnt.rs` (bin) | 3.3 / 3.0 s | 2.4 / 2.9 s | | client lib test binary, edit `mobs.rs` | 5.4 / 5.3 s | **3.3 / 2.7 s** | | test loop for a render edit (`gfx.rs`) | 4.6 / 4.6 s (whole client lib) | **1.8 / 1.9 s** (`-p horizon-client-render --lib`) | | run the lib tests (built) | 35.4 s, 1118 tests | 32.3 s (637) + render 6.8 s (481) | The 10-28 run on a7efe597e (`CARGO_INCREMENTAL=0`, `-j6`, load 4-10) gave the same picture. Client lib build after a `mobs.rs` edit: 15.0-16.5 s → 8.7-8.9 s. Lib test binary: 17.8-19.3 s → 10.7 s. ## Open pull requests this move affects (recomputed 2026-10-29 ~00:40Z on b1532a179) There are 245 open PRs, and 101 of them touch a moved file or horizon-client's `lib.rs` (not counting this one). For each one: - `git merge-tree` with main and with this head; - `cargo check --workspace --all-targets` of this head merged with them (macOS, wasm guests excluded), in seven unions; - a scan of `crate::` paths added in moved files. `datapack.rs`, `audio.rs` and `sound_engine.rs` now move too (commit ff85f100e, a pure move), so **#3325 and #3355 need nothing**. Both merge cleanly with this head and build. **Need a change of their own after this PR.** A pure move can't take files that exist only in their branch. Each fix was applied in a union branch, and that union builds: - **#3015** (sprite cache): `git mv crates/horizon-client/src/sprite_cache.rs crates/horizon-client-render/src/`, `mod sprite_cache;` in the render crate's lib.rs, and drop the line from horizon-client's lib.rs (the `lib.rs` conflict). In [`union/cs2-b9v2-text`](https://github.com/horizon-rust/horizon/tree/union/cs2-b9v2-text). - **#2888** (mod visual effects): move `mod_emissive.rs` and `particles/mod_particles.rs` into the render crate. Re-export `mod_emissive` from horizon-client's `pub use horizon_client_render::{…}` instead of its `pub mod`. Accept the new location of `gfx/mod_post.{rs,wgsl}`, and regenerate `Cargo.lock`. In [`union/cs2-b9v2-2888`](https://github.com/horizon-rust/horizon/tree/union/cs2-b9v2-2888). - **#3455** (colored hearts): `git mv` its new `heart_colors.rs` into the render crate (moved `hud_layout.rs` uses it), `pub mod heart_colors;` there, and re-export it from horizon-client. In [`union/cs2-b9v2-3455`](https://github.com/horizon-rust/horizon/tree/union/cs2-b9v2-3455). - **#3403** (winit 0.31): it bumps winit in horizon-client and horizon-client-input only. `crates/horizon-client-render/Cargo.toml` needs the same `winit = "0.31.0-beta.4"`, otherwise `gfx.rs` and `telemetry.rs` see two `Window` types. In [`union/cs2-b9v2-3403`](https://github.com/horizon-rust/horizon/tree/union/cs2-b9v2-3403). Checked with 12 other PRs in one union. **Text conflicts only.** All of these are in [`union/cs2-b9v2-text`](https://github.com/horizon-rust/horizon/tree/union/cs2-b9v2-text), which builds with no warnings: - **#3409**: `lib.rs`, keep only `pub mod item_activation;`. - **#3457**: `lib.rs`, keep only `pub mod target_info;`. - **#3089, #3167**: Git asks to confirm the new location of `gfx/view.rs` and `gfx/sunrise_fan.rs` (`crates/horizon-client-render/src/gfx/`); accept it. - **#3131**: modify/delete on `containers.rs`, because its base predates B7. Merge main into it first, then it merges cleanly. **Merge cleanly and build (60):** #2383 #2417 #2515 #2689 #2705 #2711 #2721 #2839 #2894 #2911 #2924 #2960 #2981 #2982 #3049 #3054 #3130 #3145 #3152 #3176 #3203 #3214 #3227 #3253 #3254 #3255 #3256 #3257 #3258 #3259 #3260 #3263 #3264 #3265 #3266 #3267 #3268 #3286 #3295 #3325 #3327 #3341 #3355 #3390 #3391 #3401 #3405 #3411 #3415 #3416 #3417 #3433 #3437 #3438 #3439 #3442 #3443 #3444 #3456 #3461. #2937 also merges cleanly, but it already fails to build against main (main's `Textures.slim`, `remote.rs`); this PR adds nothing to that. **Already conflict with main (31), so they need a main merge anyway:** #1068 #1069 #1070 #1180 #1415 #1696 #2475 #2574 #2608 #2699 #2812 #2872 #2875 #2959 #2971 #2990 #3048 #3269 #3270 #3271 #3272 #3273 #3274 #3276 #3277 #3282 #3300 #3350 #3351 #3353 #3371. This PR adds a conflict to four of them: - #1180 (ours): new `gfx/raytrace.rs` location. - #3048 (nightly integration): `lib.rs`, #3015's `sprite_cache` (fix above). - #3276: `Cargo.toml`, its `audio` feature line. It becomes `audio = ["horizon-client-render/audio", "horizon-mods/audio"]`. - #3371 (ours): `docs/extras.md`. The scan also finds #1068/#1069 (ours, companion drafts) reaching `ui_theme`/`companion_options` from moved files. **Not caused by this PR** (found by the unions; the same happens on main): - #3327 with #3214 doesn't build: `HudAtlas.object_skins` is missing. - #2911 with #3258 doesn't build: `folder` is undefined in `game/integrated.rs`. - #3455 and #3457 conflict in `extras.rs` and `docs/extras.md`. ## Checks - `cargo check --workspace --all-targets` (wasm guests excluded on macOS) is clean, with no warnings. `-p horizon-client -p horizon-client-render --no-default-features --all-targets` is clean too. - Full `tools/pr_ready.py` on the Mac mini, harnesses included, on b1532a179. rustfmt failed only on the wrapping of horizon-client's `pub use horizon_client_render::{…}` line, which the fold made longer. The next commit, e037d3931, only runs `cargo fmt`, and `cargo fmt --all --check` passes on it. The Label row is the tool's generic hint; this is a pure move, so `skip-release`. **pr_ready** (`tools/pr_ready.py` on ludovics-mac-mini, against origin/main at c6af85743, 105 min 5 s) | Check | Result | | --- | --- | | Scope | ✅ 186 files, +326 −164 | | Cargo.lock | ✅ changes with a Cargo.toml | | Public tree | ✅ | | Python tests | ✅ 408 passed (54 s) | | rustfmt | ❌ failed (5 s) | | clippy | ✅ (55 s) | | tests: workspace | ✅ 2377 passed (5 min 21 s) | | doc tests | ✅ 2 passed (20 s) | | content root tests | ✅ 5 passed (1 min 43 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ✅ (1 s) | | launcher clippy | ✅ (49 s) | | launcher tests | ✅ 246 passed (1 min 14 s) | | Parity | ✅ 356 affected, 355 passed (93 min 43 s) | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | Parity: 0 failed. 🤖 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:08:18 +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#4836
No description provided.