Shaders: xcl disasm prints image operands, dmask, dim and flags #812
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!812
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/812/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@upipibi on GitHub · 2026-11-24 05:45 UTC · original
upipibi:disasm-mimg-operands→main· +124 −0 · 1 files · 1 commits · merged 2026-11-25 01:08 UTCxcl disasmprints an image (MIMG) instruction with the widest registers its opcode can take and nothing else:image_load v[16:19], v[8:11], s[96:103]whatever DMASK, the dimension and the flags are, and the address registers of an NSA form are not listed. So a 1D load of one component and a 2D-array load of four read the same. The recompiler has all of this; only the printed line drops it. Same kind of gap as #664 and #790 / #791, in an encoding none of them covers;gh pr list --searchfor "mimg disasm", "dmask" and "MIMG" finds no PR for it.Independent of #790 / #791 (other hunks of
rdna2.rs; they merge cleanly in any order).What is in it
crates/xcl/src/gpu/rdna2.rs:mimg_text, called first informat– the data registers DMASK selects (four for a gather, two at least for a compare-and-swap, halved by D16, one more with TFE), the address registers (a range, or the[v8, v9, …]list of an NSA form), resource, sampler,dmask:(when not 0),dim:SQ_RSRC_IMG_*andunorm glc slc dlc r128 a16 tfe lwe d16in LLVM's order; a ray query printsa16alone.mimg_address_dwordscounts the address dwords as LLVM'sgetAddrSizeMIMGOpdoes, from the mnemonic's parts (_o/_b/_c,_cl/_l/mip,_d/_cd,_g16), the dimension and A16.llvm_gfx10_image_textcompares the whole line with LLVM's for all 265 image lines oftests/data/llvm-amdgpu(gfx10_mimg.txt, and theimage_msaa_load/image_bvh*lines ofgfx1030_new.txt; 105 instructions, 206 lines in NSA form);image_operands_and_modifiershas 7 words checked againstllvm-mc21.1.8 (-mcpu=gfx1030) for what the corpus lacks (slc,r128, all the flags at once) and a few more.The text also goes into the
// pc: …comment lines of the translated HLSL, so the HLSL of a program with image instructions changes in its comments (no code line changes).Tested
cargo test -p xcl --lib gpu::rdna2::tests::: 11 passed, 0 failed. With the tests onmain'sformat(e50836b): 2 failed –llvm_gfx10_image_text"263 of 265 image lines differ from LLVM's",image_operands_and_modifiers.cargo test --workspace --no-fail-fast -- --test-threads=4on2239a06: 706 passed, 0 failed, 41 ignored (xcl lib: 665 passed, 0 failed, 21 ignored).no wave64:gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.Regression run
From Anon64's run (https://github.com/ivall/xcl/pull/812#issuecomment-7124221119), thanks:
main:
PR:
Not tested
XCL_SAMPLE_*data: the game-data tests passed without running.test_title_draws_with_a_root_signature_under_the_debug_layeranduploads_start_from_each_subresources_statereturn early.image_load_by2,image_store_pck4, …) follow the same rules by their names; LLVM does not know them, so nothing was compared.llvm-mcshows: an atomic with more than two DMASK bits (llvm-mc: one register), an NSA form with more or fewer dwords than its addresses need.AI use
xcl disasmwith the LLVM test lines in the repository, wrote the code, the tests and this description, and ran the tests.🤖 Generated with Claude Code
@MesshM on GitHub · 2026-11-24 06:06 UTC · original
Test run of
2239a061261939bd5b8a61c5a8ab4334b5d4c476on AMD RDNA4. I merged it onto currentmainbeaa245locally (clean merge) and tested that tree.Tested
stable-x86_64-pc-windows-msvc, debugcargo build --workspace+cargo test --workspace -- --test-threads=4on the merge: 715 passed, 0 failed, 41 ignored, exit code 0;xcllib tests 674 passed, 0 failed, 21 ignoredSKIPPED;image_operands_and_modifierspasses.Review: Disassembler text only. I found nothing to change.
Not tested: no retail title or regression run (I have no unpacked game), no
XCL_SAMPLE_*tests, release build; the PR's head on its old base was not run, only its merge ontomain.Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.
@Anon64 on GitHub · 2026-11-24 06:43 UTC · original
Regression runs for this PR's head
2239a06and for its basemaine50836b, on a retail title (same title, 60 s each), made withscripts/smoke.ps1(release, clean tree at each commit) and pasted unedited, for Regression run.main:
this PR:
Tested
Not tested
Report written with Claude Code (Claude Opus 5.5) from runs on this machine.
@SlopTart on GitHub · 2026-11-24 08:09 UTC · original
Linux / AMD RDNA3 datapoint.
Merged state: head
2239a06onto main1ec4c98, clean merge.Full suite,
cargo test --workspace --release --no-fail-fast --target x86_64-pc-windows-gnu -- --test-threads=4: 706 passed, 11 failed, 41 ignored. Failures = the known Wine-lane set from my #42 rows plus #718 trio members and a hit ofgpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes(new flake, see #718 addendum). xcl disasm image-operand tests green.Not tested: retail titles (none here), Windows, RDNA4.
Counts only, no game data.
Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross
x86_64-pc-windows-gnu,XCL_NETWORK=0, release profile,--test-threads=4. My Linux rows: #42 / #718.AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.