Shaders: lower s_wqm_b32 and s_wqm_b64 in pure 32-bit DXIL #2104
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2104
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@geiyiliyabumo on GitHub · 2026-11-25 05:04 UTC · original
geiyiliyabumo:feat/shader-s-wqm→main· +113 −0 · 2 files · 1 commits · openSummary
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)@upipibi on GitHub · 2026-11-25 05:09 UTC · original
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).
@sinan-cmyk on GitHub · 2026-11-25 08:44 UTC · original
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).
@Marvisak on GitHub · 2026-11-25 10:39 UTC · original
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
View 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.