Shaders: s_atc_probe's immediate is not a register #1021

Manually merged
github merged 1 commit from gh-pr/1021/head into gh-pr/1021/base 2026-11-26 04:17:25 +00:00
Owner

@⁠CaravelaLabs on GitHub · 2026-11-24 15:08 UTC · original
CaravelaLabs:caravela/smem-atc-probe → main · +100 −9 · 2 files · 1 commits · merged 2026-11-25 00:21 UTC

s_atc_probe and s_atc_probe_buffer were decoded as ordinary scalar loads, so the 7-bit immediate became a register and the buffer resource was 2 dwords instead of 4.

On main ffe310e, llvm-mc -arch=amdgcn -mcpu=gfx1030 reads 0xF4981FF4 0x0A000001 as s_atc_probe 0x7f, s[104:105], s5 offset:0x1. The printer produced s_atc_probe exec_hi, s[104:105], s5 offset:0x000001. s_atc_probe_buffer 7, s[8:11], 0x20 was printed with s[8:9].

LLVM's probe form takes an immediate in that field, a 2-dword address or a 4-dword buffer resource, and no GLC/DLC operand (those bits are ignored). Translation still rejects these two opcodes, so this is the disassembly and the decoded fields, not a miscompiled shader. Ordinary s_load / s_buffer_load text is unchanged.

The new test fails on main (s7 where the immediate is 7) and passes with this change. Shader library tests: 97 passed, 0 failed, 1 ignored. Windows clippy -D warnings on the workspace, with and without --all-features, is clean.

AI-assisted; tests run on this machine.

**@⁠CaravelaLabs** on GitHub · 2026-11-24 15:08 UTC · [original](https://github.com/Marvisak/VIctory/pull/1021) `CaravelaLabs:caravela/smem-atc-probe` → `main` · +100 −9 · 2 files · 1 commits · merged 2026-11-25 00:21 UTC `s_atc_probe` and `s_atc_probe_buffer` were decoded as ordinary scalar loads, so the 7-bit immediate became a register and the buffer resource was 2 dwords instead of 4. On main `ffe310e`, `llvm-mc -arch=amdgcn -mcpu=gfx1030` reads `0xF4981FF4 0x0A000001` as `s_atc_probe 0x7f, s[104:105], s5 offset:0x1`. The printer produced `s_atc_probe exec_hi, s[104:105], s5 offset:0x000001`. `s_atc_probe_buffer 7, s[8:11], 0x20` was printed with `s[8:9]`. LLVM's probe form takes an immediate in that field, a 2-dword address or a 4-dword buffer resource, and no GLC/DLC operand (those bits are ignored). Translation still rejects these two opcodes, so this is the disassembly and the decoded fields, not a miscompiled shader. Ordinary `s_load` / `s_buffer_load` text is unchanged. The new test fails on main (`s7` where the immediate is `7`) and passes with this change. Shader library tests: 97 passed, 0 failed, 1 ignored. Windows clippy `-D warnings` on the workspace, with and without `--all-features`, is clean. AI-assisted; tests run on this machine.
SDATA on s_atc_probe and s_atc_probe_buffer is a 7-bit immediate, the buffer resource is four dwords, and GLC/DLC are not operands of either.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:17:24 +00:00
github manually merged commit 3d71ad1a65 into gh-pr/1021/base 2026-11-26 04:17:25 +00:00
Author
Owner

@⁠Zipettte on GitHub · 2026-11-24 15:40 UTC · original

Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 3d71ad1: cargo test -p victory-shader passes, 121 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).

Tested with AI assistance (Claude).

**@⁠Zipettte** on GitHub · 2026-11-24 15:40 UTC · [original](https://github.com/Marvisak/VIctory/pull/1021#issuecomment-7136417109) Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 3d71ad1: `cargo test -p victory-shader` passes, 121 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed). _Tested with AI assistance (Claude)._
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!1021
No description provided.