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

Open
mastrr9 wants to merge 1 commit from upstream-pr/823 into main
mastrr9 commented 2026-11-24 06:07:54 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by mastrr9 on 2026-11-24T06:07:54Z.


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://github.com/xcl-dev/xcl/pull/823#issuecomment-7151535852
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.
<!-- greyfinch-sync:ivall/xcl:issue:5467062119 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/823). Originally posted by [mastrr9](https://github.com/mastrr9) on 2026-11-24T06:07:54Z. --- `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://github.com/xcl-dev/xcl/pull/823#issuecomment-7151535852 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.
SlopTart commented 2026-11-24 07:06:50 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-24T06:41:30Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7124192812 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/823#issuecomment-7124192812). Originally posted by [SlopTart](https://github.com/SlopTart) on 2026-11-24T06:41:30Z. --- 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.
dcastell1 commented 2026-11-24 07:06:54 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by dcastell1 on 2026-11-24T06:55:00Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7124422334 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/823#issuecomment-7124422334). Originally posted by [dcastell1](https://github.com/dcastell1) on 2026-11-24T06:55:00Z. --- 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.
mastrr9 commented 2026-11-24 07:06:57 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by mastrr9 on 2026-11-24T07:06:12Z.


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)

<!-- greyfinch-sync:ivall/xcl:comment:7124618583 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/823#issuecomment-7124618583). Originally posted by [mastrr9](https://github.com/mastrr9) on 2026-11-24T07:06:12Z. --- 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)*
SlopTart commented 2026-11-24 09:07:02 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-24T08:10:01Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7125804633 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/823#issuecomment-7125804633). Originally posted by [SlopTart](https://github.com/SlopTart) on 2026-11-24T08:10:01Z. --- 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.
KENAJBBY commented 2026-11-24 10:04:44 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KENAJBBY on 2026-11-24T09:32:04Z.


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.
<!-- greyfinch-sync:ivall/xcl:comment:7127545762 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/823#issuecomment-7127545762). Originally posted by [KENAJBBY](https://github.com/KENAJBBY) on 2026-11-24T09:32:04Z. --- 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.
iggyvilla commented 2026-11-24 14:06:26 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by iggyvilla on 2026-11-24T13:04:33Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7132313566 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/823#issuecomment-7132313566). Originally posted by [iggyvilla](https://github.com/iggyvilla) on 2026-11-24T13:04:33Z. --- 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.
mastrr9 commented 2026-11-24 15:06:00 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by mastrr9 on 2026-11-24T14:38:12Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7134699788 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/823#issuecomment-7134699788). Originally posted by [mastrr9](https://github.com/mastrr9) on 2026-11-24T14:38:12Z. --- 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.
Toons29 commented 2026-11-25 03:05:59 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Toons29 on 2026-11-25T03:02:47Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7151535852 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/823#issuecomment-7151535852). Originally posted by [Toons29](https://github.com/Toons29) on 2026-11-25T03:02:47Z. --- 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.
DavidM1911 commented 2026-11-25 11:09:14 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T10:38:38Z.


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!

<!-- greyfinch-sync:ivall/xcl:comment:7159976444 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/823#issuecomment-7159976444). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T10:38:38Z. --- 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!
github-actions[bot] commented 2026-11-29 20:41:06 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-29T20:41:06Z.


Nothing has happened on this PR for 3 days, so it is marked stale and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto main if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.

<!-- greyfinch-sync:ivall/xcl:comment:7262276211 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/823#issuecomment-7262276211). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-29T20:41:06Z. --- Nothing has happened on this PR for 3 days, so it is marked `stale` and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto `main` if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.
saintwolf commented 2026-11-30 17:08:03 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by saintwolf on 2026-11-30T17:08:03Z.


merge-check claim
head: 66d892164d

<!-- greyfinch-sync:ivall/xcl:comment:7285770924 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/823#issuecomment-7285770924). Originally posted by [saintwolf](https://github.com/saintwolf) on 2026-11-30T17:08:03Z. --- merge-check claim head: 66d892164d14eb091f175c2763574d02e348fd2e
saintwolf commented 2026-11-30 17:13:35 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by saintwolf on 2026-11-30T17:13:35Z.


merge-check
base: 9dfbe3ea66
head: 66d892164d
merge: clean (trial merge 265f4e19a799b716fdd6d3cb251c123cc7502d86; git diff --check clean; +145/-0 in crates/xcl/src/gpu/recomp/emit.rs and tests.rs)
build: cargo build --workspace -> ok (pre-existing warnings only, none from the PR's lines)
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2886 passed, 2 failed, 51 ignored; SKIPPED: 27, the standard set for this card (22 "no wave64" — wave32-only GPU, 2 "no heap windows", 1 "cannot disable the driver cache (Developer Mode)", 2 "no xgameruntime.dll"). Failing: (1) gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16 — pre-existing on this machine, identical on base 9dfbe3ea; (2) the new gpu_div_f64 in the default environment: kernel tests run on the direct-DXIL backend when XCL_DIRECT_DXIL is unset, and the direct backend still has no f64 division (v_div_scale_f64 hits the "VALU 64-bit" catch-all at dxil/lower_wide.rs:1032). I reproduced the identical panic on a clean base worktree with only the test file applied, so this is not a regression — this PR touches only the HLSL recompiler, and the game compute path falls back to it when the direct backend cannot translate a program (direct_fallback, recomp/pso.rs:1280). On the HLSL path the PR actually changes (XCL_DIRECT_DXIL=0) I confirmed first-hand: both new tests fail on base and pass with the change, and gpu_div_f64 is bit-exact against CPU IEEE division for all 512 pairs on this card.
review: read the whole diff and the surrounding code. The three new ops mirror the existing f32 division handling (v_div_scale_f32 at emit.rs:4268, v_div_fmas_f32 / v_div_fixup_f32 at 4181–4182): v_div_scale_f64 is the identity with VCC 0, v_div_fmas_f64 is a plain fma of the already-scaled reciprocal sequence, v_div_fixup_f64 is the IEEE special-case table. I hand-verified div_d against IEEE RNE: the ULP constants (2^-52 / 2^-53), the exact half-ULP tie bounds (the power-of-two scaling is exact), the subnormal sticky/round path including the t = 2^53 carry rolling into the min-normal encoding, and the fixup table (NaN priority, 0/0, ±0 / ±inf). The GPU test drives a genuine Newton reciprocal sequence (constant 242 = 1.0 verified) and checks 34 hand-picked edge pairs plus 478 seeded random pairs bit-for-bit. Thread: dcastell1's RTX 5090 full suite clean; SlopTart's RX 7900 XT (RADV wave64) found a deterministic 1-ULP failure on 19 pairs, root-caused by the author to RADV's approximate-reciprocal double division and fixed in-tree (fb5ca84: one FMA refinement step plus an exact 1-ULP RNE adjustment, verified off-tree against ±4-ULP / ±2-ULP corrupted-division simulation, 0 mismatches on 20k pairs); SlopTart's re-run confirmed the 19 are gone with 8 denormal pairs remaining, isolated to RADV's f64 denormal path; at the current head, iggyvilla (gfx1036 RDNA2 wave64 iGPU, 715/0/41) and KENAJBBY (RX 6650 XT, release) both bit-exact in both wave sizes, and the author's xcl-smoke main-vs-head pair on an RX 9070 is 100% of main's frames and peak commit with no crashes or device removals. No duplicates; sibling #3312 (f32 div_fixup fallbacks) touches the same file but is a different concern — only a rebase-ordering note. Pure additions, no unsafe, no new dependencies, no stop-criteria files.
performance: none; the division sequence is the same shape as the f32 one it mirrors.
verdict: safe to merge
hardware / tool and model: RTX 4070 SUPER (driver 32.0.16.2140), Ryzen 7 7800X3D, Windows 11 build 26300, Rust 1.100.0 / OpenCode, Qwen 3.8 27B

<!-- greyfinch-sync:ivall/xcl:comment:7285920478 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/823#issuecomment-7285920478). Originally posted by [saintwolf](https://github.com/saintwolf) on 2026-11-30T17:13:35Z. --- merge-check base: 9dfbe3ea6653a9c76ef3ea0d66187a4b5407483b head: 66d892164d14eb091f175c2763574d02e348fd2e merge: clean (trial merge 265f4e19a799b716fdd6d3cb251c123cc7502d86; git diff --check clean; +145/-0 in crates/xcl/src/gpu/recomp/emit.rs and tests.rs) build: cargo build --workspace -> ok (pre-existing warnings only, none from the PR's lines) tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2886 passed, 2 failed, 51 ignored; SKIPPED: 27, the standard set for this card (22 "no wave64" — wave32-only GPU, 2 "no heap windows", 1 "cannot disable the driver cache (Developer Mode)", 2 "no xgameruntime.dll"). Failing: (1) gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16 — pre-existing on this machine, identical on base 9dfbe3ea; (2) the new gpu_div_f64 in the default environment: kernel tests run on the direct-DXIL backend when XCL_DIRECT_DXIL is unset, and the direct backend still has no f64 division (v_div_scale_f64 hits the "VALU 64-bit" catch-all at dxil/lower_wide.rs:1032). I reproduced the identical panic on a clean base worktree with only the test file applied, so this is not a regression — this PR touches only the HLSL recompiler, and the game compute path falls back to it when the direct backend cannot translate a program (direct_fallback, recomp/pso.rs:1280). On the HLSL path the PR actually changes (XCL_DIRECT_DXIL=0) I confirmed first-hand: both new tests fail on base and pass with the change, and gpu_div_f64 is bit-exact against CPU IEEE division for all 512 pairs on this card. review: read the whole diff and the surrounding code. The three new ops mirror the existing f32 division handling (v_div_scale_f32 at emit.rs:4268, v_div_fmas_f32 / v_div_fixup_f32 at 4181–4182): v_div_scale_f64 is the identity with VCC 0, v_div_fmas_f64 is a plain fma of the already-scaled reciprocal sequence, v_div_fixup_f64 is the IEEE special-case table. I hand-verified div_d against IEEE RNE: the ULP constants (2^-52 / 2^-53), the exact half-ULP tie bounds (the power-of-two scaling is exact), the subnormal sticky/round path including the t = 2^53 carry rolling into the min-normal encoding, and the fixup table (NaN priority, 0/0, ±0 / ±inf). The GPU test drives a genuine Newton reciprocal sequence (constant 242 = 1.0 verified) and checks 34 hand-picked edge pairs plus 478 seeded random pairs bit-for-bit. Thread: dcastell1's RTX 5090 full suite clean; SlopTart's RX 7900 XT (RADV wave64) found a deterministic 1-ULP failure on 19 pairs, root-caused by the author to RADV's approximate-reciprocal double division and fixed in-tree (fb5ca84: one FMA refinement step plus an exact 1-ULP RNE adjustment, verified off-tree against ±4-ULP / ±2-ULP corrupted-division simulation, 0 mismatches on 20k pairs); SlopTart's re-run confirmed the 19 are gone with 8 denormal pairs remaining, isolated to RADV's f64 denormal path; at the current head, iggyvilla (gfx1036 RDNA2 wave64 iGPU, 715/0/41) and KENAJBBY (RX 6650 XT, release) both bit-exact in both wave sizes, and the author's xcl-smoke main-vs-head pair on an RX 9070 is 100% of main's frames and peak commit with no crashes or device removals. No duplicates; sibling #3312 (f32 div_fixup fallbacks) touches the same file but is a different concern — only a rebase-ordering note. Pure additions, no unsafe, no new dependencies, no stop-criteria files. performance: none; the division sequence is the same shape as the f32 one it mirrors. verdict: safe to merge hardware / tool and model: RTX 4070 SUPER (driver 32.0.16.2140), Ryzen 7 7800X3D, Windows 11 build 26300, Rust 1.100.0 / OpenCode, Qwen 3.8 27B
brainhay5 commented 2026-11-30 17:21:52 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by brainhay5 on 2026-11-30T17:21:52Z.


merge-check claim
head: 66d892164d

<!-- greyfinch-sync:ivall/xcl:comment:7286153993 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/823#issuecomment-7286153993). Originally posted by [brainhay5](https://github.com/brainhay5) on 2026-11-30T17:21:52Z. --- merge-check claim head: 66d892164d14eb091f175c2763574d02e348fd2e
brainhay5 commented 2026-11-30 20:29:05 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by brainhay5 on 2026-11-30T20:29:05Z.


merge-check
base: 9dfbe3ea66
head: 66d892164d
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2885 passed, 3 failed, 51 ignored; 29 SKIPPED lines; failing: gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16 (fails on base too), test_title_runs_and_game_folder_is_untouched (fails on base too), gpu::recomp::tests::gpu_div_f64 (does not exist on base — this PR adds it, and it fails)
review: automated check: diff inspected for safety only (no build/CI/toolchain/script changes, no process/network/runtime-loading code); no line-by-line review and no duplicate search performed.
performance: not assessed beyond the suite.
verdict: not yet: adds failing test(s): gpu::recomp::tests::gpu_div_f64
hardware / tool and model: RTX 5070 Ti 16 GB, driver 610.88 (32.0.16.1088); Ryzen 7 5800X3D, 64 GB; Windows 11 22631; OpenCode agent, DeepSeek V4.1 Flash 1017

<!-- greyfinch-sync:ivall/xcl:comment:7290993448 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/823#issuecomment-7290993448). Originally posted by [brainhay5](https://github.com/brainhay5) on 2026-11-30T20:29:05Z. --- merge-check base: 9dfbe3ea6653a9c76ef3ea0d66187a4b5407483b head: 66d892164d14eb091f175c2763574d02e348fd2e merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2885 passed, 3 failed, 51 ignored; 29 SKIPPED lines; failing: gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16 (fails on base too), test_title_runs_and_game_folder_is_untouched (fails on base too), gpu::recomp::tests::gpu_div_f64 (does not exist on base — this PR adds it, and it fails) review: automated check: diff inspected for safety only (no build/CI/toolchain/script changes, no process/network/runtime-loading code); no line-by-line review and no duplicate search performed. performance: not assessed beyond the suite. verdict: not yet: adds failing test(s): gpu::recomp::tests::gpu_div_f64 hardware / tool and model: RTX 5070 Ti 16 GB, driver 610.88 (32.0.16.1088); Ryzen 7 5800X3D, 64 GB; Windows 11 22631; OpenCode agent, DeepSeek V4.1 Flash 1017
Chrysana commented 2026-12-01 00:13:53 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Chrysana on 2026-12-01T00:13:53Z.


merge-check
base: d0832e614f
head: 66d892164d
merge: clean (git diff --check clean)
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2883 passed, 10 failed, 51 ignored (base: 2882 passed, 9 failed, 51 ignored); SKIPPED: 6, the same as on base (2 no heap windows, 1 cannot disable the driver cache without Developer Mode, 3 no D3D12 debug layer). This card runs wave64, so the wave64 halves of the GPU tests run here too. failing: the same 8 tests as on base (fuzz_validate_and_gpu_1, fuzz_validate_and_gpu_3, gpu_smem_flat_descriptor_windows_and_limits, f32_programs_on_the_gpu, gpu_f32_compares_with_nan, gpu_float_compares_random, gpu_ps_readfirstlane_loop_on_a_primitive_edge_ends, two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs, counted twice), plus this PR's new gpu_div_f64, which fails before it reaches the GPU: "v_div_scale_f64 v[4:5], vcc, v[2:3], v[2:3], v[0:1]: VALU 64-bit". Run alone with XCL_DIRECT_DXIL=0, gpu_div_f64 passes in wave32 and wave64: all 512 pairs bit-exact against the CPU, denormal and special cases included. div_f64_translates passes.
review: I read the whole diff. The HLSL side looks right to me. v_div_scale_f64 passes src0 through with VCC = 0, v_div_fmas_f64 is a plain fma (which is right with VCC = 0), and div_fixup_d falls back to the exact div_d wherever the skipped scaling would matter. And it holds bit for bit on RDNA 4. The test fails because the direct-DXIL translator has no v_div_scale_f64 / v_div_fmas_f64 / v_div_fixup_f64 (gpu/dxil/lower_wide.rs:1032, "VALU 64-bit"), and the GPU test runner doesn't fall back to HLSL. In a title, a shader the direct path rejects falls back to the HLSL path, so this code would be used there. But as it stands the PR puts a failing test into the suite on every GPU.
performance: only shaders that use these ops change, and they currently can't be translated at all; div_d / div_fixup_d are long, but they run only for f64 division. Not measured (Tier 1, no title run).
verdict: not yet: gpu_div_f64 fails on the default path (no direct-DXIL lowering of the three ops, lower_wide.rs:1032); either add it or have the test run the HLSL path. The HLSL fix itself is bit-exact on AMD RDNA 4 in wave32 and wave64
hardware / tool and model: AMD Radeon RX 9070 XT 16 GB (RDNA 4, driver 32.0.32015.2008), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11 25H2 build 26200.9974, rustc 1.100.1 / Claude Code (Claude Opus 5.5)

<!-- greyfinch-sync:ivall/xcl:comment:7296087001 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/823#issuecomment-7296087001). Originally posted by [Chrysana](https://github.com/Chrysana) on 2026-12-01T00:13:53Z. --- merge-check base: d0832e614fa7d6ae027bb4feb27ccb9121f54a8f head: 66d892164d14eb091f175c2763574d02e348fd2e merge: clean (git diff --check clean) build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2883 passed, 10 failed, 51 ignored (base: 2882 passed, 9 failed, 51 ignored); SKIPPED: 6, the same as on base (2 no heap windows, 1 cannot disable the driver cache without Developer Mode, 3 no D3D12 debug layer). This card runs wave64, so the wave64 halves of the GPU tests run here too. failing: the same 8 tests as on base (fuzz_validate_and_gpu_1, fuzz_validate_and_gpu_3, gpu_smem_flat_descriptor_windows_and_limits, f32_programs_on_the_gpu, gpu_f32_compares_with_nan, gpu_float_compares_random, gpu_ps_readfirstlane_loop_on_a_primitive_edge_ends, two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs, counted twice), plus this PR's new gpu_div_f64, which fails before it reaches the GPU: `"v_div_scale_f64 v[4:5], vcc, v[2:3], v[2:3], v[0:1]: VALU 64-bit"`. Run alone with XCL_DIRECT_DXIL=0, gpu_div_f64 passes in wave32 and wave64: all 512 pairs bit-exact against the CPU, denormal and special cases included. div_f64_translates passes. review: I read the whole diff. The HLSL side looks right to me. v_div_scale_f64 passes src0 through with VCC = 0, v_div_fmas_f64 is a plain fma (which is right with VCC = 0), and div_fixup_d falls back to the exact div_d wherever the skipped scaling would matter. And it holds bit for bit on RDNA 4. The test fails because the direct-DXIL translator has no v_div_scale_f64 / v_div_fmas_f64 / v_div_fixup_f64 (gpu/dxil/lower_wide.rs:1032, "VALU 64-bit"), and the GPU test runner doesn't fall back to HLSL. In a title, a shader the direct path rejects falls back to the HLSL path, so this code would be used there. But as it stands the PR puts a failing test into the suite on every GPU. performance: only shaders that use these ops change, and they currently can't be translated at all; div_d / div_fixup_d are long, but they run only for f64 division. Not measured (Tier 1, no title run). verdict: not yet: gpu_div_f64 fails on the default path (no direct-DXIL lowering of the three ops, lower_wide.rs:1032); either add it or have the test run the HLSL path. The HLSL fix itself is bit-exact on AMD RDNA 4 in wave32 and wave64 hardware / tool and model: AMD Radeon RX 9070 XT 16 GB (RDNA 4, driver 32.0.32015.2008), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11 25H2 build 26200.9974, rustc 1.100.1 / Claude Code (Claude Opus 5.5)
Foniass commented 2026-12-01 04:12:45 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T04:12:45Z.


Triage (#1607) – head 66d8921

No open or merged PR translates v_div_scale_f64 / v_div_fmas_f64 / v_div_fixup_f64. Main handles only the f32/f16 forms, and #1144, #3023 and #3312 cover f32 div_fmas/div_fixup only. The approach mirrors the existing f32 path (no pre-scaling, VCC 0), with div_d as the exact fallback where scaling would matter, and the GPU test checks every result bit-exact against the CPU division.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7300494483 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/823#issuecomment-7300494483). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T04:12:45Z. --- **Triage (#1607)** – head 66d8921 No open or merged PR translates `v_div_scale_f64` / `v_div_fmas_f64` / `v_div_fixup_f64`. Main handles only the f32/f16 forms, and #1144, #3023 and #3312 cover f32 div_fmas/div_fixup only. The approach mirrors the existing f32 path (no pre-scaling, VCC 0), with `div_d` as the exact fallback where scaling would matter, and the GPU test checks every result bit-exact against the CPU division. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/823:upstream-pr/823'
git switch 'upstream-pr/823'

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.

git switch 'main'
git merge --no-ff 'upstream-pr/823'
git switch 'upstream-pr/823'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/823'
git switch 'upstream-pr/823'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/823'
git switch 'main'
git merge --squash 'upstream-pr/823'
git switch 'main'
git merge --ff-only 'upstream-pr/823'
git switch 'main'
git merge 'upstream-pr/823'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!817
No description provided.