Recompiler: comparison samples use their supplied pixel gradients #346

Closed
Kalmarv wants to merge 2 commits from upstream-pr/350 into main
Kalmarv commented 2026-11-24 00:07:25 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-24T00:07:25Z.


Pixel-shader image_sample_c_d* and image_sample_c_cd* now use the instruction’s gradients for depth comparisons. Main selected the mip from screen derivatives even when the instruction requested a finer or coarser footprint. This overlaps #247 in emit.rs and builds directly on main.

What is in it

  • crates/xcl/src/gpu/recomp/emit.rs — Uses the instruction’s X and Y gradients, keeping array layers discrete and projecting cube-face coordinates back to a direction. At ps_6_6, QuadReadAcrossX and QuadReadAcrossY on SV_Position identify the pixel in the quad. An unrolled four-iteration loop uses QuadReadLaneAt for the coordinate and both derivatives, then issues one native SampleCmp per iteration. Each pixel selects its own result.
  • crates/xcl/src/gpu/recomp/tests.rs — six 16×16 raster draws check coarser, finer and per-pixel gradients, the coarse-derivative zero-offset form, matching gradients and a minimum-LOD clamp against two opposite depth checkerboards with point mip filtering.
  • crates/xcl/src/gpu/recomp/runner.rs (second commit, 3d8246e): the test runner's graphics draws (draw_views) submit on the runner's own queue and fence, which they already hold the lock for, instead of creating a direct queue and fence per draw. The new test makes 18 draws, and at the default test thread count CreateCommandQueue failed with E_OUTOFMEMORY (0x8007000E) in it and in other GPU tests. draw_on_multi, called with other devices, keeps its own queue.

Tested

  • Head 9249b7a, on main 06c9f55, with DXC 1.9.2609: cargo test --workspace -- --test-threads=4 (debug): 1266 passed, 0 failed, 46 ignored, with 25 SKIPPED notices from 15 tests (no native wave64, three refused per-lane cases, no heap windows). In release, gpu_ps_compare_mip_gradients 1 passed, gpu_ps_ 7 passed and sample 22 passed, 0 failed each. On this base the change needed one fix: main's 5195e27 runs an image sample without an implicit LOD only in the lanes EXEC keeps, but a comparison with gradients reads every pixel of the quad (QuadReadLaneAt). This head runs it in all four lanes, as an implicit-LOD sample is run, with a lane outside EXEC given descriptor index 0 and a zero result.
  • Ryzen 9 9950X, RTX 5070 Ti (610.74), Windows 11 25H2 build 26200.9711, Rust 1.99.0 (MSVC x64), debug, SDK DXC 1.7.2308.16.
  • Head 3d8246e, with DXC 1.9.2609: cargo test --workspace --no-fail-fast -- --test-threads=4 (debug): 1266 passed, 0 failed, 46 ignored, with 25 SKIPPED notices (21 no native wave64, three refused per-lane cases, no heap windows).
  • Default test thread count (32 on this CPU), cargo test -p xcl --lib, the two heads alternating, 3 runs each: on 9249b7a every run failed with 0x8007000E (1, 2 and 3 failures; gpu_ps_compare_mip_gradients in all three, d32s8_targets_take_their_own_size_of_video_memory twice, gpu_ps_p0_reads_flat_integer_selectors once). On 3d8246e, 0x8007000E never appeared: 1197 passed, 0 failed, 26 ignored twice, and once 1196 passed with 1 failure in coherent_buffer_sanitizes_console_flags_and_state at its final VirtualFree. That test doesn't draw, and #910 and #1520 are about it.
  • The default-thread failure was found and diagnosed by @upipibi on an RTX 3070 8 GB (https://github.com/xcl-dev/xcl/pull/350#issuecomment-7186401073), thank you: 5 of 6 full runs of 9249b7a at 32 threads failed with 0x8007000E from CreateCommandQueue in the draw path, against 0 of 5 on main, with VRAM peaking at 2.3 of 8 GB. They also confirmed the fix itself at one thread, with negative controls that revert the EXEC change or all of emit.rs.
  • Independent run by @throny (https://github.com/ivall/xcl/pull/350#issuecomment-7118933157): RTX 4080 (NVIDIA 610.88), i9-12900K, Windows 11 26300, Rust 1.100.0, debug, 13d8a1f merged onto main 7ebf1b8. cargo test --workspace -- --test-threads=4: 678 passed, 0 failed, 41 ignored. With emit.rs from main the new test fails in four of its six cases. With #349 merged too, both tests pass.
  • Also run by @DavidM1911 on an RTX 3060 Ti, Windows 11, this head 9249b7a merged with current main, thank you: cargo test -p xcl --lib (the library only, not the workspace). Run in parallel, 3 tests failed; the comment does not name them. Rerun with --test-threads=1: 1304 passed, 0 failed, 27 ignored (https://github.com/xcl-dev/xcl/pull/350#issuecomment-7181121944). They count the parallel failures as the flakes of #1978. That issue was closed by #2002, which this main contains.
  • Earlier smoke runs by @CuteBooty, RTX 3070 (NVIDIA 617.14), release, on main 9ab7d76 and this head: 918 and 909 frames, no crash or device removal (https://github.com/ivall/xcl/pull/350#issuecomment-7119195251).

Regression run

scripts/smoke.ps1 (60 s), the same retail title, one after the other in one job on the machine under Tested (RTX 5070 Ti), release builds from clean trees, default route. main b49be18 (a newer main that contains this PR's base 06c9f55), then this PR's head 3d8246e.

xcl-smoke v1
commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 1478 (PresentX 1478)
presents per 2 s (last 3): 55 37 60
device removals: 0
crashes: 0
peak commit: 17502 MB
xcl-smoke v1
commit: 3d8246e1e756bf1d9bfedeedffc415bd7c246664
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 1494 (PresentX 1494)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14776 MB

PR vs main: 1494 / 1478 frames (101 %), peak commit 14776 / 17502 MB (84 %); device removals 0 and crashes 0 on both runs. The pair for the previous head 9249b7a (120 s, XCL_DIRECT_DXIL=1, against main 08db802) had 1311 / 1313 frames and 29495 / 29957 MB.

Not tested

  • Nonzero texel offsets on explicit-gradient comparisons at mip 1 or higher depend on #247. The standalone head uses mip-0 texel units for these offsets.
  • AMD. The pixel-shader quad operations emitted by this change have never been compiled by an AMD driver in our testing.
  • Whether the title's frames reach these sample forms: the smoke runs above are a regression check only.
  • Cube and array sampling on hardware, and the throughput cost of issuing four comparison samples.

AI use

  • Codex (GPT-6.2 Astra): code, tests and this description
  • Claude Code (Claude Opus 5.5): the smoke runs under Regression run, the squash into one commit, the suite runs on 08866f9 and 3d8246e, and the runner change in 3d8246e

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:issue:5463501561 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/350). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-11-24T00:07:25Z. --- Pixel-shader `image_sample_c_d*` and `image_sample_c_cd*` now use the instruction’s gradients for depth comparisons. Main selected the mip from screen derivatives even when the instruction requested a finer or coarser footprint. This overlaps #247 in `emit.rs` and builds directly on main. **What is in it** - `crates/xcl/src/gpu/recomp/emit.rs` — Uses the instruction’s X and Y gradients, keeping array layers discrete and projecting cube-face coordinates back to a direction. At `ps_6_6`, `QuadReadAcrossX` and `QuadReadAcrossY` on `SV_Position` identify the pixel in the quad. An unrolled four-iteration loop uses `QuadReadLaneAt` for the coordinate and both derivatives, then issues one native `SampleCmp` per iteration. Each pixel selects its own result. - `crates/xcl/src/gpu/recomp/tests.rs` — six 16×16 raster draws check coarser, finer and per-pixel gradients, the coarse-derivative zero-offset form, matching gradients and a minimum-LOD clamp against two opposite depth checkerboards with point mip filtering. - `crates/xcl/src/gpu/recomp/runner.rs` (second commit, `3d8246e`): the test runner's graphics draws (`draw_views`) submit on the runner's own queue and fence, which they already hold the lock for, instead of creating a direct queue and fence per draw. The new test makes 18 draws, and at the default test thread count `CreateCommandQueue` failed with `E_OUTOFMEMORY` (0x8007000E) in it and in other GPU tests. `draw_on_multi`, called with other devices, keeps its own queue. **Tested** - Head `9249b7a`, on `main` `06c9f55`, with DXC 1.9.2609: `cargo test --workspace -- --test-threads=4` (debug): 1266 passed, 0 failed, 46 ignored, with 25 SKIPPED notices from 15 tests (no native wave64, three refused per-lane cases, no heap windows). In release, `gpu_ps_compare_mip_gradients` 1 passed, `gpu_ps_` 7 passed and `sample` 22 passed, 0 failed each. On this base the change needed one fix: `main`'s `5195e27` runs an image sample without an implicit LOD only in the lanes EXEC keeps, but a comparison with gradients reads every pixel of the quad (`QuadReadLaneAt`). This head runs it in all four lanes, as an implicit-LOD sample is run, with a lane outside EXEC given descriptor index 0 and a zero result. - Ryzen 9 9950X, RTX 5070 Ti (610.74), Windows 11 25H2 build 26200.9711, Rust 1.99.0 (MSVC x64), debug, SDK DXC 1.7.2308.16. - Head `3d8246e`, with DXC 1.9.2609: `cargo test --workspace --no-fail-fast -- --test-threads=4` (debug): 1266 passed, 0 failed, 46 ignored, with 25 SKIPPED notices (21 no native wave64, three refused per-lane cases, no heap windows). - Default test thread count (32 on this CPU), `cargo test -p xcl --lib`, the two heads alternating, 3 runs each: on `9249b7a` every run failed with 0x8007000E (1, 2 and 3 failures; `gpu_ps_compare_mip_gradients` in all three, `d32s8_targets_take_their_own_size_of_video_memory` twice, `gpu_ps_p0_reads_flat_integer_selectors` once). On `3d8246e`, 0x8007000E never appeared: 1197 passed, 0 failed, 26 ignored twice, and once 1196 passed with 1 failure in `coherent_buffer_sanitizes_console_flags_and_state` at its final `VirtualFree`. That test doesn't draw, and #910 and #1520 are about it. - The default-thread failure was found and diagnosed by @upipibi on an RTX 3070 8 GB (https://github.com/xcl-dev/xcl/pull/350#issuecomment-7186401073), thank you: 5 of 6 full runs of `9249b7a` at 32 threads failed with 0x8007000E from `CreateCommandQueue` in the draw path, against 0 of 5 on `main`, with VRAM peaking at 2.3 of 8 GB. They also confirmed the fix itself at one thread, with negative controls that revert the EXEC change or all of `emit.rs`. - Independent run by @throny (https://github.com/ivall/xcl/pull/350#issuecomment-7118933157): RTX 4080 (NVIDIA 610.88), i9-12900K, Windows 11 26300, Rust 1.100.0, debug, `13d8a1f` merged onto `main` `7ebf1b8`. `cargo test --workspace -- --test-threads=4`: 678 passed, 0 failed, 41 ignored. With `emit.rs` from `main` the new test fails in four of its six cases. With #349 merged too, both tests pass. - Also run by @DavidM1911 on an RTX 3060 Ti, Windows 11, this head `9249b7a` merged with current `main`, thank you: `cargo test -p xcl --lib` (the library only, not the workspace). Run in parallel, 3 tests failed; the comment does not name them. Rerun with `--test-threads=1`: 1304 passed, 0 failed, 27 ignored (https://github.com/xcl-dev/xcl/pull/350#issuecomment-7181121944). They count the parallel failures as the flakes of #1978. That issue was closed by #2002, which this `main` contains. - Earlier smoke runs by @CuteBooty, RTX 3070 (NVIDIA 617.14), release, on `main` `9ab7d76` and this head: 918 and 909 frames, no crash or device removal (https://github.com/ivall/xcl/pull/350#issuecomment-7119195251). **Regression run** `scripts/smoke.ps1` (60 s), the same retail title, one after the other in one job on the machine under **Tested** (RTX 5070 Ti), release builds from clean trees, default route. `main` `b49be18` (a newer `main` that contains this PR's base `06c9f55`), then this PR's head `3d8246e`. ``` xcl-smoke v1 commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7 gpu: NVIDIA GeForce RTX 5070 Ti title: ea3b5e4d seconds: 60 exit: 0x0 frames shown: 1478 (PresentX 1478) presents per 2 s (last 3): 55 37 60 device removals: 0 crashes: 0 peak commit: 17502 MB ``` ``` xcl-smoke v1 commit: 3d8246e1e756bf1d9bfedeedffc415bd7c246664 gpu: NVIDIA GeForce RTX 5070 Ti title: ea3b5e4d seconds: 60 exit: 0x0 frames shown: 1494 (PresentX 1494) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14776 MB ``` PR vs `main`: 1494 / 1478 frames (101 %), peak commit 14776 / 17502 MB (84 %); device removals 0 and crashes 0 on both runs. The pair for the previous head `9249b7a` (120 s, `XCL_DIRECT_DXIL=1`, against `main` `08db802`) had 1311 / 1313 frames and 29495 / 29957 MB. **Not tested** - Nonzero texel offsets on explicit-gradient comparisons at mip 1 or higher depend on #247. The standalone head uses mip-0 texel units for these offsets. - AMD. The pixel-shader quad operations emitted by this change have never been compiled by an AMD driver in our testing. - Whether the title's frames reach these sample forms: the smoke runs above are a regression check only. - Cube and array sampling on hardware, and the throughput cost of issuing four comparison samples. **AI use** - Codex (GPT-6.2 Astra): code, tests and this description - Claude Code (Claude Opus 5.5): the smoke runs under **Regression run**, the squash into one commit, the suite runs on `08866f9` and `3d8246e`, and the runner change in `3d8246e` 🤖 Generated with [Claude Code](https://claude.com/claude-code)
nullmarsh commented 2026-11-24 07:04:56 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by nullmarsh on 2026-11-24T00:19:38Z.


AMD run, since Not tested says no AMD driver has compiled these quad operations yet: 13d8a1f merged onto main a6f5f7a (clean merge): pass on RDNA4, and the new test fails without the emit.rs change.

Tested

  • AMD Radeon RX 9060 XT (RDNA4, wave64 + mesh shaders), driver 32.0.32029.2010; Ryzen 7 5800X3D; Windows 11 Pro 26200; Rust 1.100.0; DXC 1.9.2602.17 (SDK 10.0.26100); debug build.
  • .\scripts\test.ps1: 677 passed, 0 failed, 41 ignored; no SKIPPED GPU tests (the two wave64 skips on your 5070 Ti run here).
  • XCL_REQUIRE_GPU=wave64,mesh cargo test -p xcl --lib gpu_ps_compare_mip: gpu_ps_compare_mip_gradients passes.
  • Negative control: the merged tree with only emit.rs back on main. The test fails with IMAGE_SAMPLE_C_D, scale 0.125, slope 0: pixel (0,0): 0 instead of 1 from mip 1, plus the _C_D_CL, _C_CD_O and slope 0.0625 cases.
  • With #349 also merged (the shared sample_cmp_grad is identical, so git merges it cleanly): both gpu_ps_compare_mip_gradients and gpu_ps_compare_mip_bias pass.

Not tested

  • A retail title (smoke.ps1); cube and array sampling on hardware; NVIDIA.

AI use

  • Claude Code (Claude Opus 5.5) ran the commands and wrote this report from the logs; I checked it before posting.
<!-- greyfinch-sync:ivall/xcl:comment:7117950355 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/350#issuecomment-7117950355). Originally posted by [nullmarsh](https://github.com/nullmarsh) on 2026-11-24T00:19:38Z. --- AMD run, since **Not tested** says no AMD driver has compiled these quad operations yet: `13d8a1f` merged onto `main` `a6f5f7a` (clean merge): **pass** on RDNA4, and the new test fails without the `emit.rs` change. **Tested** - AMD Radeon RX 9060 XT (RDNA4, wave64 + mesh shaders), driver 32.0.32029.2010; Ryzen 7 5800X3D; Windows 11 Pro 26200; Rust 1.100.0; DXC 1.9.2602.17 (SDK 10.0.26100); debug build. - `.\scripts\test.ps1`: 677 passed, 0 failed, 41 ignored; no `SKIPPED` GPU tests (the two wave64 skips on your 5070 Ti run here). - `XCL_REQUIRE_GPU=wave64,mesh cargo test -p xcl --lib gpu_ps_compare_mip`: `gpu_ps_compare_mip_gradients` passes. - Negative control: the merged tree with only `emit.rs` back on `main`. The test fails with `IMAGE_SAMPLE_C_D, scale 0.125, slope 0: pixel (0,0): 0 instead of 1 from mip 1`, plus the `_C_D_CL`, `_C_CD_O` and slope 0.0625 cases. - With #349 also merged (the shared `sample_cmp_grad` is identical, so git merges it cleanly): both `gpu_ps_compare_mip_gradients` and `gpu_ps_compare_mip_bias` pass. **Not tested** - A retail title (`smoke.ps1`); cube and array sampling on hardware; NVIDIA. **AI use** - Claude Code (Claude Opus 5.5) ran the commands and wrote this report from the logs; I checked it before posting.
throny commented 2026-11-24 07:05:12 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-24T01:16:18Z.


NVIDIA RTX 40 run of 13d8a1f merged onto main 7ebf1b8 (clean merge, merge commit 5e66bc9): pass, and the new test fails without the emit.rs change.

Tested

  • Windows 11 Pro 10.0.26300, NVIDIA GeForce RTX 4080 (driver 610.88, 32-lane waves), Intel i9-12900K, 64 GB; Rust 1.100.0 stable-x86_64-pc-windows-msvc, debug; DXC 1.9.2602.17 (Windows SDK 10.0.26100.0); no XCL_SAMPLE_*
  • cargo build --workspace && cargo test --workspace -- --test-threads=4: 678 passed, 0 failed, 41 ignored (lib: 638 / 0 / 21, gpu_ps_compare_mip_gradients ok). An earlier run of this PR on a6f5f7a stopped in the #344 deadlock (not this PR: stacks in my report on #443).
  • SKIPPED on this adapter: gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware (no wave64)
  • Negative control: the merged tree with emit.rs from main: gpu_ps_compare_mip_gradients fails in four of its six cases (IMAGE_SAMPLE_C_D coarser, _C_D_CL finer, _C_CD_O coarser and the per-pixel gradient case); the two controls pass.
  • With #349 (d25aea1): the two branches merge without a conflict although both add sample_cmp_grad and check_ps_depth_mip (one copy of each results), and cargo test -p xcl --lib gpu_ps_compare_mip on main + #350 + #349 passes both tests.

Reviewed (read the whole diff)

  • The new arm comes before the has_lz || !ps one and is limited to pixel shaders, so comparison samples with gradients outside PS still take SampleCmpLevelZero as on main.

Not tested

  • No regression run (scripts/smoke.ps1) on a title, no shader-pack run (XCL_SAMPLE_RPF), wave64 hardware, the cube, array and 3D forms (the test draws 2D only).

AI use

  • Claude Code (Claude Fable 5.2) ran the builds, the tests and the controls, read the diff and wrote this report. The runs above are real, on the hardware named.
<!-- greyfinch-sync:ivall/xcl:comment:7118933157 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/350#issuecomment-7118933157). Originally posted by [throny](https://github.com/throny) on 2026-11-24T01:16:18Z. --- NVIDIA RTX 40 run of `13d8a1f` merged onto `main` `7ebf1b8` (clean merge, merge commit `5e66bc9`): **pass**, and the new test fails without the `emit.rs` change. **Tested** - Windows 11 Pro 10.0.26300, NVIDIA GeForce RTX 4080 (driver 610.88, 32-lane waves), Intel i9-12900K, 64 GB; Rust 1.100.0 `stable-x86_64-pc-windows-msvc`, debug; DXC 1.9.2602.17 (Windows SDK 10.0.26100.0); no `XCL_SAMPLE_*` - `cargo build --workspace && cargo test --workspace -- --test-threads=4`: 678 passed, 0 failed, 41 ignored (lib: 638 / 0 / 21, `gpu_ps_compare_mip_gradients` ok). An earlier run of this PR on `a6f5f7a` stopped in the #344 deadlock (not this PR: stacks in my report on #443). - `SKIPPED` on this adapter: `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware` (no wave64) - Negative control: the merged tree with `emit.rs` from `main`: `gpu_ps_compare_mip_gradients` fails in four of its six cases (`IMAGE_SAMPLE_C_D` coarser, `_C_D_CL` finer, `_C_CD_O` coarser and the per-pixel gradient case); the two controls pass. - With #349 (`d25aea1`): the two branches merge without a conflict although both add `sample_cmp_grad` and `check_ps_depth_mip` (one copy of each results), and `cargo test -p xcl --lib gpu_ps_compare_mip` on `main` + #350 + #349 passes both tests. **Reviewed** (read the whole diff) - The new arm comes before the `has_lz || !ps` one and is limited to pixel shaders, so comparison samples with gradients outside PS still take `SampleCmpLevelZero` as on `main`. **Not tested** - No regression run (`scripts/smoke.ps1`) on a title, no shader-pack run (`XCL_SAMPLE_RPF`), wave64 hardware, the cube, array and 3D forms (the test draws 2D only). **AI use** - Claude Code (Claude Fable 5.2) ran the builds, the tests and the controls, read the diff and wrote this report. The runs above are real, on the hardware named.
QemmHD commented 2026-11-24 07:05:13 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by QemmHD on 2026-11-24T01:18:18Z.


Review: the quad construction is exact (the coordinate is affine across the quad and each lane's own coordinate is unchanged), and staying on ps_6_6 avoids SM 6.8's SampleCmpGrad. Three points:

  1. emit.rs:2191-2196: offsets for comparison samples still use level 0u (the _ => "0u" arm), so _c_d_o / _c_cd_o / _c_cd_cl_o with a non-zero offset move by mip-0 texels while the gradients now select coarser mips. The _O rows in the test use offset 0. If this is meant to be fixed by #247, a note on the dependency (or a non-zero-offset row once #247 lands) would help.
  2. check_ps_depth_mip draws [0,0],[0,32],[32,0] over the whole target, so no quad ever has helper lanes, which the QuadReadLaneAt method relies on. A triangle edge through quads (e.g. [0,0],[0,16],[16,0], checking only covered pixels) would cover that.
  3. Minor, emit.rs:1927: the own-lane term is delta * grad with delta == 0, so a ±inf/NaN gradient turns the lane's own coordinate into NaN. Using QuadReadLaneAt(coord, q) unchanged when delta == 0 avoids it.

AI-assisted review (Claude Code, Claude Opus 5.5).
Discord: bigpeppa.

<!-- greyfinch-sync:ivall/xcl:comment:7118967548 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/350#issuecomment-7118967548). Originally posted by [QemmHD](https://github.com/QemmHD) on 2026-11-24T01:18:18Z. --- Review: the quad construction is exact (the coordinate is affine across the quad and each lane's own coordinate is unchanged), and staying on `ps_6_6` avoids SM 6.8's `SampleCmpGrad`. Three points: 1. `emit.rs:2191-2196`: offsets for comparison samples still use level `0u` (the `_ => "0u"` arm), so `_c_d_o` / `_c_cd_o` / `_c_cd_cl_o` with a non-zero offset move by mip-0 texels while the gradients now select coarser mips. The `_O` rows in the test use offset 0. If this is meant to be fixed by #247, a note on the dependency (or a non-zero-offset row once #247 lands) would help. 2. `check_ps_depth_mip` draws `[0,0],[0,32],[32,0]` over the whole target, so no quad ever has helper lanes, which the `QuadReadLaneAt` method relies on. A triangle edge through quads (e.g. `[0,0],[0,16],[16,0]`, checking only covered pixels) would cover that. 3. Minor, `emit.rs:1927`: the own-lane term is `delta * grad` with `delta == 0`, so a ±inf/NaN gradient turns the lane's own coordinate into NaN. Using `QuadReadLaneAt(coord, q)` unchanged when `delta == 0` avoids it. AI-assisted review (Claude Code, Claude Opus 5.5). Discord: bigpeppa.
CuteBooty commented 2026-11-24 07:05:17 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by CuteBooty on 2026-11-24T01:32:07Z.


Regression run on a retail title for 13d8a1f, which the description lists as pending: pass (no device removal, no crash, frames and peak commit level with main).

Tested

  • RTX 3070 8 GB (32-lane waves), NVIDIA 617.14; Ryzen 5 3600, 32 GB; Windows 11 Pro 26200; rustc 1.100.0 MSVC; release build.
  • scripts\smoke.ps1 -Game <folder> -Seconds 60 on the PR's head as it is and on main 9ab7d76, the commit it is based on, each built from a clean checkout of its commit.
  • Each build ran twice back to back and the blocks are the second runs. The first runs: 912 frames (main) and 919 frames (PR), also with no device removal or crash. The main block is one run, shared with my reports on #348 and #349.
  • Video memory at 60 s, from XCL's memory: line: 6311 MB local / 4619 MB non-local (main), 6247 MB local / 4620 MB non-local (PR).

main:

xcl-smoke v1
commit: 9ab7d763197c7f420bff10cd9bf1310f07e2a9aa
gpu: NVIDIA GeForce RTX 3070
title: game
seconds: 60
exit: 0x0
frames shown: 918 (PresentX 918)
presents per 2 s (last 3): 40 41 40
device removals: 0
crashes: 0
peak commit: 14793 MB

PR:

xcl-smoke v1
commit: 13d8a1f5e5927ba445bacd13e9dfb71deb3933d4
gpu: NVIDIA GeForce RTX 3070
title: game
seconds: 60
exit: 0x0
frames shown: 909 (PresentX 909)
presents per 2 s (last 3): 41 40 40
device removals: 0
crashes: 0
peak commit: 14733 MB

Not tested

  • The test suite on this head (others have posted it), anything past the first 60 s, and whether a shader the title draws with in these 60 s has a comparison sample with gradients (the case this changes).

AI use: Claude Code with Claude Fable 5.2 made the runs with me present and wrote this comment.

<!-- greyfinch-sync:ivall/xcl:comment:7119195251 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/350#issuecomment-7119195251). Originally posted by [CuteBooty](https://github.com/CuteBooty) on 2026-11-24T01:32:07Z. --- Regression run on a retail title for `13d8a1f`, which the description lists as pending: **pass** (no device removal, no crash, frames and peak commit level with `main`). **Tested** - RTX 3070 8 GB (32-lane waves), NVIDIA 617.14; Ryzen 5 3600, 32 GB; Windows 11 Pro 26200; rustc 1.100.0 MSVC; release build. - `scripts\smoke.ps1 -Game <folder> -Seconds 60` on the PR's head as it is and on `main` `9ab7d76`, the commit it is based on, each built from a clean checkout of its commit. - Each build ran twice back to back and the blocks are the second runs. The first runs: 912 frames (`main`) and 919 frames (PR), also with no device removal or crash. The `main` block is one run, shared with my reports on #348 and #349. - Video memory at 60 s, from XCL's `memory:` line: 6311 MB local / 4619 MB non-local (`main`), 6247 MB local / 4620 MB non-local (PR). main: ``` xcl-smoke v1 commit: 9ab7d763197c7f420bff10cd9bf1310f07e2a9aa gpu: NVIDIA GeForce RTX 3070 title: game seconds: 60 exit: 0x0 frames shown: 918 (PresentX 918) presents per 2 s (last 3): 40 41 40 device removals: 0 crashes: 0 peak commit: 14793 MB ``` PR: ``` xcl-smoke v1 commit: 13d8a1f5e5927ba445bacd13e9dfb71deb3933d4 gpu: NVIDIA GeForce RTX 3070 title: game seconds: 60 exit: 0x0 frames shown: 909 (PresentX 909) presents per 2 s (last 3): 41 40 40 device removals: 0 crashes: 0 peak commit: 14733 MB ``` **Not tested** - The test suite on this head (others have posted it), anything past the first 60 s, and whether a shader the title draws with in these 60 s has a comparison sample with gradients (the case this changes). **AI use:** Claude Code with Claude Fable 5.2 made the runs with me present and wrote this comment.
Kalmarv commented 2026-11-24 07:05:34 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-24T02:23:04Z.


Thanks for checking the mip calculation and the triangle coverage.

The standalone head uses mip-0 texel units for the explicit-gradient offset forms, and both offset rows pass zero. I added that dependency to the PR body draft. With #247 at a60db9f, a synthetic IMAGE_SAMPLE_C_D_O draw with a +1 X offset read the expected neighbor at mip 1.

The full-screen triangle left the helper-lane case uncovered. The test now keeps that draw and adds a diagonal that leaves one or three covered pixels in each edge quad. It checks the depth comparison for all 96 covered pixels and the clear value for the other 160.

With the tests carried onto 13d8a1f, +∞ and NaN in dU/dX returned 1 instead of 0 at pixel (2,0), and −∞ in dV/dY did the same at (0,2). The zero-displacement multiply contaminated the sample center. The emitter still reads the gradients across the quad, but applies an axis displacement only when it is nonzero. The new cases use positive infinity, negative infinity and NaN with the mip clamped to 1 to isolate the sampling coordinate.

Tested

PR head bf32301d87b8 on an RTX 5070 Ti (610.74), SDK DXC 1.7, ps_6_6: the targeted raster test passed. The full workspace returned 652 passed, 0 failed, 40 ignored; two native-wave64 tests reported SKIPPED within the pass count.

Not tested

AMD on this follow-up. Our title smoke pair on this head is in the description; the title doesn't show whether it reaches these sampling forms.

🤖 GPT-6.2 Astra

<!-- greyfinch-sync:ivall/xcl:comment:7120083673 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/350#issuecomment-7120083673). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-11-24T02:23:04Z. --- Thanks for checking the mip calculation and the triangle coverage. The standalone head uses mip-0 texel units for the explicit-gradient offset forms, and both offset rows pass zero. I added that dependency to the PR body draft. With #247 at `a60db9f`, a synthetic `IMAGE_SAMPLE_C_D_O` draw with a +1 X offset read the expected neighbor at mip 1. The full-screen triangle left the helper-lane case uncovered. The test now keeps that draw and adds a diagonal that leaves one or three covered pixels in each edge quad. It checks the depth comparison for all 96 covered pixels and the clear value for the other 160. With the tests carried onto `13d8a1f`, +∞ and NaN in dU/dX returned 1 instead of 0 at pixel (2,0), and −∞ in dV/dY did the same at (0,2). The zero-displacement multiply contaminated the sample center. The emitter still reads the gradients across the quad, but applies an axis displacement only when it is nonzero. The new cases use positive infinity, negative infinity and NaN with the mip clamped to 1 to isolate the sampling coordinate. **Tested** PR head `bf32301d87b8` on an RTX 5070 Ti (610.74), SDK DXC 1.7, `ps_6_6`: the targeted raster test passed. The full workspace returned 652 passed, 0 failed, 40 ignored; two native-wave64 tests reported SKIPPED within the pass count. **Not tested** AMD on this follow-up. Our title smoke pair on this head is in the description; the title doesn't show whether it reaches these sampling forms. 🤖 GPT-6.2 Astra
thehollowedone commented 2026-11-24 08:03:50 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-24T07:45:14Z.


Independent native D3D12 check of f09eca5 on RTX 3080 Ti / 621.35, Windows 11 build 26300, Rust 1.99.1 MSVC, release.

Both DXC 1.8.2502.11 and 1.6.2112.16 passed all nine explicit-gradient cases on both triangle coverage patterns, including NaN, positive infinity and negative infinity with the mip fixed. The flat integer selector control also passed on both compilers. Four test runs passed, with zero failures, ignores or skips. The offset variants use zero offsets.

I used XCL_ADAPTER=3080 Ti and cargo test --locked --offline --release -p xcl --lib <filter> -- --test-threads=1 --nocapture with gpu_ps_compare_mip_gradients and gpu_ps_p0_reads_flat_integer_selectors. The older compiler was selected through XCL_DXC_DIR and confirmed in the test output.

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

<!-- greyfinch-sync:ivall/xcl:comment:7125333730 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/350#issuecomment-7125333730). Originally posted by [thehollowedone](https://github.com/thehollowedone) on 2026-11-24T07:45:14Z. --- Independent native D3D12 check of [`f09eca5`](https://github.com/ivall/xcl/commit/f09eca5427b417731aeae33e81e16e4b7edba03b) on RTX 3080 Ti / 621.35, Windows 11 build 26300, Rust 1.99.1 MSVC, release. Both DXC 1.8.2502.11 and 1.6.2112.16 passed all nine explicit-gradient cases on both triangle coverage patterns, including NaN, positive infinity and negative infinity with the mip fixed. The flat integer selector control also passed on both compilers. Four test runs passed, with zero failures, ignores or skips. The offset variants use zero offsets. I used `XCL_ADAPTER=3080 Ti` and `cargo test --locked --offline --release -p xcl --lib <filter> -- --test-threads=1 --nocapture` with `gpu_ps_compare_mip_gradients` and `gpu_ps_p0_reads_flat_integer_selectors`. The older compiler was selected through `XCL_DXC_DIR` and confirmed in the test output. AI use: Codex (GPT-6, exact variant unavailable) ran the tests and drafted this report.
Kalmarv commented 2026-11-24 18:09:12 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-24T17:50:39Z.


Squashed into one commit (08866f9, the same tree as before) as CONTRIBUTING asks; the smoke pair for it is queued.

A note for the merge order with #247: this PR makes the PS SampleCmp take the gradients, and #247 moves a comparison offset by the mip that sample reads. With both in a tree, one line in #247's offset code has to take the gradients too, or gpu_image_sample_c_b_d_offset_moves_by_the_mip_read fails (sample_c_d_o, PS: pixel (0,0) = 0). We have that line ready and tested (3edfb6f; with it the test passes, and main + all eleven of our open PRs + both follow-ups pass the whole suite, 815 passed, 0 failed). Whichever of the two lands second, we push it there.

AI use: Claude Code (Claude Opus 5.5)

<!-- greyfinch-sync:ivall/xcl:comment:7139785277 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/350#issuecomment-7139785277). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-11-24T17:50:39Z. --- Squashed into one commit (`08866f9`, the same tree as before) as CONTRIBUTING asks; the smoke pair for it is queued. A note for the merge order with #247: this PR makes the PS `SampleCmp` take the gradients, and #247 moves a comparison offset by the mip that sample reads. With both in a tree, one line in #247's offset code has to take the gradients too, or `gpu_image_sample_c_b_d_offset_moves_by_the_mip_read` fails (`sample_c_d_o, PS: pixel (0,0) = 0`). We have that line ready and tested (`3edfb6f`; with it the test passes, and main + all eleven of our open PRs + both follow-ups pass the whole suite, 815 passed, 0 failed). Whichever of the two lands second, we push it there. **AI use:** Claude Code (Claude Opus 5.5)
JJAutoCompare commented 2026-11-25 08:08:16 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T07:34:23Z.


Tested

Independent native Windows run for PR #350 at clean detached 08866f93ae63d9d73cf13ca96b47fca028f775b0. STOR-WINLAB, Windows 11 Enterprise Evaluation x64 26200.9974, Ryzen 7 3800X, Intel Arc A770 driver 32.0.101.9175, Rust/Cargo 1.100.0 x86_64-pc-windows-msvc, DXC and DXIL 1.9.2609.5. Unoptimized test profile with debug info and incremental compilation disabled.

cargo test --locked -p xcl --lib --no-run -j 2 --message-format=json built outside the GPU lock and exited 0. Used XCL_ADAPTER=A770, XCL_DIRECT_DXIL=0, and XCL_DXC_DIR=%LOCALAPPDATA%/XclTooling/dxc-1.9.2609/bin/x64. Ran the Cargo-emitted executable in the shared Arc lock wrapper:

& 'L:/XclTooling/Invoke-ArcTest.ps1' -Test {
    & 'L:/XclTooling/verify-pr1523-1362129-t3-cf2e05e7/target/debug/build/xcl/00e28da3621caf64/out/xcl-00e28da3621caf64.exe' --exact gpu::recomp::tests::gpu_ps_compare_mip_gradients --nocapture --test-threads=1
}

1 passed, 0 failed, 0 ignored, 0 GPU skips, 671 filtered out, 2.76 s. The fixture and mutex wrapper both exited 0. Executable SHA-256 matched before the wait, under the mutex, and after the fixture exited.

All nine stock HLSL/DXC cases passed on both triangle geometries. The fixture checks exact red-channel comparison results on the 16×16 readback, including the gradient that selects adjacent mips across pixel columns, the non-finite gradient controls, and the clear value for uncovered pixels. The offset forms use zero offsets.

Not tested

Nonzero offsets, cube and array textures, direct DXIL lowering, the PR base, other adapters, the workspace suite, and title smoke runs.

AI use

T3 Code / Codex (gpt-6.2-sol) verified the checkout, ran the checked-in fixture, and wrote this report.

<!-- greyfinch-sync:ivall/xcl:comment:7156011190 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/350#issuecomment-7156011190). Originally posted by [JJAutoCompare](https://github.com/JJAutoCompare) on 2026-11-25T07:34:23Z. --- **Tested** Independent native Windows run for PR #350 at clean detached `08866f93ae63d9d73cf13ca96b47fca028f775b0`. STOR-WINLAB, Windows 11 Enterprise Evaluation x64 26200.9974, Ryzen 7 3800X, Intel Arc A770 driver 32.0.101.9175, Rust/Cargo 1.100.0 x86_64-pc-windows-msvc, DXC and DXIL 1.9.2609.5. Unoptimized test profile with debug info and incremental compilation disabled. `cargo test --locked -p xcl --lib --no-run -j 2 --message-format=json` built outside the GPU lock and exited 0. Used `XCL_ADAPTER=A770`, `XCL_DIRECT_DXIL=0`, and `XCL_DXC_DIR=%LOCALAPPDATA%/XclTooling/dxc-1.9.2609/bin/x64`. Ran the Cargo-emitted executable in the shared Arc lock wrapper: ```powershell & 'L:/XclTooling/Invoke-ArcTest.ps1' -Test { & 'L:/XclTooling/verify-pr1523-1362129-t3-cf2e05e7/target/debug/build/xcl/00e28da3621caf64/out/xcl-00e28da3621caf64.exe' --exact gpu::recomp::tests::gpu_ps_compare_mip_gradients --nocapture --test-threads=1 } ``` **1 passed, 0 failed, 0 ignored, 0 GPU skips**, 671 filtered out, 2.76 s. The fixture and mutex wrapper both exited 0. Executable SHA-256 matched before the wait, under the mutex, and after the fixture exited. All nine stock HLSL/DXC cases passed on both triangle geometries. The fixture checks exact red-channel comparison results on the 16×16 readback, including the gradient that selects adjacent mips across pixel columns, the non-finite gradient controls, and the clear value for uncovered pixels. The offset forms use zero offsets. **Not tested** Nonzero offsets, cube and array textures, direct DXIL lowering, the PR base, other adapters, the workspace suite, and title smoke runs. **AI use** T3 Code / Codex (gpt-6.2-sol) verified the checkout, ran the checked-in fixture, and wrote this report.
DavidM1911 commented 2026-11-25 15:07:52 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T14:33:18Z.


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

  • cargo test -p xcl --lib: 1 real failure, deterministic (also fails --test-threads=1, 1098/1):
gpu::recomp::tests::gpu_ps_compare_mip_gradients
  IMAGE_SAMPLE_C_D / _CL / _CD_O / _CD_CL_O, scale 0.125:
  off-by-one pixels at mip boundaries (e.g. "12x16 triangle, pixel (11,0): 0 instead of 1 at mip 0",
  "pixel (10,0): 1 instead of 0 at mip 1")

Texture-compare sampling with mip gradients returns wrong texels at mip transitions on the GPU — a real sampling regression. Needs a fix before merge.

— Devin

<!-- greyfinch-sync:ivall/xcl:comment:7165455977 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/350#issuecomment-7165455977). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T14:33:18Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: **1 real failure**, deterministic (also fails `--test-threads=1`, 1098/1): ``` gpu::recomp::tests::gpu_ps_compare_mip_gradients IMAGE_SAMPLE_C_D / _CL / _CD_O / _CD_CL_O, scale 0.125: off-by-one pixels at mip boundaries (e.g. "12x16 triangle, pixel (11,0): 0 instead of 1 at mip 0", "pixel (10,0): 1 instead of 0 at mip 1") ``` Texture-compare sampling with mip gradients returns wrong texels at mip transitions on the GPU — a real sampling regression. Needs a fix before merge. — Devin
Kalmarv commented 2026-11-25 15:07:56 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-25T14:43:37Z.


Thanks @DavidM1911. It fails the same way here on an RTX 5070 Ti, with main 06c9f55 merged in: every failing pixel is in the one 2×2 quad at (10..11, 0..1) of the 12×16 triangle, whose lower-right pixel lies outside the triangle. Even the cases clamped to a minimum LOD of 1 come back as mip 0 there, so the lowering most likely takes the value from the wrong pixel of a partially covered quad. The mip choice itself looks right. I'm fixing it and will update the PR here.

AI use: drafted with Claude Code (Claude Opus 5.5); the test run is my own.

<!-- greyfinch-sync:ivall/xcl:comment:7165719629 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/350#issuecomment-7165719629). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-11-25T14:43:37Z. --- Thanks @DavidM1911. It fails the same way here on an RTX 5070 Ti, with `main` `06c9f55` merged in: every failing pixel is in the one 2×2 quad at (10..11, 0..1) of the 12×16 triangle, whose lower-right pixel lies outside the triangle. Even the cases clamped to a minimum LOD of 1 come back as mip 0 there, so the lowering most likely takes the value from the wrong pixel of a partially covered quad. The mip choice itself looks right. I'm fixing it and will update the PR here. AI use: drafted with Claude Code (Claude Opus 5.5); the test run is my own.
Kalmarv commented 2026-11-25 16:12:08 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-25T15:20:17Z.


@DavidM1911 fixed and pushed (9249b7a, rebased onto main 06c9f55, one commit).

What went wrong: this PR predates 5195e27b, which puts pixel-shader samples without implicit derivatives inside an EXEC check. The emulated compare-with-gradients reads all four lanes of the quad and relies on SampleCmp's quad derivatives. The partial quad's helper lane, pixel (11,1) of the 12×16 triangle, is outside EXEC, so it skipped the sample and left its neighbours' LOD undefined. The PR's own head still passed on its old base; only the merge failed.

The fix runs that sample in every lane of the quad, the way implicit-LOD samples already run, and writes the result only for lanes in EXEC. On the RTX 5070 Ti: gpu_ps_compare_mip_gradients 1 passed, the gpu_ps_ filter 7/0, the sample filter 22/0, and the full workspace (debug, --test-threads=4) 1266 passed, 0 failed, 46 ignored. The new smoke pair goes into the description when it's done.

AI use: investigated and fixed with Claude Code (Claude Opus 5.5).

<!-- greyfinch-sync:ivall/xcl:comment:7166683662 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/350#issuecomment-7166683662). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-11-25T15:20:17Z. --- @DavidM1911 fixed and pushed (`9249b7a`, rebased onto `main` `06c9f55`, one commit). What went wrong: this PR predates 5195e27b, which puts pixel-shader samples without implicit derivatives inside an EXEC check. The emulated compare-with-gradients reads all four lanes of the quad and relies on SampleCmp's quad derivatives. The partial quad's helper lane, pixel (11,1) of the 12×16 triangle, is outside EXEC, so it skipped the sample and left its neighbours' LOD undefined. The PR's own head still passed on its old base; only the merge failed. The fix runs that sample in every lane of the quad, the way implicit-LOD samples already run, and writes the result only for lanes in EXEC. On the RTX 5070 Ti: `gpu_ps_compare_mip_gradients` 1 passed, the `gpu_ps_` filter 7/0, the `sample` filter 22/0, and the full workspace (debug, `--test-threads=4`) 1266 passed, 0 failed, 46 ignored. The new smoke pair goes into the description when it's done. AI use: investigated and fixed with Claude Code (Claude Opus 5.5).
DavidM1911 commented 2026-11-26 03:06:36 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T02:47:29Z.


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

  • cargo test -p xcl --lib: 3 failures under parallel scheduling; clean on --test-threads=1 rerun (1304 passed, 0 failed, 27 ignored, 77s). Intermittent flakes — tracked in #1978.

Thanks!

— Devin

<!-- greyfinch-sync:ivall/xcl:comment:7181121944 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/350#issuecomment-7181121944). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-26T02:47:29Z. --- Re-verification on RTX 3060 Ti (Windows 11), new head merged with current `main`: - `cargo test -p xcl --lib`: 3 failures under parallel scheduling; clean on `--test-threads=1` rerun (**1304 passed, 0 failed, 27 ignored**, 77s). Intermittent flakes — tracked in #1978. Thanks! — Devin
Kalmarv commented 2026-11-26 04:07:39 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-26T03:29:16Z.


@DavidM1911 thanks for the re-run. We ran the same here: 9249b7a merged with main b49be18, debug, cargo test -p xcl --lib, on an RTX 5070 Ti with 32 logical CPUs, so 32 test threads by default.

  • Default threads, five runs: 2 or 3 failures each time.
    • gpu::recomp::tests::gpu_ps_compare_mip_gradients (this PR's test) failed in all five, and hle::d3d12x::vram::tests::gpu_retire_queue_holds_heap_until_blocked_queue_passes_mark did too. hle::d3d12x::vram::tests::d32s8_targets_take_their_own_size_of_video_memory failed in three. Each of these failed with E_OUTOFMEMORY (0x8007000E) when it created a D3D12 resource, not on a wrong sampled value.
    • hle::d3d12x::sparse::tests::a_tile_decommitted_and_committed_again_keeps_its_video_memory failed once, on its video-memory assertion.
  • --test-threads=4, three runs: 1310 passed, 0 failed, 27 ignored each time.
  • main b49be18 on its own, default threads, two runs: in one, the two vram tests failed with the same E_OUTOFMEMORY; the other passed.

Since this PR's test is the one that fails every time at 32 threads, I'll make it take the same lock the vram tests take, and post the default-thread runs after that change here.

Were your 3 among these? If not, could you paste their names and the panic messages? #1978 was closed by #2002, which is on main, so these may be something else.

AI use: Claude Code (Claude Opus 5.5) ran these tests and drafted this reply.

<!-- greyfinch-sync:ivall/xcl:comment:7181761921 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/350#issuecomment-7181761921). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-11-26T03:29:16Z. --- @DavidM1911 thanks for the re-run. We ran the same here: `9249b7a` merged with `main` `b49be18`, debug, `cargo test -p xcl --lib`, on an RTX 5070 Ti with 32 logical CPUs, so 32 test threads by default. - Default threads, five runs: 2 or 3 failures each time. - `gpu::recomp::tests::gpu_ps_compare_mip_gradients` (this PR's test) failed in all five, and `hle::d3d12x::vram::tests::gpu_retire_queue_holds_heap_until_blocked_queue_passes_mark` did too. `hle::d3d12x::vram::tests::d32s8_targets_take_their_own_size_of_video_memory` failed in three. Each of these failed with `E_OUTOFMEMORY` (0x8007000E) when it created a D3D12 resource, not on a wrong sampled value. - `hle::d3d12x::sparse::tests::a_tile_decommitted_and_committed_again_keeps_its_video_memory` failed once, on its video-memory assertion. - `--test-threads=4`, three runs: 1310 passed, 0 failed, 27 ignored each time. - `main` `b49be18` on its own, default threads, two runs: in one, the two `vram` tests failed with the same `E_OUTOFMEMORY`; the other passed. Since this PR's test is the one that fails every time at 32 threads, I'll make it take the same lock the `vram` tests take, and post the default-thread runs after that change here. Were your 3 among these? If not, could you paste their names and the panic messages? #1978 was closed by #2002, which is on `main`, so these may be something else. AI use: Claude Code (Claude Opus 5.5) ran these tests and drafted this reply.
Kalmarv commented 2026-11-26 05:05:35 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-26T04:34:49Z.


Follow-up on the lock: it doesn't help, so it isn't pushed.

With gpu_ps_compare_mip_gradients taking VRAM_TEST_LOCK (local commit 95c16a6 on this head), merged with main b49be18: debug, cargo test -p xcl --lib at the default 32 threads, RTX 5070 Ti, with nothing else on the GPU (346 MiB in use before each run). Three runs, with 6, 5 and 6 failures:

  • gpu_ps_compare_mip_gradients still failed in two of three, with E_OUTOFMEMORY (0x8007000E) when it created a resource.
  • The three title_textures tests that take the same lock failed in all three: gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes and placed_title_textures_share_vram_and_preserve_pixels with E_OUTOFMEMORY, and a_placed_texture_gets_the_pages_of_a_level_with_its_texels once with E_OUTOFMEMORY and twice on the lock (.lock().unwrap()), poisoned by a test that panicked while it held it.
  • The two vram tests failed as before. They fail the same way on main b49be18 alone at this thread count, so that is main's flake, not this PR's.

So the out-of-memory doesn't come from this test running beside the vram tests; it shows up once many GPU tests run at once in one process. With --test-threads=4, this head merged with main b49be18 (without the lock) passes: 1310 passed, 0 failed, 27 ignored in three runs.

AI use: Claude Code (Claude Opus 5.5) made the change, ran these tests and wrote this comment.

<!-- greyfinch-sync:ivall/xcl:comment:7182718205 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/350#issuecomment-7182718205). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-11-26T04:34:49Z. --- Follow-up on the lock: it doesn't help, so it isn't pushed. With `gpu_ps_compare_mip_gradients` taking `VRAM_TEST_LOCK` (local commit `95c16a6` on this head), merged with `main` `b49be18`: debug, `cargo test -p xcl --lib` at the default 32 threads, RTX 5070 Ti, with nothing else on the GPU (346 MiB in use before each run). Three runs, with 6, 5 and 6 failures: - `gpu_ps_compare_mip_gradients` still failed in two of three, with `E_OUTOFMEMORY` (0x8007000E) when it created a resource. - The three `title_textures` tests that take the same lock failed in all three: `gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes` and `placed_title_textures_share_vram_and_preserve_pixels` with `E_OUTOFMEMORY`, and `a_placed_texture_gets_the_pages_of_a_level_with_its_texels` once with `E_OUTOFMEMORY` and twice on the lock (`.lock().unwrap()`), poisoned by a test that panicked while it held it. - The two `vram` tests failed as before. They fail the same way on `main` `b49be18` alone at this thread count, so that is `main`'s flake, not this PR's. So the out-of-memory doesn't come from this test running beside the `vram` tests; it shows up once many GPU tests run at once in one process. With `--test-threads=4`, this head merged with `main` `b49be18` (without the lock) passes: 1310 passed, 0 failed, 27 ignored in three runs. AI use: Claude Code (Claude Opus 5.5) made the change, ran these tests and wrote this comment.
upipibi commented 2026-11-26 09:07:41 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by upipibi on 2026-11-26T08:16:42Z.


RTX 3070 8 GB run of 9249b7a (as-is, on its base main 06c9f55, not merged with current main). The fix holds; at the default 32 threads the failures are E_OUTOFMEMORY (0x8007000E), as in your 04:34Z results. (Edited 08:19Z: narrowed to what was measured.)

  • The fix: gpu_ps_compare_mip_gradients, --test-threads=1: 3 of 3 passed, no SKIPPED. Controls: with only the EXEC change reverted it fails 3 of 3 (8 of 9 cases, all in the partial quad (10..11, 0) of the 12x16 triangle, e.g. pixel (11,0): 0 instead of 1 at mip 0); with all of emit.rs from main it fails 4 of 9.
  • 32 threads: gpu::recomp::tests:: failed in 2 of 3 runs (this test only); full lib failed in 3 of 3: this test in all 3, vram::tests::d32s8_targets_take_their_own_size_of_video_memory in 2, gpu_ps_p0_reads_flat_integer_selectors and gpu_wave64_ps_spill_slots in 1.
  • --test-threads=4: full lib 1188 passed, 0 failed, 26 ignored; the module 3 x 156/0/17.
  • One instrumented run (error sites in runner.rs labelled locally): the failing call was dev.CreateCommandQueue at runner.rs:1107 in draw_indexed_on, which makes a queue per draw. That is one run; others may fail elsewhere. Possibly related (a hypothesis, not checked): #1668, E_OUTOFMEMORY on the 64th submitted queue.
  • VRAM sampled every 500 ms peaked at 1.29 GB (module) and 2.30 GB (full lib) of 8 GB. System commit and the queue count were not measured.
  • Base 06c9f55, which does not contain the new test: 0 failures in 5 runs at 32 threads.

NVIDIA 616.56, 32 logical CPUs, Windows 11 26100, Rust 1.100.0, debug, DXC 1.8.2502.11. Not tested: merged with current main, release, AMD.

Update (08:26Z): with the same local labelled build, 6 more runs of gpu::recomp::tests:: at the default 32 threads gave 1 failure (gpu_ps_compare_mip_gradients, E_OUTOFMEMORY at runner.rs:1107, CreateCommandQueue in draw_indexed_on); both labelled failures so far are at that call. System commit, logged every second: 70.3% (23.9 of 33.9 GiB) at the failure, 70-74% peak in every run, and the commit limit never changed, so at that resolution commit was not near its limit. The full lib at 32 threads with the new test skipped passed 3 of 3 (1187 passed, 0 failed); at this failure rate that is weak evidence. The number of live queues was not measured.

AI use: Claude Code (Claude Opus 5.5) ran the builds, tests and controls and wrote this from the logs.

<!-- greyfinch-sync:ivall/xcl:comment:7186401073 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/350#issuecomment-7186401073). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-26T08:16:42Z. --- RTX 3070 8 GB run of `9249b7a` (as-is, on its base `main` `06c9f55`, not merged with current `main`). The fix holds; at the default 32 threads the failures are `E_OUTOFMEMORY` (0x8007000E), as in your 04:34Z results. *(Edited 08:19Z: narrowed to what was measured.)* - **The fix:** `gpu_ps_compare_mip_gradients`, `--test-threads=1`: 3 of 3 passed, no SKIPPED. Controls: with only the EXEC change reverted it fails 3 of 3 (8 of 9 cases, all in the partial quad (10..11, 0) of the 12x16 triangle, e.g. `pixel (11,0): 0 instead of 1 at mip 0`); with all of `emit.rs` from `main` it fails 4 of 9. - **32 threads:** `gpu::recomp::tests::` failed in 2 of 3 runs (this test only); full lib failed in 3 of 3: this test in all 3, `vram::tests::d32s8_targets_take_their_own_size_of_video_memory` in 2, `gpu_ps_p0_reads_flat_integer_selectors` and `gpu_wave64_ps_spill_slots` in 1. - **`--test-threads=4`:** full lib 1188 passed, 0 failed, 26 ignored; the module 3 x 156/0/17. - **One instrumented run** (error sites in `runner.rs` labelled locally): the failing call was `dev.CreateCommandQueue` at `runner.rs:1107` in `draw_indexed_on`, which makes a queue per draw. That is one run; others may fail elsewhere. Possibly related (a hypothesis, not checked): #1668, `E_OUTOFMEMORY` on the 64th submitted queue. - VRAM sampled every 500 ms peaked at 1.29 GB (module) and 2.30 GB (full lib) of 8 GB. System commit and the queue count were not measured. - Base `06c9f55`, which does not contain the new test: 0 failures in 5 runs at 32 threads. NVIDIA 616.56, 32 logical CPUs, Windows 11 26100, Rust 1.100.0, debug, DXC 1.8.2502.11. Not tested: merged with current `main`, release, AMD. **Update (08:26Z):** with the same local labelled build, 6 more runs of `gpu::recomp::tests::` at the default 32 threads gave 1 failure (`gpu_ps_compare_mip_gradients`, `E_OUTOFMEMORY` at `runner.rs:1107`, `CreateCommandQueue` in `draw_indexed_on`); both labelled failures so far are at that call. System commit, logged every second: 70.3% (23.9 of 33.9 GiB) at the failure, 70-74% peak in every run, and the commit limit never changed, so at that resolution commit was not near its limit. The full lib at 32 threads with the new test skipped passed 3 of 3 (1187 passed, 0 failed); at this failure rate that is weak evidence. The number of live queues was not measured. AI use: Claude Code (Claude Opus 5.5) ran the builds, tests and controls and wrote this from the logs.
Kalmarv commented 2026-11-26 12:07:01 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-26T11:50:16Z.


@upipibi thank you, your diagnosis was right. draw_views created a direct queue and a fence on every draw, and the new test's 18 draws were enough to make CreateCommandQueue fail at the default thread count.

3d8246e (a second commit, test runner only) makes draw_views submit on the runner's own queue and fence, which it already holds the lock for. draw_on_multi, used with other devices, keeps its own queue. On an RTX 5070 Ti, cargo test -p xcl --lib at the default 32 threads, the two heads alternating, 3 runs each: 9249b7a failed with 0x8007000E in all three runs, and 3d8246e had none (1197 passed twice; one run had an unrelated failure in coherent_buffer_sanitizes_console_flags_and_state at its VirtualFree). The whole suite on 3d8246e: 1266 passed, 0 failed, 46 ignored. Your report is credited in the description.

AI use: Claude Code (Claude Opus 5.5) wrote the change, ran the tests and wrote this.

<!-- greyfinch-sync:ivall/xcl:comment:7191228098 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/350#issuecomment-7191228098). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-11-26T11:50:16Z. --- @upipibi thank you, your diagnosis was right. `draw_views` created a direct queue and a fence on every draw, and the new test's 18 draws were enough to make `CreateCommandQueue` fail at the default thread count. `3d8246e` (a second commit, test runner only) makes `draw_views` submit on the runner's own queue and fence, which it already holds the lock for. `draw_on_multi`, used with other devices, keeps its own queue. On an RTX 5070 Ti, `cargo test -p xcl --lib` at the default 32 threads, the two heads alternating, 3 runs each: `9249b7a` failed with 0x8007000E in all three runs, and `3d8246e` had none (1197 passed twice; one run had an unrelated failure in `coherent_buffer_sanitizes_console_flags_and_state` at its `VirtualFree`). The whole suite on `3d8246e`: 1266 passed, 0 failed, 46 ignored. Your report is credited in the description. AI use: Claude Code (Claude Opus 5.5) wrote the change, ran the tests and wrote this.
upipibi commented 2026-11-26 16:06:16 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by upipibi on 2026-11-26T15:22:18Z.


@Kalmarv re your 11:50Z comment: repeated the old/new comparison on the 8 GB card where 9249b7a failed. RTX 3070 8 GB (Ampere), driver 616.56, Windows 11, 32 threads (default). cargo test -p xcl --lib -- --skip hle::xaudio2, old/new alternated, 3 runs each, separate worktrees and target dirs.

9249b7a: 0x8007000E in 3 of 3. gpu_ps_compare_mip_gradients every run and gpu_ps_p0_reads_flat_integer_selectors once (both via the runner's draw), plus vram d32s8_targets_take_their_own_size_of_video_memory twice at its own CreateCommandQueue. 1185, 1185, 1186 passed.
3d8246e: none in 3; 1188 passed, 0 failed, 26 ignored each run.

The only other failure, coherent_buffer_sanitizes_console_flags_and_state (VirtualFree assert, 2 of 3 old runs, none new), is the #1487 flake fixed by #1590, which is on main but not in this branch's base 06c9f55.

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

<!-- greyfinch-sync:ivall/xcl:comment:7196172322 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/350#issuecomment-7196172322). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-26T15:22:18Z. --- @Kalmarv re your 11:50Z comment: repeated the old/new comparison on the 8 GB card where 9249b7a failed. RTX 3070 8 GB (Ampere), driver 616.56, Windows 11, 32 threads (default). `cargo test -p xcl --lib -- --skip hle::xaudio2`, old/new alternated, 3 runs each, separate worktrees and target dirs. 9249b7a: 0x8007000E in 3 of 3. gpu_ps_compare_mip_gradients every run and gpu_ps_p0_reads_flat_integer_selectors once (both via the runner's draw), plus vram d32s8_targets_take_their_own_size_of_video_memory twice at its own CreateCommandQueue. 1185, 1185, 1186 passed. 3d8246e: none in 3; 1188 passed, 0 failed, 26 ignored each run. The only other failure, coherent_buffer_sanitizes_console_flags_and_state (VirtualFree assert, 2 of 3 old runs, none new), is the #1487 flake fixed by #1590, which is on main but not in this branch's base 06c9f55. AI-assisted (Claude Code, Claude Opus 5.5).
futurepro62 commented 2026-11-26 17:17:23 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-26T17:17:23Z.


NVIDIA and AMD full-suite run, to go with the reports above by upipibi, since none of them covers AMD. Tested exact head 3d8246e1 (on its base 06c9f55).

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 -- --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: 1254 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, dispatch_chain_native_wave64_builds_whole, 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_ps_compare_mip_gradients.
  • Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1: 1265 passed, 0 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 8b957bec 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.

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:7198777939 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/350#issuecomment-7198777939). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-26T17:17:23Z. --- NVIDIA and AMD full-suite run, to go with the reports above by upipibi, since none of them covers AMD. Tested exact head `3d8246e1` (on its base `06c9f55`). **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 -- --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`: **1254 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`, `dispatch_chain_native_wave64_builds_whole`, `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_ps_compare_mip_gradients`. - Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, `XCL_ADAPTER=radeon`), `cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1`: **1265 passed, 0 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 `8b957bec` 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`. **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.
ClosetPie107 commented 2026-11-26 17:24:25 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ClosetPie107 on 2026-11-26T17:24:25Z.


Independent test report under Wine/Proton (not native Windows) for head 3d8246e1, merged onto main 8b957bec (test commit d7e6e09b).

Tested

  • AMD Radeon RX 9070 (RDNA4, RADV GFX1201, Mesa 26.3.1), Ryzen 5 9600X, CachyOS Linux 7.3.5

  • Proton Experimental experimental-11.0-20261112, DXVK v3.1.1-209, DXC 1.9.2609.5, Rust 1.96.0, target x86_64-pc-windows-gnu, debug build for tests

  • vkd3d-proton master ec207194 (dxil-spirv b540c8a2) with a local patch that drops the lpVtbl identity checks in d3d12_command_allocator_from_iface / d3d12_command_list_from_iface, loaded with WINEDLLOVERRIDES=d3d12,d3d12core,dxgi=n,b, VKD3D_CONFIG=ignore_shared_fence

  • XCL_REQUIRE_GPU=wave64 cargo test -p xcl --lib gpu_ps_compare_mip_gradients -- --test-threads=1: 1 passed, 0 failed, not skipped.

  • cargo test --workspace --no-fail-fast -- --test-threads=4, same environment, main vs main+PR:

passed failed ignored SKIPPED
main 8b957bec 1434 12 47 12
main + #350 1433 11 + 1 binary abort 47 12

The same 11 failures happen on both runs under Wine (pls_quota, e2e testtitle, predication_e2e, f32/f64/fma GPU programs, Opus/XMA2 voices, sparse tile recommit, among others). main also failed sparse::flush_parked_does_not_free_or_reuse_tiles_while_unmap_is_in_flight, which passed with the PR.

The PR run's extra failure is tests/d3d12_resource_and_sync.rs. The process dies during fence_and_command_queue_sync_timing_and_allocator_reset_match_host_and_console, right after the ID3D12CommandQueue::Wait on q0 fence >= 0x2 log line. No panic is printed, and one run printed glibc corrupted double-linked list. This binary passed in the main full-suite run, so I ran only this binary 3 more times on each revision:

focused reruns exits
main crashed 3/3 148, 1, 148
main + #350 crashed 3/3 1, 1, 1

The crash happens on main without this PR and depends on timing. It looks like a Wine/vkd3d-proton problem with fence/allocator lifetime, and I don't think #350 caused it.

Not tested

  • Native Windows, NVIDIA/Intel, stock (unpatched) Proton vkd3d-proton
  • A retail title: this run did not exercise the comparison-sampling path in a game.

AI use

  • Codex in T3 Code (gpt-6.2-sol) wrote the test scripts and ran the tests on this machine. Claude Code (Claude Opus 5.5) wrote this report from the logs.
<!-- greyfinch-sync:ivall/xcl:comment:7198962119 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/350#issuecomment-7198962119). Originally posted by [ClosetPie107](https://github.com/ClosetPie107) on 2026-11-26T17:24:25Z. --- Independent test report under Wine/Proton (not native Windows) for head `3d8246e1`, merged onto `main` `8b957bec` (test commit `d7e6e09b`). **Tested** - AMD Radeon RX 9070 (RDNA4, RADV GFX1201, Mesa 26.3.1), Ryzen 5 9600X, CachyOS Linux 7.3.5 - Proton Experimental `experimental-11.0-20261112`, DXVK `v3.1.1-209`, DXC `1.9.2609.5`, Rust 1.96.0, target `x86_64-pc-windows-gnu`, debug build for tests - `vkd3d-proton` master `ec207194` (dxil-spirv `b540c8a2`) with a local patch that drops the `lpVtbl` identity checks in `d3d12_command_allocator_from_iface` / `d3d12_command_list_from_iface`, loaded with `WINEDLLOVERRIDES=d3d12,d3d12core,dxgi=n,b`, `VKD3D_CONFIG=ignore_shared_fence` - `XCL_REQUIRE_GPU=wave64 cargo test -p xcl --lib gpu_ps_compare_mip_gradients -- --test-threads=1`: **1 passed, 0 failed**, not skipped. - `cargo test --workspace --no-fail-fast -- --test-threads=4`, same environment, `main` vs `main`+PR: | | passed | failed | ignored | SKIPPED | |---|---:|---:|---:|---:| | `main` `8b957bec` | 1434 | 12 | 47 | 12 | | `main` + #350 | 1433 | 11 + 1 binary abort | 47 | 12 | The same 11 failures happen on both runs under Wine (`pls_quota`, `e2e` testtitle, `predication_e2e`, f32/f64/fma GPU programs, Opus/XMA2 voices, sparse tile recommit, among others). `main` also failed `sparse::flush_parked_does_not_free_or_reuse_tiles_while_unmap_is_in_flight`, which passed with the PR. The PR run's extra failure is `tests/d3d12_resource_and_sync.rs`. The process dies during `fence_and_command_queue_sync_timing_and_allocator_reset_match_host_and_console`, right after the `ID3D12CommandQueue::Wait on q0 fence >= 0x2` log line. No panic is printed, and one run printed glibc `corrupted double-linked list`. This binary passed in the `main` full-suite run, so I ran only this binary 3 more times on each revision: | | focused reruns | exits | |---|---|---| | `main` | crashed 3/3 | 148, 1, 148 | | `main` + #350 | crashed 3/3 | 1, 1, 1 | The crash happens on `main` without this PR and depends on timing. It looks like a Wine/vkd3d-proton problem with fence/allocator lifetime, and I don't think #350 caused it. **Not tested** - Native Windows, NVIDIA/Intel, stock (unpatched) Proton `vkd3d-proton` - A retail title: this run did not exercise the comparison-sampling path in a game. **AI use** - Codex in T3 Code (gpt-6.2-sol) wrote the test scripts and ran the tests on this machine. Claude Code (Claude Opus 5.5) wrote this report from the logs.
thehollowedone commented 2026-11-28 09:23:03 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-28T09:23:03Z.


merge-check
base: e429936c10
head: 3d8246e1e7
merge: clean; the trial merge changes gpu/recomp/emit.rs, runner.rs, and tests.rs (+149/-11).
build: cargo build --offline --locked -j 4 --workspace -> ok on the unchanged trial merge.
tests: cargo test --offline --locked -j 4 -p xcl --lib gpu_ps_compare_mip_gradients -- --nocapture -> 1 passed, 0 failed, 0 ignored, 0 skips. cargo test --offline --locked -j 4 --workspace --no-fail-fast -- --test-threads=4 -> 2,126 passed, 10 failed, 48 ignored, 25 explicit SKIPPED GPU/environment notices. Failing: dispatch_chain_oversized_loop_matches_whole, dispatch_chain_wave32_live_loops, dispatch_chain_wave64_live_loops_and_exchange, gpu_heap_flat_reads_match_guarded_and_root_output, console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk, gpu_compute_mode_dispatch_abi, gpu_float_cas_uses_ieee_equality, test_title_draws_with_a_root_signature_under_the_debug_layer, test_title_runs_and_game_folder_is_untouched, test_title_runs_under_the_debug_layer_with_dred. All ten also failed on untouched main e429936c. This machine's suite is not green.
review: P2 visual-correctness regression. The new quad reconstruction adds explicit gradients to each pixel's binary32 coordinate here. At U = 12,582,913, binary32 spacing is 1; U ± 0.25 rounds back to U. The synthesized quad therefore has zero horizontal derivative although the supplied gradient on the 8-wide texture is two texels and should select mip 1. A synthetic clamp-sampler/depth-checkerboard regression using this PR's helper passed 1/1 with only the emitter restored to current main and failed 0/1 with this head's emitter: full-screen pixel (0,0) returned 0 instead of 1 at mip 1. The PR's existing gradient test still passed. The exact test-only diff is below. No sampled title data was involved.
resolution: preserve the explicit gradient independently of coordinate magnitude and sampler address behavior. A blanket clamp of the coordinate is insufficient for wrap, mirror, border, and cube cases. DXIL documents native SampleCmpGrad for Shader Model 6.8+; XCL currently targets 6.6, so a version-gated native path still needs a correct 6.6 fallback. I did not verify an implementation candidate. The regression should cover representability loss and address modes before this change is merged.
performance: the new path emits four SampleCmp evaluations per pixel for comparison samples with explicit gradients, plus quad operations, versus one comparison sample before. I did not measure title frame time.
verdict: not yet: the matched GPU fixture demonstrates a wrong mip on this exact head despite its existing test passing.
hardware / tool and model: Windows 11 build 26300, Ryzen 7 9800X3D, NVIDIA RTX 3080 Ti driver 621.35, DXC 1.8.2502.11; Codex (GPT-6.2 Sol) built and ran the GPU/control and workspace checks; Codex (GPT-6.2 Astra) independently traced the source and constructed the failing fixture.

Test-only reproduction diff (head 0/1; main emitter 1/1)
diff --git a/crates/xcl/src/gpu/recomp/tests.rs b/crates/xcl/src/gpu/recomp/tests.rs
index dcfd8e21..64da0447 100644
--- a/crates/xcl/src/gpu/recomp/tests.rs
+++ b/crates/xcl/src/gpu/recomp/tests.rs
@@ -2389,6 +2389,26 @@ fn gpu_ps_compare_mip_gradients() {
     assert!(failures.is_empty(), "{}", failures.join("\n"));
 }
 
+#[test]
+fn gpu_ps_compare_large_clamped_coordinate_keeps_explicit_gradient() {
+    if !gpu_ready() {
+        return;
+    }
+    let ps = prog(&[
+        ("V_MOV_B32", "ENC_VOP1", &[("VDST", 8), ("SRC0", 240)], None),
+        ("V_MOV_B32", "ENC_VOP1", &[("VDST", 9), ("SRC0", 255)], Some(0.25f32.to_bits())),
+        ("V_MOV_B32", "ENC_VOP1", &[("VDST", 10), ("SRC0", 128)], None),
+        ("V_MOV_B32", "ENC_VOP1", &[("VDST", 11), ("SRC0", 128)], None),
+        ("V_MOV_B32", "ENC_VOP1", &[("VDST", 12), ("SRC0", 128)], None),
+        ("V_MUL_F32", "ENC_VOP2", &[("VDST", 13), ("SRC0", 255), ("VSRC1", 2)], Some(2.0f32.to_bits())),
+        ("V_ADD_F32", "ENC_VOP2", &[("VDST", 13), ("SRC0", 255), ("VSRC1", 13)], Some(12_582_912.0f32.to_bits())),
+        ("V_MUL_F32", "ENC_VOP2", &[("VDST", 14), ("SRC0", 255), ("VSRC1", 3)], Some(2.0f32.to_bits())),
+        ("IMAGE_SAMPLE_C_D", "ENC_MIMG", &[("VDATA", 20), ("VADDR", 8), ("SRSRC", 4), ("SSAMP", 6), ("DMASK", 1), ("DIM", 1)], None),
+        ("EXP", "ENC_EXP", &[("TGT", 0), ("EN", 1), ("VSRC0", 20), ("DONE", 1), ("VM", 1)], None),
+    ]);
+    check_ps_depth_mip_shapes(&ps, 2.0, |_| 1, &[(32.0, 32.0)]).unwrap();
+}
+
 /// `draw_console` with initial SGPRs and textures / samplers (see `runner::ViewTexture`).
 fn draw_console_views(
     vs: Option<&[u8]>,
@@ -2430,6 +2450,10 @@ fn draw_console_views(
 /// Both depth mips contain a checkerboard, in opposite phases. Check the comparison result at
 /// each pixel so that selecting a neighbor's coordinates is distinguishable from selecting its mip.
 fn check_ps_depth_mip(ps: &[u8], coord_scale: f32, mip_at: impl Fn(usize) -> u32) -> Result<(), String> {
+    check_ps_depth_mip_shapes(ps, coord_scale, mip_at, &[(32.0, 32.0), (12.0, 16.0)])
+}
+
+fn check_ps_depth_mip_shapes(ps: &[u8], coord_scale: f32, mip_at: impl Fn(usize) -> u32, shapes: &[(f32, f32)]) -> Result<(), String> {
     use windows::Win32::Graphics::Direct3D12::*;
     use windows::Win32::Graphics::Dxgi::Common::{DXGI_FORMAT_R32_FLOAT, DXGI_FORMAT_R32_TYPELESS, DXGI_SAMPLE_DESC};
     let mut data = Vec::new();
@@ -2461,7 +2485,7 @@ fn check_ps_depth_mip(ps: &[u8], coord_scale: f32, mip_at: impl Fn(usize) -> u32
     let samplers = [crate::gpu::desc::sampler_d3d12(&sampler, true)];
     // The second triangle cuts through 2x2 quads. Its diagonal is 4*x + 3*y = 48;
     // no pixel center lies exactly on it. Uncovered pixels must retain the clear value.
-    for (width, height) in [(32.0, 32.0), (12.0, 16.0)] {
+    for &(width, height) in shapes {
         let tri = [[0.0, 0.0], [0.0, height], [width, 0.0]];
         let pixels = draw_console_views(None, Some(ps), &tri, &sgprs, std::slice::from_ref(&tex), &samplers);
         for (i, pixel) in pixels.iter().enumerate() {
<!-- greyfinch-sync:ivall/xcl:comment:7237203581 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/350#issuecomment-7237203581). Originally posted by [thehollowedone](https://github.com/thehollowedone) on 2026-11-28T09:23:03Z. --- merge-check base: e429936c10a5b8aa09470ff99dfc8c8d3d8c56fd head: 3d8246e1e756bf1d9bfedeedffc415bd7c246664 merge: clean; the trial merge changes `gpu/recomp/emit.rs`, `runner.rs`, and `tests.rs` (+149/-11). build: `cargo build --offline --locked -j 4 --workspace` -> ok on the unchanged trial merge. tests: `cargo test --offline --locked -j 4 -p xcl --lib gpu_ps_compare_mip_gradients -- --nocapture` -> 1 passed, 0 failed, 0 ignored, 0 skips. `cargo test --offline --locked -j 4 --workspace --no-fail-fast -- --test-threads=4` -> 2,126 passed, 10 failed, 48 ignored, 25 explicit `SKIPPED` GPU/environment notices. Failing: `dispatch_chain_oversized_loop_matches_whole`, `dispatch_chain_wave32_live_loops`, `dispatch_chain_wave64_live_loops_and_exchange`, `gpu_heap_flat_reads_match_guarded_and_root_output`, `console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk`, `gpu_compute_mode_dispatch_abi`, `gpu_float_cas_uses_ieee_equality`, `test_title_draws_with_a_root_signature_under_the_debug_layer`, `test_title_runs_and_game_folder_is_untouched`, `test_title_runs_under_the_debug_layer_with_dred`. All ten also failed on [untouched main `e429936c`](https://github.com/xcl-dev/xcl/pull/2479#issuecomment-7236759153). This machine's suite is not green. review: **P2 visual-correctness regression.** The new quad reconstruction adds explicit gradients to each pixel's binary32 coordinate [here](https://github.com/xcl-dev/xcl/blob/3d8246e1e756bf1d9bfedeedffc415bd7c246664/crates/xcl/src/gpu/recomp/emit.rs#L2466-L2468). At U = 12,582,913, binary32 spacing is 1; U ± 0.25 rounds back to U. The synthesized quad therefore has zero horizontal derivative although the supplied gradient on the 8-wide texture is two texels and should select mip 1. A synthetic clamp-sampler/depth-checkerboard regression using this PR's helper passed 1/1 with **only the emitter restored to current main** and failed 0/1 with this head's emitter: full-screen pixel (0,0) returned 0 instead of 1 at mip 1. The PR's existing gradient test still passed. The exact test-only diff is below. No sampled title data was involved. resolution: preserve the explicit gradient independently of coordinate magnitude and sampler address behavior. A blanket clamp of the coordinate is insufficient for wrap, mirror, border, and cube cases. [DXIL documents native `SampleCmpGrad` for Shader Model 6.8+](https://github.com/microsoft/DirectXShaderCompiler/blob/main/docs/DXIL.rst); XCL currently targets 6.6, so a version-gated native path still needs a correct 6.6 fallback. I did not verify an implementation candidate. The regression should cover representability loss and address modes before this change is merged. performance: the new path emits four `SampleCmp` evaluations per pixel for comparison samples with explicit gradients, plus quad operations, versus one comparison sample before. I did not measure title frame time. verdict: not yet: the matched GPU fixture demonstrates a wrong mip on this exact head despite its existing test passing. hardware / tool and model: Windows 11 build 26300, Ryzen 7 9800X3D, NVIDIA RTX 3080 Ti driver 621.35, DXC 1.8.2502.11; Codex (GPT-6.2 Sol) built and ran the GPU/control and workspace checks; Codex (GPT-6.2 Astra) independently traced the source and constructed the failing fixture. <details> <summary>Test-only reproduction diff (head 0/1; main emitter 1/1)</summary> ```diff diff --git a/crates/xcl/src/gpu/recomp/tests.rs b/crates/xcl/src/gpu/recomp/tests.rs index dcfd8e21..64da0447 100644 --- a/crates/xcl/src/gpu/recomp/tests.rs +++ b/crates/xcl/src/gpu/recomp/tests.rs @@ -2389,6 +2389,26 @@ fn gpu_ps_compare_mip_gradients() { assert!(failures.is_empty(), "{}", failures.join("\n")); } +#[test] +fn gpu_ps_compare_large_clamped_coordinate_keeps_explicit_gradient() { + if !gpu_ready() { + return; + } + let ps = prog(&[ + ("V_MOV_B32", "ENC_VOP1", &[("VDST", 8), ("SRC0", 240)], None), + ("V_MOV_B32", "ENC_VOP1", &[("VDST", 9), ("SRC0", 255)], Some(0.25f32.to_bits())), + ("V_MOV_B32", "ENC_VOP1", &[("VDST", 10), ("SRC0", 128)], None), + ("V_MOV_B32", "ENC_VOP1", &[("VDST", 11), ("SRC0", 128)], None), + ("V_MOV_B32", "ENC_VOP1", &[("VDST", 12), ("SRC0", 128)], None), + ("V_MUL_F32", "ENC_VOP2", &[("VDST", 13), ("SRC0", 255), ("VSRC1", 2)], Some(2.0f32.to_bits())), + ("V_ADD_F32", "ENC_VOP2", &[("VDST", 13), ("SRC0", 255), ("VSRC1", 13)], Some(12_582_912.0f32.to_bits())), + ("V_MUL_F32", "ENC_VOP2", &[("VDST", 14), ("SRC0", 255), ("VSRC1", 3)], Some(2.0f32.to_bits())), + ("IMAGE_SAMPLE_C_D", "ENC_MIMG", &[("VDATA", 20), ("VADDR", 8), ("SRSRC", 4), ("SSAMP", 6), ("DMASK", 1), ("DIM", 1)], None), + ("EXP", "ENC_EXP", &[("TGT", 0), ("EN", 1), ("VSRC0", 20), ("DONE", 1), ("VM", 1)], None), + ]); + check_ps_depth_mip_shapes(&ps, 2.0, |_| 1, &[(32.0, 32.0)]).unwrap(); +} + /// `draw_console` with initial SGPRs and textures / samplers (see `runner::ViewTexture`). fn draw_console_views( vs: Option<&[u8]>, @@ -2430,6 +2450,10 @@ fn draw_console_views( /// Both depth mips contain a checkerboard, in opposite phases. Check the comparison result at /// each pixel so that selecting a neighbor's coordinates is distinguishable from selecting its mip. fn check_ps_depth_mip(ps: &[u8], coord_scale: f32, mip_at: impl Fn(usize) -> u32) -> Result<(), String> { + check_ps_depth_mip_shapes(ps, coord_scale, mip_at, &[(32.0, 32.0), (12.0, 16.0)]) +} + +fn check_ps_depth_mip_shapes(ps: &[u8], coord_scale: f32, mip_at: impl Fn(usize) -> u32, shapes: &[(f32, f32)]) -> Result<(), String> { use windows::Win32::Graphics::Direct3D12::*; use windows::Win32::Graphics::Dxgi::Common::{DXGI_FORMAT_R32_FLOAT, DXGI_FORMAT_R32_TYPELESS, DXGI_SAMPLE_DESC}; let mut data = Vec::new(); @@ -2461,7 +2485,7 @@ fn check_ps_depth_mip(ps: &[u8], coord_scale: f32, mip_at: impl Fn(usize) -> u32 let samplers = [crate::gpu::desc::sampler_d3d12(&sampler, true)]; // The second triangle cuts through 2x2 quads. Its diagonal is 4*x + 3*y = 48; // no pixel center lies exactly on it. Uncovered pixels must retain the clear value. - for (width, height) in [(32.0, 32.0), (12.0, 16.0)] { + for &(width, height) in shapes { let tri = [[0.0, 0.0], [0.0, height], [width, 0.0]]; let pixels = draw_console_views(None, Some(ps), &tri, &sgprs, std::slice::from_ref(&tex), &samplers); for (i, pixel) in pixels.iter().enumerate() { ``` </details>
throny commented 2026-11-28 13:38:52 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-28T13:38:52Z.


merge-check claim
head: 3d8246e1e7

<!-- greyfinch-sync:ivall/xcl:comment:7240084394 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/350#issuecomment-7240084394). Originally posted by [throny](https://github.com/throny) on 2026-11-28T13:38:52Z. --- merge-check claim head: 3d8246e1e756bf1d9bfedeedffc415bd7c246664
throny commented 2026-11-28 13:55:03 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-28T13:55:03Z.


merge-check
base: e13d6250
head: 3d8246e1e7
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2131 passed, 10 failed, 48 ignored (26 SKIPPED lines). The 10 failures are the ones main itself has at e13d6250 on this GPU (#3093: the nine since #2959 and, since today, gpu::dxil::msaa_tests::direct_msaa_loads_precede_get_dimensions), the same set with and without this PR; base alone: 2130 passed, 10 failed, 48 ignored.
review: no blocking finding. The new arm covers pixel-shader comparison samples with gradients only; both callers of the changed test-runner function are updated. Open from the thread (point 1 of an earlier review): the forms with an offset still move by mip-0 texels, which depends on #247 (open); the author says a one-line follow-up is needed when the two meet.
performance: this one costs frame time by design: each pixel-shader comparison sample with gradients becomes four SampleCmp calls plus quad reads instead of one, in every lane of the quad. Titles whose shadow lookups use gradients pay it; not measured here. It changes a translator source: every tester re-translates once.
verdict: safe to merge (correctness; the cost above deserves a title measurement)
hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).

<!-- greyfinch-sync:ivall/xcl:comment:7240277296 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/350#issuecomment-7240277296). Originally posted by [throny](https://github.com/throny) on 2026-11-28T13:55:03Z. --- merge-check base: e13d6250 head: 3d8246e1e756bf1d9bfedeedffc415bd7c246664 merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2131 passed, 10 failed, 48 ignored (26 SKIPPED lines). The 10 failures are the ones main itself has at e13d6250 on this GPU (#3093: the nine since #2959 and, since today, gpu::dxil::msaa_tests::direct_msaa_loads_precede_get_dimensions), the same set with and without this PR; base alone: 2130 passed, 10 failed, 48 ignored. review: no blocking finding. The new arm covers pixel-shader comparison samples with gradients only; both callers of the changed test-runner function are updated. Open from the thread (point 1 of an earlier review): the forms with an offset still move by mip-0 texels, which depends on #247 (open); the author says a one-line follow-up is needed when the two meet. performance: this one costs frame time by design: each pixel-shader comparison sample with gradients becomes four SampleCmp calls plus quad reads instead of one, in every lane of the quad. Titles whose shadow lookups use gradients pay it; not measured here. It changes a translator source: every tester re-translates once. verdict: safe to merge (correctness; the cost above deserves a title measurement) hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).
Foniass commented 2026-12-01 07:49:52 +00:00 (Migrated from github.com)

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


merge-check
base: 7d86c5d2b7
head: 3d8246e1e7
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2897 passed, 0 failed, 51 ignored; SKIPPED: 28 (20 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 no heap windows, 1 cannot disable the driver cache, 3 others; the same set as on main); failing: none
review: read the whole diff. Not on main; it merges cleanly onto d0832e61, keeping a single sample_cmp_grad shared with #349 (7d1c008d). Findings: (1) on current main direct DXIL is the default route for pixel shaders, and there a PS comparison sample ignores both the supplied gradients and the bias (gpu/dxil/lower_image.rs ~1354-1357 emits sample_cmp(..., cl) whatever grads / bias hold), so this change, like the merged #349, only reaches PS that fall back to HLSL; gpu_ps_compare_mip_gradients compiles HLSL through translate + DXC, so it doesn't cover the default route. A follow-up in lower_image.rs is needed for titles to see it by default. (2) _o forms with a non-zero offset still move by mip 0's texels, as the description says (#247). (3) The runner.rs commit (one queue per draw, main still creates one per draw at ~1137) is a separate test-infra fix that could stand alone. Fine: the whole_quad change correctly moves compare-with-gradient samples out of the EXEC guard so the QuadReadLaneAt reads see all four lanes, and the cube / array location building matches the existing sample path.
performance: 60 s smoke of a retail title, main 7d86c5d2 vs this merge (de814153): 1663 -> 1690 frames shown (101 %; last presents per 2 s: 60 60 60), peak commit 17153 -> 17307 MB, 0 device removals, 0 crashes.
verdict: safe to merge (HLSL path only: the default direct DXIL route still ignores compare-sample gradients and bias, so titles see it only on HLSL fallbacks; the runner.rs queue fix could be its own PR)
hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5

AI-written and posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7304531940 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/350#issuecomment-7304531940). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T07:49:52Z. --- merge-check base: 7d86c5d2b7845695031eeea1327aa81b6c439323 head: 3d8246e1e756bf1d9bfedeedffc415bd7c246664 merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2897 passed, 0 failed, 51 ignored; SKIPPED: 28 (20 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 no heap windows, 1 cannot disable the driver cache, 3 others; the same set as on main); failing: none review: read the whole diff. Not on main; it merges cleanly onto d0832e61, keeping a single `sample_cmp_grad` shared with #349 (7d1c008d). Findings: (1) on current main direct DXIL is the default route for pixel shaders, and there a PS comparison sample ignores both the supplied gradients and the bias (`gpu/dxil/lower_image.rs` ~1354-1357 emits `sample_cmp(..., cl)` whatever `grads` / `bias` hold), so this change, like the merged #349, only reaches PS that fall back to HLSL; `gpu_ps_compare_mip_gradients` compiles HLSL through `translate` + DXC, so it doesn't cover the default route. A follow-up in `lower_image.rs` is needed for titles to see it by default. (2) `_o` forms with a non-zero offset still move by mip 0's texels, as the description says (#247). (3) The `runner.rs` commit (one queue per draw, main still creates one per draw at ~1137) is a separate test-infra fix that could stand alone. Fine: the `whole_quad` change correctly moves compare-with-gradient samples out of the EXEC guard so the `QuadReadLaneAt` reads see all four lanes, and the cube / array location building matches the existing sample path. performance: 60 s smoke of a retail title, main 7d86c5d2 vs this merge (de814153): 1663 -> 1690 frames shown (101 %; last presents per 2 s: 60 60 60), peak commit 17153 -> 17307 MB, 0 device removals, 0 crashes. verdict: safe to merge (HLSL path only: the default direct DXIL route still ignores compare-sample gradients and bias, so titles see it only on HLSL fallbacks; the runner.rs queue fix could be its own PR) hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5 AI-written and posted by Foniass without a human check of each point.
stijn-boer commented 2026-12-02 18:01:19 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by stijn-boer on 2026-12-02T18:01:19Z.


merge-check
base: 817eb1fc9f
head: 3d8246e1e7
verdict: not yet: the targeted AMD gradient draws passed and the early workspace and smoke exits reproduced on main. The same-head review found the fix only applies to HLSL fallbacks; the default direct DXIL route still ignores the gradients.

Windows / AMD RDNA4 (native D3D12) — comparison gradient and mip-selection checks on 3d8246e

Clean merge onto main at 817eb1f (merge commit 76dce6e5172e4319b3e87a110fa76cbb176caa0c). git diff --check was clean.

Setup

  • AMD Radeon RX 9060 XT (driver 32.0.32029.2010), Ryzen 7 5700X, Windows 10 21H2 build 19044.6332
  • Rust 1.100.0, debug builds, Agility SDK 1.620.2 with matching d3d12SDKLayers.dll, DXC 1.9.2609.5

Tested

cargo build --workspace passed. cargo test --workspace --no-fail-fast -- --test-threads=4 --show-output exited 101 on both builds. The baseline table row is from a prior run of the same commit, machine, SDK, and command.

Build Passed Failed Ignored SKIPPED notices
main 340 3 23 0
Merged PR 340 3 23 0

Counts are partial because two test processes aborted on each build.

  • Tests that failed on the PR and passed on main — none observed in the comparable results.
  • Test added by the PR — gpu_ps_compare_mip_gradients passed on AMD in isolation. Its nine draws cover finer and coarser footprints, minimum LOD, offsets, positive and negative infinity, NaN, and a per-lane gradient.
  • Draw runner — the gradient test exercised the shared queue. emitted_ps_samples_a_texture_with_implicit_lod separately passed through draw_on_multi. Each focused test ran serially with --show-output --nocapture and emitted no skip notices.
  • Debug-layer coverage — both debug-layer E2E tests, including DRED, and uploads_start_from_each_subresources_state passed.
Shared failures and process aborts
  • fuzz_validate_and_gpu_1, fuzz_validate_and_gpu_3, and two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs reported failures on both builds.
  • The library and gpu_compute_e2e test processes exited with 0xc0000409 on both builds.

Retail smoke

Ran scripts/smoke.ps1 -Game <local folder> -Seconds 60 -Xcl <debug binary> with XCL_UMA_DRIVER=mixed for title hash 2c508222.

Build Exit Frames logged Device removals logged Peak commit
main 0xc0000409 None 0 1321 MB
Merged PR, first attempt 0xc0000409 None 0 5573 MB
Merged PR, repeat from fresh data root 0xc0000409 None 0 1320 MB

The first run's higher startup commit did not reproduce. These exits leave frame and steady-state memory behavior unverified.

Diff review

The change retains quad helper lanes for pixel-shader comparison gradients and passes explicit footprints into sample_cmp_grad. The focused AMD test covered the new 2D sampling path. The shared-queue change is in the draw runner.

Not tested

Remaining workspace tests after the aborts, retail performance, and explicit comparison-gradient draws for cube and array textures.

AI use

Codex (GPT-6) merged and built the PR, ran the tests, compared the results with main, reviewed the diff, and drafted this report.

<!-- greyfinch-sync:ivall/xcl:comment:7353867971 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/350#issuecomment-7353867971). Originally posted by [stijn-boer](https://github.com/stijn-boer) on 2026-12-02T18:01:19Z. --- merge-check base: 817eb1fc9fb0763008ae5d8de1f7f586f442b51d head: 3d8246e1e756bf1d9bfedeedffc415bd7c246664 verdict: not yet: the targeted AMD gradient draws passed and the early workspace and smoke exits reproduced on main. The [same-head review](https://github.com/xcl-dev/xcl/pull/350#issuecomment-7304531940) found the fix only applies to HLSL fallbacks; the default direct DXIL route still ignores the gradients. **Windows / AMD RDNA4 (native D3D12) — comparison gradient and mip-selection checks on `3d8246e`** Clean merge onto `main` at `817eb1f` (merge commit `76dce6e5172e4319b3e87a110fa76cbb176caa0c`). `git diff --check` was clean. **Setup** - AMD Radeon RX 9060 XT (driver 32.0.32029.2010), Ryzen 7 5700X, Windows 10 21H2 build 19044.6332 - Rust 1.100.0, debug builds, Agility SDK 1.620.2 with matching `d3d12SDKLayers.dll`, DXC 1.9.2609.5 **Tested** `cargo build --workspace` passed. `cargo test --workspace --no-fail-fast -- --test-threads=4 --show-output` exited 101 on both builds. The baseline table row is from a prior run of the same commit, machine, SDK, and command. | Build | Passed | Failed | Ignored | `SKIPPED` notices | |---|---:|---:|---:|---:| | `main` | 340 | 3 | 23 | 0 | | Merged PR | 340 | 3 | 23 | 0 | Counts are partial because two test processes aborted on each build. - **Tests that failed on the PR and passed on `main`** — none observed in the comparable results. - **Test added by the PR** — `gpu_ps_compare_mip_gradients` passed on AMD in isolation. Its nine draws cover finer and coarser footprints, minimum LOD, offsets, positive and negative infinity, NaN, and a per-lane gradient. - **Draw runner** — the gradient test exercised the shared queue. `emitted_ps_samples_a_texture_with_implicit_lod` separately passed through `draw_on_multi`. Each focused test ran serially with `--show-output --nocapture` and emitted no skip notices. - **Debug-layer coverage** — both debug-layer E2E tests, including DRED, and `uploads_start_from_each_subresources_state` passed. <details><summary>Shared failures and process aborts</summary> - `fuzz_validate_and_gpu_1`, `fuzz_validate_and_gpu_3`, and `two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs` reported failures on both builds. - The library and `gpu_compute_e2e` test processes exited with `0xc0000409` on both builds. </details> **Retail smoke** Ran `scripts/smoke.ps1 -Game <local folder> -Seconds 60 -Xcl <debug binary>` with `XCL_UMA_DRIVER=mixed` for title hash `2c508222`. | Build | Exit | Frames logged | Device removals logged | Peak commit | |---|---|---|---:|---:| | `main` | `0xc0000409` | None | 0 | 1321 MB | | Merged PR, first attempt | `0xc0000409` | None | 0 | 5573 MB | | Merged PR, repeat from fresh data root | `0xc0000409` | None | 0 | 1320 MB | The first run's higher startup commit did not reproduce. These exits leave frame and steady-state memory behavior unverified. **Diff review** The change retains quad helper lanes for pixel-shader comparison gradients and passes explicit footprints into `sample_cmp_grad`. The focused AMD test covered the new 2D sampling path. The shared-queue change is in the draw runner. **Not tested** Remaining workspace tests after the aborts, retail performance, and explicit comparison-gradient draws for cube and array textures. **AI use** Codex (GPT-6) merged and built the PR, ran the tests, compared the results with `main`, reviewed the diff, and drafted this report.
Kalmarv commented 2026-12-02 19:37:33 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-12-02T19:37:33Z.


Closing: HLSL-only path with a demonstrated wrong-mip regression and AMD not yet (and partially overlapped by #349); any real fix belongs in direct DXIL.

<!-- greyfinch-sync:ivall/xcl:comment:7356469204 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/350#issuecomment-7356469204). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-12-02T19:37:33Z. --- Closing: HLSL-only path with a demonstrated wrong-mip regression and AMD `not yet` (and partially overlapped by #349); any real fix belongs in direct DXIL.

Pull request closed

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!346
No description provided.