[PR #7798] Shader packs: rebind replaced world colour/depth views #7829

Open
opened 2026-11-03 07:24:59 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7798
Author: @gigamans442
Created: 11/2/2026
Status: 🔄 Open

Base: main ← Head: fix/world-target-view-identity-20261102


📝 Commits (2)

  • a61029e Shader packs: refresh replaced world colour and depth bindings
  • 9594213 Tests: read world-target pixels with fixed-size chunks

📊 Changes

2 files changed (+382 additions, -4 deletions)

View changed files

📝 crates/horizon-client-render/src/gfx/pack_post.rs (+11 -4)
➕ crates/horizon-client-render/src/gfx/pack_post/world_target_tests.rs (+371 -0)

📄 Description

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

What and why

Fixes #7744.

After a loading/title frame releases the world target, the renderer can recreate its colour/depth textures at the same dimensions. PackPost::run previously reused the old input bind group because its key contained only the dimensions, leaving the pack reading an old frame. Cache the actual colour and depth views so either replacement refreshes the bindings.

The production change is +8/-4 lines in the existing cache. Original offscreen GPU regressions run the production PackPost::run, compare current inputs against a fresh PackPost, and independently check known colour/depth pixels. They cover colour-only, depth-only and combined replacement, retained-view content updates, resize, and the no-final fallback.

This addresses source-view lifetime rather than outline program routing. #7698 remains a separate change; no new material/entity path or cache optimization is included.

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

Horizon-only shader-pack renderer resource lifetime; no gameplay rule or vanilla algorithm changes. The original GPU tests check the actual colour/depth outputs and the existing reverse-Z to GL-depth convention.

Other projects' code

None in this change. The production hunk was developed in a private branch of MIT Horizon and extracted onto public history; the fixtures are original synthetic GLSL and generated GPU inputs, with the frame-construction helper from Horizon's existing MIT tests. Earlier broader private shader work included third-party pack research, so this PR does not claim that broader history was clean-room. No third-party shader implementation, pack assets, game resources, worlds or player media are included.

Self-check

Focused original GPU tests on Intel Arc A770 / Vulkan: baseline 2 passed / 4 failed on stale pixels; fixed 6 passed / 0 failed. Colour-only, depth-only, combined and no-final replacement cases fail before the fix; retained-view contents and resize controls pass in both versions. Every fresh-reference output also matches independently specified colour/depth values.

The full local self-check exits nonzero only on these two unchanged frame-generation interpolation assertions on the recorded Intel Arc A770 / Vulkan setup:

  • gfx::frame_gen::interpolation::tests::moves_the_view_halfway_with_the_camera
  • gfx::frame_gen::interpolation::tests::moves_what_has_its_own_motion_vectors_halfway

Both were independently reproduced on public base bc761767d35d4fdc1f4b1144fa8ab75168ed4d14 with the cache fix removed: one optical-flow control passes and the two assertions fail with the same numeric values. The framegen source and Cargo.lock blobs match that public base. This is an observed baseline on this backend, not a claim that every upstream test environment fails. No unrelated tests are weakened or skipped. The final six original cache regressions all pass; formatting, workspace/server Clippy, 614 Python tests, public tree/history and doc checks pass.

pr_ready (tools/pr_ready.py on homepc, against origin/main at bc761767d, 7 min 48 s)

Check Result
Scope ✅ 2 files, +382 −4
Cargo.lock ✅ unchanged
Public tree ✅ (1 s)
Python tests ✅ 614 passed (1 min 5 s)
rustfmt ✅ (15 s)
clippy ✅ (4 min 32 s)
tests: horizon-client-render ❌ 1175 passed, 2 failed (1 min 52 s)
doc tests ✅ 0 passed (3 s)
content root tests ➖ content root untouched
mod API up to date ➖ native hooks 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)

Required GitHub verify and the launcher scope check passed on head 95942138f7aa19ccee4904abcd739d40da53fef8 (checks run). The launcher build/tests were skipped because their paths are untouched. Maintainer-gated parity and vanilla-parity did not run under the fork policy and remain pending maintainer review; they are not counted as passes.

Synthetic output

Original offscreen GPU inputs encode independently specified RG colour values and GL window depth in blue. Replacing only colour, only depth, both views, or colour without a final pass retains old pixels before this fix; every fixed output matches a fresh-binding reference. Retained-view contents and resize controls pass in both versions. No game resources or player imagery are used.

The GPU fixtures do not establish gameplay death/respawn acceptance, real-pack visual parity, FPS, or every graphics backend. No player game was launched.

🤖 Generated with OpenAI 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/7798 **Author:** [@gigamans442](https://github.com/gigamans442) **Created:** 11/2/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/world-target-view-identity-20261102` --- ### 📝 Commits (2) - [`a61029e`](https://github.com/horizon-rust/horizon/commit/a61029e052519d6f6d029b6026f4b8c38c05eed1) Shader packs: refresh replaced world colour and depth bindings - [`9594213`](https://github.com/horizon-rust/horizon/commit/95942138f7aa19ccee4904abcd739d40da53fef8) Tests: read world-target pixels with fixed-size chunks ### 📊 Changes **2 files changed** (+382 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/gfx/pack_post.rs` (+11 -4) ➕ `crates/horizon-client-render/src/gfx/pack_post/world_target_tests.rs` (+371 -0) </details> ### 📄 Description > 🤖 Opened by gigamans442's AI agent (OpenAI Codex, GPT-6.1 Sol), not by gigamans442 personally. ## What and why Fixes #7744. After a loading/title frame releases the world target, the renderer can recreate its colour/depth textures at the same dimensions. `PackPost::run` previously reused the old input bind group because its key contained only the dimensions, leaving the pack reading an old frame. Cache the actual colour and depth views so either replacement refreshes the bindings. The production change is +8/-4 lines in the existing cache. Original offscreen GPU regressions run the production `PackPost::run`, compare current inputs against a fresh `PackPost`, and independently check known colour/depth pixels. They cover colour-only, depth-only and combined replacement, retained-view content updates, resize, and the no-`final` fallback. This addresses source-view lifetime rather than outline program routing. #7698 remains a separate change; no new material/entity path or cache optimization is included. ## 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 Horizon-only shader-pack renderer resource lifetime; no gameplay rule or vanilla algorithm changes. The original GPU tests check the actual colour/depth outputs and the existing reverse-Z to GL-depth convention. ## Other projects' code None in this change. The production hunk was developed in a private branch of MIT Horizon and extracted onto public history; the fixtures are original synthetic GLSL and generated GPU inputs, with the frame-construction helper from Horizon's existing MIT tests. Earlier broader private shader work included third-party pack research, so this PR does not claim that broader history was clean-room. No third-party shader implementation, pack assets, game resources, worlds or player media are included. ## Self-check Focused original GPU tests on Intel Arc A770 / Vulkan: **baseline 2 passed / 4 failed on stale pixels; fixed 6 passed / 0 failed**. Colour-only, depth-only, combined and no-final replacement cases fail before the fix; retained-view contents and resize controls pass in both versions. Every fresh-reference output also matches independently specified colour/depth values. The full local self-check exits nonzero only on these two unchanged frame-generation interpolation assertions on the recorded Intel Arc A770 / Vulkan setup: - `gfx::frame_gen::interpolation::tests::moves_the_view_halfway_with_the_camera` - `gfx::frame_gen::interpolation::tests::moves_what_has_its_own_motion_vectors_halfway` Both were independently reproduced on public base `bc761767d35d4fdc1f4b1144fa8ab75168ed4d14` with the cache fix removed: one optical-flow control passes and the two assertions fail with the same numeric values. The framegen source and Cargo.lock blobs match that public base. This is an observed baseline on this backend, not a claim that every upstream test environment fails. No unrelated tests are weakened or skipped. The final six original cache regressions all pass; formatting, workspace/server Clippy, 614 Python tests, public tree/history and doc checks pass. **pr_ready** (`tools/pr_ready.py` on homepc, against origin/main at bc761767d, 7 min 48 s) | Check | Result | | --- | --- | | Scope | ✅ 2 files, +382 −4 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ (1 s) | | Python tests | ✅ 614 passed (1 min 5 s) | | rustfmt | ✅ (15 s) | | clippy | ✅ (4 min 32 s) | | tests: horizon-client-render | ❌ 1175 passed, 2 failed (1 min 52 s) | | doc tests | ✅ 0 passed (3 s) | | content root tests | ➖ content root untouched | | mod API up to date | ➖ native hooks 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) | Required GitHub `verify` and the launcher scope check passed on head `95942138f7aa19ccee4904abcd739d40da53fef8` ([checks run](https://github.com/horizon-rust/horizon/actions/runs/41524689667)). The launcher build/tests were skipped because their paths are untouched. Maintainer-gated parity and vanilla-parity did not run under the fork policy and remain pending maintainer review; they are not counted as passes. ## Synthetic output Original offscreen GPU inputs encode independently specified RG colour values and GL window depth in blue. Replacing only colour, only depth, both views, or colour without a `final` pass retains old pixels before this fix; every fixed output matches a fresh-binding reference. Retained-view contents and resize controls pass in both versions. No game resources or player imagery are used. The GPU fixtures do not establish gameplay death/respawn acceptance, real-pack visual parity, FPS, or every graphics backend. No player game was launched. 🤖 Generated with [OpenAI Codex](https://openai.com/codex/) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#7829
No description provided.