Recompiler: D16 image loads of 32-bit integer texels saturate to 16 bits #2032

Open
upipibi wants to merge 5 commits from upstream-pr/2042 into main
upipibi commented 2026-11-25 01:44:38 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by upipibi on 2026-11-25T01:44:38Z.


Known: this PR's D16 normalization uses a 64-bit divide (d16_fmt in dxil/lower_mem.rs, norm16_rep in recomp/emit.rs), so every shader with a D16 load declares Int64 (SFI0 0x8000) in both backends. A 32-bit fix with tests is on upipibi/xcl branch fix/d16-norm16-no-int64 (af15e87, one commit on #2027's head; RTX 3070: gpu_buffer_d16 2/2 with XCL_DIRECT_DXIL=0 and =1, lib suite 1170 passed, 0 failed; a no-GPU test checks that the Int64 flag is clear for all 20 UNORM / SNORM D16 buffer and tbuffer loads). It isn't pushed here because a push needs a new title smoke pair, which I can't make. This PR is stacked on #2030 and gets it the same way.

Stacked on #2030 (itself on #2027): only the last commit (Recompiler: D16 image loads of 32-bit integer texels saturate to 16 bits) belongs to this PR. It edits the same image D16 packing as #2030. Part of #2026; XCL-BT-028 in #1489.

image_load with D16=1 kept the low 16 bits of a 32-bit UINT / SINT texel, so 70000 loaded as 0x1170. RDNA2 saturates instead: UINT to 0xFFFF, SINT to -32768..32767 (boykopovar/AnyPS5#22750, gfx1036). A second native gfx1036 measurement (through HIP, by andrewpozdnakov7-jpg in Marvisak/VIctory#2125) agrees: D16 loads of R32 and R32G32 UINT/SINT saturate, including values where saturation and keeping the low 16 bits differ, on image_load and image_load_mip (mip 0) for 1D, 2D, 2D array and 3D. This is the image counterpart of #1977's buffer change.

Overlap with #1565 (#1607 group D94): both saturate integer channels in the HLSL emitter's image-load D16 packing, and those hunks conflict (emit.rs, tests.rs), so whichever lands second needs a rebase there. #1565 also keeps the destination register's high half when the last channel is odd (main and this PR write 0 there); I haven't measured which one RDNA2 does. This PR also covers the direct DXIL backend (dxil/lower_image.rs, lower_mem.rs) and, with #2030 under it, the buffer, sample and gather D16 paths, which #1565 doesn't touch.

What is in it

  • recomp/emit.rs: the image-load D16 half closure saturates integer channels by class (min(e, 0xFFFF) for UINT, a clamp for SINT) instead of & 0xFFFF.
  • dxil/lower_image.rs: Lw::d16_int, used at the load and MSAA-load D16 sites.
  • recomp/tests.rs: gpu_image_d16_loads_saturate_32_bit_integers covers R32_UINT and R32_SINT textures with values in range and past both ends.

8- and 16-bit integer formats never leave that range, so they're unchanged.

  • The branch is now all of #2030 at aabd307 with this PR's commit on top (rebased from c4ed6ae for Kalmarv's merge-check finding: aabd307 packs every tap of an HLSL D16 gather with the gathered component's format). So it also carries #2030's c4ed6ae (the D16 rule in #1951's direct gather4_l and UNORM=1 sample paths) and aabd307.

Tested

At the current head 8363419 (rebased onto #2030's new head e297589, itself on main e99b0bd, 2026-12-03): NVIDIA GeForce RTX 3070, driver 621.40, Windows 11 Pro, rustc 1.100.0, debug.

  • cargo test -p xcl --lib -- --test-threads=4: 2868 passed, 0 failed, 37 ignored
  • gpu_image_d16_ (5 tests with this PR's), 3 runs each with XCL_DIRECT_DXIL=0 and =1: 5 passed, 0 failed every run

Earlier, at d11c796:

  • At d11c796 (this commit, unchanged, on #2030's aabd307), RTX 3070 (616.56): d16 tests 11 of 11 (with the R10G10B10A2 gather case aabd307 adds) and gpu_ suite (--skip gpu_sparse_vram) 150 passed, 0 failed, 1 ignored, with XCL_DIRECT_DXIL=0 and with =1.
  • At 9dd6a33 (this commit on #2030's c4ed6ae, main 426a5a74), RTX 3070 (616.56): d16 tests 11 of 11 and gpu_ suite (--skip gpu_sparse_vram) 150 passed, 0 failed, 1 ignored, with XCL_DIRECT_DXIL=0 and with =1.
  • At 270774b (rebased onto main 426a5a74, the first main with green CI after 5478c4a7, whose two failing tests main fixed in 0d13b071), RTX 3070 (616.56): gpu_ suite (--skip gpu_sparse_vram) 148 passed, 0 failed with XCL_DIRECT_DXIL=0 and with =1. main 426a5a74 gives 143 passed on both.
  • At 4bfb5f4, RTX 3070 (616.56): d16 tests 9 of 9 on both paths; gpu_ suite: 137 passed with XCL_DIRECT_DXIL=0; with 1, 136 passed and 1 failed: gpu_image_get_resinfo_1d_array, which fails on main too (#2046). CI Build and test: passing.
  • Earlier, on an RTX 3070 (Ampere, driver 616.56), Windows 11, debug, on main 5ce558f (rebased; #1947 now keys the translated cache on the gpu/dxil sources, so there is no TRANSLATOR_VERSION bump):
  • new test: without the fix it fails on both paths (32_UINT 0x11170: 0x1170, want 0xffff). With it, it passes with XCL_DIRECT_DXIL=0 and 1.
  • gpu_ tests (--skip gpu_sparse_vram), with the whole stack (#2027, #2030, #2042): 135 passed with XCL_DIRECT_DXIL=0; with 1, 134 passed and 1 failed, gpu_image_get_resinfo_1d_array, which fails the same way on main 5ce558f (#2046 fixes it).
  • dxil:: and buffer_format units: 138 passed.

Regression run

The pair below is for the earlier head d11c796; a pair on 8363419 is needed.

Needs a new pair for d11c796: the rebase onto #2030's aabd307 changed the head, and I can't make a title run. The pair below is for the previous head 9dd6a33 (the same commit on #2030's c4ed6ae) against main 1a0bbe3, run by thehollowedone (comment, thanks): RTX 3080 Ti (621.35), stock scripts/smoke.ps1, clean release builds, 60 s offline. Pasted unedited.

xcl-smoke v1
commit: 1a0bbe3a2ba91ea8f5b6fc29130a053868d3c9e6
gpu: NVIDIA GeForce RTX 3080 Ti
title: retail-private-fixture
seconds: 60
exit: 0x0
frames shown: 1634 (PresentX 1634)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14300 MB
xcl-smoke v1
commit: 9dd6a33c35e2f8f0c5955439e380bdb6018634d5
gpu: NVIDIA GeForce RTX 3080 Ti
title: retail-private-fixture
seconds: 60
exit: 0x0
frames shown: 1630 (PresentX 1630)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14351 MB

Earlier: The earlier pair, comment, was for 4bfb5f4, before the rebase onto main 5478c4a7..

Not tested

  • AMD, titles.

AI use

  • AI-assisted (Claude Code, Claude Opus 5.5): wrote the change, the tests and this description, and ran the tests above. Synthetic tests only; no game files.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:issue:5483506843 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2042). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-25T01:44:38Z. --- **Known:** this PR's D16 normalization uses a 64-bit divide (`d16_fmt` in `dxil/lower_mem.rs`, `norm16_rep` in `recomp/emit.rs`), so every shader with a D16 load declares Int64 (SFI0 `0x8000`) in both backends. A 32-bit fix with tests is on `upipibi/xcl` branch `fix/d16-norm16-no-int64` (`af15e87`, one commit on #2027's head; RTX 3070: `gpu_buffer_d16` 2/2 with `XCL_DIRECT_DXIL=0` and `=1`, lib suite 1170 passed, 0 failed; a no-GPU test checks that the Int64 flag is clear for all 20 UNORM / SNORM D16 buffer and tbuffer loads). It isn't pushed here because a push needs a new title smoke pair, which I can't make. This PR is stacked on #2030 and gets it the same way. Stacked on #2030 (itself on #2027): only the last commit (`Recompiler: D16 image loads of 32-bit integer texels saturate to 16 bits`) belongs to this PR. It edits the same image D16 packing as #2030. Part of #2026; XCL-BT-028 in #1489. `image_load` with `D16=1` kept the low 16 bits of a 32-bit UINT / SINT texel, so 70000 loaded as `0x1170`. RDNA2 saturates instead: UINT to `0xFFFF`, SINT to `-32768..32767` (boykopovar/AnyPS5#22750, gfx1036). A second native gfx1036 measurement (through HIP, by andrewpozdnakov7-jpg in [Marvisak/VIctory#2125](https://github.com/Marvisak/VIctory/pull/2125#issuecomment-7160370723)) agrees: D16 loads of R32 and R32G32 UINT/SINT saturate, including values where saturation and keeping the low 16 bits differ, on `image_load` and `image_load_mip` (mip 0) for 1D, 2D, 2D array and 3D. This is the image counterpart of #1977's buffer change. **Overlap with #1565** (#1607 group D94): both saturate integer channels in the HLSL emitter's image-load D16 packing, and those hunks conflict (`emit.rs`, `tests.rs`), so whichever lands second needs a rebase there. #1565 also keeps the destination register's high half when the last channel is odd (`main` and this PR write 0 there); I haven't measured which one RDNA2 does. This PR also covers the direct DXIL backend (`dxil/lower_image.rs`, `lower_mem.rs`) and, with #2030 under it, the buffer, sample and gather D16 paths, which #1565 doesn't touch. **What is in it** - `recomp/emit.rs`: the image-load D16 `half` closure saturates integer channels by class (`min(e, 0xFFFF)` for UINT, a clamp for SINT) instead of `& 0xFFFF`. - `dxil/lower_image.rs`: `Lw::d16_int`, used at the load and MSAA-load D16 sites. - `recomp/tests.rs`: `gpu_image_d16_loads_saturate_32_bit_integers` covers R32_UINT and R32_SINT textures with values in range and past both ends. 8- and 16-bit integer formats never leave that range, so they're unchanged. - The branch is now all of #2030 at `aabd307` with this PR's commit on top (rebased from `c4ed6ae` for Kalmarv's merge-check finding: `aabd307` packs every tap of an HLSL D16 gather with the gathered component's format). So it also carries #2030's `c4ed6ae` (the D16 rule in #1951's direct `gather4_l` and `UNORM=1` sample paths) and `aabd307`. **Tested** At the current head 8363419 (rebased onto #2030's new head e297589, itself on `main` e99b0bd, 2026-12-03): NVIDIA GeForce RTX 3070, driver 621.40, Windows 11 Pro, rustc 1.100.0, debug. - `cargo test -p xcl --lib -- --test-threads=4`: 2868 passed, 0 failed, 37 ignored - `gpu_image_d16_` (5 tests with this PR's), 3 runs each with `XCL_DIRECT_DXIL=0` and `=1`: 5 passed, 0 failed every run Earlier, at d11c796: - At `d11c796` (this commit, unchanged, on #2030's `aabd307`), RTX 3070 (616.56): `d16` tests 11 of 11 (with the R10G10B10A2 gather case `aabd307` adds) and `gpu_` suite (`--skip gpu_sparse_vram`) 150 passed, 0 failed, 1 ignored, with `XCL_DIRECT_DXIL=0` and with `=1`. - At `9dd6a33` (this commit on #2030's `c4ed6ae`, `main` `426a5a74`), RTX 3070 (616.56): `d16` tests 11 of 11 and `gpu_` suite (`--skip gpu_sparse_vram`) 150 passed, 0 failed, 1 ignored, with `XCL_DIRECT_DXIL=0` and with `=1`. - At `270774b` (rebased onto `main` `426a5a74`, the first `main` with green CI after `5478c4a7`, whose two failing tests main fixed in `0d13b071`), RTX 3070 (616.56): `gpu_` suite (`--skip gpu_sparse_vram`) 148 passed, 0 failed with `XCL_DIRECT_DXIL=0` and with `=1`. `main` `426a5a74` gives 143 passed on both. - At `4bfb5f4`, RTX 3070 (616.56): `d16` tests 9 of 9 on both paths; `gpu_` suite: 137 passed with `XCL_DIRECT_DXIL=0`; with `1`, 136 passed and 1 failed: `gpu_image_get_resinfo_1d_array`, which fails on `main` too (#2046). CI Build and test: passing. - Earlier, on an RTX 3070 (Ampere, driver 616.56), Windows 11, debug, on `main` `5ce558f` (rebased; #1947 now keys the translated cache on the `gpu/dxil` sources, so there is no `TRANSLATOR_VERSION` bump): - new test: without the fix it fails on both paths (`32_UINT 0x11170`: `0x1170`, want `0xffff`). With it, it passes with `XCL_DIRECT_DXIL=0` and `1`. - `gpu_` tests (`--skip gpu_sparse_vram`), with the whole stack (#2027, #2030, #2042): 135 passed with `XCL_DIRECT_DXIL=0`; with `1`, 134 passed and 1 failed, `gpu_image_get_resinfo_1d_array`, which fails the same way on `main` `5ce558f` (#2046 fixes it). - `dxil::` and `buffer_format` units: 138 passed. **Regression run** The pair below is for the earlier head d11c796; a pair on 8363419 is needed. **Needs a new pair for `d11c796`**: the rebase onto #2030's `aabd307` changed the head, and I can't make a title run. The pair below is for the previous head `9dd6a33` (the same commit on #2030's `c4ed6ae`) against `main` `1a0bbe3`, run by thehollowedone ([comment](https://github.com/xcl-dev/xcl/pull/2042#issuecomment-7162523259), thanks): RTX 3080 Ti (621.35), stock `scripts/smoke.ps1`, clean release builds, 60 s offline. Pasted unedited. ``` xcl-smoke v1 commit: 1a0bbe3a2ba91ea8f5b6fc29130a053868d3c9e6 gpu: NVIDIA GeForce RTX 3080 Ti title: retail-private-fixture seconds: 60 exit: 0x0 frames shown: 1634 (PresentX 1634) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14300 MB ``` ``` xcl-smoke v1 commit: 9dd6a33c35e2f8f0c5955439e380bdb6018634d5 gpu: NVIDIA GeForce RTX 3080 Ti title: retail-private-fixture seconds: 60 exit: 0x0 frames shown: 1630 (PresentX 1630) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14351 MB ``` Earlier: The earlier pair, [comment](https://github.com/xcl-dev/xcl/pull/2042#issuecomment-7159477465), was for `4bfb5f4`, before the rebase onto `main` `5478c4a7`.. **Not tested** - AMD, titles. **AI use** - AI-assisted (Claude Code, Claude Opus 5.5): wrote the change, the tests and this description, and ran the tests above. Synthetic tests only; no game files. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
nnonno91 commented 2026-11-25 02:08:59 +00:00 (Migrated from github.com)

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


Tested

Independent Windows/D3D12 check on exact head 86e9cef31fd6cc7294f70f7a90d649e61a0dd62b. Windows 11 25H2 (26200.9974), Ryzen 7 9800X3D, Radeon(TM) Graphics (32.0.21042.62, native wave64) and RTX 5090 (32.0.16.1742, split wave64). Rust 1.100.0 x64 MSVC, DXC/DXIL 1.8.2502.11, unoptimized dev/test profiles with debug info off.

  • cargo build --workspace --locked passed.
  • cargo test --locked -p xcl --lib gpu::recomp::tests::gpu_image_d16_loads_saturate_32_bit_integers -- --exact --test-threads=1 --nocapture passed on both GPUs with XCL_DIRECT_DXIL=0 and 1 (1 passed, 0 failed, 0 ignored, 0 skipped per run).
  • cargo test --locked -p xcl --lib gpu::dxil::msaa_tests -- --test-threads=1 --nocapture passed on both GPUs (5 passed, 0 failed, 0 ignored, 0 skipped per run).
  • cargo test --locked -p xcl --test d16_integer_msaa_gpu_probe -- --exact d16_msaa_integer_reads_saturate_each_sample --test-threads=1 --nocapture used a temporary Direct DXIL probe with 4× MSAA R32_UINT and R32_SINT textures. It checked D16 IMAGE_LOAD and IMAGE_MSAA_LOAD against CPU saturation, including both signed limits and zero for slots past the sample count. Each GPU checked 64 single-sample and 256 packed-sample values per format. The probe also ran on parent 2d941f0c62772661a3c844f5f7767122ee31f39e, where it explicitly expected the old low-16-bit behavior. All four probe runs passed their assertions (1 passed, 0 failed, 0 ignored, 0 skipped per run).
Mismatches against saturation, per GPU Parent single / packed PR head single / packed
R32_UINT 20/64, 55/256 0/64, 0/256
R32_SINT 32/64, 82/256 0/64, 0/256

Not tested

Real-title smoke runs, the full workspace suite, and other multisample counts. The extra multisample probe covered Direct DXIL.

AI use

OpenAI Codex (GPT-6 family, exact variant unavailable) prepared and ran the temporary probe, checked the outputs, and drafted this report.

<!-- greyfinch-sync:ivall/xcl:comment:7149998463 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2042#issuecomment-7149998463). Originally posted by [nnonno91](https://github.com/nnonno91) on 2026-11-25T01:49:27Z. --- **Tested** Independent Windows/D3D12 check on exact head `86e9cef31fd6cc7294f70f7a90d649e61a0dd62b`. Windows 11 25H2 (26200.9974), Ryzen 7 9800X3D, Radeon(TM) Graphics (32.0.21042.62, native wave64) and RTX 5090 (32.0.16.1742, split wave64). Rust 1.100.0 x64 MSVC, DXC/DXIL 1.8.2502.11, unoptimized dev/test profiles with debug info off. - `cargo build --workspace --locked` passed. - `cargo test --locked -p xcl --lib gpu::recomp::tests::gpu_image_d16_loads_saturate_32_bit_integers -- --exact --test-threads=1 --nocapture` passed on both GPUs with `XCL_DIRECT_DXIL=0` and `1` (1 passed, 0 failed, 0 ignored, 0 skipped per run). - `cargo test --locked -p xcl --lib gpu::dxil::msaa_tests -- --test-threads=1 --nocapture` passed on both GPUs (5 passed, 0 failed, 0 ignored, 0 skipped per run). - `cargo test --locked -p xcl --test d16_integer_msaa_gpu_probe -- --exact d16_msaa_integer_reads_saturate_each_sample --test-threads=1 --nocapture` used a temporary Direct DXIL probe with 4× MSAA R32_UINT and R32_SINT textures. It checked D16 `IMAGE_LOAD` and `IMAGE_MSAA_LOAD` against CPU saturation, including both signed limits and zero for slots past the sample count. Each GPU checked 64 single-sample and 256 packed-sample values per format. The probe also ran on parent `2d941f0c62772661a3c844f5f7767122ee31f39e`, where it explicitly expected the old low-16-bit behavior. All four probe runs passed their assertions (1 passed, 0 failed, 0 ignored, 0 skipped per run). | Mismatches against saturation, per GPU | Parent single / packed | PR head single / packed | | --- | --- | --- | | R32_UINT | 20/64, 55/256 | 0/64, 0/256 | | R32_SINT | 32/64, 82/256 | 0/64, 0/256 | **Not tested** Real-title smoke runs, the full workspace suite, and other multisample counts. The extra multisample probe covered Direct DXIL. **AI use** OpenAI Codex (GPT-6 family, exact variant unavailable) prepared and ran the temporary probe, checked the outputs, and drafted this report.
raylitebull commented 2026-11-25 02:09:00 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-25T01:51:05Z.


Diff audit on 86e9cef looks clean (Lw::d16_int in lower_image.rs + matching emit.rs UINT/SINT clamp + gpu_image_d16_loads_saturate_32_bit_integers, already verified across RTX 3070, RTX 5090, and AMD iGPU).

Remaining before merge:

  1. Rebase once #2027 and #2030 rebase onto main (dropping the manual TRANSLATOR_VERSION bump in kernel.rs, since #1947 now auto-hashes gpu/dxil sources via XCL_DIRECT_DXIL_SOURCE_ID).
  2. Add paired xcl-smoke v1 blocks (main and PR) for PR description.
<!-- greyfinch-sync:ivall/xcl:comment:7150030736 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2042#issuecomment-7150030736). Originally posted by [raylitebull](https://github.com/raylitebull) on 2026-11-25T01:51:05Z. --- Diff audit on `86e9cef` looks clean (`Lw::d16_int` in `lower_image.rs` + matching `emit.rs` UINT/SINT clamp + `gpu_image_d16_loads_saturate_32_bit_integers`, already verified across RTX 3070, RTX 5090, and AMD iGPU). **Remaining before merge:** 1. Rebase once `#2027` and `#2030` rebase onto `main` (dropping the manual `TRANSLATOR_VERSION` bump in `kernel.rs`, since `#1947` now auto-hashes `gpu/dxil` sources via `XCL_DIRECT_DXIL_SOURCE_ID`). 2. Add paired `xcl-smoke v1` blocks (`main` and PR) for `PR description`.
JoaoPauluu commented 2026-11-25 03:05:38 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JoaoPauluu on 2026-11-25T02:20:32Z.


A run with vkd3d-proton as the host D3D12 (DXIL → SPIR-V through dxil-spirv, then the NVIDIA Vulkan driver), so the DXIL goes through a different compiler than the native-Windows runs here: this PR's test passes.

Tested

  • RTX 3060 12 GB (NVIDIA 620.70.06, 32-lane waves), i5-10400F, 16 GB, CachyOS (kernel 7.3.3), Proton Experimental 11.0-20261112 with the patched vkd3d-proton 3.1 from #257, DXC 1.9.2609.5. Release, cross-built for x86_64-pc-windows-gnu. 7add2e7 as it is (merge base with main 5ce558f), no uncommitted changes. The lib test binary runs under Wine, one test per process.
    • gpu_image_d16_loads_saturate_32_bit_integers: ok, not skipped
  • The two tests from #2027 and #2030 below it pass on this head too.

Not tested

  • the whole suite on this head, a retail title, native Windows, AMD.

AI use

  • Claude Code (Claude Opus 5.5) built the commit, ran the tests and wrote this report. The account owner asked for test reports to be posted and has not reviewed this one.
<!-- greyfinch-sync:ivall/xcl:comment:7150599223 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2042#issuecomment-7150599223). Originally posted by [JoaoPauluu](https://github.com/JoaoPauluu) on 2026-11-25T02:20:32Z. --- A run with vkd3d-proton as the host D3D12 (DXIL → SPIR-V through dxil-spirv, then the NVIDIA Vulkan driver), so the DXIL goes through a different compiler than the native-Windows runs here: this PR's test passes. **Tested** - RTX 3060 12 GB (NVIDIA 620.70.06, 32-lane waves), i5-10400F, 16 GB, CachyOS (kernel 7.3.3), Proton Experimental 11.0-20261112 with the patched vkd3d-proton 3.1 from #257, DXC 1.9.2609.5. Release, cross-built for `x86_64-pc-windows-gnu`. `7add2e7` as it is (merge base with `main` `5ce558f`), no uncommitted changes. The lib test binary runs under Wine, one test per process. - `gpu_image_d16_loads_saturate_32_bit_integers`: ok, not skipped - The two tests from #2027 and #2030 below it pass on this head too. **Not tested** - the whole suite on this head, a retail title, native Windows, AMD. **AI use** - Claude Code (Claude Opus 5.5) built the commit, ran the tests and wrote this report. The account owner asked for test reports to be posted and has not reviewed this one.
JJAutoCompare commented 2026-11-25 03:05:39 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T02:22:15Z.


Tested

Independent Windows/D3D12 check on clean PR #2042 head 7add2e7250844bec3c130835417ce3a33a6d498a, stacked on #2030 at 7009727951604107093a31e9bdc8775a0979a7d8. The PR head matched before and after execution.

  • Intel Arc A770 (driver 32.0.101.9175), AMD Ryzen 7 3800X, Windows 11 Enterprise Evaluation 26200.9974, Rust 1.100.0 x86_64-pc-windows-msvc, DXC/DXIL 1.9.2609.5, unoptimized test profile.
  • cargo test --locked -p xcl --lib -j 2 --no-run succeeded outside the Arc lock. CARGO_INCREMENTAL=0, CARGO_PROFILE_DEV_DEBUG=0, and CARGO_PROFILE_TEST_DEBUG=0.
  • With XCL_ADAPTER=A770, XCL_REQUIRE_GPU=wave64, and XCL_DXC_DIR set to the DXC 1.9.2609 x64 directory under %LOCALAPPDATA%, I ran this command under L:/XclTooling/Invoke-ArcTest.ps1 -WaitMinutes 60 -Test { … } once per backend.
$testExe = 'L:\XclTooling\pr1947-1831ec4-t3-97236edf\target\debug\build\xcl\97fdf2b9ff8e1482\out\xcl-97fdf2b9ff8e1482.exe'
& $testExe gpu::recomp::tests::gpu_image_d16_loads_saturate_32_bit_integers --exact --nocapture --test-threads=1
Backend Passed Failed Ignored GPU skips Filtered out
HLSL/DXC (XCL_DIRECT_DXIL=0) 1 0 0 0 1121
Direct DXIL (XCL_DIRECT_DXIL=1, no fallback in this test) 1 0 0 0 1121

Each run checked 64 lane results per format. R32_UINT saturated to 0xFFFF and R32_SINT saturated at both -32768 and 32767. In-range texels produced their expected values. This covers the signed and unsigned integer IMAGE_LOAD cases. The prior #2030 result covers normalized image conversion, and #1977 covers D16 buffer FormatLoad.

Not tested

MSAA and mip image loads, odd-channel high-half preservation, the full workspace suite, retail-title smoke runs, and other GPU adapters. The #2030 and #1977 tests were outside this run.

AI use

T3 Code / Codex (gpt-6.2-sol) ran the checked-in test on both backends, verified the logs, and drafted this report.

<!-- greyfinch-sync:ivall/xcl:comment:7150635724 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2042#issuecomment-7150635724). Originally posted by [JJAutoCompare](https://github.com/JJAutoCompare) on 2026-11-25T02:22:15Z. --- **Tested** Independent Windows/D3D12 check on clean PR #2042 head `7add2e7250844bec3c130835417ce3a33a6d498a`, stacked on #2030 at `7009727951604107093a31e9bdc8775a0979a7d8`. The PR head matched before and after execution. - Intel Arc A770 (driver 32.0.101.9175), AMD Ryzen 7 3800X, Windows 11 Enterprise Evaluation 26200.9974, Rust 1.100.0 `x86_64-pc-windows-msvc`, DXC/DXIL 1.9.2609.5, unoptimized test profile. - `cargo test --locked -p xcl --lib -j 2 --no-run` succeeded outside the Arc lock. `CARGO_INCREMENTAL=0`, `CARGO_PROFILE_DEV_DEBUG=0`, and `CARGO_PROFILE_TEST_DEBUG=0`. - With `XCL_ADAPTER=A770`, `XCL_REQUIRE_GPU=wave64`, and `XCL_DXC_DIR` set to the DXC 1.9.2609 x64 directory under `%LOCALAPPDATA%`, I ran this command under `L:/XclTooling/Invoke-ArcTest.ps1 -WaitMinutes 60 -Test { … }` once per backend. ```powershell $testExe = 'L:\XclTooling\pr1947-1831ec4-t3-97236edf\target\debug\build\xcl\97fdf2b9ff8e1482\out\xcl-97fdf2b9ff8e1482.exe' & $testExe gpu::recomp::tests::gpu_image_d16_loads_saturate_32_bit_integers --exact --nocapture --test-threads=1 ``` | Backend | Passed | Failed | Ignored | GPU skips | Filtered out | | --- | ---: | ---: | ---: | ---: | ---: | | HLSL/DXC (`XCL_DIRECT_DXIL=0`) | 1 | 0 | 0 | 0 | 1121 | | Direct DXIL (`XCL_DIRECT_DXIL=1`, no fallback in this test) | 1 | 0 | 0 | 0 | 1121 | Each run checked 64 lane results per format. `R32_UINT` saturated to `0xFFFF` and `R32_SINT` saturated at both `-32768` and `32767`. In-range texels produced their expected values. This covers the signed and unsigned integer `IMAGE_LOAD` cases. The prior #2030 result covers normalized image conversion, and #1977 covers D16 buffer `FormatLoad`. **Not tested** MSAA and mip image loads, odd-channel high-half preservation, the full workspace suite, retail-title smoke runs, and other GPU adapters. The #2030 and #1977 tests were outside this run. **AI use** T3 Code / Codex (`gpt-6.2-sol`) ran the checked-in test on both backends, verified the logs, and drafted this report.
DavidM1911 commented 2026-11-25 05:08:19 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T04:28:43Z.


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:7152878619 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2042#issuecomment-7152878619). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T04:28:43Z. --- 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!
Toons29 commented 2026-11-25 11:08:58 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Toons29 on 2026-11-25T10:16:48Z.


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

xcl-smoke v1
commit: 568e7db7729c8fa6c8f0f4b32d798faaf11462bb
gpu: AMD Radeon RX 9070
title: 34df7c50
seconds: 60
exit: 0x0
frames shown: 1566 (PresentX 1566)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14592 MB
xcl-smoke v1
commit: 4bfb5f41456b4220ec7cc0328751af05d60d041b
gpu: AMD Radeon RX 9070
title: 34df7c50
seconds: 60
exit: 0x0
frames shown: 1630 (PresentX 1630)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14661 MB

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

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

AI use: Claude Code (Claude Opus 5.5) built both trees and ran scripts/smoke.ps1; a script posted this right after the run, with both blocks exactly as printed.

<!-- greyfinch-sync:ivall/xcl:comment:7159477465 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2042#issuecomment-7159477465). Originally posted by [Toons29](https://github.com/Toons29) on 2026-11-25T10:16:48Z. --- Regression run of `4bfb5f41` on the retail title, for this PR's **Regression run** section. Both blocks are from `scripts/smoke.ps1` as printed, not edited: `main` on `568e7db7`, this PR on its head commit with no uncommitted changes, same title and time. ``` xcl-smoke v1 commit: 568e7db7729c8fa6c8f0f4b32d798faaf11462bb gpu: AMD Radeon RX 9070 title: 34df7c50 seconds: 60 exit: 0x0 frames shown: 1566 (PresentX 1566) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14592 MB ``` ``` xcl-smoke v1 commit: 4bfb5f41456b4220ec7cc0328751af05d60d041b gpu: AMD Radeon RX 9070 title: 34df7c50 seconds: 60 exit: 0x0 frames shown: 1630 (PresentX 1630) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14661 MB ``` Against the limits in CONTRIBUTING.md: 104 % of `main`'s frames, 100 % of its peak commit, no crash, no device removal. AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, `cargo build --release -p xcl`, 60 s, `XCL_NETWORK=0`. This is a regression check only: it does not show whether the run reaches the code this PR changes. AI use: Claude Code (Claude Opus 5.5) built both trees and ran `scripts/smoke.ps1`; a script posted this right after the run, with both blocks exactly as printed.
thehollowedone commented 2026-11-25 13:05:09 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-25T12:32:53Z.


Here is the requested scripts/smoke.ps1 pair from clean release builds of main 1a0bbe3 and PR head 9dd6a33.

RTX 3080 Ti (621.35), Ryzen 7 9800X3D, Windows 11 build 26300, Rust 1.99.1 MSVC. The 60 s offline runs used separate copies of the same starting profile and DXIL seed, no input, PSO preload off, a 16 GiB job commit cap, and a 12 GiB system commit floor.

xcl-smoke v1
commit: 1a0bbe3a2ba91ea8f5b6fc29130a053868d3c9e6
gpu: NVIDIA GeForce RTX 3080 Ti
title: retail-private-fixture
seconds: 60
exit: 0x0
frames shown: 1634 (PresentX 1634)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14300 MB
xcl-smoke v1
commit: 9dd6a33c35e2f8f0c5955439e380bdb6018634d5
gpu: NVIDIA GeForce RTX 3080 Ti
title: retail-private-fixture
seconds: 60
exit: 0x0
frames shown: 1630 (PresentX 1630)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14351 MB

On the exact head, cargo test --offline --locked -p xcl --lib gpu_image_d16_ -- --nocapture --test-threads=1 reported 5 passed, 0 failed, 0 ignored with each of XCL_DIRECT_DXIL=0 and =1. The unnormalized-coordinate case runs only in direct DXIL and returns early in HLSL, so four fixtures executed GPU work under HLSL and five under direct DXIL. The UINT/SINT saturation fixture ran in both modes.

The smoke pair covers startup. AMD hardware, Wine, and world load were outside this test.

AI-assisted. Codex (GPT-6, exact variant unavailable) ran the tests and drafted this report.

<!-- greyfinch-sync:ivall/xcl:comment:7162523259 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2042#issuecomment-7162523259). Originally posted by [thehollowedone](https://github.com/thehollowedone) on 2026-11-25T12:32:53Z. --- Here is the requested `scripts/smoke.ps1` pair from clean release builds of [main 1a0bbe3](https://github.com/xcl-dev/xcl/commit/1a0bbe3a2ba91ea8f5b6fc29130a053868d3c9e6) and [PR head 9dd6a33](https://github.com/xcl-dev/xcl/commit/9dd6a33c35e2f8f0c5955439e380bdb6018634d5). RTX 3080 Ti (621.35), Ryzen 7 9800X3D, Windows 11 build 26300, Rust 1.99.1 MSVC. The 60 s offline runs used separate copies of the same starting profile and DXIL seed, no input, PSO preload off, a 16 GiB job commit cap, and a 12 GiB system commit floor. ``` xcl-smoke v1 commit: 1a0bbe3a2ba91ea8f5b6fc29130a053868d3c9e6 gpu: NVIDIA GeForce RTX 3080 Ti title: retail-private-fixture seconds: 60 exit: 0x0 frames shown: 1634 (PresentX 1634) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14300 MB ``` ``` xcl-smoke v1 commit: 9dd6a33c35e2f8f0c5955439e380bdb6018634d5 gpu: NVIDIA GeForce RTX 3080 Ti title: retail-private-fixture seconds: 60 exit: 0x0 frames shown: 1630 (PresentX 1630) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14351 MB ``` On the exact head, `cargo test --offline --locked -p xcl --lib gpu_image_d16_ -- --nocapture --test-threads=1` reported 5 passed, 0 failed, 0 ignored with each of `XCL_DIRECT_DXIL=0` and `=1`. The unnormalized-coordinate case runs only in direct DXIL and returns early in HLSL, so four fixtures executed GPU work under HLSL and five under direct DXIL. The UINT/SINT saturation fixture ran in both modes. The smoke pair covers startup. AMD hardware, Wine, and world load were outside this test. AI-assisted. Codex (GPT-6, exact variant unavailable) ran the tests and drafted this report.
throny commented 2026-11-25 19:09:01 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-25T18:18:52Z.


Two contributors checked independently and found that #1565 solves the same problem (for #1489) in a different way: #1607, group D94. You may want to compare them with the other author and agree on one, or say in the PR why both are needed.

This is a hint from the community triage in #1607, not a maintainer decision.

AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.

<!-- greyfinch-sync:ivall/xcl:comment:7170738039 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2042#issuecomment-7170738039). Originally posted by [throny](https://github.com/throny) on 2026-11-25T18:18:52Z. --- <!-- xcl-1607-hint:D94 --> Two contributors checked independently and found that #1565 solves the same problem (for #1489) in a different way: #1607, group D94. You may want to compare them with the other author and agree on one, or say in the PR why both are needed. This is a hint from the community triage in #1607, not a maintainer decision. AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.
upstream-sync closed this pull request 2026-11-25 23:07:58 +00:00
CalvyPZ commented 2026-11-25 23:09:14 +00:00 (Migrated from github.com)

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


This PR has been marked as a duplicate and closed after multiple agreeing checks in #1607. If you believe this is incorrect please re-open with why.

<!-- greyfinch-sync:ivall/xcl:comment:7176698451 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2042#issuecomment-7176698451). Originally posted by [CalvyPZ](https://github.com/CalvyPZ) on 2026-11-25T22:42:46Z. --- This PR has been marked as a duplicate and closed after multiple agreeing checks in #1607. If you believe this is incorrect please re-open with why.
upipibi commented 2026-11-25 23:09:21 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by upipibi on 2026-11-25T22:58:17Z.


@CalvyPZ could you reopen this one? It isn't a duplicate by #1607's own checks: group D94 (#1565, #2042) has two checks, by oni-swr (7167979724) and NWProgramming00 (7170477355), and both read "different approaches". The table row says: "1565 saturates integer d16 loads and keeps the odd high half in the hlsl; 2042 saturates too but also rounds unorm / snorm d16 once, is sampler-aware, and changes the direct dxil" path.

What this PR covers that #1565 doesn't: the direct DXIL backend (dxil/lower_image.rs, lower_mem.rs), and, with #2030 under it, the buffer, sample and gather D16 paths. #1565 changes only the HLSL image-load packing. #1565 was closed at the same time; with both closed I found no other open PR for #1489's XCL-BT-028 on images (searched PR titles and bodies).

The two do conflict in emit.rs / tests.rs, so whichever lands second needs a rebase; I'm happy to do that on this side. I can't reopen it myself (GitHub refuses the reopen for the author here).

AI-assisted (Claude Code, Claude Opus 5.5).

<!-- greyfinch-sync:ivall/xcl:comment:7176996679 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2042#issuecomment-7176996679). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-25T22:58:17Z. --- @CalvyPZ could you reopen this one? It isn't a duplicate by #1607's own checks: group D94 (#1565, #2042) has two checks, by oni-swr ([7167979724](https://github.com/xcl-dev/xcl/issues/1607#issuecomment-7167979724)) and NWProgramming00 ([7170477355](https://github.com/xcl-dev/xcl/issues/1607#issuecomment-7170477355)), and both read "different approaches". The table row says: "1565 saturates integer d16 loads and keeps the odd high half in the hlsl; 2042 saturates too but also rounds unorm / snorm d16 once, is sampler-aware, and changes the direct dxil" path. What this PR covers that #1565 doesn't: the direct DXIL backend (`dxil/lower_image.rs`, `lower_mem.rs`), and, with #2030 under it, the buffer, sample and gather D16 paths. #1565 changes only the HLSL image-load packing. #1565 was closed at the same time; with both closed I found no other open PR for #1489's XCL-BT-028 on images (searched PR titles and bodies). The two do conflict in `emit.rs` / `tests.rs`, so whichever lands second needs a rebase; I'm happy to do that on this side. I can't reopen it myself (GitHub refuses the reopen for the author here). AI-assisted (Claude Code, Claude Opus 5.5).
upstream-sync reopened this pull request 2026-11-26 00:04:50 +00:00
DavidM1911 commented 2026-11-26 08:04:36 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T07:13:49Z.


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

<!-- greyfinch-sync:ivall/xcl:comment:7185233872 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2042#issuecomment-7185233872). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-26T07:13:49Z. --- 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
futurepro62 commented 2026-11-27 23:36:35 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-27T23:36:35Z.


NVIDIA and AMD full-suite run of head 9dd6a33c, on its own base 426a5a7 and merged with current main 2c717a04, to go with the reports above by JJAutoCompare, JoaoPauluu, thehollowedone, since none of them covers AMD. On its base, the one failure comes from changes made on main after that base (ea088a5); merged with main, both cards pass. The bare-head runs come first.

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace --no-fail-fast -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::recomp::lower_dxil::tests::mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests: 1238 passed, 0 failed, 44 ignored. SKIPPED (no wave64, no xgameruntime.dll): a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu, a_per_lane_2d_or_3d_group_runs_on_the_gpu, coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu, cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu, gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware, test_title_draws_with_a_root_signature_under_the_debug_layer, the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu.
  • The new tests ran and passed: gpu_buffer_d16_loads_of_32_bit_floats_truncate, gpu_buffer_d16_loads_of_16_bit_norms_round_once, gpu_image_d16_loads_of_unorm8_round_once, gpu_image_d16_filtered_samples_keep_the_blend, gpu_image_d16_gather4_l_of_unorm8_rounds_once, gpu_image_d16_unnormalized_samples_round_texels_once, gpu_image_d16_loads_saturate_32_bit_integers.
  • Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace --no-fail-fast -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1: 1248 passed, 1 failed, 46 ignored. SKIPPED: f16_programs_on_the_gpu (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), f32_programs_on_the_gpu (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), f32_programs_on_the_gpu (f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows), test_title_draws_with_a_root_signature_under_the_debug_layer (no xgameruntime.dll).
  • --skip leaves out tests that fail on main 2c717a04 too, not because of this PR. On NVIDIA: heap_window_out_of_memory_falls_back_to_the_switch_form (#1651), the four gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu tests, const_and_null_mask_operands_agree_with_hlsl_on_the_gpu and mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu (follow-up on #1651) fail because runner::skip_test turns their skips into failures under XCL_REQUIRE_GPU=mesh, and gpu::dxil::fuzz_tests seeds 70, 545, 1019 and 1507 fail CreateComputePipelineState with E_OUTOFMEMORY on this card (drivers 616.64 and 621.40). On AMD: fuzz_validate_and_gpu_1 fails on seed 540 (res[833] 0x7 vs CPU 0x6). The AMD run does not set XCL_REQUIRE_GPU.
  • AMD failures on this base: gpu_image_get_resinfo_past_last_level (ea088a5).
  • Merged with main 2c717a04 (git merge --no-ff, clean, local only): NVIDIA XCL_REQUIRE_GPU=mesh cargo test --workspace with the same skips: 1461 passed, 0 failed, 45 ignored; AMD Radeon iGPU (XCL_ADAPTER=radeon, same skips): 1472 passed, 0 failed, 47 ignored.

Not tested

  • a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
<!-- greyfinch-sync:ivall/xcl:comment:7230271788 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2042#issuecomment-7230271788). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-27T23:36:35Z. --- NVIDIA and AMD full-suite run of head `9dd6a33c`, on its own base `426a5a7` and merged with current `main` `2c717a04`, to go with the reports above by JJAutoCompare, JoaoPauluu, thehollowedone, since none of them covers AMD. On its base, the one failure comes from changes made on `main` after that base (`ea088a5`); merged with `main`, both cards pass. The bare-head runs come first. **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace --no-fail-fast -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::recomp::lower_dxil::tests::mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests`: **1238 passed, 0 failed, 44 ignored**. SKIPPED (no wave64, no xgameruntime.dll): `a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu`, `a_per_lane_2d_or_3d_group_runs_on_the_gpu`, `coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu`, `cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu`, `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`, `test_title_draws_with_a_root_signature_under_the_debug_layer`, `the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu`. - The new tests ran and passed: `gpu_buffer_d16_loads_of_32_bit_floats_truncate`, `gpu_buffer_d16_loads_of_16_bit_norms_round_once`, `gpu_image_d16_loads_of_unorm8_round_once`, `gpu_image_d16_filtered_samples_keep_the_blend`, `gpu_image_d16_gather4_l_of_unorm8_rounds_once`, `gpu_image_d16_unnormalized_samples_round_texels_once`, `gpu_image_d16_loads_saturate_32_bit_integers`. - Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, `XCL_ADAPTER=radeon`), `cargo test --workspace --no-fail-fast -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1`: **1248 passed, 1 failed, 46 ignored**. SKIPPED: `f16_programs_on_the_gpu` (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), `f16_programs_on_the_gpu` (f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), `f16_programs_on_the_gpu` (f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), `f16_programs_on_the_gpu` (f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), `f32_programs_on_the_gpu` (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), `f32_programs_on_the_gpu` (f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows), `test_title_draws_with_a_root_signature_under_the_debug_layer` (no xgameruntime.dll). - `--skip` leaves out tests that fail on main `2c717a04` too, not because of this PR. On NVIDIA: `heap_window_out_of_memory_falls_back_to_the_switch_form` (#1651), the four `gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu` tests, `const_and_null_mask_operands_agree_with_hlsl_on_the_gpu` and `mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu` ([follow-up on #1651](https://github.com/xcl-dev/xcl/issues/1651#issuecomment-7146069648)) fail because `runner::skip_test` turns their skips into failures under `XCL_REQUIRE_GPU=mesh`, and `gpu::dxil::fuzz_tests` seeds 70, 545, 1019 and 1507 fail `CreateComputePipelineState` with `E_OUTOFMEMORY` on this card (drivers 616.64 and 621.40). On AMD: `fuzz_validate_and_gpu_1` fails on seed 540 (`res[833]` 0x7 vs CPU 0x6). The AMD run does not set `XCL_REQUIRE_GPU`. - AMD failures on this base: `gpu_image_get_resinfo_past_last_level` (`ea088a5`). - **Merged with `main` `2c717a04`** (`git merge --no-ff`, clean, local only): NVIDIA `XCL_REQUIRE_GPU=mesh cargo test --workspace` with the same skips: **1461 passed, 0 failed, 45 ignored**; AMD Radeon iGPU (`XCL_ADAPTER=radeon`, same skips): **1472 passed, 0 failed, 47 ignored**. **Not tested** - a release build, a game (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
Kalmarv commented 2026-11-28 23:30:01 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-28T23:30:01Z.


merge-check
base: 227d2cb388
head: 9dd6a33c35
merge: clean (trial merge fdc7c39578a9e59951ed53e7d57a8ac07a2e1eed, local, not pushed; git diff --check clean)
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 (XCL_DXC_DIR = DXC 1.9.2609) -> 2602 passed, 0 failed, 49 ignored; SKIPPED: 26 (21 no wave64 on this 32-lane GPU, 3 per-lane f16/f32 forms refused (#1426 semantics), 2 no heap windows); failing: none. The PR's 7 new tests ran and passed on the default HLSL path; gpu_image_d16_unnormalized_samples_round_texels_once returns early there (direct DXIL only), so it passed without checking anything.
review: one blocking finding, in the part of the stack that comes from #2030 at c4ed6ae:

  1. The HLSL path packs D16 gathers with the wrong channel width. In recomp/emit.rs the sample/gather half closure calls f16(e), and f16 takes the component from the swizzle letter of e (comp_of). For a gather, e is {t}_r.x .. {t}_r.w, the four taps of the one DMASK component, so taps 1..3 are decoded as if they were components 1..3 of the format. The direct DXIL path does it right (comps.first() in lower_image.rs). Shown with a local probe (not pushed): IMAGE_GATHER4_L, D16=1, DMASK=1, T# format 50 (10_10_10_2_UNORM), red code 100 in both texels of a 2x1 texture, point sampler. Want 0x2E42 (100/1023 rounded once) in all four taps. With XCL_DIRECT_DXIL=1 the probe passes. On the default HLSL path it fails: [0x2E42, 0x2E42, 0x2E42, 0x0000] (tap 3 is re-quantized with alpha's 2-bit width). Any format whose channels differ in width (5_6_5, 10_10_10_2, 1_5_5_5 ...) is affected. #2030's current head aabd307 already has the fix (let component = if gather { comps[0] as u32 } else { comp_of(e) }), so rebasing this PR's commit onto #2030's current head should clear it. The existing gpu_image_d16_gather4_l_of_unorm8_rounds_once can't see this because every channel of 8_8_8_8 has the same width; a gather of red on 10_10_10_2 would.
    Not blocking: this PR's own commit (integer saturation: d16_int in the DXIL path, min / clamp in the HLSL image-load half) reads correctly, and gpu_image_d16_loads_saturate_32_bit_integers passed. The merge diff vs. main also carries all of #2030 (UNORM/SNORM rounded once, float D16 truncation, filtered-sample truncation), +632/-28 in 5 files, beyond what the title says; it is stated in the description. The Int64 divide the description lists as known is still in this head.
    performance: reasoned, not measured: every D16 UNORM/SNORM read gains a 64-bit integer divide per component in both backends (Int64 shader flag). NVIDIA has no native 64-bit integer divide, so it is emulated in a long instruction sequence. Only shaders with D16 reads pay it. The 32-bit variant the description mentions (af15e87) would remove it. No title run: Recompiler / Tier 1.
    verdict: not yet: the D16 gather taps on the HLSL path take the wrong channel width (finding 1); rebase onto #2030's current head (aabd307), which has the fix
    hardware / tool and model: NVIDIA GeForce RTX 5070 Ti 16 GB (driver 610.74, wave32 only), AMD Ryzen 9 9950X, Windows 11 build 26200; rustc 1.99.0, debug test profile, DXC 1.9.2609 via XCL_DXC_DIR. Claude Code, Claude Opus 5.5: merge, build, suite, the probe test and full-diff review; this report.
<!-- greyfinch-sync:ivall/xcl:comment:7247471831 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2042#issuecomment-7247471831). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-11-28T23:30:01Z. --- merge-check base: 227d2cb388f103268dac7635ea720eb3e5352d4e head: 9dd6a33c35e2f8f0c5955439e380bdb6018634d5 merge: clean (trial merge fdc7c39578a9e59951ed53e7d57a8ac07a2e1eed, local, not pushed; `git diff --check` clean) build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 (XCL_DXC_DIR = DXC 1.9.2609) -> 2602 passed, 0 failed, 49 ignored; SKIPPED: 26 (21 no wave64 on this 32-lane GPU, 3 per-lane f16/f32 forms refused (#1426 semantics), 2 no heap windows); failing: none. The PR's 7 new tests ran and passed on the default HLSL path; `gpu_image_d16_unnormalized_samples_round_texels_once` returns early there (direct DXIL only), so it passed without checking anything. review: one blocking finding, in the part of the stack that comes from #2030 at `c4ed6ae`: 1. The HLSL path packs D16 gathers with the wrong channel width. In `recomp/emit.rs` the sample/gather `half` closure calls `f16(e)`, and `f16` takes the component from the swizzle letter of `e` (`comp_of`). For a gather, `e` is `{t}_r.x` .. `{t}_r.w`, the four taps of the one DMASK component, so taps 1..3 are decoded as if they were components 1..3 of the format. The direct DXIL path does it right (`comps.first()` in `lower_image.rs`). Shown with a local probe (not pushed): `IMAGE_GATHER4_L`, `D16=1`, `DMASK=1`, T# format 50 (10_10_10_2_UNORM), red code 100 in both texels of a 2x1 texture, point sampler. Want `0x2E42` (100/1023 rounded once) in all four taps. With `XCL_DIRECT_DXIL=1` the probe passes. On the default HLSL path it fails: `[0x2E42, 0x2E42, 0x2E42, 0x0000]` (tap 3 is re-quantized with alpha's 2-bit width). Any format whose channels differ in width (5_6_5, 10_10_10_2, 1_5_5_5 ...) is affected. #2030's current head `aabd307` already has the fix (`let component = if gather { comps[0] as u32 } else { comp_of(e) }`), so rebasing this PR's commit onto #2030's current head should clear it. The existing `gpu_image_d16_gather4_l_of_unorm8_rounds_once` can't see this because every channel of 8_8_8_8 has the same width; a gather of red on 10_10_10_2 would. Not blocking: this PR's own commit (integer saturation: `d16_int` in the DXIL path, `min` / `clamp` in the HLSL image-load `half`) reads correctly, and `gpu_image_d16_loads_saturate_32_bit_integers` passed. The merge diff vs. main also carries all of #2030 (UNORM/SNORM rounded once, float D16 truncation, filtered-sample truncation), +632/-28 in 5 files, beyond what the title says; it is stated in the description. The Int64 divide the description lists as known is still in this head. performance: reasoned, not measured: every D16 UNORM/SNORM read gains a 64-bit integer divide per component in both backends (Int64 shader flag). NVIDIA has no native 64-bit integer divide, so it is emulated in a long instruction sequence. Only shaders with D16 reads pay it. The 32-bit variant the description mentions (`af15e87`) would remove it. No title run: Recompiler / Tier 1. verdict: not yet: the D16 gather taps on the HLSL path take the wrong channel width (finding 1); rebase onto #2030's current head (`aabd307`), which has the fix hardware / tool and model: NVIDIA GeForce RTX 5070 Ti 16 GB (driver 610.74, wave32 only), AMD Ryzen 9 9950X, Windows 11 build 26200; rustc 1.99.0, debug test profile, DXC 1.9.2609 via XCL_DXC_DIR. Claude Code, Claude Opus 5.5: merge, build, suite, the probe test and full-diff review; this report.
upipibi commented 2026-11-28 23:58:26 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by upipibi on 2026-11-28T23:58:26Z.


@Kalmarv thanks. Rebased: the head is now d11c796 = this PR's one commit on top of #2030's aabd307, which packs every gather tap with the gathered component's format. The commit applied unchanged.

Re-run on an RTX 3070 (wave32), cargo test -p xcl --lib d16: 11 passed, 0 failed. That includes gpu_image_d16_gather4_l_of_unorm8_rounds_once, which since aabd307 also gathers red from an R10G10B10A2 texture and checks all four lanes, and gpu_image_d16_loads_saturate_32_bit_integers.
Same with XCL_DIRECT_DXIL=0 and =1: gpu_ suite (--skip gpu_sparse_vram) 150 passed, 0 failed, 1 ignored.

The rebase changed the head, so the PR-description check now wants a new xcl-smoke pair on d11c796; the pair in the description is for 9dd6a33. I can't make a title run here.

<!-- greyfinch-sync:ivall/xcl:comment:7247785306 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2042#issuecomment-7247785306). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-28T23:58:26Z. --- @Kalmarv thanks. Rebased: the head is now `d11c796` = this PR's one commit on top of #2030's `aabd307`, which packs every gather tap with the gathered component's format. The commit applied unchanged. Re-run on an RTX 3070 (wave32), `cargo test -p xcl --lib d16`: 11 passed, 0 failed. That includes `gpu_image_d16_gather4_l_of_unorm8_rounds_once`, which since `aabd307` also gathers red from an R10G10B10A2 texture and checks all four lanes, and `gpu_image_d16_loads_saturate_32_bit_integers`. Same with `XCL_DIRECT_DXIL=0` and `=1`: `gpu_` suite (`--skip gpu_sparse_vram`) 150 passed, 0 failed, 1 ignored. The rebase changed the head, so the PR-description check now wants a new `xcl-smoke` pair on `d11c796`; the pair in the description is for `9dd6a33`. I can't make a title run here.
Foniass commented 2026-12-01 07:14:52 +00:00 (Migrated from github.com)

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


Triage (#1607) – head d11c796

Stacked on #2030 (itself on the merged #2027); only the top commit d11c796 is this PR's. It is not a duplicate of #2030.
Overlap with #1565 (#1607 D94): both saturate D16 image-load UINT/SINT texels in the HLSL emitter's half closure. #1565 also keeps vdst[31:16] on an odd channel count but covers only HLSL. This PR also covers direct DXIL (Lw::d16_int) but still writes 0 to the high half. The two approaches differ, and the emit.rs/tests.rs hunks will conflict.
Nit: in dxil/lower_image.rs the new d16_int sits under the existing /// Writes result components to VDATA doc line, so that line now documents d16_int, not image_result.
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:7303821673 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2042#issuecomment-7303821673). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T07:14:52Z. --- **Triage (#1607)** – head d11c796 Stacked on #2030 (itself on the merged #2027); only the top commit d11c796 is this PR's. It is not a duplicate of #2030. Overlap with #1565 (#1607 D94): both saturate D16 image-load UINT/SINT texels in the HLSL emitter's `half` closure. #1565 also keeps vdst[31:16] on an odd channel count but covers only HLSL. This PR also covers direct DXIL (`Lw::d16_int`) but still writes 0 to the high half. The two approaches differ, and the emit.rs/tests.rs hunks will conflict. Nit: in `dxil/lower_image.rs` the new `d16_int` sits under the existing `/// Writes result components to VDATA` doc line, so that line now documents `d16_int`, not `image_result`. 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/2042:upstream-pr/2042'
git switch 'upstream-pr/2042'

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