Tests: legacy FMA and float min/max NaN semantics on the GPU #714
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/719"
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 lordon1a on 2026-11-24T04:03:21Z.
Adds a per-instruction GPU test (
gpu_fma_legacy_and_float_min_max) covering 6 RDNA2 floating-point instructions that previously had no GPU test coverage:v_fma_legacy_f32,v_fmac_legacy_f32,v_min_f32,v_max_f32,v_min_f16, andv_max_f16. Checks legacy0 * inf == 0/0 * NaN == 0returningc, normal FMA, and IEEE-754minNum/maxNumNaN propagation (one NaN returns the non-NaN operand, two NaNs return NaN) across 12 edge cases.What is in it
crates/xcl/src/gpu/recomp/tests.rs: addsgpu_fma_legacy_and_float_min_max(test-only; no runtime code changed).Tested
616.64, wave32, SM 6.6), Intel i7-12700H, Windows 11 Home 26H2 (build 26200),rustc 1.100.0(x86_64-pc-windows-gnullvm), debug build, DXC1.9.2609.5(01b62ad4)cargo test -p xcl --lib gpu_fma_legacy_and_float_min_max -- --nocapture: 1 passed, 0 failed, 0 ignored (0.64s)cargo test --workspace -- --test-threads=1: 702 passed, 0 failed, 41 ignoredSKIPPEDGPU tests (expected on wave32-only NVIDIA hardware):gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64Not tested
AI use
Imported from ivall/xcl. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-24T04:03:37Z.
Review: COMMENTED
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
Imported from ivall/xcl. Originally posted by joeypercia on 2026-11-24T04:08:25Z.
AMD / wave64 run (the Not tested item):
6e948d7merged ontomainf4ce27c(clean merge).Tested
gpu_fma_legacy_and_float_min_max: passes on the RDNA2 iGPU (native wave64) and on the RTX 4070 Ti (split form); noSKIPPEDReview note: the legacy model here is "a zero factor returns
c". That differs from the hardware in one case:c = -0, where the result is+0(the legacy product is+0, and+0 + -0 = +0; LLVM'samdgcn_fma_legacyfolding calls this out). None of the cases has a zero product withc = -0, so the test is right as written, but adding one (e.g.(0, inf, -0) → +0) would cover #679. It would fail onmaintoday, so it fits #679's fix PR better than this one.Not tested: the full suite on this merge (test-only change); release build.
Run and report by Claude Code (Claude Opus 5.5).
Imported from ivall/xcl. Originally posted by MesshM on 2026-11-24T04:14:41Z.
Test run of
6e948d7153ca09a4002fc83da3becf3804554efbon AMD RDNA4. I merged it onto currentmainf4ce27clocally (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_fma_legacy_and_float_min_maxpasses.Review: The min / max references follow IEEE minNum / maxNum (one NaN gives the other operand), and the legacy FMA cases with a zero factor check that
ccomes back. One precision for the description: the hardware returns c + (+0), so for c = −0 the result is +0, not c; #720 fixes the translation for that case. None of this test's cases uses c = −0, so it passes with or without #720.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 JJAutoCompare on 2026-11-25T06:10:40Z.
Empirical test report (
6e948d71)Hardware / environment
XCL_ADAPTER=A770, Windows x64 build 26200, AMD CPU (family 23, model 113). GPU driver version was not recorded.rustc 1.100.0 (0ef1bc386 2026-11-09), DXC 1.9.2609.5 (01b62ad47), and Cargo's unoptimized test profile with debug info and incremental compilation disabled.6e948d7153ca09a4002fc83da3becf3804554efb.Commands and results
cargo test -p xcl --lib --no-runcompleted with exit code 0 before acquiring the GPU lock.Invoke-ArcTest.ps1, ran& $fixturePath gpu::recomp::tests::gpu_fma_legacy_and_float_min_max --exact --nocapture --test-threads=1withRUST_TEST_NOCAPTURE=1.$fixturePathwas the unit-test executable printed by the compile step.SKIPPEDlines. The fixture completed in 2.04 seconds.Observed behavior
Not tested
The full GPU workspace suite and game smoke runs were omitted. Other GPU adapters were 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 pr719-focused.log and published.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T11:38:50Z.
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:49Z.
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 Foniass on 2026-12-01T04:00:25Z.
Triage (#1607) – head
6e948d7Main has no GPU test of
v_fma_legacy_f32/v_fmac_legacy_f32or ofv_min/v_max_f32/f16with NaN. Some open PRs overlap in part: #1639 and #670 test the legacy FMA zero product, #739 tests f32 min/max with NaN, and #1301 tests the ordering of -0 and +0 (other cases). None covers all of this.The expected values are right, and the cases avoid c = -0 with a zero product (#679) and +0 vs -0 in min/max, where the CPU reference is ambiguous.
Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Pull request closed