shader: lower compute quad DPP OR #1606
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1613"
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 JustinDCosta on 2026-11-24T15:02:44Z.
Scope
Adds a narrow gfx1013 compute translation for
v_or_b32_dppwithquad_permand full row/bank masks. It models the guest's logical 1D quad usingSV_GroupThreadID.xand group-shared staging, so it does not assume that Shader Model 6.0 wave lane indices map to group thread IDs. The accepted group layout is 1D with a size divisible by four. Other DPP controls remain unsupported; row shifts, partial masks, non-VGPR operands, multidimensional groups, incomplete quads, and lane-guarded execution are refused.The source-built fixture uses unique input words across logical lanes and quads. The CPU reference derives source lanes from logical thread IDs, and a probe verifies every logical thread participated. An identity-read mutant must fail.
Refs #1543
Validation
Generated HLSL on WARP
Generated HLSL on NVIDIA hardware
gfx1013 LLVM round-trip
Other checks
offscreen_check— passed.dpp_controls()— passed acceptance/refusal checks, includingrow_shr, incomplete quads, and multidimensional groups.python -B tests/docs_links_check.py— passed (349 links).Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T15:12:47Z.
Review: CHANGES_REQUESTED
The added probe computes expected source lanes from the host WaveGetLaneIndex measured in the same dispatch. It verifies the host shuffle but can pass if the host quad differs from the logical guest quad. The branch accepts multidimensional groups and uses cs_6_0, which does not guarantee mapping quad lanes to SV_GroupThreadID. Please use a proven 1D quad layout (SM 6.6 quad semantics with capability gating) or index a logical 1D quad explicitly, and compute the reference from logical thread IDs. Keep the incomplete-quad, row_shift and identity controls. https://microsoft.github.io/DirectX-Specs/d3d/HLSL_SM_6_6_Derivatives.html
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T15:13:09Z.
Review: COMMENTED
Reviewed
79226e74af0fb986eda2c5eadbf6a1309d8f10a6:tools/compute_store_aot.pylowersv_or_b32_dppwithquad_perm:[p0,p1,p2,p3]androw_mask:0xf bank_mask:0xfongfx1013(unmaskedguard_span is None, VGPR operands<= 255, workgroup size divisible by 4) usingWaveGetLaneIndex()andWaveReadLaneAt(..., source_lane).tests/compute_check.cpp(run_computewithdpp_case = true) validates the same-dispatchWaveGetLaneIndex(),WaveGetLaneCount(),WaveActiveBallot(true)quad liveness, and the expectedinput_word(source_lane) | laneoutput.tests/compute_store_check.pycoversdpp_controls(),dpp_binary()(LLVM round-trip), anddraw_dppincluding a no-shuffle mutant negative control.python3 -B tests/compute_store_check.py binary llvm-mc-19 llvm-objcopy-19 libLLVM-19.sopassed (exit 0).python3 tests/docs_links_check.py(16 Markdown files, 349 links) andpython3 tests/bidi_controls_check.py(1262 files) passed.--preset dev):cmake --build --preset dev --target offscreen_check+ctest --preset dev -R '^(compute_store_aot_dpp_warp|compute_store_aot_warp|compute_store_aot_ds_route_warp)$' --parallel 4 --no-tests=error --output-on-failure-> 3/3 passed (6.81s)./O2(--preset release):cmake --build --preset release --target offscreen_check+ctest --preset release -R '^(compute_store_aot_dpp_warp|compute_store_aot_warp|compute_store_aot_ds_route_warp)$' --parallel 4 --no-tests=error --output-on-failure-> 3/3 passed (6.73s).AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by JustinDCosta on 2026-11-24T15:40:40Z.
Updated in
5c599b9. The generated HLSL now stages each source word in group-shared memory indexed bySV_GroupThreadID.x, and derives the quad source from that logical 1D thread ID. The translator accepts only 1D groups with X divisible by four, so this path no longer depends on the unspecified Shader Model 6.0 mapping from group IDs to wave lanes.The fixture CPU reference now derives expected sources from logical thread IDs and verifies all 32 IDs participated. The identity-read mutant fails as expected. WARP and the RTX 3060 passed in Debug and Release; Ubuntu CI passed the gfx1013 LLVM 15 round-trip.
row_shr, incomplete quads, partial masks, multidimensional groups, and lane-guarded execution remain refused.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T16:33:27Z.
Review: APPROVED
The logical quad staging, windows readback oracle and updated docs now agree. The integrated Windows Release candidate passed 8/8 on RTX and WARP covering DPP, entry layout, MED3 and full-mask image stores, with no skips.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T16:28:32Z.
Resolved the CTest and documentation conflicts in
d383358b. Both entry-layout and DPP tests are retained, and the description now matches the logical group-thread implementation. Windows Release DPP, RSRC2, full-mask image store and MED3 passed on RTX and WARP, 8/8 with no skips.