Repository navigation
Shaders: hardware probe for s_flbit_i32 - #1361
LouisRiverstone wants to merge 2 commits into
Conversation
catminou4
left a comment
There was a problem hiding this comment.
Hardware test only: s_brev/s_bcnt1/s_ff1/s_flbit (u32 and signed)/s_abs_i32 SOP1 opcodes with RDNA2 reference formulas (searches return -1/0xFFFFFFFF when no bit). The signed flbit formula (invert when sign set, then leading_zeros) matches the 'first bit differing from sign' definition. Windows-only execution — worth a hardware run since flbit signed corner cases (0, INT_MIN) are exactly where emulators diverge. Local verification: macOS arm64, rustc 1.98.1, PR head merged into main ffe310e, cargo test -p <crate> --locked. Shader execution tests (valu_tests/host/diff_tests) are #[cfg(all(test, windows))], so macOS covers lowering/decode/unit tests only. 96 passed, 0 failed.
|
First GPU run of this PR's test that I could find, on an AMD GPU under Proton on Linux:
This is RADV, not AMD's Windows driver, so it adds to a Windows run rather than replacing it. Synthetic tests only, no game files. AI-assisted (Claude Code, Opus 5.5); every run was on this machine. |
|
Native Windows run on AMD RDNA2: RX 6750 XT (RDNA2, gfx1031), AMD driver 32.0.21045.29003, i5-13400F, Windows 11, Rust 1.98.1 MSVC. Head 8d6d06c on main ffe310e (clean merge).
Synthetic tests only, no game files. AI-assisted (Claude picked the PRs and wrote the batch script; I ran it on my machine). |
catminou4
left a comment
There was a problem hiding this comment.
Tested locally on macOS arm64 (rustc 1.98.1): PR head merged cleanly into current main (ffe310e), cargo test -p victory-shader --locked → 96 passed, 0 failed. Hardware/valu tests are #[cfg(all(test, windows))] and only run on Windows; macOS covers structure/lowering unit tests.
Hardware test for the scalar bit-scan/reverse/abs ops (s_bit_scan_and_reverse_ops_match_rdna2) against RDNA2 reference values.
8d6d06c to
774d3cf
Compare
|
Automated triage for the maintainers. Merge candidate (recommending a look, not an approval). Reviewed at It adds a probe for Generated by Claude Code |
774d3cf to
f5286fe
Compare
fuzeofficlal
left a comment
There was a problem hiding this comment.
LGTM — verified against origin/main (63bcca43) on Windows x64 (RTX 5090 and WARP).
- The new
sop1_probe(0x17, unary(U32_EDGES), ...)incrates/victory-shader/src/emit/semantics_tests.rs:2759-2763accurately models RDNA2s_flbit_i32(first bit from MSB differing from the sign bit,-1for0and-1) and matches DXILFirstbitSHion both host GPU and WARP. - Checks:
cargo test --locked -p victory-shader --lib -- --test-threads=1 emit::semantics_tests::withVICTORY_WARP=0: 34 passed, 0 failed, 1 ignored (includingscalar_alu_matches_the_hardware).cargo test --locked -p victory-shader --lib -- --test-threads=1 emit::semantics_tests::withVICTORY_WARP=1: 34 passed, 0 failed, 1 ignored (includingscalar_alu_matches_the_hardware).cargo clippy -p victory-shader --all-targets --locked -- -D warnings(default and--all-features): clean.cargo xtask policy: 191 files ok;rustfmt --edition 2024: clean on changed hunks.
Synthetic tests only; no game data used.
Adds
sop1_probe(0x17, ...)fors_flbit_i32(first bit that differs from the sign bit, -1 for 0 and -1) toscalar_probes. Reduced after triage: the other scalar bit-scan ops are already covered on main.