shader: lower quad-local DPP16 and DPP8 f32/move/select ops in pixel_aot #402
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/408"
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?
Imported from R0Y00/Xbox2Windows. Originally posted by KomaGuy on 2026-11-22T00:36:56Z.
Change
Lower quad-local
DPP16(quad_perm) andDPP8(dpp8) forms for all 20 currently supportedVOP1/VOP2pixel operations intools/pixel_aot.py, advancing coverage from0/101to20/101onDPP16and0/101to20/101onDPP8(+40 forms on bothgfx1013andgfx1030):v_*_dppinstructions (20):v_mov_b32_dpp,v_cvt_f32_f16_dpp,v_cndmask_b32_dpp, 9 unaryf32ops (log,exp,rcp,sqrt,rsq,floor,ceil,fract,trunc), and 8 binary/accumulatef32ops (add,sub,subrev,mul,mul_legacy,min,max,fmac).src0asuintbits (asuint) throughQuadReadAcrossX,QuadReadAcrossY,QuadReadAcrossDiagonal, or uniformQuadReadLaneAt(selected viaWaveGetLaneIndex() & 3u), keeping subnormal/binary16 bit patterns intact and staying valid across wave widths 4 (WARP) through 64.quad_perm:[0..3,...]withrow_mask:0xf bank_mask:0xf(plus optionalbound_ctrl:[01]/fi:[01]) and quad-localdpp8:[p0..p3, p0+4..p3+4](plus optionalfi:[01]). Allows-/|.|/abs()modifiers onDPP16floating-point ops and rejects them onDPP8,v_mov_b32_dpp, andv_cndmask_b32_dpp. Rejects cross-quadDPP8,row_*/wave_*controls, partial masks, non-VGPR operands, non-vccselect masks, WQM, andvmcnthazards.DPP_BODYderives per-quad lane ID{0, 1, 2, 3}from interpolateduv.x/uv.y(v8/v9, whilev_mov_b32_e32keeps rejectingv8), tests all 20 forms across 2 constant sets with exact binary16 outputs immune to transcendental ULP differences, and verifies 6 negative mutations (AcrossXvsAcrossY,AcrossYvsAcrossX, cyclicdpp8rotation, lane broadcast,DPP16negation, andfloorvsceil).Verification
Tested on Linux x86_64 (Python 3.13.5, LLVM 19.1.7, Clang 19.1.7) on top of
6549244:python3 -B tests/pixel_aot_check.py binary llvm-mc-19 llvm-objcopy-19 libLLVM-19.so— passed (controls, negative controls, andllvm-mc -mcpu=gfx1013assembly→DXBC/XDAT/XBCH/FSSM→disassembly→lowering parity forDPP_BODYand all existing fixtures).python3 -B tests/ffx_dispatch_aot_check.py llvm-mc-19 llvm-objcopy-19 libLLVM-19.so— passed.python3 -B tests/script_state_check.py,tests/bcpack_check.py,tests/resource_ranges_check.py,tests/layout_chunks_check.py,tests/docs_links_check.py,tests/bidi_controls_check.py— all passed.tools/form_coverage.pyrecords 20DPP16and 20DPP8forms against bothdocs/coverage/gfx1013.tsvanddocs/coverage/rdna2.tsv.DPP_BODYand all 6 negative mutations on a 4-lane SIMT 2×2 pixel quad harness compiled as C++20 withclang++-19 -std=c++20 -O2 -Wall -Wextra -Wpedantic -Werror -fsanitize=undefined,address— bit-exact match across all 4 quad lanes on both constant sets and all 6 mutations caught; 0 sanitizer errors.dxc -Gis -T ps_6_0), WARP (pixel_aot_warp), and hardware (pixel_aot_hardware) checks were not run locally on Linux; relying on thebuild-and-testWindows CI job to verify DXC compilation and D3D12 WARP quad readback.Evidence and follow-up
tests/pixel_aot_check.pyare original MIT-licensedgfx1013assembly sequences built from source at test time.DPP16/DPP8work: integer/bitwise/shift/conversion/f16v_*_dppforms once their corresponding base ops land or in focused follow-up PRs.Checklist
Imported from R0Y00/Xbox2Windows. Originally posted by KomaGuy on 2026-11-22T10:51:28Z.
Refreshed #408 onto current
main(075413d, preserving all merged VOP3P/SDWA/conversion draw suites and using the sharedcompile_shaderhelper); all 4 CI checks pass. Holding off on refreshing #414, #419, #421, #423, and #428 until this base lands.Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-22T12:33:53Z.
Hardware result after this merge:
pixel_aot_hardwarefails onaefed61at the firstcheck_dpp_drawdraw.pixel_aot_warppasses on the same build.aefed61fails; both tests pass onb515663, its parent commitThe two
check_renderchannel-order draws pass (max_absolute_error=0). Then the renderer reports:and
subprocess.run(draw, check=True)raises incheck_dpp_draw(tests/pixel_aot_check.py:2778, called fromcheck_renderat 4818). The HRESULT isE_OUTOFMEMORY, returned byCreateGraphicsPipelineState(tests/pixel_aot_render.cpp:99), so the draw fails before any pixel is compared. I have not narrowed it to a singlev_*_dppline.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by KomaGuy on 2026-11-22T12:55:46Z.
Thanks for the hardware measurement @Leyukaka! This matches the exact NVIDIA Blackwell driver exception recorded in #363 for the
curvefixture (RTX 5060 Ti driver32.0.16.2124refusedCreateGraphicsPipelineStatewithE_OUTOFMEMORYunder-denorm preserveoncurve, which useslog2/exp2/1.0f / x/mul_legacy, while passing undermode="any"and on WARP/AMD).When #408 was refreshed onto #363,
check_dpp_drawmoved fromps_6_0tocompile_shader()(mode="preserve") andDPP_BODYuses those same operations (v_log_f32_dpp,v_exp_f32_dpp,v_rcp_f32_dpp,v_mul_legacy_f32_dpp). In addition,emit_quad_swizzle_u32was inlining fast-pathQuadRead*calls directly intov_mul_legacy_f32_dpp's ternary expression.Opened #569 to:
check_dpp_drawwithmode="any"and assertflush_ftz(word) == wordon every expected word (matchingcurve), andQuadRead*calls into unconditionaluint dpp{i}_slocals before any ternary expression.If you have a moment to test #569 on your RTX 5080, that would confirm it clears the
E_OUTOFMEMORYfailure.