fix(shader): DPP16 lanes whose source lane is inactive #515
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/515"
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 boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-04T14:31:01Z.
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)Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-04T20:36:31Z.
Rebased on current main: the only Windows failure was
guest_audio_in_no_device, fixed by #532. No other changes.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-04T21:30:40Z.
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,
fifor dpp16 andbound_ctrl). I checked the lane 0 cells of the wave32 table against that model by hand and they agree. The rebased head has the same two commits as before; the DPP8 one is the same patch as #513, and #515 merges cleanly on top of #513, so after #513 lands only your own commit is left in the diff.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.
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-05T01:33:06Z.
Rebased on current main, carrying #513's rebased head (after #587). This commit applied unchanged;
agc_driver_dpp16_inactive_source_testsand the full ctest pass on RADV (only the knownagc_driver_pixel_helper_lanes).Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-05T02:47:10Z.
Thanks, this carries #513's rebased head and your commit applied unchanged (same patch as the one I reviewed).
agc_driver_dpp16_inactive_sourcepasses here on the merged branch. PPSA21564 uses DPP16 (quad_permandrow_shronv_mov_b32,v_sub_f32and others) in about 2,400 shaders, so this goes through my PPSA21564 check before merging, after #513.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-05T05:04:04Z.
Gated on PPSA21564: no visual or FPS change.