fix(shader): track constant s_mov_b32 identities in whole-wave reductions #155

Manually merged
github merged 1 commit from gh-pr/155/head into gh-pr/155/base 2026-11-27 00:51:44 +00:00
Owner

@⁠brainbudt on GitHub · 2026-11-26 21:51 UTC · original
brainbudt:fix/shader-wave-scalar-const-identity → main · +76 −2 · 3 files · 1 commits · merged 2026-11-26 22:39 UTC

Whole-wave reduction simulation in crates/victory-shader/src/emit/wave.rs previously refused scalar moves that load a compile-time constant identity (such as s_mov_b32 s6, INT_MAX before a signed-minimum v_cndmask_b32) with "a whole-wave section step the simulation does not follow: a scalar ALU result".

Changes

  • Track exact constant s_mov_b32 writes to an SGPR as Sym::K in wave::simulate (using the existing constant() helper so non-constant SGPR copies and special registers like vccz/execz/scc remain refused).
  • Add regression tests in crates/victory-shader/src/emit/gfx_refusal_tests.rs checking byte-identical DXIL against a direct literal operand (including with EXEC == 0 at the scalar move), plus negative cases for a wrong constant identity and a dynamic SGPR copy.
  • Document the scope in docs/native-host.md.

Verification

  • cargo test -p victory-shader (261 passed, 0 failed, 2 ignored)
  • cargo clippy -p victory-shader --all-targets --target x86_64-pc-windows-gnullvm -- -D warnings
  • cargo xtask policy (364 files ok)
**@⁠brainbudt** on GitHub · 2026-11-26 21:51 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/155) `brainbudt:fix/shader-wave-scalar-const-identity` → `main` · +76 −2 · 3 files · 1 commits · merged 2026-11-26 22:39 UTC Whole-wave reduction simulation in `crates/victory-shader/src/emit/wave.rs` previously refused scalar moves that load a compile-time constant identity (such as `s_mov_b32 s6, INT_MAX` before a signed-minimum `v_cndmask_b32`) with `"a whole-wave section step the simulation does not follow: a scalar ALU result"`. ## Changes - Track exact constant `s_mov_b32` writes to an SGPR as `Sym::K` in `wave::simulate` (using the existing `constant()` helper so non-constant SGPR copies and special registers like `vccz`/`execz`/`scc` remain refused). - Add regression tests in `crates/victory-shader/src/emit/gfx_refusal_tests.rs` checking byte-identical DXIL against a direct literal operand (including with `EXEC == 0` at the scalar move), plus negative cases for a wrong constant identity and a dynamic SGPR copy. - Document the scope in `docs/native-host.md`. ## Verification - `cargo test -p victory-shader` (261 passed, 0 failed, 2 ignored) - `cargo clippy -p victory-shader --all-targets --target x86_64-pc-windows-gnullvm -- -D warnings` - `cargo xtask policy` (364 files ok)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 00:51:43 +00:00
github manually merged commit 3872852d5b into gh-pr/155/base 2026-11-27 00:51:44 +00:00
Author
Owner

@⁠LakshanSivakumar on GitHub · 2026-11-26 22:39 UTC · original · approved these changes

Reviewed and tested together with the other open PRs on main (macOS x86_64 workspace tests, the setup shell tests, and Windows clippy). Thanks!

**@⁠LakshanSivakumar** on GitHub · 2026-11-26 22:39 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/155#pullrequestreview-6081188548) · **approved these changes** Reviewed and tested together with the other open PRs on main (macOS x86_64 workspace tests, the setup shell tests, and Windows clippy). Thanks!
This discussion has been locked. Commenting is limited to contributors.
No description provided.