Repository navigation
fix(shader): DPP16 lanes whose source lane is inactive - #515
Conversation
3ae1bd2 to
bd6afc7
Compare
|
Rebased on current main: the only Windows failure was |
|
Thanks, this matches the documented DPP16 rule: with fi:0 an inactive source lane is an invalid lane and bound_ctrl decides, so with bound_ctrl off the destination keeps its old value, and with fi:1 a source outside the row is still invalid (LLVM AMDGPUModifierSyntax, One note for anyone reading the CI results: the new test skips when the subgroup is narrower than 32, so lavapipe never runs it. I ran it on NVIDIA here (32-wide subgroups, so both wave64 runs take the two-half path): it fails on main's code ("lane 0 mov_quad_perm is 0x00000000, expected 0xdeaddead") and passes with the change, along with the existing DPP tests. Since this changes every DPP16 move with bound_ctrl off under a partial EXEC, which is what compiler wave reductions emit, I'll run it through my PPSA21564 check before merging. It goes in after #513. Ready to merge from my side otherwise. |
Co-Authored-By: Claude <noreply@anthropic.com>
Without bound_ctrl and fetch-inactive, a DPP16 lane whose source lane is inactive keeps its old value instead of being written with 0. With fetch-inactive, a source outside the row reads 0. Co-Authored-By: Claude <noreply@anthropic.com>
bd6afc7 to
fd159a6
Compare
|
Thanks, this carries #513's rebased head and your commit applied unchanged (same patch as the one I reviewed). |
|
Gated on PPSA21564: no visual or FPS change. |
What
DPP16 write rule when the source lane is inactive, measured on hardware (gfx1035, RDNA2):
bound_ctrloff,fi:0, source lane inactive: the lane is not written (keeps its old value).mainwrote 0.bound_ctrloff,fi:1, source lane inactive: the lane is written with the inactive lane's value (unchanged).bound_ctrlon: the lane is written with 0 when the source is invalid (unchanged).fi:1with the source outside the row (row_shr:1on lane 0 of a row) andbound_ctrlon: reads 0.mainreturned the shuffled value.EmitDppWriteConditionnow also requires the source lane to be active (ballot of exec at the target lane, same pairEmitDppMoveU32uses for the read) when neitherbound_ctrlnorfiis set. DPP8 keeps its own rule from #513 (an inactive source writes 0), so it is excluded viaDppMoveFlags::Lanes8. Withfi:1,EmitDppMoveU32now returns 0 when the target lane is out of range.Behaviour measured on HW
Python model
valid = in_row && (exec[src] || fi),write = exec[lane] && row_mask && bank_mask && (valid || bound_ctrl), valuevalid ? src : 0: 0 mismatches against the GPU over 3 seeds x (32 lanes wave32 + 64 lanes wave64) x 15 cells, forv_mov_b32_dppandv_add_nc_u32_dppunderquad_perm,row_shr,row_mirrorwithrow_mask/bank_mask, each with and withoutfiandbound_ctrl, with a non-trivial exec mask.Tested
Linux, RADV. New
agc_driver_dpp16_inactive_source_tests(tests/execution/Dpp16InactiveSource.cpp, expected values from the hardware run): wave32, wave64 on the native target and wave64 on the two-half path (ComputeTarget(32)). It skips on lavapipe (8-lane subgroups), the same asDpp8.cpp/ReadLane.cpp.Fails without the fix, each piece reverted separately: dropping the source-active term (
mov_quad_perm), returning the unselected shuffle forfi(mov_row_shr_bc_fi), ignoringfiin the write rule (mov_quad_perm_fi); applying the new rule to DPP8 too breaksagc_driver_dpp8_tests(mov_inactive).Full Release build + ctest: everything passes except
agc_driver_pixel_helper_lanes, which also fails onmainwith local RADV.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)