Recompiler tests: GPU checks for v_fmac_f32, v_fmamk_f32 and v_fmaak_f32 #732
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/737"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by 13hourstilliland on 2026-11-24T04:21:31Z.
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.3db536e(before the rebase onto main91f9a5e; the test code did not change): with the reference changed (wrong reference forv_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, commit9b5e344268(on main91f9a5e9f0)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).main91f9a5e9f0on 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
Imported from ivall/xcl. Originally posted by MesshM on 2026-11-24T04:39:54Z.
Test run of
9b5e3442686c2c1878b63bca3254667d466573f5on AMD RDNA4. I merged it onto currentmain64b3f35locally (clean merge) and tested that tree.Tested
stable-x86_64-pc-windows-msvc, debugcargo build --workspace+cargo test --workspace -- --test-threads=4on the merge: 702 passed, 0 failed, 41 ignored, exit code 0;xcllib tests 661 passed, 0 failed, 21 ignoredSKIPPED;gpu_valu_fmac_fmamk_fmaakpasses.Review:
fmacuses the destination as the addend,fmamkis a·K + b andfmaaka·b + K, compared againstmul_add(one rounding), and the literal K is placed as the encoding expects. I found nothing to change.Not tested: no retail title or regression run (I have no unpacked game), no
XCL_SAMPLE_*tests, release build; the PR's head on its old base was not run, only its merge ontomain.Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.
Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T04:46:47Z.
An NVIDIA run, since the report above is on RDNA4 (native wave64). Tested exact head
9b5e344(on its base91f9a5e).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 693 passed, 0 failed, 41 ignored. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.gpu::recomp::tests::gpu_valu_fmac_fmamk_fmaak ... ok.Not tested
AI use
Imported from ivall/xcl. Originally posted by ItsMrDubey on 2026-11-24T04:57:24Z.
Test report for
9b5e3442686c2c1878b63bca3254667d466573f5(this PR's head)Tested
stable-x86_64-pc-windows-msvc), debug; DXC 1.9.2602.17 from Windows SDK 10.0.2610016 test binaries: 692 passed, 1 failed, 41 ignored. Same machine,
main64b3f3559: 700 passed, 1 failed, 41 ignored.This PR's tests:
gpu::recomp::tests::gpu_valu_fmac_fmamk_fmaak: okFailures:
hle::kernelx::tests::xmem_virtual_query_marks_cpu_readable_memoryfails on this machine on every run, on this PR's head and onmain64b3f3559alike (5 of 5 reruns onmain), so it is not from this PR. #650 fixes it here.16 test binaries instead of
main's 17 because this branch predatestests/sparse_reinit.rs; nothing crashed.SKIPPED (no wave64 on this GPU):
gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.AI use: Claude Code (Claude Opus 5.5) ran the builds and tests and wrote this report from their output.
upstream-sync referenced this pull request2026-11-24 19:06:45 +00:00
upstream-sync referenced this pull request2026-11-24 23:06:49 +00:00
upstream-sync referenced this pull request2026-11-25 02:07:14 +00:00
Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T06:03:14Z.
Empirical test report (
9b5e3442)Verified PR #737 at
9b5e3442686c2c1878b63bca3254667d466573f5in a clean detached checkout.Hardware / environment
XCL_ADAPTER=A770), Windows x64 build 26200. The machine reported CPU identifierAMD64 Family 23 Model 113 Stepping 0, AuthenticAMD.1.100.0 (0ef1bc386 2026-11-09), hostx86_64-pc-windows-msvc. The DXC executable reported1.9.2609.5 (01b62ad47), and the fixture logged loading dxcompiler and DXIL version1.9.2609.5.Commands and results
cargo test -p xcl --lib --no-run --message-format=jsonexited 0 in 59.93s outside the GPU lock. The Cargo artifact record identified the library test executable.Invoke-ArcTest.ps1, withXCL_ADAPTER=A770andRUST_TEST_NOCAPTURE=1, ranxcl-00e28da3621caf64.exe gpu::recomp::tests::gpu_valu_fmac_fmamk_fmaak --exact --nocapture --test-threads=1. It exited 0 in 0.64s of test time. The harness reported 1 passed, 0 failed, 0 ignored, and 673 filtered out. The captured output contained 0SKIPPEDlines.Observed behavior
V_FMAC_F32,V_FMAMK_F32, andV_FMAAK_F32over 1,152 operand triples per wave size exercised, including signed zeros, infinities, and NaNs. All results met the CPUf32::mul_addreference check, which compares result bits and accepts any NaN when the reference is NaN.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
pr737-focused.logand published.Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T11:28:57Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-29T07:41:47Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by relativespace2K on 2026-11-30T03:28:04Z.
merge-check
base:
53e85fb1head:
9b5e344268merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2789 passed, 6 failed, 49 ignored; failing: gpu::dxil::compact_tests::gpu_compact_form_with_micro_blocks_and_literal_table_runs_as_the_plain_form, gpu::recomp::pso::shader_cache_tests::console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk, hle::d3d12x::standin::tests::concurrent_shell_miss_reuses_winner_and_releases_loser_pipeline, ram_budget::tests::windows_takes_a_working_set_maximum_and_lifts_it, and two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs (in
--test gpu_two_pass_cache_e2e, so 5 failing tests give 6 failures). The same five fail on base53e85fb1alone (2788 passed, 6 failed, 49 ignored there), so none comes from this PR; its new GPU test passed and is not among the SKIPPED lines, so it ran on the RX 6800 XT in both wave sizes. 13 SKIPPED lines, all environmental: no D3D12 debug layer / d3d12SDKLayers.dll, no heap windows, no GPU_UPLOAD, per-lane f16/f32 forms refused.review: no blocking finding; the whole diff is one test of 50 lines. It compares the three multiply-add forms against
f32::mul_addwith the literal where each instruction puts it (v_fmac_f32takes the destination as addend,v_fmamk_f32a literal multiplier,v_fmaak_f32a literal addend), over a cross product of values that includes the signed zeros, both infinities and NaN, and it compares bits rather than a tolerance, with NaN handled byis_nan. The operands are dyadic so every product is exact: the comment says that on purpose, because an unfused and a fused result agree there and the test is aimed at the wiring of the three forms, not at contraction (that is #472 and #676's separate control). One note, not blocking: because the products are exact, the test cannot catch a backend that stops fusing these forms on inexact inputs; that is deliberate and stated.performance: none: tests only.
verdict: safe to merge
hardware / tool and model: AMD Radeon RX 6800 XT 16 GB (RDNA2, wave64), driver 32.0.21045.29003; Ryzen 5 5600, 32 GB RAM; Windows 10 IoT Enterprise LTSC 2024, 10.0.26100 build 26100.9974; Rust 1.100.0; DXC 1.9.2602.17; debug build. DeepSeek Harness coding agent, model DeepSeek V4.1 Flash.
Imported from ivall/xcl. Originally posted by Parakeet-Wheat on 2026-11-30T03:30:05Z.
merge-check
base:
cfb9753a8chead:
9b5e344268merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2835 passed, 0 failed, 51 ignored; SKIPPED: 26 (22 no wave64, 2 no heap windows, 1 driver cache needs Developer Mode, 1 no GPU_UPLOAD heaps); failing: none
review: No blocking finding; whole diff read.
gpu_valu_fmac_fmamk_fmaakpasses as wave32; this GPU has no wave64. On current main,kernel_wavebuilds the test's kernel with the direct DXIL translator by default (gpu/dxil/kernel.rs:43-47). The description's mutation editsemit.rs, the HLSL path, which this test reaches only withXCL_DIRECT_DXIL=0. We swappedv_fmamk_f32's operands (a · K + c to c · K + a) and ran the test. With the swap inemit.rs, the test passes by default and fails withXCL_DIRECT_DXIL=0(588 wrong, allV_FMAMK_F32). With the swap in the direct translator (lower_valu.rs:670), the test fails by default (588 wrong). This test does not reach the second directv_fmamk_f32lowering (lower_valu.rs:1200): with the same swap there, it passes. The description says no test runs these instructions. On main,check_f32_arithmeticchecksv_fmac_f32, andcheck_f32_three_sourcechecks fmamk and fmaak (lower.rs:2799,lower.rs:2893). The new test adds ±0, ±inf and NaN as factors and addends.performance: No runtime change: the PR changes only
gpu/recomp/tests.rs. This check made no title run.verdict: safe to merge (test-only; the new test passes on our RTX 3070 and catches a swapped
v_fmamk_f32operand on the path it runs)hardware / tool and model: RTX 3070 8 GB (610.88), AMD Ryzen 5 5600X, Windows 11 Home 26300, Rust 1.95.0, debug / Claude Code, Claude Opus 5.5 (merge, build, suite, hand mutations and review)
Imported from ivall/xcl. Originally posted by brainhay5 on 2026-11-30T03:32:16Z.
merge-check claim
head:
9b5e344268Imported from ivall/xcl. Originally posted by brainhay5 on 2026-11-30T03:37:59Z.
merge-check
base:
cfb9753a8chead:
9b5e344268merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2834 passed, 1 failed, 51 ignored; 29 SKIPPED lines
failing: test_title_runs_and_game_folder_is_untouched
review: automated overnight check — diff inspected for safety only (no build/CI/toolchain/script changes, no process/network/runtime-loading code); no duplicate search performed; no line-by-line code review.
performance: not assessed beyond the suite.
verdict: safe to merge
hardware / tool and model: RTX 5070 Ti 16 GB, driver 610.88 (32.0.16.1088); Ryzen 7 5800X3D, 64 GB; Windows 11 22631; OpenCode agent, DeepSeek V4.1 Flash 1017
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T04:02:18Z.
Triage (#1607) – head
9b5e344Main's
F32_THREE_SOURCEprogram (9231d486) already checks v_fmamk_f32 / v_fmaak_f32 on the GPU with exact products. This PR adds v_fmac_f32 (VOP2, destination as addend) and signed zeros, infinities and NaN on wave32 and wave64. No open PR adds the same test. #590 and #738 (same author) cover other instructions.No problems found: with exact products, a fused and an unfused reference agree, as the doc comment says.
Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.