[PR #7831] Shader packs: preserve depth snapshot timing and stage demand #7848

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

📋 Pull Request Information

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

Base: main ← Head: fix/shader-depth-snapshots-20261102


📝 Commits (1)

  • 58e5884 Fix shader depth snapshot timing and demand

📊 Changes

2 files changed (+697 additions, -37 deletions)

View changed files

📝 crates/horizon-client-render/src/gfx/pack_post.rs (+60 -37)
➕ crates/horizon-client-render/src/gfx/pack_post/depth_test.rs (+637 -0)

📄 Description

🤖 Opened by gigamans442's AI agent (Codex, gpt-6.1-sol), not by gigamans442 personally.

What and why

Fixes #7815.

Keep standard-pack depth snapshots distinct around the pack-drawn opaque hand, serve Deferred post readers, and include each post program's attached compute stages in depth demand. Depth2 copies before the pack-drawn opaque first-person hand; depth1 copies after it and before translucent terrain. A depth2-only reader without a pack hand program still requests the shared opaque copy. Deferred post readers use the available snapshots, and attached compute stages participate in both snapshot and world-depth demand.

Original GPU fixtures on Intel Arc A770/Vulkan demonstrate both failures on the unchanged baseline. With authored opaque/hand/water depths .7/.2/.4, the old depth0/1/2 result is (.2,.7,.7) instead of (.2,.2,.7); without a hand, an exclusive depth2 reader gets water depth .4 instead of opaque .7. Independent opaque, water and depth1-only controls pass. Raw and opaque-transformed original packs give identical results.

Valid supplemental GPU cases also demonstrate Deferred-only depth2 returning hand depth .2 instead of .7, attached/earlier-child compute depth0 returning zero instead of world depth .7, and child-only depth1/2 readers returning water depth .4 instead of .7. Direct-fragment, standalone-compute and Deferred depth1 hand-presence controls pass; every intended pipeline built and all 9 cases emitted sampled pixels.

A water-only program still runs the opaque snapshot phase when copies are requested. Its original all-depth read produces (.4,0,0) instead of (.4,.7,.7), demonstrating that allocated copies were never populated. The focused depth contracts pass at the published head, and supported line/depth overlap validation passes on the separately pinned combined stack below.

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
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

Standard shader-pack format behavior, specified by the public DepthTex documentation. These shader-pack inputs are not a vanilla 26.3 feature; no vanilla implementation was used. Original fixed-depth geometry and independently seeded world depth provide expected pixel values.

Other projects' code

None. Original implementation and fixtures use Horizon's MIT source/APIs plus public format documentation. The external translator was run only as an opaque program on original diagnostic packs; no translator implementation, Iris implementation, restricted pack source or player assets were read or copied.

Self-check

Passed on exact published 58e588454: all 13 original GPU cases on Intel Arc A770 / Mesa26.2.4 / Vulkan, with 0 wrong pixels out of 3,328 sampled (one RGBA8 code value tolerance). The committed-head focused build, changed-file rustfmt, git diff --check, public-tree check and full history audit also pass.

GitHub verification, launcher, labeling and overlap-note checks pass at the same published head; parity checks are skipped. The completed local full self-check exited 1: 614 Python tests, workspace rustfmt, Clippy and doc tests pass; renderer tests report 1,182 passed, 2 failed and 38 ignored.

The two failures are gfx::frame_gen::interpolation::tests::moves_the_view_halfway_with_the_camera and moves_what_has_its_own_motion_vectors_halfway. They match the existing public-baseline failures at bc761767d, including the exact numeric diagnostics. All gfx source and the renderer manifest are unchanged between that baseline and this PR base 0bcd2f156; lockfile changes only add the unrelated cosmetics workspace package and cosmetic-mod ZIP dependency. This PR changes only pack_post.rs and its depth tests. The full check remains recorded as failed; no unrelated interpolation test or implementation was altered.

pr_ready (tools/pr_ready.py on homepc, against origin/main at 0bcd2f156, 8 min 53 s)

Check Result
Scope ⚠️ 2 files, +697 −37; 734 lines of code: over 500, split it if it can ship in parts
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 614 passed (45 s)
rustfmt ✅ (10 s)
clippy ✅ (4 min 30 s)
tests: horizon-client-render ❌ 1182 passed, 2 failed (3 min 25 s)
doc tests ✅ 0 passed (2 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)

Combined source 1936f5d16 containing #7698 at db561750 and this PR at 58e588454 also passes all 13 original depth GPU cases on Arc A770/Vulkan (0 wrong of 3,328 sampled pixels). Its full 16-test diagnostic run exited 101: three added early-line tests expected live depth sampling, while existing bindings map geometry Depth and Gbuffers Depth1/Depth2 to Dummy. The earlier live-depth assumption was incorrect; those failures are preserved as unsupported diagnostics, not a combined-suite pass or depth snapshot regression. No production behavior or expected pixel was changed to make that diagnostic pass.

Supported overlap validation passes on the separate combined stack 925b6ce10c92894b5f3a58d509ac65948d066a5b: 16 actual Arc A770/Vulkan tests, no adapter skips. All 13 original depth cases have 0 wrong of 3,328 pixels; three new supported line controls have 0 wrong of 584 pixels over six frames. These cover authored line color through colortex/final routing, empty/present lifecycle, world-depth blit, no unnecessary late snapshot allocation, and distinct late hand snapshots. The old three unsupported early-depth diagnostics remain preserved and excluded from this supported suite. This proves the stated contracts on 925b6ce10; final global-stack validation is separate and pending, and named-pack/gameplay parity is not claimed.

Baseline evidence uses actual sampled 16x16 pixels with one RGBA8 code value tolerance. It establishes synthetic depth contracts; named-pack visual behavior and performance remain untested.

Screenshots

Original synthetic pixel readback is described above. In-game before/after screenshots have not been captured.

🤖 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/7831 **Author:** [@gigamans442](https://github.com/gigamans442) **Created:** 11/2/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/shader-depth-snapshots-20261102` --- ### 📝 Commits (1) - [`58e5884`](https://github.com/horizon-rust/horizon/commit/58e588454744841798291ec9528aa7ba88f8698f) Fix shader depth snapshot timing and demand ### 📊 Changes **2 files changed** (+697 additions, -37 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/gfx/pack_post.rs` (+60 -37) ➕ `crates/horizon-client-render/src/gfx/pack_post/depth_test.rs` (+637 -0) </details> ### 📄 Description > 🤖 Opened by gigamans442's AI agent (Codex, gpt-6.1-sol), not by gigamans442 personally. ## What and why Fixes #7815. Keep standard-pack depth snapshots distinct around the pack-drawn opaque hand, serve Deferred post readers, and include each post program's attached compute stages in depth demand. Depth2 copies before the pack-drawn opaque first-person hand; depth1 copies after it and before translucent terrain. A depth2-only reader without a pack hand program still requests the shared opaque copy. Deferred post readers use the available snapshots, and attached compute stages participate in both snapshot and world-depth demand. Original GPU fixtures on Intel Arc A770/Vulkan demonstrate both failures on the unchanged baseline. With authored opaque/hand/water depths .7/.2/.4, the old depth0/1/2 result is (.2,.7,.7) instead of (.2,.2,.7); without a hand, an exclusive depth2 reader gets water depth .4 instead of opaque .7. Independent opaque, water and depth1-only controls pass. Raw and opaque-transformed original packs give identical results. Valid supplemental GPU cases also demonstrate Deferred-only depth2 returning hand depth .2 instead of .7, attached/earlier-child compute depth0 returning zero instead of world depth .7, and child-only depth1/2 readers returning water depth .4 instead of .7. Direct-fragment, standalone-compute and Deferred depth1 hand-presence controls pass; every intended pipeline built and all 9 cases emitted sampled pixels. A water-only program still runs the opaque snapshot phase when copies are requested. Its original all-depth read produces (.4,0,0) instead of (.4,.7,.7), demonstrating that allocated copies were never populated. The focused depth contracts pass at the published head, and supported line/depth overlap validation passes on the separately pinned combined stack below. ## 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 - [ ] extra: Horizon-only, off by default - [ ] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference Standard shader-pack format behavior, specified by the public [DepthTex documentation](https://shaders.properties/current/reference/buffers/depthtex/). These shader-pack inputs are not a vanilla 26.3 feature; no vanilla implementation was used. Original fixed-depth geometry and independently seeded world depth provide expected pixel values. ## Other projects' code None. Original implementation and fixtures use Horizon's MIT source/APIs plus public format documentation. The external translator was run only as an opaque program on original diagnostic packs; no translator implementation, Iris implementation, restricted pack source or player assets were read or copied. ## Self-check Passed on exact published `58e588454`: all 13 original GPU cases on Intel Arc A770 / Mesa26.2.4 / Vulkan, with 0 wrong pixels out of 3,328 sampled (one RGBA8 code value tolerance). The committed-head focused build, changed-file rustfmt, `git diff --check`, public-tree check and full history audit also pass. GitHub verification, launcher, labeling and overlap-note checks pass at the same published head; parity checks are skipped. The completed local full self-check exited 1: 614 Python tests, workspace rustfmt, Clippy and doc tests pass; renderer tests report 1,182 passed, 2 failed and 38 ignored. The two failures are `gfx::frame_gen::interpolation::tests::moves_the_view_halfway_with_the_camera` and `moves_what_has_its_own_motion_vectors_halfway`. They match the existing public-baseline failures at `bc761767d`, including the exact numeric diagnostics. All `gfx` source and the renderer manifest are unchanged between that baseline and this PR base `0bcd2f156`; lockfile changes only add the unrelated cosmetics workspace package and cosmetic-mod ZIP dependency. This PR changes only `pack_post.rs` and its depth tests. The full check remains recorded as failed; no unrelated interpolation test or implementation was altered. **pr_ready** (`tools/pr_ready.py` on homepc, against origin/main at 0bcd2f156, 8 min 53 s) | Check | Result | | --- | --- | | Scope | ⚠️ 2 files, +697 −37; 734 lines of code: over 500, split it if it can ship in parts | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 614 passed (45 s) | | rustfmt | ✅ (10 s) | | clippy | ✅ (4 min 30 s) | | tests: horizon-client-render | ❌ 1182 passed, 2 failed (3 min 25 s) | | doc tests | ✅ 0 passed (2 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) | Combined source `1936f5d16` containing #7698 at `db561750` and this PR at `58e588454` also passes all 13 original depth GPU cases on Arc A770/Vulkan (0 wrong of 3,328 sampled pixels). Its full 16-test diagnostic run exited 101: three added early-line tests expected live depth sampling, while existing bindings map geometry `Depth` and Gbuffers `Depth1`/`Depth2` to `Dummy`. The earlier live-depth assumption was incorrect; those failures are preserved as unsupported diagnostics, not a combined-suite pass or depth snapshot regression. No production behavior or expected pixel was changed to make that diagnostic pass. Supported overlap validation passes on the separate combined stack `925b6ce10c92894b5f3a58d509ac65948d066a5b`: 16 actual Arc A770/Vulkan tests, no adapter skips. All 13 original depth cases have 0 wrong of 3,328 pixels; three new supported line controls have 0 wrong of 584 pixels over six frames. These cover authored line color through colortex/final routing, empty/present lifecycle, world-depth blit, no unnecessary late snapshot allocation, and distinct late hand snapshots. The old three unsupported early-depth diagnostics remain preserved and excluded from this supported suite. This proves the stated contracts on `925b6ce10`; final global-stack validation is separate and pending, and named-pack/gameplay parity is not claimed. Baseline evidence uses actual sampled 16x16 pixels with one RGBA8 code value tolerance. It establishes synthetic depth contracts; named-pack visual behavior and performance remain untested. ## Screenshots Original synthetic pixel readback is described above. In-game before/after screenshots have not been captured. 🤖 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>
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#7848
No description provided.