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:
authorDominik <55330408+Dom-in@users.noreply.github.com>2026-11-22 19:56:18 +0000
committerDominik <55330408+Dom-in@users.noreply.github.com>2026-11-22 19:56:18 +0000
commit61a9adc2a89ce247f5a598a30fe089caba55487e (patch)
tree9cc2ff798e6394e4115885431070fe01412ee396 /scripts/run_gpu_tests.py
parent162821017ea3c286c8bec860f3ff94f037912061 (diff)
vk_compute_test: VKC_HEAP_INIT seeds the heap from a file before the dispatch
A compute program that reads its inputs from memory (a root table, descriptors, data) needs them in the heap before it runs; VKC_SGPRS only reaches s4..s31. VKC_HEAP_INIT=<file> copies the file to Xbox VA 0 after the default fill. A file larger than the buffer, or one that can't be read, is refused (exit 2). cs_heap_init.asm loads four words the file put at 0x100 and stores them at 0; check.py and run_gpu_tests.py write the file and check the words and the file's zeros past them. First part of TEST-594 (the BVH builder's programs read their root table from the heap). 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.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/run_gpu_tests.py b/scripts/run_gpu_tests.py
index 3a23250fc..7cc2bc612 100644
--- a/scripts/run_gpu_tests.py
+++ b/scripts/run_gpu_tests.py
@@ -32,6 +32,7 @@ from check import (CMPX_CLASS_WORDS, CVT_F32_SAT_CASES, CVT_PK_U8_WORDS, GRADIEN
32 TEXTURE_MIP_TEST, GATHER_LOD_TEST, MIP_TEST_PASSES, TEXTURE_CONSTANTS, USER_SGPRS_ENV, USER_SGPRS_WORDS, Skip, mesh_v5_test, not_found_message, 32 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 pick_build_dir, start_failure, texture_gradient_a16_test, texture_mip_test) 33 pick_build_dir, start_failure, texture_gradient_a16_test, texture_mip_test)
34from check import SIGNED_MIP_TEST 34from check import SIGNED_MIP_TEST
35from check import HEAP_INIT_EXPECTED, heap_init_env # cs_heap_init: vk_compute_test's VKC_HEAP_INIT
35from check import judged_words, words_match # dump words not judged on some devices (cs_signed_zero_nan) 36from check import judged_words, words_match # dump words not judged on some devices (cs_signed_zero_nan)
36from check import TEXOFF_ARGS, texoff_problem # ps_texoff's expected words and arguments live in check.py 37from check import TEXOFF_ARGS, texoff_problem # ps_texoff's expected words and arguments live in check.py
37from check import TEXOFF_FALLBACK, texoff_env # LEONIDA_TEXOFF_FALLBACK=1: texel offsets without maintenance8 38from check import TEXOFF_FALLBACK, texoff_env # LEONIDA_TEXOFF_FALLBACK=1: texel offsets without maintenance8
@@ -860,6 +861,13 @@ def run_suite(a, work: str) -> int:
860 want = [0x5EED1FFC, 0x8BAD1800, 0x5EED1FF0, 0x5EED1FF4, 0x9E, 0xFFFF8BAD, 0x57023FFC, 0xEEEEEEEE] 861 want = [0x5EED1FFC, 0x8BAD1800, 0x5EED1FF0, 0x5EED1FF4, 0x9E, 0xFFFF8BAD, 0x57023FFC, 0xEEEEEEEE]
861 ok, detail = judge_cs_dump(rc, msg, want, wave64=False, partial=False, emulated=False, hexwords=True) 862 ok, detail = judge_cs_dump(rc, msg, want, wave64=False, partial=False, emulated=False, hexwords=True)
862 results.append((name, ok, detail)) 863 results.append((name, ok, detail))
864 elif name == "cs_heap_init":
865 # vk_compute_test copies VKC_HEAP_INIT's file into the heap; the shader copies its words at 0x100 to 0.
866 rc, msg = run_cmd([vk_compute, spv, "1", "dump"], env=dict(cs_env or os.environ, **heap_init_env()))
867 words = dump_words(msg)
868 vals = words[:len(HEAP_INIT_EXPECTED)] if words else []
869 results.append((name, rc == 0 and vals == HEAP_INIT_EXPECTED,
870 " ".join(hex(x) for x in vals) if vals else msg))
863 elif name == "cs_user_sgprs": 871 elif name == "cs_user_sgprs":
864 # vk_compute_test seeds s4..s7 from VKC_SGPRS; the shader stores them back. 872 # vk_compute_test seeds s4..s7 from VKC_SGPRS; the shader stores them back.
865 rc, msg = run_cmd([vk_compute, spv, "1", "dump"], env=dict(cs_env or os.environ, **USER_SGPRS_ENV)) 873 rc, msg = run_cmd([vk_compute, spv, "1", "dump"], env=dict(cs_env or os.environ, **USER_SGPRS_ENV))