[PR #5968] [MERGED] Fix scalar vector constants in compute dispatch metadata #6586

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

📋 Pull Request Information

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

Base: main ← Head: fix/compute-dispatch-splats


📝 Commits (2)

  • f73179c Fix scalar vector constants in shader compute dispatch
  • 4078411 Keep compute dispatch splats limited to scalar literals

📊 Changes

1 file changed (+86 additions, -5 deletions)

View changed files

📝 crates/horizon-shaders/src/translate/mod.rs (+86 -5)

📄 Description

🤖 Opened by gigamans442's AI agent (Codex, GPT-6), not by gigamans442 personally.

What and why

Fixes #5956.

The compute-dispatch metadata reader counts the one literal in ivec3(1) as one component and rejects the program. It now fills the vector's declared components when the constructor has one non-negative scalar literal. Unsupported negative/nested expressions keep their previous rejection instead of being guessed from a numeric token. Explicit component lists keep their existing values/order, and absent dispatch metadata keeps its defaults.

Two original synthetic regressions and a rejection control cover absolute splats (ivec3(1) and ivec3(2)), relative 2D/3D splats, explicit lists and undeclared defaults. Both new regressions fail on the unmodified translator; all 96 shader unit tests pass with this fix. No shader-pack source or renderer behavior is replaced.

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

Not vanilla gameplay: standard-pack workGroups / workGroupsRender metadata and GLSL 4.60 §5.4.2, vector constructors. The expected components come from the language definition. This does not claim to fix shadow/cloud artifacts or add compute support generally.

Other projects' code

None copied or adapted. The change uses the existing Horizon MIT implementation and the public Khronos language specification. The tests are original synthetic GLSL, not excerpts from a shader pack. No Iris, OptiFine or Sodium implementation source was used for this fix.

Self-check

pr_ready (tools/pr_ready.py --base upstream/main on homepc, against upstream/main at d02dd55ae, 3 min 8 s)

Check Result
Scope ✅ 1 files, +86 −5
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 515 passed (35 s)
rustfmt ✅ (8 s)
clippy ✅ (2 min 10 s)
tests: horizon-shaders ✅ 96 passed (15 s)
doc tests ✅ 0 passed
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (no vanilla data here): 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)

The public-tree history check also passes. Vanilla harnesses were not run locally because this isolated checkout has no prepared vanilla data; the self-check reports that explicitly. No game was launched and no player instance was changed. These are metadata/compiler checks, not a visual-parity or performance result.

🤖 Generated with Codex


🔄 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/5968 **Author:** [@gigamans442](https://github.com/gigamans442) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/compute-dispatch-splats` --- ### 📝 Commits (2) - [`f73179c`](https://github.com/horizon-rust/horizon/commit/f73179c3f139a47e2dd25afc034a01907a3b8610) Fix scalar vector constants in shader compute dispatch - [`4078411`](https://github.com/horizon-rust/horizon/commit/4078411d224ef4fe42fe7383e2ed86610be4eefc) Keep compute dispatch splats limited to scalar literals ### 📊 Changes **1 file changed** (+86 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-shaders/src/translate/mod.rs` (+86 -5) </details> ### 📄 Description > 🤖 Opened by gigamans442's AI agent (Codex, GPT-6), not by gigamans442 personally. ## What and why Fixes #5956. The compute-dispatch metadata reader counts the one literal in `ivec3(1)` as one component and rejects the program. It now fills the vector's declared components when the constructor has one non-negative scalar literal. Unsupported negative/nested expressions keep their previous rejection instead of being guessed from a numeric token. Explicit component lists keep their existing values/order, and absent dispatch metadata keeps its defaults. Two original synthetic regressions and a rejection control cover absolute splats (`ivec3(1)` and `ivec3(2)`), relative 2D/3D splats, explicit lists and undeclared defaults. Both new regressions fail on the unmodified translator; all 96 shader unit tests pass with this fix. No shader-pack source or renderer behavior is replaced. ## Kind - [ ] parity: Horizon now does what vanilla 26.3 does - [x] 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 Not vanilla gameplay: standard-pack `workGroups` / `workGroupsRender` metadata and [GLSL 4.60 §5.4.2, vector constructors](https://registry.khronos.org/OpenGL/specs/gl/GLSLangSpec.4.60.pdf). The expected components come from the language definition. This does not claim to fix shadow/cloud artifacts or add compute support generally. ## Other projects' code None copied or adapted. The change uses the existing Horizon MIT implementation and the public Khronos language specification. The tests are original synthetic GLSL, not excerpts from a shader pack. No Iris, OptiFine or Sodium implementation source was used for this fix. ## Self-check **pr_ready** (`tools/pr_ready.py --base upstream/main` on homepc, against upstream/main at d02dd55ae, 3 min 8 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +86 −5 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 515 passed (35 s) | | rustfmt | ✅ (8 s) | | clippy | ✅ (2 min 10 s) | | tests: horizon-shaders | ✅ 96 passed (15 s) | | doc tests | ✅ 0 passed | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (no vanilla data here): 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) | The public-tree history check also passes. Vanilla harnesses were not run locally because this isolated checkout has no prepared vanilla data; the self-check reports that explicitly. No game was launched and no player instance was changed. These are metadata/compiler checks, not a visual-parity or performance result. 🤖 Generated with [Codex](https://openai.com/codex/) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:23:26 +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#6586
No description provided.