Repository navigation
vk_compute_test: VKC_HEAP_INIT seeds the heap from a file before the dispatch (TEST-594, part 1) - #3263
vk_compute_test: VKC_HEAP_INIT seeds the heap from a file before the dispatch (TEST-594, part 1)#3263Dom-in wants to merge 1 commit into
Conversation
|
Apple M2 data point. Tested head 61a9adc on Apple M2 (Mac14,3), macOS 26.4 (25E246), MoltenVK 1.4.2 (direct), subgroup 4..32, llvm-mc 23.1.6, Python 3.13.18.
Build note: full build fails on AppleClang 17 at vk_pipeline_check.cpp:567 (BUILD-822, fixed by open PR #2927); all GPU binaries built, so the run above is valid. Head fetched unchanged into a separate worktree; no rebase/edit/push. Synthetic test only; no game files. AI-assisted. |
|
Tested Independent Linux Vulkan check of A direct run with a 274-byte seed and a 288-byte heap matched the complete byte-level expectation. The shader copied the four seeded words to the start of the heap. The final two seed bytes and the two fill bytes sharing their dword stayed exact, as did the remaining fill. The unseeded control retained The module passed Vulkan 1.2 SPIR-V validation and all 69 shader-check CPU tests passed. Synthetic inputs only. AI-assisted. AI-assisted verification. |
…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>
61a9adc to
3a94ab0
Compare
|
Tested
No game files. AI-assisted (Claude Code). |
|
Tested 3a94ab0 on NVIDIA GeForce GTX 1660 (Turing, TU116, subgroup 32..32), driver 620.73.04 (proprietary, Vulkan 1.4.357), Arch Linux (kernel 6.18): pass, no regression. Native build of runtime/ from this head (Ninja, RelWithDebInfo, clang 23.1.5), llvm-mc 23.1.5, SPIRV-Tools v2026.4.
AI-assisted run (Claude). Synthetic programs only, no game files involved. |
First part of TEST-594 (claim: #2891 (comment)).
Why
XboxBvhBuilder.dll's translated compute programs don't take their inputs in user SGPRs. They read a root table from memory throughs[0:1](root descriptor addresses and root constants at fixed offsets), and invk_compute_testthat pointer is the heap base, Xbox VA 0. The harness had no way to put anything in the heap before the dispatch:VKC_SGPRSonly reachess4..s31, and the buffer was always0xEE-filled. Without this, none of those programs can be given real inputs.What
vk_compute_test:VKC_HEAP_INIT=<file>copies the file's bytes to the start of the buffer after the default fill and before the dispatch. Bytes past the file keep the fill. A file larger than the buffer is refused with a message pointing atVKC_OUT_WORDS(exit 2), and so is an unreadable file. Documented in the harness's usage header with the otherVKC_*variables.runtime/test/shaders/cs_heap_init.asm: one thread loads the four words the file put at 0x100 and stores them at 0.out[0..3]are then the seeded words, andout[4..7]are the file's zeros at 0x10..0x1f rather than the0xEEfill, which shows the whole file was copied.check.pyandscripts/run_gpu_tests.pywrite the 0x110-byte file (check.heap_init_env()), passVKC_OUT_WORDS=68so it fits, and check all eight words.tests/test_shader_checks.py's fake runner returns the words only when the file and buffer size are right; the case count goes up by one.Tested
AMD Radeon RX 9070 (RDNA4), Windows 11, MSVC Release, Vulkan SDK 1.4.363, on
main1628210:check.py: 165 of 168 pass, 3 skipped (the three mesh fixturesbuild.pydoesn't build, as onmain);cs_heap_init ok.run_gpu_tests.py --filter cs_heap_init:PASS cs_heap_init 0x1badb002 0xcafef00d 0x80000001 0xffff 0x0 0x0 0x0 0x0.VKC_HEAP_INIT, the same dispatch reads0xEEEEEEEEin all eight words. An oversized file and a missing file each exit 2 with their message.pytest tests/test_shader_checks.py tests/test_run_gpu_tests*.py tests/test_ctest_registration.py tests/test_ci_registration.py: 134 passed.Synthetic test only, no game data. The BVH programs themselves come in the next part.
AI-assisted (Claude Code).
🤖 Generated with Claude Code