upleb.uk

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

summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAslan2142 <jan.trencansky@protonmail.com>2026-11-30 11:24:25 +0100
committerGitHub <noreply@github.com>2026-11-30 11:24:25 +0100
commit012b79a6787cd47d31dcf023eb2b67a1eac6d77f (patch)
tree0a1b3c094dd393645c2dfa30222b3ed7e8c6f99d /scripts
parent454df8e954815e716888785df0b2e65ecfc82cf7 (diff)
parent70ea7d6ec070730a6868c1445b2383d2789c0a79 (diff)
Merge pull request #2566 from aslan2142/integration/perf-cpu-gpu-r6
[integration] PageMirror, GPU detile, async queue & RDNA2->SPIR-V performance stack (INTEGRATION-PERF-CPU-GPU-R6)
Diffstat (limited to 'scripts')
-rw-r--r--scripts/run_gpu_tests.py46
1 files changed, 46 insertions, 0 deletions
diff --git a/scripts/run_gpu_tests.py b/scripts/run_gpu_tests.py
index 4063b5fde..92d0e61b5 100644
--- a/scripts/run_gpu_tests.py
+++ b/scripts/run_gpu_tests.py
@@ -369,8 +369,15 @@ def f16_interp_fallback() -> bool:
369 return _device_per_vertex() is False 369 return _device_per_vertex() is False
370 370
371 371
372def no_ftz32() -> bool:
373 """Translate with --no-ftz32 when tools/vk_subgroup_info.py reports denorm_flush_to_zero_f32: false
374 (drivers such as NVIDIA Vulkan that do not advertise DenormFlushToZero 32)."""
375 return _device_denorm_ftz_f32() is False
376
377
372_PER_VERTEX = [] 378_PER_VERTEX = []
373_BARYCENTRIC_FALLBACK = [] 379_BARYCENTRIC_FALLBACK = []
380_DENORM_FTZ_F32 = []
374 381
375 382
376def _device_per_vertex(): 383def _device_per_vertex():
@@ -406,6 +413,22 @@ def _device_barycentric_fallback():
406 return _BARYCENTRIC_FALLBACK[0] 413 return _BARYCENTRIC_FALLBACK[0]
407 414
408 415
416def _device_denorm_ftz_f32():
417 """denorm_flush_to_zero_f32 from tools/vk_subgroup_info.py for the device the tests run on (cached), or None."""
418 if not _DENORM_FTZ_F32:
419 answer = None
420 try:
421 r = subprocess.run([sys.executable, "-I", os.path.join(ROOT, "tools", "vk_subgroup_info.py")],
422 capture_output=True, text=True, timeout=60)
423 report = json.loads(r.stdout.strip().splitlines()[-1])
424 if isinstance(report, dict) and isinstance(report.get("denorm_flush_to_zero_f32"), bool):
425 answer = report["denorm_flush_to_zero_f32"]
426 except (OSError, ValueError, IndexError, subprocess.SubprocessError):
427 pass
428 _DENORM_FTZ_F32.append(answer)
429 return _DENORM_FTZ_F32[0]
430
431
409def w64_emulated() -> bool: 432def w64_emulated() -> bool:
410 # Wave64 emulation on: the suite runs every wave64 check without asking for a 64-wide 433 # Wave64 emulation on: the suite runs every wave64 check without asking for a 64-wide
411 # subgroup, matching check.py (W64_EMULATED). Accepts "1"/"true"/"yes"/"on" and tolerates 434 # subgroup, matching check.py (W64_EMULATED). Accepts "1"/"true"/"yes"/"on" and tolerates
@@ -798,6 +821,9 @@ def main() -> int:
798 ap.add_argument("--no-validate", action="store_true", 821 ap.add_argument("--no-validate", action="store_true",
799 help="skip spirv-val during translation (automatic when --assembler resolves to python " 822 help="skip spirv-val during translation (automatic when --assembler resolves to python "
800 "and spirv-val is not on PATH)") 823 "and spirv-val is not on PATH)")
824 ap.add_argument("--no-ftz32", action="store_true",
825 help="translate shaders with --no-ftz32 (automatic when tools/vk_subgroup_info.py reports "
826 "denorm_flush_to_zero_f32: false)")
801 ap.add_argument("--disasm-dir", default=None, 827 ap.add_argument("--disasm-dir", default=None,
802 help="folder of pre-disassembled <name>.s listings (e.g. tests/semantic/fixtures/disasm); " 828 help="folder of pre-disassembled <name>.s listings (e.g. tests/semantic/fixtures/disasm); "
803 "skips llvm-mc and runs only fixtures present there") 829 "skips llvm-mc and runs only fixtures present there")
@@ -974,6 +1000,8 @@ def run_suite(a, work: str) -> int:
974 cmd.append("--bary-fallback") 1000 cmd.append("--bary-fallback")
975 if f16_interp_fallback(): # *_f16 interps from decoded-half inputs, no PerVertexKHR (MoltenVK) 1001 if f16_interp_fallback(): # *_f16 interps from decoded-half inputs, no PerVertexKHR (MoltenVK)
976 cmd.append("--f16-interp-fallback") 1002 cmd.append("--f16-interp-fallback")
1003 if getattr(a, "no_ftz32", False) or no_ftz32(): # no DenormFlushToZero 32 (e.g. NVIDIA Vulkan)
1004 cmd.append("--no-ftz32")
977 if TEXOFF_FALLBACK: # image_sample*_o: offset folded into the coordinate, no VK_KHR_maintenance8 1005 if TEXOFF_FALLBACK: # image_sample*_o: offset folded into the coordinate, no VK_KHR_maintenance8
978 cmd.append("--texel-offset-fallback") 1006 cmd.append("--texel-offset-fallback")
979 if MESH_COMPUTE: # mesh shaders as compute writing to a buffer, drawn by tools/mesh_compute_vs.py 1007 if MESH_COMPUTE: # mesh shaders as compute writing to a buffer, drawn by tools/mesh_compute_vs.py
@@ -1118,6 +1146,24 @@ def run_suite(a, work: str) -> int:
1118 "cs_buf_fmt8": [0x7F, 0x80, 0xFF, 0x01, 0, 0, 0xFF, 1], 1146 "cs_buf_fmt8": [0x7F, 0x80, 0xFF, 0x01, 0, 0, 0xFF, 1],
1119 }[name] 1147 }[name]
1120 results.append((name,) + dump_result(rc, msg, want)) 1148 results.append((name,) + dump_result(rc, msg, want))
1149 elif name == "cs_w64x_dynamic_r32_uint":
1150 word = 0x8A600250
1151 descriptor_at, value_at = 0x100, 0x180
1152 with tempfile.TemporaryDirectory(prefix="dynamic-r32-", dir=work) as scratch:
1153 heap = os.path.join(scratch, "heap.bin")
1154 with open(heap, "wb") as stream:
1155 descriptor = struct.pack("<4I", value_at, 4 << 16, 1, (2 << 28) | (20 << 12) | 4)
1156 stream.write(descriptor)
1157 stream.write(bytes(value_at - descriptor_at - len(descriptor)))
1158 stream.write(struct.pack("<I", word))
1159 env = dict(cs_env or os.environ, VKC_SGPRS=f"0,{descriptor_at}",
1160 VKC_HEAP_FILE=f"{heap}@{descriptor_at}")
1161 command = [vk_compute, spv, "1", "dump"]
1162 if not w64_emulated():
1163 command.append("--require-wave64")
1164 rc, msg = run_cmd(command, env=env)
1165 results.append((name,) + judge_cs_dump(rc, msg, [word] * 8, wave64=not w64_emulated(),
1166 partial=False, emulated=w64_emulated()))
1121 elif name == "cs_fmt_1010102": 1167 elif name == "cs_fmt_1010102":
1122 problem = fmt_1010102_test(a.build, spirv_dir, cs_env) 1168 problem = fmt_1010102_test(a.build, spirv_dir, cs_env)
1123 results.append((name, not problem, problem or "64/64 dumped words exact")) 1169 results.append((name, not problem, problem or "64/64 dumped words exact"))