Recompiler: translate v_trig_preop_f64 in both backends #2305

Open
NWProgramming00 wants to merge 1 commit from upstream-pr/2315 into main
NWProgramming00 commented 2026-11-25 13:39:47 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by NWProgramming00 on 2026-11-25T13:39:47Z.


Both backends refused v_trig_preop_f64. This translates it as RDNA2 hardware runs it. I measured the hardware first, then checked xcl against it bit for bit.

What the hardware does (gfx1036, 2,072 measured rows, MODE with f64 denormals kept)

  • The result is the 53 bits of 2/π that start shift bits below b1200, times 2^(−53 − shift).
    • shift = S1[4:0] × 53, plus exp(S0) − 1077 when the S0 exponent is above 1077.
    • When the S0 exponent is 1968 or more, the scale gets an extra 2^128.
    • This is the ISA pseudocode.
  • The hardware's table ends at b17. Windows that reach below it read zeros. The full 1,201-bit constant gives different results on 104 of the measured rows; the 1,184-bit table matches all of them.
  • Rounding cannot change the result.
    • Table bit b_j is worth 2^(j − 1201), or 2^(j − 1073) with the 2^128 scale, for every input.
    • With the 2^128 scale, every bit down to b17 is at or above 2^−1074, so the result is exact.
    • Without it, the bits below 2^−1074 always start at b126, and b126 is 0. So rounding to nearest and truncating give the same double for every input.
    • Of 570 rows whose window straddles 2^−1074, 471 are inexact; the hardware matches both forms on all of them.
    • So the double is built from integers.
  • Only the exponent of S0 is read: NaN, inf, negative and denormal S0 follow the same rule. Bits above S1[4:0] are ignored.

What is in it

  • crates/xcl/src/gpu/recomp/emit.rs:
    • a trig_preop() helper and the 37-word table (TRIG_PREOP_2_OVER_PI);
    • both go into the HLSL only when a program uses the instruction, so no other shader's text changes.
  • crates/xcl/src/gpu/dxil/lower_wide.rs: the same computation in the direct DXIL translator. It reads the table with a chain of selects, because that translator has no constant arrays.
  • crates/xcl/src/gpu/dxil/lower.rs and emit.rs: v_trig_preop_f64 leaves the list of f64 ops that follow the f64 round mode (it does not round).
  • An output modifier (OMOD / CLAMP) is refused, because I did not measure it.
  • crates/xcl/src/gpu/recomp/tests.rs:
    • gpu_trig_preop_f64_matches_rdna2 checks both backends against 64 rows measured on the gfx1036.
    • trig_preop_f64_with_omod_is_refused checks the OMOD refusal in both backends.

Tested

  • Windows 11, NVIDIA GeForce RTX 5070 Ti 16 GB (wave64 as two halves) and an AMD Radeon RDNA2 iGPU (gfx1036, native wave64, XCL_ADAPTER=radeon). Rust 1.100 MSVC, release.
  • All 2,072 measured rows through xcl's kernel path, compared with the gfx1036's results: 2072/2072 equal on both adapters, in both backends.
  • The new tests pass on both adapters. The table test fails with each of six deliberate mistakes:
    • the 2^128 threshold moved to 1969 (HLSL);
    • the exponent threshold moved to 1078 (HLSL);
    • one bit of the table's last word changed;
    • 52 bits per S1 step instead of 53 (direct DXIL);
    • the denormal shift off by one (direct DXIL);
    • S1 masked to 6 bits (direct DXIL).
  • The whole suite: cargo build --release --workspace, then cargo test --release --workspace --no-fail-fast -- --test-threads=4, with and without XCL_DIRECT_DXIL=all, on this change rebased onto main 8b957be (9a608a4), against that base on the same machine:
Adapter Mode base 8b957be this PR (9a608a4)
RTX 5070 Ti default 1442 passed, 4 failed, 47 ignored 1444 passed, 4 failed, 47 ignored
RTX 5070 Ti XCL_DIRECT_DXIL=all 1442 passed, 4 failed, 47 ignored 1444 passed, 4 failed, 47 ignored
Radeon gfx1036 default 1445 passed, 1 failed, 47 ignored 1447 passed, 1 failed, 47 ignored
Radeon gfx1036 XCL_DIRECT_DXIL=all 1445 passed, 1 failed, 47 ignored 1447 passed, 1 failed, 47 ignored

The +2 are the new tests, which pass in all four rows. The failing tests are the same on base and PR, and both are tracked: fuzz_validate_and_gpu_0..3 on NVIDIA (#1905) and fuzz_validate_and_gpu_1 on RDNA2 (#2115, #2170).

Regression run
Base (main e120925), NVIDIA GeForce RTX 5070 Ti:

xcl-smoke v1
commit: e120925e3abc9956a8b9bae631969d32e8ccd43c
gpu: NVIDIA GeForce RTX 5070 Ti
title: title-a
seconds: 60
exit: 0x0
frames shown: 649 (PresentX 650)
presents per 2 s (last 3): 32 32 33
device removals: 0
crashes: 0
peak commit: 16853 MB

This PR (a2d9c47), same card:

xcl-smoke v1
commit: a2d9c470554cf43ad412af89a5b7c53812ebe4dc
gpu: NVIDIA GeForce RTX 5070 Ti
title: title-a
seconds: 60
exit: 0x0
frames shown: 992 (PresentX 992)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16140 MB
  • Why e120925: this head sits on e120925, the main commit just before #2555.
    • Since #2555, a run first prepares the whole shader pack. On this PC that takes about 5 hours from an empty cache, so a 60 s smoke on a later base cannot reach the title.
    • #2555 touches none of this PR's files. Merged into main 8b957be, this head gives the same tree as the commit the suite above ran on (9a608a4, tree 5f5b6a7).
  • An earlier pair on the same commits: main 805 frames, this PR 593, both exit 0x0, 0 crashes.
    • The frame counts swing that much between runs of main alone (805, then 649).
    • Neither run's log mentions v_trig_preop_f64, and both have the same 41 refusals. The title does not reach this instruction in these 60 s, so the 60 s runs check only that nothing else changed.

Not tested

  • OMOD / CLAMP on this instruction (refused).
  • A program that flushes f64 denormals. With MODE's double / half denormal field set to flush output denormals, the gfx1036 returns 0 for all 223 measured denormal results.
    • This keeps them, like xcl's other f64 instructions, which do not read that field.
    • Denormals kept is the mode the measurements and the test use.
  • RDNA4 and Intel by me. RDNA3 (gfx1100, RADV) was checked by @SlopTart in a comment below, bit-exact.
  • Whether a retail program uses the instruction.

AI use

  • Claude Code (Claude Opus 5.5) did the work: it measured the hardware, wrote both lowerings and the tests, ran the comparisons, the mutation checks and the suites, and wrote this description.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:issue:5492439396 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2315). Originally posted by [NWProgramming00](https://github.com/NWProgramming00) on 2026-11-25T13:39:47Z. --- Both backends refused `v_trig_preop_f64`. This translates it as RDNA2 hardware runs it. I measured the hardware first, then checked xcl against it bit for bit. **What the hardware does** (gfx1036, 2,072 measured rows, MODE with f64 denormals kept) - The result is the 53 bits of 2/π that start `shift` bits below b1200, times 2^(−53 − shift). - `shift = S1[4:0] × 53`, plus `exp(S0) − 1077` when the S0 exponent is above 1077. - When the S0 exponent is 1968 or more, the scale gets an extra 2^128. - This is the ISA pseudocode. - **The hardware's table ends at b17.** Windows that reach below it read zeros. The full 1,201-bit constant gives different results on 104 of the measured rows; the 1,184-bit table matches all of them. - **Rounding cannot change the result.** - Table bit b_j is worth 2^(j − 1201), or 2^(j − 1073) with the 2^128 scale, for every input. - With the 2^128 scale, every bit down to b17 is at or above 2^−1074, so the result is exact. - Without it, the bits below 2^−1074 always start at b126, and b126 is 0. So rounding to nearest and truncating give the same double for every input. - Of 570 rows whose window straddles 2^−1074, 471 are inexact; the hardware matches both forms on all of them. - So the double is built from integers. - Only the exponent of S0 is read: NaN, inf, negative and denormal S0 follow the same rule. Bits above S1[4:0] are ignored. **What is in it** - `crates/xcl/src/gpu/recomp/emit.rs`: - a `trig_preop()` helper and the 37-word table (`TRIG_PREOP_2_OVER_PI`); - both go into the HLSL only when a program uses the instruction, so no other shader's text changes. - `crates/xcl/src/gpu/dxil/lower_wide.rs`: the same computation in the direct DXIL translator. It reads the table with a chain of selects, because that translator has no constant arrays. - `crates/xcl/src/gpu/dxil/lower.rs` and `emit.rs`: `v_trig_preop_f64` leaves the list of f64 ops that follow the f64 round mode (it does not round). - An output modifier (`OMOD` / `CLAMP`) is refused, because I did not measure it. - `crates/xcl/src/gpu/recomp/tests.rs`: - `gpu_trig_preop_f64_matches_rdna2` checks both backends against 64 rows measured on the gfx1036. - `trig_preop_f64_with_omod_is_refused` checks the OMOD refusal in both backends. **Tested** - Windows 11, NVIDIA GeForce RTX 5070 Ti 16 GB (wave64 as two halves) and an AMD Radeon RDNA2 iGPU (gfx1036, native wave64, `XCL_ADAPTER=radeon`). Rust 1.100 MSVC, release. - **All 2,072 measured rows through xcl's kernel path, compared with the gfx1036's results:** 2072/2072 equal on both adapters, in both backends. - **The new tests pass on both adapters.** The table test fails with each of six deliberate mistakes: - the 2^128 threshold moved to 1969 (HLSL); - the exponent threshold moved to 1078 (HLSL); - one bit of the table's last word changed; - 52 bits per S1 step instead of 53 (direct DXIL); - the denormal shift off by one (direct DXIL); - S1 masked to 6 bits (direct DXIL). - **The whole suite:** `cargo build --release --workspace`, then `cargo test --release --workspace --no-fail-fast -- --test-threads=4`, with and without `XCL_DIRECT_DXIL=all`, on this change rebased onto `main` `8b957be` (`9a608a4`), against that base on the same machine: | Adapter | Mode | base `8b957be` | this PR (`9a608a4`) | |---|---|---|---| | RTX 5070 Ti | default | 1442 passed, 4 failed, 47 ignored | 1444 passed, 4 failed, 47 ignored | | RTX 5070 Ti | `XCL_DIRECT_DXIL=all` | 1442 passed, 4 failed, 47 ignored | 1444 passed, 4 failed, 47 ignored | | Radeon gfx1036 | default | 1445 passed, 1 failed, 47 ignored | 1447 passed, 1 failed, 47 ignored | | Radeon gfx1036 | `XCL_DIRECT_DXIL=all` | 1445 passed, 1 failed, 47 ignored | 1447 passed, 1 failed, 47 ignored | The +2 are the new tests, which pass in all four rows. The failing tests are the same on base and PR, and both are tracked: `fuzz_validate_and_gpu_0..3` on NVIDIA (#1905) and `fuzz_validate_and_gpu_1` on RDNA2 (#2115, #2170). **Regression run** Base (`main` `e120925`), NVIDIA GeForce RTX 5070 Ti: ``` xcl-smoke v1 commit: e120925e3abc9956a8b9bae631969d32e8ccd43c gpu: NVIDIA GeForce RTX 5070 Ti title: title-a seconds: 60 exit: 0x0 frames shown: 649 (PresentX 650) presents per 2 s (last 3): 32 32 33 device removals: 0 crashes: 0 peak commit: 16853 MB ``` This PR (`a2d9c47`), same card: ``` xcl-smoke v1 commit: a2d9c470554cf43ad412af89a5b7c53812ebe4dc gpu: NVIDIA GeForce RTX 5070 Ti title: title-a seconds: 60 exit: 0x0 frames shown: 992 (PresentX 992) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 16140 MB ``` - **Why `e120925`:** this head sits on `e120925`, the `main` commit just before #2555. - Since #2555, a run first prepares the whole shader pack. On this PC that takes about 5 hours from an empty cache, so a 60 s smoke on a later base cannot reach the title. - #2555 touches none of this PR's files. Merged into `main` `8b957be`, this head gives the same tree as the commit the suite above ran on (`9a608a4`, tree `5f5b6a7`). - **An earlier pair on the same commits:** `main` 805 frames, this PR 593, both exit 0x0, 0 crashes. - The frame counts swing that much between runs of `main` alone (805, then 649). - Neither run's log mentions `v_trig_preop_f64`, and both have the same 41 refusals. The title does not reach this instruction in these 60 s, so the 60 s runs check only that nothing else changed. **Not tested** - `OMOD` / `CLAMP` on this instruction (refused). - **A program that flushes f64 denormals.** With MODE's double / half denormal field set to flush output denormals, the gfx1036 returns 0 for all 223 measured denormal results. - This keeps them, like xcl's other f64 instructions, which do not read that field. - Denormals kept is the mode the measurements and the test use. - RDNA4 and Intel by me. RDNA3 (gfx1100, RADV) was checked by @SlopTart in a comment below, bit-exact. - Whether a retail program uses the instruction. **AI use** - Claude Code (Claude Opus 5.5) did the work: it measured the hardware, wrote both lowerings and the tests, ran the comparisons, the mutation checks and the suites, and wrote this description. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
nnonno91 commented 2026-11-25 14:10:14 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by nnonno91 on 2026-11-25T14:04:27Z.


Independent focused check of 44455fe9109fed47598714ecc1a464c96d1012c8 on Radeon integrated graphics and RTX 5090.

Tested

  • Ryzen 7 9800X3D, Windows 11 25H2 build 26200.9974, Rust 1.100.0 MSVC, Windows SDK DXC/DXIL 1.8.2502.11, unoptimized profile. AMD Radeon(TM) Graphics driver 32.0.21042.62 and GeForce RTX 5090 driver 32.0.16.1742.
  • Ran cargo test --locked -p xcl --lib trig_preop_f64 -- --nocapture --test-threads=1 in separate processes with XCL_ADAPTER=AMD Radeon or XCL_ADAPTER=NVIDIA GeForce RTX 5090 (XCL_REQUIRE_GPU=wave64 on Radeon). Each run gave 2 passed, 0 failed, 0 ignored and no skips.
  • On each GPU, all 64 checked-in hardware reference values matched bit for bit through HLSL and direct DXIL. The separate OMOD refusal test passed for both translators.

Not tested

The larger hardware capture, retail smoke, and the full workspace suite.

AI use

OpenAI Codex (GPT-6.2 Sol) ran the tests, checked the logs and wrote this report.

<!-- greyfinch-sync:ivall/xcl:comment:7164716332 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2315#issuecomment-7164716332). Originally posted by [nnonno91](https://github.com/nnonno91) on 2026-11-25T14:04:27Z. --- Independent focused check of `44455fe9109fed47598714ecc1a464c96d1012c8` on Radeon integrated graphics and RTX 5090. **Tested** - Ryzen 7 9800X3D, Windows 11 25H2 build 26200.9974, Rust 1.100.0 MSVC, Windows SDK DXC/DXIL 1.8.2502.11, unoptimized profile. AMD Radeon(TM) Graphics driver 32.0.21042.62 and GeForce RTX 5090 driver 32.0.16.1742. - Ran `cargo test --locked -p xcl --lib trig_preop_f64 -- --nocapture --test-threads=1` in separate processes with `XCL_ADAPTER=AMD Radeon` or `XCL_ADAPTER=NVIDIA GeForce RTX 5090` (`XCL_REQUIRE_GPU=wave64` on Radeon). Each run gave 2 passed, 0 failed, 0 ignored and no skips. - On each GPU, all 64 checked-in hardware reference values matched bit for bit through HLSL and direct DXIL. The separate OMOD refusal test passed for both translators. **Not tested** The larger hardware capture, retail smoke, and the full workspace suite. **AI use** OpenAI Codex (GPT-6.2 Sol) ran the tests, checked the logs and wrote this report.
SlopTart commented 2026-11-25 15:07:42 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-25T14:10:59Z.


RDNA3 confirmation: the new f64 trig translation is bit-exact on gfx1100 too.

The fix is calibrated against gfx1036 hardware measurements; here it is on RDNA3 (RX 7900 XT, NAVI31) under RADV, which the PR does not list as tested.

Tested: origin/main 379725ae + PR head 44455fe9 (merge c7785944, no conflicts, mergeable clean onto current main). Linux (Arch, kernel 7.2.15), Mesa 26.2.5 RADV, Radeon RX 7900 XT, cargo target x86_64-pc-windows-gnu run under wine-11.0 (Proton), rustc 1.94.0, official MS DXC (binaries 2026-09-29).

  • gpu_ suite (--release --locked, --test-threads=2): 143 passed / 3 failed / 1 ignored, versus 142 / 3 on plain origin/main on this rig. The pass delta is exactly this PR's added test, and the 3 failures are the rig's known baseline, unchanged: fuzz seed 1003 (posted on #2115), gpu_nonfused_mad_and_mac_prevent_fma_contraction, gpu_depth_buffer_created_for_unordered_access_is_placed.
  • So on RDNA3 + Mesa 26.2.5, the translated v_trig_preop_f64 matches what the test expects bit for bit, same as on the gfx1036 measurements.

Not tested: Windows on this card; gfx103x native Linux (native target, not Wine).

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

<!-- greyfinch-sync:ivall/xcl:comment:7164883151 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2315#issuecomment-7164883151). Originally posted by [SlopTart](https://github.com/SlopTart) on 2026-11-25T14:10:59Z. --- **RDNA3 confirmation: the new f64 trig translation is bit-exact on gfx1100 too.** The fix is calibrated against gfx1036 hardware measurements; here it is on RDNA3 (RX 7900 XT, NAVI31) under RADV, which the PR does not list as tested. **Tested**: `origin/main` `379725ae` + PR head `44455fe9` (merge `c7785944`, no conflicts, mergeable clean onto current main). Linux (Arch, kernel 7.2.15), Mesa 26.2.5 RADV, Radeon RX 7900 XT, cargo target `x86_64-pc-windows-gnu` run under wine-11.0 (Proton), rustc 1.94.0, official MS DXC (binaries 2026-09-29). - `gpu_` suite (`--release --locked`, `--test-threads=2`): 143 passed / 3 failed / 1 ignored, versus 142 / 3 on plain `origin/main` on this rig. The pass delta is exactly this PR's added test, and the 3 failures are the rig's known baseline, unchanged: fuzz seed 1003 (posted on #2115), `gpu_nonfused_mad_and_mac_prevent_fma_contraction`, `gpu_depth_buffer_created_for_unordered_access_is_placed`. - So on RDNA3 + Mesa 26.2.5, the translated `v_trig_preop_f64` matches what the test expects bit for bit, same as on the gfx1036 measurements. **Not tested**: Windows on this card; gfx103x native Linux (native target, not Wine). **AI use**: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting.
DavidM1911 commented 2026-11-25 18:04:42 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T17:52:50Z.


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:7170128835 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2315#issuecomment-7170128835). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T17:52:50Z. --- 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!
raylitebull commented 2026-11-25 19:09:10 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-25T18:41:08Z.


Diff review, CI, and both AMD and NVIDIA checks passed on 44455fe, but recent origin/main merges turned this branch CONFLICTING/DIRTY. Please rebase onto origin/main so it becomes mergeable again.

<!-- greyfinch-sync:ivall/xcl:comment:7171251072 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2315#issuecomment-7171251072). Originally posted by [raylitebull](https://github.com/raylitebull) on 2026-11-25T18:41:08Z. --- Diff review, CI, and both AMD and NVIDIA checks passed on `44455fe`, but recent `origin/main` merges turned this branch `CONFLICTING/DIRTY`. Please rebase onto `origin/main` so it becomes mergeable again.
NWProgramming00 commented 2026-11-26 20:06:05 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by NWProgramming00 on 2026-11-26T20:06:05Z.


@raylitebull rebased as asked. The new head is a2d9c47, on e120925, the main commit just before #2555. It merges cleanly into current main 8b957be, and the merge gives the same tree as the commit the suite ran on.

  • The full suite ran on 8b957be + this change, against 8b957be: +2 everywhere, the same tracked failures.
  • The smoke pair is on e120925, because since #2555 a cold shader preparation takes about 5 hours here.

The description has the numbers.

<!-- greyfinch-sync:ivall/xcl:comment:7202297111 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2315#issuecomment-7202297111). Originally posted by [NWProgramming00](https://github.com/NWProgramming00) on 2026-11-26T20:06:05Z. --- @raylitebull rebased as asked. The new head is `a2d9c47`, on `e120925`, the `main` commit just before #2555. It merges cleanly into current `main` `8b957be`, and the merge gives the same tree as the commit the suite ran on. - The full suite ran on `8b957be` + this change, against `8b957be`: +2 everywhere, the same tracked failures. - The smoke pair is on `e120925`, because since #2555 a cold shader preparation takes about 5 hours here. The description has the numbers.
Decodere commented 2026-11-26 21:01:23 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Decodere on 2026-11-26T21:01:23Z.


Independent desktop NVIDIA verification of PR #2315 at rebased head a2d9c470554cf43ad412af89a5b7c53812ebe4dc (1 commit; exact parent & merge-base: e120925e3abc9956a8b9bae631969d32e8ccd43c, pre-#2555 ancestor of main).

Environment

  • GPU: NVIDIA GeForce RTX 4060 (8 GB / 7956 MiB reported by D3D12, Wave32-only Ada), driver 32.0.16.2114 (NVIDIA 621.14, WDDM 3.2)
  • CPU / RAM / OS: Intel Core i5-11400F (6C / 12T), 32 GB RAM (31.9 GiB usable), Windows 11 Home 26200 (Developer Mode off)
  • Toolchain: rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC, DXC 1.9.2609.5, --release

Targeted release tests & build (a2d9c470)

Command Result
cargo test --release -p xcl --lib trig_preop_f64_with_omod_is_refused -- --nocapture 1 passed; 0 failed; 0 ignored; 1343 filtered out (0.00s)
cargo test --release -p xcl --lib gpu_trig_preop_f64_matches_rdna2 -- --nocapture (3 consecutive runs, on-GPU RTX 4060 across both HLSL and direct DXIL backends) 1 passed; 0 failed; 0 ignored; 1343 filtered out × 3 (0.26s, 0.22s, 0.22s)
cargo test --release -p xcl --lib gpu::dxil:: 184 passed; 0 failed; 3 ignored; 1157 filtered out (3.79s; dispatch_chain_native_wave64_builds_whole self-skipped on Wave32-only RTX 4060)
cargo test --release -p xcl --lib gpu::recomp:: 403 passed; 0 failed; 20 ignored; 921 filtered out (5.27s; Wave64-only and #1426-refused subcases self-skipped as expected)
cargo build --release -p xcl --bin xcl Clean build (1m 14s, exit 0)

Paired quiet 60 s retail smoke (title: 29640639)

Exact parent & merge-base (e120925e3abc9956a8b9bae631969d32e8ccd43c, cached baseline on the same machine):

xcl-smoke v1
commit: e120925e3abc9956a8b9bae631969d32e8ccd43c
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1602 (PresentX 1602)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13979 MB

PR #2315 (a2d9c470554cf43ad412af89a5b7c53812ebe4dc):

xcl-smoke v1
commit: a2d9c470554cf43ad412af89a5b7c53812ebe4dc
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1579 (PresentX 1579)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14021 MB

Runtime log observations (xcl.log)

  • 9222 log lines, 0 [ERROR] / device-removal / panic lines.
  • Final draw/memory telemetry in log: 19474 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped); last memory sample 14020 MB committed by the process; video memory 6114 MB local, 4683 MB non-local.

Limits of coverage

  • gpu_trig_preop_f64_matches_rdna2 executed directly on the RTX 4060 GPU across both the HLSL and direct DXIL backends (3/3 passes against all 64 RDNA2 gfx1036 reference rows), and trig_preop_f64_with_omod_is_refused verified refusal of output modifiers.
  • Wave64-only GPU subcases in gpu::dxil:: and gpu::recomp:: self-skipped on the Wave32-only RTX 4060, and the existing #[ignore] dump/fuzz/benchmark tests remained ignored.
  • The 60 s retail smoke on title: 29640639 serves as an end-to-end non-regression check and was not confirmed to execute a retail shader containing v_trig_preop_f64.

AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).

<!-- greyfinch-sync:ivall/xcl:comment:7203305780 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2315#issuecomment-7203305780). Originally posted by [Decodere](https://github.com/Decodere) on 2026-11-26T21:01:23Z. --- Independent desktop NVIDIA verification of **PR #2315** at rebased head `a2d9c470554cf43ad412af89a5b7c53812ebe4dc` (`1` commit; exact parent & merge-base: `e120925e3abc9956a8b9bae631969d32e8ccd43c`, pre-`#2555` ancestor of `main`). ### Environment - **GPU:** NVIDIA GeForce RTX 4060 (8 GB / `7956 MiB` reported by D3D12, Wave32-only Ada), driver `32.0.16.2114` (NVIDIA `621.14`, WDDM 3.2) - **CPU / RAM / OS:** Intel Core i5-11400F (6C / 12T), 32 GB RAM (`31.9 GiB` usable), Windows 11 Home `26200` (Developer Mode off) - **Toolchain:** `rustc 1.100.0 (0ef1bc386 2026-11-09)` MSVC, DXC `1.9.2609.5`, `--release` ### Targeted release tests & build (`a2d9c470`) | Command | Result | | --- | --- | | `cargo test --release -p xcl --lib trig_preop_f64_with_omod_is_refused -- --nocapture` | `1 passed; 0 failed; 0 ignored; 1343 filtered out` (`0.00s`) | | `cargo test --release -p xcl --lib gpu_trig_preop_f64_matches_rdna2 -- --nocapture` (3 consecutive runs, on-GPU RTX 4060 across both HLSL and direct DXIL backends) | `1 passed; 0 failed; 0 ignored; 1343 filtered out` × 3 (`0.26s`, `0.22s`, `0.22s`) | | `cargo test --release -p xcl --lib gpu::dxil::` | `184 passed; 0 failed; 3 ignored; 1157 filtered out` (`3.79s`; `dispatch_chain_native_wave64_builds_whole` self-skipped on Wave32-only RTX 4060) | | `cargo test --release -p xcl --lib gpu::recomp::` | `403 passed; 0 failed; 20 ignored; 921 filtered out` (`5.27s`; Wave64-only and `#1426`-refused subcases self-skipped as expected) | | `cargo build --release -p xcl --bin xcl` | Clean build (`1m 14s`, exit `0`) | ### Paired quiet 60 s retail smoke (`title: 29640639`) Exact parent & merge-base (`e120925e3abc9956a8b9bae631969d32e8ccd43c`, cached baseline on the same machine): ``` xcl-smoke v1 commit: e120925e3abc9956a8b9bae631969d32e8ccd43c gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1602 (PresentX 1602) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 13979 MB ``` PR #2315 (`a2d9c470554cf43ad412af89a5b7c53812ebe4dc`): ``` xcl-smoke v1 commit: a2d9c470554cf43ad412af89a5b7c53812ebe4dc gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1579 (PresentX 1579) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14021 MB ``` ### Runtime log observations (`xcl.log`) - `9222` log lines, `0` `[ERROR]` / device-removal / panic lines. - Final draw/memory telemetry in log: `19474 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped)`; last memory sample `14020 MB committed by the process; video memory 6114 MB local, 4683 MB non-local`. ### Limits of coverage - `gpu_trig_preop_f64_matches_rdna2` executed directly on the RTX 4060 GPU across both the HLSL and direct DXIL backends (3/3 passes against all 64 RDNA2 gfx1036 reference rows), and `trig_preop_f64_with_omod_is_refused` verified refusal of output modifiers. - Wave64-only GPU subcases in `gpu::dxil::` and `gpu::recomp::` self-skipped on the Wave32-only RTX 4060, and the existing `#[ignore]` dump/fuzz/benchmark tests remained ignored. - The 60 s retail smoke on `title: 29640639` serves as an end-to-end non-regression check and was not confirmed to execute a retail shader containing `v_trig_preop_f64`. *AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).*
artor410 commented 2026-11-28 07:56:53 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by artor410 on 2026-11-28T07:56:53Z.


Test report, head a2d9c47, NVIDIA GeForce RTX 3070 Ti (driver 610.88), Windows 11, rustc 1.100.0, debug build, no game data (no XCL_SAMPLE_* set).

cargo test --workspace -- --test-threads=4: 1396 passed, 1 failed, 31 ignored.

The one failure is e2e::test_title_runs_under_the_debug_layer_with_dred (test title exits 0xC0000005 under the debug layer). It fails the same way on main e429936 on this machine, so it is not from this PR. Everything else passes.

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

<!-- greyfinch-sync:ivall/xcl:comment:7236263159 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2315#issuecomment-7236263159). Originally posted by [artor410](https://github.com/artor410) on 2026-11-28T07:56:53Z. --- Test report, head a2d9c47, NVIDIA GeForce RTX 3070 Ti (driver 610.88), Windows 11, rustc 1.100.0, debug build, no game data (no XCL_SAMPLE_* set). `cargo test --workspace -- --test-threads=4`: 1396 passed, 1 failed, 31 ignored. The one failure is `e2e::test_title_runs_under_the_debug_layer_with_dred` (test title exits 0xC0000005 under the debug layer). It fails the same way on main e429936 on this machine, so it is not from this PR. Everything else passes. AI use: Claude Code (Claude Opus 5.5) ran the suite and wrote this.
thehollowedone commented 2026-11-29 09:43:07 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-29T09:43:07Z.


Supplemental arithmetic check for a2d9c470554cf43ad412af89a5b7c53812ebe4dc. I independently recomputed the first 1,184 bits of 2/π and matched all 37 words in the proposed table. In an isolated Python model, I enumerated all 65,536 pairs of the 11-bit exponent and 5-bit segment. The three-word window agreed with arbitrary-precision bit extraction, and the bit packing agreed with binary64 scaling: 32,025 normal, 2,012 subnormal, and 31,499 zero cases, with no mismatches.

That checks the arithmetic for the proposed table with subnormals preserved. It does not establish RDNA2’s hardware table length, emitted DXIL or HLSL behavior, or a Windows GPU result. No XCL code was executed. AI assistance: OpenAI ChatGPT wrote and ran the independent arithmetic model.

<!-- greyfinch-sync:ivall/xcl:comment:7253949238 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2315#issuecomment-7253949238). Originally posted by [thehollowedone](https://github.com/thehollowedone) on 2026-11-29T09:43:07Z. --- Supplemental arithmetic check for `a2d9c470554cf43ad412af89a5b7c53812ebe4dc`. I independently recomputed the first 1,184 bits of 2/π and matched all 37 words in the proposed table. In an isolated Python model, I enumerated all 65,536 pairs of the 11-bit exponent and 5-bit segment. The three-word window agreed with arbitrary-precision bit extraction, and the bit packing agreed with binary64 scaling: 32,025 normal, 2,012 subnormal, and 31,499 zero cases, with no mismatches. That checks the arithmetic for the proposed table with subnormals preserved. It does not establish RDNA2’s hardware table length, emitted DXIL or HLSL behavior, or a Windows GPU result. No XCL code was executed. AI assistance: OpenAI ChatGPT wrote and ran the independent arithmetic model.
Foniass commented 2026-12-01 07:48:35 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T07:48:35Z.


Triage (#1607) – head a2d9c47

No open or merged PR translates v_trig_preop_f64; on main it is only in the generated spec table (#2169 merely lists TRIG_PREOP in its fuzzer's skip list).
Read both forms (recomp/emit.rs trig_preop, dxil/lower_wide.rs Lw::trig_preop): same shift, window and denormal handling, and the test runs both backends against the 64 measured gfx1036 rows. Minor: in the direct form the 64-bit shifts by k / -k can get a count >= 64 on the branch the select drops; the HLSL form masks it with & 63, the direct one does not.
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:7304506195 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2315#issuecomment-7304506195). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T07:48:35Z. --- **Triage (#1607)** – head a2d9c47 No open or merged PR translates v_trig_preop_f64; on main it is only in the generated spec table (#2169 merely lists TRIG_PREOP in its fuzzer's skip list). Read both forms (recomp/emit.rs `trig_preop`, dxil/lower_wide.rs `Lw::trig_preop`): same shift, window and denormal handling, and the test runs both backends against the 64 measured gfx1036 rows. Minor: in the direct form the 64-bit shifts by `k` / `-k` can get a count >= 64 on the branch the select drops; the HLSL form masks it with `& 63`, the direct one does not. 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/2315:upstream-pr/2315'
git switch 'upstream-pr/2315'

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/2315'
git switch 'upstream-pr/2315'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2315'
git switch 'upstream-pr/2315'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2315'
git switch 'main'
git merge --squash 'upstream-pr/2315'
git switch 'main'
git merge --ff-only 'upstream-pr/2315'
git switch 'main'
git merge 'upstream-pr/2315'
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!2305
No description provided.