Shaders: lower v_dot4_u32_u8 and v_dot8_u32_u4 in pure 32-bit DXIL #2092
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!2092
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2092"
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 04:37 UTC · original
geiyiliyabumo:feat/shader-v-dot4-dot8→main· +136 −17 · 2 files · 1 commits · openSummary
v_dot4_u32_u8andv_dot8_u32_u4incrates/victory-shader/src/emit/lower.rsusing pure 32-bit DXIL (shifts, masks, multiply-adds, and unsigned overflow detection forclamp), reusing the existing VOP3P half-selector and modifier validation fromv_dot4_i32_i8without enablingInt64/WIDE_OPS.crates/victory-shader/src/emit/valu_tests.rscovering unsigned byte products (including0xFF * 0xFF), all 8 nibble positions and max nibble sum (1800), modulo-2^32wraparound (clamp = 0), unsigned saturation to0xFFFF_FFFF(clamp = 1), and VOP3P operand half selection, assertingInt64is not set.Verification
cargo xtask policy: passedcargo clippy -p victory-shader --tests -- -D warnings: passedcargo test -p victory-shader --lib dot_products -- --test-threads=1with Microsoftdxil.dll: 5/5 passed on AMD Radeon RX 9060 XT (RDNA4) and Microsoft Basic Render Driver (WARP)@jeremygold02 on GitHub · 2026-11-25 04:43 UTC · original
Triage verdict — Keep the unsigned dot lowering with operand selectors (
e4eae6b)Evidence
srcoperands without those selectors, while #157 explicitly refuses selector and clamp cases. Current lowering · #1292 patch · #157 patchChecks and limits
Next step
This verification was AI-assisted.
@upipibi on GitHub · 2026-11-25 04:48 UTC · original
Ran on Windows 11 with an RTX 3070 (Ampere, driver 616.56), debug build, at
e4eae6b.victory-shader: 247 passed, 3 failed, 3 ignored. The newunsigned_byte_dot_products_wrap_or_saturate,unsigned_nibble_dot_products_wrap_or_saturateandunsigned_packed_dot_products_use_operand_half_selectorspass. The 3 failures are #1744's NVIDIA failures onmain. Same asmainon this hardware.Overlap, from reading: #1292 (open, conflicting with
main) lowersv_dot4_u32_u8andv_dot8_u32_u4too, along withv_dot2_{i32_i16,u32_u16},v_dot4_i32_i8andv_dot4c_i32_i8.AI-assisted (Claude Code).
@sinan-cmyk on GitHub · 2026-11-25 08:54 UTC · original
Offline measurement on a retail dump
Result: no count change against
main.I merged head
e4eae6b3ontomain940d32f(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:34 UTC · original
Automated triage for the maintainers.
Extends the existing
v_dot4_i32_i8arm inemit/lower.rstov_dot4_u32_u8(VOP3P 0x17) andv_dot8_u32_u4(0x19), reusing its op_sel/op_sel_hi operand handling. I checked the opcodes againstgfx10/opcodes.rs, that the byte/nibble product sums fit in 32 bits (so the only overflow is the accumulator add, which theclamppath saturates with an unsigned compare), and the expected values in the three newvalu_tests.rstests, including the half-selector case. This matches the unsigned dot products as AMD's public RDNA ISA guide describes them; citing that in the PR would help. CI passes, and an independent NVIDIA run reports the new tests passing.Notes: #1292 and #157 also touch these two opcodes; there should be one implementation. The
try_build_valu_cschange (panic whenVICTORY_DXILis set but fails to load) also appears in #2097 with a different message, so whichever lands second needs a trivial rebase.Generated by Claude Code
@fuzeofficlal on GitHub · 2026-11-26 01:42 UTC · original
Code review and RTX 5090 + WARP + DXIL verification at head
e4eae6b3466amerged cleanly ontomain(63bcca43c6a0;emit/lower.rs=522,189B,2,099B under the 512 KiB cap):crates/victory-shader/src/emit/lower.rs:6194-6249):v.opsel/v.opsel_hihalf selection withv_dot4_i32_i8; computes pure 32-bit unsigned 4x8 (<= 260,100) and 8x4 (<= 1,800) dot products withoutu32overflow, detectsacc + dotwrap viapred::IULT(sum, acc)forv.clampsaturation tou32::MAX, and writes underguard. (Consistent withv_dot4_i32_i8, line 6199 checksv.neg_hi != 0.)dxil.dll10.0.26100.0,VICTORY_D3D12_DEBUG=1, Rust 1.98.1):cargo xtask policy:191 files ok;cargo clippy(default +--features diagnostics): 0 warningsdot_product(5/5),emit::lower::tests(33/33), andemit::semantics_tests(34/34 on both RTX 5090 and WARP, 1 ignored) all passed.LGTM.
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.