shader: lower v_pk_fmac_f16 in pixel_aot #990
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#990
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@rasptum on GitHub · 2026-11-23 20:12 UTC · original
tools/pixel_aot.pycurrently rejects the VOP2 packed binary16 multiply-accumulate form (v_pk_fmac_f16/v_pk_fmac_f16_e32) withValueError: Unsupported instruction 23: v_pk_fmac_f16 v12, v13, v14(same for_e32), leavingVOP2 v_pk_fmac_f16uncovered indocs/coverage/gfx1013.tsvanddocs/coverage/rdna2.tsv.ISA definition: AMD RDNA 2 ISA Reference Guide §12.11 (VOP2 Instructions,
V_PK_FMAC_F16, opcode 60 /0x3c) and LLVM 15llvm/lib/Target/AMDGPU/VOP2Instructions.td(V_PK_FMAC_F16,VOP_MAC_F16packed 32-bit VOP2 encoding):D.f16[0] = S0.f16[0] * S1.f16[0] + D.f16[0]andD.f16[1] = S0.f16[1] * S1.f16[1] + D.f16[1]withvdstas the implicit packed accumulator.I am taking this as one small PR: lower
v_pk_fmac_f16/v_pk_fmac_f16_e32intools/pixel_aot.pyreusing the existing packed binary16widen16/pack16_rnehelpers, refusing uninitializedvdst, unsupported modifiers,op_sel/neg, and_e64/DPP/SDWA spellings.Test plan: add
draw-pk-fmacintests/pixel_aot_check.pywith exactR32G32B32A32_UINTreadback on WARP (pixel_aot_pk_fmac_warp) and a hardware entry withSKIP_RETURN_CODE 77(pixel_aot_pk_fmac_hardware), Python reference model, negative controls (dropped accumulator, swapped halves, wrong rounding must each reportpixel_mismatch) plus static refusals, atests/form_coverage_check.pyassertion, and adocs/experiments.mdentry.AI-assisted (Claude Code)
@R0Y00 on GitHub · 2026-11-23 20:16 UTC · original
Please proceed with the verified VOP2 scope and both halves of the original destination as the accumulator. Use exact half bits for a rounding control that distinguishes a fused half result from a binary32 computation followed by half packing. For example, in a finite preserve/RNE profile, 0x3e00 × 0x3956 + 0x0001 is exactly 16785409/16777216. Rounding it directly to half gives 0x3c01, while rounding through binary32 first gives 0x3c00. I checked that distinction with exact rational arithmetic and binary32/half conversion. Treat it as a differentiating reference case, and verify the mode used by the fixture. Include a source aliasing the destination, distinct lane inputs, and uninitialized destination/modifier refusals. The widening and packing helpers alone do not establish the intermediate precision.
AMD RDNA 2 VOP2 definition
@R0Y00 on GitHub · 2026-11-23 22:10 UTC · original
The agreed VOP2 finite preserve/RNE slice landed in #1004 (
64ecc873). The actual raw readback gives 0x3c01 for the exact half-FMA witness, and the intermediate-f32 control gives 0x3c00. Runtime operands without proven finite halves, other denormal or rounding modes, and DPP/SDWA remain separate work.