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:
authorExopus <230622659+Exopus-0x65f7ad0@users.noreply.github.com>2026-11-23 01:15:02 +0100
committerExopus <230622659+Exopus-0x65f7ad0@users.noreply.github.com>2026-11-23 01:15:02 +0100
commitc5e6cc5c388792794f8a9494fe4ccdcf8ae18769 (patch)
tree158138595eff0f0c4606f7094988d41c41b71b0e /scripts/run_gpu_tests.py
parentaa2988cc555bad7ecd508b48a702adbb32fe7c95 (diff)
run_gpu_tests: a missing or partial readback fails its test, not the suite
ps_interp_f16_high (also drawn by ms_f16_pack) and ps_ij_computed still unpacked their readbacks with a bare struct.iter_unpack("<4I", ...): a file whose size isn't a multiple of 16 raised struct.error, a missing one FileNotFoundError, and nothing caught either, so the run ended there and every other test's result was lost. They now read it like #3442's Mandelbrot fix, read_raw_u32(raw) if the file exists, else no pixels, which the checkers already report as a failure of that test. tests/test_run_gpu_readback_size.py: the suite with the harness stood in for, a missing, empty, partial-pixel and one-byte-short readback for each test (6 of the 8 cases crash the suite on main). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'scripts/run_gpu_tests.py')
-rw-r--r--scripts/run_gpu_tests.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/scripts/run_gpu_tests.py b/scripts/run_gpu_tests.py
index 94de20f26..c3c44f44a 100644
--- a/scripts/run_gpu_tests.py
+++ b/scripts/run_gpu_tests.py
@@ -1270,12 +1270,11 @@ def run_suite(a, work: str) -> int:
1270 elif name == "ps_flat": 1270 elif name == "ps_flat":
1271 ok, detail = check_flat(raw) 1271 ok, detail = check_flat(raw)
1272 elif name == "ps_interp_f16_high": 1272 elif name == "ps_interp_f16_high":
1273 with open(raw, "rb") as source: 1273 # A missing or partial readback is an empty frame for this test, not a crash of the suite (as #3442).
1274 problem = interp_f16_high_problem(list(struct.iter_unpack("<4I", source.read()))) 1274 problem = interp_f16_high_problem(read_raw_u32(raw) if os.path.isfile(raw) else [])
1275 ok, detail = not problem, problem or "f16 low/high halves and f32 control within 2e-3" 1275 ok, detail = not problem, problem or "f16 low/high halves and f32 control within 2e-3"
1276 elif name == "ps_ij_computed": 1276 elif name == "ps_ij_computed":
1277 with open(raw, "rb") as source: 1277 problem = ij_computed_problem(read_raw_u32(raw) if os.path.isfile(raw) else [])
1278 problem = ij_computed_problem(list(struct.iter_unpack("<4I", source.read())))
1279 ok, detail = not problem, problem or "computed I/J pair words and v/2 within 1e-6" 1278 ok, detail = not problem, problem or "computed I/J pair words and v/2 within 1e-6"
1280 elif name == "ps_mandelbrot": 1279 elif name == "ps_mandelbrot":
1281 with open(raw, "rb") as source: 1280 with open(raw, "rb") as source:
@@ -1334,8 +1333,8 @@ def run_suite(a, work: str) -> int:
1334 elif rc != 0: 1333 elif rc != 0:
1335 results.append((name, False, msg)) 1334 results.append((name, False, msg))
1336 else: 1335 else:
1337 with open(raw, "rb") as source: 1336 # A missing or partial readback is an empty frame for this test, not a crash of the suite (as #3442).
1338 problem = interp_f16_high_problem(list(struct.iter_unpack("<4I", source.read()))) 1337 problem = interp_f16_high_problem(read_raw_u32(raw) if os.path.isfile(raw) else [])
1339 results.append((name, not problem, problem or "f16 low/high halves and f32 control within 2e-3")) 1338 results.append((name, not problem, problem or "f16 low/high halves and f32 control within 2e-3"))
1340 elif name == "ms_clip": 1339 elif name == "ms_clip":
1341 raw = os.path.join(raw_dir, f"{name}.raw") 1340 raw = os.path.join(raw_dir, f"{name}.raw")