shader: support VOP3P clamp on v_pk_add_f16, v_pk_mul_f16, and v_pk_fma_f16 #3292
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!3292
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3290"
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?
@legacy-code-archaeologist on GitHub · 2026-11-28 05:28 UTC · original
legacy-code-archaeologist:shader/direct-packed-f16-clamp→main· +354 −21 · 6 files · 1 commits · merged 2026-11-28 06:02 UTCFixes #3289, Refs #2935.
Summary
CLAMPonv_pk_add_f16(0x0f),v_pk_mul_f16(0x10), andv_pk_fma_f16(0x0e) inDirectCompute::packed_f16_alu()(src/gfx1013_direct_compute.inl), saturating each rounded binary16 result half to[+0.0, 1.0]with-0.0 -> +0.0andNaN -> +0.0.v_pk_fmac_f16clamp, unused third-operand modifier/source fields (src2,OP_SEL[2],NEG_HI[2],NEG_LO[2]) on 2-sourceadd/mul, and non-default/dynamic binary16MODEstates refused.tests/native_packed_f16_check.pyandtests/native_packed_f16_inline_check.pyto test unused third-operand bits while verifying clamped compilation.tests/native_packed_f16_clamp_check.py+tests/cmake/native_packed_f16_clamp.cmake(22cases,9refusals across Compute IR/DXIL/lossless 16-bit Pixel readbacks, plus2064-word Compute replay where SM 6.6 wave32 is supported) and updatesdocs/experiments/native-packed-f16.md.Verification
All checks passed on Windows 11 with SDK
10.0.26100.0(devandrelease/O2presets):python -B tests/docs_links_check.py: passed (141Markdown files,662links)ctest --preset dev&ctest --preset release(-R '^(native_packed_f16_clamp_|native_packed_f16_controls|native_packed_f16_pixel_|native_packed_f16_inline_ir|native_packed_f16_inline_controls|native_pk_fmac_f16_ir|native_f16_alu_ir)'):11passed,1skipped in each preset:native_f16_alu_ir(435results,39refusals): passednative_packed_f16_controls,_pixel_warp,_pixel_hardware: passednative_packed_f16_clamp_ir(22cases,9refusals),_controls(22cases compiled,9refusals): passednative_packed_f16_clamp_pixel_warp(Microsoft Basic Render Driver,11draws /22cases) andnative_packed_f16_clamp_pixel_hardware(NVIDIA Quadro M1000M driver32.0.15.7371,debug_layer=unavailable,11draws /22cases): passednative_packed_f16_inline_ir,_controls(24cases,10refusals), andnative_pk_fmac_f16_ir(17cases,8refusals): passednative_packed_f16_clamp_compute_hardware: skipped (77on local Intel HD Graphics 53031.0.101.2111lacking SM 6.6 wave32; Compute SM 6.6 wave32 replay needs an SM 6.6 wave32 GPU)dev(native_packed_f16_clamp_ir): dropping the NaN check, dropping the sign-bit (32768) check, and dropping the> 15359upper clamp each failed on the exact affected cases before restoring clean source.AI-assisted.
@R0Y00 on GitHub · 2026-11-28 06:02 UTC · original · approved these changes
Independent Release check on
f7984889:ctest --preset release --no-tests=error --output-on-failure -j 1 -R '^native_(packed_f16.*|f16_alu_ir)$'passed 15/15 with no skips. It covered the new wave32 hardware Compute and both WARP and hardware Pixel cases, adjacent unclamped and inline paths, and the modifier/encoding refusal controls. Windows 11 build 26200, DXC 10.0.26100, RTX 4060 Laptop driver 32.0.16.1656 and inbox WARP 10.0.26100.9818. The implementation applies the clamp after the per-half rounded operation and retains the separate FMAC and mode gates.