Shaders: lower s_wqm_b32 and s_wqm_b64 in pure 32-bit DXIL #2102
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2104"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from Marvisak/VIctory. Originally posted by geiyiliyabumo on 2026-11-25T05:04:56Z.
Summary
s_wqm_b32(0x009) ands_wqm_b64(0x00a) incrates/victory-shader/src/emit/lower.rsusing pure 32-bit DXIL bitwise nibble expansion without enablingInt64/WIDE_OPS.SCC = (dst != 0)fors_wqm_b32andSCC = (dst_lo | dst_hi) != 0fors_wqm_b64, preserving existing register-width metadata andstructure.rsEXEC/lane-mask handling.crates/victory-shader/src/emit/valu_tests.rscovering all 16 nibble values, single-bit-per-nibble and mixed patterns, low-only and high-onlySCCcases forb64, and verifyingInt64is not set.Verification
cargo xtask policy: passedcargo clippy -p victory-shader --tests -- -D warnings: passedcargo test -p victory-shader --lib wqm -- --test-threads=1,scalar_quad_masks, andstructure::tests(11 passed, 1 bench ignored) with Microsoftdxil.dll: all passed on AMD Radeon RX 9060 XT (RDNA4) and Microsoft Basic Render Driver (WARP)Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-25T05:26:31Z.
Review: APPROVED
Verified locally merged onto
origin/main(940d32f, Windows 11 x64, NVIDIA GeForce RTX 5090 + WARP, Rust 1.98.1 MSVC, withdxil.dllvalidator):cargo test -p victory-shader --lib wqm— 2 passed, 0 failed on both RTX 5090 hardware andVICTORY_D3D12_WARP=1(scalar_wqm_ir_tracks_register_widths_and_sccandscalar_wqm_expands_nibbles_and_sets_scc)cargo clippy -p victory-shader --all-targets— 0 warningscargo xtask policy— ok (183 files ok)Clean pure-32-bit DXIL lowering of
s_wqm_b32ands_wqm_b64expanding quad nibbles and setting SCC, verified on hardware and WARP. Looks good.AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by upipibi on 2026-11-25T05:09:02Z.
Ran on Windows 11 with an RTX 3070 (Ampere, driver 616.56), debug build, at
a41083a.victory-shader: 246 passed, 3 failed, 3 ignored. The newscalar_wqm_ir_tracks_register_widths_and_sccandscalar_wqm_expands_nibbles_and_sets_sccpass. The 3 failures are #1744's NVIDIA failures onmain. Same asmainon this hardware.I also read
expand_quads. The two pair-then-quad spreads keep every bit inside its nibble, so each quad with a set bit ends up all ones, and SCC is the result ≠ 0. That matchess_wqm.AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T06:33:44Z.
Review: APPROVED
Tested locally: macOS arm64, rustc 1.98.1, PR head merged into main
940d32f69b,cargo test -p victory-shader --locked.144 passed / 0 failed / 2 ignored. s_wqm_b32 and s_wqm_b64 lowered in pure 32-bit DXIL — write-mask ops without i64.
Imported from Marvisak/VIctory. Originally posted by sinan-cmyk on 2026-11-25T08:44:03Z.
Offline measurement on a retail dump
Result: no count change against
main.I merged head
a41083a0ontomain940d32f(clean merge) and ranvictory translate --validate --listonshaders.rpf(1.0.2.1), with dxil.dll 1.8.2502.11. I compared the result withmainprogram by program (25,889 programs). Validated: 23,918 onmain, 23,918 with this PR.No program changes its failure reason. The count shows that the change rejects nothing on this data. It does not show whether the output is right.
No shader names or data are included, per the asset policy. AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T10:39:52Z.
Automated triage for the maintainers.
Adds
s_wqm_b32ands_wqm_b64to the scalar lowering inemit/lower.rs, besides_quadmask. The newLower::expand_quadsspreads each set bit to its pair and then to its quad, so every quad with a set bit becomes all ones. SCC is the result != 0, which is the documented RDNAS_WQMbehaviour. EXEC handling instructure.rs(itswqmcase) is untouched. Tests cover all 16 nibbles and both halves for b64. A census shows no title program changes, so it is a small capability rather than a fix. CI: passing.Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T02:26:54Z.
Review: COMMENTED
Reviewed and verified against
main(63bcca43) on Windows 11 (RTX 5090 + WARP +dxil.dll,VICTORY_D3D12_DEBUG=1) — clean 32-bit lowering and ready to merge:expand_quads(lower.rs:3918-3935) uses two 32-bit butterfly shift-mask steps (0xaaaa_aaaa/0x5555_5555,0xcccc_cccc/0x3333_3333) with zeroi64/flags::INT64usage, symmetric withs_quadmask_b{32,64}and accurateSCC((low | high) != 0).emit/lower.rsreaches 522,007 B (2,281 B headroom on63bcca43).Local verification:
victory-shader(emit::valu_tests,emit::lower::tests,emit::semantics_tests): 104/104 passed on both RTX 5090 and WARP (dxil.dll+DEBUG=1), includingscalar_wqm_ir_tracks_register_widths_and_sccandscalar_wqm_expands_nibbles_and_sets_scccargo clippy --locked -p victory-shader --tests -- -D warnings(default &--all-features) +cargo xtask policy(191 files ok): 0 warningsView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.