Repository navigation
d3d12: with no shader library, the descriptor table is tagged, the tr… - #2543
JamesCicada wants to merge 1 commit into
Conversation
…anslator's default With no library loaded (the GPU tests, the tools) the device picked the plain descriptor table, while tools/rdna2spirv.py translates for the tagged one by default. cs_texture_uav.spv then read an all-zero kind word, fell back to index 0 and skipped its image stores (got 0x11, expected 0x3f9). kNoLibraryDescriptorTableLayout (runtime/src/shader_library.h) is now that default; the kind word is additive, so a plain module still reads only its index. A loaded library's vote and LEONIDA_DESCRIPTOR_TABLE are unchanged. tests/test_descriptor_table_default.py keeps the runtime's default equal to the translator's. From qhukz13's finding in the coordination issue (ProjectLeonida#1608). Tested on Windows 11 (CPU tests; GPU test not run, needs llvm-mc): shader_library, d3d12_vulkan_device, d3d12_texture_uav --descriptors-only, descriptor_table, tests/test_descriptor_table_default.py. AI-assisted (Claude Code). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
#2543 | head 4a83ecd | python -I tests/test_descriptor_table_default.py; ctest -C RelWithDebInfo -R "^(shader_library|d3d12_texture_uav|descriptor_table)$" | red: clean main + the PR's Python test: FAILED (failures=1), AssertionError, kNoLibraryDescriptorTableLayout not found (shader_library_test's new CHECK uses that constant, so it does not compile on main) | green: main 02f71cc merged into the head, Python: Ran 2 tests, OK; ctest 3/3 passed (d3d12_texture_uav with --descriptors-only only: the full cs_texture_uav GPU run needs llvm-mc, which this machine does not have yet) | full suite: not run (a game boot was using the machine) | Windows 11, RTX 4070 SUPER, NVIDIA 621.01, Python 3.14 | AI-assisted: yes, Claude Code |
|
#2543 (GPU follow-up) | head 4a83ecd | d3d12_texture_uav_test <cs_texture_uav.spv> (the shader built with test/shaders/build.py, llvm-mc 21.1.8 with the AMDGPU target) | red: clean main: fails on an assertion, line 650 (check_case on the 1D texture), 2 of 2 runs | green: main 02f71cc merged into the head: "texture UAVs: 14 GPU cases (10 compared with WARP), format/range/refusal checks passed", 2 of 2 runs | full suite: not run (a game boot was using the machine) | Windows 11, RTX 4070 SUPER, NVIDIA 621.01, Python 3.14 | AI-assisted: yes, Claude Code |
lixonik
left a comment
There was a problem hiding this comment.
Reviewed the diff and tested merged onto main (493867366) with Ninja Release (MSVC), native llvm-mc (AMDGPU), Vulkan SDK 1.4.363.1 (spirv-val, spirv-as, glslangValidator), and LEONIDA_VK_VALIDATION=1.
Defaulting no-library runs to kNoLibraryDescriptorTableLayout = DescriptorTableLayout::tagged keeps the runtime aligned with tools/rdna2spirv.py, and tests/test_descriptor_table_default.py guards against future drift. Crucially, the translated-shader GPU test d3d12_texture_uav (which exercises cs_texture_uav.spv without a shader library) now builds and passes on real Vulkan hardware with zero validation errors.
Tests run
ctest --output-on-failure -R "^(shader_library|descriptor_table|d3d12_texture_uav|d3d12_translated_draw)$"(withLEONIDA_VK_VALIDATION=1): 4/4 passed (descriptor_table0.03 s,shader_library0.19 s,d3d12_texture_uav2.45 s,d3d12_translated_draw0.32 s).python -I tests/test_descriptor_table_default.py -v: 2/2 passed.
GPUs tested: NVIDIA GeForce RTX 5070 12 GB (Windows 11, driver 610.88, Vulkan 1.4.341, VK_LAYER_KHRONOS_validation 1.4.363).
AI-assisted (Antigravity, Gemini).
|
#2543 | head 4a83ecd (merged cleanly with main adfb382) | |
timbot103
left a comment
There was a problem hiding this comment.
Static audit of 4a83ecddc against 48bae6cad. No findings. The tagged default gives caller-supplied shaders the image kind bits they expect, while library metadata and LEONIDA_DESCRIPTOR_TABLE still determine the layout when present. The supplied results report a full texture UAV red/green and a separate Vulkan validation pass on earlier main merges. The registered CTest covers descriptor setup, and the full GPU test dispatches the translated shader and checks the texels.
AI-assisted.
|
Independent RTX 4090 verification on Windows 11 build 26300, NVIDIA 616.64, MSVC 19.44, LLVM 23.1.6 and SPIRV-Tools 2026.4. Khronos Vulkan validation was enabled. All fixtures were synthetic.
AI-assisted with OpenAI Codex (GPT-6.2 Sol). |
|
Tested 4a83ecd merged (no commit) with main 8fb9748: MSVC 19.52, Python 3.12.4, Windows 11 10.0.26300.
AI-assisted (Claude Code). |
|
Independent verification on this machine (Windows 11, MSVC 19.44.35226, Python 3.13.14), and the negative control bites on the Python side. 1. It applies. 2. Both test surfaces pass with the change: 3. The Python check fails on So the pairing the commit establishes - with no shader library, the descriptor table is tagged the way the translator tags it - is absent on What I did not test: a title run without a shader library on a device that needs one. The tests drive the decision and the tagging; whether the GPU stops complaining about an untagged table needs the title, which this machine can boot but not in the "no shader library" configuration the commit is about. Written with an AI assistant. |
… translator's default
With no library loaded (the GPU tests, the tools) the device picked the plain descriptor table, while tools/rdna2spirv.py translates for the tagged one by default. cs_texture_uav.spv then read an all-zero kind word, fell back to index 0 and skipped its image stores (got 0x11, expected 0x3f9).
kNoLibraryDescriptorTableLayout (runtime/src/shader_library.h) is now that default; the kind word is additive, so a plain module still reads only its index. A loaded library's vote and LEONIDA_DESCRIPTOR_TABLE are unchanged. tests/test_descriptor_table_default.py keeps the runtime's default equal to the translator's.
From qhukz13's finding in the coordination issue (#1608).
Tested on Windows 11 (CPU tests; GPU test not run, needs llvm-mc): shader_library, d3d12_vulkan_device, d3d12_texture_uav --descriptors-only, descriptor_table, tests/test_descriptor_table_default.py.
AI-assisted (Claude Code).
Claimed in the coordination issue as:
Depends on:
Fixes:
What and why
Tested
GPUs tested:
AI-assisted:
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed.