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

Open
github-bot wants to merge 6 commits from github-bot/gh-2042 into main AGit
Owner

@⁠upipibi on GitHub · 2026-11-25 01:44 UTC · original
upipibi:fix/image-d16-int-saturate → main · +632 −28 · 5 files · 6 commits · open

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 c4ed6ae with this PR's commit on top (it used to sit in the middle, under copies of #2030's later commits). So it also carries #2030's c4ed6ae (the D16 rule in #1951's direct gather4_l and UNORM=1 sample paths).

Tested

  • 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
Pair for the current head 9dd6a33 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

**@⁠upipibi** on GitHub · 2026-11-25 01:44 UTC · [original](https://github.com/xcl-dev/xcl/pull/2042) `upipibi:fix/image-d16-int-saturate` → `main` · +632 −28 · 5 files · 6 commits · open **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 `c4ed6ae` with this PR's commit on top (it used to sit in the middle, under copies of #2030's later commits). So it also carries #2030's `c4ed6ae` (the D16 rule in #1951's direct `gather4_l` and `UNORM=1` sample paths). **Tested** - 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** Pair for the current head `9dd6a33` against `main` `1a0bbe3`, run by thehollowedone ([comment](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2042), 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://git.gtahub.st/github/xcl-dev--xcl/pulls/2042), 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)
A D16 buffer format load packed a UNORM / SNORM channel with f32tof16 of
the decoded f32: two roundings, the second toward zero on D3D12. RDNA2
rounds code / (2^w - 1) once to nearest even, so about half of all codes
came back one unit in the last place low (16_UNORM 0x0801: 0x2800 for
0x2801). That value's binary expansion repeats the w-bit code, so its
first 32 bits, floor((code << 32) / (2^w - 1)), decide the rounding and a
tie cannot happen. Both paths; checked against exact rounding for every
code at w = 2..16. #2026 (XCL-BT-020's third item).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
image_load / image_sample / image_gather4 with D16 packed each channel
with f32tof16 of the f32 the view returned: rounded twice, the second time
toward zero on D3D12. RDNA2 rounds code / (2^w - 1) once to nearest even:
123 of the 256 8_8_8_8_UNORM codes came back one unit in the last place
low (code 9: 0x2884 for 0x2885). The channels go through d16_fmt with the
T#'s format, as the buffer format loads do. #2026.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
d16_fmt passed float channels to f32tof16 / legacyF32ToF16, whose rounding
is the host's: it truncates on the RTX 3070 and WARP but rounds to nearest
under vkd3d-proton (Marvisak/VIctory#2006), where RDNA2 truncates
(boykopovar/AnyPS5#22750). Use f16_rtz in both paths, as the format
stores already do.

gpu_buffer_d16_loads_of_32_bit_floats_truncate loads 32_FLOAT values
that the two roundings tell apart (1 + 1.5 / 1.75 ulp, 65535, +/-70000,
a denormal half-way, -1.5, +inf).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit b0aae2ecbb5c92bda70990ab3cb75475e869fbeb)
d16_fmt reads a UNORM / SNORM value back as a code of the format and
rounds code / (2^w - 1) once. A load, a gather or a point-sampled texel is
such a code; a filtered sample is a blend of texels (or mips) and is not, so
rounding it to a code quantizes it again: half way between codes 0 and 255
gave 0x3804 (code 128), not 0x3800 (reported on #2030, RTX 3090 and AMD).

Both paths now pack a sample whose S# can filter (XY_MAG / XY_MIN_FILTER
not point, or MIP_FILTER linear, as desc::sampler_d3d12 maps them) with
f16_rtz of the host's value, as d16_fmt packs float channels. Gathers and
point samplers keep d16_fmt. A static sampler decides it when translating;
otherwise S# word 2 decides it when the shader runs. image_get_lod's D16
result, an LOD and not a texel, goes back to f32tof16 in the HLSL path, as
the direct DXIL path packs it.

gpu_image_d16_filtered_samples_keep_the_blend samples a 2x1 RGBA8_UNORM
texture between codes 0 and 255 with heap and static linear samplers and
checks f16_rtz of the f32 sample in every lane (0x3800 half way), and codes
9 and 128 through heap and static point samplers (0x2885, 0x3804).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
#1951's direct DXIL paths for image_gather4_l (mimg_gather4_lod) and for
non-cube UNORM=1 sampling (mimg_unorm_sample) still packed D16 results
with f32tof16 / legacyF32ToF16, which truncates on the RTX 3070: 123 of
the 256 8_8_8_8_UNORM codes came back one unit in the last place low
(code 9: 0x2884 for 0x2885), the rounding #2030 fixed in the main sample
and gather path.

Both now take the T#'s format info and follow the main path's rule: a
gather returns texels of the one component DMASK names, rounded once
(d16_fmt); a sample through an S# that cannot filter does the same, a
filtered one keeps the host's blend truncated (f16_rtz). Unnormalized
coordinates still allow linear x / y filtering, so mimg_unorm_sample
uses the same Filters decision. The Filters enum and its decision move
out of the main path into d16_filters / d16_sample, shared by the three.

The HLSL path already packs gather4_l with d16_fmt (it lowers it as a
level-0 Gather) and rejects UNORM=1 sampling ("MIMG unorm"), so only the
direct path changes behaviour.

gpu_image_d16_gather4_l_of_unorm8_rounds_once gathers every component of
a 64x1 RGBA8_UNORM texture of codes 0..255 at LOD 0 (1024 taps, all 256
codes) against code / 255 rounded once; before this change the direct
path got 498 taps wrong, the HLSL path none.
gpu_image_d16_unnormalized_samples_round_texels_once (direct path only)
samples each texel's centre through a point S# (all 256 codes; 123 wrong
before) and the edge between two texels through a bilinear S#
(f16_rtz of the f32 sample).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
image_load with D16 kept the low half of a 32-bit UINT / SINT texel (70000
loaded as 0x1170). RDNA2 saturates: UINT to 0xFFFF, SINT to -32768..32767
(AnyPS5#22750, gfx1036; XCL-BT-028 in #1489). 8- and 16-bit integer
formats never leave that range. Both paths. #2026.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:16:19 +00:00
Author
Owner

@⁠nnonno91 on GitHub · 2026-11-25 01:49 UTC · original

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.

**@⁠nnonno91** on GitHub · 2026-11-25 01:49 UTC · [original](https://github.com/xcl-dev/xcl/pull/2042#issuecomment-7149998463) **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.
Author
Owner

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

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.
**@⁠raylitebull** on GitHub · 2026-11-25 01:51 UTC · [original](https://github.com/xcl-dev/xcl/pull/2042#issuecomment-7150030736) 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`.
Author
Owner

@⁠JoaoPauluu on GitHub · 2026-11-25 02:20 UTC · original

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.
**@⁠JoaoPauluu** on GitHub · 2026-11-25 02:20 UTC · [original](https://github.com/xcl-dev/xcl/pull/2042#issuecomment-7150599223) 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.
Author
Owner

@⁠JJAutoCompare on GitHub · 2026-11-25 02:22 UTC · original

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.

**@⁠JJAutoCompare** on GitHub · 2026-11-25 02:22 UTC · [original](https://github.com/xcl-dev/xcl/pull/2042#issuecomment-7150635724) **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.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 04:28 UTC · original

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!

**@⁠DavidM1911** on GitHub · 2026-11-25 04:28 UTC · [original](https://github.com/xcl-dev/xcl/pull/2042#issuecomment-7152878619) 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!
Author
Owner

@⁠Toons29 on GitHub · 2026-11-25 10:16 UTC · original

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.

**@⁠Toons29** on GitHub · 2026-11-25 10:16 UTC · [original](https://github.com/xcl-dev/xcl/pull/2042#issuecomment-7159477465) 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.
Author
Owner

@⁠thehollowedone on GitHub · 2026-11-25 12:32 UTC · original

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.

**@⁠thehollowedone** on GitHub · 2026-11-25 12:32 UTC · [original](https://github.com/xcl-dev/xcl/pull/2042#issuecomment-7162523259) 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.
Author
Owner

@⁠throny on GitHub · 2026-11-25 18:18 UTC · original

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.

**@⁠throny** on GitHub · 2026-11-25 18:18 UTC · [original](https://github.com/xcl-dev/xcl/pull/2042#issuecomment-7170738039) <!-- 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.
Author
Owner

@⁠upipibi on GitHub · 2026-11-25 22:58 UTC · original

@⁠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).

**@⁠upipibi** on GitHub · 2026-11-25 22:58 UTC · [original](https://github.com/xcl-dev/xcl/pull/2042#issuecomment-7176996679) @⁠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://git.gtahub.st/github/xcl-dev--xcl/issues/1607)) and NWProgramming00 ([7170477355](https://git.gtahub.st/github/xcl-dev--xcl/issues/1607)), 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).
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-26 07:13 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 07:13 UTC · [original](https://github.com/xcl-dev/xcl/pull/2042#issuecomment-7185233872) 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/2042/head:github-bot/gh-2042'
git switch 'github-bot/gh-2042'

Merge

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