Translate tiled cascade shadows exactly on wave32 GPUs #82

Manually merged
github merged 1 commit from github-bot/gh-82 into main 2026-11-26 08:21:45 +00:00 AGit
Owner

@⁠sawetco on GitHub · 2026-11-26 02:32 UTC · original
sawetco:nvidia-exact-cascade-shadows → main · +332 −30 · 2 files · 1 commits · merged 2026-11-26 08:17 UTC

This ports Bruno Magalhães's exact cascade-shadow lowering to the current AvatarManz tree. On an RTX 5070, all four cascade programs already emitted valid DXIL on this fork, but their final translation used the approximate per-half wave fallback. With this change they take the exact deep-skip form. Original PR and author

The change recognizes the far-jump form of an early exit and follows scalar copies through joins where every incoming value resolves to the same source. This fork already tracks lifetimes of register pairs parked in lanes. Its existing implementation passes the upstream pairing tests. The change is limited to the IR and the handwritten regression fixtures.

Verification

  • Clean tree at e2a28ec plus this commit, Windows SDK 10.0.26100 and RTX 5070 12 GB, driver 621.24. cargo test --profile diag --locked --offline -p victory-shader --lib -- --test-threads=1 passed 284 tests with four ignored. The gate fixture ran on the physical GPU and checked both halves of each console wave.
  • On the local Series X graphics build, 20b78ee12ecdb57d, ce79e9eba7ae0348, fa0bd10a35bfef3c and f133e35efed2a48a all changed from an approximate per-half form to the exact form that follows scalar copies. The SDK validator accepted all four emitted compute programs.

Gameplay scope

On a separate build carrying #10 and #48, I compared the same 1440p porch camera and 30-second walk at Jason's house. Both starts used the same 251,292,264-byte driver library and independently translated the same 1,352 inputs. The house, character and water appeared in both. FPS was 3.80 before and 3.83 after, with 678 ms and 644 ms p95 respectively. Each setting was measured once. The stepped sunlight on the shirt and railing remained visible in this scene.

Four additional compute programs (2cc4c197ee29e291, 369cbe906ea72764, 02384a60fda6f2d0, 2da4beb386509b77) passed DXIL validation but failed D3D12 compute pipeline creation on the AvatarManz build. As a separate control on the same GPU and inputs, the paired-wave integration built all four real D3D12 PSOs. That is a separate set of shader changes. RTX 3060 comparison and integrated commit

Follow-up on the RTX 5070

I measured the remaining edge on Jason's sunlit shirt in two window captures, each 960 pixels wide. At a verified 1920×1080 scene and presentation size, the edge jumped 8 capture pixels between successive plateaus. At 2560×1440 it jumped a median of 6. Both correspond to about 16 native pixels. The position held for several consecutive scanlines at a time. This gives us a repeatable check across resolutions, even when the driver accepts the four cascade programs above.

I also ran the paired-wave integration in the game at both resolutions on the same GPU. The driver created all four compute pipelines listed above and two additional ones that the Avatar renderer refused, 5dc3b25986622949 and 6f225b641c5b0708. All six were requested in the scene. At Jason's porch this integration still left the face and veranda in silhouette, so I could not verify the prison scene's reported visual improvement at this checkpoint. The 1080p walk averaged 1.67 FPS with 1,070 ms p95. The PR10/#48 lighting build with this change showed the face and water reflections at 4.00 FPS with 634 ms p95 on that walk. These are different renderer configurations and one measured walk each.

AI-assisted with Codex.

**@⁠sawetco** on GitHub · 2026-11-26 02:32 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/82) `sawetco:nvidia-exact-cascade-shadows` → `main` · +332 −30 · 2 files · 1 commits · merged 2026-11-26 08:17 UTC This ports Bruno Magalhães's exact cascade-shadow lowering to the current AvatarManz tree. On an RTX 5070, all four cascade programs already emitted valid DXIL on this fork, but their final translation used the approximate per-half wave fallback. With this change they take the exact deep-skip form. [Original PR and author](https://github.com/fxceless/victory-fork/pull/1002) The change recognizes the far-jump form of an early exit and follows scalar copies through joins where every incoming value resolves to the same source. This fork already tracks lifetimes of register pairs parked in lanes. Its existing implementation passes the upstream pairing tests. The change is limited to the IR and the handwritten regression fixtures. ### Verification - Clean tree at `e2a28ec` plus this commit, Windows SDK 10.0.26100 and RTX 5070 12 GB, driver 621.24. `cargo test --profile diag --locked --offline -p victory-shader --lib -- --test-threads=1` passed 284 tests with four ignored. The gate fixture ran on the physical GPU and checked both halves of each console wave. - On the local Series X graphics build, `20b78ee12ecdb57d`, `ce79e9eba7ae0348`, `fa0bd10a35bfef3c` and `f133e35efed2a48a` all changed from an approximate per-half form to the exact form that follows scalar copies. The SDK validator accepted all four emitted compute programs. ### Gameplay scope On a separate build carrying #10 and #48, I compared the same 1440p porch camera and 30-second walk at Jason's house. Both starts used the same 251,292,264-byte driver library and independently translated the same 1,352 inputs. The house, character and water appeared in both. FPS was 3.80 before and 3.83 after, with 678 ms and 644 ms p95 respectively. Each setting was measured once. The stepped sunlight on the shirt and railing remained visible in this scene. Four additional compute programs (`2cc4c197ee29e291`, `369cbe906ea72764`, `02384a60fda6f2d0`, `2da4beb386509b77`) passed DXIL validation but failed D3D12 compute pipeline creation on the AvatarManz build. As a separate control on the same GPU and inputs, the paired-wave integration built all four real D3D12 PSOs. That is a separate set of shader changes. [RTX 3060 comparison and integrated commit](https://github.com/fxceless/victory-fork/pull/1002#issuecomment-7172865868) ### Follow-up on the RTX 5070 I measured the remaining edge on Jason's sunlit shirt in two window captures, each 960 pixels wide. At a verified 1920×1080 scene and presentation size, the edge jumped 8 capture pixels between successive plateaus. At 2560×1440 it jumped a median of 6. Both correspond to about 16 native pixels. The position held for several consecutive scanlines at a time. This gives us a repeatable check across resolutions, even when the driver accepts the four cascade programs above. I also ran the paired-wave integration in the game at both resolutions on the same GPU. The driver created all four compute pipelines listed above and two additional ones that the Avatar renderer refused, `5dc3b25986622949` and `6f225b641c5b0708`. All six were requested in the scene. At Jason's porch this integration still left the face and veranda in silhouette, so I could not verify the prison scene's reported visual improvement at this checkpoint. The 1080p walk averaged 1.67 FPS with 1,070 ms p95. The PR10/#48 lighting build with this change showed the face and water reflections at 4.00 FPS with 634 ms p95 on that walk. These are different renderer configurations and one measured walk each. AI-assisted with Codex.
Adapt the far early-out and deep scalar-copy parts of fxceless/victory-fork#1002. This tree already tracks parked scalar pairs by lifetime. Retain that implementation and bring across the synthetic regressions, including the hardware gate.

Adapted from eaeb8f173a

Co-authored-by: Bruno Magalhães <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:31:52 +00:00
Author
Owner

@⁠avatarmanz on GitHub · 2026-11-26 07:56 UTC · original

Merged into main in the next push (tests pass); thanks.

**@⁠avatarmanz** on GitHub · 2026-11-26 07:56 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/82#issuecomment-7185999473) Merged into main in the next push (tests pass); thanks.
github manually merged commit 0cb13721b2 into main 2026-11-26 08:21:45 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.