diff options
| author | milk4sale <53350507+milk4sale@users.noreply.github.com> | 2026-11-24 16:31:07 -0600 |
|---|---|---|
| committer | milk4sale <53350507+milk4sale@users.noreply.github.com> | 2026-11-24 16:31:07 -0600 |
| commit | 2eb49b1a6fdbba711a5567613297a735503a6fcb (patch) | |
| tree | 91b6825c0aee378c77ff5da224e100d757bee556 /scripts/run_gpu_tests.py | |
| parent | eba94cbe893de58b059a4ded35c498fea32a32d0 (diff) | |
| parent | 68d1331e5fe9bb4c9d02deabeb5905e55c23b7c8 (diff) | |
Merge main into gpu-test/frexp-ldexp
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.py | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/scripts/run_gpu_tests.py b/scripts/run_gpu_tests.py index 180c9773a..75da4cd3a 100644 --- a/scripts/run_gpu_tests.py +++ b/scripts/run_gpu_tests.py | |||
| @@ -97,10 +97,23 @@ def make_ms_psv0(threads_x: int, maxv: int, maxp: int, topology: int = 2, group_ | |||
| 97 | return struct.pack("<I", len(r)) + bytes(r) | 97 | return struct.pack("<I", len(r)) + bytes(r) |
| 98 | 98 | ||
| 99 | 99 | ||
| 100 | # A comment line a .asm carries when llvm-mc cannot assemble it (cs_dpp_cmp.asm: a VOPC compare in DPP form). | ||
| 101 | TEXT_ONLY_MARK = "; run_gpu_tests: text only, llvm-mc has no gfx1013 encoding for an instruction here" | ||
| 102 | |||
| 103 | |||
| 100 | def assemble_to_s(llvm_mc: str, asm_path: str, s_path: str, name: str) -> None: | 104 | def assemble_to_s(llvm_mc: str, asm_path: str, s_path: str, name: str) -> None: |
| 101 | """Assemble raw RDNA2 .asm with llvm-mc -show-encoding into .s format for rdna2spirv.py.""" | 105 | """Assemble raw RDNA2 .asm with llvm-mc -show-encoding into .s format for rdna2spirv.py.""" |
| 102 | with open(asm_path, encoding="utf-8") as source: | 106 | with open(asm_path, encoding="utf-8") as source: |
| 103 | raw = source.read() | 107 | raw = source.read() |
| 108 | if any(ln.strip() == TEXT_ONLY_MARK for ln in raw.splitlines()): | ||
| 109 | # The source holds an instruction llvm-mc has no gfx1013 encoding for. The translator reads straight-line | ||
| 110 | # code from its text alone (tests/semantic/regen_fixtures.py writes such listings), so the lines go through | ||
| 111 | # as they are. | ||
| 112 | lines = [f"; {name} code 0x0..0x0 (synthetic), gfx1013, 0 invalid words"] | ||
| 113 | lines += ["\t" + ln.strip() for ln in raw.splitlines() if ln.strip() and not ln.lstrip().startswith(";")] | ||
| 114 | with open(s_path, "w", encoding="utf-8", newline="\n") as f: | ||
| 115 | f.write("\n".join(lines) + "\n") | ||
| 116 | return | ||
| 104 | cmd = mc_command.mc_command(llvm_mc) + ["-triple=amdgcn--amdpal", "-mcpu=gfx1013"] | 117 | cmd = mc_command.mc_command(llvm_mc) + ["-triple=amdgcn--amdpal", "-mcpu=gfx1013"] |
| 105 | for ln in raw.splitlines(): | 118 | for ln in raw.splitlines(): |
| 106 | s = ln.strip() | 119 | s = ln.strip() |
| @@ -1182,7 +1195,7 @@ def run_suite(a, work: str) -> int: | |||
| 1182 | results.append((name,) + wavemask_check(vk_compute, spv, cs_env, w64_emulated())) | 1195 | results.append((name,) + wavemask_check(vk_compute, spv, cs_env, w64_emulated())) |
| 1183 | 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", | 1196 | 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", |
| 1184 | "cs_dpp", "cs_dpp_row", "cs_dpp_mask", "cs_dpp8", "cs_dpp_ops", "cs_dpp_bank", "cs_dpp_fi", | 1197 | "cs_dpp", "cs_dpp_row", "cs_dpp_mask", "cs_dpp8", "cs_dpp_ops", "cs_dpp_bank", "cs_dpp_fi", |
| 1185 | "cs_dpp_bound", "cs_dpp_w64", | 1198 | "cs_dpp_bound", "cs_dpp_cmp", "cs_dpp_w64", |
| 1186 | "cs_w64_mask_detect", | 1199 | "cs_w64_mask_detect", |
| 1187 | "cs_w64x_readlane", "cs_w64x_writelane", "cs_w64x_readfirstlane", "cs_w64x_bpermute", "cs_w64x_permute", | 1200 | "cs_w64x_readlane", "cs_w64x_writelane", "cs_w64x_readfirstlane", "cs_w64x_bpermute", "cs_w64x_permute", |
| 1188 | "cs_w64x_branch", "cs_w64x_ballot", "cs_w64x_wg128_branches", "cs_w64x_lds_raw", | 1201 | "cs_w64x_branch", "cs_w64x_ballot", "cs_w64x_wg128_branches", "cs_w64x_lds_raw", |
| @@ -1243,6 +1256,7 @@ def run_suite(a, work: str) -> int: | |||
| 1243 | "cs_dpp_bound": [10, 10, 11, 12, 13, 14, 15, 16], | 1256 | "cs_dpp_bound": [10, 10, 11, 12, 13, 14, 15, 16], |
| 1244 | "cs_dpp_bank": [0xFFFFFFFF, 0xFFFFFFFE, 0xFFFFFFFD, 0xFFFFFFFC, 7, 7, 7, 7], | 1257 | "cs_dpp_bank": [0xFFFFFFFF, 0xFFFFFFFE, 0xFFFFFFFD, 0xFFFFFFFC, 7, 7, 7, 7], |
| 1245 | "cs_dpp_fi": [1, 2, 3, 0x7777, 5, 6, 7, 0x7777], | 1258 | "cs_dpp_fi": [1, 2, 3, 0x7777, 5, 6, 7, 0x7777], |
| 1259 | "cs_dpp_cmp": [3, 2, 3, 2, 1, 0, 1, 0], | ||
| 1246 | "cs_dpp_w64": [1, 0, 3, 2, 5, 4, 7, 6], | 1260 | "cs_dpp_w64": [1, 0, 3, 2, 5, 4, 7, 6], |
| 1247 | # SHADER-99: -0 and NaN survive (SignedZeroInfNanPreserve, cs_signed_zero_nan.asm); 0 in out[4..7] | 1261 | # SHADER-99: -0 and NaN survive (SignedZeroInfNanPreserve, cs_signed_zero_nan.asm); 0 in out[4..7] |
| 1248 | # without it | 1262 | # without it |
| @@ -1317,7 +1331,7 @@ def run_suite(a, work: str) -> int: | |||
| 1317 | "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", | 1331 | "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", |
| 1318 | "cs_lds_b64_cmpst", "cs_lds_xchg64_ext", "cs_lds_atomics_ext", "cs_exec_const", "cs_w32_mask_imm", "cs_mask_vgpr_exec", | 1332 | "cs_lds_b64_cmpst", "cs_lds_xchg64_ext", "cs_lds_atomics_ext", "cs_exec_const", "cs_w32_mask_imm", "cs_mask_vgpr_exec", |
| 1319 | "cs_dpp", "cs_dpp_row", "cs_dpp_mask", "cs_dpp8", | 1333 | "cs_dpp", "cs_dpp_row", "cs_dpp_mask", "cs_dpp8", |
| 1320 | "cs_dpp_ops", "cs_dpp_bound", "cs_dpp_bank", "cs_dpp_fi", "cs_w32_andn2_exec", | 1334 | "cs_dpp_ops", "cs_dpp_bound", "cs_dpp_bank", "cs_dpp_fi", "cs_dpp_cmp", "cs_w32_andn2_exec", |
| 1321 | "cs_w32_exec_computed") and not emulated and not partial | 1335 | "cs_w32_exec_computed") and not emulated and not partial |
| 1322 | if partial and not emulated: | 1336 | if partial and not emulated: |
| 1323 | cs_env = dict(os.environ, VKC_SUBGROUP_SIZE="64") | 1337 | cs_env = dict(os.environ, VKC_SUBGROUP_SIZE="64") |