Skip to content

Shaders: hardware probes for the remaining s_cmp_* integer compares - #2564

Open
LouisRiverstone wants to merge 1 commit into
Marvisak:mainfrom
LouisRiverstone:shaders/s-cmp-signed-and-unsigned-probes
Open

LouisRiverstone wants to merge 1 commit into
Marvisak:mainfrom
LouisRiverstone:shaders/s-cmp-signed-and-unsigned-probes

Conversation

@LouisRiverstone

Copy link
Copy Markdown
Contributor

Adds probes for s_cmp_eq_i32, s_cmp_lg_i32, s_cmp_ge_i32, s_cmp_le_i32, s_cmp_ge_u32 and s_cmp_le_u32 (SOPC 0x00, 0x01, 0x03, 0x05, 0x09, 0x0B) to the compare loop in scalar_probes. Test-only.

@Vedoxdev123

Copy link
Copy Markdown

Tested on Windows with AMD Ryzen 5 5600X + NVIDIA GeForce RTX 4060 (AI-assisted):

cargo test -p victory-gpu --lib -> 193 passed; 2 failed; 1 ignored (improved from 192 passed; 3 failed on main).

@fyernald fyernald left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked on real NVIDIA hardware: RTX 3080 (617.42), Windows 10 (19045), plus WARP, main 67e8ae1 + #486 + #2596 (without #2596 the suite crashes on NVIDIA, #2571). cargo test -p victory-shader --lib --locked -- --test-threads=1 gives 267 passed, 3 failed, the same as the base. The 3 are the #1835 failures. The new probes agree with the model on both adapters.

The opcodes match the RDNA2 SOPC table: s_cmp_eq_i32, lg_i32, ge_i32, le_i32 at 0x00/0x01/0x03/0x05, and ge_u32/le_u32 at 0x09/0x0B.

Copy link
Copy Markdown
Owner

Automated triage for the maintainers.

Merge candidate. This is a recommendation to look, not an approval. It merges cleanly into main. CI: check passing.

The PR adds the six missing 32-bit SOPC compares to the SCC/s_cselect probe loop in scalar_probes (crates/victory-shader/src/emit/semantics_tests.rs): s_cmp_eq_i32 (0x00), lg_i32 (0x01), ge_i32 (0x03), le_i32 (0x05), ge_u32 (0x09) and le_u32 (0x0B). The opcodes match the SOPC table in gfx10/opcodes.rs, and the reference closures use signed or unsigned compares accordingly. The inputs include 0x7FFF_FFFF and 0x8000_0000, so the signed/unsigned boundary is exercised. The s_cmp_ branch in emit/lower.rs already handles all six, so the probes cover existing code. No other open PR covers these opcodes (#1046 covers s_cmpk_*).


Generated by Claude Code

github-actions Bot added a commit to KevinPratap/VIctory that referenced this pull request Nov 25, 2026
github-actions Bot added a commit to KevinPratap/VIctory that referenced this pull request Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants