Tests: check v_fma_mix_f32, v_fma_mixlo_f16 and v_fma_mixhi_f16 on the GPU #1122
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1122
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1122/head"
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?
@mynzjerko on GitHub · 2026-11-24 12:06 UTC · original
tests/fma-mix-gpu→main· +199 −0 · 1 files · 1 commits · closed without mergingAdd GPU test coverage for
v_fma_mix_f32,v_fma_mixlo_f16, andv_fma_mixhi_f16(ENC_VOP3P) against a pure-Rust reference in bothwave64andwave32.What is in it
crates/xcl/src/gpu/recomp/tests.rs: addgpu_fma_mix_f32_and_f16coveringOP_SEL_HI/OP_SEL_HI_2/OP_SEL,NEG_HI(abs, including0b111on all three sources),NEG(including0b111on all three sources),CLAMP, SGPRSRC2, untouched 16-bit half preservation, chainedmixlo+mixhiinto oneVDST, and dynamicS_ROUND_MODERNE/RTZ rounding onv_fma_mixhi_f16.Tested
32.0.32029.2010), AMD Ryzen 5 7500F, Windows 11 Pro 10.0.26300,rustc 1.100.0(stable-x86_64-pc-windows-msvc), DXC1.9.2602.17, debug buildcargo test -p xcl --lib -- gpu_fma_mix_f32_and_f16 --nocapture --test-threads=1: 1 passed, 0 failed, 0 ignored (0 SKIPPED)cargo test --workspace -- --test-threads=4: 742 passed, 0 failed, 41 ignored (xcl --lib: 699 passed, 0 failed, 21 ignored;SKIPPEDGPU tests: 0)Not tested
scripts/smoke.ps1; tests-only change)AI use
@AlexandreSchuelter on GitHub · 2026-11-24 12:16 UTC · original
Test report on RDNA2 (RX 6900 XT):
gpu_fma_mix_f32_and_f16passes in both wave64 and wave32 (gpu_waves()runs both on a wave64 adapter), and there are no new failures.Tested
stable-x86_64-pc-windows-msvc, debug; DXC 1.9.2602.17;XCL_NETWORK=0,XCL_REQUIRE_GPU=wave64; no SKIPPED testscargo build --workspace+cargo test --workspace --no-fail-fast -- --test-threads=4:main47efa2ea5d7066(based on47efa2e)main: the RDNA2 packed-mip failure inplaced_title_textures_share_vram_and_preserve_pixels(fixed by #470 / #1028) and its twoPoisonErrorcascades (#673).Not tested
AI use: Claude Code (Claude Opus 5.5) fetched the branch, ran the suite and wrote this report; the runs are real, on the hardware above.
@jesuarchive on GitHub · 2026-11-24 12:42 UTC · original
NVIDIA run, since Not tested lists NVIDIA. Head
a5d7066, merged locally ontomain47efa2e(clean merge, nothing pushed).Tested
stable-x86_64-pc-windows-msvc; DXC 1.9.2602.17 from the Windows SDK; debug.cargo test -p xcl --lib -- gpu_fma_mix_f32_and_f16 --nocapture --test-threads=1: 1 passed, 0 failed, 0 ignored, not skipped. On this adaptergpu_waves()gives only wave32, so all three of the test's passes ran as wave32 on the NVIDIA driver (no wave64 pass here).cargo test --workspace -- --test-threads=4: 742 passed, 0 failed, 41 ignored.main47efa2eon the same machine: 741 / 0 / 41; the extra one is this test.main:gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware(no wave64).Not tested
AI use
@bjarngard on GitHub · 2026-11-24 12:45 UTC · original
Test report for head
a5d7066(NVIDIA, wave32 only)Tested
XCL_ADAPTER=nvidia cargo test --workspace --no-fail-fast -- --test-threads=4: 742 passed, 0 failed, 41 ignored;gpu_fma_mix_f32_and_f16passedgpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardwareNot tested: Intel, retail titles.
AI use: the tests were run and this report was written by an AI agent, Claude Code (Claude Opus 5.5), on the hardware above. The numbers are copied from the actual test output.
@JoaoPauluu on GitHub · 2026-11-24 13:45 UTC · original
A run on Linux with vkd3d-proton, where the shaders go through dxil-spirv to Vulkan instead of a Windows driver's DXIL compiler.
Tested
x86_64-pc-windows-gnu.a5d7066as it is (based on47efa2e), no uncommitted changes. The lib test binary runs under Wine.gpu::recomp::tests::gpu_fma_mix_f32_and_f16(--exact, one process): ok, no SKIPPED. DXC compiled it and it ran on the GPU in about 0.8 s.Not tested
AI use
@Rj45n on GitHub · 2026-11-24 16:05 UTC · original
Tested on the NVIDIA side you list under Not tested, and it passes. I also checked that it actually fails when the emitter is wrong, which is the part a test like this lives or dies on.
Machine: RTX 5070 Ti 16 GB (driver 621.01), Windows 11 Pro 10.0.26300, Rust 1.98.1 stable-x86_64-pc-windows-msvc, DXC 1.9.2602.17 (Windows SDK 10.0.26100.0), 64 GB RAM, debug profile. Wave32 adapter, so the native 64-lane path is the one thing this card cannot cover. No XCL_SAMPLE_* set, no game data.
Commit tested: a5d7066 (this PR's head), and the same commit rebased onto main
930e8b4, ten commits ahead of your base. The rebase is clean — one file, 193 insertions, no conflict.cargo test -p xcl --lib gpu_fma_mix_f32_and_f16 -- --test-threads=1, on a5d7066: 1 passed, 0 failed, 0 SKIPPED. Same on the rebase onto
930e8b4.cargo test --workspace --no-fail-fast -- --test-threads=4 on the rebase: 752 passed, 0 failed, 41 ignored over 18 test binaries.
SKIPPED on this adapter — 2, both "no wave64": gpu_geometry_wave32_prefix_count_over_a_mask (which does run its wave32 content and only skips the native reference) and gpu_wave32_program_in_wave64_hardware.
It catches regressions. I put eight deliberate changes into the MIX arm of emit.rs, one at a time, reverting between each, and ran only this test. All eight fail it:
change to the v_fma_mix* arm of emit.rs assertion that fires
NEG and NEG_HI swapped v_fma_mix_f32 abs+neg
NEG_HI no longer applies abs mixlo / exactness check
abs applied after neg instead of before v_fma_mix_f32 -|x| + sgpr
OP_SEL takes the other half-word v_fma_mix_f32 mixed hi2
OP_SEL_HI ignored (every source read as f32) v_fma_mix_f32 mixed hi2
MIXLO writes the high half half-preservation assertion
the half not written is no longer preserved half-preservation assertion
CLAMP ignored v_fma_mix_f32 clamp
That is the whole point of this PR and it holds. emit.rs is byte-identical to main again; the mutations were local and never committed.
Two combinations it does not reach, if you want them and they are cheap to add — each of your cases sets NEG or NEG_HI on at most one source at a time:
NEG = 0b111 (all three sources negated),
NEG_HI = 0b111 (abs on all three).
I had these in a test of my own that I am not opening, since yours came first and covers more. Say the word if you would rather I posted the two encodings here than add them yourself.
Not tested: AMD (you have RDNA4 covered), Intel, any other NVIDIA generation, Linux / Wine, release profile, and no retail title (no Xbox GDK files here, so no scripts/smoke.ps1; this diff touches only tests.rs, so pr_check.py does not ask for one).
AI use: Claude Code with Claude Opus 5 ran the suite, the rebase and the eight-mutation check, and drafted this report. I read your diff in full before running it, and checked every count against the logs.
@mynzjerko on GitHub · 2026-11-24 16:47 UTC · original
Thanks @Rj45n for testing on RTX 5070 Ti and running the mutation checks!
I added both
NEG=0b111andNEG_HI=0b111cases (v20andv21) togpu_fma_mix_f32_and_f16(amended head167e48a) and re-ran the suite on RX 9070 (Windows 11 Pro 10.0.26300,rustc 1.100.0, DXC1.9.2602.17, debug):cargo test -p xcl --lib -- gpu_fma_mix_f32_and_f16 --nocapture --test-threads=1: 1 passed, 0 failed, 0 ignored (0 SKIPPED)cargo test --workspace -- --test-threads=4: 742 passed, 0 failed, 41 ignored (0 SKIPPED)Pull request closed