Repository navigation
Tests: 16-bit integer VALU ops and the byte / half SADs on the GPU - #638
acaracargo wants to merge 1 commit into
Conversation
20 VOP3 instructions that no GPU test ran: the 16-bit add / sub / mul_lo / shifts / min / max / mad (u16 and i16), v_mad_u32_u16, v_mad_i32_i16, v_sad_hi_u8, v_sad_u16, v_sad_u32 and v_cvt_pk_i16_i32. Eleven lanes carry edge values (sign and carry boundaries, shift counts past 15, i16 saturation), with another value in the high half of each 16-bit source, compared per lane with the ISA's pseudo-code. Only D[15:0] of a 16-bit result is compared. Making v_ashrrev_i16 a logical shift, or v_sad_u16 skip the high half, in emit.rs fails the test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WsgnReN2iZK9RUNckZAhrv
|
Test run of Tested
Review: The CPU references match the RDNA2 pseudo-code where I checked: Not tested: no retail title or regression run (I have no unpacked game), no Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code. |
|
Test run of Tested
Not tested
AI use
|
|
Measured on RDNA2 hardware, for the two points under Not tested: console-generation hardware, and D[31:16] of 16-bit results. Method. The Radeon iGPU of a Ryzen 7 9800X3D ( Result.
For comparison, an RX 9070 XT ( Not tested: the console itself ( AI use: Claude Code (Claude Opus 5.5) wrote the OpenCL probes and the port of the reference, ran them on my PC and wrote this comment. I have not reviewed the code. |
Empirical test report (253f749)Hardware / environment
Commands and results
Observed behavior
Not tested
AI use Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr638-focused.log and published. |
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
Adds a GPU test for 20 VOP3 instructions that
emit.rstranslates but no test runs:v_mad_u32_u16andv_mad_i32_i16.v_sad_hi_u8,v_sad_u16andv_sad_u32.v_cvt_pk_i16_i32.Eleven lanes carry edge values: sign and carry boundaries, shift counts past 15, and i16 saturation in both directions. The high half of every 16-bit source holds another value, so a translation that reads the whole register shows up. Each lane is compared with the ISA's pseudo-code. Only D[15:0] of a 16-bit result is compared.
#590 tests the 24-bit and high-half multiplies, so this one leaves them out. #445 has the 16-bit min3 / max3 / med3.
What is in it
crates/xcl/src/gpu/recomp/tests.rs:gpu_valu_16_bit_integer_and_sad.Tested
x86_64-pc-windows-msvc; DXC 1.9.2602.17; debug.cargo test --workspace -- --test-threads=4on253f749: 685 passed, 0 failed, 41 ignored (main9ce2070: 684 / 0 / 41).gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware(no wave64).v_ashrrev_i16into a logical shift, or makingv_sad_u16skip the high half, fails the test (checked locally, reverted).Regression run
Not tested
AI use