DXIL: fix negative preserved denormal qNaN in rm_sqrt and route rm_mad via by_mode #2524

Merged
Decodere merged 1 commit from upstream-pr/2534 into main 2026-11-29 12:19:30 +00:00
Decodere commented 2026-11-25 21:48:39 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Decodere on 2026-11-25T21:48:39Z.


Part of #675
Part of #1833

What is in it

Fixes two direct-DXIL directed f32 rounding bugs in crates/xcl/src/gpu/dxil/lower_round.rs and expands test coverage in crates/xcl/src/gpu/dxil/round_tests.rs:

  • Direct special-case handling in Lw::rm_sqrt: Previously, rm_sqrt fell back to native (dx.op.unary.f32(Sqrt, fa)) for nonzero special values (negv || infnan). Under D3D12 / SM 6.x, native f32 Sqrt flushes f32 denormals to zero, so a negative preserved denormal (MODE[4] == 1) produced -0.0 (0x8000_0000) instead of qNaN, and static directed modes kept an unused native Sqrt call live. rm_sqrt now computes the special-case result directly from the MODE[4]-filtered bits u (±0 -> ±0, +inf -> +inf, negative nonzero values including preserved denormals and -inf and all NaNs -> canonical qNaN 0x7FC0_0000), removing the native dependency from the directed path so DCE eliminates the dead native Sqrt in static directed modes.
  • Route Lw::rm_mad through Lw::by_mode: Replaces the nested rm_mul + rm_add + outer is_ne select with a single self.by_mode(native, mode, ...) (ext_exact -> fmul -> round_exact -> ext_exact -> round_sum), matching rm_add, rm_mul, and rm_fma. Constant RNE now folds directly to native (mad_nf) with zero f64 instructions, and dynamic mode emits only a single native mad_nf instead of duplicate dead fmul float / fadd float ops.
  • Tests (crates/xcl/src/gpu/dxil/round_tests.rs):
    • Updated ref_sqrt to return Some(0x7FC0_0000) for negative nonzero inputs (instead of skipping them with None) and updated directed_reference_basics with preserved/flushed negative-denormal ref_sqrt assertions and host NaN comparison.
    • Added direct_f32_round_sqrt_specials_and_mad_dxil_validate (pure-CPU/WARP 0-skip DXC 1.9 validation + disassembly check verifying a single dx.op.unary.f32(i32 24, ...) under static directed v_sqrt_f32, single fmul float/fadd float under dynamic v_mad_f32, and zero fmul double under constant RNE v_mad_f32).
    • Added gpu_direct_f32_round_sqrt_negative_denormals_and_specials covering ±denorm, ±0, -1.0, ±inf, ±qNaN, ±sNaN, and v_mad_f32(+denorm, +inf, 1.0) under both s_denorm_mode 3 (preserve) and s_denorm_mode 0 (flush) across rm in [1, 2, 3] (cleanly skipped on WARP/CI via gpu_ready()).

Tested

  • Failing-first on unmodified origin/main (lower_round.rs unchanged) with the new tests:
    • CPU/DXIL (direct_f32_round_sqrt_specials_and_mad_dxil_validate): panicked at round_tests.rs:574 (expected 1 Sqrt (dead native eliminated): left: 2, right: 1).
    • RTX 4060 GPU (gpu_direct_f32_round_sqrt_negative_denormals_and_specials): panicked at round_tests.rs:639 (rm=1 keep=true lane=0 in=0x80000001: got=0x80000000 want=0x7fc00000).
  • Post-fix targeted release tests on NVIDIA GeForce RTX 4060 (DXC 1.9.2609.5, 0 compiler warnings in lower_round.rs and round_tests.rs):
    • cargo test --release -p xcl --lib gpu::dxil::round_tests -- --test-threads=1 --nocapture: 10 passed; 0 failed; 0 ignored (0 skipped).
  • Post-fix targeted release tests on WARP (XCL_ADAPTER=warp):
    • cargo test --release -p xcl --lib gpu::dxil::round_tests -- --test-threads=1 --nocapture: 10 passed; 0 failed; 0 ignored (all 4 CPU/DXC tests ran with 0 skips; all 6 gpu_* tests cleanly reported SKIPPED: no wave64).
  • Full release workspace (cargo test --release --workspace --no-fail-fast -- --test-threads=4 --nocapture):
    • 37 test binaries: 1425 passed; 0 failed; 46 ignored.
    • 29 pre-existing runtime SKIPPED messages (21 no wave64 on wave32-only RTX 4060, 3 per-lane form: refused, 3 no D3D12 debug layer / no d3d12SDKLayers.dll, 1 cannot disable the driver cache, 1 no heap windows).

Regression run

Before (origin/main e1d84b7d9153f86a97d2ec5d209d196046fc0bea):

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

After (fix-dxil-round-sqrt-denorm-mad b3fced11b79fe70204212a03ec78e60dca110eb9):

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

Both 60 s runs reach steady 60 presents per 2 s (60 61 60 vs 60 60 60) with 0 device removals, 0 crashes, 1593 vs 1556 frames shown (102.4%), and 14004 MB vs 14015 MB peak commit.

Not tested

  • Native wave64 GPU execution (RTX 4060 is wave32-only, so direct_kernel tests ran on the split-wave64 path; round_tests lowering is wave-width independent).
  • D3D12 debug-layer tests (d3d12SDKLayers.dll is not installed on this machine).

AI use

Written and verified with Google Antigravity (Gemini 4 Neon). All code changes, CPU/DXIL and RTX 4060 failing-first reproductions, targeted RTX 4060 and WARP test runs, the full release workspace suite, and both paired 60 s GPU smoke runs were executed and checked locally.

<!-- greyfinch-sync:ivall/xcl:issue:5499746132 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2534). Originally posted by [Decodere](https://github.com/Decodere) on 2026-11-25T21:48:39Z. --- Part of #675 Part of #1833 **What is in it** Fixes two direct-DXIL directed f32 rounding bugs in `crates/xcl/src/gpu/dxil/lower_round.rs` and expands test coverage in `crates/xcl/src/gpu/dxil/round_tests.rs`: - **Direct special-case handling in `Lw::rm_sqrt`:** Previously, `rm_sqrt` fell back to `native` (`dx.op.unary.f32(Sqrt, fa)`) for nonzero special values (`negv || infnan`). Under D3D12 / SM 6.x, native f32 `Sqrt` flushes f32 denormals to zero, so a negative preserved denormal (`MODE[4] == 1`) produced `-0.0` (`0x8000_0000`) instead of `qNaN`, and static directed modes kept an unused native `Sqrt` call live. `rm_sqrt` now computes the special-case result directly from the `MODE[4]`-filtered bits `u` (`±0` -> `±0`, `+inf` -> `+inf`, negative nonzero values including preserved denormals and `-inf` and all NaNs -> canonical `qNaN` `0x7FC0_0000`), removing the `native` dependency from the directed path so DCE eliminates the dead native `Sqrt` in static directed modes. - **Route `Lw::rm_mad` through `Lw::by_mode`:** Replaces the nested `rm_mul` + `rm_add` + outer `is_ne` select with a single `self.by_mode(native, mode, ...)` (`ext_exact` -> `fmul` -> `round_exact` -> `ext_exact` -> `round_sum`), matching `rm_add`, `rm_mul`, and `rm_fma`. Constant `RNE` now folds directly to `native` (`mad_nf`) with zero f64 instructions, and dynamic mode emits only a single `native` `mad_nf` instead of duplicate dead `fmul float` / `fadd float` ops. - **Tests (`crates/xcl/src/gpu/dxil/round_tests.rs`):** - Updated `ref_sqrt` to return `Some(0x7FC0_0000)` for negative nonzero inputs (instead of skipping them with `None`) and updated `directed_reference_basics` with preserved/flushed negative-denormal `ref_sqrt` assertions and host NaN comparison. - Added `direct_f32_round_sqrt_specials_and_mad_dxil_validate` (pure-CPU/WARP `0`-skip DXC 1.9 validation + disassembly check verifying a single `dx.op.unary.f32(i32 24, ...)` under static directed `v_sqrt_f32`, single `fmul float`/`fadd float` under dynamic `v_mad_f32`, and zero `fmul double` under constant RNE `v_mad_f32`). - Added `gpu_direct_f32_round_sqrt_negative_denormals_and_specials` covering `±denorm`, `±0`, `-1.0`, `±inf`, `±qNaN`, `±sNaN`, and `v_mad_f32(+denorm, +inf, 1.0)` under both `s_denorm_mode 3` (preserve) and `s_denorm_mode 0` (flush) across `rm in [1, 2, 3]` (cleanly skipped on WARP/CI via `gpu_ready()`). **Tested** - Failing-first on unmodified `origin/main` (`lower_round.rs` unchanged) with the new tests: - CPU/DXIL (`direct_f32_round_sqrt_specials_and_mad_dxil_validate`): panicked at `round_tests.rs:574` (`expected 1 Sqrt (dead native eliminated): left: 2, right: 1`). - RTX 4060 GPU (`gpu_direct_f32_round_sqrt_negative_denormals_and_specials`): panicked at `round_tests.rs:639` (`rm=1 keep=true lane=0 in=0x80000001: got=0x80000000 want=0x7fc00000`). - Post-fix targeted release tests on NVIDIA GeForce RTX 4060 (DXC `1.9.2609.5`, `0` compiler warnings in `lower_round.rs` and `round_tests.rs`): - `cargo test --release -p xcl --lib gpu::dxil::round_tests -- --test-threads=1 --nocapture`: `10 passed; 0 failed; 0 ignored` (`0` skipped). - Post-fix targeted release tests on WARP (`XCL_ADAPTER=warp`): - `cargo test --release -p xcl --lib gpu::dxil::round_tests -- --test-threads=1 --nocapture`: `10 passed; 0 failed; 0 ignored` (all 4 CPU/DXC tests ran with `0` skips; all 6 `gpu_*` tests cleanly reported `SKIPPED: no wave64`). - Full release workspace (`cargo test --release --workspace --no-fail-fast -- --test-threads=4 --nocapture`): - `37` test binaries: `1425 passed; 0 failed; 46 ignored`. - `29` pre-existing runtime `SKIPPED` messages (`21` `no wave64` on wave32-only RTX 4060, `3` `per-lane form: refused`, `3` `no D3D12 debug layer` / `no d3d12SDKLayers.dll`, `1` `cannot disable the driver cache`, `1` `no heap windows`). **Regression run** Before (`origin/main` `e1d84b7d9153f86a97d2ec5d209d196046fc0bea`): ``` xcl-smoke v1 commit: e1d84b7d9153f86a97d2ec5d209d196046fc0bea gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1556 (PresentX 1556) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14015 MB ``` After (`fix-dxil-round-sqrt-denorm-mad` `b3fced11b79fe70204212a03ec78e60dca110eb9`): ``` xcl-smoke v1 commit: b3fced11b79fe70204212a03ec78e60dca110eb9 gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1593 (PresentX 1594) presents per 2 s (last 3): 60 61 60 device removals: 0 crashes: 0 peak commit: 14004 MB ``` Both 60 s runs reach steady `60` presents per 2 s (`60 61 60` vs `60 60 60`) with `0` device removals, `0` crashes, `1593` vs `1556` frames shown (`102.4%`), and `14004 MB` vs `14015 MB` peak commit. **Not tested** - Native wave64 GPU execution (RTX 4060 is wave32-only, so `direct_kernel` tests ran on the split-wave64 path; `round_tests` lowering is wave-width independent). - D3D12 debug-layer tests (`d3d12SDKLayers.dll` is not installed on this machine). **AI use** Written and verified with Google Antigravity (Gemini 4 Neon). All code changes, CPU/DXIL and RTX 4060 failing-first reproductions, targeted RTX 4060 and WARP test runs, the full release workspace suite, and both paired 60 s GPU smoke runs were executed and checked locally.
DarkPanda69 commented 2026-11-25 22:06:54 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DarkPanda69 on 2026-11-25T22:00:46Z.


Native wave64 run (listed as untested) on AMD RDNA4, plus an RTX 3060: both new tests pass on both cards, and nothing else changes.

Head b3fced1 applied on main e1d84b7, debug, Windows 11 Pro 26200, XCL_DIRECT_DXIL=1 cargo test -p xcl --lib -- gpu:: --test-threads=4 on main and with the PR, card chosen with XCL_ADAPTER:

main this PR
RX 9070 XT (RDNA4, 32.0.32029.2010; direct_kernel_full(.., true) runs native wave64 here) 698 passed, 2 failed, 6 SKIPPED 700 passed, 2 failed, 6 SKIPPED
RTX 3060 (32.0.16.1088; split wave64) 700 passed, 0 failed, 24 SKIPPED 702 passed, 0 failed, 24 SKIPPED

On both cards, the only result changes against main are the new gpu_direct_f32_round_sqrt_negative_denormals_and_specials and direct_f32_round_sqrt_specials_and_mad_dxil_validate, both ok, with no new skips. The 2 RX 9070 XT failures are the AMD fuzz seeds tracked in #2115, the same on main. So the expected denormal and NaN results hold on both vendors' hardware, with denormals kept and flushed, for round modes 1–3.

Not tested: the D3D12 debug-layer tests (no d3d12SDKLayers.dll here either; they skip), RDNA2/3, a title.
AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.

<!-- greyfinch-sync:ivall/xcl:comment:7175823970 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2534#issuecomment-7175823970). Originally posted by [DarkPanda69](https://github.com/DarkPanda69) on 2026-11-25T22:00:46Z. --- Native wave64 run (listed as untested) on AMD RDNA4, plus an RTX 3060: both new tests pass on both cards, and nothing else changes. Head `b3fced1` applied on `main` `e1d84b7`, debug, Windows 11 Pro 26200, `XCL_DIRECT_DXIL=1 cargo test -p xcl --lib -- gpu:: --test-threads=4` on `main` and with the PR, card chosen with `XCL_ADAPTER`: | | `main` | this PR | |---|---|---| | RX 9070 XT (RDNA4, 32.0.32029.2010; `direct_kernel_full(.., true)` runs native wave64 here) | 698 passed, 2 failed, 6 SKIPPED | 700 passed, 2 failed, 6 SKIPPED | | RTX 3060 (32.0.16.1088; split wave64) | 700 passed, 0 failed, 24 SKIPPED | 702 passed, 0 failed, 24 SKIPPED | On both cards, the only result changes against `main` are the new `gpu_direct_f32_round_sqrt_negative_denormals_and_specials` and `direct_f32_round_sqrt_specials_and_mad_dxil_validate`, both ok, with no new skips. The 2 RX 9070 XT failures are the AMD fuzz seeds tracked in #2115, the same on `main`. So the expected denormal and NaN results hold on both vendors' hardware, with denormals kept and flushed, for round modes 1–3. Not tested: the D3D12 debug-layer tests (no `d3d12SDKLayers.dll` here either; they skip), RDNA2/3, a title. AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.
DavidM1911 commented 2026-11-25 23:09:03 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T22:08:32Z.


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:7175988614 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2534#issuecomment-7175988614). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T22:08:32Z. --- 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!
xpatfussy69x commented 2026-11-25 23:09:03 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by xpatfussy69x on 2026-11-25T22:09:19Z.


Test run on exact head b3fced1 (b3fced11b79fe70204212a03ec78e60dca110eb9, on its base e1d84b7), clean tree.

Tested

  • NVIDIA GeForce RTX 3060 12 GB (driver 32.0.16.2124, 32-lane waves only), AMD Ryzen 5 7500F, Windows 11, Rust 1.100.0; debug build for the tests, release for the smoke runs
  • cargo test --workspace -- --test-threads=4: 1425 passed, 0 failed, 46 ignored
  • SKIPPED (25): 21 × no wave64; 1 × no heap windows; 3 × per-lane form refused V_MUL_F16 / V_PK_MUL_F16 / V_CVT_F16_F32 (on main too)
  • cargo test -p xcl --lib round: 36 passed, 0 failed
  • This PR's new tests in the workspace run:
    • direct_f32_round_sqrt_specials_and_mad_dxil_validate: ok, not skipped
    • gpu_direct_f32_round_sqrt_negative_denormals_and_specials: ok, not skipped

Regression run (60 s, default settings)

main:

xcl-smoke v1
commit: e1d84b7d9153f86a97d2ec5d209d196046fc0bea
gpu: NVIDIA GeForce RTX 3060
title: c3f791f3
seconds: 60
exit: 0x0
frames shown: 1091 (PresentX 1091)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14814 MB

this PR:

xcl-smoke v1
commit: b3fced11b79fe70204212a03ec78e60dca110eb9
gpu: NVIDIA GeForce RTX 3060
title: c3f791f3
seconds: 60
exit: 0x0
frames shown: 1104 (PresentX 1104)
presents per 2 s (last 3): 60 61 60
device removals: 0
crashes: 0
peak commit: 14794 MB

No crash or device removal; frames 101 % of main's, peak commit 100 %.

Not tested

  • The smoke run uses the default (HLSL) path, not XCL_DIRECT_DXIL=1, and no directed rounding mode: a regression check only
  • The PR merged into current main (tested on its own base; it merges into e1d84b7 without conflicts)
  • AMD / native wave64

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and both smoke runs on the machine above and wrote this report.
<!-- greyfinch-sync:ivall/xcl:comment:7176005350 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2534#issuecomment-7176005350). Originally posted by [xpatfussy69x](https://github.com/xpatfussy69x) on 2026-11-25T22:09:19Z. --- Test run on exact head `b3fced1` (`b3fced11b79fe70204212a03ec78e60dca110eb9`, on its base `e1d84b7`), clean tree. **Tested** - NVIDIA GeForce RTX 3060 12 GB (driver 32.0.16.2124, 32-lane waves only), AMD Ryzen 5 7500F, Windows 11, Rust 1.100.0; debug build for the tests, release for the smoke runs - `cargo test --workspace -- --test-threads=4`: 1425 passed, 0 failed, 46 ignored - SKIPPED (25): 21 × no wave64; 1 × no heap windows; 3 × per-lane form refused `V_MUL_F16` / `V_PK_MUL_F16` / `V_CVT_F16_F32` (on `main` too) - `cargo test -p xcl --lib round`: 36 passed, 0 failed - This PR's new tests in the workspace run: - `direct_f32_round_sqrt_specials_and_mad_dxil_validate`: ok, not skipped - `gpu_direct_f32_round_sqrt_negative_denormals_and_specials`: ok, not skipped **Regression run** (60 s, default settings) main: ``` xcl-smoke v1 commit: e1d84b7d9153f86a97d2ec5d209d196046fc0bea gpu: NVIDIA GeForce RTX 3060 title: c3f791f3 seconds: 60 exit: 0x0 frames shown: 1091 (PresentX 1091) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14814 MB ``` this PR: ``` xcl-smoke v1 commit: b3fced11b79fe70204212a03ec78e60dca110eb9 gpu: NVIDIA GeForce RTX 3060 title: c3f791f3 seconds: 60 exit: 0x0 frames shown: 1104 (PresentX 1104) presents per 2 s (last 3): 60 61 60 device removals: 0 crashes: 0 peak commit: 14794 MB ``` No crash or device removal; frames 101 % of `main`'s, peak commit 100 %. **Not tested** - The smoke run uses the default (HLSL) path, not `XCL_DIRECT_DXIL=1`, and no directed rounding mode: a regression check only - The PR merged into current `main` (tested on its own base; it merges into `e1d84b7` without conflicts) - AMD / native wave64 **AI use** - Claude Code (Claude Opus 5.5) ran the tests and both smoke runs on the machine above and wrote this report.
emirduran707 commented 2026-11-25 23:09:04 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by emirduran707 on 2026-11-25T22:10:18Z.


Independent AMD RDNA4 (native wave64) test report on exact head b3fced11b79fe70204212a03ec78e60dca110eb9 (clean detached checkout, no local changes).

Tested

  • AMD Radeon RX 9060 XT 16 GB (RDNA4, native wave64, driver 32.0.31044.16), Ryzen 5 5600, 32 GB RAM, Windows 11 Pro 26300, Rust 1.100.0 (stable-x86_64-pc-windows-msvc), DXC 1.9.2602.17; tests debug, smoke release.
  • cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4: 1423 passed, 2 failed, 46 ignored; 8 SKIPPED (6 in lower_dxil::tests::{f16,f32}_programs_on_the_gpu refused by per-lane form; heap_window_out_of_memory_falls_back_to_the_switch_form; pso_measurement_compiles_an_exact_synthetic_record). All native wave64 GPU tests ran and passed.
    • Both PR tests passed (no skips): gpu::dxil::round_tests::direct_f32_round_sqrt_specials_and_mad_dxil_validate and gpu_direct_f32_round_sqrt_negative_denormals_and_specials.
    • The 2 failures (gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1 seed 722 and fuzz_validate_and_gpu_3 seed 1599) are pre-existing on unmodified main on this GPU.

Regression run (60 s retail-title smoke, XCL_NETWORK=0, release)

xcl-smoke v1
commit: b3fced11b79fe70204212a03ec78e60dca110eb9
gpu: AMD Radeon RX 9060 XT
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1617 (PresentX 1617)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13934 MB

(Matched main 68a284a baseline on the same machine today: 1573 frames, 14420 MB peak, 0 device removals, 0 crashes.)

Not tested

  • D3D12 debug layer; Intel GPUs.

AI use

  • Antigravity with Gemini 4 Neon ran the build, test suite, and smoke run and drafted this report.
<!-- greyfinch-sync:ivall/xcl:comment:7176025983 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2534#issuecomment-7176025983). Originally posted by [emirduran707](https://github.com/emirduran707) on 2026-11-25T22:10:18Z. --- Independent AMD RDNA4 (native wave64) test report on exact head `b3fced11b79fe70204212a03ec78e60dca110eb9` (clean detached checkout, no local changes). **Tested** - AMD Radeon RX 9060 XT 16 GB (RDNA4, native wave64, driver 32.0.31044.16), Ryzen 5 5600, 32 GB RAM, Windows 11 Pro 26300, Rust 1.100.0 (`stable-x86_64-pc-windows-msvc`), DXC 1.9.2602.17; tests debug, smoke release. - `cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4`: **1423 passed, 2 failed, 46 ignored; 8 SKIPPED** (6 in `lower_dxil::tests::{f16,f32}_programs_on_the_gpu` refused by per-lane form; `heap_window_out_of_memory_falls_back_to_the_switch_form`; `pso_measurement_compiles_an_exact_synthetic_record`). All native wave64 GPU tests ran and passed. - Both PR tests passed (no skips): `gpu::dxil::round_tests::direct_f32_round_sqrt_specials_and_mad_dxil_validate` and `gpu_direct_f32_round_sqrt_negative_denormals_and_specials`. - The 2 failures (`gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1` seed 722 and `fuzz_validate_and_gpu_3` seed 1599) are pre-existing on unmodified `main` on this GPU. **Regression run** (60 s retail-title smoke, `XCL_NETWORK=0`, release) ``` xcl-smoke v1 commit: b3fced11b79fe70204212a03ec78e60dca110eb9 gpu: AMD Radeon RX 9060 XT title: 21222967 seconds: 60 exit: 0x0 frames shown: 1617 (PresentX 1617) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 13934 MB ``` (Matched `main` `68a284a` baseline on the same machine today: 1573 frames, 14420 MB peak, 0 device removals, 0 crashes.) **Not tested** - D3D12 debug layer; Intel GPUs. **AI use** - Antigravity with Gemini 4 Neon ran the build, test suite, and smoke run and drafted this report.
SlopTart commented 2026-11-25 23:09:24 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-25T23:07:58Z.


Tested: current PR head merged onto current origin/main (clean), Linux (Arch, kernel 7.2.15), Mesa 26.2.5 RADV, Radeon RX 7900 XT (NAVI31), cargo target x86_64-pc-windows-gnu run under wine-11.0 (Proton), rustc 1.94.0, vkd3d-proton 3.1 with the XCL patch, official MS DXC (binaries 2026-09-29).

gpu_ suite (cold cache): 165 passed / 3 failed, no crashes. The three are the known baseline on this lane (seed-1003 fuzz, mad/mac contraction, promoted-UAV-clear driver gap, PR #2490); none caused by this PR.
Targeted run of the rm_sqrt/rm_mad qNaN/denormal tests: the three matching new-behavior tests passed; the one failure in the same filter is the pre-existing baseline gpu_nonfused_mad_and_mac_prevent_fma_contraction, which stays red on this lane with this PR (unchanged from main). Flagging that explicitly since this PR touches that machinery.

Not tested: retail titles (no title data on this lane, counts only).

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

<!-- greyfinch-sync:ivall/xcl:comment:7177183674 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2534#issuecomment-7177183674). Originally posted by [SlopTart](https://github.com/SlopTart) on 2026-11-25T23:07:58Z. --- **Tested**: current PR head merged onto current `origin/main` (clean), Linux (Arch, kernel 7.2.15), Mesa 26.2.5 RADV, Radeon RX 7900 XT (NAVI31), cargo target `x86_64-pc-windows-gnu` run under wine-11.0 (Proton), rustc 1.94.0, vkd3d-proton 3.1 with the XCL patch, official MS DXC (binaries 2026-09-29). `gpu_` suite (cold cache): 165 passed / 3 failed, no crashes. The three are the known baseline on this lane (seed-1003 fuzz, mad/mac contraction, promoted-UAV-clear driver gap, PR #2490); none caused by this PR. Targeted run of the rm_sqrt/rm_mad qNaN/denormal tests: the three matching new-behavior tests passed; the one failure in the same filter is the pre-existing baseline `gpu_nonfused_mad_and_mac_prevent_fma_contraction`, which stays red on this lane with this PR (unchanged from main). Flagging that explicitly since this PR touches that machinery. **Not tested**: retail titles (no title data on this lane, counts only). **AI use**: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting.
luckyteagirl commented 2026-11-26 00:05:41 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-25T23:31:01Z.


RX 6800M focused validation on exact PR head b3fced11b79fe70204212a03ec78e60dca110eb9 (Windows 11 build 26200, Radeon RX 6800M driver 30.0.13002.13003, Rust 1.99.0 MSVC, DXC/DXIL 1.8.2502.11):

XCL_ADAPTER=6800M XCL_REQUIRE_GPU=1 XCL_DIRECT_DXIL=1 cargo test --locked -p xcl --lib -j 1 gpu_direct_f32_round_sqrt_negative_denormals_and_specials -- --test-threads=1 --show-output passed on an isolated target directory: 1 passed, 0 failed, 0 ignored, 0 SKIPPED (1,325 filtered out). The fixture ran on native RDNA2 hardware, exercising the new negative-denormal/special-value cases in direct DXIL. The memory guard did not stop this completed run.

A prior cold compile stopped at the memory guard before testing. A later attempt with a target directory shared across worktrees incorrectly reused another PR's test binary and selected zero tests; I detected that in the libtest summary, discarded it, and rebuilt in the isolated target for the result above. Neither earlier attempt is counted as a pass.

Not tested: full GPU workspace suite, release binary, paired title smoke, other adapters/drivers, or a full title path through these instructions. No game data was uploaded.

AI use: OpenAI Codex (GPT-6; exact variant unavailable) ran the guarded exact-head test, checked the binary/test selection and logs, and drafted this report.

<!-- greyfinch-sync:ivall/xcl:comment:7177669914 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2534#issuecomment-7177669914). Originally posted by [luckyteagirl](https://github.com/luckyteagirl) on 2026-11-25T23:31:01Z. --- **RX 6800M focused validation on exact PR head `b3fced11b79fe70204212a03ec78e60dca110eb9`** (Windows 11 build 26200, Radeon RX 6800M driver `30.0.13002.13003`, Rust 1.99.0 MSVC, DXC/DXIL 1.8.2502.11): `XCL_ADAPTER=6800M XCL_REQUIRE_GPU=1 XCL_DIRECT_DXIL=1 cargo test --locked -p xcl --lib -j 1 gpu_direct_f32_round_sqrt_negative_denormals_and_specials -- --test-threads=1 --show-output` passed on an **isolated target directory**: **1 passed, 0 failed, 0 ignored, 0 SKIPPED** (1,325 filtered out). The fixture ran on native RDNA2 hardware, exercising the new negative-denormal/special-value cases in direct DXIL. The memory guard did not stop this completed run. A prior cold compile stopped at the memory guard before testing. A later attempt with a target directory shared across worktrees incorrectly reused another PR's test binary and selected **zero tests**; I detected that in the libtest summary, discarded it, and rebuilt in the isolated target for the result above. Neither earlier attempt is counted as a pass. **Not tested:** full GPU workspace suite, release binary, paired title smoke, other adapters/drivers, or a full title path through these instructions. No game data was uploaded. **AI use:** OpenAI Codex (GPT-6; exact variant unavailable) ran the guarded exact-head test, checked the binary/test selection and logs, and drafted this report.
throny commented 2026-11-27 20:17:48 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-27T20:17:48Z.


merge-check claim
head: b3fced11b7

<!-- greyfinch-sync:ivall/xcl:comment:7227365229 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2534#issuecomment-7227365229). Originally posted by [throny](https://github.com/throny) on 2026-11-27T20:17:48Z. --- merge-check claim head: b3fced11b79fe70204212a03ec78e60dca110eb9
throny commented 2026-11-27 20:32:08 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-27T20:32:08Z.


merge-check
base: 6089122a
head: b3fced11b7
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 1467 passed, 0 failed, 47 ignored (26 SKIPPED lines); base alone: 1465 passed, 0 failed, 47 ignored
review: no defect. rm_sqrt: signed zero and +inf pass through, negatives (preserved denormals and -inf included) and NaN give the quiet NaN; the old code fell back to the native square root, which flushes denormals. rm_mad is an equivalent by_mode form. The three new tests fail on main by reading the code (not run there). Not verified: NaN inputs lose their payload; whether the hardware keeps denormals in the mad product, which one expectation assumes.
performance: direct DXIL only, fewer instructions under directed rounding; only XCL_DIRECT_DXIL users re-translate (reasoned).
verdict: safe to merge
hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).

<!-- greyfinch-sync:ivall/xcl:comment:7227598360 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2534#issuecomment-7227598360). Originally posted by [throny](https://github.com/throny) on 2026-11-27T20:32:08Z. --- merge-check base: 6089122a head: b3fced11b79fe70204212a03ec78e60dca110eb9 merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 1467 passed, 0 failed, 47 ignored (26 SKIPPED lines); base alone: 1465 passed, 0 failed, 47 ignored review: no defect. rm_sqrt: signed zero and +inf pass through, negatives (preserved denormals and -inf included) and NaN give the quiet NaN; the old code fell back to the native square root, which flushes denormals. rm_mad is an equivalent by_mode form. The three new tests fail on main by reading the code (not run there). Not verified: NaN inputs lose their payload; whether the hardware keeps denormals in the mad product, which one expectation assumes. performance: direct DXIL only, fewer instructions under directed rounding; only XCL_DIRECT_DXIL users re-translate (reasoned). verdict: safe to merge hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).
KOLESNiii commented 2026-11-28 00:18:51 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-28T00:18:51Z.


merge-check claim
head: b3fced11b7

<!-- greyfinch-sync:ivall/xcl:comment:7230815133 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2534#issuecomment-7230815133). Originally posted by [KOLESNiii](https://github.com/KOLESNiii) on 2026-11-28T00:18:51Z. --- merge-check claim head: b3fced11b79fe70204212a03ec78e60dca110eb9
KOLESNiii commented 2026-11-28 01:10:53 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-28T01:10:53Z.


merge-check
base: 2c717a043c
head: b3fced11b7
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 1468 passed, 0 failed, 47 ignored, 25 SKIPPED: 21 no wave64, 3 per-lane f16/f32 forms refused (#1426 semantics), 1 no heap windows; failing: none. The suite ran on this PC at the same time as 5 other PRs' suites, in one queued job.
review: none. Whole diff read (lower_round.rs rm_mad via by_mode, rm_sqrt special values; round_tests.rs reference + 2 tests). Under a directed round mode v_sqrt_f32 now returns canonical qNaN for negative inputs (also preserved denormals) and NaN, +inf for +inf, and +/-0 for zeros instead of falling back to the native Sqrt (which flushes denormals); v_mad_f32 goes through by_mode, so a constant RNE mode folds to the native mad.
performance: reasoned, not measured: shaders in the default round mode are unchanged (constant RNE folds to native); shaders that set the round mode at run time get the exact f64 path for v_mad_f32 in their directed branch.
verdict: safe to merge
hardware / tool and model: Windows 11 build 26300.9974, NVIDIA GeForce RTX 2070 SUPER 8 GB (driver 621.40, wave32 only), AMD Ryzen 5 3600XT; rustc 1.100.1 (20ddd0171 2026-11-25) x86_64-pc-windows-msvc, debug test profile; trial merge 5b9e2cdcf0db1cf50908586880d65c2bb0bc7454 (local, not pushed). Claude Code: Claude Opus 5.5 (coordination, full-diff review, draft).

<!-- greyfinch-sync:ivall/xcl:comment:7231479310 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2534#issuecomment-7231479310). Originally posted by [KOLESNiii](https://github.com/KOLESNiii) on 2026-11-28T01:10:53Z. --- merge-check base: 2c717a043c8488938179fca81da4bb9e7913a358 head: b3fced11b79fe70204212a03ec78e60dca110eb9 merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 1468 passed, 0 failed, 47 ignored, 25 SKIPPED: 21 no wave64, 3 per-lane f16/f32 forms refused (#1426 semantics), 1 no heap windows; failing: none. The suite ran on this PC at the same time as 5 other PRs' suites, in one queued job. review: none. Whole diff read (lower_round.rs rm_mad via by_mode, rm_sqrt special values; round_tests.rs reference + 2 tests). Under a directed round mode v_sqrt_f32 now returns canonical qNaN for negative inputs (also preserved denormals) and NaN, +inf for +inf, and +/-0 for zeros instead of falling back to the native Sqrt (which flushes denormals); v_mad_f32 goes through by_mode, so a constant RNE mode folds to the native mad. performance: reasoned, not measured: shaders in the default round mode are unchanged (constant RNE folds to native); shaders that set the round mode at run time get the exact f64 path for v_mad_f32 in their directed branch. verdict: safe to merge hardware / tool and model: Windows 11 build 26300.9974, NVIDIA GeForce RTX 2070 SUPER 8 GB (driver 621.40, wave32 only), AMD Ryzen 5 3600XT; rustc 1.100.1 (20ddd0171 2026-11-25) x86_64-pc-windows-msvc, debug test profile; trial merge 5b9e2cdcf0db1cf50908586880d65c2bb0bc7454 (local, not pushed). Claude Code: Claude Opus 5.5 (coordination, full-diff review, draft).
Gevroska commented 2026-11-28 02:04:30 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Gevroska on 2026-11-28T02:04:30Z.


I found no change in finite MAD results between base e1d84b7d and head b3fced11 on an RTX 3080 using direct DXIL. I ran the same fixture on both revisions. It dispatched the shader and read back the GPU registers for three directed rounding settings, each with subnormal flushing and preservation. All six base/head readbacks matched bit for bit.

Subnormal mode MAD with a subnormal input MUL with a positive subnormal product MUL with a negative subnormal product
Flush 0x3f800000 0x00000000 0x80000000
Preserve 0x3f800001 0x00400000 0x80400000

In the first column, the shader computes 1 + 2⁻¹⁴⁹ × 2¹²⁶. Preserving the input adds exactly one FP32 ULP to 1.0. Across all four lanes, including the normal control, MAD also matched a separate MUL followed by ADD on both revisions.

The focused test passed once per revision with zero failures or skips (Windows, NVIDIA driver 32.0.16.1692, DXC 1.9.2609.5). These inputs have exact arithmetic results, so they don’t distinguish the three rounding directions. The readbacks establish XCL’s behavior on this GPU; the console opcode’s behavior remains unverified.

I used OpenAI Codex with GPT-6.2 Sol to write and run the fixture. A separate GPT-6.2 Sol agent verified the arithmetic and saved readbacks. GPT-6.1 Terra checked for overlapping upstream reports. GPT-6.2 Astra drafted this comment.

I reviewed and approved this comment before posting.

<!-- greyfinch-sync:ivall/xcl:comment:7232112158 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2534#issuecomment-7232112158). Originally posted by [Gevroska](https://github.com/Gevroska) on 2026-11-28T02:04:30Z. --- I found no change in finite `MAD` results between base `e1d84b7d` and head `b3fced11` on an RTX 3080 using direct DXIL. I ran the same fixture on both revisions. It dispatched the shader and read back the GPU registers for three directed rounding settings, each with subnormal flushing and preservation. All six base/head readbacks matched bit for bit. | Subnormal mode | `MAD` with a subnormal input | `MUL` with a positive subnormal product | `MUL` with a negative subnormal product | |---|---|---|---| | Flush | `0x3f800000` | `0x00000000` | `0x80000000` | | Preserve | `0x3f800001` | `0x00400000` | `0x80400000` | In the first column, the shader computes `1 + 2⁻¹⁴⁹ × 2¹²⁶`. Preserving the input adds exactly one FP32 ULP to `1.0`. Across all four lanes, including the normal control, `MAD` also matched a separate `MUL` followed by `ADD` on both revisions. The focused test passed once per revision with zero failures or skips (Windows, NVIDIA driver `32.0.16.1692`, DXC `1.9.2609.5`). These inputs have exact arithmetic results, so they don’t distinguish the three rounding directions. The readbacks establish XCL’s behavior on this GPU; the console opcode’s behavior remains unverified. I used OpenAI Codex with GPT-6.2 Sol to write and run the fixture. A separate GPT-6.2 Sol agent verified the arithmetic and saved readbacks. GPT-6.1 Terra checked for overlapping upstream reports. GPT-6.2 Astra drafted this comment. I reviewed and approved this comment before posting.
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!2524
No description provided.