Recompiler: translate f64 division ops (v_div_scale/fmas/fixup_f64) #823

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

@⁠mastrr9 on GitHub · 2026-11-24 06:07 UTC · original
mastrr9:feat/recomp-div-f64 → main · +145 −0 · 2 files · 1 commits · open

v_div_scale_f64, v_div_fmas_f64, and v_div_fixup_f64 were previously reported unsupported, leaving shaders that emit LLVM's fdiv double sequence untranslated.

What is in it

  • crates/xcl/src/gpu/recomp/emit.rs:
    • v_div_scale_f64 passes src0 through unscaled and sets SDST (VCC) to false (matching v_div_scale_f32).
    • v_div_fmas_f64 emits fma(a, b, c) (since scale carry is 0).
    • v_div_fixup_f64 emits div_fixup_d(q, d, n) (placed after ldexp_d in PRELUDE): handles IEEE 754 special cases on the bits, uses q directly with the quotient sign in the safe normal range (e_n >= 55, 3 <= e_d <= 2042, 3 <= e_q <= 2045), and falls back to div_d(n, d) (precise mantissa division + single-rounded denormal scaling) where scaling matters.
  • crates/xcl/src/gpu/recomp/tests.rs: div_f64_translates (HLSL + DXC check) and gpu_div_f64 (full LLVM f64 division sequence verified bit-for-bit against CPU IEEE division across 512+ special, denormal, extreme-exponent, and random pairs).

Tested

  • Environment: NVIDIA GeForce RTX 5080 (16 GB, wave32, driver 617.42 / 32.0.16.1742), Windows 11 Pro 25H2 (26200.9974), D3D12 debug layer installed (d3d12SDKLayers.dll), rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC, DXC from Windows SDK 10.0.26100.0, debug build.
  • Command (at head 93b8b1d118d6db4b6e134166c0ada511a8950354): cargo build --workspace && cargo test --workspace -- --test-threads=4
  • Result: 715 passed, 0 failed, 41 ignored (0 new warnings).
    • gpu::recomp::tests::div_f64_translates — ok
    • gpu::recomp::tests::gpu_div_f64 — ok (executed on RTX 5080 wave32, bit-exact on all 512+ pairs, not skipped)
  • SKIPPED (2): gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask (no wave64), gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware (no wave64).

Regression run
Smoke run by @⁠Toons29 in comment below: #823
Contributed by a community tester; the PR author did not run it. Both blocks are pasted as posted.

main:

xcl-smoke v1
commit: 4178e888c0b5be50a2887eda45cdb832763b68a4
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1618 (PresentX 1618)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 14831 MB

PR:

xcl-smoke v1
commit: 66d892164d14eb091f175c2763574d02e348fd2e
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1614 (PresentX 1614)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14815 MB

Tester's setup and limits: AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, cargo build --release -p xcl, 60 s, XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.

Tester's AI use: Claude Code (Claude Opus 5.5) built both trees and ran scripts/smoke.ps1; the tester checked the blocks before posting.

Not tested

  • By the author: AMD/wave64 hardware, and release build.
  • Whether the community regression run above reaches the code this PR changes.

AI use

  • Claude Opus 5.5 (via Claude Duet / Claude Code) wrote the v_div_scale_f64 / v_div_fmas_f64 / v_div_fixup_f64 translation, div_d / div_fixup_d helpers, and tests.
  • Antigravity (Gemini 4 Neon & Gemini 4 Hydrogen) audited the patch, fixed HLSL declaration order (moving div_d / div_fixup_d below ldexp_d after catching a DXC compile error on Windows), ran the full Windows RTX 5080 MSVC + D3D12 debug-layer workspace suite, and drafted this PR description.
  • Claude Code (Claude Sonnet 5.5) added the community regression run to this description and updated the lines that it made out of date or that the PR check requires.
**@⁠mastrr9** on GitHub · 2026-11-24 06:07 UTC · [original](https://github.com/xcl-dev/xcl/pull/823) `mastrr9:feat/recomp-div-f64` → `main` · +145 −0 · 2 files · 1 commits · open `v_div_scale_f64`, `v_div_fmas_f64`, and `v_div_fixup_f64` were previously reported unsupported, leaving shaders that emit LLVM's `fdiv double` sequence untranslated. **What is in it** - `crates/xcl/src/gpu/recomp/emit.rs`: - `v_div_scale_f64` passes `src0` through unscaled and sets `SDST` (VCC) to `false` (matching `v_div_scale_f32`). - `v_div_fmas_f64` emits `fma(a, b, c)` (since scale carry is 0). - `v_div_fixup_f64` emits `div_fixup_d(q, d, n)` (placed after `ldexp_d` in `PRELUDE`): handles IEEE 754 special cases on the bits, uses `q` directly with the quotient sign in the safe normal range (`e_n >= 55`, `3 <= e_d <= 2042`, `3 <= e_q <= 2045`), and falls back to `div_d(n, d)` (`precise` mantissa division + single-rounded denormal scaling) where scaling matters. - `crates/xcl/src/gpu/recomp/tests.rs`: `div_f64_translates` (HLSL + DXC check) and `gpu_div_f64` (full LLVM f64 division sequence verified bit-for-bit against CPU IEEE division across 512+ special, denormal, extreme-exponent, and random pairs). **Tested** - **Environment:** NVIDIA GeForce RTX 5080 (16 GB, wave32, driver `617.42` / `32.0.16.1742`), Windows 11 Pro 25H2 (`26200.9974`), D3D12 debug layer installed (`d3d12SDKLayers.dll`), `rustc 1.100.0 (0ef1bc386 2026-11-09)` MSVC, DXC from Windows SDK `10.0.26100.0`, debug build. - **Command (at head `93b8b1d118d6db4b6e134166c0ada511a8950354`):** `cargo build --workspace && cargo test --workspace -- --test-threads=4` - **Result:** **715 passed, 0 failed, 41 ignored** (0 new warnings). - `gpu::recomp::tests::div_f64_translates` — `ok` - `gpu::recomp::tests::gpu_div_f64` — `ok` (executed on RTX 5080 wave32, bit-exact on all 512+ pairs, not skipped) - **SKIPPED (2):** `gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask` (`no wave64`), `gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware` (`no wave64`). **Regression run** Smoke run by @⁠Toons29 in comment below: https://git.gtahub.st/github/xcl-dev--xcl/pulls/823 Contributed by a community tester; the PR author did not run it. Both blocks are pasted as posted. main: ``` xcl-smoke v1 commit: 4178e888c0b5be50a2887eda45cdb832763b68a4 gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1618 (PresentX 1618) presents per 2 s (last 3): 61 60 60 device removals: 0 crashes: 0 peak commit: 14831 MB ``` PR: ``` xcl-smoke v1 commit: 66d892164d14eb091f175c2763574d02e348fd2e gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1614 (PresentX 1614) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14815 MB ``` Tester's setup and limits: AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, `cargo build --release -p xcl`, 60 s, `XCL_NETWORK=0`. This is a regression check only: it does not show whether the run reaches the code this PR changes. Tester's AI use: Claude Code (Claude Opus 5.5) built both trees and ran `scripts/smoke.ps1`; the tester checked the blocks before posting. **Not tested** - By the author: AMD/wave64 hardware, and release build. - Whether the community regression run above reaches the code this PR changes. **AI use** - Claude Opus 5.5 (via Claude Duet / Claude Code) wrote the `v_div_scale_f64` / `v_div_fmas_f64` / `v_div_fixup_f64` translation, `div_d` / `div_fixup_d` helpers, and tests. - Antigravity (Gemini 4 Neon & Gemini 4 Hydrogen) audited the patch, fixed HLSL declaration order (moving `div_d` / `div_fixup_d` below `ldexp_d` after catching a DXC compile error on Windows), ran the full Windows RTX 5080 MSVC + D3D12 debug-layer workspace suite, and drafted this PR description. - Claude Code (Claude Sonnet 5.5) added the community regression run to this description and updated the lines that it made out of date or that the PR check requires.
v_div_scale_f64, v_div_fmas_f64 and v_div_fixup_f64 were reported
unsupported, so any shader with a double division (LLVM always emits
the scale / rcp / Newton / fmas / fixup sequence for fdiv double) was
not translated.

They follow v_div_scale_f32: v_div_scale_f64 returns src0 unscaled
and writes VCC = 0, so v_div_fmas_f64 is a plain fma. Unscaled, the
sequence is exact only while n, d and the quotient stay well inside
the normal range, so v_div_fixup_f64 takes over where the hardware's
scaling matters:

- the IEEE special cases of n / d (NaN, 0/0, inf/inf, x/0, 0/x, ...)
- n below 2^-968, d outside [2^-1020, 2^1020), q outside
  [2^-1020, 2^1023) or not finite: div_d, which divides the mantissas
  (`precise`), scales back with ldexp_d and rounds a denormal quotient
  once, from the 53-bit quotient and the sign of its exact remainder
- otherwise q, with the sign of n / d

The scheme (the unscaled sequence plus this fixup) was checked
bit for bit against IEEE division on 1.5M pairs off-tree, weighted to
the exponent edges, including denormal operands and quotients.

Tests: div_f64_translates checks the sequence translates (and compiles
with DXC when present); gpu_div_f64 runs it in each wave size in
gpu_waves() on fixed edge cases, every special case and random pairs
from rand_f64, against the CPU bit for bit. Not built or run on
Windows; the HLSL was not compiled with DXC here.

Assisted-by: Claude Code (Claude Opus 5.5)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:33:45 +00:00
Author
Owner

@⁠SlopTart on GitHub · 2026-11-24 06:41 UTC · original

2|
3|AMD/wave64 + release-build datapoint - and the bit-exactness does NOT hold here: your gpu_div_f64 fails on RDNA3, deterministically, and only in the wave64 form.
4|
5|Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Wine = Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust 1.100.0 cross x86_64-pc-windows-gnu, release profile, XCL_NETWORK=0, native wave64. Same rig as my Linux rows in #42 / #718.
6|
7|Merged state: head 93b8b1d (fast-forward onto beaa245), clean.
8|
9|Full suite, cargo test --workspace --release --no-fail-fast -- --test-threads=4: 704 passed, 11 failed, 41 ignored (17 suites). 10 are this rig's known set (7 stable Wine-lane, my #42 row, + the #718 trio). The 11th is yours:
10|
11|- gpu::recomp::tests::gpu_div_f64 - FAIL, deterministic: 3 of 3 isolated reruns + the full suite, identical pair set. The wave32 form passes; the wave64 form is off by exactly 1 ulp on 19 of the checked pairs. Every mismatch sits where your fixup falls back to div_d (extreme exponents / denormal territory), including the clean case 1.7976931348623157e308 / 1.7976931348623157e308 = 0.9999999999999999 (0x3fefffffffffffff), want 1e0. Sample of the set:
12| - -3.3895232148356776e228 / 1.7976931348623157e308 = ...2fc9, want ...2fca
13| - 1.005e2 / 1.7976931348623157e308 = 0x0059200000000000, want 0x0059200000000001
14| - 2.225073858507201e-308 / -1.644453431147607e-308 = ...947f, want ...947e
15|- div_f64_translates (HLSL/DXC check) passes.
16|- Note this rig's f64 lane already has known failures (gpu_f64_math_random etc., my #42 row) - but those are different ops and a different pattern; your wave32 form passing while wave64 fails 1-ulp points at the wave64 path or the div_d fallback under this DXC/radv pipeline, not at general f64 brokenness.
17|
18|Not tested: retail titles (none here), Windows, RDNA4, debug build.
19|Counts only, no game data.
20|AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.

**@⁠SlopTart** on GitHub · 2026-11-24 06:41 UTC · [original](https://github.com/xcl-dev/xcl/pull/823#issuecomment-7124192812) 2| 3|AMD/wave64 + release-build datapoint - and the bit-exactness does NOT hold here: your `gpu_div_f64` fails on RDNA3, deterministically, and only in the wave64 form. 4| 5|**Machine:** RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Wine = Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust 1.100.0 cross `x86_64-pc-windows-gnu`, **release** profile, `XCL_NETWORK=0`, native wave64. Same rig as my Linux rows in #42 / #718. 6| 7|**Merged state:** head `93b8b1d` (fast-forward onto `beaa245`), clean. 8| 9|**Full suite, `cargo test --workspace --release --no-fail-fast -- --test-threads=4`:** **704 passed, 11 failed, 41 ignored** (17 suites). 10 are this rig's known set (7 stable Wine-lane, my #42 row, + the #718 trio). The 11th is yours: 10| 11|- `gpu::recomp::tests::gpu_div_f64` - **FAIL, deterministic**: 3 of 3 isolated reruns + the full suite, identical pair set. The **wave32 form passes; the wave64 form is off by exactly 1 ulp on 19 of the checked pairs**. Every mismatch sits where your fixup falls back to `div_d` (extreme exponents / denormal territory), including the clean case `1.7976931348623157e308 / 1.7976931348623157e308 = 0.9999999999999999 (0x3fefffffffffffff), want 1e0`. Sample of the set: 12| - `-3.3895232148356776e228 / 1.7976931348623157e308 = ...2fc9, want ...2fca` 13| - `1.005e2 / 1.7976931348623157e308 = 0x0059200000000000, want 0x0059200000000001` 14| - `2.225073858507201e-308 / -1.644453431147607e-308 = ...947f, want ...947e` 15|- `div_f64_translates` (HLSL/DXC check) passes. 16|- Note this rig's f64 lane already has known failures (`gpu_f64_math_random` etc., my #42 row) - but those are different ops and a different pattern; your wave32 form passing while wave64 fails 1-ulp points at the wave64 path or the `div_d` fallback under this DXC/radv pipeline, not at general f64 brokenness. 17| 18|**Not tested:** retail titles (none here), Windows, RDNA4, debug build. 19|Counts only, no game data. 20|AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.
Author
Owner

@⁠dcastell1 on GitHub · 2026-11-24 06:55 UTC · original

Verified on Windows 11 10.0.26300, NVIDIA GeForce RTX 5090 (driver 621.24), Rust 1.100.0 MSVC 14.44.35207, debug build, on main@beaa245:

patch -p1 < this PR            # clean, no fuzz
cargo test --workspace -- --test-threads=4
exit 0

All green: the translated f64 division ops builds and runs, the workspace has no new failure against main on this box (737 passed there), and nothing else changes verdict. Restored the tree afterwards; no game data, hardware adapter, no Wine.

AI-assisted (opencode): applied the patch to a built tree, ran the suite, reverted it.

**@⁠dcastell1** on GitHub · 2026-11-24 06:55 UTC · [original](https://github.com/xcl-dev/xcl/pull/823#issuecomment-7124422334) Verified on Windows 11 10.0.26300, NVIDIA GeForce RTX 5090 (driver 621.24), Rust 1.100.0 MSVC 14.44.35207, debug build, on `main@beaa245`: ``` patch -p1 < this PR # clean, no fuzz cargo test --workspace -- --test-threads=4 exit 0 ``` All green: the translated f64 division ops builds and runs, the workspace has no new failure against `main` on this box (737 passed there), and nothing else changes verdict. Restored the tree afterwards; no game data, hardware adapter, no Wine. AI-assisted (opencode): applied the patch to a built tree, ran the suite, reverted it.
Author
Owner

@⁠mastrr9 on GitHub · 2026-11-24 07:06 UTC · original

Huge catch — thank you for running this on RDNA3 wave64!

Root cause: In div_d, precise double r = mn / md; assumed the driver's double division is IEEE correctly rounded (as on NVIDIA), whereas RADV wave64 lowers double division via approximate reciprocal (~1 ULP low, e.g. mn == md returning 0x3fefffffffffffff instead of 1.0).

Fix (squashed into fb5ca84a252484bda54daf65f39a825f11978be2):

  • Added one FMA refinement step r = fma(rem, 1.0 / md, r); rem = fma(-md, r, mn); followed by an exact 1-ULP IEEE round-to-nearest-even adjustment comparing rem against the exact power-of-two half-ULP bound md * (0.5 * ulp(r)), updating rem = fma(-md, r, mn) if adjusted (so the denormal rounding step below also sees the exact remainder).
  • Verified off-tree on 20,000 normalized pairs (including f64::MAX / f64::MAX) with simulated ±4 ULP corrupted hardware mn / md and ±2 ULP corrupted 1.0 / md — 0 mismatches.

Re-tested on native Windows 11 + NVIDIA RTX 5080 (fb5ca84a252484bda54daf65f39a825f11978be2, driver 617.42, rustc 1.100.0): cargo build --workspace clean, cargo test --workspace -- --test-threads=4: 715 passed, 0 failed, 41 ignored (SKIPPED: only the 2 no wave64 tests). If you get a chance to re-run gpu_div_f64 on your RX 7900 XT, I'd love to know if wave64 is bit-exact now!

(Assisted-by: Antigravity / Gemini 4 Neon + Claude Sonnet 5.5)

**@⁠mastrr9** on GitHub · 2026-11-24 07:06 UTC · [original](https://github.com/xcl-dev/xcl/pull/823#issuecomment-7124618583) Huge catch — thank you for running this on RDNA3 wave64! **Root cause:** In `div_d`, `precise double r = mn / md;` assumed the driver's double division is IEEE correctly rounded (as on NVIDIA), whereas RADV wave64 lowers `double` division via approximate reciprocal (~1 ULP low, e.g. `mn == md` returning `0x3fefffffffffffff` instead of `1.0`). **Fix (squashed into `fb5ca84a252484bda54daf65f39a825f11978be2`):** - Added one FMA refinement step `r = fma(rem, 1.0 / md, r); rem = fma(-md, r, mn);` followed by an exact 1-ULP IEEE round-to-nearest-even adjustment comparing `rem` against the exact power-of-two half-ULP bound `md * (0.5 * ulp(r))`, updating `rem = fma(-md, r, mn)` if adjusted (so the denormal rounding step below also sees the exact remainder). - Verified off-tree on 20,000 normalized pairs (including `f64::MAX / f64::MAX`) with simulated `±4 ULP` corrupted hardware `mn / md` and `±2 ULP` corrupted `1.0 / md` — 0 mismatches. **Re-tested on native Windows 11 + NVIDIA RTX 5080** (`fb5ca84a252484bda54daf65f39a825f11978be2`, driver `617.42`, `rustc 1.100.0`): `cargo build --workspace` clean, `cargo test --workspace -- --test-threads=4`: **715 passed, 0 failed, 41 ignored** (`SKIPPED`: only the 2 `no wave64` tests). If you get a chance to re-run `gpu_div_f64` on your RX 7900 XT, I'd love to know if wave64 is bit-exact now! *(Assisted-by: Antigravity / Gemini 4 Neon + Claude Sonnet 5.5)*
Author
Owner

@⁠SlopTart on GitHub · 2026-11-24 08:10 UTC · original

Re-ran on the RX 7900 XT at fb5ca84 (merged onto main 1ec4c98 for the run): the fix works for the normal range but gpu_div_f64 still fails here - wave64 leg only, and the residue is purely denormal.

  • Before: 19 mismatched pairs, including the extreme-exponent normals (f64::MAX / f64::MAX -> 0x3fefffffffffffff). All gone - MAX/MAX and the normal-range pairs are bit-exact now.
  • After: 8 mismatched pairs, every one involving a denormal operand or denormal-scale result, each 1 ULP off. Smallest sample: 5e-324 / -6.591622639274444e-308. The wave32 leg passes clean, as before.

Sample (full list of 8 is in the test output):

5e-324 / -6.591622639274444e-308 = -7.495356953498624e-17 (0xbc959a98e5eeb869), want ...68
1.370471379494811e-308 / -1.3820494452201154e-308 = -9.916225387120936e-1 (0xbfefbb5f30b7d684), want ...83

Reading from your fix note: the FMA refinement + RNE adjustment lands r exactly for normals, but the denormal rounding step still computes through the approximate reciprocal path - same root cause one layer down. The rem you feed into it is exact now, so the fixup may only need the subnormal scale handled without re-touching 1.0 / md.

Determinism: same 8 pairs on reruns (isolated, release, --test-threads default). Happy to re-verify any follow-up.

Counts only, no game data.

Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross x86_64-pc-windows-gnu, XCL_NETWORK=0, release profile. My Linux rows: #42 / #718.

AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.

**@⁠SlopTart** on GitHub · 2026-11-24 08:10 UTC · [original](https://github.com/xcl-dev/xcl/pull/823#issuecomment-7125804633) Re-ran on the RX 7900 XT at `fb5ca84` (merged onto main `1ec4c98` for the run): the fix **works for the normal range but `gpu_div_f64` still fails here - wave64 leg only, and the residue is purely denormal.** - Before: 19 mismatched pairs, including the extreme-exponent normals (`f64::MAX / f64::MAX` -> `0x3fefffffffffffff`). **All gone** - MAX/MAX and the normal-range pairs are bit-exact now. - After: **8 mismatched pairs, every one involving a denormal operand or denormal-scale result**, each 1 ULP off. Smallest sample: `5e-324 / -6.591622639274444e-308`. The wave32 leg passes clean, as before. Sample (full list of 8 is in the test output): ``` 5e-324 / -6.591622639274444e-308 = -7.495356953498624e-17 (0xbc959a98e5eeb869), want ...68 1.370471379494811e-308 / -1.3820494452201154e-308 = -9.916225387120936e-1 (0xbfefbb5f30b7d684), want ...83 ``` Reading from your fix note: the FMA refinement + RNE adjustment lands `r` exactly for normals, but the denormal rounding step still computes through the approximate reciprocal path - same root cause one layer down. The `rem` you feed into it is exact now, so the fixup may only need the subnormal scale handled without re-touching `1.0 / md`. Determinism: same 8 pairs on reruns (isolated, release, `--test-threads` default). Happy to re-verify any follow-up. Counts only, no game data. **Machine:** RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross `x86_64-pc-windows-gnu`, `XCL_NETWORK=0`, release profile. My Linux rows: #42 / #718. AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.
Author
Owner

@⁠KENAJBBY on GitHub · 2026-11-24 09:32 UTC · original

Native wave64 run on RDNA2 under the Windows AMD driver, at 66d892164d14eb091f175c2763574d02e348fd2e (its base beaa245; it also merges cleanly with main 077ce40): gpu_div_f64 passes, both the wave64 and the wave32 pass, every pair bit-exact. This head has the same code as fb5ca84, which failed on 8 denormal pairs on the RX 7900 XT under RADV in the comment above. The test's pairs are fixed (seeded RNG), so this run checked the same pairs.

Tested

  • AMD Radeon iGPU of a Ryzen 7 9800X3D (RDNA2 gfx1036, native 64-lane waves, mesh shaders), driver 32.0.21030.2001; NVIDIA GeForce RTX 5070 Ti, driver 621.24 (32-lane waves only); Windows 11 Pro 26200; Rust 1.100.0 stable-x86_64-pc-windows-msvc, debug; DXC 1.9.2602.17
  • XCL_ADAPTER=radeon XCL_REQUIRE_GPU=wave64,mesh cargo test --workspace --no-fail-fast -- --test-threads=4: 715 passed, 0 failed, 41 ignored, 0 SKIPPED. main beaa245 on the same machine: 713 passed, 0 failed, 41 ignored, 0 SKIPPED. The +2 are div_f64_translates and gpu_div_f64.
  • gpu_div_f64 alone on the Radeon (--exact, XCL_REQUIRE_GPU=wave64,mesh), 3 runs: passed each time.
  • XCL_ADAPTER=nvidia XCL_REQUIRE_GPU=mesh, same command: 712 passed, 3 failed, 41 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware. gpu_div_f64 passes there too (split wave64 + wave32).
  • The 3 NVIDIA failures are the known placed_title_textures_share_vram_and_preserve_pixels (cubemap extra_pages must be reused at same va) plus transitions_apply_when_their_list_is_submitted and d32s8_targets_take_their_own_size_of_video_memory on its PoisonError. They are not from this PR. main 077ce40 fails the same three on this machine on both adapters, and the first Radeon run of this PR did too. Other test runs were using the same GPUs at the time. Alone (cargo test -p xcl --lib -- --test-threads=4 title_textures::tests vram::tests), they pass on this head: 20 passed, 0 failed on the Radeon and on the RTX.

So on this machine the remaining RDNA3 mismatches do not show up, in either wave size. That points at how RADV / vkd3d-proton runs the f64 denormal path rather than at XCL's wave64 form, but I have not checked RADV myself.

Not tested

  • RADV / Linux, RDNA3 / RDNA4, a release build, a retail title (scripts/smoke.ps1); no XCL_SAMPLE_* set

AI use

  • Claude Code (Claude Opus 5.5) ran the builds and tests on this machine and wrote this report from their output.
**@⁠KENAJBBY** on GitHub · 2026-11-24 09:32 UTC · [original](https://github.com/xcl-dev/xcl/pull/823#issuecomment-7127545762) Native wave64 run on RDNA2 under the Windows AMD driver, at `66d892164d14eb091f175c2763574d02e348fd2e` (its base `beaa245`; it also merges cleanly with `main` `077ce40`): **`gpu_div_f64` passes, both the wave64 and the wave32 pass, every pair bit-exact.** This head has the same code as `fb5ca84`, which failed on 8 denormal pairs on the RX 7900 XT under RADV in the comment above. The test's pairs are fixed (seeded RNG), so this run checked the same pairs. **Tested** - AMD Radeon iGPU of a Ryzen 7 9800X3D (RDNA2 `gfx1036`, native 64-lane waves, mesh shaders), driver 32.0.21030.2001; NVIDIA GeForce RTX 5070 Ti, driver 621.24 (32-lane waves only); Windows 11 Pro 26200; Rust 1.100.0 `stable-x86_64-pc-windows-msvc`, debug; DXC 1.9.2602.17 - `XCL_ADAPTER=radeon XCL_REQUIRE_GPU=wave64,mesh cargo test --workspace --no-fail-fast -- --test-threads=4`: **715 passed, 0 failed, 41 ignored, 0 `SKIPPED`**. `main` `beaa245` on the same machine: 713 passed, 0 failed, 41 ignored, 0 `SKIPPED`. The +2 are `div_f64_translates` and `gpu_div_f64`. - `gpu_div_f64` alone on the Radeon (`--exact`, `XCL_REQUIRE_GPU=wave64,mesh`), 3 runs: passed each time. - `XCL_ADAPTER=nvidia XCL_REQUIRE_GPU=mesh`, same command: 712 passed, 3 failed, 41 ignored. `SKIPPED` (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`. `gpu_div_f64` passes there too (split wave64 + wave32). - The 3 NVIDIA failures are the known `placed_title_textures_share_vram_and_preserve_pixels` (`cubemap extra_pages must be reused at same va`) plus `transitions_apply_when_their_list_is_submitted` and `d32s8_targets_take_their_own_size_of_video_memory` on its `PoisonError`. They are not from this PR. `main` `077ce40` fails the same three on this machine on both adapters, and the first Radeon run of this PR did too. Other test runs were using the same GPUs at the time. Alone (`cargo test -p xcl --lib -- --test-threads=4 title_textures::tests vram::tests`), they pass on this head: 20 passed, 0 failed on the Radeon and on the RTX. So on this machine the remaining RDNA3 mismatches do not show up, in either wave size. That points at how RADV / vkd3d-proton runs the f64 denormal path rather than at XCL's wave64 form, but I have not checked RADV myself. **Not tested** - RADV / Linux, RDNA3 / RDNA4, a release build, a retail title (`scripts/smoke.ps1`); no `XCL_SAMPLE_*` set **AI use** - Claude Code (Claude Opus 5.5) ran the builds and tests on this machine and wrote this report from their output.
Author
Owner

@⁠iggyvilla on GitHub · 2026-11-24 13:04 UTC · original

Test report for 66d892164d14eb091f175c2763574d02e348fd2e (current head of #823, base beaa245; not merged with main): the targeted GPU tests on an AMD RDNA2 card. The command was run, and its output captured, by an agent (omp, DeepSeek V4.1 Flash); the text below was checked against the PR head's source and written by Claude Code (Claude Sonnet 5.5).

Tested

  • AMD Radeon RX 6650 XT 8 GB (RDNA2, native wave64), Ryzen 7 5700X, Windows 11; DXC 1.8.2502.11 from Windows SDK 10.0.26100.0; release profile, built in a clean worktree at the head commit.
  • cargo test -p xcl --lib --release -- div_f64:
running 2 tests
test gpu::recomp::tests::div_f64_translates ... ok
test gpu::recomp::tests::gpu_div_f64 ... ok

test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 693 filtered out; finished in 2.93s

No SKIPPED line, so the GPU path ran. gpu_div_f64 loops over gpu_waves(); on a native wave64 adapter that is wave64 and wave32. In each it runs the same 512 pairs (34 fixed edge cases, the rest random) and compares the result bit for bit with n / d, treating NaN as equal to NaN.

What this shows

  • On AMD's D3D12/DXIL path the sequence reproduces IEEE division exactly for all 512 pairs in both wave sizes on this card.
  • It does not replace the RADV (Mesa) wave64 re-run the author asked for: the earlier failure (19 of 512 pairs off by 1 ULP, on a pre-fix head) was on that different backend.

Not tested

  • No full cargo test --workspace; no compare-side e2e.
  • crates/xcl/src/gpu/recomp/emit.rs is runtime code, so the PR still needs the scripts/smoke.ps1 pair (main vs head). This report is GPU test evidence only; no retail title was run.
  • Not merged with current main. The raw test output was not kept as a file; the block above is the agent's capture.

AI use
Claude Code, Claude Sonnet 5.5: checked the report against the PR head's tests.rs and wrote this text; it ran nothing. The build and test run were done by omp with DeepSeek V4.1 Flash, which changed no code.

**@⁠iggyvilla** on GitHub · 2026-11-24 13:04 UTC · [original](https://github.com/xcl-dev/xcl/pull/823#issuecomment-7132313566) Test report for `66d892164d14eb091f175c2763574d02e348fd2e` (current head of #823, base `beaa245`; not merged with `main`): the targeted GPU tests on an AMD RDNA2 card. The command was run, and its output captured, by an agent (omp, DeepSeek V4.1 Flash); the text below was checked against the PR head's source and written by Claude Code (Claude Sonnet 5.5). **Tested** - AMD Radeon RX 6650 XT 8 GB (RDNA2, native wave64), Ryzen 7 5700X, Windows 11; DXC 1.8.2502.11 from Windows SDK 10.0.26100.0; release profile, built in a clean worktree at the head commit. - `cargo test -p xcl --lib --release -- div_f64`: ``` running 2 tests test gpu::recomp::tests::div_f64_translates ... ok test gpu::recomp::tests::gpu_div_f64 ... ok test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 693 filtered out; finished in 2.93s ``` No `SKIPPED` line, so the GPU path ran. `gpu_div_f64` loops over `gpu_waves()`; on a native wave64 adapter that is wave64 and wave32. In each it runs the same 512 pairs (34 fixed edge cases, the rest random) and compares the result bit for bit with `n / d`, treating NaN as equal to NaN. **What this shows** - On AMD's D3D12/DXIL path the sequence reproduces IEEE division exactly for all 512 pairs in both wave sizes on this card. - It does not replace the RADV (Mesa) wave64 re-run the author asked for: the earlier failure (19 of 512 pairs off by 1 ULP, on a pre-fix head) was on that different backend. **Not tested** - No full `cargo test --workspace`; no compare-side e2e. - `crates/xcl/src/gpu/recomp/emit.rs` is runtime code, so the PR still needs the `scripts/smoke.ps1` pair (main vs head). This report is GPU test evidence only; no retail title was run. - Not merged with current `main`. The raw test output was not kept as a file; the block above is the agent's capture. **AI use** Claude Code, Claude Sonnet 5.5: checked the report against the PR head's `tests.rs` and wrote this text; it ran nothing. The build and test run were done by omp with DeepSeek V4.1 Flash, which changed no code.
Author
Owner

@⁠mastrr9 on GitHub · 2026-11-24 14:38 UTC · original

Huge thanks @⁠SlopTart, @⁠KENAJBBY, and @⁠iggyvilla for the thorough cross-GPU data! Confirming bit-exact pass across both wave64 and wave32 on two independent Windows RDNA2 GPUs (gfx1036 and RX 6650 XT) alongside NVIDIA RTX 5080 (with the remaining 8 denormal pairs isolated specifically to RADV's wave64 path) gives a very clear picture.

**@⁠mastrr9** on GitHub · 2026-11-24 14:38 UTC · [original](https://github.com/xcl-dev/xcl/pull/823#issuecomment-7134699788) Huge thanks @⁠SlopTart, @⁠KENAJBBY, and @⁠iggyvilla for the thorough cross-GPU data! Confirming bit-exact pass across both wave64 and wave32 on two independent Windows RDNA2 GPUs (`gfx1036` and RX 6650 XT) alongside NVIDIA RTX 5080 (with the remaining 8 denormal pairs isolated specifically to RADV's wave64 path) gives a very clear picture.
Author
Owner

@⁠Toons29 on GitHub · 2026-11-25 03:02 UTC · original

Regression run of 66d89216 on the retail title, for this PR's Regression run section. Both blocks are from scripts/smoke.ps1 as printed, not edited: main on 4178e888, this PR on its head commit with no uncommitted changes, same title and time.

xcl-smoke v1
commit: 4178e888c0b5be50a2887eda45cdb832763b68a4
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1618 (PresentX 1618)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 14831 MB
xcl-smoke v1
commit: 66d892164d14eb091f175c2763574d02e348fd2e
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1614 (PresentX 1614)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14815 MB

Against the limits in CONTRIBUTING.md: 100 % of main's frames, 100 % of its peak commit, no crash, no device removal.

AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, cargo build --release -p xcl, 60 s, XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.

AI use: Claude Code (Claude Opus 5.5) built both trees and ran scripts/smoke.ps1; I checked the blocks before posting.

**@⁠Toons29** on GitHub · 2026-11-25 03:02 UTC · [original](https://github.com/xcl-dev/xcl/pull/823#issuecomment-7151535852) Regression run of `66d89216` on the retail title, for this PR's **Regression run** section. Both blocks are from `scripts/smoke.ps1` as printed, not edited: `main` on `4178e888`, this PR on its head commit with no uncommitted changes, same title and time. ``` xcl-smoke v1 commit: 4178e888c0b5be50a2887eda45cdb832763b68a4 gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1618 (PresentX 1618) presents per 2 s (last 3): 61 60 60 device removals: 0 crashes: 0 peak commit: 14831 MB ``` ``` xcl-smoke v1 commit: 66d892164d14eb091f175c2763574d02e348fd2e gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1614 (PresentX 1614) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14815 MB ``` Against the limits in CONTRIBUTING.md: 100 % of `main`'s frames, 100 % of its peak commit, no crash, no device removal. AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, `cargo build --release -p xcl`, 60 s, `XCL_NETWORK=0`. This is a regression check only: it does not show whether the run reaches the code this PR changes. AI use: Claude Code (Claude Opus 5.5) built both trees and ran `scripts/smoke.ps1`; I checked the blocks before posting.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 10:38 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 10:38 UTC · [original](https://github.com/xcl-dev/xcl/pull/823#issuecomment-7159976444) 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!
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/823/head:github-bot/gh-823'
git switch 'github-bot/gh-823'

Merge

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