[PR #1584] [MERGED] Shader packs, clean room 1: read packs and their lang files #3610

Closed
opened 2026-11-03 04:10:47 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: feat/shader-packs-read


📝 Commits (1)

  • 07e46da Shader packs, clean room 1: read packs and their lang files

📊 Changes

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

View changed files

📝 AGENTS.md (+1 -0)
📝 Cargo.lock (+7 -0)
📝 Cargo.toml (+1 -1)
➕ crates/horizon-shaders/Cargo.toml (+13 -0)
➕ crates/horizon-shaders/src/discover.rs (+82 -0)
➕ crates/horizon-shaders/src/lang.rs (+74 -0)
➕ crates/horizon-shaders/src/lib.rs (+15 -0)
➕ crates/horizon-shaders/src/pack.rs (+262 -0)
➕ crates/horizon-shaders/tests/real_packs.rs (+43 -0)

📄 Description

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

Shader packs, clean room 1 of 3 (slice 1a): a new crate, horizon-shaders, that opens a shader pack and reads its lang files. First piece of shader pack support written again from a specification of the format (the old feature was removed in #1561).

What

  • Pack: a folder or a .zip whose root holds a shaders folder. Licences, readmes and decoy folders beside it are ignored. Paths are relative to shaders; a path that climbs out (../x) reads nothing.
  • discover(dir): the folders and .zip files in a shaderpacks folder, sorted by name ignoring case, each with the reason a broken one can't be used ("no shaders folder at the root of the pack", "not a readable zip: …"). Hidden entries and other files (the option files that will sit beside the packs) are skipped.
  • Lang::load(pack, locale): English with the player's locale over it, so a missing key still has a name. File names match ignoring case (packs ship en_US.lang, Minecraft names the locale en_us). § codes are kept for the game's text renderer.

Nothing uses the crate yet, so players see no change (skip-release). Plan for the next slices: preprocessor and #include, options, then the GLSL to naga translator, post-processing, gbuffers, shadows, and a Shader Packs page once packs draw.

Clean room

Clean-room: implemented from cleanroom/shader-packs-spec.md revision 1, §1.1 and §8.4; no other loader's code read. Inputs: that spec, its README (orchestrator decisions of 2026-10-24), Horizon's main (crates/horizon-client/src/zip.rs for the zip conventions). Decision OQ-18 (lang file case and fallback) is in the clean room's impl-plan.md. Real packs were only run as black boxes: the ignored test tests/real_packs.rs reads them (zip listing, shaders.properties, lang/); no pack GLSL was opened.

How tested

  • Unit tests on synthetic packs built in the tests (zips in memory, folders in the temp dir): zip and folder packs, decoys, escaping paths, discovery with broken entries, lang fallback by case then English.
  • Black box on the three public test packs and Complementary Unbound (never committed): HORIZON_TEST_SHADER_PACKS=… cargo test -p horizon-shaders --release -- --ignored --nocapture. Every pack opens and its shaders.properties and English lang are found, in 0.3–1.5 ms per pack on the Mac mini.

Self-check (whole stack, on its top branch)

pr_ready (tools/pr_ready.py --quick on ludovics-mac-mini, against origin/main at 16d49fe66, 18 min 0 s)

Check Result
Scope ⚠️ 12 files, +1199 −1; 1140 lines of code: over 500, split it if it can ship in parts
Cargo.lock ✅ changes with a Cargo.toml
Public tree ✅
Python tests ➖ no Python change
rustfmt ✅ (4 s)
clippy ✅ (1 min 12 s)
tests: workspace ✅ 1947 passed (15 min 38 s)
doc tests ✅ 1 passed (1 min 5 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 326 affected, to run in CI (--quick): active_effect_tick, active_effects, ambient_sound, anchor, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes, auto_jump, bamboo and 314 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

Parity: the root Cargo.toml change selects 326 harnesses, but nothing in the game depends on the new crate, so they can't change. CI runs them.

Needs Ludovic

Nothing for this PR. Label skip-release because players see nothing yet. The clean room brief says feature, but no player-facing change ships until the Shader Packs page (slice 9).

🤖 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/1584 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/24/2026 **Status:** ✅ Merged **Merged:** 10/24/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/shader-packs-read` --- ### 📝 Commits (1) - [`07e46da`](https://github.com/horizon-rust/horizon/commit/07e46daa59e2c6238a443c7992beb10af1307266) Shader packs, clean room 1: read packs and their lang files ### 📊 Changes **9 files changed** (+498 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `AGENTS.md` (+1 -0) 📝 `Cargo.lock` (+7 -0) 📝 `Cargo.toml` (+1 -1) ➕ `crates/horizon-shaders/Cargo.toml` (+13 -0) ➕ `crates/horizon-shaders/src/discover.rs` (+82 -0) ➕ `crates/horizon-shaders/src/lang.rs` (+74 -0) ➕ `crates/horizon-shaders/src/lib.rs` (+15 -0) ➕ `crates/horizon-shaders/src/pack.rs` (+262 -0) ➕ `crates/horizon-shaders/tests/real_packs.rs` (+43 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. **Shader packs, clean room 1 of 3 (slice 1a):** a new crate, `horizon-shaders`, that opens a shader pack and reads its lang files. First piece of shader pack support written again from a specification of the format (the old feature was removed in #1561). ## What - `Pack`: a folder or a `.zip` whose root holds a `shaders` folder. Licences, readmes and decoy folders beside it are ignored. Paths are relative to `shaders`; a path that climbs out (`../x`) reads nothing. - `discover(dir)`: the folders and `.zip` files in a `shaderpacks` folder, sorted by name ignoring case, each with the reason a broken one can't be used ("no shaders folder at the root of the pack", "not a readable zip: …"). Hidden entries and other files (the option files that will sit beside the packs) are skipped. - `Lang::load(pack, locale)`: English with the player's locale over it, so a missing key still has a name. File names match ignoring case (packs ship `en_US.lang`, Minecraft names the locale `en_us`). `§` codes are kept for the game's text renderer. Nothing uses the crate yet, so players see no change (`skip-release`). Plan for the next slices: preprocessor and `#include`, options, then the GLSL to naga translator, post-processing, gbuffers, shadows, and a Shader Packs page once packs draw. ## Clean room Clean-room: implemented from `cleanroom/shader-packs-spec.md` revision 1, §1.1 and §8.4; no other loader's code read. Inputs: that spec, its README (orchestrator decisions of 2026-10-24), Horizon's main (`crates/horizon-client/src/zip.rs` for the zip conventions). Decision OQ-18 (lang file case and fallback) is in the clean room's `impl-plan.md`. Real packs were only run as black boxes: the ignored test `tests/real_packs.rs` reads them (zip listing, `shaders.properties`, `lang/`); no pack GLSL was opened. ## How tested - Unit tests on synthetic packs built in the tests (zips in memory, folders in the temp dir): zip and folder packs, decoys, escaping paths, discovery with broken entries, lang fallback by case then English. - Black box on the three public test packs and Complementary Unbound (never committed): `HORIZON_TEST_SHADER_PACKS=… cargo test -p horizon-shaders --release -- --ignored --nocapture`. Every pack opens and its `shaders.properties` and English lang are found, in 0.3–1.5 ms per pack on the Mac mini. ## Self-check (whole stack, on its top branch) **pr_ready** (`tools/pr_ready.py --quick` on ludovics-mac-mini, against origin/main at 16d49fe66, 18 min 0 s) | Check | Result | | --- | --- | | Scope | ⚠️ 12 files, +1199 −1; 1140 lines of code: over 500, split it if it can ship in parts | | Cargo.lock | ✅ changes with a Cargo.toml | | Public tree | ✅ | | Python tests | ➖ no Python change | | rustfmt | ✅ (4 s) | | clippy | ✅ (1 min 12 s) | | tests: workspace | ✅ 1947 passed (15 min 38 s) | | doc tests | ✅ 1 passed (1 min 5 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 326 affected, to run in CI (--quick): active_effect_tick, active_effects, ambient_sound, anchor, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes, auto_jump, bamboo and 314 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | Parity: the root `Cargo.toml` change selects 326 harnesses, but nothing in the game depends on the new crate, so they can't change. CI runs them. ## Needs Ludovic Nothing for this PR. Label `skip-release` because players see nothing yet. The clean room brief says `feature`, but no player-facing change ships until the Shader Packs page (slice 9). 🤖 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 04:10:47 +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#3610
No description provided.