victory-shader: guard float/f16_vals propagation on DPP and SDWA #38

Manually merged
github merged 1 commit from github-bot/gh-38 into main 2026-12-05 18:48:13 +00:00 AGit
Owner

@⁠ending3729 on GitHub · 2026-12-05 16:30 UTC · original
ending3729:fix/valu-dpp-sdwa-cache-propagation → main · +156 −2 · 4 files · 1 commits · merged 2026-12-05 18:46 UTC

Summary

  • Fix a ReVictory-RDNA3 regression where v_mov_b32 and v_cndmask_b32 propagated cached self.floats / self.f16_vals entries to dst whenever Self::sdwa_dst(inst).is_none(), missing both v.dpp.is_some() (DPP16/DPP8 lane permutations) and v.sdwa.is_some() with dst_sel:DWORD + src_sel != DWORD / sext != 0.
  • Downstream FP32 (fsrc) and native FP16 (half_of_operand) consumers then read the un-permuted / un-selected source cache instead of the lowered vals bits.
  • Add #[cfg(test)] TEST_NATIVE_FP16 thread-local toggle and 3 synthetic GFX10 compute shader regression tests in valu_tests.rs covering v_mov_b32_dpp, v_mov_b32_sdwa (dst_sel:DWORD, src0_sel:WORD_1), v_cndmask_b32_sdwa, and v_cndmask_b32_dpp.
Check Scope Result
cargo test -p victory-shader --locked -- emit::valu_tests Default + TEST_NATIVE_FP16 39 passed, 0 failed, 1 pre-existing ignored (RX 6600 XT + WARP)
VICTORY_NATIVE_FP16=1 cargo test -p victory-shader --locked -- emit::valu_tests Native FP16 enabled 39 passed, 0 failed, 1 pre-existing ignored
cargo clippy -p victory-shader --no-deps --all-targets --locked -- -D warnings Default + --all-features Passed (0 warnings)
cargo xtask policy Asset policy Passed (432 files ok)
Notes on pre-existing main CI items (not touched)
  • cargo clippy -p victory-shader --all-targets --locked -- -D warnings (with deps) hits pre-existing manual_range_patterns in crates/victory-dxil/src/bitcode/opt.rs:1919 (covered by open PR #25).
  • Full cargo test -p victory-shader --locked reports 318 passed, 1 failed (emit::isa_tests::single_instructions_give_what_rdna2_gives on WARP, also covered by open PR #25).
  • No game dump or retail assets were used; all new tests are synthetic GFX10 compute shaders validated with dxil.dll and executed on local RX 6600 XT / WARP.

AI-assisted: yes

**@⁠ending3729** on GitHub · 2026-12-05 16:30 UTC · [original](https://github.com/VGLALALA/ReVictory-RDNA3/pull/38) `ending3729:fix/valu-dpp-sdwa-cache-propagation` → `main` · +156 −2 · 4 files · 1 commits · merged 2026-12-05 18:46 UTC ## Summary - Fix a `ReVictory-RDNA3` regression where `v_mov_b32` and `v_cndmask_b32` propagated cached `self.floats` / `self.f16_vals` entries to `dst` whenever `Self::sdwa_dst(inst).is_none()`, missing both `v.dpp.is_some()` (DPP16/DPP8 lane permutations) and `v.sdwa.is_some()` with `dst_sel:DWORD` + `src_sel != DWORD` / `sext != 0`. - Downstream FP32 (`fsrc`) and native FP16 (`half_of_operand`) consumers then read the un-permuted / un-selected source cache instead of the lowered `vals` bits. - Add `#[cfg(test)]` `TEST_NATIVE_FP16` thread-local toggle and 3 synthetic GFX10 compute shader regression tests in `valu_tests.rs` covering `v_mov_b32_dpp`, `v_mov_b32_sdwa` (`dst_sel:DWORD`, `src0_sel:WORD_1`), `v_cndmask_b32_sdwa`, and `v_cndmask_b32_dpp`. | Check | Scope | Result | |---|---|---| | `cargo test -p victory-shader --locked -- emit::valu_tests` | Default + `TEST_NATIVE_FP16` | 39 passed, 0 failed, 1 pre-existing ignored (RX 6600 XT + WARP) | | `VICTORY_NATIVE_FP16=1 cargo test -p victory-shader --locked -- emit::valu_tests` | Native FP16 enabled | 39 passed, 0 failed, 1 pre-existing ignored | | `cargo clippy -p victory-shader --no-deps --all-targets --locked -- -D warnings` | Default + `--all-features` | Passed (0 warnings) | | `cargo xtask policy` | Asset policy | Passed (`432 files ok`) | <details> <summary>Notes on pre-existing main CI items (not touched)</summary> - `cargo clippy -p victory-shader --all-targets --locked -- -D warnings` (with deps) hits pre-existing `manual_range_patterns` in `crates/victory-dxil/src/bitcode/opt.rs:1919` (covered by open PR #25). - Full `cargo test -p victory-shader --locked` reports 318 passed, 1 failed (`emit::isa_tests::single_instructions_give_what_rdna2_gives` on WARP, also covered by open PR #25). - No game dump or retail assets were used; all new tests are synthetic GFX10 compute shaders validated with `dxil.dll` and executed on local RX 6600 XT / WARP. </details> AI-assisted: yes
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-05 16:31:51 +00:00
github manually merged commit 6803bf4096 into main 2026-12-05 18:48:13 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.