Repository navigation
Recompiler tests: GPU checks for v_fmac_f32, v_fmamk_f32 and v_fmaak_f32 - #737
13hourstilliland wants to merge 1 commit into
Conversation
emit.rs translates v_fmac_f32 (the destination is the addend), v_fmamk_f32 (a * K + b) and v_fmaak_f32 (a * b + K), but no test ran them. gpu_valu_fmac_fmamk_fmaak runs all three in one kernel over a 12 x 12 x 8 grid (+-0, +-1, 2, 0.5, -3, 1.5, 0.25, +-inf and NaN for the factors; +-0, 1, -2.5, 100, 0.75, inf and NaN for the addend), 1152 triples per wave size, and compares each lane bit for bit (any NaN for NaN) with f32::mul_add, with the literal K in its place. The products are exact, so fused and unfused multiply-adds agree on this grid. Measured on an RTX 3070 (wave32 only; NVIDIA has no wave64): - with a wrong reference for v_fmamk_f32 (K_AK instead of K_MK) the test fails with "wave32, 696 wrong (V_FMAMK_F32: 696)" and no other op; - with all three emitter lines broken at once (fmac addend replaced by 0, fmamk and fmaak literal moved to the other operand) it fails with "wave32, 2034 wrong (V_FMAC_F32: 550, V_FMAMK_F32: 708, V_FMAAK_F32: 776)"; - against the real emitter it passes. Assisted-by: Hermes Agent (Claude Opus 5.5)
|
Test run of Tested
Review: 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. |
|
An NVIDIA run, since the report above is on RDNA4 (native wave64). Tested exact head Tested
AI use
|
|
Test report for Tested
16 test binaries: 692 passed, 1 failed, 41 ignored. Same machine, This PR's tests:
Failures:
16 test binaries instead of SKIPPED (no wave64 on this GPU): AI use: Claude Code (Claude Opus 5.5) ran the builds and tests and wrote this report from their output. |
Adds a GPU test for three RDNA2 instructions that
emit.rstranslates but no test runs:v_fmac_f32(the destination is the addend),v_fmamk_f32(a * K + b) andv_fmaak_f32(a * b + K). Test only, no runtime change.What is in it
gpu_valu_fmac_fmamk_fmaakincrates/xcl/src/gpu/recomp/tests.rs, aftergpu_nonfused_mad_and_mac_prevent_fma_contraction(away from the lines open PRs add to): one kernel with all 3 instructions, run as wave64 where the adapter has it and as wave32 everywhere (gpu_waves), a 12 x 12 x 8 grid (±0, ±1, 2, 0.5, -3, 1.5, 0.25, ±inf and NaN for the factors; ±0, 1, -2.5, 100, 0.75, inf and NaN for the addend), 1152 triples per wave size, each lane compared with the RDNA2 definition computed on the CPU withf32::mul_addand the literalKin its place, bit for bit (any NaN for NaN); the products on this grid are exact, so fused and unfused multiply-adds agree.v_fmamk_f32(K_AKinstead ofK_MK):wave32, 696 wrong (V_FMAMK_F32: 696), no other instruction) the test fails; with the fmac addend replaced by 0, and the literal moved to the other operand in fmamk and in fmaak applied toemit.rsall at once it fails and names every instruction (wave32, 2034 wrong (V_FMAC_F32: 550, V_FMAMK_F32: 708, V_FMAAK_F32: 776), 550 to 776 wrong per instruction). Those edits are not in the PR.Tested
stable-x86_64-pc-windows-gnu(MinGW linker), DXC 1.9.2609.5, debug build, commit 9b5e344 (on main 91f9a5e)cargo test --workspace --no-fail-fast -- --test-threads=4, run in the interactive desktop session: 693 passed, 0 failed, 41 ignored (lib: 653 passed, 0 failed, 21 ignored;e2e3 of 3;gpu_valu_fmac_fmamk_fmaakok).main91f9a5e on the same machine: 692 passed, 0 failed, 41 ignored (lib: 652 passed, 0 failed, 21 ignored)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