[PR #7072] [MERGED] Prepared data file: trades, paintings, enchantments, particles, ambient sounds, biomes and Fusion's scan read through it #7312

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

📋 Pull Request Information

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

Base: main ← Head: perf/prepared-data-folders


📝 Commits (2)

  • 90f2ef8 Prepared data file: trades, paintings, enchantments, particles, ambient sounds and the biome table read through it
  • d2c73f5 Prepared data file: Fusion's .mcmeta scan and model reads through it

📊 Changes

7 files changed (+114 additions, -147 deletions)

View changed files

📝 crates/horizon-client-render/src/biome.rs (+18 -16)
📝 crates/horizon-client-render/src/fusion.rs (+5 -2)
📝 crates/horizon-client-render/src/particles.rs (+3 -1)
📝 crates/horizon-client/src/ambience.rs (+11 -9)
📝 crates/horizon-client/src/game/paintings.rs (+15 -18)
📝 crates/horizon-client/src/merchant.rs (+12 -35)
📝 crates/horizon-items/src/enchant.rs (+50 -66)

📄 Description

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

Part of #1961. Stacked on #7055 (assets through the data file). It retargets to main when that merges.

What

More readers of the prepared root now go through json_folder or prepared_files, so they read horizon-data.bin when it is current. Before, each listed its folder and opened every file:

  • merchant.rs Trades::load: villager_trade/, trade_set/, tags/villager_trade, tags/potion.
  • game/paintings.rs: painting_variant/ and the placeable tag.
  • horizon-items enchant.rs: enchantment/, the entity and damage type tags, and en_us.json.
  • ambience.rs: ambient sounds from dimension_type/ and worldgen/biome/.
  • horizon-client-render biome.rs: the client's biome table and its three colormaps.
  • particles.rs: the vanilla particle sprite sets.
  • fusion.rs: the scan of every real .png.mcmeta for Fusion metadata, and Fusion's model reads.

Behaviour stays as it was. Ids are the same, files that don't parse are skipped as before, and missing folders give empty tables. The biome table and the enchantments keep their file-name order, and they still read only their folder's own files, not subfolders, as read_dir did.

A/B (playhorizon, llvmpipe; a copy of the prepared root with its horizon-data.bin; --world start until the full view)

Strace, 2 rounds each:

#7055 this PR
files opened under the prepared root 6,751 / 6,751 4,742 / 4,755
every openat of the process 9,307 / 9,250 7,127 / 7,002
data/minecraft/villager_trade 551 80
data/minecraft/tags 637 96
data/minecraft/worldgen 463 327
data/minecraft/enchantment, painting_variant, trade_set, assets/minecraft/particles 172, 102, 96, 254 0

Without strace, 3 alternated rounds (load average 9–15 on the box):

ms #7055 this PR
world full view 29,795 / 31,585 / 36,544 30,489 / 30,876 / 34,591
title shown 3,051 / 3,103 / 5,213 3,937 / 3,832 / 3,904

The title times differ, so I compared every startup span up to the title (2 more rounds each). The only span this PR touches before the title, core.biomes, takes 11–16 ms on both builds. The title differences come from renderer.boot, renderer.pipelines_textures and renderer.title_artwork, which compile shaders on llvmpipe and swing with the machine's load. This PR doesn't touch them. The open counts are the signal.

Left at world start: .ogg sounds (736, deliberately not in the data file), worldgen/structure NBTs (689, the root-level worldgen/ isn't one of the data file's folders), texture directory listings (the same folders listed by about 11 scanners) and loot_table (140).

Checks

On playhorizon:

  • horizon-items (54);
  • horizon-client-render biome, particles, fusion (28, --test-threads=1);
  • horizon-client-lib merchant, ambience (10);
  • horizon-client painting, merchant, trade;
  • clippy -D warnings on the four packages with --all-targets.

🤖 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/7072 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `perf/prepared-data-folders` --- ### 📝 Commits (2) - [`90f2ef8`](https://github.com/horizon-rust/horizon/commit/90f2ef813b16a8a5747b5a6d83339b7705f54fef) Prepared data file: trades, paintings, enchantments, particles, ambient sounds and the biome table read through it - [`d2c73f5`](https://github.com/horizon-rust/horizon/commit/d2c73f55aa93b454a40a94b9efc736adb7823c05) Prepared data file: Fusion's .mcmeta scan and model reads through it ### 📊 Changes **7 files changed** (+114 additions, -147 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/biome.rs` (+18 -16) 📝 `crates/horizon-client-render/src/fusion.rs` (+5 -2) 📝 `crates/horizon-client-render/src/particles.rs` (+3 -1) 📝 `crates/horizon-client/src/ambience.rs` (+11 -9) 📝 `crates/horizon-client/src/game/paintings.rs` (+15 -18) 📝 `crates/horizon-client/src/merchant.rs` (+12 -35) 📝 `crates/horizon-items/src/enchant.rs` (+50 -66) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Part of #1961. Stacked on #7055 (assets through the data file). It retargets to main when that merges. ## What More readers of the prepared root now go through `json_folder` or `prepared_files`, so they read `horizon-data.bin` when it is current. Before, each listed its folder and opened every file: - `merchant.rs` `Trades::load`: `villager_trade/`, `trade_set/`, `tags/villager_trade`, `tags/potion`. - `game/paintings.rs`: `painting_variant/` and the `placeable` tag. - `horizon-items` `enchant.rs`: `enchantment/`, the entity and damage type tags, and `en_us.json`. - `ambience.rs`: ambient sounds from `dimension_type/` and `worldgen/biome/`. - `horizon-client-render` `biome.rs`: the client's biome table and its three colormaps. - `particles.rs`: the vanilla particle sprite sets. - `fusion.rs`: the scan of every real `.png.mcmeta` for Fusion metadata, and Fusion's model reads. Behaviour stays as it was. Ids are the same, files that don't parse are skipped as before, and missing folders give empty tables. The biome table and the enchantments keep their file-name order, and they still read only their folder's own files, not subfolders, as `read_dir` did. ## A/B (playhorizon, llvmpipe; a copy of the prepared root with its `horizon-data.bin`; `--world` start until the full view) Strace, 2 rounds each: | | #7055 | this PR | |---|---:|---:| | files opened under the prepared root | 6,751 / 6,751 | **4,742 / 4,755** | | every `openat` of the process | 9,307 / 9,250 | **7,127 / 7,002** | | `data/minecraft/villager_trade` | 551 | **80** | | `data/minecraft/tags` | 637 | **96** | | `data/minecraft/worldgen` | 463 | **327** | | `data/minecraft/enchantment`, `painting_variant`, `trade_set`, `assets/minecraft/particles` | 172, 102, 96, 254 | **0** | Without strace, 3 alternated rounds (load average 9–15 on the box): | ms | #7055 | this PR | |---|---:|---:| | world full view | 29,795 / 31,585 / 36,544 | 30,489 / 30,876 / 34,591 | | title shown | 3,051 / 3,103 / 5,213 | 3,937 / 3,832 / 3,904 | The title times differ, so I compared every startup span up to the title (2 more rounds each). The only span this PR touches before the title, `core.biomes`, takes 11–16 ms on both builds. The title differences come from `renderer.boot`, `renderer.pipelines_textures` and `renderer.title_artwork`, which compile shaders on llvmpipe and swing with the machine's load. This PR doesn't touch them. The open counts are the signal. Left at world start: `.ogg` sounds (736, deliberately not in the data file), `worldgen/structure` NBTs (689, the root-level `worldgen/` isn't one of the data file's folders), texture directory listings (the same folders listed by about 11 scanners) and `loot_table` (140). ## Checks On playhorizon: - `horizon-items` (54); - `horizon-client-render` `biome`, `particles`, `fusion` (28, `--test-threads=1`); - `horizon-client-lib` `merchant`, `ambience` (10); - `horizon-client` `painting`, `merchant`, `trade`; - clippy `-D warnings` on the four packages with `--all-targets`. 🤖 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:37:35 +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#7312
No description provided.