Repository navigation
Recompiler tests: GPU checks for three-input VOP3 logic and add-shift - #545
13hourstilliland wants to merge 1 commit into
Conversation
v_or3_b32, v_xor3_b32, v_and_or_b32, v_lshl_or_b32, v_add_lshl_u32 and v_xad_u32 are translated by emit.rs but no test ran them. The new test runs all six in one kernel, as wave64 where the adapter has it and as wave32 everywhere, over 32 waves of operand triples from a fixed LCG mixed with edge values (0, 1, 31, 32, 33, 0x7FFFFFFF, 0x80000000, 0xFFFFFFFF), and compares every lane with the RDNA2 definition computed on the CPU (shift counts use their low five bits, adds wrap; v_xad_u32 is (a ^ b) + c, as in LLVM's AMDGPU patterns). Measured on an RTX 3070 (wave32 only): the test passes against the current emitter, and fails, naming only the broken instruction, when any one of the six emitter expressions is changed (or3 emitted with an xor, xor3 with an or, and_or with an xor, lshl_or with a 4-bit shift mask, add_lshl shifting only b, xad with an or). Assisted-by: Hermes Agent (Claude Opus 5.5)
6d9c320 to
7f6f458
Compare
|
Additional MSVC / wave64 validation for Tested
Not tested AI use |
towiice
left a comment
There was a problem hiding this comment.
Tested PR head 7f6f458 on NVIDIA GeForce GTX 1650 SUPER (Turing / TU116, wave32, driver 610.88), Windows 11 build 10.0.26300 (26H2), Rust 1.100.0 (stable-x86_64-pc-windows-gnullvm), DXC v1.9.2609:
cargo test -p xcl --lib gpu_vop3_three_input_logic_and_add_shift -- --test-threads=4: 1 passed, 0 failed (0.96 s).
Three-input VOP3 logic and add-shift GPU checks pass on Turing.
|
Tested on AMD Radeon RX 9070 XT (RDNA4) at Ryzen 7 5700X3D, 32 GB RAM, Windows 11 Pro build 26300.9974, driver 32.0.32015.7029, Rust 1.100.0 x86_64-pc-windows-msvc, DXC 1.9.2602.17, debug build. Tested:
Not tested: retail title / Report written by Claude Code (Claude Sonnet 5.5) from a real run on this machine. Correction (hidden skips): "0 SKIPPED" above means no |
|
Closing as overlapping test coverage is proposed in #703, which covers the same six operations and additional instructions. Neither PR has been merged yet. Thank you for the contribution. |
Adds a GPU test for six RDNA2 VOP3 instructions that
emit.rsalready translates but no test runs:v_or3_b32,v_xor3_b32,v_and_or_b32,v_lshl_or_b32,v_add_lshl_u32andv_xad_u32. Test only, no runtime change.What is in it
gpu_vop3_three_input_logic_and_add_shiftincrates/xcl/src/gpu/recomp/tests.rs, built like the open Recompiler tests: GPU checks for VOP3 bit-field, perm, align and min3/max3/med3 #445: one kernel with all six instructions, run as wave64 where the adapter has it and as wave32 everywhere (gpu_waves), 32 waves of operand triples from a fixed LCG mixed with edge values (0, 1, 31, 32, 33, 0x7FFFFFFF, 0x80000000, 0xFFFFFFFF, ...), each lane compared with the RDNA2 definition computed on the CPU. Shift counts use their low five bits and adds wrap.v_xad_u32is(a ^ b) + c, as in LLVM's AMDGPU patterns (ThreeOp_i32_Pats<xor, add, V_XAD_U32_e64>).gpu_valu_16_and_64_bit, away from the lines Recompiler tests: GPU checks for VOP3 bit-field, perm, align and min3/max3/med3 #445 and Recompiler: complete remaining RDNA2 integer CLAMP=1 saturation (#105) #202 add to, so it does not conflict with them.emit.rsexpressions changed on a local copy (or3 emitted with an xor, xor3 with an or, and_or with an xor, lshl_or with a 4-bit shift mask, add_lshl shifting only b, xad with an or), the test fails and names only that instruction (361 to 838 of 1024 lane results wrong). Those edits are not in the PR.Tested
stable-x86_64-pc-windows-gnu(MinGW linker), DXC 1.9.2609.5, debug build, commit 7f6f458 (identical tree to 6d9c320, author metadata amended; on main 508a0c7)cargo test --workspace --no-fail-fast -- --test-threads=4, run in the interactive desktop session: 681 passed, 0 failed, 41 ignored (lib: 641 passed, 0 failed, 21 ignored; every other test binary ok,e2e3 of 3,gpu_vop3_three_input_logic_and_add_shiftok)SKIPPED(no wave64 on this GPU):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardwareNot tested
stable-x86_64-pc-windows-msvc): built with the GNU toolchain only.crates/xcl/srcruntime file changes).AI use