shader: lower v_dot2c_f32_f16_dpp in the pixel AOT path #3649
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!3649
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3647"
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?
@lambirou on GitHub · 2026-11-30 20:59 UTC · original
lambirou:shader/f16-dot2c-dpp→main· +779 −40 · 7 files · 9 commits · openStacked on #3596 (base commit
c955d9f3, which includes theorigin/maina3bfd019merge). The plainv_dot2c_f32_f16lowering lives there; this PR adds only the two remaining DPP forms. While #3596 is open the GitHub diff includes that stack; after it lands this PR is the DPP delta.Problem
The f16 coverage plan left exactly two lines for
v_dot2c_f32_f16_dpp:DPP16andDPP8. The pixel AOT path lowered the plain form but refused the DPP spellings, so both reference rows stayed uncovered.Change
tools/pixel_aot.py: lowerv_dot2c_f32_f16_dppfor quad-local DPP16 and DPP8. SRC0 is quad-swizzled withemit_quad_swizzle_u32; SRC1 and the in-place binary32 accumulator stay on the current lane. The lowering reusesf16_dot2c_resultand the plain binary32 subnormal-accumulator fixup.dot2c_quad_wordanddot2c_quad_accumulatorkeep either one proven word or four words selected per quad lane byv_cndmask_b32with a constant SGPR mask. Every lane word's two halves must be finite; every accumulator word must be a finite binary32.row_mask/bank_mask,bound_ctrl,fi, cross-quad or non-repeated DPP8, mixed controls, source modifiers, non-VGPR operands, a destination outsidev0..v255, an outstanding sample, a non-entryEXECmask, an unknown or non-preserved denormal profile, round-toward-zero, and non-finite words or accumulators.tests/pixel_aot_check.py: six-program drawdraw-f16-dot2c-dpp. Four uniform programs cover all sixteen plain dot2c rows, readers and chains. The two lane programs select four different finite words for SRC0, SRC1 and the accumulator with the constant SGPR maskss52/s53, broadcast each lane's result, and compare the per-lane referencef16_dot2c_reference(src0[perm[l]], src1[l], acc[l]); all four results are distinct and identity differs from both tested permutations.pixel_mismatch: SRC1 high half, accumulator read as a binary16 lane, high product dropped, subnormal-accumulator fixup removed under-denorm ftz, the DPP16QuadReadAcrossXswizzle deleted from the lowering, and the DPP8[1,2,3,0]cycle replaced by its inverse[3,0,1,2].tests/cmake/pixel_aot_f16_dot2c_dpp.cmake:pixel_aot_f16_dot2c_dpp_warpandpixel_aot_f16_dot2c_dpp_hardware, 90 s, capability skip 77, withFORM_COVERAGE_RECORD.tests/form_coverage_check.py:check_dpp_f16_dot2c_formspins exactly the two forms and leaves the plain dot2c and unary DPP neighbours uncovered.tools/scan_unsupported_shaders.pyandtests/rdna2_tools_check.py: the scanner accepts the DPP16/DPP8 dot2c shapes and thev_mov_b32_dppbroadcast;test_binary16_dpp_dot2c_scanner_translator_agreementchecks agreement.docs/experiments.md: experiment note.Tests
After merging
origin/maina3bfd019, headb0c18f79was validated withpython -B tests/form_coverage_check.py,python -B tests/rdna2_tools_check.py(164 tests, 19 skips),python -B tests/pixel_aot_check.py, andctest --preset dev --no-tests=error -R '^pixel_aot_(f16_dot2c_dpp|f16_vop23|f16_dpp_unary|f16_dpp_unary_rest)_' -V(8/8 passed).Exact commands, from the original branch:
python -B tests/form_coverage_check.py->form coverage checks passed.python -B tests/rdna2_tools_check.py->Ran 164 tests ... OK (skipped=19).cmake --preset dev -DINTAKE_PYTHON="<venv>/python.exe"thencmake --build --preset dev-> exit 0.ctest --preset dev --no-tests=error -R '^pixel_aot_f16_dot2c_dpp_' -V-> bothpixel_aot_f16_dot2c_dpp_warpandpixel_aot_f16_dot2c_dpp_hardwarepass; the six mutation batches printstatuses ['mismatch'].pixel_aot_f16_vop23_warp,pixel_aot_f16_dpp_unary_warpandpixel_aot_f16_dpp_unary_rest_warppass.python -B tests/pixel_aot_check.pycontrols (also exercised byform_coverage_check.py) pass.Hardware: AMD Radeon RX 9060 XT, driver 32.0.32029.2010, Windows 11 build 26300.10075. WARP:
d3d10warp.dll 10.0.26100.10068. The targeted runs exposed no capability skip.rdna2_tools_check.pyreports 19 LLVM-dependent skips separately.The GitHub Linux
pixel-binaryjob runstests/pixel_aot_check.py binarywith LLVM 15. LLVM 15'sllvm-mc-15 -mcpu=gfx1013rejectsv_dot2c_f32_f16_dppasinstruction not supported on this GPU, so the binary fixture round-trip excludes the two DPP forms; the pure-Python controls,form_coverage_check.pyand both D3D12 draws cover them, while the plainv_dot2c_f32_f16fixture still round-trips. No LLVM 15llvm-mcwas available locally, so this limitation was found on the CI job rather than reproduced on the host.Coverage delta
Measured on this branch: the fixture adds exactly 2 forms in
docs/coverage/gfx1013.tsvand 2 indocs/coverage/rdna2.tsv(DPP16/DPP8v_dot2c_f32_f16_dpp). The documented stack totals move from 1627/1968 and 1581/1863 to 1629/1968 and 1583/1863.Limits
The high half of the destination is not observed. Runtime sources beyond the four-word constant-mask select are refused; lane routing is measured for the two lane programs only, not for dynamic controls or a partial
EXECmask. The console's denormal and rounding state is not measured; NaN and infinity words are refused before lowering. No title is known to execute these forms.AI-assisted.
9988f10af6toadff329207@lukaslw-lab on GitHub · 2026-12-01 02:45 UTC · original · requested changes
Reviewed
b0c18f79by reading the diff; not built or run. Stacked on #3596, so I read this PR's own change againstc955d9f3.Verdict: changes requested. The new constant-mask
v_cndmask_b32path lowers any known SGPR mask as if it repeated every quad, which is wrong for non-periodic masks, including the ones the fixture uses.tools/pixel_aot.py:7918-7927: when the lane-mask SGPR holds a known integer, the select keepsscalar[...] & 0xfand picks perWaveGetLaneIndex() & 3. On the guest, bit L of the mask selects lane L of the whole wave. Sos_mov_b32 s52, 0x5selects lanes 0 and 2 only, and every other lane takes the unset operand. The lowering instead selects quad lanes 0 and 2 in every quad. This path is not limited to dot2c: anyv_cndmask_b32with a constant SGPR mask, which was refused before, now takes it. The fixture (s52 = 0x5,s53 = 0x3) and its per-quad-lane reference share the assumption, so the draw cannot catch it. Accept only quad-periodic masks (value == (value & 0xf) * 0x11111111) and refuse the rest as before. Then the fixture needs0x55555555/0x33333333, plus a control that0x5is refused.-mcpu=gfx1013rejectsv_dot2c_f32_f16_dpp. If gfx1013 has no encoding for these forms, the "+2 gfx1013" coverage claim should say so.:8319) matches the plain #3596 model. Only SRC0 is quad-swizzled; the arithmetic and the subnormal-accumulator fixup are unchanged.bits0[perm[lane]], the same permutation as the emitted swizzle. The operand and profile refusals are complete.Tests: the six-program draw and its six mutations prove the dot2c arithmetic and the DPP16/DPP8 routing. Their lane programs inherit the periodic-mask assumption above. CI ran
pixel_aot_check.py,form_coverage_check.pyandrdna2_tools_check.pyat this head. The draws are outside theprfilter.@R0Y00 on GitHub · 2026-12-03 07:59 UTC · original
#3596 is in
mainat0b83a346. I tested replaying onlyadff32920onf9b112b9: the two conflicts were the draw selector intests/pixel_aot_check.pyand the ordinaryv_cndmaskbranch next to main’s existing SDWA handler intools/pixel_aot.py. Keeping the new ordinary-select lane proof, the main SDWA handler, and both draw selectors passed the Python checks and all six WARP mutations. Main already has the SDWA handler thatbe3c01565adds on the old branch.One hardware test gap reproduced both on the trial tree and on exact head
f667cf75: with SDK DXC 10.0.26100, RTX 4060 Laptop (32.0.16.1656, Windows build 26300),draw-f16-dot2c-dppreached the mutation phase with its reference and FTZ draws passing, butno_fixupondot2c_dpp8returned['pass']. WARP 10.0.26100.9818 reported the expected mismatch. Please keep the mutation coverage when refreshing the branch and distinguish the backend's observed denormal behavior from a numerical mismatch in the unmodified draw.@R0Y00 on GitHub · 2026-12-03 11:15 UTC · original
Re-tested
cdc773ddafter the clean merge from main. Windows 11 build 26300, SDK DXC 10.0.26100, inbox WARP 10.0.26100.9818 and RTX 4060 Laptop 32.0.16.1656. The RDNA2 Python suite completed (168 cases, 19 skipped). The draw-f16-dot2c-dpp fixture passed on WARP, including all six mutations. RTX passed the unmodified readback and reached the mutation checks, but removing the subnormal accumulator fixup still returns ['pass'] for dot2c_dpp8; the hardware test fails on that assertion. This is the same issue after the rebase. Please preserve the WARP mismatch check and account for the RTX result before landing. A fixture that catches the mutation on both adapters, or a separately proven FTZ capability condition, would make the hardware verdict reproducible.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.