Recompiler: keep v_fma_f64 precise so a driver cannot split it #2119

Open
github-bot wants to merge 1 commit from github-bot/gh-2119 into main AGit
Owner

@⁠pablogonz12 on GitHub · 2026-11-25 05:03 UTC · original
pablogonz12:fix/v-fma-f64-precise → main · +36 −1 · 2 files · 1 commits · open

The HLSL path emitted v_fma_f64 as a plain fma(). DXC then left the dx.op.tertiary Fma call without !dx.precise, vkd3d-proton gave RADV an OpExtInst Fma without NoContraction, and RADV split that fma when the shader already computed the same a * b: it merged the two products and rounded twice. v_fma_f64(x, x, -(x * x)) returned 0 instead of the rounding error of the product (2^-56 + 2^-104, 0x3C70000000200000), so any f64 fma whose product is also written elsewhere in the shader loses its fused result on RADV.

v_fma_f64 now goes through fma_d(), whose result is precise. Related: #472 is the f32 form of an unfused fma (mad() on RDNA1); this is the f64 form, which needs only that the host passes precise on.

What is in it

  • crates/xcl/src/gpu/recomp/emit.rs: v_fma_f64 emits fma_d(...); fma_d is defined in the prelude beside mad_nf and computes the fma in a precise double.
  • crates/xcl/src/gpu/recomp/tests.rs: gpu_v_fma_f64_stays_fused_beside_the_same_product compiles with the runtime's own DXC arguments (no -Gis), runs p = x * x and fma(x, x, -p) on the GPU and checks p and the exact residual.

Evidence

  • DXIL on 7b5f620 (disassembled with dxil::validate::disassemble, there is no dxc.exe on this machine): call double @dx.op.tertiary.f64(i32 47, …), !dx.precise !12 ; Fma(a,b,c).
  • SPIR-V dumped with VKD3D_SHADER_DUMP_PATH on the same commit: %81 = OpFMul %double decorated NoContraction, the Fma decorated NoContraction as well. Before the change the Fma had no decoration.
  • 2×2, same prefix, one test: the base exe (main) fails with both vkd3d-proton builds; the head exe fails on the d3d12core.dll our test prefix has (dxil-spirv 7c048638 is in the tree, but that DLL was built before fd92a550 "Handle precise for full FMA opcode") and passes with vkd3d-proton master 30b0eb9 (dxil-spirv 34f0ff8) and with our patched v3.1 rebuilt today (10c5f7c4). The fix therefore takes effect with any vkd3d-proton whose dxil-spirv contains fd92a550; on an older one the host drops precise for Fma and nothing in XCL can keep the fma fused on that path.

Tested

  • AMD Radeon RX 9070 XT (RADV GFX1201), Mesa 26.3.1-arch3.5, AMD Ryzen 9 9900X, Wine GE-Proton11-14, vkd3d-proton v3.1 + the XCL patch, DXC 1.9.2609.5, rustc 1.100.0, cargo xwin x86_64-pc-windows-msvc, -C target-feature=+crt-static, release.
  • xcl lib suite, --test-threads=4, skipping integer_ops_match_cpu, uaddc_and_usubb_match_cpu, jumps_to_outer_loop_heads_are_structured (they kill the lib test binary on RADV; #1246, separate):
    • test prefix as it is: main 6987e49 1085 passed, 10 failed, 26 ignored; this head 7b5f620 1088 passed, 8 failed, 26 ignored (head's extra failure is the new test, which stays red on that stale DLL; the 3 title-textures / d32s8 failures of main's run passed on head)
    • vkd3d-proton v3.1 + XCL patch rebuilt today (10c5f7c4): main 6987e49 1088 passed, 7 failed, 26 ignored; this head 7b5f620 1089 passed, 7 failed, 26 ignored — the same 7 on both (fuzz_validate_and_gpu_2, directed_reference_basics, lower_dxil f64 and f32, gpu_nonfused_mad_and_mac_prevent_fma_contraction, depth-UAV placement, xma2_source_voice), and the new test passes.
  • Integration tests (e2e, pls_quota, predication_e2e and the other 14 test binaries), one thread: the same 3 failures on main and on head (e2e console-screen cloak, pls_quota Wine ERROR_FILE_NOT_FOUND, predication_e2e copies not predicated by vkd3d-proton).
  • SKIPPED on this adapter: the four f16 / f32-conversion programs of lower_dxil (unsupported V_MUL_F16 semantics, #1426), unchanged by this PR.

Regression run

Both blocks are the output of each commit's own unmodified scripts/smoke.ps1, written to a file by PowerShell and pasted as is. It ran in Windows PowerShell 7.7.0 (pwsh.exe) under Wine (GE-Proton11-14, Linux), not on native Windows, with MinGit 2.56.1 for git; xcl.exe is an MSVC release build (cargo xwin, static CRT), passed with -Xcl. Host workarounds outside the script: a pseudo-terminal, DOTNET_SYSTEM_GLOBALIZATION_USENLS=1, and importing PowerShell's Utility and Management modules before calling it. main is this PR's base commit. These replace the earlier blocks from a bash port. Frame counts at this speed are small; I read them only as no crash or device removal. Each commit was run once. Note that this title can end in a device removal on this host even on main (seen in repeat runs of another base commit, see #464).

main:

xcl-smoke v1
commit: 6987e496c35653f9ccc9dbdc1f1d342734306811
gpu: AMD Radeon RX 9070 XT (RADV GFX1201)
title: bdd254b6
seconds: 60
exit: 0x0
frames shown: 22 (PresentX 31)
presents per 2 s (last 3): 1 1 1
device removals: 0
crashes: 0
peak commit: 0 MB

This PR's head:

xcl-smoke v1
commit: 7b5f6202288bc3fd40416c57b39e9b4c04fe7f14
gpu: AMD Radeon RX 9070 XT (RADV GFX1201)
title: bdd254b6
seconds: 60
exit: 0x0
frames shown: 21 (PresentX 29)
presents per 2 s (last 3): 1 0 0
device removals: 0
crashes: 0
peak commit: 0 MB

Not tested

  • Native Windows, any AMD or NVIDIA D3D12 driver: the maintainer's run is the first one there. On Windows the driver gets NoContraction on the Fma, so the fma should stay fused, but I did not measure it.
  • Any retail code path that uses v_fma_f64 with the same product written elsewhere; no title was checked for a change in output.
  • XCL_DIRECT_DXIL: its Fma still carries no dx.precise and its f64_programs_on_the_gpu fails the same way; that is a separate change in gpu/dxil.
  • macOS / D3DMetal.

AI use

  • Claude Code, Claude Sonnet 5.5: found the instruction, wrote fma_d and the test, dumped the DXIL and SPIR-V, ran the suite, the integration tests and the two smoke runs, and wrote this description. I checked every line of the diff and every number above.
**@⁠pablogonz12** on GitHub · 2026-11-25 05:03 UTC · [original](https://github.com/xcl-dev/xcl/pull/2119) `pablogonz12:fix/v-fma-f64-precise` → `main` · +36 −1 · 2 files · 1 commits · open The HLSL path emitted `v_fma_f64` as a plain `fma()`. DXC then left the `dx.op.tertiary` Fma call without `!dx.precise`, vkd3d-proton gave RADV an `OpExtInst Fma` without `NoContraction`, and RADV **split** that fma when the shader already computed the same `a * b`: it merged the two products and rounded twice. `v_fma_f64(x, x, -(x * x))` returned `0` instead of the rounding error of the product (`2^-56 + 2^-104`, `0x3C70000000200000`), so any f64 fma whose product is also written elsewhere in the shader loses its fused result on RADV. `v_fma_f64` now goes through `fma_d()`, whose result is `precise`. Related: #472 is the f32 form of an unfused fma (`mad()` on RDNA1); this is the f64 form, which needs only that the host passes `precise` on. **What is in it** - `crates/xcl/src/gpu/recomp/emit.rs`: `v_fma_f64` emits `fma_d(...)`; `fma_d` is defined in the prelude beside `mad_nf` and computes the fma in a `precise` double. - `crates/xcl/src/gpu/recomp/tests.rs`: `gpu_v_fma_f64_stays_fused_beside_the_same_product` compiles with the runtime's own DXC arguments (no `-Gis`), runs `p = x * x` and `fma(x, x, -p)` on the GPU and checks `p` and the exact residual. **Evidence** - DXIL on `7b5f620` (disassembled with `dxil::validate::disassemble`, there is no `dxc.exe` on this machine): `call double @dx.op.tertiary.f64(i32 47, …), !dx.precise !12 ; Fma(a,b,c)`. - SPIR-V dumped with `VKD3D_SHADER_DUMP_PATH` on the same commit: `%81 = OpFMul %double` decorated `NoContraction`, the `Fma` decorated `NoContraction` as well. Before the change the `Fma` had no decoration. - 2×2, same prefix, one test: the base exe (main) fails with both vkd3d-proton builds; the head exe fails on the `d3d12core.dll` our test prefix has (dxil-spirv `7c048638` is in the tree, but that DLL was built before `fd92a550` "Handle precise for full FMA opcode") and **passes** with vkd3d-proton master `30b0eb9` (dxil-spirv `34f0ff8`) and with our patched v3.1 rebuilt today (`10c5f7c4`). The fix therefore takes effect with any vkd3d-proton whose dxil-spirv contains `fd92a550`; on an older one the host drops `precise` for `Fma` and nothing in XCL can keep the fma fused on that path. **Tested** - AMD Radeon RX 9070 XT (RADV GFX1201), Mesa 26.3.1-arch3.5, AMD Ryzen 9 9900X, Wine GE-Proton11-14, vkd3d-proton v3.1 + the XCL patch, DXC 1.9.2609.5, rustc 1.100.0, `cargo xwin` `x86_64-pc-windows-msvc`, `-C target-feature=+crt-static`, release. - `xcl` lib suite, `--test-threads=4`, skipping `integer_ops_match_cpu`, `uaddc_and_usubb_match_cpu`, `jumps_to_outer_loop_heads_are_structured` (they kill the lib test binary on RADV; #1246, separate): - test prefix as it is: main `6987e49` 1085 passed, 10 failed, 26 ignored; this head `7b5f620` 1088 passed, 8 failed, 26 ignored (head's extra failure is the new test, which stays red on that stale DLL; the 3 title-textures / d32s8 failures of main's run passed on head) - vkd3d-proton v3.1 + XCL patch rebuilt today (`10c5f7c4`): main `6987e49` 1088 passed, 7 failed, 26 ignored; this head `7b5f620` 1089 passed, 7 failed, 26 ignored — the same 7 on both (`fuzz_validate_and_gpu_2`, `directed_reference_basics`, `lower_dxil` f64 and f32, `gpu_nonfused_mad_and_mac_prevent_fma_contraction`, depth-UAV placement, `xma2_source_voice`), and the new test passes. - Integration tests (`e2e`, `pls_quota`, `predication_e2e` and the other 14 test binaries), one thread: the same 3 failures on main and on head (`e2e` console-screen cloak, `pls_quota` Wine `ERROR_FILE_NOT_FOUND`, `predication_e2e` copies not predicated by vkd3d-proton). - `SKIPPED` on this adapter: the four f16 / f32-conversion programs of `lower_dxil` (unsupported `V_MUL_F16` semantics, #1426), unchanged by this PR. **Regression run** Both blocks are the output of each commit's own unmodified `scripts/smoke.ps1`, written to a file by PowerShell and pasted as is. It ran in **Windows PowerShell 7.7.0 (`pwsh.exe`) under Wine** (GE-Proton11-14, Linux), not on native Windows, with MinGit 2.56.1 for `git`; `xcl.exe` is an MSVC release build (`cargo xwin`, static CRT), passed with `-Xcl`. Host workarounds outside the script: a pseudo-terminal, `DOTNET_SYSTEM_GLOBALIZATION_USENLS=1`, and importing PowerShell's Utility and Management modules before calling it. `main` is this PR's base commit. These replace the earlier blocks from a bash port. Frame counts at this speed are small; I read them only as no crash or device removal. Each commit was run once. Note that this title can end in a device removal on this host even on `main` (seen in repeat runs of another base commit, see #464). `main`: ``` xcl-smoke v1 commit: 6987e496c35653f9ccc9dbdc1f1d342734306811 gpu: AMD Radeon RX 9070 XT (RADV GFX1201) title: bdd254b6 seconds: 60 exit: 0x0 frames shown: 22 (PresentX 31) presents per 2 s (last 3): 1 1 1 device removals: 0 crashes: 0 peak commit: 0 MB ``` This PR's head: ``` xcl-smoke v1 commit: 7b5f6202288bc3fd40416c57b39e9b4c04fe7f14 gpu: AMD Radeon RX 9070 XT (RADV GFX1201) title: bdd254b6 seconds: 60 exit: 0x0 frames shown: 21 (PresentX 29) presents per 2 s (last 3): 1 0 0 device removals: 0 crashes: 0 peak commit: 0 MB ``` **Not tested** - Native Windows, any AMD or NVIDIA D3D12 driver: the maintainer's run is the first one there. On Windows the driver gets `NoContraction` on the `Fma`, so the fma should stay fused, but I did not measure it. - Any retail code path that uses `v_fma_f64` with the same product written elsewhere; no title was checked for a change in output. - `XCL_DIRECT_DXIL`: its `Fma` still carries no `dx.precise` and its `f64_programs_on_the_gpu` fails the same way; that is a separate change in `gpu/dxil`. - macOS / D3DMetal. **AI use** - Claude Code, Claude Sonnet 5.5: found the instruction, wrote `fma_d` and the test, dumped the DXIL and SPIR-V, ran the suite, the integration tests and the two smoke runs, and wrote this description. I checked every line of the diff and every number above.
The HLSL path emitted v_fma_f64 as a plain fma(), so DXC left the Fma
call without !dx.precise and vkd3d-proton gave the driver an Fma without
NoContraction. With the same a * b already computed in the shader, RADV
split the fma and merged the two products: v_fma_f64(x, x, -(x * x))
returned 0 instead of the rounding error of the product.

Emit it through fma_d(), whose result is precise. vkd3d-proton passes
that on for Fma from dxil-spirv fd92a550 ("Handle precise for full FMA
opcode").

Assisted-by: Claude Code (Claude Sonnet 5.5)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:19:34 +00:00
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-25 05:19 UTC · original · edited 2026-11-25 05:23 UTC

Full-suite run, since this PR has no test report yet. Tested exact head 7b5f620 (on its base 6987e49).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::recomp::lower_dxil::tests::mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests: 1143 passed, 0 failed, 44 ignored. SKIPPED (no wave64): a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu, a_per_lane_2d_or_3d_group_runs_on_the_gpu, coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu, cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu, gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware, the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu.
  • The new tests ran and passed: gpu_v_fma_f64_stays_fused_beside_the_same_product.
  • Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1: 1154 passed, 0 failed, 46 ignored. SKIPPED: f16_programs_on_the_gpu (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), f32_programs_on_the_gpu (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), f32_programs_on_the_gpu (f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • --skip leaves out tests that fail on main 6020a33 too, not because of this PR. On NVIDIA: heap_window_out_of_memory_falls_back_to_the_switch_form (#1651), the four gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu tests, const_and_null_mask_operands_agree_with_hlsl_on_the_gpu and mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu (follow-up on #1651) fail because runner::skip_test turns their skips into failures under XCL_REQUIRE_GPU=mesh, and gpu::dxil::fuzz_tests seeds 70, 545, 1019 and 1507 fail CreateComputePipelineState with E_OUTOFMEMORY on this card (drivers 616.64 and 621.40). On AMD: fuzz_validate_and_gpu_1 fails on seed 540 (res[833] 0x7 vs CPU 0x6). The AMD run does not set XCL_REQUIRE_GPU.

Not tested

  • a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
**@⁠futurepro62** on GitHub · 2026-11-25 05:19 UTC · [original](https://github.com/xcl-dev/xcl/pull/2119#issuecomment-7153653639) · edited 2026-11-25 05:23 UTC Full-suite run, since this PR has no test report yet. Tested exact head `7b5f620` (on its base `6987e49`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::recomp::lower_dxil::tests::mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests`: **1143 passed, 0 failed, 44 ignored**. SKIPPED (no wave64): `a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu`, `a_per_lane_2d_or_3d_group_runs_on_the_gpu`, `coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu`, `cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu`, `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`, `the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu`. - The new tests ran and passed: `gpu_v_fma_f64_stays_fused_beside_the_same_product`. - Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, `XCL_ADAPTER=radeon`), `cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1`: **1154 passed, 0 failed, 46 ignored**. SKIPPED: `f16_programs_on_the_gpu` (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), `f16_programs_on_the_gpu` (f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), `f16_programs_on_the_gpu` (f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), `f16_programs_on_the_gpu` (f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), `f32_programs_on_the_gpu` (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), `f32_programs_on_the_gpu` (f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). - `--skip` leaves out tests that fail on main `6020a33` too, not because of this PR. On NVIDIA: `heap_window_out_of_memory_falls_back_to_the_switch_form` (#1651), the four `gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu` tests, `const_and_null_mask_operands_agree_with_hlsl_on_the_gpu` and `mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu` ([follow-up on #1651](https://git.gtahub.st/github/xcl-dev--xcl/issues/1651)) fail because `runner::skip_test` turns their skips into failures under `XCL_REQUIRE_GPU=mesh`, and `gpu::dxil::fuzz_tests` seeds 70, 545, 1019 and 1507 fail `CreateComputePipelineState` with `E_OUTOFMEMORY` on this card (drivers 616.64 and 621.40). On AMD: `fuzz_validate_and_gpu_1` fails on seed 540 (`res[833]` 0x7 vs CPU 0x6). The AMD run does not set `XCL_REQUIRE_GPU`. **Not tested** - a release build, a game (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
Author
Owner

@⁠DarkPanda69 on GitHub · 2026-11-25 05:23 UTC · original

Tested: gpu_v_fma_f64_stays_fused_beside_the_same_product passes on an AMD D3D12 driver and on an RTX 3060.

  • RX 9070 XT (RDNA4, driver 32.0.32029.2010): ok. Whole gpu:: filter: 585 passed, 2 failed, 22 ignored. The 2 failures are the AMD fuzz seeds 722 and 1599 tracked in #2115, which fail the same way on main.
  • RTX 3060 (driver 32.0.16.1088): ok. 587 passed, 0 failed, 22 ignored.

Head 7b5f620 applied on main 6020a33, cargo test -p xcl --lib -- gpu:: --test-threads=4 with XCL_ADAPTER set to each card.
Not tested: retail runs, and nothing beyond what the test itself asserts about the fused result.
AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.

**@⁠DarkPanda69** on GitHub · 2026-11-25 05:23 UTC · [original](https://github.com/xcl-dev/xcl/pull/2119#issuecomment-7153732408) Tested: `gpu_v_fma_f64_stays_fused_beside_the_same_product` passes on an AMD D3D12 driver and on an RTX 3060. - RX 9070 XT (RDNA4, driver 32.0.32029.2010): ok. Whole `gpu::` filter: 585 passed, 2 failed, 22 ignored. The 2 failures are the AMD fuzz seeds 722 and 1599 tracked in #2115, which fail the same way on `main`. - RTX 3060 (driver 32.0.16.1088): ok. 587 passed, 0 failed, 22 ignored. Head `7b5f620` applied on `main` `6020a33`, `cargo test -p xcl --lib -- gpu:: --test-threads=4` with `XCL_ADAPTER` set to each card. Not tested: retail runs, and nothing beyond what the test itself asserts about the fused result. AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.
Author
Owner

@⁠JoaoPauluu on GitHub · 2026-11-25 06:12 UTC · original

A run with vkd3d-proton as the host D3D12. The DXIL goes through dxil-spirv and then the NVIDIA Vulkan driver, not the native-Windows path: this PR's new test passes, none skipped.

Tested

  • RTX 3060 12 GB (NVIDIA 620.70.06, 32-lane waves), i5-10400F, 16 GB, CachyOS (kernel 7.3.3), Proton Experimental 11.0-20261112 with the patched vkd3d-proton 3.1 from #257, DXC 1.9.2609.5. Release, cross-built for x86_64-pc-windows-gnu. 7b5f620 as it is (merge base with main 6987e49), no uncommitted changes. The lib test binary runs under Wine, one test per process.
    • gpu_v_fma_f64_stays_fused_beside_the_same_product: ok

Not tested

  • the whole suite on this head, a retail title, native Windows, AMD.

AI use

  • Claude Code (Claude Opus 5.5) built the commit, ran the tests and wrote this report. The account owner asked for test reports to be posted and has not reviewed this one.
**@⁠JoaoPauluu** on GitHub · 2026-11-25 06:12 UTC · [original](https://github.com/xcl-dev/xcl/pull/2119#issuecomment-7154546482) A run with vkd3d-proton as the host D3D12. The DXIL goes through dxil-spirv and then the NVIDIA Vulkan driver, not the native-Windows path: this PR's new test passes, none skipped. **Tested** - RTX 3060 12 GB (NVIDIA 620.70.06, 32-lane waves), i5-10400F, 16 GB, CachyOS (kernel 7.3.3), Proton Experimental 11.0-20261112 with the patched vkd3d-proton 3.1 from #257, DXC 1.9.2609.5. Release, cross-built for `x86_64-pc-windows-gnu`. `7b5f620` as it is (merge base with `main` `6987e49`), no uncommitted changes. The lib test binary runs under Wine, one test per process. - `gpu_v_fma_f64_stays_fused_beside_the_same_product`: ok **Not tested** - the whole suite on this head, a retail title, native Windows, AMD. **AI use** - Claude Code (Claude Opus 5.5) built the commit, ran the tests and wrote this report. The account owner asked for test reports to be posted and has not reviewed this one.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 06:17 UTC · original

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!

**@⁠DavidM1911** on GitHub · 2026-11-25 06:17 UTC · [original](https://github.com/xcl-dev/xcl/pull/2119#issuecomment-7154643395) 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!
Author
Owner

@⁠jennydeth on GitHub · 2026-11-25 14:23 UTC · original

Native Windows run on an NVIDIA D3D12 driver (listed under Not tested).

Setup: RTX 3060 12 GB (32-lane waves, driver 32.0.16.2101), Ryzen 5 5600X, 32 GB RAM, Windows 11 build 26300, Rust 1.100.0, DXC 1.9.2609.5, debug build. Head 7b5f620.

Result: cargo test --workspace -- --test-threads=4: 1155 passed, 0 failed, 46 ignored. SKIPPED: 18 GPU tests for no wave64 (expected on this card); the per-lane refused cases; heap windows; driver cache.

Not tested: AMD; a title run.

AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this report.

**@⁠jennydeth** on GitHub · 2026-11-25 14:23 UTC · [original](https://github.com/xcl-dev/xcl/pull/2119#issuecomment-7165194824) Native Windows run on an NVIDIA D3D12 driver (listed under Not tested). Setup: RTX 3060 12 GB (32-lane waves, driver 32.0.16.2101), Ryzen 5 5600X, 32 GB RAM, Windows 11 build 26300, Rust 1.100.0, DXC 1.9.2609.5, debug build. Head 7b5f620. Result: cargo test --workspace -- --test-threads=4: 1155 passed, 0 failed, 46 ignored. SKIPPED: 18 GPU tests for no wave64 (expected on this card); the per-lane refused cases; heap windows; driver cache. Not tested: AMD; a title run. AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this report.
Author
Owner

@⁠luckyteagirl on GitHub · 2026-11-26 09:06 UTC · original · reviewed

The new gpu_v_fma_f64_stays_fused_beside_the_same_product test on 7b5f620 only calls gpu_ready(), which checks adapter, wave support, and DXC but not shader FP64. It then unconditionally compiles and runs a shader with double operations. A reported XCL test adapter, Intel Arc A770, returns DoublePrecisionFloatShaderOps=0 (hardware report); on such a device the new test can fail during PSO creation before it checks fused rounding. D3D12 exposes this requirement through D3D12_FEATURE_DATA_D3D12_OPTIONS (Microsoft reference).

Could the test query that option on the adapter selected by the runner and skip the GPU execution when FP64 is unsupported? A CPU-side check of the emitted precision metadata could still exercise translation on those adapters. This is source and capability-report review only; I did not run this test on an FP64-limited GPU.

**@⁠luckyteagirl** on GitHub · 2026-11-26 09:06 UTC · [original](https://github.com/xcl-dev/xcl/pull/2119#pullrequestreview-6071197670) · **reviewed** The new `gpu_v_fma_f64_stays_fused_beside_the_same_product` test on `7b5f620` only calls `gpu_ready()`, which checks adapter, wave support, and DXC but not shader FP64. It then unconditionally compiles and runs a shader with `double` operations. A reported XCL test adapter, Intel Arc A770, returns `DoublePrecisionFloatShaderOps=0` ([hardware report](https://git.gtahub.st/github/xcl-dev--xcl/pulls/1995)); on such a device the new test can fail during PSO creation before it checks fused rounding. D3D12 exposes this requirement through `D3D12_FEATURE_DATA_D3D12_OPTIONS` ([Microsoft reference](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/ns-d3d12-d3d12_feature_data_d3d12_options)). Could the test query that option on the adapter selected by the runner and skip the GPU execution when FP64 is unsupported? A CPU-side check of the emitted precision metadata could still exercise translation on those adapters. This is source and capability-report review only; I did not run this test on an FP64-limited GPU.
Author
Owner

@⁠pablogonz12 on GitHub · 2026-11-26 10:23 UTC · original

Thanks — confirmed, and it is wider than this PR's test.

Checked at head 7b5f620:

  • gpu_v_fma_f64_stays_fused_beside_the_same_product (crates/xcl/src/gpu/recomp/tests.rs:7759) gates on gpu_ready() (tests.rs:13) only: adapter, wave64_programs_supported() and dxc::location(). No FP64 check, as you say.
  • The nine f64 tests already on the base 6987e49 gate the same way: gpu_f64_class_compare, gpu_rndne_f64, gpu_frexp_f64_exp_and_mant, gpu_f64_rounding_and_conversions, gpu_f64_roots, gpu_ldexp_f64, gpu_f64_compares_with_nan, gpu_f64_math_random, gpu_f64_literal_high_word.
  • Nothing in crates/xcl/src/gpu asks for D3D12_OPTIONS.DoublePrecisionFloatShaderOps: runner::adapter() queries D3D12_FEATURE_SHADER_MODEL, D3D12_OPTIONS1 and D3D12_OPTIONS7 (mesh). So on an adapter such as the A770 the nine tests that exist on main should fail the same way; this PR adds a tenth test of that shape, not a new hardware requirement.
  • We have no FP64-limited adapter here (RX 9070 XT, RADV GFX1201), and the reports on this PR are on that RADV device and on NVIDIA. So I can confirm the code path you point at, but not the PSO-creation failure itself — that rests on the capability report you link, not on a run of ours.
  • On your CPU-side idea: the emitted HLSL is precise double r = fma(a, b, c); (emit.rs:6164). An assertion on the !dx.precise metadata would still need DXC, which the DXC-gated tests here already need, but it would only cover the translation half, not the execution this PR is about.

About the fix: it is not a one-line test change. It needs a capability helper in gpu/recomp/runner.rs beside mesh_shaders_supported(), a skip_test("no fp64") in all ten f64 tests, and a mapping for XCL_REQUIRE_GPU, because skip_test counts any reason other than "no mesh shaders" as a failure under XCL_REQUIRE_GPU=wave64 (runner.rs:617-625) — an unmapped "no fp64" would turn a skip into a red test on that runner. If a maintainer wants that on this branch, we will push it here as one commit; otherwise a separate PR covering all ten tests is the honest scope, since it changes main's f64 coverage too.

AI use: prepared with AI assistance (DeepSeek), report only — the file and line references above were read from the source at 7b5f620.

**@⁠pablogonz12** on GitHub · 2026-11-26 10:23 UTC · [original](https://github.com/xcl-dev/xcl/pull/2119#issuecomment-7189296182) Thanks — confirmed, and it is wider than this PR's test. Checked at head `7b5f620`: - `gpu_v_fma_f64_stays_fused_beside_the_same_product` (`crates/xcl/src/gpu/recomp/tests.rs:7759`) gates on `gpu_ready()` (`tests.rs:13`) only: adapter, `wave64_programs_supported()` and `dxc::location()`. No FP64 check, as you say. - The nine f64 tests already on the base `6987e49` gate the same way: `gpu_f64_class_compare`, `gpu_rndne_f64`, `gpu_frexp_f64_exp_and_mant`, `gpu_f64_rounding_and_conversions`, `gpu_f64_roots`, `gpu_ldexp_f64`, `gpu_f64_compares_with_nan`, `gpu_f64_math_random`, `gpu_f64_literal_high_word`. - Nothing in `crates/xcl/src/gpu` asks for `D3D12_OPTIONS.DoublePrecisionFloatShaderOps`: `runner::adapter()` queries `D3D12_FEATURE_SHADER_MODEL`, `D3D12_OPTIONS1` and `D3D12_OPTIONS7` (mesh). So on an adapter such as the A770 the nine tests that exist on `main` should fail the same way; this PR adds a tenth test of that shape, not a new hardware requirement. - We have no FP64-limited adapter here (RX 9070 XT, RADV GFX1201), and the reports on this PR are on that RADV device and on NVIDIA. So I can confirm the code path you point at, but not the PSO-creation failure itself — that rests on the capability report you link, not on a run of ours. - On your CPU-side idea: the emitted HLSL is `precise double r = fma(a, b, c);` (`emit.rs:6164`). An assertion on the `!dx.precise` metadata would still need DXC, which the DXC-gated tests here already need, but it would only cover the translation half, not the execution this PR is about. About the fix: it is not a one-line test change. It needs a capability helper in `gpu/recomp/runner.rs` beside `mesh_shaders_supported()`, a `skip_test("no fp64")` in all ten f64 tests, and a mapping for `XCL_REQUIRE_GPU`, because `skip_test` counts any reason other than `"no mesh shaders"` as a failure under `XCL_REQUIRE_GPU=wave64` (`runner.rs:617-625`) — an unmapped `"no fp64"` would turn a skip into a red test on that runner. If a maintainer wants that on this branch, we will push it here as one commit; otherwise a separate PR covering all ten tests is the honest scope, since it changes `main`'s f64 coverage too. AI use: prepared with AI assistance (DeepSeek), report only — the file and line references above were read from the source at `7b5f620`.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2119/head:github-bot/gh-2119'
git switch 'github-bot/gh-2119'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2119'
git switch 'github-bot/gh-2119'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2119'
git switch 'github-bot/gh-2119'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2119'
git switch 'main'
git merge --squash 'github-bot/gh-2119'
git switch 'main'
git merge --ff-only 'github-bot/gh-2119'
git switch 'main'
git merge 'github-bot/gh-2119'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.