Repository navigation
test(shader): execute the untested LDS reads, writes and integer atomics against values measured on RDNA - #543
Conversation
…ics against values measured on RDNA Co-Authored-By: Claude <noreply@anthropic.com>
0436afa to
bb24017
Compare
|
Rebased on current main: the only Windows failure was |
|
Thanks. I recomputed all three tables from the ISA semantics instead of taking them as given: I ran the llvm-mc gfx1013 disassembly of each shader through a small lane-by-lane model. Every cell matches for wave32 and wave64 (LdsIntegerAtomics, LdsReadWrite and LdsAddtid). The model reads past the end of the allocation as zero and drops the writes there, as the RDNA2 ISA's out-of-range rules for LDS say. Addtid uses No overlap with the existing LdsAtomics test or with #523 and #385. Test only, no change to the translation. Ready to merge from my side. |
What
Three execution tests for the LDS instructions that are decoded but that no test runs yet. Each runs as wave32, wave64 and wave64 split (
ComputeTarget(32)). Every lane checks its returned values and then its dword of the whole LDS. The expected values were measured on hardware. No translator change: the recompiler matched the hardware everywhere.agc_driver_lds_integer_atomics:ds_{add,sub,min_i32,max_i32,min_u32,max_u32,and,or,xor}without return, each lane on its own dword and then all lanes on one dword. Also the_rtn_forms of these plusinc/dec, andds_wrxchg_rtn_b32, run under a partial EXEC (inactive lanes keep their destination).agc_driver_lds_read_write, under a partial EXEC:ds_read_{u8,i8,u16,i16}at every byte or half position (computed and constant offsets),ds_read2_b32,ds_read2st64_b32,ds_read_b64,ds_read2_b64,ds_read2st64_b64,ds_read_b96ds_write_b8,ds_write_b16,ds_write_b16_d16_hi,ds_write2_b32,ds_write2st64_b32,ds_write_b64,ds_write2_b64,ds_write2st64_b64,ds_write_b96agc_driver_lds_addtid:ds_read_addtid_b32/ds_write_addtid_b32with several M0 values and offsets, some lanes past the end. It is skipped on devices whose subgroups are narrower than the wave, likeagc_driver_ds_permute, because the lane id comes from the subgroup.Not covered:
ds_append/ds_consume(#523),ds_wrxchg2*(#385),ds_swizzle_b32, the 64-bit atomics and the_src2_forms (still not decoded), and GDS.Behaviour measured on hardware
On an RDNA2 GPU (gfx1035, HSA, wave32 and wave64). A Python model of each test was checked against the hardware on 32 random sets of lanes per wave size (100% match), and then the rows were picked from it:
M0[15:0] + instruction offset + lane * 4.M0[31:16]is ignored.lanes * 128bytes), reads return 0 and writes are dropped, also foraddtidand for each dword ofds_read_b64.Tested
Linux (CachyOS), GCC, Release build, full
cteston RADV (Mesa 26.2): everything passes exceptagc_driver_pixel_helper_lanes, which already fails onmainhere. The three new tests also pass on lavapipe (local and the Ubuntu Mesa 25.2.8 that CI uses).agc_driver_lds_addtidis skipped there (8-lane subgroups).Each test fails when the piece it covers is broken:
ds_min_i32mapped to unsigned minds_dec_rtn_u32mapped to inc_rtn_result not writtends_xor_b32mapped to ords_read_i8zero-extendedds_write2/ds_read2ignoredM0[31:16], without the instruction offset, or withlane * 8No title was run.
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)