Recompiler: pixel comparison samples apply their LOD bias #345

Merged
Kalmarv merged 1 commit from upstream-pr/349 into main 2026-11-30 03:09:03 +00:00
Kalmarv commented 2026-11-24 00:07:24 +00:00 (Migrated from github.com)

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


Pixel-shader image_sample_c_b* now applies the instruction’s LOD bias to depth comparisons. With point mip filtering, +1 selects the coarser mip and −1 the finer mip. This overlaps #247 in emit.rs and builds directly on main.

What is in it

  • crates/xcl/src/gpu/recomp/emit.rs — Scales ddx(coord) and ddy(coord) by exp2(bias). 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 positive, negative and per-pixel bias, the zero-offset form, zero bias and a minimum-LOD clamp against two opposite depth checkerboards with point mip filtering.

Tested

  • Head 7d1c008 is fe3011d's two commits squashed into one, with the same tree (git diff fe3011d 7d1c008 is empty). cargo test --workspace -- --test-threads=4 on 7d1c008 merged onto main 9e3831e (a clean merge, 389c343): 777 passed, 0 failed, 41 ignored (the xcl library: 728 passed, 21 ignored). SKIPPED: gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware (no wave64), and heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows; main's own test).
  • Rebased head fe3011d1b16d on 18c105af8692. The bias and flat integer selector raster tests both passed (2 passed, 0 failed). cargo build --workspace passed. cargo test --workspace -- --test-threads=4 returned 690 passed, 0 failed, 41 ignored. GPU tests reporting SKIPPED within the pass count: gpu_geometry_wave32_prefix_count_over_a_mask (no wave64), gpu_wave32_program_in_wave64_hardware (no wave64).
  • Previous head cccc2c3890ef 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. All six bias cases passed on the full-screen triangle and the partial quads along the diagonal.
  • 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 d25aea141589 on 9ab7d763197c. cargo build --workspace passed. cargo test --workspace -- --test-threads=4 returned 652 passed, 0 failed, 40 ignored. GPU tests reporting SKIPPED (included in Cargo’s pass count): gpu_geometry_wave32_prefix_count_over_a_mask (no wave64), gpu_wave32_program_in_wave64_hardware (no wave64).
  • Base 9ab7d763197c with only the tests added failed four of six draw cases. The two controls passed on base, and all six passed on this head.
  • Integration with the companion fix and #247 at a60db9f3e5f2: two checks passed. Both offset forms read the expected texel at mip 1 with a nonzero offset. SDK DXC compiled 20 opcode and view combinations.
  • Serial debug-layer suite on clean main: 593 passed, 18 failed, 20 ignored. On both main and the gradient run (594 passed, 18 failed, 20 ignored), CreateReservedResource returned E_OUTOFMEMORY in gpu_sparse_vram_descriptors_buffers_and_xmem. Three sparse windows had zero GPU addresses, then pipeline creation returned DXGI_ERROR_DEVICE_REMOVED.
  • Independent run by @throny (https://github.com/ivall/xcl/pull/349#issuecomment-7118932697): RTX 4080 (NVIDIA 610.88), i9-12900K, Windows 11 26300, Rust 1.100.0, debug, d25aea1 merged onto main 7ebf1b8. The new test passes, and with emit.rs from main fails in four of its six cases. Their whole suite stopped in the #344 hang in 4 of 4 runs; with #443 merged too: 679 passed, 0 failed, 41 ignored.
  • Earlier smoke runs by @CuteBooty, RTX 3070 (NVIDIA 617.14), release, on main 9ab7d76 and the head tested in that report: 918 and 913 frames, no crash or device removal (https://github.com/ivall/xcl/pull/349#issuecomment-7119194735).

Regression run

Our own runs, one after the other on the machine under Tested (RTX 5070 Ti), release builds, no uncommitted changes: main at 18c105a (this PR's base), then this PR's head 7d1c008. 1276 / 1246 frames (102 %), peak commit 26598 / 27160 MB (98 %); no device removal and no crash on either run.

main:

xcl-smoke v1
commit: 18c105af86929d6ae26c44096c85b66f1644e743
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 1246 (PresentX 1246)
presents per 2 s (last 3): 18 15 7
device removals: 0
crashes: 0
peak commit: 27160 MB

PR:

xcl-smoke v1
commit: 7d1c008da9127bde6076023cd3856a92dbb04c40
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 1276 (PresentX 1276)
presents per 2 s (last 3): 23 37 20
device removals: 0
crashes: 0
peak commit: 26598 MB

Not tested

  • 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 run is 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, the rebase onto 18c105a and its runs, and this description
  • Claude Code (Claude Opus 5.5): the smoke runs under Regression run, the squash into one commit and the suite run on 7d1c008

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:issue:5463501295 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/349). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-11-24T00:07:24Z. --- Pixel-shader `image_sample_c_b*` now applies the instruction’s LOD bias to depth comparisons. With point mip filtering, +1 selects the coarser mip and −1 the finer mip. This overlaps #247 in `emit.rs` and builds directly on main. **What is in it** - `crates/xcl/src/gpu/recomp/emit.rs` — Scales `ddx(coord)` and `ddy(coord)` by `exp2(bias)`. 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 positive, negative and per-pixel bias, the zero-offset form, zero bias and a minimum-LOD clamp against two opposite depth checkerboards with point mip filtering. **Tested** - Head `7d1c008` is `fe3011d`'s two commits squashed into one, with the same tree (`git diff fe3011d 7d1c008` is empty). `cargo test --workspace -- --test-threads=4` on `7d1c008` merged onto `main` `9e3831e` (a clean merge, `389c343`): 777 passed, 0 failed, 41 ignored (the `xcl` library: 728 passed, 21 ignored). SKIPPED: `gpu_geometry_wave32_prefix_count_over_a_mask` and `gpu_wave32_program_in_wave64_hardware` (no wave64), and `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows; `main`'s own test). - Rebased head `fe3011d1b16d` on `18c105af8692`. The bias and flat integer selector raster tests both passed (2 passed, 0 failed). `cargo build --workspace` passed. `cargo test --workspace -- --test-threads=4` returned 690 passed, 0 failed, 41 ignored. GPU tests reporting SKIPPED within the pass count: `gpu_geometry_wave32_prefix_count_over_a_mask` (no wave64), `gpu_wave32_program_in_wave64_hardware` (no wave64). - Previous head `cccc2c3890ef` 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. All six bias cases passed on the full-screen triangle and the partial quads along the diagonal. - 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 `d25aea141589` on `9ab7d763197c`. `cargo build --workspace` passed. `cargo test --workspace -- --test-threads=4` returned 652 passed, 0 failed, 40 ignored. GPU tests reporting SKIPPED (included in Cargo’s pass count): `gpu_geometry_wave32_prefix_count_over_a_mask` (no wave64), `gpu_wave32_program_in_wave64_hardware` (no wave64). - Base `9ab7d763197c` with only the tests added failed four of six draw cases. The two controls passed on base, and all six passed on this head. - Integration with the companion fix and #247 at `a60db9f3e5f2`: two checks passed. Both offset forms read the expected texel at mip 1 with a nonzero offset. SDK DXC compiled 20 opcode and view combinations. - Serial debug-layer suite on clean main: 593 passed, 18 failed, 20 ignored. On both main and the gradient run (594 passed, 18 failed, 20 ignored), `CreateReservedResource` returned `E_OUTOFMEMORY` in `gpu_sparse_vram_descriptors_buffers_and_xmem`. Three sparse windows had zero GPU addresses, then pipeline creation returned `DXGI_ERROR_DEVICE_REMOVED`. - Independent run by @throny (https://github.com/ivall/xcl/pull/349#issuecomment-7118932697): RTX 4080 (NVIDIA 610.88), i9-12900K, Windows 11 26300, Rust 1.100.0, debug, `d25aea1` merged onto `main` `7ebf1b8`. The new test passes, and with `emit.rs` from `main` fails in four of its six cases. Their whole suite stopped in the #344 hang in 4 of 4 runs; with #443 merged too: 679 passed, 0 failed, 41 ignored. - Earlier smoke runs by @CuteBooty, RTX 3070 (NVIDIA 617.14), release, on `main` `9ab7d76` and the head tested in that report: 918 and 913 frames, no crash or device removal (https://github.com/ivall/xcl/pull/349#issuecomment-7119194735). **Regression run** Our own runs, one after the other on the machine under **Tested** (RTX 5070 Ti), release builds, no uncommitted changes: `main` at `18c105a` (this PR's base), then this PR's head `7d1c008`. 1276 / 1246 frames (102 %), peak commit 26598 / 27160 MB (98 %); no device removal and no crash on either run. main: ``` xcl-smoke v1 commit: 18c105af86929d6ae26c44096c85b66f1644e743 gpu: NVIDIA GeForce RTX 5070 Ti title: ea3b5e4d seconds: 60 exit: 0x0 frames shown: 1246 (PresentX 1246) presents per 2 s (last 3): 18 15 7 device removals: 0 crashes: 0 peak commit: 27160 MB ``` PR: ``` xcl-smoke v1 commit: 7d1c008da9127bde6076023cd3856a92dbb04c40 gpu: NVIDIA GeForce RTX 5070 Ti title: ea3b5e4d seconds: 60 exit: 0x0 frames shown: 1276 (PresentX 1276) presents per 2 s (last 3): 23 37 20 device removals: 0 crashes: 0 peak commit: 26598 MB ``` **Not tested** - 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 run is 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, the rebase onto `18c105a` and its runs, and this description - Claude Code (Claude Opus 5.5): the smoke runs under **Regression run**, the squash into one commit and the suite run on `7d1c008` 🤖 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:39Z.


AMD run, since Not tested says no AMD driver has compiled these quad operations yet: d25aea1 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.
  • XCL_REQUIRE_GPU=wave64,mesh cargo test -p xcl --lib gpu_ps_compare_mip: gpu_ps_compare_mip_bias passes.
  • Negative control: the merged tree with only emit.rs back on main. The test fails with IMAGE_SAMPLE_C_B, scale 0.125, slope 0: pixel (0,0): 0 instead of 1 from mip 1, plus the _C_B_CL, _C_B_O and slope 0.5 cases.
  • With #350 also merged (the shared sample_cmp_grad is identical, so git merges it cleanly): both compare-mip tests 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:7117950680 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/349#issuecomment-7117950680). Originally posted by [nullmarsh](https://github.com/nullmarsh) on 2026-11-24T00:19:39Z. --- AMD run, since **Not tested** says no AMD driver has compiled these quad operations yet: `d25aea1` 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. - `XCL_REQUIRE_GPU=wave64,mesh cargo test -p xcl --lib gpu_ps_compare_mip`: `gpu_ps_compare_mip_bias` passes. - Negative control: the merged tree with only `emit.rs` back on `main`. The test fails with `IMAGE_SAMPLE_C_B, scale 0.125, slope 0: pixel (0,0): 0 instead of 1 from mip 1`, plus the `_C_B_CL`, `_C_B_O` and slope 0.5 cases. - With #350 also merged (the shared `sample_cmp_grad` is identical, so git merges it cleanly): both compare-mip tests 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.
Kalmarv commented 2026-11-24 07:04:57 +00:00 (Migrated from github.com)

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


Thanks for testing on the RX 9060 XT and checking the negative control where reverting just the emitter change brought back all four mip-selection failures.

🤖 GPT-6.2 Astra

<!-- greyfinch-sync:ivall/xcl:comment:7118001205 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/349#issuecomment-7118001205). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-11-24T00:22:30Z. --- Thanks for testing on the RX 9060 XT and checking the negative control where reverting just the emitter change brought back all four mip-selection failures. 🤖 GPT-6.2 Astra
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:16Z.


NVIDIA RTX 40 run of d25aea1 on main 7ebf1b8 (clean merge): the new test passes and fails without the emit.rs change. The whole suite did not finish on this tree here, for a reason that is not this PR (below).

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 test --workspace -- --test-threads=4 on main + this PR: stopped in the lib tests in 4 of 4 runs (bases a6f5f7a, 2997c9a twice, 7ebf1b8), in the #344 deadlock (gpu_uma_import_check_at_init and three other GPU tests running for over 60 seconds; the same stop happens here on trees without this PR, stacks in my report on #443). gpu_ps_compare_mip_bias had passed before the stop each time.
  • The same tree with #443 (16fc79d) merged in as well: 679 passed, 0 failed, 41 ignored, gpu_ps_compare_mip_bias ok (one run).
  • 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_bias fails in four of its six cases (IMAGE_SAMPLE_C_B +1, _C_B_CL −1, _C_B_O +1 and the per-pixel slope case); the two controls pass.
  • With #350 (13d8a1f): 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)

  • In iteration q every pixel of the quad computes coord[q] + (its position − q's position) · gradient[q], so the implicit derivatives SampleCmp sees are pixel q's scaled ones, and each pixel keeps the result of its own iteration (delta 0, its own coordinate). xi.xcl_pos is always a member of XclIn.

Not tested

  • No regression run (scripts/smoke.ps1) on a title, no shader-pack run (XCL_SAMPLE_RPF), wave64 hardware, cube and array 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:7118932697 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/349#issuecomment-7118932697). Originally posted by [throny](https://github.com/throny) on 2026-11-24T01:16:16Z. --- NVIDIA RTX 40 run of `d25aea1` on `main` `7ebf1b8` (clean merge): the new test **passes** and fails without the `emit.rs` change. The whole suite did not finish on this tree here, for a reason that is not this PR (below). **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 test --workspace -- --test-threads=4` on `main` + this PR: stopped in the lib tests in 4 of 4 runs (bases `a6f5f7a`, `2997c9a` twice, `7ebf1b8`), in the #344 deadlock (`gpu_uma_import_check_at_init` and three other GPU tests running for over 60 seconds; the same stop happens here on trees without this PR, stacks in my report on #443). `gpu_ps_compare_mip_bias` had passed before the stop each time. - The same tree with #443 (`16fc79d`) merged in as well: 679 passed, 0 failed, 41 ignored, `gpu_ps_compare_mip_bias` ok (one run). - `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_bias` fails in four of its six cases (`IMAGE_SAMPLE_C_B` +1, `_C_B_CL` −1, `_C_B_O` +1 and the per-pixel slope case); the two controls pass. - With #350 (`13d8a1f`): 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) - In iteration `q` every pixel of the quad computes `coord[q] + (its position − q's position) · gradient[q]`, so the implicit derivatives `SampleCmp` sees are pixel `q`'s scaled ones, and each pixel keeps the result of its own iteration (delta 0, its own coordinate). `xi.xcl_pos` is always a member of `XclIn`. **Not tested** - No regression run (`scripts/smoke.ps1`) on a title, no shader-pack run (`XCL_SAMPLE_RPF`), wave64 hardware, cube and array 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:19Z.


Review: scaling ddx/ddy by exp2(bias) adds the bias to log2 of the footprint, and the quad construction reproduces those derivatives exactly. Two points (same as on #350):

  1. emit.rs:2191-2196: offsets for comparison samples still use level 0u, so _c_b_o / _c_b_cl_o with a non-zero offset move by mip-0 texels while the bias selects mip ≥ 1. The test's _O rows use offset 0; a note on the #247 dependency, or a non-zero-offset row after #247, would cover it.
  2. The full-screen triangle never creates a partial quad, so helper lanes (which QuadReadLaneAt and SampleCmp depend on here) aren't exercised; an edge through quads would cover that.

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

<!-- greyfinch-sync:ivall/xcl:comment:7118967922 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/349#issuecomment-7118967922). Originally posted by [QemmHD](https://github.com/QemmHD) on 2026-11-24T01:18:19Z. --- Review: scaling `ddx/ddy` by `exp2(bias)` adds the bias to log2 of the footprint, and the quad construction reproduces those derivatives exactly. Two points (same as on #350): 1. `emit.rs:2191-2196`: offsets for comparison samples still use level `0u`, so `_c_b_o` / `_c_b_cl_o` with a non-zero offset move by mip-0 texels while the bias selects mip ≥ 1. The test's `_O` rows use offset 0; a note on the #247 dependency, or a non-zero-offset row after #247, would cover it. 2. The full-screen triangle never creates a partial quad, so helper lanes (which `QuadReadLaneAt` and `SampleCmp` depend on here) aren't exercised; an edge through quads would cover that. 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:05Z.


Regression run on a retail title for d25aea1, 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 911 frames (PR), also with no device removal or crash. The main block is one run, shared with my reports on #348 and #350.
  • Video memory at 60 s, from XCL's memory: line: 6311 MB local / 4619 MB non-local (main), 6311 MB local / 4619 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: d25aea1415895c250f82ec3b36023761c146a3ad
gpu: NVIDIA GeForce RTX 3070
title: game
seconds: 60
exit: 0x0
frames shown: 913 (PresentX 914)
presents per 2 s (last 3): 41 40 40
device removals: 0
crashes: 0
peak commit: 14796 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 a bias (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:7119194735 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/349#issuecomment-7119194735). Originally posted by [CuteBooty](https://github.com/CuteBooty) on 2026-11-24T01:32:05Z. --- Regression run on a retail title for `d25aea1`, 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 911 frames (PR), also with no device removal or crash. The `main` block is one run, shared with my reports on #348 and #350. - Video memory at 60 s, from XCL's `memory:` line: 6311 MB local / 4619 MB non-local (`main`), 6311 MB local / 4619 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: d25aea1415895c250f82ec3b36023761c146a3ad gpu: NVIDIA GeForce RTX 3070 title: game seconds: 60 exit: 0x0 frames shown: 913 (PresentX 914) presents per 2 s (last 3): 41 40 40 device removals: 0 crashes: 0 peak commit: 14796 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 a bias (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:26:14Z.


Thanks for checking the mip calculation and the triangle coverage.

The standalone head uses mip-0 texel units for both offset forms, and its two offset rows pass zero. I added that dependency to the PR body draft. With #247 at a60db9f, a synthetic IMAGE_SAMPLE_C_B_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. The bias fixture now enters whole-quad mode (S_WQM_B64 EXEC, EXEC) before computing texture coordinates so helper pixels supply the screen derivatives. It checks the depth comparison for all 96 covered pixels and the clear value for the other 160.

Tested

PR head cccc2c3890ef 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:7120140291 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/349#issuecomment-7120140291). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-11-24T02:26:14Z. --- Thanks for checking the mip calculation and the triangle coverage. The standalone head uses mip-0 texel units for both offset forms, and its two offset rows pass zero. I added that dependency to the PR body draft. With #247 at `a60db9f`, a synthetic `IMAGE_SAMPLE_C_B_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. The bias fixture now enters whole-quad mode (`S_WQM_B64 EXEC, EXEC`) before computing texture coordinates so helper pixels supply the screen derivatives. It checks the depth comparison for all 96 covered pixels and the clear value for the other 160. **Tested** PR head `cccc2c3890ef` 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:42:12Z.


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

All six bias cases matched the expected pixel values on both the full-screen and partial-quad triangles. The flat integer selector control passed too. The offset variants in this fixture use zero offsets. Two stock tests passed, with zero failures, ignores or skips.

Commands used XCL_ADAPTER=3080 Ti and cargo test --locked --offline --release -p xcl --lib <filter> -- --test-threads=1 --nocapture, with gpu_ps_compare_mip_bias and gpu_ps_p0_reads_flat_integer_selectors.

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

<!-- greyfinch-sync:ivall/xcl:comment:7125277485 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/349#issuecomment-7125277485). Originally posted by [thehollowedone](https://github.com/thehollowedone) on 2026-11-24T07:42:12Z. --- Independent native D3D12 check of [`fe3011d`](https://github.com/ivall/xcl/commit/fe3011d1b16d206391c8c859801d86519f4d3c2d) on RTX 3080 Ti / 621.35, Windows 11 build 26300, DXC 1.8.2502.11 and Rust 1.99.1 MSVC, release. All six bias cases matched the expected pixel values on both the full-screen and partial-quad triangles. The flat integer selector control passed too. The offset variants in this fixture use zero offsets. Two stock tests passed, with zero failures, ignores or skips. Commands used `XCL_ADAPTER=3080 Ti` and `cargo test --locked --offline --release -p xcl --lib <filter> -- --test-threads=1 --nocapture`, with `gpu_ps_compare_mip_bias` and `gpu_ps_p0_reads_flat_integer_selectors`. 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:38Z.


Squashed into one commit (7d1c008, 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 bias, 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 bias too, or gpu_image_sample_c_b_d_offset_moves_by_the_mip_read fails (sample_c_b_o, PS: pixel (0,0) = 0). We have that line ready and tested (62f93a3; 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:7139784893 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/349#issuecomment-7139784893). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-11-24T17:50:38Z. --- Squashed into one commit (`7d1c008`, 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 bias, 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 bias too, or `gpu_image_sample_c_b_d_offset_moves_by_the_mip_read` fails (`sample_c_b_o, PS: pixel (0,0) = 0`). We have that line ready and tested (`62f93a3`; 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)
DavidM1911 commented 2026-11-25 15:07:50 +00:00 (Migrated from github.com)

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


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

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7165349357 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/349#issuecomment-7165349357). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T14:29:05Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
JJAutoCompare commented 2026-11-26 22:48:20 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-26T22:48:20Z.


Tested

Independent run at clean PR head 7d1c008da9127bde6076023cd3856a92dbb04c40 on Intel Arc A770 (driver 32.0.101.9175), Ryzen 7 3800X, Windows 11 x64 26200.9974, Rust/Cargo 1.100.0 MSVC, DXC/DXIL 1.9.2609.5, debug test profile.

Prebuilt with cargo test --locked -p xcl --lib --no-run --message-format=json outside the GPU mutex. Ran <test-exe> gpu::recomp::tests::gpu_ps_compare_mip_bias --exact --nocapture --test-threads=1 under the Arc mutex with XCL_ADAPTER=A770.

1 passed, 0 failed, 0 ignored and 0 GPU skips (1.29 s). All six bias cases matched expected mip-dependent readback across both triangle geometries, including the per-pixel slope and min-LOD clamp.

Not tested

Nonzero texel offsets, cube or array views, performance, the workspace suite and retail smoke.

AI use

T3 Code / Codex (gpt-6.2-sol) ran the original verification and summarized the saved results.

<!-- greyfinch-sync:ivall/xcl:comment:7204999742 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/349#issuecomment-7204999742). Originally posted by [JJAutoCompare](https://github.com/JJAutoCompare) on 2026-11-26T22:48:20Z. --- **Tested** Independent run at clean PR head `7d1c008da9127bde6076023cd3856a92dbb04c40` on Intel Arc A770 (driver 32.0.101.9175), Ryzen 7 3800X, Windows 11 x64 26200.9974, Rust/Cargo 1.100.0 MSVC, DXC/DXIL 1.9.2609.5, debug test profile. Prebuilt with `cargo test --locked -p xcl --lib --no-run --message-format=json` outside the GPU mutex. Ran `<test-exe> gpu::recomp::tests::gpu_ps_compare_mip_bias --exact --nocapture --test-threads=1` under the Arc mutex with `XCL_ADAPTER=A770`. 1 passed, 0 failed, 0 ignored and 0 GPU skips (1.29 s). All six bias cases matched expected mip-dependent readback across both triangle geometries, including the per-pixel slope and min-LOD clamp. **Not tested** Nonzero texel offsets, cube or array views, performance, the workspace suite and retail smoke. **AI use** T3 Code / Codex (gpt-6.2-sol) ran the original verification and summarized the saved results.
futurepro62 commented 2026-11-27 17:57:48 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-27T17:57:48Z.


NVIDIA and AMD full-suite run, to go with the reports above by JJAutoCompare, since none of them names a GPU. Tested exact head 7d1c008d (on its base 18c105a).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace --no-fail-fast -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::recomp::lower_dxil::tests::mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests: 690 passed, 0 failed, 41 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
  • The new tests ran and passed: gpu_ps_compare_mip_bias.
  • Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace --no-fail-fast -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1: 690 passed, 0 failed, 41 ignored, no skips.
  • --skip leaves out tests that fail on main 6089122a 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:7224971989 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/349#issuecomment-7224971989). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-27T17:57:48Z. --- NVIDIA and AMD full-suite run, to go with the reports above by JJAutoCompare, since none of them names a GPU. Tested exact head `7d1c008d` (on its base `18c105a`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace --no-fail-fast -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::recomp::lower_dxil::tests::mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests`: **690 passed, 0 failed, 41 ignored**. SKIPPED (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`. - The new tests ran and passed: `gpu_ps_compare_mip_bias`. - Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, `XCL_ADAPTER=radeon`), `cargo test --workspace --no-fail-fast -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1`: **690 passed, 0 failed, 41 ignored**, no skips. - `--skip` leaves out tests that fail on main `6089122a` 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-27 18:00:59 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ClosetPie107 on 2026-11-27T18:00:59Z.


Tested on AMD / Linux: 7d1c008d (RX 9070 16 GB, RDNA4, Mesa 26.3.1 RADV; Ryzen 5 9600X, 32 GB; CachyOS; Proton Experimental experimental-11.0-20261112 with vkd3d-proton master ec207194 plus a local patch dropping the lpVtbl checks of command allocators and lists; DXC 1.9.2609.5; Rust 1.96.0, x86_64-pc-windows-gnu debug build, tests run under Wine)

The head as it is (not merged onto current main), with its base 18c105af the same session as the baseline.

Tests (XCL_REQUIRE_GPU=wave64)

  • cargo test -p xcl --lib -- gpu_ps_compare_mip_bias --test-threads=1: 1 passed, 0 failed, 0 ignored (on the GPU, wave64).
  • cargo test --workspace --no-fail-fast -- --test-threads=4 with --skip compositor_blends_ui_plane_over_scene_plane --skip failed_restore_stops_before_importing_an_unbacked_window --skip grooming_leaves_a_window_under_1_gib_only_its_hole (the first loses the RADV device here, the other two run out of memory under Wine): lib 645 passed, 5 failed, 21 ignored; base 18c105af lib (same flags): 644 passed, 5 failed, 21 ignored, the same 5. The other binaries fail the same 3 tests as on main here (e2e, pls_quota, predication_e2e).

Not tested

  • A retail title
  • Native Windows, NVIDIA / Intel

AI use

  • Claude Code (Claude Opus 5.5) wrote the test scripts, ran the builds and tests on my machine and wrote this report.
<!-- greyfinch-sync:ivall/xcl:comment:7225027631 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/349#issuecomment-7225027631). Originally posted by [ClosetPie107](https://github.com/ClosetPie107) on 2026-11-27T18:00:59Z. --- **Tested on AMD / Linux: `7d1c008d`** (RX 9070 16 GB, RDNA4, Mesa 26.3.1 RADV; Ryzen 5 9600X, 32 GB; CachyOS; Proton Experimental `experimental-11.0-20261112` with vkd3d-proton master `ec207194` plus a local patch dropping the `lpVtbl` checks of command allocators and lists; DXC 1.9.2609.5; Rust 1.96.0, `x86_64-pc-windows-gnu` debug build, tests run under Wine) The head as it is (not merged onto current `main`), with its base `18c105af` the same session as the baseline. **Tests** (`XCL_REQUIRE_GPU=wave64`) - `cargo test -p xcl --lib -- gpu_ps_compare_mip_bias --test-threads=1`: **1 passed, 0 failed**, 0 ignored (on the GPU, wave64). - `cargo test --workspace --no-fail-fast -- --test-threads=4` with `--skip compositor_blends_ui_plane_over_scene_plane --skip failed_restore_stops_before_importing_an_unbacked_window --skip grooming_leaves_a_window_under_1_gib_only_its_hole` (the first loses the RADV device here, the other two run out of memory under Wine): lib 645 passed, 5 failed, 21 ignored; base `18c105af` lib (same flags): 644 passed, 5 failed, 21 ignored, the same 5. The other binaries fail the same 3 tests as on `main` here (`e2e`, `pls_quota`, `predication_e2e`). **Not tested** - A retail title - Native Windows, NVIDIA / Intel **AI use** - Claude Code (Claude Opus 5.5) wrote the test scripts, ran the builds and tests on my machine and wrote this report.
throny commented 2026-11-28 14:26:46 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-28T14:26:46Z.


merge-check claim
head: 7d1c008da9

<!-- greyfinch-sync:ivall/xcl:comment:7240675571 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/349#issuecomment-7240675571). Originally posted by [throny](https://github.com/throny) on 2026-11-28T14:26:46Z. --- merge-check claim head: 7d1c008da9127bde6076023cd3856a92dbb04c40
throny commented 2026-11-28 14:40:10 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-28T14:40:10Z.


merge-check
base: b937fbab
head: 7d1c008da9
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2141 passed, 1 failed, 48 ignored (26 SKIPPED lines). The one failure is gpu::dxil::msaa_tests::direct_msaa_loads_precede_get_dimensions, which main itself has at b937fbab (#3093); base alone: 2140 passed, 1 failed, 48 ignored.
review: no blocking finding. The new arm takes pixel-shader comparison samples with a bias and does not overlap the arm #350 adds for gradients; a three-way merge of the two PRs on main's files has no conflict and keeps one copy of the helpers both add. Open and not new to this PR: the forms with an offset still move the coordinate by mip-0 texels, which waits on #247 (open); whichever of the two lands second needs the one-line fix named in the thread. The earlier point about a partial quad in the test is answered: the test draws one now.
performance: this one costs frame time by design: every pixel-shader comparison sample with a bias becomes four SampleCmp calls plus quad reads instead of one. Titles that filter shadows with biased comparison samples pay it; nobody has measured how much. It changes a translator source: every tester re-translates all shaders once.
verdict: safe to merge (correctness; the cost deserves a title measurement, together with #350)
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:7240842070 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/349#issuecomment-7240842070). Originally posted by [throny](https://github.com/throny) on 2026-11-28T14:40:10Z. --- merge-check base: b937fbab head: 7d1c008da9127bde6076023cd3856a92dbb04c40 merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2141 passed, 1 failed, 48 ignored (26 SKIPPED lines). The one failure is gpu::dxil::msaa_tests::direct_msaa_loads_precede_get_dimensions, which main itself has at b937fbab (#3093); base alone: 2140 passed, 1 failed, 48 ignored. review: no blocking finding. The new arm takes pixel-shader comparison samples with a bias and does not overlap the arm #350 adds for gradients; a three-way merge of the two PRs on main's files has no conflict and keeps one copy of the helpers both add. Open and not new to this PR: the forms with an offset still move the coordinate by mip-0 texels, which waits on #247 (open); whichever of the two lands second needs the one-line fix named in the thread. The earlier point about a partial quad in the test is answered: the test draws one now. performance: this one costs frame time by design: every pixel-shader comparison sample with a bias becomes four SampleCmp calls plus quad reads instead of one. Titles that filter shadows with biased comparison samples pay it; nobody has measured how much. It changes a translator source: every tester re-translates all shaders once. verdict: safe to merge (correctness; the cost deserves a title measurement, together with #350) 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).
thehollowedone commented 2026-11-28 17:48:12 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-28T17:48:12Z.


Focused GPU finding on #349 head 7d1c008: the bias path scales ddx/ddy correctly, but then adds the scaled derivatives to the original coordinate to make a quad for SampleCmp. At U = 12,582,913, binary32 spacing is 1, so adding or subtracting 0.25 returns U. The texture operation sees a zero horizontal derivative and selects mip 0. The instruction's original dU/dx = 2 with bias -3 requires an effective derivative of 0.25, or two texels on the eight-wide base mip, selecting mip 1.

On Windows 11 build 26300, RTX 3080 Ti / 621.35, DXC 1.8.2502.11, the attached synthetic depth-checkerboard test failed 0/1 on the unchanged head: full-screen pixel (0,0) returned 1 instead of the mip-1 value 0. Changing only the coordinate constant to 0.5 made the same biased test pass 1/1; the PR's existing gpu_ps_compare_mip_bias also passed 1/1. As a diagnostic control, replacing only the new bias arm with ordinary SampleCmp made the large-coordinate test pass, but that drops bias semantics and is not a proposed fix. Command for each run: cargo test --offline --locked -j 4 -p xcl --lib <test-filter> -- --nocapture --test-threads=1; no skip was printed. I did not run the full suite, title smoke, or a corrected production implementation for this finding.

This is the bias counterpart of the explicit-gradient boundary reported on #350. A correction must preserve the bias-scaled footprint independently of a large coordinate while preserving clamp, wrap, mirror, border, cube and array behavior. Simply clamping or wrapping every coordinate is not equivalent for all sampler modes. Please keep this regression alongside the existing small-coordinate cases before treating the four-sample SM 6.6 path as complete.

AI use: Codex (GPT-6.2 Sol) traced the emitter, wrote and ran the synthetic GPU fixture and controls, and drafted this report; Codex (GPT-6.2 Astra) independently checked the related comparison-gradient boundary and SM 6.6 constraints.

Test-only regression diff (head 0/1; small-coordinate control 1/1)
diff --git a/crates/xcl/src/gpu/recomp/tests.rs b/crates/xcl/src/gpu/recomp/tests.rs
index e7edaf96..e38245be 100644
--- a/crates/xcl/src/gpu/recomp/tests.rs
+++ b/crates/xcl/src/gpu/recomp/tests.rs
@@ -1991,6 +1991,27 @@ fn gpu_ps_compare_mip_bias() {
     assert!(failures.is_empty(), "{}", failures.join("\n"));
 }
 
+#[test]
+fn gpu_ps_compare_bias_keeps_lod_at_large_clamped_coordinate() {
+    if !gpu_ready() {
+        return;
+    }
+    let ps = prog(&[
+        ("S_WQM_B64", "ENC_SOP1", &[("SDST", 126), ("SSRC0", 126)], None),
+        ("V_MOV_B32", "ENC_VOP1", &[("VDST", 8), ("SRC0", 255)], Some((-3.0f32).to_bits())),
+        ("V_MOV_B32", "ENC_VOP1", &[("VDST", 9), ("SRC0", 240)], None),
+        ("V_MUL_F32", "ENC_VOP2", &[("VDST", 10), ("SRC0", 255), ("VSRC1", 2)], Some(2.0f32.to_bits())),
+        ("V_ADD_F32", "ENC_VOP2", &[("VDST", 10), ("SRC0", 255), ("VSRC1", 10)], Some(12_582_912.0f32.to_bits())),
+        ("V_MUL_F32", "ENC_VOP2", &[("VDST", 11), ("SRC0", 255), ("VSRC1", 3)], Some(0.125f32.to_bits())),
+        ("IMAGE_SAMPLE_C_B", "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_expected(&ps, |_, y| {
+        let v = (((y as f32 + 0.5) * 0.125 * 4.0) as u32).min(3);
+        ((3 + v + 1) % 2) as f32
+    }).unwrap();
+}

 /// Draw console wave64 VS + PS (`vs` None: position and COLOR passed through; `ps` None:
@@ -2040,6 +2061,15 @@ 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_expected(ps, |x, y| {
+        let mip = mip_at(x);
+        let size = 8u32 >> mip;
+        let texel = |p: usize| (((p as f32 + 0.5) * coord_scale * size as f32) as u32).min(size - 1);
+        ((texel(x) + texel(y) + mip) % 2) as f32
+    })
+}
+
+fn check_ps_depth_mip_expected(ps: &[u8], expected_at: impl Fn(usize, usize) -> f32) -> Result<(), String> {
     use windows::Win32::Graphics::Direct3D12::*;
@@ -2076,13 +2106,10 @@ fn check_ps_depth_mip(ps: &[u8], coord_scale: f32, mip_at: impl Fn(usize) -> u32
         let pixels = draw_console_views(None, Some(ps), &tri, &sgprs, std::slice::from_ref(&tex), &samplers);
         for (i, pixel) in pixels.iter().enumerate() {
             let (x, y) = (i % 16, i / 16);
-            let mip = mip_at(x);
-            let size = 8u32 >> mip;
-            let texel = |p: usize| (((p as f32 + 0.5) * coord_scale * size as f32) as u32).min(size - 1);
             let covered = (x as f32 + 0.5) * height + (y as f32 + 0.5) * width < width * height;
-            let expected = if covered { ((texel(x) + texel(y) + mip) % 2) as f32 } else { -1.0 };
+            let expected = if covered { expected_at(x, y) } else { -1.0 };
             if pixel[0] != expected {
-                return Err(format!("{width}x{height} triangle, pixel ({x},{y}): {} instead of {expected} at mip {mip}", pixel[0]));
+                return Err(format!("{width}x{height} triangle, pixel ({x},{y}): {} instead of {expected}", pixel[0]));
             }
<!-- greyfinch-sync:ivall/xcl:comment:7243298777 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/349#issuecomment-7243298777). Originally posted by [thehollowedone](https://github.com/thehollowedone) on 2026-11-28T17:48:12Z. --- Focused GPU finding on [#349 head `7d1c008`](https://github.com/xcl-dev/xcl/commit/7d1c008da9127bde6076023cd3856a92dbb04c40): the bias path scales `ddx`/`ddy` correctly, but then [adds the scaled derivatives to the original coordinate](https://github.com/xcl-dev/xcl/blob/7d1c008da9127bde6076023cd3856a92dbb04c40/crates/xcl/src/gpu/recomp/emit.rs#L1918-L1927) to make a quad for `SampleCmp`. At U = 12,582,913, binary32 spacing is 1, so adding or subtracting 0.25 returns U. The texture operation sees a zero horizontal derivative and selects mip 0. The instruction's original `dU/dx = 2` with bias `-3` requires an effective derivative of 0.25, or two texels on the eight-wide base mip, selecting mip 1. On Windows 11 build 26300, RTX 3080 Ti / 621.35, DXC 1.8.2502.11, the attached synthetic depth-checkerboard test **failed 0/1** on the unchanged head: full-screen pixel (0,0) returned 1 instead of the mip-1 value 0. Changing only the coordinate constant to 0.5 made the same biased test **pass 1/1**; the PR's existing `gpu_ps_compare_mip_bias` also **passed 1/1**. As a diagnostic control, replacing only the new bias arm with ordinary `SampleCmp` made the large-coordinate test pass, but that drops bias semantics and is **not** a proposed fix. Command for each run: `cargo test --offline --locked -j 4 -p xcl --lib <test-filter> -- --nocapture --test-threads=1`; no skip was printed. I did not run the full suite, title smoke, or a corrected production implementation for this finding. This is the bias counterpart of the [explicit-gradient boundary reported on #350](https://github.com/xcl-dev/xcl/pull/350#issuecomment-7239384518). A correction must preserve the bias-scaled footprint independently of a large coordinate while preserving clamp, wrap, mirror, border, cube and array behavior. Simply clamping or wrapping every coordinate is not equivalent for all sampler modes. Please keep this regression alongside the existing small-coordinate cases before treating the four-sample SM 6.6 path as complete. AI use: Codex (GPT-6.2 Sol) traced the emitter, wrote and ran the synthetic GPU fixture and controls, and drafted this report; Codex (GPT-6.2 Astra) independently checked the related comparison-gradient boundary and SM 6.6 constraints. <details><summary>Test-only regression diff (head 0/1; small-coordinate control 1/1)</summary> ```diff diff --git a/crates/xcl/src/gpu/recomp/tests.rs b/crates/xcl/src/gpu/recomp/tests.rs index e7edaf96..e38245be 100644 --- a/crates/xcl/src/gpu/recomp/tests.rs +++ b/crates/xcl/src/gpu/recomp/tests.rs @@ -1991,6 +1991,27 @@ fn gpu_ps_compare_mip_bias() { assert!(failures.is_empty(), "{}", failures.join("\n")); } +#[test] +fn gpu_ps_compare_bias_keeps_lod_at_large_clamped_coordinate() { + if !gpu_ready() { + return; + } + let ps = prog(&[ + ("S_WQM_B64", "ENC_SOP1", &[("SDST", 126), ("SSRC0", 126)], None), + ("V_MOV_B32", "ENC_VOP1", &[("VDST", 8), ("SRC0", 255)], Some((-3.0f32).to_bits())), + ("V_MOV_B32", "ENC_VOP1", &[("VDST", 9), ("SRC0", 240)], None), + ("V_MUL_F32", "ENC_VOP2", &[("VDST", 10), ("SRC0", 255), ("VSRC1", 2)], Some(2.0f32.to_bits())), + ("V_ADD_F32", "ENC_VOP2", &[("VDST", 10), ("SRC0", 255), ("VSRC1", 10)], Some(12_582_912.0f32.to_bits())), + ("V_MUL_F32", "ENC_VOP2", &[("VDST", 11), ("SRC0", 255), ("VSRC1", 3)], Some(0.125f32.to_bits())), + ("IMAGE_SAMPLE_C_B", "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_expected(&ps, |_, y| { + let v = (((y as f32 + 0.5) * 0.125 * 4.0) as u32).min(3); + ((3 + v + 1) % 2) as f32 + }).unwrap(); +} /// Draw console wave64 VS + PS (`vs` None: position and COLOR passed through; `ps` None: @@ -2040,6 +2061,15 @@ 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_expected(ps, |x, y| { + let mip = mip_at(x); + let size = 8u32 >> mip; + let texel = |p: usize| (((p as f32 + 0.5) * coord_scale * size as f32) as u32).min(size - 1); + ((texel(x) + texel(y) + mip) % 2) as f32 + }) +} + +fn check_ps_depth_mip_expected(ps: &[u8], expected_at: impl Fn(usize, usize) -> f32) -> Result<(), String> { use windows::Win32::Graphics::Direct3D12::*; @@ -2076,13 +2106,10 @@ fn check_ps_depth_mip(ps: &[u8], coord_scale: f32, mip_at: impl Fn(usize) -> u32 let pixels = draw_console_views(None, Some(ps), &tri, &sgprs, std::slice::from_ref(&tex), &samplers); for (i, pixel) in pixels.iter().enumerate() { let (x, y) = (i % 16, i / 16); - let mip = mip_at(x); - let size = 8u32 >> mip; - let texel = |p: usize| (((p as f32 + 0.5) * coord_scale * size as f32) as u32).min(size - 1); let covered = (x as f32 + 0.5) * height + (y as f32 + 0.5) * width < width * height; - let expected = if covered { ((texel(x) + texel(y) + mip) % 2) as f32 } else { -1.0 }; + let expected = if covered { expected_at(x, y) } else { -1.0 }; if pixel[0] != expected { - return Err(format!("{width}x{height} triangle, pixel ({x},{y}): {} instead of {expected} at mip {mip}", pixel[0])); + return Err(format!("{width}x{height} triangle, pixel ({x},{y}): {} instead of {expected}", pixel[0])); } ``` </details>
johnbf8x commented 2026-11-30 02:10:59 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by johnbf8x on 2026-11-30T02:10:59Z.


merge-check claim
head: 7d1c008da9

<!-- greyfinch-sync:ivall/xcl:comment:7266778141 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/349#issuecomment-7266778141). Originally posted by [johnbf8x](https://github.com/johnbf8x) on 2026-11-30T02:10:59Z. --- merge-check claim head: 7d1c008da9127bde6076023cd3856a92dbb04c40
johnbf8x commented 2026-11-30 02:30:17 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by johnbf8x on 2026-11-30T02:30:17Z.


merge-check
base: 9335bc0d86
head: 7d1c008da9
merge: clean (git merge --no-commit --no-ff onto origin/main in a detached worktree; the merged tree was tested uncommitted)
build: cargo build --workspace -> ok (the PR merged and main alike, each in its own target dir)
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 (XCL_DXC_DIR = DXC 1.9.2609) -> main and PR the same: 137 passed, 2 failed, 20 ignored outside the lib; the lib binary ends abnormally on both (0x80004005), so no lib total. SKIPPED: 28 on both (22 no wave64, 3 f16/f32 per-lane forms refused, 2 no heap windows, 1 no D3D12 debug layer). Failing: e2e test_title_draws_with_a_root_signature_under_the_debug_layer and test_title_runs_under_the_debug_layer_with_dred (no D3D12 debug layer on this PC), both fail on main too. The lib in parts: hle::d3d12x::list_x alone on 1 thread 113 passed on both; the rest on 4 threads, 0 failed before the process ends on both (PR 1741 ok, main 1739 ok). Next to the change, on 1 thread: gpu::recomp::tests:: PR 216 passed, 0 failed, 18 ignored; main 215 passed, 0 failed, 18 ignored. The new gpu_ps_compare_mip_bias passes 4 of 4 runs on the PR; the PR's tests.rs alone applied on main fails it in 4 of its 6 cases (C_B, C_B_CL, C_B_O with slope 0, and C_B with slope 0.5; the bias-0 control and the C_B_CL_O case agree on main)
review: none blocking, after reading the whole diff (emit.rs, tests.rs). The new arm only takes pixel-shader comparison samples with a bias (after the LZ / non-PS arm); the derivatives are of the coordinate before the texel offset (of the direction for cubes), scaled by exp2(bias). The test draws a partial quad and checks every pixel against a checkerboard in opposite phases per mip, so a neighbour's coordinate and a wrong mip are told apart. As the first check says: the forms with an offset still move by mip-0 texels until #247 (open, also emit.rs) lands, and whichever of the two lands second needs the follow-up named there. Not run with a title
performance: costs frame time by design, not measured here: each pixel-shader comparison sample with a bias becomes four SampleCmp calls plus quad reads instead of one, so titles that filter shadows with biased comparison samples pay it. It changes a translator source, so every tester re-translates all shaders once
verdict: safe to merge (correctness; the shader cost still wants a measurement in a title)
hardware / tool and model: NVIDIA GeForce RTX 3070 Ti 8 GB (driver 621.40), Intel Core i7-12700K, Windows 10 Pro 19045, rustc 1.100.0 / Claude Code, Claude Opus 5.5

<!-- greyfinch-sync:ivall/xcl:comment:7267063866 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/349#issuecomment-7267063866). Originally posted by [johnbf8x](https://github.com/johnbf8x) on 2026-11-30T02:30:17Z. --- merge-check base: 9335bc0d86dbdc17c0e322bca617f35375b3e289 head: 7d1c008da9127bde6076023cd3856a92dbb04c40 merge: clean (git merge --no-commit --no-ff onto origin/main in a detached worktree; the merged tree was tested uncommitted) build: cargo build --workspace -> ok (the PR merged and main alike, each in its own target dir) tests: cargo test --workspace --no-fail-fast -- --test-threads=4 (XCL_DXC_DIR = DXC 1.9.2609) -> main and PR the same: 137 passed, 2 failed, 20 ignored outside the lib; the lib binary ends abnormally on both (0x80004005), so no lib total. SKIPPED: 28 on both (22 no wave64, 3 f16/f32 per-lane forms refused, 2 no heap windows, 1 no D3D12 debug layer). Failing: e2e test_title_draws_with_a_root_signature_under_the_debug_layer and test_title_runs_under_the_debug_layer_with_dred (no D3D12 debug layer on this PC), both fail on main too. The lib in parts: hle::d3d12x::list_x alone on 1 thread 113 passed on both; the rest on 4 threads, 0 failed before the process ends on both (PR 1741 ok, main 1739 ok). Next to the change, on 1 thread: gpu::recomp::tests:: PR 216 passed, 0 failed, 18 ignored; main 215 passed, 0 failed, 18 ignored. The new gpu_ps_compare_mip_bias passes 4 of 4 runs on the PR; the PR's tests.rs alone applied on main fails it in 4 of its 6 cases (C_B, C_B_CL, C_B_O with slope 0, and C_B with slope 0.5; the bias-0 control and the C_B_CL_O case agree on main) review: none blocking, after reading the whole diff (emit.rs, tests.rs). The new arm only takes pixel-shader comparison samples with a bias (after the LZ / non-PS arm); the derivatives are of the coordinate before the texel offset (of the direction for cubes), scaled by exp2(bias). The test draws a partial quad and checks every pixel against a checkerboard in opposite phases per mip, so a neighbour's coordinate and a wrong mip are told apart. As the first check says: the forms with an offset still move by mip-0 texels until #247 (open, also emit.rs) lands, and whichever of the two lands second needs the follow-up named there. Not run with a title performance: costs frame time by design, not measured here: each pixel-shader comparison sample with a bias becomes four SampleCmp calls plus quad reads instead of one, so titles that filter shadows with biased comparison samples pay it. It changes a translator source, so every tester re-translates all shaders once verdict: safe to merge (correctness; the shader cost still wants a measurement in a title) hardware / tool and model: NVIDIA GeForce RTX 3070 Ti 8 GB (driver 621.40), Intel Core i7-12700K, Windows 10 Pro 19045, rustc 1.100.0 / Claude Code, Claude Opus 5.5
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!345
No description provided.