[PR #7247] [MERGED] Shader packs: real_packs reads packs with the game's macros #7442

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

📋 Pull Request Information

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

Base: main ← Head: shaderpacks/real-packs-game-macros


📝 Commits (2)

  • 37ba266 Shader packs: real_packs reads packs with the game's macros
  • fa7c5b0 Merge main into #7247

📊 Changes

4 files changed (+63 additions, -14 deletions)

View changed files

📝 crates/horizon-client/src/game/shader_packs.rs (+3 -6)
📝 crates/horizon-shaders/src/lib.rs (+1 -1)
📝 crates/horizon-shaders/src/options.rs (+52 -0)
📝 crates/horizon-shaders/tests/real_packs.rs (+7 -7)

📄 Description

🤖 Opened by arslanarm's AI agent (Claude Code, Claude Opus 5.5), not by arslanarm personally.

What and why

Fixes #7206.

crates/horizon-shaders/tests/real_packs.rs preprocessed every stage file and translated the composite-style programs with Macros::standard() alone. It had no renderer macros (MC_GL_VENDOR_OTHER, MC_GL_RENDERER_OTHER, MC_MIPMAP_LEVEL) and no IRIS_FEATURE_* for a pack's iris.features.optional. Its per-dimension pass had the features but not the renderer's macros. The game uses all three. So a pack that picks its code behind them counted differently from what the game translates.

  • horizon_shaders::read_properties (options.rs) reads shaders.properties with the pack's options over the given macros, then defines the features the pack turns on. It returns the properties and the notes for required features Horizon lacks.
  • game/shader_packs.rs uses it in place of the same three steps written inline.
  • real_packs builds its macros once per pack, like the game: the standard set, then the renderer's at Mipmap Levels 4, then read_properties. All three passes use them. SUBGROUPS still adds the subgroup extension on top.

Before/after, real_packs over Modrinth's 40 most-downloaded packs, main 0f0fa62dc vs this branch, SHOW_ERRORS=1:

main this branch
composite-style programs (all packs) 1509 translate, 45 fail 1523 translate, 31 fail
programs skipped (per-dimension pass) 259 259
preprocessor diagnostics 92 92

Four packs print something different (apart from timings and where the test's "running for over 60 seconds" line lands):

  • Shrimple v0.12: composite-style programs go from 75 translating and 25 failing to 89 and 11. Its imgLocalBlockMask, StaticBlockMap, darknessFactor, sunPosition, shadowProjectionEx and GetWaterMask errors are gone; three other errors appear instead (Collisions, GetBias_RT, GetCustomWaterFogFactor); why isn't diagnosed.
  • Arc v0.15.2, Fantasy Shaders Reimagined and Unbound v1.11: same counts and the same errors (Arc's with renumbered naga expressions), but more preprocessed lines.

The test reports what the game would translate; this changes no game behaviour. The game's code path calls the same steps through the helper.

Test: options::tests::properties_are_read_with_the_options_then_define_the_features. It checks that a value option and the renderer's vendor reach the conditionals, that an optional feature is defined, and that a required one Horizon lacks is noted. It is new, since read_properties doesn't exist on main.

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

none (tooling).

Other projects' code

none. Packs were only run as black boxes, through Horizon's own real_packs test.

Self-check

pr_ready (tools/pr_ready.py --quick on plony-pc, against origin/main at 0f0fa62dc, 52 s)

Check Result
Scope ✅ 4 files, +63 −14
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 612 passed (31 s)
rustfmt ✅ (7 s)
clippy ✅ (1 s)
tests: horizon-client, horizon-shaders ✅ 825 passed (1 s)
doc tests ✅ 0 passed (1 s)
content root tests ➖ content root untouched
mod API up to date ✅ (11 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 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/7247 **Author:** [@arslanarm](https://github.com/arslanarm) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `shaderpacks/real-packs-game-macros` --- ### 📝 Commits (2) - [`37ba266`](https://github.com/horizon-rust/horizon/commit/37ba266d56cd4a0019988745e8e02b28e7e41f4a) Shader packs: real_packs reads packs with the game's macros - [`fa7c5b0`](https://github.com/horizon-rust/horizon/commit/fa7c5b0a7bad8ad76a10766c7bbf676a0512dfb5) Merge main into #7247 ### 📊 Changes **4 files changed** (+63 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/shader_packs.rs` (+3 -6) 📝 `crates/horizon-shaders/src/lib.rs` (+1 -1) 📝 `crates/horizon-shaders/src/options.rs` (+52 -0) 📝 `crates/horizon-shaders/tests/real_packs.rs` (+7 -7) </details> ### 📄 Description > 🤖 Opened by arslanarm's AI agent (Claude Code, Claude Opus 5.5), not by arslanarm personally. ## What and why Fixes #7206. `crates/horizon-shaders/tests/real_packs.rs` preprocessed every stage file and translated the composite-style programs with `Macros::standard()` alone. It had no renderer macros (`MC_GL_VENDOR_OTHER`, `MC_GL_RENDERER_OTHER`, `MC_MIPMAP_LEVEL`) and no `IRIS_FEATURE_*` for a pack's `iris.features.optional`. Its per-dimension pass had the features but not the renderer's macros. The game uses all three. So a pack that picks its code behind them counted differently from what the game translates. - `horizon_shaders::read_properties` (`options.rs`) reads `shaders.properties` with the pack's options over the given macros, then defines the features the pack turns on. It returns the properties and the notes for required features Horizon lacks. - `game/shader_packs.rs` uses it in place of the same three steps written inline. - `real_packs` builds its macros once per pack, like the game: the standard set, then the renderer's at Mipmap Levels 4, then `read_properties`. All three passes use them. `SUBGROUPS` still adds the subgroup extension on top. **Before/after**, `real_packs` over Modrinth's 40 most-downloaded packs, main 0f0fa62dc vs this branch, `SHOW_ERRORS=1`: | | main | this branch | | --- | --- | --- | | composite-style programs (all packs) | 1509 translate, 45 fail | 1523 translate, 31 fail | | programs skipped (per-dimension pass) | 259 | 259 | | preprocessor diagnostics | 92 | 92 | Four packs print something different (apart from timings and where the test's "running for over 60 seconds" line lands): - **Shrimple v0.12:** composite-style programs go from 75 translating and 25 failing to 89 and 11. Its `imgLocalBlockMask`, `StaticBlockMap`, `darknessFactor`, `sunPosition`, `shadowProjectionEx` and `GetWaterMask` errors are gone; three other errors appear instead (`Collisions`, `GetBias_RT`, `GetCustomWaterFogFactor`); why isn't diagnosed. - **Arc v0.15.2, Fantasy Shaders Reimagined and Unbound v1.11:** same counts and the same errors (Arc's with renumbered naga expressions), but more preprocessed lines. The test reports what the game would translate; this changes no game behaviour. The game's code path calls the same steps through the helper. Test: `options::tests::properties_are_read_with_the_options_then_define_the_features`. It checks that a value option and the renderer's vendor reach the conditionals, that an optional feature is defined, and that a required one Horizon lacks is noted. It is new, since `read_properties` doesn't exist on main. ## Kind - [ ] parity: Horizon now does what vanilla 26.3 does - [ ] bug: a crash or a breakage - [ ] perf: faster, or less memory - [ ] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [x] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference none (tooling). ## Other projects' code none. Packs were only run as black boxes, through Horizon's own `real_packs` test. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on plony-pc, against origin/main at 0f0fa62dc, 52 s) | Check | Result | | --- | --- | | Scope | ✅ 4 files, +63 −14 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 612 passed (31 s) | | rustfmt | ✅ (7 s) | | clippy | ✅ (1 s) | | tests: horizon-client, horizon-shaders | ✅ 825 passed (1 s) | | doc tests | ✅ 0 passed (1 s) | | content root tests | ➖ content root untouched | | mod API up to date | ✅ (11 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 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:39:36 +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#7442
No description provided.