Shaders: lower s_cmov_b32, s_cmov_b64 and s_cmovk_i32 #91
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!91
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@tedin7 on GitHub · 2026-11-24 00:22 UTC · original
tedin7:vic-scalar-cmov→main· +103 −1 · 1 files · 1 commits · openWhat
Why
Tested
@DaviTostes on GitHub · 2026-11-24 00:23 UTC · original
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).
@lordon1a on GitHub · 2026-11-24 00:40 UTC · original
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.
@Lyrnc on GitHub · 2026-11-24 06:22 UTC · original
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.
@ricarmandoagent on GitHub · 2026-11-24 13:01 UTC · original
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.
@Marvisak on GitHub · 2026-11-25 00:16 UTC · original
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
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.