Tests: run the v_fma_f32 control of the no-contraction test on its own #671
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/676"
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 Tjabooo on 2026-11-24T03:18:12Z.
On RADV,
gpu_nonfused_mad_and_mac_prevent_fma_contractionfails its fused control. The cause is the test's layout, not missing FMA: thev_fma_f32control sits in the same program as themad_nfops, on the same inputs. RADV merges the fma'sv0 * v1with their identicalpreciseproducts and rounds it twice. A lonev_fma_f32is fused there. This runs the control as its own program, so it checks what it is meant to check: that the backend fuses. Part of #472.How I narrowed it down (RX 9070 XT, RADV / Mesa 26.2.6, vkd3d-proton v3.1,
maindd2ae9a):FMadwithout!dx.precise(DXC 2026_09_29), and the SPIR-V that vkd3d-proton hands to RADV hasOpExtInst Fma %v0 %v1 %v2withoutNoContraction(VKD3D_SHADER_DUMP_PATH).RADV_DEBUG=shaders) there is noffmaleft: the value stored to v16 isfadd(fmul(v0, v1) // exact, v2) // exact, the same instructions as themad_nflines.V_FMA_F32line in the program, both lanes pass (0x73FFFFFF,0x28800000). With thev_mad_f32line (v12) removed but the othermad_nflines kept, it still fails, because they share thev0 * v1product.Folding an fma's product into an identical exact product is arguably a Mesa bug. A real shader with both patterns would round that fma twice on RADV. I can report it to Mesa separately. This PR only keeps the test from depending on it.
What is in it
crates/xcl/src/gpu/recomp/tests.rs:gpu_nonfused_mad_and_mac_prevent_fma_contractiontranslates and runs thev_fma_f32control as a second program on the same register state, and asserts both lanes of v16 there. The non-fused checks are unchanged.Tested
x86_64-pc-windows-gnu, debug. No Windows build.cargo test -p xcl --lib --locked --target x86_64-pc-windows-gnu -- --test-threads=4(under Wine) on this branch (main91f9a5e+ this commit): 650 passed, 2 failed, 21 ignored, 0SKIPPED. The two failures aregpu_f64_rootsandgpu_f64_math_random, which fail onmaintoo and are fixed by #530. Onmainthe same run also fails this test.Regression run
tests.rs), no runtime code, so nosmoke.ps1run.Not tested
mad()unfused too, the control will still fail there, which is then correct.AI use
Imported from ivall/xcl. Originally posted by towiice on 2026-11-24T03:46:03Z.
Review: COMMENTED
Tested:
01b62ad4), toolchainstable-x86_64-pc-windows-gnullvm(llvm-mingw 23.1.6).cargo test -p xcl --lib gpu_nonfused_mad_and_mac_prevent_fma_contraction -- --nocaptureSeparating the
v_fma_f32control into its own isolated program avoids driver shader optimization merging withpreciseproducts while verifying hardware fused multiply-add behavior. Passes cleanly on NVIDIA Turing.Imported from ivall/xcl. Originally posted by lordon1a on 2026-11-24T03:38:04Z.
Independent GPU test report on
bbf6c40: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_nonfused_mad_and_mac_prevent_fma_contraction -- --nocapture0.80s(gpu::recomp::tests::gpu_nonfused_mad_and_mac_prevent_fma_contractionok)Not tested
AI use
bbf6c40in a detached worktree, audited the diff, ran the GPU test, and posted this report.Imported from ivall/xcl. Originally posted by joeypercia on 2026-11-24T03:39:45Z.
Native Windows AMD run, the other half of Not tested (NVIDIA is above):
bbf6c40merged ontomain91f9a5e(clean merge).Tested
gpu_nonfused_mad_and_mac_prevent_fma_contraction: passes on the RDNA2 iGPU and on the RTX 4070 Ti, the separate fused control includedcargo test --workspace --no-fail-fast -- --test-threads=4on the RDNA2 iGPU: 692 passed, 0 failed, 41 ignored;SKIPPED:gpu_geometry_mode_es_gs_strip,gpu_mesh_mode_two_passes(no mesh shaders)Not tested
Run and report by Claude Code (Claude Opus 5.5).
Imported from ivall/xcl. Originally posted by upipibi on 2026-11-24T05:52:26Z.
Full-suite run on this PR's head
bbf6c40, for the counts CONTRIBUTING.md item 2 asks for, on a GPU family the description doesn't cover:Tested
cargo build --workspacethencargo test --workspace --no-fail-fast -- --test-threads=4: 692 passed, 0 failed, 41 ignored (16 test binaries, the e2e title included)gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware(no wave64)Not tested: AMD / wave64; no retail title (this PR changes only
gpu/recomp/tests.rs).AI-assisted (Claude Code).
Imported from ivall/xcl. Originally posted by crastinator on 2026-11-24T08:01:47Z.
Review: COMMENTED
Tested on RDNA2 under Wine (RADV). Same result as the RX 9070 XT in the description.
Tested (head
bbf6c40, and merged ontomain1ec4c98: no conflicts)files/bin/wine, kernel write watches), with its own vkd3d-proton (stock, not the #257 patch) and DXVK v3.1.1-209dxgi;VKD3D_CONFIG=ignore_shared_fence; DXC 1.9.2609x86_64-pc-windows-msvc(clang-cl / lld-link 23.1.5, xwin SDK 10.0.26100), Rust 1.99.1, debug; the lib test binary run under Winemain1ec4c98,gpu_nonfused_mad_and_mac_prevent_fma_contractionfails here:v_fma_f32 overflow control should stay fused, left2139095040(+inf), right1946157055.bbf6c40it passes, and it also passes with the PR merged onto1ec4c98. So the lonev_fma_f32is fused on gfx1031 / RADV too.main664 ok / 4 failed / 21 ignored / 5 aborted at the #241 assertion / 1 exits with code 5 (mid_list_write64_wait64_split_avoids_cycle_and_reuses_spares, right after its mid-list split; newer than this PR and probably the same stock-vkd3d-proton limit); PR head 644 ok / 3 failed / 21 ignored / 5 aborted. The only status change in tests present on both sides is this test, FAILED -> ok. The 3 that still fail aregpu_f64_rootsandgpu_f64_math_random(#530) andxma2_source_voice_decodes_and_manages_lifetime(#890), and all three fail onmaintoo.Under stock vkd3d-proton, D3D12.X tests take down the test process (
iface->lpVtbl == &d3d12_heap_vtbl, #241), so the suite was run one test per process: every test in the binary, each with--exact <name> --test-threads=1, compared againstmainthe same way.Not tested
AI use
Update: re-run at
bbf6c40after @pablogonz12's RDNA4 result. On RDNA2 it still passes with every vkd3d-proton / dxil-spirv build I have, including the dxil-spirv master7c048638used there. So the difference looks like it's in RADV's RDNA4 (gfx12) backend, not in dxil-spirv.--exact gpu::recomp::tests::gpu_nonfused_mad_and_mac_prevent_fma_contraction --test-threads=1:-Db_ndebug=true53aac418(#775)-Db_ndebug=true53aac418-Db_ndebug=true7c048638(master, as in the RDNA4 run)RADV_DEBUG=shaderson gfx1031: the lone control program compiles to one fused op,v_fmac_f32_e32 v10, v3, v4(v10holdingv5, the addend).v_fma_f32is fused) holds on gfx1031 with Mesa 26.3.1, but per the RDNA4 report it does not on gfx1201. ComparingRADV_DEBUG=shaders(ornir) for the control on the RX 9070 XT would show whether ACO splits it there.Imported from ivall/xcl. Originally posted by pablogonz12 on 2026-11-24T17:26:11Z.
Test report for head
bbf6c40(based on91f9a5e). It does not fix the test on this setup: the lonev_fma_f32control is unfused here too.Tested
subprojects/dxil-spirvmoved to master7c048638(#1425), DXC 1.9.2609.5, Rust stable, release,x86_64-pc-windows-gnu,--test-threads=4.gpu_nonfused_mad_and_mac_prevent_fma_contractionon this head fails at its new control:v_fma_f32 overflow control should stay fused, left2139095040(0x7F800000), right1946157055(0x73FFFFFF). Alone (--test-threads=1) it fails the same way. The non-fused asserts before it pass.xcllib suite on this head: 716 passed, 6 failed, 21 ignored, 0SKIPPED(the six:gpu_f64_roots,gpu_f64_math_random, this test,gpu_depth_buffer_created_for_unordered_access_is_placed,xma2_source_voice_decodes_and_manages_lifetime,pe::tests::parses_own_test_binary_tls).mainb7aa9f3plus a test-only commit: 714 passed, 9 failed (the same six plus three interference failures that pass alone).Not tested
AI use
Imported from ivall/xcl. Originally posted by crastinator on 2026-11-24T18:03:53Z.
@pablogonz12 for comparison: same Mesa 26.3.1 on RDNA2 (RX 6700 XT, gfx1031). At
bbf6c40the test passes with every dxil-spirv I have, your master7c048638included, andRADV_DEBUG=shadersshows the lone control as onev_fmac_f32. So it looks gfx12-specific. Details in my review above (edited).Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T06:24:40Z.
Empirical test report (
bbf6c406)Hardware / environment
bbf6c406e5c1b831bb7aed57400c797f6e8cc42c(PR #676).32.0.101.9175. AMD Ryzen 7 3800X 8-Core Processor. Windows build10.0.26200.9974.1.100.0 (0ef1bc386 2026-11-09),x86_64-pc-windows-msvc. DXC1.9.2609.5 (01b62ad4)and DXIL1.9.2609.5.Commands and results
cargo test -p xcl --lib --no-runexited 0 outside the Arc lock and produced the library test executable. This step ran zero tests.XCL_ADAPTER=A770andRUST_TEST_NOCAPTURE=1, ran this command under the lock held byInvoke-ArcTest.ps1.$testExedenotes the executable Cargo reported.SKIPPED). The harness finished in 0.64s.Observed behavior
The selected test exercised both shaders in one test case. The non-fused MAD and MAC assertions passed for positive infinity on overflow (
0x7F800000) and positive zero on cancellation (0x00000000). The separateV_FMA_F32dispatch used the same inputs and passed the fused-result assertions (0x73FFFFFFand0x28800000, respectively).Not tested
The full GPU workspace suite, game smoke runs, and the RADV/vkd3d-proton configuration were omitted.
AI use
Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr676-focused.log and published.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T12:10:38Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: 1038 passed, 1 failed in one parallel run; the failing test passes on a single-threaded rerun (1039/0). 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:42:21Z.
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:12:37Z.
merge-check
base:
53e85fb1head:
bbf6c406e5merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2788 passed, 6 failed, 49 ignored, the base's own count because the PR moves assertions inside an existing test rather than adding one; 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).review: no blocking finding; the whole diff is 12 lines in one test. The fused
v_fma_f32control moves out of the non-fused program into a program of its own, and both expectations (overflow staying fused, cancellation staying fused) move with it; the non-fused assertions are untouched. The comment states the reason and the hardware it was seen on (RADV through vkd3d-proton merging identicalpreciseproducts across the shader and rounding twice), which is the failure mode that made the old shape flaky, and the new program gives that check nothing to merge with. The check is still meaningful: it fails if the backend stops fusing a lonev_fma_f32. No duplicate: #472 is the report this follows and nothing else changes this test.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 jsalzy on 2026-11-30T03:24:09Z.
merge-check claim
head:
bbf6c406e5Imported from ivall/xcl. Originally posted by jsalzy on 2026-11-30T03:33:13Z.
merge-check
base:
cfb9753a8chead:
bbf6c406e5merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2834 passed, 0 failed, 51 ignored; SKIPPED: 25 (22 no wave64 on this GPU; 2 no heap windows (opt-in XCL_HEAP_WINDOWS=1); 1 driver cache cannot be disabled without Windows Developer Mode); failing: none. The PR moves assertions inside gpu_nonfused_mad_and_mac_prevent_fma_contraction rather than adding a test; it passes here.
review: no blocking finding; whole diff read (12 lines in one test). The fused v_fma_f32 control leaves the non-fused program and runs as a program of its own, on the same inputs and options, with both of its expectations (overflow 0x73FF_FFFF and cancellation 0x2880_0000 staying fused); the non-fused assertions are unchanged. It still fails if the backend stops fusing a lone v_fma_f32, and it no longer gives a driver identical precise products to merge it with, which is the RADV failure the PR describes (#472). This run is NVIDIA only (wave32), where the test passes; RADV, where the old layout failed, is not covered here. No duplicate: #2119 (open) adds a different test after this one without changing it.
performance: none (test only).
verdict: safe to merge
hardware / tool and model: RTX 4070 SUPER 12 GB (621.24 / 32.0.16.2124), Ryzen 7 7800X3D, 32 GB, Windows 11 Pro 25H2 26200.9974, Rust 1.100.0, debug / Claude app (Claude Opus 5.5): merge, build and suite run on this PC with git and cargo only; diff review by Claude Opus 5.5.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T03:56:07Z.
Triage (#1607) – head
bbf6c40No open or merged PR makes this change; main still runs the
v_fma_f32control in the same program as the non-fused ops. #927 also touches this test, but in a different way: inside a large Intel Arc PR, it loosens the v16 asserts to accept an unfused result. This PR keeps the exact fused values and moves the control into its own program.No problems found in the diff: the non-fused checks are unchanged and the control's assertions keep their exact values.
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.