Recompiler: v_pack_b32_f16 applies the abs and neg half modifiers #1720

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

@⁠b3IKK on GitHub · 2026-11-24 19:52 UTC · original
b3IKK:recomp/v-pack-b32-f16-modifiers → main · +89 −5 · 4 files · 1 commits · open

Addresses XCL-BT-038 from #1488.

v_pack_b32_f16 built the packed dword from OP_SEL's halves and ignored the VOP3 abs / neg source modifiers, which the rest of the 16-bit paths (hb in valu16, and the v_cvt_pknorm_*_f16 pair) apply to the picked half's sign bit. A console shader that packs -|x| or -v on one half therefore got the source's own value, and the instruction had no test at all.

This applies both modifiers to the selected half, exactly as the pknorm conversions do, in both translators: the HLSL path (Em::valu) and the direct DXIL one (dxil::lower_valu), which lowers the instruction on its own.

Since the review (@⁠ddaikodaiko found the direct-DXIL gap, @⁠nnonno91 measured it on AMD and NVIDIA): the first version fixed the HLSL path only, so with XCL_DIRECT_DXIL=1 the modifiers were still dropped (-|2.0| packed 0x38004000, not 0x3800C000). The same two sign-bit operations are now in lower_valu.rs, and the GPU test runs the program through both translators whatever XCL_DIRECT_DXIL says. The change in lower_valu.rs was written here from the description of the gap, not taken from the fork commit linked in the review.

What is in it

  • crates/xcl/src/gpu/recomp/emit.rs: v_pack_b32_f16 applies abs (& 0x7FFF) and neg (^ 0x8000) to the half op_sel picks.
  • crates/xcl/src/gpu/dxil/lower_valu.rs: the same in the direct DXIL translator.
  • crates/xcl/src/gpu/dxil/kernel.rs: TRANSLATOR_VERSION 9 → 10 (the direct translator's output for these programs changes, and its sources are not in build.rs's hash). Other open direct-DXIL PRs bump the same line, so this will conflict with whichever merges first.
  • crates/xcl/src/gpu/recomp/tests.rs: pack_b32_f16_applies_the_half_modifiers (emitted HLSL; fails on main — the & 0x7FFF / ^ 0x8000 are absent) and GPU test gpu_pack_b32_f16_half_modifiers (pack, -|2.0|, op_sel high halves with |-4.0| and -(16.0), |-6.0|, through the default path and through the direct DXIL translator).

Tested

  • hardware (GPU + driver, CPU), Windows build, Rust version, debug / release: NVIDIA GeForce RTX 5080 (driver 32.0.16.1088), AMD Ryzen 9 9950X3D, Windows 11 10.0.26300, Rust 1.100.0 (stable-x86_64-pc-windows-msvc), DXC 1.9.2609.5, debug (scripts/test.ps1) and release (scripts/smoke.ps1)
  • .\scripts\test.ps1 (cargo build --workspace + cargo test --workspace -- --test-threads=4): 1156 passed, 0 failed, 46 ignored (SKIPPED: the wave64 / direct-DXIL per-lane tests that need 64-lane hardware or a semantics mode this adapter refuses, no heap windows, and cannot disable the driver cache (Windows Developer Mode is required))
  • cargo test -p xcl --lib -- pack_b32_f16: 2 passed, 0 failed, with XCL_DIRECT_DXIL unset and with XCL_DIRECT_DXIL=1
  • the same with the lower_valu.rs change taken out: 1 passed, 1 failed — direct DXIL, lane 0: -|2.0| packs -2.0, left: 939540480, right: 939573248 (0x38004000 / 0x3800C000, the values in the review)

Regression run

main (568e7db, clean tree, no local changes):

xcl-smoke v1
commit: 568e7db7729c8fa6c8f0f4b32d798faaf11462bb
gpu: NVIDIA GeForce RTX 5080
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1640 (PresentX 1640)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15360 MB

PR (94ecdd5, clean tree, no local changes):

xcl-smoke v1
commit: 94ecdd55d5f2a761ff498c1787c2ce4d46512f74
gpu: NVIDIA GeForce RTX 5080
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1640 (PresentX 1640)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15325 MB

Not tested

  • the full suite with XCL_DIRECT_DXIL=1 (only the two pack_b32_f16 tests ran with it)
  • AMD GPUs and native wave64 hardware on this head (@⁠nnonno91's AMD / RTX 5090 runs were on the previous head plus the equivalent direct-DXIL change)
  • other titles (Minecraft Preview, Unicorn Overlord, Fortnite, XDefiant) and Linux / Wine

AI use

  • OpenCode, Claude Fable 5.2: checked XCL-BT-038 against the code and the existing pknorm paths, wrote the fix in both translators and the tests (and confirmed each fails without it), rebased onto 689f2db, ran the test suite and scripts/smoke.ps1 regression runs, and drafted this PR description.
**@⁠b3IKK** on GitHub · 2026-11-24 19:52 UTC · [original](https://github.com/xcl-dev/xcl/pull/1720) `b3IKK:recomp/v-pack-b32-f16-modifiers` → `main` · +89 −5 · 4 files · 1 commits · open Addresses `XCL-BT-038` from #1488. `v_pack_b32_f16` built the packed dword from `OP_SEL`'s halves and ignored the VOP3 `abs` / `neg` source modifiers, which the rest of the 16-bit paths (`hb` in `valu16`, and the `v_cvt_pknorm_*_f16` pair) apply to the picked half's sign bit. A console shader that packs `-|x|` or `-v` on one half therefore got the source's own value, and the instruction had no test at all. This applies both modifiers to the selected half, exactly as the pknorm conversions do, in both translators: the HLSL path (`Em::valu`) and the direct DXIL one (`dxil::lower_valu`), which lowers the instruction on its own. **Since the review** (@⁠ddaikodaiko found the direct-DXIL gap, @⁠nnonno91 measured it on AMD and NVIDIA): the first version fixed the HLSL path only, so with `XCL_DIRECT_DXIL=1` the modifiers were still dropped (`-|2.0|` packed `0x38004000`, not `0x3800C000`). The same two sign-bit operations are now in `lower_valu.rs`, and the GPU test runs the program through both translators whatever `XCL_DIRECT_DXIL` says. The change in `lower_valu.rs` was written here from the description of the gap, not taken from the fork commit linked in the review. **What is in it** - `crates/xcl/src/gpu/recomp/emit.rs`: `v_pack_b32_f16` applies `abs` (`& 0x7FFF`) and `neg` (`^ 0x8000`) to the half `op_sel` picks. - `crates/xcl/src/gpu/dxil/lower_valu.rs`: the same in the direct DXIL translator. - `crates/xcl/src/gpu/dxil/kernel.rs`: `TRANSLATOR_VERSION` 9 → 10 (the direct translator's output for these programs changes, and its sources are not in `build.rs`'s hash). Other open direct-DXIL PRs bump the same line, so this will conflict with whichever merges first. - `crates/xcl/src/gpu/recomp/tests.rs`: `pack_b32_f16_applies_the_half_modifiers` (emitted HLSL; fails on `main` — the `& 0x7FFF` / `^ 0x8000` are absent) and GPU test `gpu_pack_b32_f16_half_modifiers` (pack, `-|2.0|`, `op_sel` high halves with `|-4.0|` and `-(16.0)`, `|-6.0|`, through the default path and through the direct DXIL translator). **Tested** - hardware (GPU + driver, CPU), Windows build, Rust version, debug / release: NVIDIA GeForce RTX 5080 (driver 32.0.16.1088), AMD Ryzen 9 9950X3D, Windows 11 10.0.26300, Rust 1.100.0 (`stable-x86_64-pc-windows-msvc`), DXC 1.9.2609.5, debug (`scripts/test.ps1`) and release (`scripts/smoke.ps1`) - `.\scripts\test.ps1` (`cargo build --workspace` + `cargo test --workspace -- --test-threads=4`): 1156 passed, 0 failed, 46 ignored (SKIPPED: the wave64 / direct-DXIL per-lane tests that need 64-lane hardware or a semantics mode this adapter refuses, `no heap windows`, and `cannot disable the driver cache (Windows Developer Mode is required)`) - `cargo test -p xcl --lib -- pack_b32_f16`: 2 passed, 0 failed, with `XCL_DIRECT_DXIL` unset and with `XCL_DIRECT_DXIL=1` - the same with the `lower_valu.rs` change taken out: 1 passed, 1 failed — `direct DXIL, lane 0: -|2.0| packs -2.0`, `left: 939540480, right: 939573248` (`0x38004000` / `0x3800C000`, the values in the review) **Regression run** main (`568e7db`, clean tree, no local changes): ``` xcl-smoke v1 commit: 568e7db7729c8fa6c8f0f4b32d798faaf11462bb gpu: NVIDIA GeForce RTX 5080 title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1640 (PresentX 1640) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15360 MB ``` PR (`94ecdd5`, clean tree, no local changes): ``` xcl-smoke v1 commit: 94ecdd55d5f2a761ff498c1787c2ce4d46512f74 gpu: NVIDIA GeForce RTX 5080 title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1640 (PresentX 1640) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15325 MB ``` **Not tested** - the full suite with `XCL_DIRECT_DXIL=1` (only the two `pack_b32_f16` tests ran with it) - AMD GPUs and native wave64 hardware on this head (@⁠nnonno91's AMD / RTX 5090 runs were on the previous head plus the equivalent direct-DXIL change) - other titles (Minecraft Preview, Unicorn Overlord, Fortnite, XDefiant) and Linux / Wine **AI use** - OpenCode, Claude Fable 5.2: checked `XCL-BT-038` against the code and the existing pknorm paths, wrote the fix in both translators and the tests (and confirmed each fails without it), rebased onto `689f2db`, ran the test suite and `scripts/smoke.ps1` regression runs, and drafted this PR description.
The VOP3 form's abs / neg source modifiers were dropped: the packed half
came out with the source's own sign and magnitude. On RDNA2 the modifiers
apply to the f16 value op_sel picks (LLVM writes them for -|x|), so
-v_pack_b32_f16(v, k), -x on one half -.5, packed the wrong half value.

Apply them to the selected half's sign bit, as the v_cvt_pknorm_*_f16
pair already does, in both translators: the HLSL path (emit.rs) and the
direct DXIL one (dxil/lower_valu.rs), which lowers the instruction on its
own and had the same gap (review of #1720: -|2.0| packed 0x38004000, not
0x3800C000). The direct translator's version goes to 10 (main's 9 plus this change), since its output
for these programs changes.

Test the instruction (it had none): the HLSL it emits, and the packed
values on the GPU through both translators.

Assisted-by: OpenCode (Claude Fable 5.2)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:02:39 +00:00
Author
Owner

@⁠ddaikodaiko on GitHub · 2026-11-24 19:58 UTC · original

One gap for this fix: the direct DXIL translator has the same bug in a second place.

crates/xcl/src/gpu/dxil/lower_valu.rs, the "v_pack_b32_f16" arm, builds the halves from SRC0/SRC1 and OP_SEL but ignores Mods::abs/Mods::neg:

let lo = if m.opsel & 1 == 1 { self.lshrc(a, 16) } else { self.andc(a, 0xFFFF) };
let hi = if m.opsel & 2 == 2 { self.lshrc(b, 16) } else { self.andc(b, 0xFFFF) };

so with XCL_DIRECT_DXIL=1 (or =all) the modifiers are still dropped. The same two sign-bit operations on each selected half fix it there: abs → andc(h, 0x7FFF), neg → xor(h, 0x8000), with indices 0/1 of m.abs/m.neg for the low/high half.

I have that as a fork commit (ddaikodaiko/xcl contrib/valupack-abs-neg 319a384, on top of 6c89285) and the existing GPU test gpu_v_pack_b32_f16_honors_abs_neg should pin it with XCL_DIRECT_DXIL=1; I could not build or run it here, so it is unverified. The 0xC0003C00 / 0x4000BC00 pair from the description is what both paths should produce.

This also applies to #1207 if it is kept separately. AI use: written with OpenCode (DeepSeek V4.1 Flash); the person submitting any code from this is responsible for running it.

**@⁠ddaikodaiko** on GitHub · 2026-11-24 19:58 UTC · [original](https://github.com/xcl-dev/xcl/pull/1720#issuecomment-7142869022) One gap for this fix: the direct DXIL translator has the same bug in a second place. `crates/xcl/src/gpu/dxil/lower_valu.rs`, the `"v_pack_b32_f16"` arm, builds the halves from `SRC0`/`SRC1` and `OP_SEL` but ignores `Mods::abs`/`Mods::neg`: ```rust let lo = if m.opsel & 1 == 1 { self.lshrc(a, 16) } else { self.andc(a, 0xFFFF) }; let hi = if m.opsel & 2 == 2 { self.lshrc(b, 16) } else { self.andc(b, 0xFFFF) }; ``` so with `XCL_DIRECT_DXIL=1` (or `=all`) the modifiers are still dropped. The same two sign-bit operations on each selected half fix it there: `abs` → `andc(h, 0x7FFF)`, `neg` → `xor(h, 0x8000)`, with indices 0/1 of `m.abs`/`m.neg` for the low/high half. I have that as a fork commit (`ddaikodaiko/xcl` `contrib/valupack-abs-neg` `319a384`, on top of `6c89285`) and the existing GPU test `gpu_v_pack_b32_f16_honors_abs_neg` should pin it with `XCL_DIRECT_DXIL=1`; I could not build or run it here, so it is unverified. The `0xC0003C00` / `0x4000BC00` pair from the description is what both paths should produce. This also applies to #1207 if it is kept separately. AI use: written with OpenCode (DeepSeek V4.1 Flash); the person submitting any code from this is responsible for running it.
Author
Owner

@⁠b3IKK on GitHub · 2026-11-24 21:49 UTC · original

Rebased onto 1d027e5 and re-ran both with the current scripts/smoke.ps1 (#677's hashed itle: line): 961 passed, 0 failed, 43 ignored.

**@⁠b3IKK** on GitHub · 2026-11-24 21:49 UTC · [original](https://github.com/xcl-dev/xcl/pull/1720#issuecomment-7145442829) Rebased onto 1d027e5 and re-ran both with the current scripts/smoke.ps1 (#677's hashed itle: line): 961 passed, 0 failed, 43 ignored.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-24 22:28 UTC · original

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~23 ignored.

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-24 22:28 UTC · [original](https://github.com/xcl-dev/xcl/pull/1720#issuecomment-7146279271) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~23 ignored. Thanks!
Author
Owner

@⁠b3IKK on GitHub · 2026-11-24 23:25 UTC · original

@⁠ddaikodaiko @⁠nnonno91 thank you both: the direct DXIL translator had the same gap, and the measurement (0x38004000 instead of 0x3800C000 at lane 0) is exactly what I get here without the change.

Pushed 3edf769 (rebased onto 689f2db):

  • dxil/lower_valu.rs: abs (& 0x7FFF) and neg (^ 0x8000) on the half op_sel picks, indices 0 / 1 for the low / high half, as in the HLSL path. I wrote this from the description of the gap rather than taking the fork commit, which its author said was not built or run.
  • gpu_pack_b32_f16_half_modifiers now runs the program through the default path and through the direct translator in the same test, so it does not depend on XCL_DIRECT_DXIL being set. With the lower_valu.rs change taken out it fails at direct DXIL, lane 0: -|2.0| packs -2.0 (left: 939540480, right: 939573248).
  • TRANSLATOR_VERSION goes 7 → 8, as kernel.rs asks for a change in the direct translator's output. Other open direct-DXIL PRs bump the same line, so one of us will have a one-line conflict.

Suite: 977 passed, 0 failed, 45 ignored. The two pack_b32_f16 tests pass with XCL_DIRECT_DXIL unset and with =1. Not run: the whole suite with XCL_DIRECT_DXIL=1, and AMD on this head.

On #1207: I have not looked at it.

AI use: OpenCode, Claude Fable 5.2 made the change, ran the tests and wrote this comment.

**@⁠b3IKK** on GitHub · 2026-11-24 23:25 UTC · [original](https://github.com/xcl-dev/xcl/pull/1720#issuecomment-7147376569) @⁠ddaikodaiko @⁠nnonno91 thank you both: the direct DXIL translator had the same gap, and the measurement (`0x38004000` instead of `0x3800C000` at lane 0) is exactly what I get here without the change. Pushed `3edf769` (rebased onto `689f2db`): - `dxil/lower_valu.rs`: `abs` (`& 0x7FFF`) and `neg` (`^ 0x8000`) on the half `op_sel` picks, indices 0 / 1 for the low / high half, as in the HLSL path. I wrote this from the description of the gap rather than taking the fork commit, which its author said was not built or run. - `gpu_pack_b32_f16_half_modifiers` now runs the program through the default path and through the direct translator in the same test, so it does not depend on `XCL_DIRECT_DXIL` being set. With the `lower_valu.rs` change taken out it fails at `direct DXIL, lane 0: -|2.0| packs -2.0` (`left: 939540480, right: 939573248`). - `TRANSLATOR_VERSION` goes 7 → 8, as `kernel.rs` asks for a change in the direct translator's output. Other open direct-DXIL PRs bump the same line, so one of us will have a one-line conflict. Suite: 977 passed, 0 failed, 45 ignored. The two `pack_b32_f16` tests pass with `XCL_DIRECT_DXIL` unset and with `=1`. Not run: the whole suite with `XCL_DIRECT_DXIL=1`, and AMD on this head. On #1207: I have not looked at it. AI use: OpenCode, Claude Fable 5.2 made the change, ran the tests and wrote this comment.
Author
Owner

@⁠b3IKK on GitHub · 2026-11-24 23:45 UTC · original

A correction to my comment above. I wrote "On #1207: I have not looked at it." That was wrong: #1207 is this account's own earlier PR for the same change (#1607, group D49, "one author: the same change"). I had not checked whose it was before answering.

The two do the same thing in emit.rs. This PR now also fixes the direct DXIL translator and tests both paths, so it is the one to keep. I am closing #1207 in its favour. What #1207 had that this one does not: its GPU test ran both wave sizes with a NaN payload. If a reviewer wants that case here, say so and I will add it.

AI use: OpenCode, Claude Fable 5.2 wrote this comment.

**@⁠b3IKK** on GitHub · 2026-11-24 23:45 UTC · [original](https://github.com/xcl-dev/xcl/pull/1720#issuecomment-7147768320) A correction to my comment above. I wrote "On #1207: I have not looked at it." That was wrong: #1207 is this account's own earlier PR for the same change (#1607, group D49, "one author: the same change"). I had not checked whose it was before answering. The two do the same thing in `emit.rs`. This PR now also fixes the direct DXIL translator and tests both paths, so it is the one to keep. I am closing #1207 in its favour. What #1207 had that this one does not: its GPU test ran both wave sizes with a NaN payload. If a reviewer wants that case here, say so and I will add it. AI use: OpenCode, Claude Fable 5.2 wrote this comment.
Author
Owner

@⁠raylitebull on GitHub · 2026-11-25 02:01 UTC · original

CI workflow approved for 3edf769.

Diff looks clean (emit.rs and dxil/lower_valu.rs apply abs/neg to the selected op_sel half). Remaining before merge: rebase onto current main (dropping the kernel.rs manual TRANSLATOR_VERSION bump since merged #1947 auto-hashes gpu/dxil/* via XCL_DIRECT_DXIL_SOURCE_ID), and obtain an AMD GPU verification pass on the rebased head.

**@⁠raylitebull** on GitHub · 2026-11-25 02:01 UTC · [original](https://github.com/xcl-dev/xcl/pull/1720#issuecomment-7150234647) `CI` workflow approved for `3edf769`. Diff looks clean (`emit.rs` and `dxil/lower_valu.rs` apply `abs`/`neg` to the selected `op_sel` half). **Remaining before merge:** rebase onto current `main` (dropping the `kernel.rs` manual `TRANSLATOR_VERSION` bump since merged `#1947` auto-hashes `gpu/dxil/*` via `XCL_DIRECT_DXIL_SOURCE_ID`), and obtain an **AMD** GPU verification pass on the rebased head.
Author
Owner

@⁠JJAutoCompare on GitHub · 2026-11-25 04:39 UTC · original

Tested

Independent Arc A770 verification of open PR #1720 at 3edf769e5a841ce271cd8f4ab99941f26d1ac704. The reused checkout was clean and detached at that SHA before and after.

STOR-WINLAB, Windows 11 Enterprise Evaluation 26200.9974, Ryzen 7 3800X, Intel Arc A770 driver 32.0.101.9175, Rust and Cargo 1.100.0 x86_64-pc-windows-msvc, DXC/DXIL 1.9.2609.5. The unoptimized build used two Cargo jobs with incremental compilation and debug info disabled.

cargo test --locked -p xcl --lib --no-run
$exe = 'L:/XclTooling/pr2008-dc0d25fe/target/debug/build/xcl/77aca8ccb20e299f/out/xcl-77aca8ccb20e299f.exe'
& $exe gpu::recomp::tests::pack_b32_f16_applies_the_half_modifiers --exact --nocapture --test-threads=1
& 'L:/XclTooling/Invoke-ArcTest.ps1' -Test {
    & $exe gpu::recomp::tests::gpu_pack_b32_f16_half_modifiers --exact --nocapture --test-threads=1
}

The build and CPU fixture ran outside the mutex. The CPU fixture confirmed HLSL uses & 0x7FFF for ABS and ^ 0x8000 for NEG. The GPU fixture dispatched HLSL/DXC and direct DXIL, with 512 output assertions across both backends. All 64 logical lanes matched the expected four dwords 0x38004000, 0x3800C000, 0xCC004400, and 0x4600C000. The cases covered unmodified low halves, ABS/NEG, high-half selection, and source-one ABS. The wrapper logged mutex release.

2 passed, 0 failed, 0 ignored, 0 skipped. Each fixture exited 0 and filtered out 952 tests. CPU took 0.02 s and GPU 0.68 s.

Not tested

Partial or zero EXEC masks, other adapters, the workspace suite, and retail smoke.

AI use

T3 Code / Codex (gpt-6.2-sol) ran the checked-in fixtures and wrote the test report.

**@⁠JJAutoCompare** on GitHub · 2026-11-25 04:39 UTC · [original](https://github.com/xcl-dev/xcl/pull/1720#issuecomment-7153046363) **Tested** Independent Arc A770 verification of open PR #1720 at `3edf769e5a841ce271cd8f4ab99941f26d1ac704`. The reused checkout was clean and detached at that SHA before and after. STOR-WINLAB, Windows 11 Enterprise Evaluation 26200.9974, Ryzen 7 3800X, Intel Arc A770 driver 32.0.101.9175, Rust and Cargo 1.100.0 x86_64-pc-windows-msvc, DXC/DXIL 1.9.2609.5. The unoptimized build used two Cargo jobs with incremental compilation and debug info disabled. ```powershell cargo test --locked -p xcl --lib --no-run $exe = 'L:/XclTooling/pr2008-dc0d25fe/target/debug/build/xcl/77aca8ccb20e299f/out/xcl-77aca8ccb20e299f.exe' & $exe gpu::recomp::tests::pack_b32_f16_applies_the_half_modifiers --exact --nocapture --test-threads=1 & 'L:/XclTooling/Invoke-ArcTest.ps1' -Test { & $exe gpu::recomp::tests::gpu_pack_b32_f16_half_modifiers --exact --nocapture --test-threads=1 } ``` The build and CPU fixture ran outside the mutex. The CPU fixture confirmed HLSL uses `& 0x7FFF` for ABS and `^ 0x8000` for NEG. The GPU fixture dispatched HLSL/DXC and direct DXIL, with 512 output assertions across both backends. All 64 logical lanes matched the expected four dwords `0x38004000`, `0x3800C000`, `0xCC004400`, and `0x4600C000`. The cases covered unmodified low halves, ABS/NEG, high-half selection, and source-one ABS. The wrapper logged mutex release. **2 passed, 0 failed, 0 ignored, 0 skipped.** Each fixture exited 0 and filtered out 952 tests. CPU took 0.02 s and GPU 0.68 s. **Not tested** Partial or zero EXEC masks, other adapters, the workspace suite, and retail smoke. **AI use** T3 Code / Codex (gpt-6.2-sol) ran the checked-in fixtures and wrote the test report.
Author
Owner

@⁠b3IKK on GitHub · 2026-11-25 10:48 UTC · original

Rebased onto 568e7db; the only conflict was TRANSLATOR_VERSION, which main had already taken to 9, so this head is 10. Head 94ecdd5: 1156 passed, 0 failed, 46 ignored, and the smoke pair in the description is 568e7db / 94ecdd5 run one after the other (both 1640 frames, 0 crashes, 0 device removals). AI use: OpenCode, Claude Fable 5.2.

**@⁠b3IKK** on GitHub · 2026-11-25 10:48 UTC · [original](https://github.com/xcl-dev/xcl/pull/1720#issuecomment-7160201470) Rebased onto `568e7db`; the only conflict was `TRANSLATOR_VERSION`, which `main` had already taken to 9, so this head is 10. Head `94ecdd5`: 1156 passed, 0 failed, 46 ignored, and the smoke pair in the description is `568e7db` / `94ecdd5` run one after the other (both 1640 frames, 0 crashes, 0 device removals). AI use: OpenCode, Claude Fable 5.2.
Author
Owner

@⁠zhouzhidong3-hash on GitHub · 2026-11-25 11:06 UTC · original

Independent RTX 5070 focused check of clean head 94ecdd55d5f2a761ff498c1787c2ce4d46512f74.

Windows 10 x64, i7-12700KF, RTX 5070 driver 591.86, Rust 1.100.0 MSVC debug, DXC/DXIL 1.8.2502.11, local D3D12 Agility SDK; XCL_ADAPTER=5070.

cargo test --locked -p xcl --lib pack_b32_f16 -- --test-threads=1 --nocapture

  • XCL_DIRECT_DXIL=0: 2 passed, 0 failed, 0 ignored, 1124 filtered out, 6.99 s.
  • XCL_DIRECT_DXIL=all: 2 passed, 0 failed, 0 ignored, 1124 filtered out, 0.26 s.
  • No skip messages. The GPU fixture exercises its selected default path and an explicit Direct DXIL container. The other test checks translation text.

Additional reproduction, separate from the clean-head run: copied this PR's test-only hunk onto older 7a1f5a2 with no runtime changes. The GPU test failed in both modes at -|2.0|, actual packed word 939540480 versus expected 939573248. Applying this PR's two runtime emitter hunks there (leaving that older tree's cache-version constant alone) made the two focused tests pass in both modes, without skips. This is a ported before/after control, not a parent-commit control for the rebased head.

Not tested: full workspace, Release, native wave64, AMD/Intel, retail smoke, or gameplay impact. Durations are single runs and are not a performance comparison.

Logs: nvidia-pr1720-head-0.log, nvidia-pr1720-head-all.log, nvidia-pack-before-{0,all}.log, nvidia-pack-after-{0,all}.log under I:\neospace\work\xcl-1994-5070.

AI assistance: OpenAI Codex ran the unchanged upstream tests, prepared and restored the older-tree control, checked the logs and drafted this report.

**@⁠zhouzhidong3-hash** on GitHub · 2026-11-25 11:06 UTC · [original](https://github.com/xcl-dev/xcl/pull/1720#issuecomment-7160589364) Independent RTX 5070 focused check of clean head `94ecdd55d5f2a761ff498c1787c2ce4d46512f74`. Windows 10 x64, i7-12700KF, RTX 5070 driver 591.86, Rust 1.100.0 MSVC debug, DXC/DXIL 1.8.2502.11, local D3D12 Agility SDK; `XCL_ADAPTER=5070`. `cargo test --locked -p xcl --lib pack_b32_f16 -- --test-threads=1 --nocapture` - `XCL_DIRECT_DXIL=0`: 2 passed, 0 failed, 0 ignored, 1124 filtered out, 6.99 s. - `XCL_DIRECT_DXIL=all`: 2 passed, 0 failed, 0 ignored, 1124 filtered out, 0.26 s. - No skip messages. The GPU fixture exercises its selected default path and an explicit Direct DXIL container. The other test checks translation text. Additional reproduction, separate from the clean-head run: copied this PR's test-only hunk onto older `7a1f5a2` with no runtime changes. The GPU test failed in both modes at `-|2.0|`, actual packed word 939540480 versus expected 939573248. Applying this PR's two runtime emitter hunks there (leaving that older tree's cache-version constant alone) made the two focused tests pass in both modes, without skips. This is a ported before/after control, not a parent-commit control for the rebased head. Not tested: full workspace, Release, native wave64, AMD/Intel, retail smoke, or gameplay impact. Durations are single runs and are not a performance comparison. Logs: nvidia-pr1720-head-0.log, nvidia-pr1720-head-all.log, nvidia-pack-before-{0,all}.log, nvidia-pack-after-{0,all}.log under I:\neospace\work\xcl-1994-5070. AI assistance: OpenAI Codex ran the unchanged upstream tests, prepared and restored the older-tree control, checked the logs and drafted this report.
Author
Owner

@⁠nnonno91 on GitHub · 2026-11-24 20:05 UTC · original · edited 2026-11-25 14:32 UTC

Retest on 94ecdd55d5f2a761ff498c1787c2ce4d46512f74

@⁠b3IKK The rebased head passed on my native-wave64 Radeon and RTX 5090. This resolves the direct-DXIL failure I reported below.

Tested

  • Clean detached head, Windows 11 25H2 build 26200.9974, Ryzen 7 9800X3D, Rust 1.100.0 MSVC, SDK DXC/DXIL 1.8.2502.11, unoptimized profile. AMD Radeon(TM) Graphics driver 32.0.21042.62 and RTX 5090 driver 32.0.16.1742.
  • Ran cargo test --locked -p xcl --lib pack_b32_f16 -- --nocapture --test-threads=1 with XCL_ADAPTER=AMD Radeon (XCL_REQUIRE_GPU=wave64) and XCL_ADAPTER=NVIDIA GeForce RTX 5090 in separate processes. Each gave 2 passed, 0 failed, 0 ignored and no skips. The fixtures covered four packed results across 64 lanes with each translation path on both GPUs.

Not tested

A retail title, the full workspace suite and partial EXEC masks in this retest.

AI use

OpenAI Codex (GPT-6.2 Sol) ran the retest and updated this report.


Independent GPU test of ca4c7df9a28c4f0079a5ee3b836b8d87fb76548d. The PR's HLSL path passes on AMD and NVIDIA. The same fixture reproduces the direct-DXIL sign-modifier gap reported above on both GPUs.

Tested

  • Windows 11 25H2 build 26200.9974, Ryzen 7 9800X3D, AMD Radeon(TM) Graphics (32.0.21042.62, native wave64), NVIDIA GeForce RTX 5090 (32.0.16.1742, split wave64), Rust 1.100.0 MSVC, Windows SDK DXC 1.8.2502.11, debug/test profiles. Selected GPUs using XCL_ADAPTER.
  • On the unmodified head, cargo build --workspace --locked passed. On AMD with the default shader settings, cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --show-output reported 860 passed, 0 failed, 42 ignored. One pass logged an explicit skip, heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows.
  • cargo test --locked -p xcl --lib gpu::recomp::tests::gpu_pack_b32_f16_half_modifiers -- --exact --nocapture produced the same result on both adapters in each configuration below. All targeted invocations reported 0 ignored and no skips.
Configuration AMD RTX 5090
PR head, XCL_DIRECT_DXIL=0 1 passed 1 passed
PR head, XCL_DIRECT_DXIL=1 1 failed 1 failed
PR head plus the local direct-DXIL diff, XCL_DIRECT_DXIL=1 1 passed 1 passed

In the direct failure the -|2.0| case stopped at lane 0, producing 0x38004000 instead of 0x3800C000. For the last row I temporarily applied only the lower_valu.rs diff from ddaikodaiko's fork commit 319a384 to the PR head. The fixture passed all four packed-word checks across 64 lanes on each GPU. I restored the worktree afterward.

Not tested

Retail-title output, a full workspace run with the local direct-DXIL diff, or the full workspace on NVIDIA.

AI use

OpenAI Codex (GPT-6 family, exact variant unavailable) ran and checked the tests and wrote this report.

**@⁠nnonno91** on GitHub · 2026-11-24 20:05 UTC · [original](https://github.com/xcl-dev/xcl/pull/1720#issuecomment-7143019013) · edited 2026-11-25 14:32 UTC **Retest on `94ecdd55d5f2a761ff498c1787c2ce4d46512f74`** @⁠b3IKK The rebased head passed on my native-wave64 Radeon and RTX 5090. This resolves the direct-DXIL failure I reported below. **Tested** - Clean detached head, Windows 11 25H2 build 26200.9974, Ryzen 7 9800X3D, Rust 1.100.0 MSVC, SDK DXC/DXIL 1.8.2502.11, unoptimized profile. AMD Radeon(TM) Graphics driver 32.0.21042.62 and RTX 5090 driver 32.0.16.1742. - Ran `cargo test --locked -p xcl --lib pack_b32_f16 -- --nocapture --test-threads=1` with `XCL_ADAPTER=AMD Radeon` (`XCL_REQUIRE_GPU=wave64`) and `XCL_ADAPTER=NVIDIA GeForce RTX 5090` in separate processes. Each gave 2 passed, 0 failed, 0 ignored and no skips. The fixtures covered four packed results across 64 lanes with each translation path on both GPUs. **Not tested** A retail title, the full workspace suite and partial EXEC masks in this retest. **AI use** OpenAI Codex (GPT-6.2 Sol) ran the retest and updated this report. --- Independent GPU test of `ca4c7df9a28c4f0079a5ee3b836b8d87fb76548d`. The PR's HLSL path passes on AMD and NVIDIA. The same fixture reproduces the direct-DXIL sign-modifier gap reported above on both GPUs. **Tested** - Windows 11 25H2 build 26200.9974, Ryzen 7 9800X3D, AMD Radeon(TM) Graphics (32.0.21042.62, native wave64), NVIDIA GeForce RTX 5090 (32.0.16.1742, split wave64), Rust 1.100.0 MSVC, Windows SDK DXC 1.8.2502.11, debug/test profiles. Selected GPUs using `XCL_ADAPTER`. - On the unmodified head, `cargo build --workspace --locked` passed. On AMD with the default shader settings, `cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --show-output` reported **860 passed, 0 failed, 42 ignored**. One pass logged an explicit skip, `heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows`. - `cargo test --locked -p xcl --lib gpu::recomp::tests::gpu_pack_b32_f16_half_modifiers -- --exact --nocapture` produced the same result on both adapters in each configuration below. All targeted invocations reported 0 ignored and no skips. | Configuration | AMD | RTX 5090 | | --- | --- | --- | | PR head, `XCL_DIRECT_DXIL=0` | 1 passed | 1 passed | | PR head, `XCL_DIRECT_DXIL=1` | 1 failed | 1 failed | | PR head plus the local direct-DXIL diff, `XCL_DIRECT_DXIL=1` | 1 passed | 1 passed | In the direct failure the `-|2.0|` case stopped at lane 0, producing `0x38004000` instead of `0x3800C000`. For the last row I temporarily applied only the `lower_valu.rs` diff from [ddaikodaiko's fork commit `319a384`](https://github.com/ddaikodaiko/xcl/commit/319a38468e4c8f6cf9219bb9cd4a393518284152) to the PR head. The fixture passed all four packed-word checks across 64 lanes on each GPU. I restored the worktree afterward. **Not tested** Retail-title output, a full workspace run with the local direct-DXIL diff, or the full workspace on NVIDIA. **AI use** OpenAI Codex (GPT-6 family, exact variant unavailable) ran and checked the tests and wrote this report.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-26 06:17 UTC · original

Re-verification on RTX 3060 Ti (Windows 11), new head merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.

Thanks!

— Devin

**@⁠DavidM1911** on GitHub · 2026-11-26 06:17 UTC · [original](https://github.com/xcl-dev/xcl/pull/1720#issuecomment-7184278079) Re-verification on RTX 3060 Ti (Windows 11), new head merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved. Thanks! — Devin
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1720/head:github-bot/gh-1720'
git switch 'github-bot/gh-1720'

Merge

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