tombox-xshader tests: replay RDNA2-recorded image atomic results (13 image_atomic_* ops) #195

Closed
github-bot wants to merge 1 commit from gh-pr/195/head into gh-pr/195/base
Owner

@⁠SchmashinPrunes on GitHub · 2026-11-23 00:25 UTC · original
SchmashinPrunes:rdna2-image-atomics → main · +420 −6 · 6 files · 1 commits · closed without merging

Follow-up to #191: a WARP replay test of image atomic results recorded on RDNA2 hardware, for all 13 image_atomic_* ops. As agreed on #191, it doesn't touch the progress files; the count is for your generator to pick up.

Library / area: tombox-xshader tests, tools/rdna2-hwprobe

Exports changed (exports.txt rows): none

Source of the behaviour: results recorded on RDNA2 hardware, the gfx1036 iGPU of a Ryzen 5 9600X (ROCm/HIP 5.7.1), with the new tools/rdna2-hwprobe/image_probe.py. Each kernel run was done twice and kept only when both runs were identical. gfx1036 is RDNA2, not the console's gfx1013. No game or console files are involved.

What is recorded

  • Image: each workgroup builds a T# in SGPRs for an 8-texel linear R32_UINT image (dim 2D, height 1, unorm addressing).
  • Inputs: it fills the image with the initial texels of exec_mem::mimg::image_mimg_atomics, then runs one atomic with one of that test's 8 (x, data, cmp) tuples, with and without glc.
  • Output: the whole texel row read back, plus the returned register.
  • Coverage: 13 ops x 8 tuples x 2 = 208 results.

All 208 equal the existing test's ISA-model expectations. That covers the new texel, the untouched neighbours, the pre-op value with glc, and vdata unchanged without it.

Change

  • tests/exec_mem/mimg.rs: a new test, image_mimg_atomics_rdna2_silicon (group mimg_atomics_rdna2_silicon). It replays the 208 recorded cases through the translator with the same encodings (mimg(), IMG_AT), checking all 8 texels and the returned value.
  • tests/exec_mem/mimg_rdna2.rs (new, generated): the recorded table. It is registered in exec_mem/mod.rs.
  • tools/rdna2-hwprobe/image_probe.py: writes the kernels and inputs. Its check <dir> mode compares a recording with the model, and rust <dir> <out> <machine> writes mimg_rdna2.rs.
  • tools/rdna2-hwprobe/verify_runner.cpp: takes an optional case count and output bytes per case (the default behaviour is unchanged).
  • tools/rdna2-hwprobe/README.txt: a section with the commands.

One probe detail, recorded here because it cost a run: on RDNA2, stores are counted by vscnt, so the probe needs s_waitcnt_vscnt null, 0 between filling the image and the atomic. Without it, about half the workgroups ran the atomic on unfilled memory.

Tests (Windows 11 Pro, WARP, DXC 1.9.2609, on c4b7607)

cargo check --locked -p tombox-pe -p tombox-archive -p tombox-rpf -p tombox-disasm -p tombox-xshader --all-targets    ok, no warnings
cargo test -p tombox-xshader --release --test exec mimg
  mimg_atomics_rdna2_silicon: 13 mnemonics verified, 0 failing or skipped, 208 cases, 208 rerun with runtime inputs
  test result: ok. 10 passed; 0 failed

The remaining RDNA2 instruction squares are ds_gws_*, ds_ordered_count and s_sendmsghalt. These are the translator's refusals in BLOCKERS, so this PR doesn't address them.

  • cargo test -p tombox-xshader passes
  • No game or console files and no binaries included
  • No fake success

🤖 Generated with Claude Code

**@⁠SchmashinPrunes** on GitHub · 2026-11-23 00:25 UTC · [original](https://github.com/omonkeyz/xbox-emulator/pull/195) `SchmashinPrunes:rdna2-image-atomics` → `main` · +420 −6 · 6 files · 1 commits · closed without merging Follow-up to #191: a WARP replay test of image atomic results recorded on RDNA2 hardware, for all 13 `image_atomic_*` ops. As agreed on #191, it doesn't touch the progress files; the count is for your generator to pick up. **Library / area:** tombox-xshader tests, `tools/rdna2-hwprobe` **Exports changed (exports.txt rows):** none **Source of the behaviour:** results recorded on RDNA2 hardware, the gfx1036 iGPU of a Ryzen 5 9600X (ROCm/HIP 5.7.1), with the new `tools/rdna2-hwprobe/image_probe.py`. Each kernel run was done twice and kept only when both runs were identical. gfx1036 is RDNA2, not the console's gfx1013. No game or console files are involved. ### What is recorded - **Image:** each workgroup builds a T# in SGPRs for an 8-texel linear `R32_UINT` image (dim 2D, height 1, unorm addressing). - **Inputs:** it fills the image with the initial texels of `exec_mem::mimg::image_mimg_atomics`, then runs one atomic with one of that test's 8 `(x, data, cmp)` tuples, with and without `glc`. - **Output:** the whole texel row read back, plus the returned register. - **Coverage:** 13 ops x 8 tuples x 2 = 208 results. All 208 equal the existing test's ISA-model expectations. That covers the new texel, the untouched neighbours, the pre-op value with `glc`, and vdata unchanged without it. ### Change - `tests/exec_mem/mimg.rs`: a new test, `image_mimg_atomics_rdna2_silicon` (group `mimg_atomics_rdna2_silicon`). It replays the 208 recorded cases through the translator with the same encodings (`mimg()`, `IMG_AT`), checking all 8 texels and the returned value. - `tests/exec_mem/mimg_rdna2.rs` (new, generated): the recorded table. It is registered in `exec_mem/mod.rs`. - `tools/rdna2-hwprobe/image_probe.py`: writes the kernels and inputs. Its `check <dir>` mode compares a recording with the model, and `rust <dir> <out> <machine>` writes `mimg_rdna2.rs`. - `tools/rdna2-hwprobe/verify_runner.cpp`: takes an optional case count and output bytes per case (the default behaviour is unchanged). - `tools/rdna2-hwprobe/README.txt`: a section with the commands. One probe detail, recorded here because it cost a run: on RDNA2, stores are counted by `vscnt`, so the probe needs `s_waitcnt_vscnt null, 0` between filling the image and the atomic. Without it, about half the workgroups ran the atomic on unfilled memory. ### Tests (Windows 11 Pro, WARP, DXC 1.9.2609, on c4b7607) ``` cargo check --locked -p tombox-pe -p tombox-archive -p tombox-rpf -p tombox-disasm -p tombox-xshader --all-targets ok, no warnings cargo test -p tombox-xshader --release --test exec mimg mimg_atomics_rdna2_silicon: 13 mnemonics verified, 0 failing or skipped, 208 cases, 208 rerun with runtime inputs test result: ok. 10 passed; 0 failed ``` The remaining RDNA2 instruction squares are `ds_gws_*`, `ds_ordered_count` and `s_sendmsghalt`. These are the translator's refusals in BLOCKERS, so this PR doesn't address them. - [x] `cargo test -p tombox-xshader` passes - [x] No game or console files and no binaries included - [x] No fake success 🤖 Generated with [Claude Code](https://claude.com/claude-code)
exec_mem::mimg::image_mimg_atomics_rdna2_silicon runs all 13
image_atomic_* ops through the translator on WARP and compares against
results recorded on RDNA2 hardware (gfx1036): the 8 (x, data, cmp)
tuples and initial texels of image_mimg_atomics, with and without glc,
the whole recorded texel row and the returned pre-op value (or vdata
unchanged without glc). 208 cases, 0 failing with fixed and runtime
inputs. The recordings equal the existing test's ISA-model
expectations.

tools/rdna2-hwprobe/image_probe.py builds the kernels (linear R32_UINT
T# in SGPRs), checks a recording against the model and writes
exec_mem/mimg_rdna2.rs; verify_runner takes an optional case count and
output size per case.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xsrj8HzdWhzzYYavNNpHjk
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 06:13:23 +00:00
github-bot closed this pull request 2026-11-26 06:13:23 +00:00
Author
Owner

@⁠kiwe147 on GitHub · 2026-11-23 00:29 UTC · original

Tested head 0cd2d86dd9, applied with git apply (whitespace ignored, the line endings of my checkout differ) on main c2a3522, this PR alone. It applied without conflicts and the tests built.

Setup: Windows 11 Pro 10.0.26200, Ryzen 7 9800X3D, NVIDIA GeForce RTX 3080 (driver 621.24), MSVC, Rust 1.91.1.

cargo test --locked -p tombox-xshader --test exec mimg (11 tests, including the new image_mimg_atomics_rdna2_silicon):

mode result
WARP 11 passed, 0 failed
TOMBOX_EXEC_HW=1 (RTX 3080) 11 passed, 0 failed

So the recorded RDNA2 image-atomic results replay the same on WARP and on an NVIDIA GPU. I only ran the mimg tests of the exec suite, not the whole suite, and did not run the tools/rdna2-hwprobe scripts (they need ROCm).

For comparison, rdna2_silicon_results from #191 passes on WARP but fails on this GPU in hardware mode (NaN payloads of the f16 FMA family, see #194); this PR's test does not show that.

AI-assisted: yes (Claude Code)

**@⁠kiwe147** on GitHub · 2026-11-23 00:29 UTC · [original](https://github.com/omonkeyz/xbox-emulator/pull/195#issuecomment-7088388687) Tested head `0cd2d86dd9`, applied with `git apply` (whitespace ignored, the line endings of my checkout differ) on `main` `c2a3522`, this PR alone. It applied without conflicts and the tests built. Setup: Windows 11 Pro 10.0.26200, Ryzen 7 9800X3D, NVIDIA GeForce RTX 3080 (driver 621.24), MSVC, Rust 1.91.1. `cargo test --locked -p tombox-xshader --test exec mimg` (11 tests, including the new `image_mimg_atomics_rdna2_silicon`): | mode | result | |---|---| | WARP | 11 passed, 0 failed | | `TOMBOX_EXEC_HW=1` (RTX 3080) | 11 passed, 0 failed | So the recorded RDNA2 image-atomic results replay the same on WARP and on an NVIDIA GPU. I only ran the `mimg` tests of the `exec` suite, not the whole suite, and did not run the `tools/rdna2-hwprobe` scripts (they need ROCm). For comparison, `rdna2_silicon_results` from #191 passes on WARP but fails on this GPU in hardware mode (NaN payloads of the f16 FMA family, see #194); this PR's test does not show that. AI-assisted: yes (Claude Code)
Author
Owner

@⁠omonkeyz on GitHub · 2026-11-23 00:37 UTC · original

Applied in 50a13be (merged in c4e72f0) with your authorship kept, thanks. exec mimg passes 11/0 on WARP, and the progress files are untouched as agreed. Please also see #194: on NVIDIA in TOMBOX_EXEC_HW mode, the f16 FMA NaN payload cases from #191 fail.

**@⁠omonkeyz** on GitHub · 2026-11-23 00:37 UTC · [original](https://github.com/omonkeyz/xbox-emulator/pull/195#issuecomment-7088501889) Applied in 50a13be (merged in c4e72f0) with your authorship kept, thanks. exec mimg passes 11/0 on WARP, and the progress files are untouched as agreed. Please also see #194: on NVIDIA in TOMBOX_EXEC_HW mode, the f16 FMA NaN payload cases from #191 fail.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.