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:
Diffstat (limited to 'scripts/run_gpu_tests.py')
-rw-r--r--scripts/run_gpu_tests.py97
1 files changed, 76 insertions, 21 deletions
diff --git a/scripts/run_gpu_tests.py b/scripts/run_gpu_tests.py
index a075c876a..8ba62104d 100644
--- a/scripts/run_gpu_tests.py
+++ b/scripts/run_gpu_tests.py
@@ -25,17 +25,22 @@ sys.path.insert(0, os.path.join(ROOT, "tools"))
25import mc_command # noqa: E402 25import mc_command # noqa: E402
26sys.path.insert(0, SHADER_DIR) 26sys.path.insert(0, SHADER_DIR)
27from build import CLIP_CASES, clip_container, shader_source 27from build import CLIP_CASES, clip_container, shader_source
28from check import (Skip, clip_test, fmt_1010102_test, fmt_d16_xyz_test, fmt_int_narrow_test, fmt_sint32_test, 28from check import (Skip, clip_test, fmt_1010102_test, fmt_d16_xyz_test, fmt_int_narrow_test,
29 fmt_xy_xyz_test, tbuffer_store_test) 29 fmt_sint32_test, fmt_xy_xyz_test, tbuffer_store_test, compute_unsupported)
30from check import compute_unsupported # vk_compute_test's exit 77 over a feature the module needs
31from compute_fixture import compute_header 30from compute_fixture import compute_header
32from check import SAMPLER_CASES, sampler_test # ps_ssharp: the S#/T# mip fields (vk_sampler_test) 31from check import SAMPLER_CASES, sampler_test # ps_ssharp: the S#/T# mip fields (vk_sampler_test)
33from check import (CMPX_CLASS_WORDS, CVT_F32_SAT_CASES, CVT_PK_U8_WORDS, PK_MUL_LO_WORDS, GRADIENT_TESTS, TEST_PROGRAMS, TEXTURE_MIP_DEPENDENCIES, 32from check import (CS_SMEM_VCC, CMPX_CLASS_WORDS, CVT_F32_SAT_CASES, CVT_PK_U8_WORDS, PK_MUL_LO_WORDS, GRADIENT_TESTS, TEST_PROGRAMS, TEXTURE_MIP_DEPENDENCIES,
34 TEXTURE_MIP_TEST, GATHER_LOD_TEST, MIP_TEST_PASSES, TEXTURE_CONSTANTS, USER_SGPRS_ENV, USER_SGPRS_WORDS, Skip, mesh_v5_test, not_found_message, 33 TEXTURE_MIP_TEST, GATHER_LOD_TEST, MIP_TEST_PASSES, TEXTURE_CONSTANTS, USER_SGPRS_ENV, USER_SGPRS_WORDS, Skip, mesh_v5_test, not_found_message,
35 pick_build_dir, start_failure, table_fetch_test, texture_gradient_a16_test, texture_mip_test) 34 pick_build_dir, start_failure, table_fetch_test, texture_gradient_a16_test, texture_mip_test)
36from check import SIGNED_MIP_TEST, UINT_MIP_TEST 35from check import SIGNED_MIP_TEST, UINT_MIP_TEST
37from check import cbv_modulate_test 36from check import cbv_modulate_test
37from check import IMAGE_STORE_CASES, texture_uav_test
38from check import salu_ext_test # 38 scalar ALU ops on operands seeded through VKC_SGPRS
38from check import HEAP_INIT_EXPECTED, heap_init_env # cs_heap_init: vk_compute_test's VKC_HEAP_INIT 39from check import HEAP_INIT_EXPECTED, heap_init_env # cs_heap_init: vk_compute_test's VKC_HEAP_INIT
40from check import shift64_test # dynamic 64-bit vector shifts and overlapping destinations
41from check import cmp_f64_test # the 32 binary64 vector compares on memory-fed operands
42from check import round_f64_test # the four binary64 roundings on memory-fed inputs
43from check import frexp_ldexp_test # binary32 and binary64 frexp, and v_ldexp_f32, on memory-fed records
39from check import judged_words, words_match # dump words not judged on some devices (cs_signed_zero_nan) 44from check import judged_words, words_match # dump words not judged on some devices (cs_signed_zero_nan)
40from check import TEXOFF_ARGS, texoff_problem # ps_texoff's expected words and arguments live in check.py 45from check import TEXOFF_ARGS, texoff_problem # ps_texoff's expected words and arguments live in check.py
41from check import TEXOFF_FALLBACK, texoff_env # LEONIDA_TEXOFF_FALLBACK=1: texel offsets without maintenance8 46from check import TEXOFF_FALLBACK, texoff_env # LEONIDA_TEXOFF_FALLBACK=1: texel offsets without maintenance8
@@ -93,10 +98,23 @@ def make_ms_psv0(threads_x: int, maxv: int, maxp: int, topology: int = 2, group_
93 return struct.pack("<I", len(r)) + bytes(r) 98 return struct.pack("<I", len(r)) + bytes(r)
94 99
95 100
101# A comment line a .asm carries when llvm-mc cannot assemble it (cs_dpp_cmp.asm: a VOPC compare in DPP form).
102TEXT_ONLY_MARK = "; run_gpu_tests: text only, llvm-mc has no gfx1013 encoding for an instruction here"
103
104
96def assemble_to_s(llvm_mc: str, asm_path: str, s_path: str, name: str) -> None: 105def assemble_to_s(llvm_mc: str, asm_path: str, s_path: str, name: str) -> None:
97 """Assemble raw RDNA2 .asm with llvm-mc -show-encoding into .s format for rdna2spirv.py.""" 106 """Assemble raw RDNA2 .asm with llvm-mc -show-encoding into .s format for rdna2spirv.py."""
98 with open(asm_path, encoding="utf-8") as source: 107 with open(asm_path, encoding="utf-8") as source:
99 raw = source.read() 108 raw = source.read()
109 if any(ln.strip() == TEXT_ONLY_MARK for ln in raw.splitlines()):
110 # The source holds an instruction llvm-mc has no gfx1013 encoding for. The translator reads straight-line
111 # code from its text alone (tests/semantic/regen_fixtures.py writes such listings), so the lines go through
112 # as they are.
113 lines = [f"; {name} code 0x0..0x0 (synthetic), gfx1013, 0 invalid words"]
114 lines += ["\t" + ln.strip() for ln in raw.splitlines() if ln.strip() and not ln.lstrip().startswith(";")]
115 with open(s_path, "w", encoding="utf-8", newline="\n") as f:
116 f.write("\n".join(lines) + "\n")
117 return
100 cmd = mc_command.mc_command(llvm_mc) + ["-triple=amdgcn--amdpal", "-mcpu=gfx1013"] 118 cmd = mc_command.mc_command(llvm_mc) + ["-triple=amdgcn--amdpal", "-mcpu=gfx1013"]
101 for ln in raw.splitlines(): 119 for ln in raw.splitlines():
102 s = ln.strip() 120 s = ln.strip()
@@ -149,8 +167,13 @@ def spirv_as(asm_text: str, out_spv: str, assembler: str = "spirv-as") -> None:
149 with open(out_spv, "wb") as f: 167 with open(out_spv, "wb") as f:
150 f.write(spv_bytes) 168 f.write(spv_bytes)
151 return 169 return
152 p = subprocess.run(["spirv-as", "--target-env", "vulkan1.2", "-o", out_spv, "-"], 170 try:
153 input=asm_text, capture_output=True, text=True) 171 p = subprocess.run(["spirv-as", "--target-env", "vulkan1.2", "-o", out_spv, "-"],
172 input=asm_text, capture_output=True, text=True)
173 except FileNotFoundError:
174 raise RuntimeError("spirv-as not found on PATH (use --assembler python to assemble with tools/spirv_asm.py)") from None
175 except OSError as exc:
176 raise RuntimeError(f"spirv-as could not be started: {exc.strerror or exc}") from None
154 if p.returncode != 0: 177 if p.returncode != 0:
155 raise RuntimeError(f"spirv-as failed for {out_spv}:\n{p.stderr}") 178 raise RuntimeError(f"spirv-as failed for {out_spv}:\n{p.stderr}")
156 179
@@ -258,6 +281,8 @@ def read_raw_u32(path: str) -> list[tuple[int, int, int, int]]:
258 return [struct.unpack_from("<4I", data, 16 * i) for i in range(n)] 281 return [struct.unpack_from("<4I", data, 16 * i) for i in range(n)]
259 282
260 283
284# cs_div_fmas_f64_rt's operands a = 1 + 2^-30, c = -(1 + 2^-29) as s4..s7 (low word first).
285DIV_FMAS_F64_SGPRS = "0x00400000,0x3ff00000,0x00800000,0xbff00000"
261UNSUPPORTED = 77 # vk_harness: the device lacks a stage the test draws with (geometry or mesh shaders) 286UNSUPPORTED = 77 # vk_harness: the device lacks a stage the test draws with (geometry or mesh shaders)
262 287
263 288
@@ -423,8 +448,10 @@ def judge_cs_dump(rc: int, msg: str, want: list[int], *, wave64: bool, partial:
423 return None, "SKIP (no 64-wide compute subgroup on this device)" 448 return None, "SKIP (no 64-wide compute subgroup on this device)"
424 if rc == 0 and wave64 and "compute subgroup size: 64" not in msg.splitlines(): 449 if rc == 0 and wave64 and "compute subgroup size: 64" not in msg.splitlines():
425 return False, "64-wide subgroup was not confirmed (rebuild vk_compute_test)" 450 return False, "64-wide subgroup was not confirmed (rebuild vk_compute_test)"
451 if rc != 0:
452 return False, f"exit {rc}: {msg or 'no test output'}"
426 words = dump_words(msg) 453 words = dump_words(msg)
427 if rc != 0 or words is None: 454 if words is None:
428 return False, msg 455 return False, msg
429 vals = words[:len(want)] 456 vals = words[:len(want)]
430 return words_match(vals, want), " ".join((hex if hexwords else str)(x) for x in vals) 457 return words_match(vals, want), " ".join((hex if hexwords else str)(x) for x in vals)
@@ -659,7 +686,8 @@ OTHER_HARNESS = {"ps_m15": "d3d12_translated_draw_test", "vs_m15": "d3d12_transl
659 "cs_m4_fill": "d3d12_m4_compute_test", "cs_m4_indirect": "d3d12_m4_compute_test", 686 "cs_m4_fill": "d3d12_m4_compute_test", "cs_m4_indirect": "d3d12_m4_compute_test",
660 "cs_buf_typed": "d3d12_buffer_uav_test", "cs_buf_counter": "d3d12_buffer_uav_test", 687 "cs_buf_typed": "d3d12_buffer_uav_test", "cs_buf_counter": "d3d12_buffer_uav_test",
661 "ps_live_width": "w64_graphics.py", 688 "ps_live_width": "w64_graphics.py",
662 "ps_heap_index": "d3d12_heap_index_test"} 689 "ps_heap_index": "d3d12_heap_index_test",
690 "ps_quad_flat": "d3d12_quad_index_test", "vs_quad_inst": "d3d12_quad_index_test"}
663 691
664 692
665# Shaders a selected test draws with, built even when the filter leaves them out (#192). 693# Shaders a selected test draws with, built even when the filter leaves them out (#192).
@@ -975,6 +1003,22 @@ def run_suite(a, work: str) -> int:
975 if name in CLIP_CASES: 1003 if name in CLIP_CASES:
976 detail = clip_test(a.build, spirv_dir, name) 1004 detail = clip_test(a.build, spirv_dir, name)
977 results.append((name, None if isinstance(detail, Skip) else not detail, detail or "four pixel masks exact")) 1005 results.append((name, None if isinstance(detail, Skip) else not detail, detail or "four pixel masks exact"))
1006 elif name == "cs_w32_frexp_ldexp":
1007 detail = frexp_ldexp_test(a.build, spirv_dir, cs_env)
1008 results.append((name, None if isinstance(detail, Skip) else not detail,
1009 detail or "768 words exact (64 records, eight results each, and unchanged inputs)"))
1010 elif name == "cs_w32_shift64":
1011 detail = shift64_test(a.build, spirv_dir, cs_env)
1012 results.append((name, None if isinstance(detail, Skip) else not detail,
1013 detail or "640 words exact (64 shift cases and unchanged inputs)"))
1014 elif name == "cs_w32_cmp_f64":
1015 detail = cmp_f64_test(a.build, spirv_dir, cs_env)
1016 results.append((name, None if isinstance(detail, Skip) else not detail,
1017 detail or "1536 words exact (256 operand pairs and unchanged inputs)"))
1018 elif name == "cs_w32_round_f64":
1019 detail = round_f64_test(a.build, spirv_dir, cs_env)
1020 results.append((name, None if isinstance(detail, Skip) else not detail,
1021 detail or "1152 words exact (64 inputs, eight roundings each, and unchanged inputs)"))
978 elif name == "cs_workgroup_yz": 1022 elif name == "cs_workgroup_yz":
979 rc, msg = run_cmd([vk_compute, spv, "2x3x4", "workgroup_yz"], env=cs_env) 1023 rc, msg = run_cmd([vk_compute, spv, "2x3x4", "workgroup_yz"], env=cs_env)
980 results.append((name,) + compute_result(rc, msg, rc == 0 and "2x3x4 workgroup Y/Z: 0 mismatches" 1024 results.append((name,) + compute_result(rc, msg, rc == 0 and "2x3x4 workgroup Y/Z: 0 mismatches"
@@ -1084,6 +1128,10 @@ def run_suite(a, work: str) -> int:
1084 vals = words[:len(USER_SGPRS_WORDS)] if words else [] 1128 vals = words[:len(USER_SGPRS_WORDS)] if words else []
1085 results.append((name,) + compute_result(rc, msg, rc == 0 and vals == USER_SGPRS_WORDS, 1129 results.append((name,) + compute_result(rc, msg, rc == 0 and vals == USER_SGPRS_WORDS,
1086 " ".join(hex(x) for x in vals) if vals else msg)) 1130 " ".join(hex(x) for x in vals) if vals else msg))
1131 elif name == "cs_w32_salu_ext":
1132 detail = salu_ext_test(a.build, spirv_dir, cs_env)
1133 results.append((name, None if isinstance(detail, Skip) else not detail,
1134 detail or "80 words exact (73 results of 38 scalar ops and the untouched fill)"))
1087 elif name == "cs_f64_add": 1135 elif name == "cs_f64_add":
1088 rc, msg = run_cmd([vk_compute, spv, "1", "dump"], env=cs_env) 1136 rc, msg = run_cmd([vk_compute, spv, "1", "dump"], env=cs_env)
1089 if rc == 77: # Float64, or Int64 where the module declares both: quote whichever it names 1137 if rc == 77: # Float64, or Int64 where the module declares both: quote whichever it names
@@ -1092,10 +1140,12 @@ def run_suite(a, work: str) -> int:
1092 ok, detail = judge_cs_dump(rc, msg, [0, 0x40040000], wave64=False, partial=False, emulated=False, 1140 ok, detail = judge_cs_dump(rc, msg, [0, 0x40040000], wave64=False, partial=False, emulated=False,
1093 hexwords=True) 1141 hexwords=True)
1094 results.append((name, ok, detail)) 1142 results.append((name, ok, detail))
1095 elif name == "cs_div_fmas_f64": 1143 elif name in ("cs_div_fmas_f64", "cs_div_fmas_f64_rt"):
1096 # One-rounding binary64 FMA: strict where the translator emitted OpFmaKHR on doubles (shaderFmaFloat64, 1144 # One-rounding binary64 FMA: strict where the translator emitted OpFmaKHR on doubles (shaderFmaFloat64,
1097 # --fma khr); under the default GLSL Fma the split result (0) is allowed, as cs_fma_fused allows it. 1145 # --fma khr); under the default GLSL Fma the split result (0) is allowed, as cs_fma_fused allows it.
1098 rc, msg = run_cmd([vk_compute, spv, "1", "dump"], env=cs_env) 1146 # The _rt fixture reads the same operands from s4..s7, so the driver cannot fold the Fma at compile time.
1147 env = dict(cs_env or os.environ, VKC_SGPRS=DIV_FMAS_F64_SGPRS) if name.endswith("_rt") else cs_env
1148 rc, msg = run_cmd([vk_compute, spv, "1", "dump"], env=env)
1099 if rc == UNSUPPORTED: # no shaderFloat64, or (--fma khr) no shaderFmaFloat64 1149 if rc == UNSUPPORTED: # no shaderFloat64, or (--fma khr) no shaderFmaFloat64
1100 results.append((name, None, unsupported_skip(msg))) 1150 results.append((name, None, unsupported_skip(msg)))
1101 else: 1151 else:
@@ -1105,7 +1155,8 @@ def run_suite(a, work: str) -> int:
1105 ok = rc == 0 and (words == fused or (not strict and words == split)) 1155 ok = rc == 0 and (words == fused or (not strict and words == split))
1106 detail = " ".join(hex(x) for x in words) if words else msg 1156 detail = " ".join(hex(x) for x in words) if words else msg
1107 if ok and words == split: 1157 if ok and words == split:
1108 detail += " (split: the driver rounds GLSL Fma on doubles twice; --fma khr fixes it)" 1158 detail += (" (split: the driver rounded GLSL Fma on doubles twice%s; --fma khr fixes it)"
1159 % ("" if name.endswith("_rt") else " when folding the constants"))
1109 results.append((name, ok, detail)) 1160 results.append((name, ok, detail))
1110 elif name == "cs_cvt_f32_sat": 1161 elif name == "cs_cvt_f32_sat":
1111 # #300's saturating float -> int conversions: one dispatch per input word in s4 (VKC_SGPRS). 1162 # #300's saturating float -> int conversions: one dispatch per input word in s4 (VKC_SGPRS).
@@ -1150,20 +1201,21 @@ def run_suite(a, work: str) -> int:
1150 # Whole-wave mask test, as in check.py: needs a 64-wide subgroup, skipped where the device has none. 1201 # Whole-wave mask test, as in check.py: needs a 64-wide subgroup, skipped where the device has none.
1151 # With LEONIDA_W64_EMULATE=1 it was translated with --wave64-emulate and runs on any subgroup size. 1202 # With LEONIDA_W64_EMULATE=1 it was translated with --wave64-emulate and runs on any subgroup size.
1152 results.append((name,) + wavemask_check(vk_compute, spv, cs_env, w64_emulated())) 1203 results.append((name,) + wavemask_check(vk_compute, spv, cs_env, w64_emulated()))
1153 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", 1204 elif name in ("cs_smem_vcc_base", "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",
1154 "cs_dpp", "cs_dpp_row", "cs_dpp_mask", "cs_dpp8", "cs_dpp_ops", "cs_dpp_bank", "cs_dpp_fi", 1205 "cs_dpp", "cs_dpp_row", "cs_dpp_mask", "cs_dpp8", "cs_dpp_ops", "cs_dpp_bank", "cs_dpp_fi",
1155 "cs_dpp_bound", "cs_dpp_w64", 1206 "cs_dpp_bound", "cs_dpp_cmp", "cs_dpp_w64",
1156 "cs_w64_mask_detect", 1207 "cs_w64_mask_detect",
1157 "cs_w64x_readlane", "cs_w64x_writelane", "cs_w64x_readfirstlane", "cs_w64x_bpermute", "cs_w64x_permute", 1208 "cs_w64x_readlane", "cs_w64x_writelane", "cs_w64x_readfirstlane", "cs_w64x_bpermute", "cs_w64x_permute",
1158 "cs_w64x_branch", "cs_w64x_ballot", "cs_w64x_wg128_branches", "cs_w64x_lds_raw", 1209 "cs_w64x_branch", "cs_w64x_ballot", "cs_w64x_wg128_branches", "cs_w64x_lds_raw",
1159 "cs_w64x_lds_war", "cs_w64x_partial", "cs_w64x_sbarrier", "cs_w64x_load_ballot_load", 1210 "cs_w64x_lds_war", "cs_w64x_partial", "cs_w64x_sbarrier", "cs_w64x_load_ballot_load",
1160 "cs_w64x_mask_reuse", "cs_w64x_mask_reuse2", "cs_w64x_chain_barrier", "cs_barrier_divergent", 1211 "cs_w64x_mask_reuse", "cs_w64x_mask_reuse2", "cs_w64x_chain_barrier", "cs_barrier_divergent",
1161 "cs_bpermute32", "cs_w64x_partial_scmp", "cs_w32_partial_scmp", "cs_w32_partial_permute", "cs_barrier_early_end", 1212 "cs_bpermute32", "cs_w64x_partial_scmp", "cs_w32_partial_scmp", "cs_w32_partial_permute", "cs_barrier_early_end",
1162 "cs_barrier_loop", "cs_w64x_andn2_exec", "cs_w64x_saveexec_b64", "cs_lds_b64_cmpst", "cs_lds_xchg64_ext", "cs_lds_atomics_ext", "cs_w32_andn2_exec", 1213 "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",
1163 "cs_mask_vgpr_exec", "cs_w32_exec_computed", "cs_w64_exec_computed"): 1214 "cs_mask_vgpr_exec", "cs_w32_exec_computed", "cs_w64_exec_computed"):
1164 cs_dump_wants = { 1215 cs_dump_wants = {
1165 "cs_store": [0x400080FF, 0xE00003FF, 0x3C004000, 0xEEEEEEEE, 0x40003C00, 0xBC003800, 0x40FF8000, 0x3FF00000], 1216 "cs_store": [0x400080FF, 0xE00003FF, 0x3C004000, 0xEEEEEEEE, 0x40003C00, 0xBC003800, 0x40FF8000, 0x3FF00000],
1166 # base + soffset + imm (cs_smem_soffset_imm.asm); out[4..7] are seeds the shader leaves alone 1217 # base + soffset + imm (cs_smem_soffset_imm.asm); out[4..7] are seeds the shader leaves alone
1218 "cs_smem_vcc_base": CS_SMEM_VCC,
1167 "cs_smem_soffset_imm": [0x5EED0024, 0x5EED0028, 0x5EED002C, 0x5EED0030, 1219 "cs_smem_soffset_imm": [0x5EED0024, 0x5EED0028, 0x5EED002C, 0x5EED0030,
1168 0x5EED0010, 0x5EED0014, 0x5EED0018, 0x5EED001C], 1220 0x5EED0010, 0x5EED0014, 0x5EED0018, 0x5EED001C],
1169 # SHADER-52: wave32 lane select & 31 (40 → 8) 1221 # SHADER-52: wave32 lane select & 31 (40 → 8)
@@ -1213,6 +1265,7 @@ def run_suite(a, work: str) -> int:
1213 "cs_dpp_bound": [10, 10, 11, 12, 13, 14, 15, 16], 1265 "cs_dpp_bound": [10, 10, 11, 12, 13, 14, 15, 16],
1214 "cs_dpp_bank": [0xFFFFFFFF, 0xFFFFFFFE, 0xFFFFFFFD, 0xFFFFFFFC, 7, 7, 7, 7], 1266 "cs_dpp_bank": [0xFFFFFFFF, 0xFFFFFFFE, 0xFFFFFFFD, 0xFFFFFFFC, 7, 7, 7, 7],
1215 "cs_dpp_fi": [1, 2, 3, 0x7777, 5, 6, 7, 0x7777], 1267 "cs_dpp_fi": [1, 2, 3, 0x7777, 5, 6, 7, 0x7777],
1268 "cs_dpp_cmp": [3, 2, 3, 2, 1, 0, 1, 0],
1216 "cs_dpp_w64": [1, 0, 3, 2, 5, 4, 7, 6], 1269 "cs_dpp_w64": [1, 0, 3, 2, 5, 4, 7, 6],
1217 # SHADER-99: -0 and NaN survive (SignedZeroInfNanPreserve, cs_signed_zero_nan.asm); 0 in out[4..7] 1270 # SHADER-99: -0 and NaN survive (SignedZeroInfNanPreserve, cs_signed_zero_nan.asm); 0 in out[4..7]
1218 # without it 1271 # without it
@@ -1257,6 +1310,7 @@ def run_suite(a, work: str) -> int:
1257 "cs_w64x_load_ballot_load": [43, 74, 75, 42, 42, 18, 41, 32], 1310 "cs_w64x_load_ballot_load": [43, 74, 75, 42, 42, 18, 41, 32],
1258 "cs_w64x_andn2_exec": [1, 16, 32, 4144, 2052, 3, 8, 1544], # s_andn2_saveexec/wrexec_b64 (.asm header) 1311 "cs_w64x_andn2_exec": [1, 16, 32, 4144, 2052, 3, 8, 1544], # s_andn2_saveexec/wrexec_b64 (.asm header)
1259 "cs_w64x_saveexec_b64": [6160, 12304, 5120, 2088, 6168, 8192, 7176, 1837171], # .asm header 1312 "cs_w64x_saveexec_b64": [6160, 12304, 5120, 2088, 6168, 8192, 7176, 1837171], # .asm header
1313 "cs_w64x_cmp_sdst": [10240, 6144, 2053, 8224, 7714, 6184, 4144, 5], # .asm header
1260 "cs_bpermute32": [0, 50, 162, 99, 36, 218, 183, 15], # wave32: needs 32 lanes 1314 "cs_bpermute32": [0, 50, 162, 99, 36, 218, 183, 15], # wave32: needs 32 lanes
1261 # SHADER-91: s_barrier sites in different wave-uniform branches meet (cs_barrier_divergent.asm) 1315 # SHADER-91: s_barrier sites in different wave-uniform branches meet (cs_barrier_divergent.asm)
1262 "cs_barrier_divergent": [127, 126, 125, 124, 123, 122, 121, 120], 1316 "cs_barrier_divergent": [127, 126, 125, 124, 123, 122, 121, 120],
@@ -1287,7 +1341,7 @@ def run_suite(a, work: str) -> int:
1287 "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", 1341 "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",
1288 "cs_lds_b64_cmpst", "cs_lds_xchg64_ext", "cs_lds_atomics_ext", "cs_exec_const", "cs_w32_mask_imm", "cs_mask_vgpr_exec", 1342 "cs_lds_b64_cmpst", "cs_lds_xchg64_ext", "cs_lds_atomics_ext", "cs_exec_const", "cs_w32_mask_imm", "cs_mask_vgpr_exec",
1289 "cs_dpp", "cs_dpp_row", "cs_dpp_mask", "cs_dpp8", 1343 "cs_dpp", "cs_dpp_row", "cs_dpp_mask", "cs_dpp8",
1290 "cs_dpp_ops", "cs_dpp_bound", "cs_dpp_bank", "cs_dpp_fi", "cs_w32_andn2_exec", 1344 "cs_dpp_ops", "cs_dpp_bound", "cs_dpp_bank", "cs_dpp_fi", "cs_dpp_cmp", "cs_w32_andn2_exec",
1291 "cs_w32_exec_computed") and not emulated and not partial 1345 "cs_w32_exec_computed") and not emulated and not partial
1292 if partial and not emulated: 1346 if partial and not emulated:
1293 cs_env = dict(os.environ, VKC_SUBGROUP_SIZE="64") 1347 cs_env = dict(os.environ, VKC_SUBGROUP_SIZE="64")
@@ -1301,7 +1355,7 @@ def run_suite(a, work: str) -> int:
1301 continue 1355 continue
1302 if rc == 0: 1356 if rc == 0:
1303 skip = wave32_lane_skip(msg) 1357 skip = wave32_lane_skip(msg)
1304 if skip is None and name in WAVE32_PIN_DUMPS: 1358 if rc == 0 and skip is None and name in WAVE32_PIN_DUMPS:
1305 # the device may not be able to run the wave size this fixture was written for (a 64-only device 1359 # the device may not be able to run the wave size this fixture was written for (a 64-only device
1306 # can't pin 32, so cs_barrier_loop's words mean nothing); check.py skips it too 1360 # can't pin 32, so cs_barrier_loop's words mean nothing); check.py skips it too
1307 skip = subgroup_pin_skip(msg, cs_env) 1361 skip = subgroup_pin_skip(msg, cs_env)
@@ -1317,12 +1371,13 @@ def run_suite(a, work: str) -> int:
1317 unjudged = ", ".join(str(i) for i, w in enumerate(want) if w is None) 1371 unjudged = ", ".join(str(i) for i, w in enumerate(want) if w is None)
1318 detail += f" (words {unjudged} not judged on this device: UNJUDGED_WORDS in check.py)" 1372 detail += f" (words {unjudged} not judged on this device: UNJUDGED_WORDS in check.py)"
1319 results.append((name, ok, detail)) 1373 results.append((name, ok, detail))
1320 elif name == "cs_imgstore": 1374 elif name in IMAGE_STORE_CASES:
1321 rc, msg = run_cmd([vk_store, spv]) 1375 rc, msg = run_cmd([vk_store, spv, *IMAGE_STORE_CASES[name]])
1322 results.append((name, *helper_result(rc, msg)))
1323 elif name in ("cs_imgload", "cs_imgload_tfe", "cs_imgload_d16", "cs_imgload_d16_tfe", "cs_sample_lz_int_d16"):
1324 rc, msg = run_cmd([vk_store, spv, "load" if name in ("cs_imgload", "cs_imgload_tfe") else "load-d16"])
1325 results.append((name, *helper_result(rc, msg))) 1376 results.append((name, *helper_result(rc, msg)))
1377 elif name == "cs_texture_uav":
1378 problem = texture_uav_test(a.build, spv)
1379 results.append((name, None if isinstance(problem, Skip) else not problem,
1380 problem or "D3D12/Vulkan storage-image readback matched"))
1326 elif name in MIP_TEST_PASSES: 1381 elif name in MIP_TEST_PASSES:
1327 problem = texture_mip_test(a.build, spirv_dir, name) 1382 problem = texture_mip_test(a.build, spirv_dir, name)
1328 ok = None if isinstance(problem, Skip) else not problem 1383 ok = None if isinstance(problem, Skip) else not problem