tombox-xshader tests: bit-exact buffer_gl0_inv and buffer_gl1_inv #332
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
library
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/omonkeyz--xbox-emulator!332
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/332/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?
@GDAgent on GitHub · 2026-11-23 20:21 UTC · original
GDAgent:tests/xshader-exec-mubuf-cache-inv→main· +33 −0 · 2 files · 1 commits · closed without mergingLibrary / area:
tombox-xshader, tests only (newtests/exec_mem/mubuf_inv.rs, onemodline intests/exec_mem/mod.rs)Exports changed (exports.txt rows): none
Source of the behaviour: RDNA2 ISA: MUBUF opcodes 0x71
BUFFER_GL0_INVand 0x72BUFFER_GL1_INVinvalidate the vector L0 and the GL1 caches; they take no resource and write no register. The translator already emits nothing for them. Run natively on Windows 11 on an AMD RDNA2 GPU (Radeon RX 6600 XT, gfx1032) and on WARP; not run under Proton.What
buffer_gl0_invandbuffer_gl1_invare translated, but no exec case ran them, so neither counts as verified. The new test executes each of them on the device through the existingCsCaseharness (compute shader, buffer readback). Per mnemonic and per value (a plain dword and one with the sign bit set), the shader:The test checks that the stored data is still visible after the invalidate, that a register written before the invalidate is intact, and that the neighbouring dword stays 0. The group is also rerun with runtime inputs, like the other groups.
Why
Both opcodes occur in the shaders of The Matrix Awakens (Xbox Series X build) as the RDNA2 form of the GCN
buffer_wbinvl1; the ISA table test already maps that name to them. A mistranslation here (for example treating the instruction as a memory access that needs a resource) would refuse every shader that contains one, so a pinned case is cheap protection.No translator bug turned up: all 4 cases passed on WARP and on the GPU at the first run.
This PR replaces the cache-invalidate group of an earlier broader MUBUF branch of ours; the other 11 mnemonics of that branch are covered by #297, so they are not repeated here. The new module is named
mubuf_invand sits away from the othermodlines so it does not conflict with #297 (checked with a trial merge against #297, #298, #286, #287, #242 and #302).tools/progress/progress.jsonrdna2_verifiedis not touched, to keep this PR test-only.Tests
cargo test -p tombox-xshader --test exec mubuf_cache_invalidates(WARP): 1 passed.TOMBOX_EXEC_HW=1 cargo test -p tombox-xshader --test exec mubuf_cache_invalidates -- --nocapture(Radeon RX 6600 XT): 1 passed; output linemubuf_cache_invalidates: 2 mnemonics verified, 0 failing, 4 cases, 4 rerun with runtime inputs.pr_gate.py --base origin/main: 0 problems.Not verified
execbinary was not run with this commit. Onmainand this GPU, four existing tests fail withTOMBOX_EXEC_HW=1on this AMD GPU (f16_omod_follows_mode,mtbuf_d16_store_formats,scalar_smem_loads,vop2_basic); they fail the same way on plainmainand they share no code with this module. They pass on WARP.@omonkeyz on GitHub · 2026-11-25 13:51 UTC · original
Thanks. #305 covers buffer_gl0_inv and buffer_gl1_inv with the same and additional cases, so this is superseded.
Pull request closed