Shaders: lower s_cmov_b32, s_cmov_b64 and s_cmovk_i32 #91
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/91"
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 Marvisak/VIctory. Originally posted by tedin7 on 2026-11-24T00:22:43Z.
What
Why
Tested
Imported from Marvisak/VIctory. Originally posted by DaviTostes on 2026-11-24T00:23:37Z.
Tested
ed5f98fstacked on #39 on Arch Linux x86_64, rustc 1.98.1: pass.cargo test --workspace: 156 passed, 0 failed, 3 ignored; merge with #39 clean.#[test]s for the news_cmov*lowerings, included in that run.AI-assisted (DeepSeek V4.1 Flash coding agent).
Imported from Marvisak/VIctory. Originally posted by lordon1a on 2026-11-24T00:40:15Z.
Verified
ed5f98ff6on Windows 11 (x86_64-pc-windows-gnullvm,rustc 1.100.0, applied cleanly tomain@35b054ec0): pass.cargo xtask policy: 150 files okcargo test -p victory-shader: 58 passed, 0 failed (+1 new lowering test fors_cmov_b32/s_cmov_b64/s_cmovk_i32).AI-assisted.
Imported from Marvisak/VIctory. Originally posted by Lyrnc on 2026-11-24T06:22:41Z.
RDNA2 hardware check of the three conditional moves: all match.
Setup. AMD Radeon iGPU of a Ryzen 7 9800X3D, gfx1036 (RDNA2), AMD driver 32.0.21042.62, Windows 11 Pro 26200. Hand-written instructions in a HIP kernel (assembled by the AMD driver's amd_comgr). RDNA2 desktop silicon, not the console's. No game data. 130 cases: SCC set from bit 0 of a test value (
s_bitcmp1_b32), with random and edge sources.s_cmov_b32/s_cmov_b64: the source when SCC = 1, the destination's old value (both dwords for_b64) when SCC = 0: 130/130.s_cmovk_i32: the 16-bit constant sign-extended (0xbeef→0xffffbeef) when SCC = 1, else the old value: 130/130.So the select on SCC is right. The
kform sign-extends itssimm16, so it is worth checking that the lowering uses the sign-extended constant and not a zero-extended one.AI use: Claude Code (Claude Opus 5.5) wrote the probes, ran them on the GPU above and drafted this comment; the numbers come from the hardware run.
Imported from Marvisak/VIctory. Originally posted by ricarmandoagent on 2026-11-24T13:01:24Z.
Two things before this can land.
It is
dirtyagainst main today, and the rebase is not mechanical:mainnow has its ownfn lowers(words: &[u32], rsrc2: u32)in this test module (line 6959). This branch adds a secondfn lowers(words: &[u32]); both names cannot coexist after a rebase. Reuse the existing helper.scalar_conditional_moves_loweronly asserts that lowering returnsOk(lowers(&words).unwrap()). An inverted select (select(c, cond, old, a)), a swapped half, or a stale destination read all still pass. Since the change is about the value kept when SCC is clear, please assert on the lowered program, or add a fixture that does.AI-assisted review.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:16:33Z.
Automated triage for the maintainers.
Needs rebase. This PR does not merge cleanly into current
main(ac2525d). Conflicting files:crates/victory-shader/src/emit/lower.rs.The content has not been reviewed yet; it will be once the branch is rebased onto
main.Generated by Claude Code
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.