compute: lower v_dot4c_i32_i8 in direct compute #3248
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!3248
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3246"
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?
@Leyukaka on GitHub · 2026-11-28 01:42 UTC · original
Leyukaka:dot4c-i32-i8→main· +158 −6 · 4 files · 2 commits · merged 2026-11-28 03:57 UTCPart of #2935, claimed in #3226 (item 2 of my second comment there). Target branch
main.Change (
src/gfx1013_direct_compute.inl): direct compute lowers VOP2v_dot4c_i32_i8(opcode 0x0d).D = D + sum(sext(S0.byte[k]) * sext(S1.byte[k]))modulo 2^32, astools/pixel_aot.pymodelsdpp_dot4c_i32_i8.Tests. The setup was Windows 11 with an NVIDIA GeForce RTX 5080 and DXC from the Windows SDK 10.0.26100, Release, on
main7364e6a9plus this commit.native_dot4c_irandnative_dot4c_hardware(wave32, groups 0 and 1, EXEC set explicitly) cover four cases:main'scompile_dxil, the new test stops at "direct DXIL lowering for v_dot4c_i32_i8".-R "native_dot|native_direct_container|native_packed".Measured with
compile_dxil --jobs 8 gfx1013-direct-cs@36 --requests,main7364e6a9against this commit.AI-assisted.
4909bb61dftod8a1909831@R0Y00 on GitHub · 2026-11-28 03:45 UTC · original · requested changes
I reviewed
d8a19098and ran Debug and Release /O2 on maina166a753plus this head (tree796f1777). Each build passed 11/11, including the new signed accumulator's IR and RTX wave32 readback, inactive-lane preservation and the adjacent packed-dot controls. Windows 11 26200.9974, RTX 4060 Laptop driver 32.0.16.1656, SDK/DXC 10.0.26100.0. No skips.Please add the newly supported VOP2 form, refusal boundary and reproduction command to the experiment documentation alongside the existing packed-dot coverage. The #3226 counts already identify the offline cohort.
@Leyukaka on GitHub · 2026-11-28 03:50 UTC · original
Thanks for testing it. Pushed
8f0b1b94, docs only.docs/experiments/native-packed-dot4.mdgains a "VOP2 dot-accumulate" section, next to the existing packed-dot text:v_dot4c_i32_i8, with the destination as accumulator,Dot4AddI8Packed, and S0 from a VGPR, SGPR, inline constant or literal;native_dot4c_(ir|hardware)command and what each test checks.AI-assisted.
@R0Y00 on GitHub · 2026-11-28 03:57 UTC · original · approved these changes
The requested experiment note is present at
8f0b1b94. On main152e93b4plus this head (tree25711d43), the two focused Release /O2 tests native_dot4c_ir and native_dot4c_hardware both passed on RTX 4060 Laptop, including the sparse EXEC control. The earlier source-identical revision passed 11/11 in both configurations. The launcher-only merge leaves the tested shader and fixture files unchanged.@pigalot on GitHub · 2026-11-28 04:00 UTC · original
Independently reviewed
8f0b1b94integrated overmain152e93b4(tree25711d43). This is the head that was merged, so I'm posting this as a comment. The merge is clean, andgit diff --cached --checkis clean too.What I traced. VOP2
v_dot4c_i32_i8is lowered asDot4AddI8Packed(D, S0, S1), with the destination as the accumulator and the sum wrapping modulo 2^32. The VOP2 decoder setsi.dst = 256 + vdst(gfx1013_compute_native.cpp:151), sooperand32(i, i.dst)reads the destination VGPR.vector_writekeeps the old D on inactive lanes. Clamp is refused for this form, so the saturating path is never taken.I checked the four expected dots by hand:
0xfbf201f7·0x04030201gives -69;0x7ffffff0, which crosses INT32_MAX;v3byte 3 (-128)·127 gives -16256 on0x80000000, which crosses INT32_MIN.What I ran. I built
compile_dxil native_store_replay native_compute_ir_dump offscreen_checkindevandrelease, then ranThe
_hardwaretests ran at-j 1. All 11 pass in Debug and in Release/O2, with no skips:native_dot4c_ir: four source encodings, plus the DPP and SDWA refusals.native_dot4c_hardware: "64 results and all guards matched" for literal, sgpr, inline and vgpr_dst_alias.The 74
^native_.*_(controls|ir)$tests also pass indev.Negative control and mutants. Each mutant was rebuilt in
devand run against both new tests:src/gfx1013_direct_compute.inlback tomain_irand_hardware(literal word 80000081f)src[2]instead of D_hardware(literal word 8)_hardware(literal word 8ffffffbb)writeinstead ofvector_write(inactive lanes written)_hardware(sgpr word 98000fff1)Restored and rebuilt afterwards. The restored build passes again, and
git diff --quietis clean.R0Y00's request on
d8a19098.8f0b1b94adds the "VOP2 dot-accumulate" section todocs/experiments/native-packed-dot4.md. It covers the accepted form and sources, the refusal boundary with each message, the reproduction commands, and what each test checks.Non-blocking. The new refusal's
dpp_controlandsubwordclauses are not reached by the controls. DPP16 and SDWA are refused earlier, with "unsupported DPP arithmetic" and "unimplemented direct SDWA operand profile", and the docs say so. The clauses are harmless, but nothing pins "unsupported packed byte dot-accumulate operand modifiers" itself.Verdict: I would have approved
8f0b1b94.Environment: NVIDIA GeForce RTX 5090 driver 32.0.16.1088, Windows 11 25H2 build 26200.9974; MSVC 19.52.37029; SDK 10.0.28000.0 DXC (the one CTest picked up); Python 3.12.10; wave32.
CI:
Build and test on Windowspasses on8f0b1b94.This reply was AI-assisted.