diff options
| author | milk4sale <53350507+milk4sale@users.noreply.github.com> | 2026-11-24 16:31:06 -0600 |
|---|---|---|
| committer | milk4sale <53350507+milk4sale@users.noreply.github.com> | 2026-11-24 16:31:06 -0600 |
| commit | d366ee248992db80d03ac1e5ce323058c6ac9e5d (patch) | |
| tree | a5574bc7ace504306ca3c38db66f758f55af3aa9 /scripts/run_gpu_tests.py | |
| parent | 50407827cd2cb73313c585cdf3d3d40ed7918bae (diff) | |
| parent | 68d1331e5fe9bb4c9d02deabeb5905e55c23b7c8 (diff) | |
Merge main into gpu-test/cmp-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.py | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/scripts/run_gpu_tests.py b/scripts/run_gpu_tests.py index fa69a5f1e..c2da9234f 100644 --- a/scripts/run_gpu_tests.py +++ b/scripts/run_gpu_tests.py | |||
| @@ -95,10 +95,23 @@ def make_ms_psv0(threads_x: int, maxv: int, maxp: int, topology: int = 2, group_ | |||
| 95 | return struct.pack("<I", len(r)) + bytes(r) | 95 | return struct.pack("<I", len(r)) + bytes(r) |
| 96 | 96 | ||
| 97 | 97 | ||
| 98 | # A comment line a .asm carries when llvm-mc cannot assemble it (cs_dpp_cmp.asm: a VOPC compare in DPP form). | ||
| 99 | TEXT_ONLY_MARK = "; run_gpu_tests: text only, llvm-mc has no gfx1013 encoding for an instruction here" | ||
| 100 | |||
| 101 | |||
| 98 | def assemble_to_s(llvm_mc: str, asm_path: str, s_path: str, name: str) -> None: | 102 | def assemble_to_s(llvm_mc: str, asm_path: str, s_path: str, name: str) -> None: |
| 99 | """Assemble raw RDNA2 .asm with llvm-mc -show-encoding into .s format for rdna2spirv.py.""" | 103 | """Assemble raw RDNA2 .asm with llvm-mc -show-encoding into .s format for rdna2spirv.py.""" |
| 100 | with open(asm_path, encoding="utf-8") as source: | 104 | with open(asm_path, encoding="utf-8") as source: |
| 101 | raw = source.read() | 105 | raw = source.read() |
| 106 | if any(ln.strip() == TEXT_ONLY_MARK for ln in raw.splitlines()): | ||
| 107 | # The source holds an instruction llvm-mc has no gfx1013 encoding for. The translator reads straight-line | ||
| 108 | # code from its text alone (tests/semantic/regen_fixtures.py writes such listings), so the lines go through | ||
| 109 | # as they are. | ||
| 110 | lines = [f"; {name} code 0x0..0x0 (synthetic), gfx1013, 0 invalid words"] | ||
| 111 | lines += ["\t" + ln.strip() for ln in raw.splitlines() if ln.strip() and not ln.lstrip().startswith(";")] | ||
| 112 | with open(s_path, "w", encoding="utf-8", newline="\n") as f: | ||
| 113 | f.write("\n".join(lines) + "\n") | ||
| 114 | return | ||
| 102 | cmd = mc_command.mc_command(llvm_mc) + ["-triple=amdgcn--amdpal", "-mcpu=gfx1013"] | 115 | cmd = mc_command.mc_command(llvm_mc) + ["-triple=amdgcn--amdpal", "-mcpu=gfx1013"] |
| 103 | for ln in raw.splitlines(): | 116 | for ln in raw.splitlines(): |
| 104 | s = ln.strip() | 117 | s = ln.strip() |
| @@ -1172,7 +1185,7 @@ def run_suite(a, work: str) -> int: | |||
| 1172 | results.append((name,) + wavemask_check(vk_compute, spv, cs_env, w64_emulated())) | 1185 | results.append((name,) + wavemask_check(vk_compute, spv, cs_env, w64_emulated())) |
| 1173 | 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", | 1186 | 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", |
| 1174 | "cs_dpp", "cs_dpp_row", "cs_dpp_mask", "cs_dpp8", "cs_dpp_ops", "cs_dpp_bank", "cs_dpp_fi", | 1187 | "cs_dpp", "cs_dpp_row", "cs_dpp_mask", "cs_dpp8", "cs_dpp_ops", "cs_dpp_bank", "cs_dpp_fi", |
| 1175 | "cs_dpp_bound", "cs_dpp_w64", | 1188 | "cs_dpp_bound", "cs_dpp_cmp", "cs_dpp_w64", |
| 1176 | "cs_w64_mask_detect", | 1189 | "cs_w64_mask_detect", |
| 1177 | "cs_w64x_readlane", "cs_w64x_writelane", "cs_w64x_readfirstlane", "cs_w64x_bpermute", "cs_w64x_permute", | 1190 | "cs_w64x_readlane", "cs_w64x_writelane", "cs_w64x_readfirstlane", "cs_w64x_bpermute", "cs_w64x_permute", |
| 1178 | "cs_w64x_branch", "cs_w64x_ballot", "cs_w64x_wg128_branches", "cs_w64x_lds_raw", | 1191 | "cs_w64x_branch", "cs_w64x_ballot", "cs_w64x_wg128_branches", "cs_w64x_lds_raw", |
| @@ -1233,6 +1246,7 @@ def run_suite(a, work: str) -> int: | |||
| 1233 | "cs_dpp_bound": [10, 10, 11, 12, 13, 14, 15, 16], | 1246 | "cs_dpp_bound": [10, 10, 11, 12, 13, 14, 15, 16], |
| 1234 | "cs_dpp_bank": [0xFFFFFFFF, 0xFFFFFFFE, 0xFFFFFFFD, 0xFFFFFFFC, 7, 7, 7, 7], | 1247 | "cs_dpp_bank": [0xFFFFFFFF, 0xFFFFFFFE, 0xFFFFFFFD, 0xFFFFFFFC, 7, 7, 7, 7], |
| 1235 | "cs_dpp_fi": [1, 2, 3, 0x7777, 5, 6, 7, 0x7777], | 1248 | "cs_dpp_fi": [1, 2, 3, 0x7777, 5, 6, 7, 0x7777], |
| 1249 | "cs_dpp_cmp": [3, 2, 3, 2, 1, 0, 1, 0], | ||
| 1236 | "cs_dpp_w64": [1, 0, 3, 2, 5, 4, 7, 6], | 1250 | "cs_dpp_w64": [1, 0, 3, 2, 5, 4, 7, 6], |
| 1237 | # SHADER-99: -0 and NaN survive (SignedZeroInfNanPreserve, cs_signed_zero_nan.asm); 0 in out[4..7] | 1251 | # SHADER-99: -0 and NaN survive (SignedZeroInfNanPreserve, cs_signed_zero_nan.asm); 0 in out[4..7] |
| 1238 | # without it | 1252 | # without it |
| @@ -1307,7 +1321,7 @@ def run_suite(a, work: str) -> int: | |||
| 1307 | "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", | 1321 | "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", |
| 1308 | "cs_lds_b64_cmpst", "cs_lds_xchg64_ext", "cs_lds_atomics_ext", "cs_exec_const", "cs_w32_mask_imm", "cs_mask_vgpr_exec", | 1322 | "cs_lds_b64_cmpst", "cs_lds_xchg64_ext", "cs_lds_atomics_ext", "cs_exec_const", "cs_w32_mask_imm", "cs_mask_vgpr_exec", |
| 1309 | "cs_dpp", "cs_dpp_row", "cs_dpp_mask", "cs_dpp8", | 1323 | "cs_dpp", "cs_dpp_row", "cs_dpp_mask", "cs_dpp8", |
| 1310 | "cs_dpp_ops", "cs_dpp_bound", "cs_dpp_bank", "cs_dpp_fi", "cs_w32_andn2_exec", | 1324 | "cs_dpp_ops", "cs_dpp_bound", "cs_dpp_bank", "cs_dpp_fi", "cs_dpp_cmp", "cs_w32_andn2_exec", |
| 1311 | "cs_w32_exec_computed") and not emulated and not partial | 1325 | "cs_w32_exec_computed") and not emulated and not partial |
| 1312 | if partial and not emulated: | 1326 | if partial and not emulated: |
| 1313 | cs_env = dict(os.environ, VKC_SUBGROUP_SIZE="64") | 1327 | cs_env = dict(os.environ, VKC_SUBGROUP_SIZE="64") |