Repository navigation
Recompiler: preserve zero sign in HLSL f16 multiplies - #2183
luckyteagirl wants to merge 1 commit into
Conversation
|
Tested on AMD Radeon RX 9070 XT (RDNA4) at AMD Radeon RX 9070 XT, driver 32.0.32015.7029; Ryzen 7 5700X3D; 32 GB; Windows 11 Pro build 26300.9974; Rust 1.100.0 msvc; DXC 1.9.2602.17; debug build. The head is directly on top of main 568e7db (0 commits behind), tested as is. Tested:
Not tested: the #2168 cross-backend fuzzer (it is not on main, so I did not check the v_sin/v_cos or ldexp cases before/after), retail title / Update: #2169 fuzzer comparison (asked for by DarkPanda69). Base:
Instructions with differences: 6 on Report written by Claude Code (Claude Sonnet 5.5) from a real run on this machine. |
|
Update for head The #2169 fuzzer before and after this PR on RDNA4 and on NVIDIA ("other GPU vendors" is listed as untested, and the RDNA4 report above didn't run the fuzzer). Head
So the fix removes both multiply differences on RDNA4 too, and changes nothing on NVIDIA, where the HLSL path already kept the sign. Not tested: a title. |
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
46b7744 to
abcf799
Compare
|
Independent NVIDIA (wave32) full-suite + retail smoke test report on exact PR head Tested
Regression run Not tested
AI use
|
|
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
Thanks! — Devin |
|
RX 9070 / Wine check of exact head RX 9070 16 GB (RADV GFX1201), Ryzen 7 7700, CachyOS kernel 7.3.6-1-cachyos, Mesa 26.3.1-5, GE-Proton11-12 / Wine 11.0 Staging, ntsync. Native vkd3d-proton Tested
The last filter is a local fixture. Production functions and original assertions were not edited. The exact head's parent is Not tested: clamp, dynamic rounding modes, OMOD, SDWA/DPP, split wave64, other shader contexts, whole suite, title/smoke or performance. No global AI use: OpenAI Codex (GPT-6; exact serving variant not exposed) reviewed the public patch, prepared the source integration and local fixtures, ran and independently verified the readbacks, and drafted this report. Publication authorized by the account owner. |
|
Independent desktop NVIDIA verification of PR #2183 at exact head Environment
Targeted release tests & build (exact head
|
| Target & Command | Result |
|---|---|
Exact head abcf799a: cargo build --release -p xcl |
Clean build (1m 30s, exit 0, 0 new warnings in emit.rs / tests.rs) |
Exact head abcf799a: gpu_f16_multiply_preserves_zero_sign (XCL_DIRECT_DXIL=0, --test-threads=1 & --test-threads=4, 3× each) |
1 passed; 0 failed; 0 ignored; 1324 filtered out × 6 (0.24–0.31s, 0 skipped) |
Exact head abcf799a: gpu_f16_multiply_preserves_zero_sign (XCL_DIRECT_DXIL=1, --test-threads=1 & --test-threads=4, 3× each) |
1 passed; 0 failed; 0 ignored; 1324 filtered out × 6 (0.20–0.24s, 0 skipped) |
Exact head abcf799a: cargo test --release -p xcl --lib -- gpu::recomp:: --test-threads=4 --nocapture (3 consecutive runs) |
393 passed; 0 failed; 19 ignored; 913 filtered out × 3 (8.15s, 7.89s, 7.81s; 23 expected runtime SKIPPED lines: 20 no wave64 + 3 wave32 per-lane refused) |
Unpatched main 623d02e4 control (test-only hunk applied, emit.rs unpatched): gpu_f16_multiply_preserves_zero_sign (XCL_DIRECT_DXIL=0 & XCL_DIRECT_DXIL=1, --test-threads=1) |
1 passed; 0 failed on both (0.27s / 0.24s, 0 skipped — RTX 4060 driver 621.14 + DXC 1.9.2609.5 already preserves -0 on these f16 multiplies natively) |
Local temp merge 55e5afea (abcf799a onto 623d02e4, ort clean merge): cargo build --release -p xcl |
Clean build (1m 40s, exit 0, 0 new warnings in emit.rs / tests.rs) |
Local temp merge 55e5afea: gpu_f16_multiply_preserves_zero_sign (XCL_DIRECT_DXIL=0, --test-threads=1 & --test-threads=4, 3× each) |
1 passed; 0 failed; 0 ignored; 1357 filtered out × 6 (0.24–0.29s, 0 skipped) |
Local temp merge 55e5afea: gpu_f16_multiply_preserves_zero_sign (XCL_DIRECT_DXIL=1, --test-threads=1 & --test-threads=4, 3× each) |
1 passed; 0 failed; 0 ignored; 1357 filtered out × 6 (0.20–0.21s, 0 skipped) |
Local temp merge 55e5afea: cargo test --release -p xcl --lib -- gpu::recomp:: --test-threads=4 --nocapture (3 consecutive runs) |
402 passed; 0 failed; 20 ignored; 936 filtered out × 3 (7.94s, 7.98s, 7.95s; 23 expected runtime SKIPPED lines: 20 no wave64 + 3 wave32 per-lane refused) |
Paired quiet 60 s retail smoke (title: 29640639, XCL_PREPARE=0 XCL_NETWORK=0)
main baseline (623d02e465a17497a757a4ce867f482b0a6c8f3b, XCL_PREPARE=0 XCL_NETWORK=0):
xcl-smoke v1
commit: 623d02e465a17497a757a4ce867f482b0a6c8f3b
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1587 (PresentX 1587)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14010 MB
Temporary local conflict-free merge of PR #2183 (abcf799a) onto 623d02e4 (55e5afea7da3f297d4eef234680885f67f016319, XCL_PREPARE=0 XCL_NETWORK=0):
xcl-smoke v1
commit: 55e5afea7da3f297d4eef234680885f67f016319
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1586 (PresentX 1586)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 14043 MB
Limits of coverage
- Verified on desktop Windows 11 + NVIDIA GeForce RTX 4060 (32-lane Wave32, driver
621.14, DXC1.9.2609.5) across bothXCL_DIRECT_DXIL=0andXCL_DIRECT_DXIL=1and both--test-threads=1and--test-threads=4(24/24passing runs across exact headabcf799aand local merge55e5afea), with zero parallel-scheduling flakiness observed. - Because unpatched
main623d02e4already passedgpu_f16_multiply_preserves_zero_signon this RTX 4060 + DXC1.9.2609.5host, this run confirms cross-vendor non-regression and parallel-test stability on NVIDIA Ada rather than reproducing the AMD RX 6800M / driver-0erasure failure mode directly. - Paired 60 s retail smokes ran on the temporary local integration onto
623d02e4(55e5afea) withXCL_PREPARE=0(XCL_NETWORK=0), bypassing startupprepare_for_launchshader precompilation. - Native 64-lane AMD hardware (including AMD RX 6800M,
20no wave64skipped subcases), Wine hosts, and the20#[ignore]tests were not exercised on this machine.
AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).
Fixes the f16 multiplication signed-zero part of #2168 on the default HLSL backend. On the RX 6800M, DXC fast math can turn a negative-zero product into positive zero for
V_MUL_F16andV_PK_MUL_F16; direct DXIL preserves the sign. A global-Gisswitch also changes FMA results on this card, so this patch repairs only the two multiply forms.What is in it
Tested
abcf799a3a08766a62a645f2159a3f9e82e9459conmain6d12f58a229bc73889878a448c64dc3af25eeba0; Windows 11 Home build 26200, Ryzen 9 5980HX, Radeon RX 6800M driver30.0.13002.13003, Rust 1.99.0 MSVC, DXC/DXIL 1.8.2502.11.cargo test --locked -p xcl --lib -j 2 gpu_f16_multiply_preserves_zero_sign -- --test-threads=1 --show-output, withXCL_ADAPTER=6800MandXCL_REQUIRE_GPU=wave64: 1 passed, 0 failed, 0 ignored, 0 SKIPPED withXCL_DIRECT_DXIL=0, and the same counts withXCL_DIRECT_DXIL=1. The two guarded runs did not trigger the memory guard.cargo build --locked --release -p xcl --bins -j 2: passed under the 1 GiB free-commit guard with no trigger on the retry. An earlier attempt was guard-stopped before completion when unrelated jobs exhausted free commit; it produced no build result.git diff --check: clean..\scripts\test.ps1completed with 1,424 passed, 0 failed, 46 ignored, and 25 explicit GPU skips (21 native-wave64, one heap-window, three refused per-lane forms). The focused f16 regression passed. A separate 60-second release title smoke showed 1,563 frames, 15,387 MB peak, and zero crashes/device removals against a same-machinemainbaseline of 1,605 frames and 15,009 MB. These are the independent reporter's results, not runs on our RX 6800M.46b7744: the RX 6800M fuzzer comparison found 26/256V_MUL_F16and 49/256V_PK_MUL_F16HLSL/direct differences before the emitter change, and 0/256 for each after it. Its full workspace run reported 993 passed, 162 failed, 46 ignored; 161 of the failed names matched a prior clean-main run after this old AMD driver suspended the device. These are not current-head suite results.Regression run
The committed release binaries for the tested
mainbase (6d12f58) and this PR ran the same locally owned title on the RX 6800M for five seconds each, with separate data and shader caches. Both exited normally with no crash, device removal, or memory-guard trigger, but neither reached a frame; these runs cover startup only. A separate seven-second main run showed six frames, while the seven-second head attempt hit the unchanged 1 GiB free-commit guard at 713 MB and produced no smoke block. The focused GPU fixture above exercises the changed f16 instructions.Tested
mainbase:This PR:
On an RTX 3070, ramon-victor reported an independent 60-second retail comparison on this exact clean PR head and main
08db802. The PR showed 1,563 frames and 15,387 MB peak commit. The reported main baseline showed 1,605 frames and 15,009 MB. Both reported zero crashes or device removals. The report includes the PR's raw smoke block and summarizes the main run, so the paired raw blocks above remain the recorded comparison for the checker. The independent smoke reached rendered frames, with no verified coverage of the changed f16 instructions. Independent RTX 3070 reportNot tested
AI use
OpenAI Codex (GPT-6; exact variant unavailable) implemented the fix and regression, rebased the commit, ran the current-head focused GPU checks and guarded release/smoke runs, reviewed logs, and drafted this description.
OpenAI Codex (GPT-6.2 Astra) verified the independent exact-head report and added its linked results to this description.
OpenAI Codex (GPT-6.2 Sol) added the attributed positive-frame comparison to the regression section and verified the PR checker without changing the code.