upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/scripts/run_gpu_tests.py
diff options
context:
space:
mode:
authorohshitwaddup <38006566+ohshitwaddup@users.noreply.github.com>2026-11-24 21:37:54 +0700
committerohshitwaddup <38006566+ohshitwaddup@users.noreply.github.com>2026-11-25 08:53:57 +0700
commita9761ab2f9aaae5a29df2351c3edb2cd602deb31 (patch)
tree15969f7c10561f1512150f7514349b936660af3b /scripts/run_gpu_tests.py
parent871e4b8b990bb9424c6f3c06175259d1a548239c (diff)
tests: GPU fixtures for the ds_wrxchg2_rtn_b32 pair cases and ds_wrxchg2st64_rtn_b32 (TEST-WRXCHG2-B32-EXT)
docs/design.md's ds_wrxchg2_rtn_b32 row names cs_w32_new_ops as its fixture, and that fixture compares only the first returned word and data1 in LDS. Four things the row states were therefore never checked on a GPU: the second returned word, data0, the st64 step, and vdst aliasing the data VGRs. The row's own note also records the non-st64 step indirectly only on gfx1100. Two branchless fixtures, one lane each (32 lanes on one LDS address would race): cs_w32_wrxchg2_ext both offsets on one dword: the first exchange returns the old word and the second returns data0, not the word the first wrote; a neighbouring LDS word is untouched; with vdst aliased onto the data VGPRs the data is read before the result is written, so vdst gets the old pair and LDS the new one. cs_w32_wrxchg2st64 the st64 unit is 64 dwords: base 0x80 with offsets 1/2 addresses 0x180 and 0x280. 0x84/0x88 (where a 4-byte step would land) and 0x140/0x2c0 (one step either side of the real elements) are seeded and must come back untouched, which is what pins the stride rather than assuming it. Both are registered in check.py (CS_DUMPS, WAVE32_DUMPS, WAVE32_LANE_DUMPS) and scripts/run_gpu_tests.py, and judge all eight words in hex. Measured on a Radeon RX 6900 XT (RDNA2, GFX1030, RADV Mesa 26.2.4, Nobara Linux 44), main d0da7da: build.py 283 shaders: 283 translated, 283 pass spirv-val check.py 217 of 222 pass, 3 skipped, 2 failed run_gpu_tests.py 233/251 passed, 16 skipped, 2 failed (native and LEONIDA_W64_EMULATE=1 alike) --filter wrxchg2 2/2 PASS both modes, every word exact (16/16) The two failures in the full runs are cs_imgload_tfe and cs_imgload_d16_tfe, the pre-existing SHADER-1266/#31 pair, unchanged by this commit. No game files, nothing online. AI-assisted (Hermes Agent).
Diffstat (limited to 'scripts/run_gpu_tests.py')
-rw-r--r--scripts/run_gpu_tests.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/scripts/run_gpu_tests.py b/scripts/run_gpu_tests.py
index 6b96cc158..4075f87d8 100644
--- a/scripts/run_gpu_tests.py
+++ b/scripts/run_gpu_tests.py
@@ -1209,7 +1209,7 @@ def run_suite(a, work: str) -> int:
1209 "cs_w64x_lds_war", "cs_w64x_partial", "cs_w64x_sbarrier", "cs_w64x_load_ballot_load", 1209 "cs_w64x_lds_war", "cs_w64x_partial", "cs_w64x_sbarrier", "cs_w64x_load_ballot_load",
1210 "cs_w64x_mask_reuse", "cs_w64x_mask_reuse2", "cs_w64x_chain_barrier", "cs_barrier_divergent", 1210 "cs_w64x_mask_reuse", "cs_w64x_mask_reuse2", "cs_w64x_chain_barrier", "cs_barrier_divergent",
1211 "cs_bpermute32", "cs_w64x_partial_scmp", "cs_w32_partial_scmp", "cs_w32_partial_permute", "cs_barrier_early_end", 1211 "cs_bpermute32", "cs_w64x_partial_scmp", "cs_w32_partial_scmp", "cs_w32_partial_permute", "cs_barrier_early_end",
1212 "cs_barrier_loop", "cs_w64x_andn2_exec", "cs_w64x_saveexec_b64", "cs_w64x_cmp_sdst", "cs_lds_b64_cmpst", "cs_lds_xchg64_ext", "cs_lds_atomics_ext", "cs_w32_andn2_exec", 1212"cs_barrier_loop", "cs_w64x_andn2_exec", "cs_w64x_saveexec_b64", "cs_w64x_cmp_sdst", "cs_lds_b64_cmpst", "cs_lds_xchg64_ext", "cs_lds_atomics_ext", "cs_w32_wrxchg2_ext", "cs_w32_wrxchg2st64", "cs_w32_andn2_exec",
1213 "cs_mask_vgpr_exec", "cs_w32_exec_computed", "cs_w64_exec_computed"): 1213 "cs_mask_vgpr_exec", "cs_w32_exec_computed", "cs_w64_exec_computed"):
1214 cs_dump_wants = { 1214 cs_dump_wants = {
1215 "cs_store": [0x400080FF, 0xE00003FF, 0x3C004000, 0xEEEEEEEE, 0x40003C00, 0xBC003800, 0x40FF8000, 0x3FF00000], 1215 "cs_store": [0x400080FF, 0xE00003FF, 0x3C004000, 0xEEEEEEEE, 0x40003C00, 0xBC003800, 0x40FF8000, 0x3FF00000],
@@ -1247,6 +1247,12 @@ def run_suite(a, work: str) -> int:
1247 # ds_wrxchg*_rtn_b64, ds_or_rtn_b64, ds_min_f32, ds_max_rtn_f32 (cs_lds_xchg64_ext.asm header) 1247 # ds_wrxchg*_rtn_b64, ds_or_rtn_b64, ds_min_f32, ds_max_rtn_f32 (cs_lds_xchg64_ext.asm header)
1248 "cs_lds_xchg64_ext": [0x11110003, 0x33333333, 0xF00FF000, 0x04030201, 1248 "cs_lds_xchg64_ext": [0x11110003, 0x33333333, 0xF00FF000, 0x04030201,
1249 0x40302010, 0x70500705, 0x3FC00000, 0x80000000], 1249 0x40302010, 0x70500705, 0x3FC00000, 0x80000000],
1250 # ds_wrxchg2_rtn_b32's pair cases and ds_wrxchg2st64_rtn_b32
1251 # (cs_w32_wrxchg2_ext.asm / cs_w32_wrxchg2st64.asm headers)
1252 "cs_w32_wrxchg2_ext": [0x77777777, 0x88880008, 0x99990009, 0xDEADBEEF,
1253 0xAAAAAAAA, 0xBBBBBBBB, 0x12341234, 0x56785678],
1254 "cs_w32_wrxchg2st64": [0x33333333, 0x44444444, 0x55550005, 0x66660006,
1255 0xB0B00084, 0xB0B00088, 0xB0B00140, 0xB0B002C0],
1250 # ds_mskor, ds_and/xor_b64, ds_add_rtn_f32, ds_inc/dec/rsub_u32 (cs_lds_atomics_ext.asm header) 1256 # ds_mskor, ds_and/xor_b64, ds_add_rtn_f32, ds_inc/dec/rsub_u32 (cs_lds_atomics_ext.asm header)
1251 "cs_lds_atomics_ext": [0xF0F11234, 0xAB34CD78, 0x12345678, 0xF0F00F0F, 1257 "cs_lds_atomics_ext": [0xF0F11234, 0xAB34CD78, 0x12345678, 0xF0F00F0F,
1252 0xA5A55A5A, 0x00AA00AA, 0x7FB00000, 0xFE090700], 1258 0xA5A55A5A, 0x00AA00AA, 0x7FB00000, 0xFE090700],
@@ -1337,7 +1343,7 @@ def run_suite(a, work: str) -> int:
1337 "cs_w32_lds_u8_d16", "cs_w32_int_ext", "cs_w32_salu64", "cs_w32_misc_ext", "cs_w32_new_ops", 1343 "cs_w32_lds_u8_d16", "cs_w32_int_ext", "cs_w32_salu64", "cs_w32_misc_ext", "cs_w32_new_ops",
1338 "cs_w32_lds_subdword", "cs_w32_lds_wide", 1344 "cs_w32_lds_subdword", "cs_w32_lds_wide",
1339 "cs_bpermute32", "cs_w32_partial_scmp", "cs_w32_partial_permute", "cs_w32_permlane_fi", "cs_w32_sincos", "cs_w32_buffer_sub16", "cs_w32_buffer_store_sub", "cs_w32_fcmpswap", 1345 "cs_bpermute32", "cs_w32_partial_scmp", "cs_w32_partial_permute", "cs_w32_permlane_fi", "cs_w32_sincos", "cs_w32_buffer_sub16", "cs_w32_buffer_store_sub", "cs_w32_fcmpswap",
1340 "cs_lds_b64_cmpst", "cs_lds_xchg64_ext", "cs_lds_atomics_ext", "cs_exec_const", "cs_w32_mask_imm", "cs_mask_vgpr_exec", 1346 "cs_lds_b64_cmpst", "cs_lds_xchg64_ext", "cs_lds_atomics_ext", "cs_w32_wrxchg2_ext", "cs_w32_wrxchg2st64", "cs_exec_const", "cs_w32_mask_imm", "cs_mask_vgpr_exec",
1341 "cs_dpp", "cs_dpp_row", "cs_dpp_mask", "cs_dpp8", 1347 "cs_dpp", "cs_dpp_row", "cs_dpp_mask", "cs_dpp8",
1342 "cs_dpp_ops", "cs_dpp_bound", "cs_dpp_bank", "cs_dpp_fi", "cs_dpp_cmp", "cs_w32_andn2_exec", 1348 "cs_dpp_ops", "cs_dpp_bound", "cs_dpp_bank", "cs_dpp_fi", "cs_dpp_cmp", "cs_w32_andn2_exec",
1343 "cs_w32_exec_computed") and not emulated and not partial 1349 "cs_w32_exec_computed") and not emulated and not partial
@@ -1364,7 +1370,7 @@ def run_suite(a, work: str) -> int:
1364 ok, detail = judge_cs_dump(rc, msg, want, wave64=wave64, partial=partial, emulated=emulated, 1370 ok, detail = judge_cs_dump(rc, msg, want, wave64=wave64, partial=partial, emulated=emulated,
1365 hexwords=name in ("cs_store", "cs_smem_soffset_imm", "cs_w32_lds_u8_d16", 1371 hexwords=name in ("cs_store", "cs_smem_soffset_imm", "cs_w32_lds_u8_d16",
1366 "cs_w32_lds_subdword", "cs_w32_lds_wide", 1372 "cs_w32_lds_subdword", "cs_w32_lds_wide",
1367 "cs_lds_b64_cmpst", "cs_lds_xchg64_ext", "cs_lds_atomics_ext", "cs_signed_zero_nan")) 1373 "cs_lds_b64_cmpst", "cs_lds_xchg64_ext", "cs_lds_atomics_ext", "cs_w32_wrxchg2_ext", "cs_w32_wrxchg2st64", "cs_signed_zero_nan"))
1368 if ok and None in want: 1374 if ok and None in want:
1369 unjudged = ", ".join(str(i) for i, w in enumerate(want) if w is None) 1375 unjudged = ", ".join(str(i) for i, w in enumerate(want) if w is None)
1370 detail += f" (words {unjudged} not judged on this device: UNJUDGED_WORDS in check.py)" 1376 detail += f" (words {unjudged} not judged on this device: UNJUDGED_WORDS in check.py)"