Repository navigation
Conversation
|
Tested 20f02e6 on Intel UHD Graphics 630 (CFL GT2, subgroup 8..32): tests/semantic test_image_get_resinfo_dims passes (10 tests), tests/test_image_query_translate.py passes (10), and test_translate.py -k resinfo gives 6 passed. run_gpu_tests.py --filter resinfo with LEONIDA_VK_DEVICE=Intel passes 2/2, "PASS cs_resinfo all 64 words of the uint image, the sint image and the volume exact" and "PASS ps_array_resinfo 4096/4096 pixels exact", and a nonexistent device name fails both rows with "no Vulkan physical device matches". Those two GPU fixtures are not changed by this PR, so the new 1D, 3D, CUBE, MSAA and a16 paths are covered here only by the semantic and translator tests. The AMD and NVIDIA results in the description were not reproduced. AI-assisted. |
|
Independent RTX 4080 coverage of the new query paths at
SPIR-V validation passed and there were no Vulkan validation warnings or errors. Synthetic inputs only. AI-assisted with Codex. |
Kam471
left a comment
There was a problem hiding this comment.
Head 20f02e6 · Windows 11, Python 3.13.15
python tests/semantic/test_image_get_resinfo_dims.py -v-> 9 passed, 1 skipped ("requires llvm-mc with amdgcn target")python -I -m pytest tests/test_image_query_translate.py -q-> 10 passed (10 subtests)python -I -m pytest tests/test_translate.py -k resinfo -q-> 6 skipped (LLVM_MC absent), 590 deselected- Main repro: PR test with
origin/main:tools/rdna2spirv.py-> FAILED (failures=16, errors=57, skipped=1) git diff --checkclean
Two problems:
- No
docs/design.mdchange, and that contract row still ends "image_get_resinfoon other dimensions isUnsupported". CONTRIBUTING.md and AGENTS.md require a new translator rule in the table with how it was confirmed. - The MSAA path loads binding 20/21 unconditionally. The runtime puts an MS view only at
sampled_binding(dim, sampled_class), withsampled_class = numeric_class(view_format)(runtime/src/vulkan_bindless.h,write_image), so UINT/SINT MSAA live at bindings 22–25. A uint MSAA T# therefore queries the 1x1 fallback rather than the texture. The GPU runs in the body only cover 2D and 2D-array resinfo, so this is unverified.
Verdict: needs changes — docs row plus class-aware MSAA binding (or an explicit, tested restriction).
|
Tested
|
20f02e6 to
904608c
Compare
|
Tested 904608c merged onto main 561b65a (the branch already contains it) on Apple M4, macOS 27.2.1, MoltenVK 1.4.2, Python 3.15.2 and 3.12.16: needs changes
AI-assisted. |
|
Tested 904608c merged with main 561b65a (PR already based on it) on Linux WSL2, Python 3.12.16, and native Windows, Python 3.13.1 (llvm-mc 23.1.6 on PATH): pass tests/semantic/test_image_get_resinfo_dims.py: Linux 10 run, 9 passed, 1 skipped (the llvm-mc/spirv-val round trip, no spirv-as on Linux), 0 failed; Windows 10 run, 10 passed, 0 skipped. tests/test_image_query_translate.py: 10 run, 10 passed on both. Full semantic suite with the #4357 runner (scripts/run_semantic_tests.py --jobs 3, Linux): 434 files, 6160 tests, 0 files not ok. Baseline main (561b65a): 433 files, 6150 tests, 0 not ok; the difference is exactly this PR's new file (1 file, 10 tests), so no other file changed status. Negative control: with tools/rdna2spirv.py restored to upstream/main the new semantic file runs 10 tests with 16 failures, 57 errors and 1 skip. tests/test_image_query_translate.py still passes on main's translator, because the PR only removes 1D/3D/CUBE and a16 from that file's list of dims that must be refused, so that edit is not a regression check by itself. I checked the bindings: the new set-0 bindings 20 and 21 for MSAA images match first_ms_binding = 20 and the comment in runtime/src/vulkan_bindless.h. No issue found. |
thiefyzheng
left a comment
There was a problem hiding this comment.
Code read at 904608c4 against base 561b65a8 (AI-assisted review, automated pass per AGENTS.md; driver + worker, see lrev).
Mechanical checks (run by the driver, not the model):
compileallon the changed Python: oktests/semantic/test_image_get_resinfo_dims.py: ok — OK (skipped=1)- patch mentions game-data/protection terms; needs a human read
Review
VERDICT: CONCERNS
WHY: The translation is wired correctly (bindings, types and capabilities match runtime/src/vulkan_bindless.h and gfx10_descriptors.h, and the 2D/2D_ARRAY paths are preserved), but the CUBE path issues the same OpImageQuerySizeLod %v3int on the same %images_arr/%img2da as 2D_ARRAY yet skips the layer minification applied there, and none of the new dimension rules is recorded in the docs/design.md contract table or confirmed against hardware — the only resinfo GPU tests still cover just 2D and 2D array.
FINDINGS:
tools/rdna2spirv.py:12556— CUBE is queried through exactly the same path as 2D_ARRAY (has_zat 12548 routes it toOpImageQuerySizeLod %v3inton the%images_arr/%img2daload), but onlydim:SQ_RSRC_IMG_2D_ARRAYapplies themax(1, layers >> (BASE_LEVEL + level))minification; the cube face count is returned raw. One of the two must be wrong for the same hardware query, anddocs/design.md:401states the measured RDNA2 rule is that a 2D array's depth word is minified — a cube is bound as a 6N-layer 2D array (runtime/src/gfx10_descriptors.h:199), so a minification is to be expected there too. Nothing measures the cube case (runtime/test/shaders/cs_resinfo.asm:41andps_array_resinfo.asm:6only exercise 2D and 2D_ARRAY), andtests/semantic/test_image_get_resinfo_dims.py:315bakes the unminified assumption in, so the suite cannot catch it.docs/design.md:401— the contract row for this instruction still ends with "image_get_resinfoon other dimensions isUnsupported" and records only the 2D/2D-array behaviour measured on gfx1036; five new rules (3D, CUBE, 1D, 2D_MSAA, 2D_MSAA_ARRAY) plusa16masking were added with no row and no statement of how each was confirmed. AGENTS.md requires a new translator rule to go into that table with its confirmation, and the PR's own GPU evidence covers none of the new dimensions (onlycs_resinfo2D andps_array_resinfo2D_ARRAY), so the MSAA sample-count-in-W,mip != 0zeroing, 1D depth = 0 and cube face count are assumptions.tools/rdna2spirv.py:14218— declaring%images_2dms/%images_2dmsa(bindings 20/21) makes the shader statically use those bindings unconditionally, whileruntime/src/vulkan_bindless.h:125(binding_enabled) omits the MS bindings from set 0's layout whenever that sample class is off — the default is one sample, andlimit_ms_bindingsturns classes off on devices whose descriptor limits are tight. On such a device a shader containing an MSAAimage_get_resinfofails pipeline creation instead of falling back via the descriptor table.
CHECKED:.lrev.diff;tools/rdna2spirv.py(lines 12500-12574 resinfo_words, 12675-12869 image_misc, 13945-13960 iface, 13996 capabilities, 14171-14230 types/decorations, 14485-14510 globals, 11360-11399 desc_lookup/uses_tex);tests/semantic/test_image_get_resinfo_dims.py;tests/semantic/support.py(translate_lines/translate_listing);tests/semantic/README.md;tests/test_image_query_translate.py(160-204);tests/test_translate.py:1558-1572;docs/design.md:262-277, 399-401;runtime/src/vulkan_bindless.h:4-160;runtime/src/gfx10_descriptors.h:180-200;runtime/shims/d3d12_vulkan_device.cpp:4684;runtime/test/shaders/cs_resinfo.asm,ps_array_resinfo.asm;scripts/run_gpu_tests.py:890. No game data or protection material appears in the diff (the mechanical flag is a false positive: the matches are the wordscube/dim:). I could not runspirv-valor the GPU tests here, andvalidate_spirvin the new test returns silently when spirv-as/spirv-val are absent, so the driver's "OK (skipped=1)" does not by itself prove the modules validated.
Claim: #5156 (comment)
Summary
Extends
image_get_resinfointools/rdna2spirv.pyto support all remaining standard bindless image dimensions (plusa1616-bit mip level masking):dim:SQ_RSRC_IMG_3D(set 0 binding 6,%images_3d):OpImageQuerySizeLod %v3int+OpImageQueryLevels %intwith OOB mip zeroing (mip >= levels->(0, 0, 0, levels)).dim:SQ_RSRC_IMG_CUBE(set 0 binding 3,%images_arr, matching the bindless 2D-array-of-6*N-faces layout):OpImageQuerySizeLod %v3int+OpImageQueryLevels %int->(w, h, 6*N, levels)with OOB mip zeroing.dim:SQ_RSRC_IMG_1D(set 0 binding 5,%images_1d,OpCapability Sampled1D): scalarOpImageQuerySizeLod %int+OpImageQueryLevels %int->(w, 0, 0, levels)with OOB mip zeroing.dim:SQ_RSRC_IMG_2D_MSAA&dim:SQ_RSRC_IMG_2D_MSAA_ARRAY(set 0 bindings 20 & 21,%images_2dms/%images_2dmsamatchingruntime/src/vulkan_bindless.h):OpImageQuerySize %v2int/%v3int+OpImageQuerySamples %int(no mipmaps, soOpImageQuerySizeLod/OpImageQueryLevelsare not emitted;mip != 0zeroes spatial extents while keeping sample count in.w).a16: masks the low 16 bits (& 0xFFFF) of the address VGPR as the unsigned mip level.2Dand2D_ARRAY(SHADER-388) behavior andGen.resinfo_wordsbool backwards compatibility;SQ_RSRC_IMG_1D_ARRAY(no bindless binding) andd16remainUnsupported.Verification
python -m unittest discover -s tests/semantic -p test_image_get_resinfo_dims.py -v: 10/10 PASS (all 7 dims in PS & CS, 8dmasksubsets per dim,a16, semantic evaluation ofresinfo_wordsincluding OOB mips, andllvm-mc-assembled round-trips — every generated SPIR-V module validated withspirv-as+spirv-val --target-env vulkan1.2).python -I tests/test_image_query_translate.py -v: 10/10 PASS.pytest tests/test_translate.py -k resinfo -v: 6/6 PASS (withLLVM_MC+spirv-val).python -I tests/test_text_write_line_endings.py: 3/3 PASS.scripts/run_gpu_tests.py --filter resinfo:LEONIDA_W64_EMULATE=1): 2/2 PASS (cs_resinfo64/64 words exact,ps_array_resinfo4096/4096 pixels exact).LEONIDA_VK_DEVICE=AMD): 1/2 PASS, 1 SKIP (cs_resinfo64/64 words exact;ps_array_resinfoskipped due to 128 B push-constant limit).git diff --check: clean.AI-assisted (Gemini 4 Neon).