Repository navigation
rdna2spirv, shader_disasm: VOPC compares in DPP form (SHADER-VOPC-DPP) - #957
Conversation
Three pipeline-library compute programs of 1.0.2.1 hold v_cmp_gt_f32 with a DPP16 or DPP8 src0. llvm-mc has no gfx10 decoding for the pair, so the listing dropped the words and the programs were refused. shader_disasm.py prints the pair through a VOP2 stand-in that takes the same DPP word, rdna2_decode.py decodes it directly, and Gen.dpp_insn translates the compare for the forms where every lane writes its bit. Other forms and v_cmpx are refused: what an unwritten lane does to VCC is not measured. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
KernelSmoker
left a comment
There was a problem hiding this comment.
Verified on exact head d046559435c22f1dc834001b1e117a992358f89e. In the Fedora 45 container with LLVM 23.1.5 (LLVM_MC=llvm-mc), test_dpp_compare.py passed 9/9 with both llvm-mc-dependent cases enabled; test_rdna2_decode.py 19/19; test_shader_disasm.py 30/30; test_dpp_eager_subgroup.py 7/7; test_run_gpu_tests.py 64/64; test_run_gpu_tests_python_assembler.py 10/10; test_run_gpu_tests_paths.py 21/21; design rows 5/5; docs repo paths 3/3; docs table rows 2/2. regen_fixtures.py --check, check_no_game_data.py, and git diff --check also passed.
These are CPU/interpreter, assembler/disassembler, and fixture checks; I did not run the GPU shader probe locally. No local GPU result is claimed.
Independent GPU testing resultsVerified the new VOPC DPP compare fixture on NVIDIA Blackwell hardware using both native execution and Wave64 emulation with Vulkan validation enabled. The new Tested revisions
Test environment
Test configuration
Both revisions compiled successfully. Execution logs confirm nine GPU runner invocations per mode on each revision, for 36 GPU runner invocations overall. Shader translationEvery invocation reported successful translation and SPIR-V validation for all selected shaders.
The additional HEAD shader is GPU test resultsResults across all three attempts:
Aggregate fixture results:
The fixture totals exclude aggregate runner summary records. New VOPC DPP compare fixtureThe new
All 144 compared output words across the 18 executions matched the expected values. No validation failure was attributed to the new fixture in the examined runner results. Existing Wave64 validation issueNative Under Wave64 emulation, the fixture produced correct functional output but failed due to validation diagnostics: The validation layer reported shared-memory data races during compute dispatch. Representative diagnostic: Every affected invocation reported six validation errors.
Across both revisions, all 18 affected Wave64 executions reported zero functional output mismatches and a combined 108 validation errors. The runner returned exit code 1 for these emulated runs. Native runner invocations returned exit code 0. The issue was already present on BASE and was not newly introduced by this PR. Whether the reported race represents a genuine synchronization defect or a validation-layer issue requires separate investigation. Test execution noteDuring the second attempt, live GitHub PR metadata verification was temporarily unavailable because of a network connection failure. The recorded pinned revisions and merge base remained unchanged. Live PR metadata verification succeeded in the first and third attempts. Limitations
ConclusionResult: PASS for the new VOPC DPP compare fixture; overall suite requires review due to a pre-existing Wave64 validation issue. The new All eight previously existing non-Wave64 DPP fixtures also remained successful. The existing No new functional regression was identified within the tested DPP coverage. AI-assisted log analysis and report preparation. |
|
Independent run of Setup: Windows 11 Pro 26300, native
AI-assisted. |
|
Merging. Why merged: SHADER-VOPC-DPP decodes and translates VOPC compares in DPP16/DPP8 form. Why it's good: on the RTX 4070 SUPER,
Own tests (dpp_compare, dpp_eager_subgroup, rdna2_decode, shader_disasm, run_gpu_tests*, docs): 207 passed, 0 skipped. The llvm-mc cases ran with a real AMDGPU llvm-mc. Tested on Windows 11 / RTX 4070 SUPER: merged alone onto main 66d4f5a. With it in, the repo-consistency set gives 573 passed / 5 skipped / 0 failed, and check_no_game_data is clean. git merge-tree against current main: no conflicts. Security read of the three-dot diff: decoder and translator branches plus the tool changes above, with no binaries, downloads, network calls or CI changes. Heads-up from the PR body: this conflicts with #281 in AI-assisted (Claude Code, Claude Opus 5.5). |
Extend ProjectLeonida#957's DPP VOPC compare to v_cmpx: the same lane selection, with the result written to EXEC. v_cmpx prints no destination, so src0 is its first operand. Only the forms where every lane writes its bit are taken, as for v_cmp. 78 pipeline-library pixel shaders of 1.0.2.1 were refused for it; all 78 now translate and pass spirv-val. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ing, as run_gpu_tests.py does (TEST-TRANSLATE-TEXT-ONLY) translator-tests fails on main since 6261ca9 (the merge of #957), which added runtime/test/shaders/cs_dpp_cmp.asm: tests/test_translate.py::test_gpu_samples_translate_and_validate[cs_dpp_cmp.asm] and ::test_wave64_emulate_uses_no_subgroup_ops[cs_dpp_cmp.asm] stop at the llvm-mc assertion of conftest.Shader with "dpp variant of this instruction is not supported" (2 failed, 1879 passed on a runner with llvm-mc 21; the same two with 23.1.4). llvm-mc has no gfx1013 encoding for a VOPC compare in DPP form, so the fixture carries the line "; run_gpu_tests: text only, ..." and assemble_to_s in scripts/run_gpu_tests.py writes its listing from the text. conftest.Shader assembled every sample with llvm-mc and did not know the line. It now does the same as the GPU runner for a sample that carries it, so both tests translate and validate the fixture instead of failing before they reach the translator. Two new tests: the line is spelled in conftest as in run_gpu_tests.py, and only a sample that carries it skips llvm-mc (the same lines without it still go to llvm-mc and fail there). Controls: with the line spelled differently in conftest the spelling test and both cs_dpp_cmp tests fail; with every sample taking the text path the second new test fails. The translator-tests step with the workflow's file list (37 files, pytest 9.2.0, llvm-mc 23.1.4, without numpy and Pillow, so 134 skipped): 2 failed, 1618 passed on main 89d7dfc; 1622 passed here. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claimed in the coordination issue as: SHADER-VOPC-DPP (#14 (comment))
Depends on: conflicts with #281 in
tools/shader_disasm.py(both splitdisasmintorun_mcplus a second pass over the words llvm-mc rejected; whichever merges second needs a small rebase). Builds on none.What and why
Three of the 2,684 pipeline-library compute programs of 1.0.2.1 hold a VOPC compare whose src0 field is a DPP marker: 4
v_cmp_gt_f32each, withquad_perm:[1,0,3,2],quad_perm:[2,3,0,1],row_ror:8(allbound_ctrl:1, masks 0xF) anddpp8:[4,5,6,7,0,1,2,3], besidev_min/max_f32_dppandv_mov_b32_dppon the same lanes. llvm-mc (LLVM 21.1.8,gfx1013) rejects the first word, so the listing dropped 7 words per program and the translator refused all three (fall-through into undecodable words). The retail boot asks for these pipelines at device slot 67.These are the three small programs still refused with #674 + #647 + #593 + #583 applied (2,672 of 2,684 translate then, measured for the first three and counted from the header census for #583; the other 9 are the large vcc-tuple family). This change needs none of them.
tools/shader_disasm.py: a rejected VOPC word with a DPP src0 is decoded with its first word turned intov_max_f32intov0, which takes the same DPP second word, so llvm-mc prints the two sources and the DPP controls; the line then gets the compare's name, avcc_lodestination and the real encoding back (with_vopc_dpp). A word that does not come out as the stand-in at an instruction boundary is left as it was.tools/rdna2_decode.py: decodes the pair directly. Before, it printed the DPP marker as an operand.tools/rdna2spirv.py(Gen.dpp_insn): a compare takes src0 through the existing DPP lane selection and writes its mask as the plain compare does. Only the forms where every lane writes its bit are translated:row_maskandbank_mask0xF and eitherbound_ctrl1 or DPP8. Any other form, andv_cmpx, is refused (DPP compare with lanes that keep their mask bit).scripts/run_gpu_tests.py: llvm-mc does not assemble the form either (dpp variant of this instruction is not supported), so a.asmcan carry a marker line that passes its text through as the listing, the wayregen_fixtures.pywrites fixtures.cs_dpp_cmp.asmis the only one.docs/design.md: the contract row "DPP on a VOPC compare".Not measured on hardware. The rule follows from the encoding, LLVM's GFX11 definition of the same form and the VOP2 DPP rules already measured;
tools/crosslane_fuzz.py --dpp-sweep --oracle hwdoes not cover compares and I have no Linux AMD machine for it. That is why the forms that leave a lane unwritten are refused rather than guessed. If someone with the oracle rig can run the four forms above, the row should say so.Tested
spirv-val(--wave64-emulate). Withmain's listings and translator: 0 of 3.python -I tests/semantic/test_dpp_compare.py: 9 pass. Lane values for 3 compares x 8 forms x 3 EXEC cases in the SPIR-V interpreter against a reference; refusals; both printers give the same line for 5 synthetic pairs (the llvm-mc cases skip withoutLLVM_MC).python -I scripts/run_semantic_tests.py tests/semantic: 466 files, 6,117 tests, 1 file fails (test_image_cube_store_glc), which also fails onmainhere.tests/test_rdna2_decode.py,tests/test_shader_disasm.py,tests/semantic/test_dpp_eager_subgroup.py,tests/test_run_gpu_tests*.py,tests/semantic/regen_fixtures.py --check,tests/test_docs_design_rows.py,tests/test_docs_repo_paths.py,tests/test_docs_table_rows.py: pass.scripts/run_gpu_tests.py --filter cs_dpp:cs_dpp_cmppasses (3 2 3 2 1 0 1 0) on all three runs below, with the othercs_dpp*unchanged.main).GPUs tested: NVIDIA GeForce RTX 4080 (driver 621.24, Windows 11 26300), native 9/10 with
cs_dpp_w64skipped (no 64-wide subgroup) andLEONIDA_W64_EMULATE=110/10; AMD Radeon integrated graphics (PCI 1002:13C0, driver 32.0.21042.62, same machine), native 10/10.AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed.🤖 Generated with Claude Code