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:
authorItsNotRexed <300290919+ItsNotRexed@users.noreply.github.com>2026-11-22 11:42:07 -0500
committerItsNotRexed <300290919+ItsNotRexed@users.noreply.github.com>2026-11-22 11:42:07 -0500
commit1180c0b4a405389d53082670fc84ca329cf02f91 (patch)
tree4523e4fef51f847a91d34cd3b540e2e858e89ebb /scripts/run_gpu_tests.py
parente06b7e92d5ad3831a0a3bc8a914c8e5452b20a26 (diff)
parent21d01a9570ddd3ba45154b1c0b87fb15d012672b (diff)
Merge pull request #2136 from Vonsek
Diffstat (limited to 'scripts/run_gpu_tests.py')
-rw-r--r--scripts/run_gpu_tests.py21
1 files changed, 6 insertions, 15 deletions
diff --git a/scripts/run_gpu_tests.py b/scripts/run_gpu_tests.py
index 6e9520dbe..54adae976 100644
--- a/scripts/run_gpu_tests.py
+++ b/scripts/run_gpu_tests.py
@@ -239,12 +239,13 @@ def unsupported_skip(msg: str) -> str:
239 return f"SKIP ({m.group(0) if m else 'unsupported device'})" 239 return f"SKIP ({m.group(0) if m else 'unsupported device'})"
240 240
241 241
242def run_cmd(cmd: list[str], env: dict | None = None, gpu: bool = True) -> tuple[int, str]: 242def run_cmd(cmd: list[str], env: dict | None = None, gpu: bool = True, *,
243 cwd: str | None = None) -> tuple[int, str]:
243 # A hung GPU test program fails its test instead of stalling the suite (check.py, LEONIDA_GPU_TEST_TIMEOUT). 244 # A hung GPU test program fails its test instead of stalling the suite (check.py, LEONIDA_GPU_TEST_TIMEOUT).
244 # gpu=False (the translator over the whole suite) runs without a limit. 245 # gpu=False (the translator over the whole suite) runs without a limit.
245 limit = gpu_test_timeout() if gpu else None 246 limit = gpu_test_timeout() if gpu else None
246 try: 247 try:
247 p = subprocess.run(cmd, capture_output=True, text=True, env=env, timeout=limit) 248 p = subprocess.run(cmd, capture_output=True, text=True, env=env, timeout=limit, cwd=cwd)
248 except subprocess.TimeoutExpired: 249 except subprocess.TimeoutExpired:
249 return 1, timed_out(cmd[0], limit) 250 return 1, timed_out(cmd[0], limit)
250 except OSError as e: # e.g. Smart App Control blocked a fresh build: fail this test, keep running the others 251 except OSError as e: # e.g. Smart App Control blocked a fresh build: fail this test, keep running the others
@@ -1033,13 +1034,7 @@ def run_suite(a, work: str) -> int:
1033 mode = {"ps_cube_sample": ["cube"], "ps_sample_c_lz": ["dref"], 1034 mode = {"ps_cube_sample": ["cube"], "ps_sample_c_lz": ["dref"],
1034 "ps_sample_c_lz_a16": ["dref_a16"]}.get(name, []) 1035 "ps_sample_c_lz_a16": ["dref_a16"]}.get(name, [])
1035 cmd = [tool, *mode, raw] 1036 cmd = [tool, *mode, raw]
1036 try: 1037 rc, msg = run_cmd(cmd, cwd=spirv_dir)
1037 p = subprocess.run(cmd, capture_output=True, text=True, cwd=spirv_dir)
1038 rc, msg = p.returncode, (p.stdout + "\n" + p.stderr).strip()
1039 except FileNotFoundError:
1040 rc, msg = 1, f"missing {tool}"
1041 except OSError as e:
1042 rc, msg = 1, start_failure(tool, e)
1043 if rc == UNSUPPORTED: # e.g. fewer push constant bytes than the texture tests need 1038 if rc == UNSUPPORTED: # e.g. fewer push constant bytes than the texture tests need
1044 results.append((name, None, unsupported_skip(msg))) 1039 results.append((name, None, unsupported_skip(msg)))
1045 elif name == "ps_texture_sample_d16" and rc == 0: 1040 elif name == "ps_texture_sample_d16" and rc == 0:
@@ -1051,12 +1046,8 @@ def run_suite(a, work: str) -> int:
1051 expected = TEXTURE_CONSTANTS[name] 1046 expected = TEXTURE_CONSTANTS[name]
1052 tool = os.path.join(a.build, "vk_texture_test" + ext) 1047 tool = os.path.join(a.build, "vk_texture_test" + ext)
1053 raw = os.path.join(raw_dir, f"{name}.raw") 1048 raw = os.path.join(raw_dir, f"{name}.raw")
1054 try: 1049 rc, msg = run_cmd([tool, os.path.join(spirv_dir, "vs_ids.spv"), spv, raw, "0", "92", "c00000",
1055 p = subprocess.run([tool, os.path.join(spirv_dir, "vs_ids.spv"), spv, raw, "0", "92", "c00000", 1050 "14500000", "0"], cwd=spirv_dir)
1056 "14500000", "0"], capture_output=True, text=True, cwd=spirv_dir)
1057 rc, msg = p.returncode, (p.stdout + "\n" + p.stderr).strip()
1058 except FileNotFoundError:
1059 rc, msg = 1, f"missing {tool}"
1060 bad = 4096 1051 bad = 4096
1061 if rc == 0 and os.path.isfile(raw): 1052 if rc == 0 and os.path.isfile(raw):
1062 data = Path(raw).read_bytes() 1053 data = Path(raw).read_bytes()