tests: check that V_CMPX leaves VCC unchanged #1251
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!1251
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1251/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?
@Nawid3333 on GitHub · 2026-10-08 20:00 UTC · original
Nawid3333:tests/cmpx-preserves-vcc→main· +26 −0 · 1 files · 1 commits · closed without mergingProblem
On RDNA2 every
V_CMPX_*writes its result to EXEC only: the ISA guide says "All V_CMPX instructions write theresult of their comparison (one bit per thread) the EXEC mask", and the per-opcode pseudo-code is
EXEC[threadId] = (S0 < S1)with no VCC term. No test checks that VCC survives a V_CMPX: a translation that alsowrites VCC passed every test I could run (the CPU tests, the GPU case list and the focused modes that pass on my
host).
Change
VectorCmpxPreservesVccsets VCC withV_CMP_GT_U32(true), saves EXEC, runsV_CMPX_LT_U32(false), saves theresulting EXEC, restores EXEC and reads VCC through
V_CNDMASK_B32. It expects VCC still true and EXEC zero afterthe V_CMPX. It runs in the default list and with
--cmpx-lt-u16-only, which already runs the 32-bit V_CMPX EXECcases (
VectorVop3CmpxWritesExecMask,VectorVopcSdwaCmpxWritesExecMask); happy to use a new mode instead.Testing
Windows 11, clang-cl 19.1.5, Release, AMD RX 9070 XT (Vulkan driver 2.0.395, Adrenalin 26.8.1), on
2f4b8a33:shader_recompiler_compute_tests --cmpx-lt-u16-onlypasses.Compare.cppalso writing VCC (ir.SetVcc(masked)), it fails.shader_cfg,resource_tracking,resource_materialization,scalar_provenanceandshader_vertex_metadatapass.
AI use (per the README's AI policy): Claude (Anthropic) found the gap with a mutation run, wrote the test and
this description, and ran the checks above on my machine.
@coderabbitai[bot] on GitHub · 2026-10-08 20:05 UTC · original
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
755c1111-afd9-4af2-aa46-136bb18f639d📥 Commits
Reviewing files that changed from the base of the PR and between
2f4b8a335dandb7aec02e63.📒 Files selected for processing (1)
tests/ShaderRecompilerComputeTests.cppIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.
📝 Walkthrough
Walkthrough
Adds
VectorCmpxPreservesVcc, a regression test for a vector comparison followed by CMPX. The test checks that CMPX updates EXEC without replacing the earlier VCC result, then verifies the expected output after EXEC is restored. The test is registered in the full case list and the--cmpx-lt-u16-onlyselector.Suggested reviewers:
nmzikPriority: ⬇️ Low
Change: Other
Merge Risk: ⚪ Minimal · up to
b7aecThe regression test distinguishes preserved VCC from an overwrite and checks the result. No actionable merge-blocking risk remains beyond normal checks.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
Comment
@coderabbitai helpto get the list of available commands.Pull request closed