[PR #648] [MERGED] Content mods: refuse more block states than chunks hold; the pack against NeoForge, measured #2698

Closed
opened 2026-11-02 15:58:21 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: feat/modpack-bench


📝 Commits (5)

  • ddc115e Content mods: load real carried-over mods (large tables, convention tags, mod recipes)
  • 886def4 horizon-port-pack carry: templates and numbers from the NeoForge oracle, 1.21.1 loot upgraded
  • 32f5f01 Per-mod parity harness against a dev-only NeoForge oracle
  • 0560bbf horizon-port-pack report: coverage per mod, and ATM10 measured
  • 2822d4e Content mods: refuse more block states than chunks hold; the pack against NeoForge, measured

📊 Changes

28 files changed (+3264 additions, -114 deletions)

View changed files

➕ crates/horizon-client/examples/mod_port_probe.rs (+271 -0)
📝 crates/horizon-client/src/collisions.rs (+1 -1)
📝 crates/horizon-client/src/items.rs (+14 -6)
📝 crates/horizon-client/src/light.rs (+1 -1)
📝 crates/horizon-client/src/mod_content.rs (+100 -2)
📝 crates/horizon-client/src/mod_content_tests.rs (+44 -4)
📝 crates/horizon-client/src/models.rs (+1 -1)
📝 crates/horizon-client/src/motion.rs (+1 -1)
📝 crates/horizon-client/src/stations.rs (+17 -10)
📝 crates/horizon-mods/src/content.rs (+10 -6)
📝 crates/horizon-port-pack/src/carry.rs (+358 -35)
📝 crates/horizon-port-pack/src/import.rs (+88 -2)
📝 crates/horizon-port-pack/src/inventory.rs (+7 -3)
📝 crates/horizon-port-pack/src/jar.rs (+16 -0)
📝 crates/horizon-port-pack/src/main.rs (+78 -7)
➕ crates/horizon-port-pack/src/oracle.rs (+384 -0)
➕ crates/horizon-port-pack/src/report.rs (+428 -0)
📝 crates/horizon-world/src/nbt.rs (+12 -0)
📝 crates/horizon-world/src/worldgen/generator_blocks.rs (+6 -8)
📝 docs/modpacks.md (+146 -18)

...and 8 more files

📄 Description

Top of the modpack stack (#630 → #631 → #632 → #633 → this). Loading the eight carried-over mods in the game itself, not only in the probe, showed two limits real packs reach. Block textures past 2048 layers are #647. This PR handles block states and measures a pack against NeoForge.

Block states past what chunks hold

Chunk sections store a block state in 16 bits. Vanilla 26.3 has 35,723 states, so mods may add 29,813. Macaw's four mods add 36,154 and the eight mods 41,389. Past 65,536, ids wrapped onto other blocks: a placed trapdoor read back as a cherry hanging sign. mod_content::build now refuses a set of mods past MAX_STATES and names each mod's state count. The game then starts without content mods, as it does for any refused content. Wider state ids are the step big packs need; it is noted in docs/modpacks.md.

tools/mod_port_harness.py now probes each mod on its own against vanilla, as a player adding it would load it. The results are unchanged (#632's table).

The pack against NeoForge

  • tools/perf_bench.py --game neoforge --mod-jars DIR --deps DIR runs Minecraft 1.21.1 on NeoForge 21.1.259, driven through the same steps by a dev-only NeoForge port of the bench mod (mods/horizon/src/neoforge-bench, our code, never shipped).
  • --game horizon --port-work WORK loads a work folder's carried-over mods into Horizon as dev mods.
  • tools/neoforge_oracle.py installs the client once under .local/neoforge-oracle: the NeoForge installer, then the vanilla libraries its profile inherits, sha1-checked. It also builds the driver.
  • A NeoForge first start that crashes before the driver loads (FML reading fml.toml while creating it) is retried once.

Measured: six ported mods against the same mods on NeoForge

Cloud Glass, Factory Blocks, Glassential, Macaw's Fences, Paths and Trapdoors are carried over in Horizon. NeoForge runs their jars plus Architectury and Fusion. Doors is left out because with Trapdoors it passes the state limit. Mac mini M4 Pro, 1280x720, seed 1234, the four flight scenes, 2 games per row, 2026-10-17. FPS is the mean of the four scenes.

RD game title s world s scene load s FPS RSS steady / peak MB load avg
8 Horizon + 6 mods 9.8 16.2 4.0 122 2,644 / 2,771 32
8 NeoForge + 6 mods 19.5 50.0 30.2 72 2,325 / 2,592 56
8 Horizon 5.0 11.0 4.0 124 1,559 / 1,629 51
8 NeoForge 12.8 36.1 21.9 104 2,334 / 2,558 30
16 Horizon + 6 mods 10.8 27.0 11.3 90 2,925 / 3,032 40
16 NeoForge + 6 mods 26.4 82.5 64.3 25 3,016 / 3,519 45
16 Horizon 3.5 10.0 7.4 119 1,732 / 1,871 56
16 NeoForge 16.9 73.7 43.2 36 2,748 / 3,425 48

With the same content, against NeoForge, Horizon:

  • has the world ready 3.1x sooner at both 8 and 16 chunks;
  • reaches the title screen 2.0x and 2.4x sooner;
  • runs the flights at 1.7x and 3.6x the frames.

RAM is not lower. Horizon's steady RSS grows by 1.1 GB with the mods (61,816 block states against vanilla's 35,723), while the JVM stays inside its 2 GB heap.

The caveats are written in docs/modpacks.md, and they are why none of this is a "10x" claim:

  • Other sessions and CI runners kept the load average at 30–56 on 14 threads, so the 95% intervals are as wide as the means.
  • At 8 chunks, Horizon's frames are paced near the display's 144 Hz.
  • Horizon's title time includes building the content overlay on a first start, about 5 s, which is cached afterwards.
  • 1.21.1 runs against 26.3.

The next measurement is a quiet rerun with more games. The result JSONs stay local.

Checks

  • cargo fmt --all --check: clean
  • cargo clippy --workspace --all-targets -- -D warnings (release profile, with #647's changes in the tree): clean
  • horizon-client mod_content tests (7, including the new state-limit test): pass
  • Local parity (--changed origin/main, this branch plus #647): 293 harnesses depend on the changes; the 20 without a pass for their current inputs ran and passed (2.3 min), the other 273 had passed for the same inputs in the stack's run

Not merged by me.

🤖 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/648 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/17/2026 **Status:** ✅ Merged **Merged:** 10/17/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/modpack-bench` --- ### 📝 Commits (5) - [`ddc115e`](https://github.com/horizon-rust/horizon/commit/ddc115e969690c3a868283b540af534cc9465310) Content mods: load real carried-over mods (large tables, convention tags, mod recipes) - [`886def4`](https://github.com/horizon-rust/horizon/commit/886def4360a904802f30d1e053281ef35cf6b4d6) horizon-port-pack carry: templates and numbers from the NeoForge oracle, 1.21.1 loot upgraded - [`32f5f01`](https://github.com/horizon-rust/horizon/commit/32f5f01e22fb4fcbb0017d4951560d27459f8525) Per-mod parity harness against a dev-only NeoForge oracle - [`0560bbf`](https://github.com/horizon-rust/horizon/commit/0560bbf87607c435bab58b7005b0fe0707891fec) horizon-port-pack report: coverage per mod, and ATM10 measured - [`2822d4e`](https://github.com/horizon-rust/horizon/commit/2822d4e1b7146a1a41392421d3ddb818452fb522) Content mods: refuse more block states than chunks hold; the pack against NeoForge, measured ### 📊 Changes **28 files changed** (+3264 additions, -114 deletions) <details> <summary>View changed files</summary> ➕ `crates/horizon-client/examples/mod_port_probe.rs` (+271 -0) 📝 `crates/horizon-client/src/collisions.rs` (+1 -1) 📝 `crates/horizon-client/src/items.rs` (+14 -6) 📝 `crates/horizon-client/src/light.rs` (+1 -1) 📝 `crates/horizon-client/src/mod_content.rs` (+100 -2) 📝 `crates/horizon-client/src/mod_content_tests.rs` (+44 -4) 📝 `crates/horizon-client/src/models.rs` (+1 -1) 📝 `crates/horizon-client/src/motion.rs` (+1 -1) 📝 `crates/horizon-client/src/stations.rs` (+17 -10) 📝 `crates/horizon-mods/src/content.rs` (+10 -6) 📝 `crates/horizon-port-pack/src/carry.rs` (+358 -35) 📝 `crates/horizon-port-pack/src/import.rs` (+88 -2) 📝 `crates/horizon-port-pack/src/inventory.rs` (+7 -3) 📝 `crates/horizon-port-pack/src/jar.rs` (+16 -0) 📝 `crates/horizon-port-pack/src/main.rs` (+78 -7) ➕ `crates/horizon-port-pack/src/oracle.rs` (+384 -0) ➕ `crates/horizon-port-pack/src/report.rs` (+428 -0) 📝 `crates/horizon-world/src/nbt.rs` (+12 -0) 📝 `crates/horizon-world/src/worldgen/generator_blocks.rs` (+6 -8) 📝 `docs/modpacks.md` (+146 -18) _...and 8 more files_ </details> ### 📄 Description Top of the modpack stack (#630 → #631 → #632 → #633 → **this**). Loading the eight carried-over mods in the game itself, not only in the probe, showed two limits real packs reach. Block textures past 2048 layers are #647. This PR handles block states and measures a pack against NeoForge. ### Block states past what chunks hold Chunk sections store a block state in 16 bits. Vanilla 26.3 has 35,723 states, so mods may add 29,813. Macaw's four mods add 36,154 and the eight mods 41,389. Past 65,536, ids wrapped onto other blocks: a placed trapdoor read back as a cherry hanging sign. `mod_content::build` now refuses a set of mods past `MAX_STATES` and names each mod's state count. The game then starts without content mods, as it does for any refused content. Wider state ids are the step big packs need; it is noted in docs/modpacks.md. `tools/mod_port_harness.py` now probes each mod on its own against vanilla, as a player adding it would load it. The results are unchanged (#632's table). ### The pack against NeoForge - `tools/perf_bench.py --game neoforge --mod-jars DIR --deps DIR` runs Minecraft 1.21.1 on NeoForge 21.1.259, driven through the same steps by a dev-only NeoForge port of the bench mod (`mods/horizon/src/neoforge-bench`, our code, never shipped). - `--game horizon --port-work WORK` loads a work folder's carried-over mods into Horizon as dev mods. - `tools/neoforge_oracle.py` installs the client once under `.local/neoforge-oracle`: the NeoForge installer, then the vanilla libraries its profile inherits, sha1-checked. It also builds the driver. - A NeoForge first start that crashes before the driver loads (FML reading `fml.toml` while creating it) is retried once. ### Measured: six ported mods against the same mods on NeoForge Cloud Glass, Factory Blocks, Glassential, Macaw's Fences, Paths and Trapdoors are carried over in Horizon. NeoForge runs their jars plus Architectury and Fusion. Doors is left out because with Trapdoors it passes the state limit. Mac mini M4 Pro, 1280x720, seed 1234, the four flight scenes, 2 games per row, 2026-10-17. FPS is the mean of the four scenes. | RD | game | title s | world s | scene load s | FPS | RSS steady / peak MB | load avg | |---|---|---:|---:|---:|---:|---:|---:| | 8 | Horizon + 6 mods | 9.8 | 16.2 | 4.0 | 122 | 2,644 / 2,771 | 32 | | 8 | NeoForge + 6 mods | 19.5 | 50.0 | 30.2 | 72 | 2,325 / 2,592 | 56 | | 8 | Horizon | 5.0 | 11.0 | 4.0 | 124 | 1,559 / 1,629 | 51 | | 8 | NeoForge | 12.8 | 36.1 | 21.9 | 104 | 2,334 / 2,558 | 30 | | 16 | Horizon + 6 mods | 10.8 | 27.0 | 11.3 | 90 | 2,925 / 3,032 | 40 | | 16 | NeoForge + 6 mods | 26.4 | 82.5 | 64.3 | 25 | 3,016 / 3,519 | 45 | | 16 | Horizon | 3.5 | 10.0 | 7.4 | 119 | 1,732 / 1,871 | 56 | | 16 | NeoForge | 16.9 | 73.7 | 43.2 | 36 | 2,748 / 3,425 | 48 | With the same content, against NeoForge, Horizon: - has the world ready 3.1x sooner at both 8 and 16 chunks; - reaches the title screen 2.0x and 2.4x sooner; - runs the flights at 1.7x and 3.6x the frames. RAM is not lower. Horizon's steady RSS grows by 1.1 GB with the mods (61,816 block states against vanilla's 35,723), while the JVM stays inside its 2 GB heap. The caveats are written in docs/modpacks.md, and they are why none of this is a "10x" claim: - Other sessions and CI runners kept the load average at 30–56 on 14 threads, so the 95% intervals are as wide as the means. - At 8 chunks, Horizon's frames are paced near the display's 144 Hz. - Horizon's title time includes building the content overlay on a first start, about 5 s, which is cached afterwards. - 1.21.1 runs against 26.3. The next measurement is a quiet rerun with more games. The result JSONs stay local. ## Checks - `cargo fmt --all --check`: clean - `cargo clippy --workspace --all-targets -- -D warnings` (release profile, with #647's changes in the tree): clean - `horizon-client` mod_content tests (7, including the new state-limit test): pass - Local parity (`--changed origin/main`, this branch plus #647): 293 harnesses depend on the changes; the 20 without a pass for their current inputs ran and passed (2.3 min), the other 273 had passed for the same inputs in the stack's run Not merged by me. 🤖 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-02 15:58:21 +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#2698
No description provided.