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:
authormilk4sale <53350507+milk4sale@users.noreply.github.com>2026-11-24 16:31:06 -0600
committermilk4sale <53350507+milk4sale@users.noreply.github.com>2026-11-24 16:31:06 -0600
commite040dce1f09d42f21a8fed75668c53c0d49fb57a (patch)
tree3b254dec5ef8caf9a86f63abf4771913f24a2fbb /scripts/run_gpu_tests.py
parent60c2ed910b90aef3cf5af1df2366a28a25afbe64 (diff)
parent68d1331e5fe9bb4c9d02deabeb5905e55c23b7c8 (diff)
Merge main into gpu-test/round-f64
Brings the branch up to date with main 68d1331e5. No conflicts; the merged tree was tested before the push (every standalone test file under tests/ passes except tests/test_ci_registration.py, which fails on main alone since #930). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Diffstat (limited to 'scripts/run_gpu_tests.py')
-rw-r--r--scripts/run_gpu_tests.py18
1 files changed, 16 insertions, 2 deletions
diff --git a/scripts/run_gpu_tests.py b/scripts/run_gpu_tests.py
index aac6efeee..e62471c2a 100644
--- a/scripts/run_gpu_tests.py
+++ b/scripts/run_gpu_tests.py
@@ -96,10 +96,23 @@ def make_ms_psv0(threads_x: int, maxv: int, maxp: int, topology: int = 2, group_
96 return struct.pack("<I", len(r)) + bytes(r) 96 return struct.pack("<I", len(r)) + bytes(r)
97 97
98 98
99# A comment line a .asm carries when llvm-mc cannot assemble it (cs_dpp_cmp.asm: a VOPC compare in DPP form).
100TEXT_ONLY_MARK = "; run_gpu_tests: text only, llvm-mc has no gfx1013 encoding for an instruction here"
101
102
99def assemble_to_s(llvm_mc: str, asm_path: str, s_path: str, name: str) -> None: 103def assemble_to_s(llvm_mc: str, asm_path: str, s_path: str, name: str) -> None:
100 """Assemble raw RDNA2 .asm with llvm-mc -show-encoding into .s format for rdna2spirv.py.""" 104 """Assemble raw RDNA2 .asm with llvm-mc -show-encoding into .s format for rdna2spirv.py."""
101 with open(asm_path, encoding="utf-8") as source: 105 with open(asm_path, encoding="utf-8") as source:
102 raw = source.read() 106 raw = source.read()
107 if any(ln.strip() == TEXT_ONLY_MARK for ln in raw.splitlines()):
108 # The source holds an instruction llvm-mc has no gfx1013 encoding for. The translator reads straight-line
109 # code from its text alone (tests/semantic/regen_fixtures.py writes such listings), so the lines go through
110 # as they are.
111 lines = [f"; {name} code 0x0..0x0 (synthetic), gfx1013, 0 invalid words"]
112 lines += ["\t" + ln.strip() for ln in raw.splitlines() if ln.strip() and not ln.lstrip().startswith(";")]
113 with open(s_path, "w", encoding="utf-8", newline="\n") as f:
114 f.write("\n".join(lines) + "\n")
115 return
103 cmd = mc_command.mc_command(llvm_mc) + ["-triple=amdgcn--amdpal", "-mcpu=gfx1013"] 116 cmd = mc_command.mc_command(llvm_mc) + ["-triple=amdgcn--amdpal", "-mcpu=gfx1013"]
104 for ln in raw.splitlines(): 117 for ln in raw.splitlines():
105 s = ln.strip() 118 s = ln.strip()
@@ -1177,7 +1190,7 @@ def run_suite(a, work: str) -> int:
1177 results.append((name,) + wavemask_check(vk_compute, spv, cs_env, w64_emulated())) 1190 results.append((name,) + wavemask_check(vk_compute, spv, cs_env, w64_emulated()))
1178 elif name in ("cs_store", "cs_signed_zero_nan", "cs_smem_soffset_imm", "cs_w32_lane_wrap", "cs_movrelsd_2", "cs_w32_permute", "cs_w32_sincos", "cs_w32_buffer_sub16", "cs_w32_buffer_store_sub", "cs_w32_fcmpswap", "cs_w32_permlane_fi", "cs_exec_const", "cs_w32_mask_imm", "cs_w64_mask_imm", "cs_w32_lds_u8_d16", "cs_w32_lds_subdword", "cs_w32_lds_wide", "cs_w32_int_ext", "cs_w32_salu64", "cs_w32_misc_ext", "cs_w32_new_ops", "cs_wave64_ballot", "cs_wm_half_ops", "cs_wm_half_cmp", "cs_wm_bfm64", "cs_wm_scc_rfl", "cs_wqm_w64", "cs_wqm_w32", "cs_wqm_w64_half", 1191 elif name in ("cs_store", "cs_signed_zero_nan", "cs_smem_soffset_imm", "cs_w32_lane_wrap", "cs_movrelsd_2", "cs_w32_permute", "cs_w32_sincos", "cs_w32_buffer_sub16", "cs_w32_buffer_store_sub", "cs_w32_fcmpswap", "cs_w32_permlane_fi", "cs_exec_const", "cs_w32_mask_imm", "cs_w64_mask_imm", "cs_w32_lds_u8_d16", "cs_w32_lds_subdword", "cs_w32_lds_wide", "cs_w32_int_ext", "cs_w32_salu64", "cs_w32_misc_ext", "cs_w32_new_ops", "cs_wave64_ballot", "cs_wm_half_ops", "cs_wm_half_cmp", "cs_wm_bfm64", "cs_wm_scc_rfl", "cs_wqm_w64", "cs_wqm_w32", "cs_wqm_w64_half",
1179 "cs_dpp", "cs_dpp_row", "cs_dpp_mask", "cs_dpp8", "cs_dpp_ops", "cs_dpp_bank", "cs_dpp_fi", 1192 "cs_dpp", "cs_dpp_row", "cs_dpp_mask", "cs_dpp8", "cs_dpp_ops", "cs_dpp_bank", "cs_dpp_fi",
1180 "cs_dpp_bound", "cs_dpp_w64", 1193 "cs_dpp_bound", "cs_dpp_cmp", "cs_dpp_w64",
1181 "cs_w64_mask_detect", 1194 "cs_w64_mask_detect",
1182 "cs_w64x_readlane", "cs_w64x_writelane", "cs_w64x_readfirstlane", "cs_w64x_bpermute", "cs_w64x_permute", 1195 "cs_w64x_readlane", "cs_w64x_writelane", "cs_w64x_readfirstlane", "cs_w64x_bpermute", "cs_w64x_permute",
1183 "cs_w64x_branch", "cs_w64x_ballot", "cs_w64x_wg128_branches", "cs_w64x_lds_raw", 1196 "cs_w64x_branch", "cs_w64x_ballot", "cs_w64x_wg128_branches", "cs_w64x_lds_raw",
@@ -1238,6 +1251,7 @@ def run_suite(a, work: str) -> int:
1238 "cs_dpp_bound": [10, 10, 11, 12, 13, 14, 15, 16], 1251 "cs_dpp_bound": [10, 10, 11, 12, 13, 14, 15, 16],
1239 "cs_dpp_bank": [0xFFFFFFFF, 0xFFFFFFFE, 0xFFFFFFFD, 0xFFFFFFFC, 7, 7, 7, 7], 1252 "cs_dpp_bank": [0xFFFFFFFF, 0xFFFFFFFE, 0xFFFFFFFD, 0xFFFFFFFC, 7, 7, 7, 7],
1240 "cs_dpp_fi": [1, 2, 3, 0x7777, 5, 6, 7, 0x7777], 1253 "cs_dpp_fi": [1, 2, 3, 0x7777, 5, 6, 7, 0x7777],
1254 "cs_dpp_cmp": [3, 2, 3, 2, 1, 0, 1, 0],
1241 "cs_dpp_w64": [1, 0, 3, 2, 5, 4, 7, 6], 1255 "cs_dpp_w64": [1, 0, 3, 2, 5, 4, 7, 6],
1242 # SHADER-99: -0 and NaN survive (SignedZeroInfNanPreserve, cs_signed_zero_nan.asm); 0 in out[4..7] 1256 # SHADER-99: -0 and NaN survive (SignedZeroInfNanPreserve, cs_signed_zero_nan.asm); 0 in out[4..7]
1243 # without it 1257 # without it
@@ -1312,7 +1326,7 @@ def run_suite(a, work: str) -> int:
1312 "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", 1326 "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",
1313 "cs_lds_b64_cmpst", "cs_lds_xchg64_ext", "cs_lds_atomics_ext", "cs_exec_const", "cs_w32_mask_imm", "cs_mask_vgpr_exec", 1327 "cs_lds_b64_cmpst", "cs_lds_xchg64_ext", "cs_lds_atomics_ext", "cs_exec_const", "cs_w32_mask_imm", "cs_mask_vgpr_exec",
1314 "cs_dpp", "cs_dpp_row", "cs_dpp_mask", "cs_dpp8", 1328 "cs_dpp", "cs_dpp_row", "cs_dpp_mask", "cs_dpp8",
1315 "cs_dpp_ops", "cs_dpp_bound", "cs_dpp_bank", "cs_dpp_fi", "cs_w32_andn2_exec", 1329 "cs_dpp_ops", "cs_dpp_bound", "cs_dpp_bank", "cs_dpp_fi", "cs_dpp_cmp", "cs_w32_andn2_exec",
1316 "cs_w32_exec_computed") and not emulated and not partial 1330 "cs_w32_exec_computed") and not emulated and not partial
1317 if partial and not emulated: 1331 if partial and not emulated:
1318 cs_env = dict(os.environ, VKC_SUBGROUP_SIZE="64") 1332 cs_env = dict(os.environ, VKC_SUBGROUP_SIZE="64")