Shaders: xcl disasm prints waitcnt counters, hwreg() and sendmsg() #1007
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1014"
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?
Imported from ivall/xcl. Originally posted by upipibi on 2026-11-24T10:23:52Z.
xcl disasmprints the immediates ofs_waitcnt,s_waitcnt_depctr,s_getreg_b32/s_setreg_b32/s_setreg_imm32_b32ands_sendmsg/s_sendmsghaltas one hexadecimal number (s_waitcnt 0xf7f,s_setreg_b32 0xf851, m0,s_sendmsg 0x122), which the reader has to take apart by hand. Now as LLVM writes them:s_waitcnt vmcnt(15) lgkmcnt(15),s_setreg_b32 hwreg(HW_REG_TBA_HI, 1, 32), m0,s_sendmsg sendmsg(MSG_GS, GS_OP_EMIT, 1). One more of the text gaps of #664, in operands that issue and #687 / #706 / #716 / #790 / #791 / #812 do not cover; no open PR found for it (gh pr list --search"disasm", "hwreg OR sendmsg OR waitcnt").Independent: merges cleanly with #687, #706, #716, #790 / #791, #811 and #812.
What is in it
crates/xcl/src/gpu/rdna2.rs:waitcnt_text(a counter at its maximum is left out, unless all are),depctr_text(RDNA2's counters, withdepctr_hold_cnt; the number when bit 5 or 6 is set, as LLVM),hwreg_text(hwreg(register)for a whole register, elsehwreg(register, first bit, bits); LLVM's names for gfx10.3),sendmsg_text(names where the message has that operation, a stream only with a GS cut / emit, else the three numbers), called fromoperand_textbefore its match on the operand type.llvm_gfx10_waitcnt_hwreg_sendmsg_textcompares the whole line with LLVM's for the 48 such lines oftests/data/llvm-amdgpu;waitcnt_hwreg_and_sendmsg_operandshas 25 words checked againstllvm-mc21.1.8 (-mcpu=gfx1030): the corpus has twohwregforms and onesendmsg.sendmsgimmediate with bits above bit 9 stays a number (LLVM 21 ignores them). Branch targets stay addresses.Tested
cargo test -p xcl --lib gpu::rdna2::tests::: 11 passed, 0 failed. With the tests onmain'srdna2.rs(e50836b): 2 failed –llvm_gfx10_waitcnt_hwreg_sendmsg_text"40 of … lines differ from LLVM's" (48 lines),waitcnt_hwreg_and_sendmsg_operands.cargo test --workspace --no-fail-fast -- --test-threads=4on7cd41d9: three runs. Run 3: 706 passed, 0 failed, 41 ignored (xcl lib: 665 passed, 0 failed, 21 ignored). Runs 1 and 2: 703 passed, 3 failed, 41 ignored – the failure of #718 (placed_title_textures_share_vram_and_preserve_pixels, "cubemap extra_pages must be reused at same va", and the two tests its poisoned lock takes with it), whichmainshows on this machine too.no wave64:gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.Regression run
From Kalmarv's run (https://github.com/ivall/xcl/pull/1014#issuecomment-7138422552), 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.s_waitcnt_depctrlines ofgfx10_sopp.txtare not compared: they are RDNA1's reading (nodepctr_hold_cnt); the 19 ofgfx1030_new.txtare.llvm-mc21.1.8, not from hardware.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
Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T14:24:49Z.
Full-suite run, since this PR has no test report yet. Tested exact head
7cd41d9(on its basee50836b).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 706 passed, 0 failed, 41 ignored. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.waitcnt_hwreg_and_sendmsg_operands,llvm_gfx10_waitcnt_hwreg_sendmsg_text.Not tested
AI use
Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-24T16:55:41Z.
Regression pair for
7cd41d9againstmaine50836b(this PR's base), for the Regression run section. Both runs pass: no device removal, no crash, 97 % ofmain's frames, 98 % of its peak commit.Tested
scripts/smoke.ps1, the same retail title for 60 s each:mainate50836b(this PR's base, 67 commits behind today'smain) first, then this PR's head, one after the other on the same machine.maine50836b:this PR,
7cd41d9:Not tested
xcl disasmitself: the run doesn't print a disassembly, so it shows only that the rest of the runtime is unchanged.AI use: Claude Code (Claude Opus 5.5)
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T09:17:10Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-29T07:41:11Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T04:38:07Z.
Triage (#1607) – head
7cd41d9No open or merged PR formats
s_waitcnt,s_waitcnt_depctr,hwreg()orsendmsg(). Main has noOPR_WAITCNT/OPR_HWREG/OPR_SENDMSGhandling inrdna2.rs. #1013 (same author) touches different operands in the same file.No problems found in the diff.
Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.