Recompiler: image_sample_b/d/cd/c_o offsets move by the mip they read #247

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

@⁠Kalmarv on GitHub · 2026-11-23 21:49 UTC · original
Kalmarv:fix/sample-o-lod-variants → main · +365 −8 · 2 files · 1 commits · open

Follows #229. #229 moves the coordinates by offset / size of the mip the console reads, but it picks that mip only for the plain form (implicit LOD in a PS, or a given LOD). The bias, gradient and comparison forms still take mip 0's size. With a point mip filter, the texel read is then off by up to one texel of the mip actually sampled. This PR picks the mip for those forms too.

What main does today:

  • image_sample_b_o: in a PS, the implicit LOD without the bias; outside a PS, mip 0, though the sample is SampleLevel(bias).
  • image_sample_d_o / cd_o: mip 0 whatever the gradients say.
  • image_sample_c_o in a PS: mip 0, because the plain-form branch excludes comparison samplers. CalculateLevelOfDetail takes no SamplerComparisonState; DXC rejects it.

What is in it

One commit, 227a60a, on main 9e3831e: 287ca93 (on dd2ae9a) with @⁠JGonzalezRodriguez's five review points fixed (the review points are marked below), then rebased onto 9e3831e without conflicts (as c14bd12 on dd2ae9a it is the same patch; git range-diff: =). The rebase is there because a whole-suite run on dd2ae9a stops in the #344 deadlock, whose fix (#443) came later. 287ca93 was a60db9f (on 9ab7d76) rebased without conflicts and without a changed line.

  • crates/xcl/src/gpu/recomp/emit.rs: the offset's level for these forms is:

    • the given LOD (unchanged);
    • else the LOD of the given gradients (log2 of the longer gradient in mip-0 texels), or in a PS the pixel's own LOD (CalculateLevelOfDetailUnclamped, or for comparison samplers the same log2 of ddx / ddy of the coordinates);
    • plus the sampler's LOD_BIAS (S# word 2 [13:0]) where that LOD comes from gradients, as SampleGrad and SampleCmp add it (review point 3; CalculateLevelOfDetailUnclamped already has it);
    • plus the instruction's bias;
    • then clamped as desc makes the view and the sampler: from below by the larger of the S# MIN_LOD and the T#'s MIN_LOD (word 1 [19:8], the SRV's ResourceMinLODClamp; point 2), from above by MAX_LOD, which is MIN_LOD without a mip filter (S# word 2 [27:26] = 0; point 1); rounded, and clamped to the view's last mip.
    • A comparison sample's offset moves by the mip that the emitted sample reads (point 4): mip 0 outside a PS (SampleCmpLevelZero), and in a PS the pixel's own LOD, because SampleCmp takes neither gradients nor a bias in SM 6.6. The level-0 size comes from a new mip_size, which texel_offset also calls (point 5).

    The LOD is unclamped before the bias, so a bias on a magnified pixel starts below 0. @⁠ryotdev found that the first head (fd45f20) got this wrong. The plain form, lz, gather and given-LOD forms take the same path as before.

  • crates/xcl/src/gpu/recomp/tests.rs: nine new GPU tests on a 2-mip texture (8², 4²) with point min, mag and mip filters, so each pixel reads exactly one mip. Four of them are for the review: gpu_ps_image_sample_offset_without_a_mip_filter, …_resource_min_lod, …_sampler_bias, and gpu_image_sample_c_b_d_offset_moves_by_the_mip_read (PS and VS). The last one samples a checkerboard (one in each mip's own texels) at offsets 0 and +1. Moving by one texel of the mip that was read flips every pixel, so the test doesn't depend on which mip that is.

  • Overlap with #349 and #350: they make the PS SampleCmp take the bias and the gradients. In a tree with either of them and this PR, the matching line here (lod_bias for #349, lod_grads for #350) has to take them too. The two lines are separate, so neither follow-up conflicts with the other.

Tested

  • RTX 5070 Ti, NVIDIA 610.74, Ryzen 9 9950X, Windows 11 Pro 25H2 (build 26200.9711), Rust 1.99.0, debug build, SDK DXC 1.7.2308.16.
  • cargo test --workspace -- --test-threads=4 on 227a60a: 785 passed, 0 failed, 41 ignored (the xcl library: 736 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).
  • The 11 offset tests (image_sample_offset, and the new comparison test) on c14bd12 (the same patch on dd2ae9a): 11 passed. With emit.rs from 287ca93 (the same tests), the four review tests fail and the other seven pass. Each of their 12 cases run on its own (a scratch test, not in the PR): 11 fail on 287ca93, all 12 pass on c14bd12. The 12th, b_o with the sampler's LOD_BIAS, is a control and passes on both.
  • cargo test --workspace -- --test-threads=4 on 287ca93: 695 passed, 0 failed, 41 ignored (the xcl library: 655 passed, 21 ignored). SKIPPED GPU tests: gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware, both "no wave64". The six gpu_ps_image_sample_offset tests (this PR's five and #229's): 6 passed.
  • The earlier head a60db9f, on main 9ab7d76: 656 passed, 0 failed, 40 ignored, with the same two SKIPPED tests.
  • The new tests, built from main with and without the emit.rs change (the same test code in both):
test main this PR
gpu_ps_image_sample_offset_point_mip (control, plain sample_o) pass pass
gpu_ps_image_sample_offset_bias_lod (b_o, LOD 0 + bias 1) FAIL: pixel (0,0) = 100, expected 101 pass
gpu_ps_image_sample_offset_bias_lod_magnified (b_o, LOD -1 + bias 1, @⁠ryotdev's case) pass pass (fd45f20: FAIL, (0,0) = 2, expected 1)
gpu_ps_image_sample_offset_gradient_lod (d_o and cd_o, gradient LOD 1) FAIL: pixel (0,0) = 100, expected 101 (cd_o fails the same way, 48 of 256 pixels) pass
gpu_ps_image_sample_offset_compare_lod (c_o, implicit LOD 1, LESS_EQUAL) FAIL: pixel (0,0) = 0, expected 1 pass
gpu_ps_image_sample_offset_implicit_lod_between_mips (#229's) pass pass
  • gpu::recomp:: on 287ca93: 188 passed, 0 failed, 18 ignored (on a60db9f: 187 passed, 0 failed, 18 ignored).
  • @⁠WarmMilkCodes ran the previous head fd45f20, before the magnification fix, on main 9ab7d76 with an RX 6600 XT (RDNA2). cargo test --workspace: main 651 passed, 0 failed; PR 655 passed, 0 failed. No GPU test was skipped, and the four new tests of that head passed.
  • Also run by @⁠denio4321 on an RTX 3060 (NVIDIA 610.88), head a60db9f: cargo test --workspace, 656 passed, 0 failed, 40 ignored, and the 5 new tests pass (https://github.com/ivall/xcl/pull/247#issuecomment-7115578260).
  • Also run by @⁠PHeitor1 on an RTX 5060 Ti (NVIDIA 621.24), Windows 11, debug, head a60db9f: cargo test --workspace, 656 passed, 0 failed, 40 ignored (https://github.com/ivall/xcl/pull/247#issuecomment-7115669307).
  • Also run by @⁠PHeitor1 on a60db9f merged onto main 2b4bb43, on an RTX 5060 Ti, debug, with the debug-layer tests enabled: cargo test --workspace, 675 passed, 0 failed, 41 ignored; the only SKIPPED tests are the two "no wave64" ones (https://github.com/ivall/xcl/pull/247#issuecomment-7117533720).
  • Also run by @⁠nullmarsh on an RX 9060 XT (RDNA4, driver 32.0.32029.2010), Ryzen 7 5800X3D, Windows 11 Pro 26200, Rust 1.100.0, DXC 1.9.2602.17, debug. They ran a60db9f merged onto main 4017f8f (a clean merge) (https://github.com/ivall/xcl/pull/247#issuecomment-7116443830):
    • scripts/test.ps1: 657 passed, 0 failed, 40 ignored, with no SKIPPED GPU tests.
    • With only this PR's tests.rs (no emit.rs change), …_bias_lod, …_gradient_lod and …_compare_lod fail; …_point_mip and …_bias_lod_magnified pass with and without the fix.
  • Also run by @⁠futurepro62 on the exact head 227a60a (on 9e3831e) (#247), debug, DXC 1.9.2602: on an RTX 5070 Ti (NVIDIA 621.40), XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 with 8 --skip filters, 784 passed, 0 failed, 41 ignored, and all of this PR's tests ran and passed. On the Radeon integrated GPU (iGPU) of a Ryzen 7 9800X3D (RDNA2), 785 passed, 0 failed, 41 ignored; its only SKIPPED test is heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows). Of the skip filters, only that test exists at this head (it is not this PR's); the other seven name tests that reached main after 9e3831e, so they skipped nothing here.
  • Earlier smoke runs by @⁠srcamarda, RX 7800 XT (RDNA3), release, 90 s, three of each on main 9ab7d76 and this head: main 901 / 1180 / 1184 frames, this PR 1168 / 1167 / 1357, no crash or device removal (https://github.com/ivall/xcl/pull/247#issuecomment-7117441417). No _o sample form appears in the title's first menus, so these runs and ours below are a regression check, not a test of the change.

Regression run

scripts/smoke.ps1, the same retail title for 60 s each, one after the other on the machine under Tested (RTX 5070 Ti, NVIDIA 610.74), release builds, no uncommitted changes.

main 9e3831e:

xcl-smoke v1
commit: 9e3831e1f570d3646e53ab753b19ec07eb8f1485
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 1274 (PresentX 1274)
presents per 2 s (last 3): 8 31 32
device removals: 0
crashes: 0
peak commit: 27459 MB

this PR's head 227a60a:

xcl-smoke v1
commit: 227a60a977b9ab43b1bb77875ec547a5403d3972
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 1313 (PresentX 1313)
presents per 2 s (last 3): 6 36 56
device removals: 0
crashes: 0
peak commit: 27471 MB

PR vs main: 1313 / 1274 frames (103 %), peak commit 27471 / 27459 MB (100 %); no device removal and no crash on either run.

Not tested

  • On image_sample_l_o the offset uses the given LOD before the sampler's bias and MIN/MAX_LOD, as on main. Sampler bias on image_sample_b_o follows it on NVIDIA 610.74 (measured); AMD not measured.
  • No title is known to use any of these forms with a VGPR offset. They come from the ISA, not from a shader seen in use.
  • AMD RDNA2 for the head a60db9f: the RX 6600 XT run above is of fd45f20. RDNA4 ran a60db9f (@⁠nullmarsh, above).
  • Linear mip filters on these forms. Only the level choice is fixed; the per-mip blend #229 does for the plain form is not extended here.
  • b_o and d_o outside a pixel shader, 1D / 3D / array textures, A16 addresses, and a min-LOD clamp (_cl_) together with an offset.
  • A T# with MIN_LOD whose base level isn't 0. The offset applies MIN_LOD in the view's levels; I didn't check whether D3D12 applies ResourceMinLODClamp in the view's levels or the resource's.
  • image_sample_c_l_o in a PS: the offset moves by the given LOD, while SampleCmp reads the pixel's own, as on main.
  • AMD RDNA3 and RDNA4 for 227a60a: only the RDNA2 iGPU run above (@⁠futurepro62) is of this head.
  • Anisotropic samplers. The gradient LOD here is the isotropic log2 of the longer gradient, which can differ from the hardware's at a mip boundary. The plain form's CalculateLevelOfDetail has the same limit.

AI use

  • Claude Code (Claude Opus 5.5), code, tests and this description; Claude Code (Claude Fable 5.2), the rebase onto dd2ae9a and its runs; Claude Code (Claude Opus 5.5), the fixes for @⁠JGonzalezRodriguez's review, their tests and the runs on c14bd12 and 227a60a
**@⁠Kalmarv** on GitHub · 2026-11-23 21:49 UTC · [original](https://github.com/xcl-dev/xcl/pull/247) `Kalmarv:fix/sample-o-lod-variants` → `main` · +365 −8 · 2 files · 1 commits · open Follows #229. #229 moves the coordinates by offset / size of the mip the console reads, but it picks that mip only for the plain form (implicit LOD in a PS, or a given LOD). The bias, gradient and comparison forms still take mip 0's size. With a point mip filter, the texel read is then off by up to one texel of the mip actually sampled. This PR picks the mip for those forms too. What main does today: - `image_sample_b_o`: in a PS, the implicit LOD without the bias; outside a PS, mip 0, though the sample is `SampleLevel(bias)`. - `image_sample_d_o` / `cd_o`: mip 0 whatever the gradients say. - `image_sample_c_o` in a PS: mip 0, because the plain-form branch excludes comparison samplers. `CalculateLevelOfDetail` takes no `SamplerComparisonState`; DXC rejects it. **What is in it** One commit, `227a60a`, on `main` `9e3831e`: `287ca93` (on `dd2ae9a`) with @⁠JGonzalezRodriguez's five review points fixed (the review points are marked below), then rebased onto `9e3831e` without conflicts (as `c14bd12` on `dd2ae9a` it is the same patch; `git range-diff`: `=`). The rebase is there because a whole-suite run on `dd2ae9a` stops in the #344 deadlock, whose fix (#443) came later. `287ca93` was `a60db9f` (on `9ab7d76`) rebased without conflicts and without a changed line. - `crates/xcl/src/gpu/recomp/emit.rs`: the offset's level for these forms is: - the given LOD (unchanged); - else the LOD of the given gradients (`log2` of the longer gradient in mip-0 texels), or in a PS the pixel's own LOD (`CalculateLevelOfDetailUnclamped`, or for comparison samplers the same `log2` of `ddx` / `ddy` of the coordinates); - plus the sampler's LOD_BIAS (S# word 2 [13:0]) where that LOD comes from gradients, as SampleGrad and SampleCmp add it (review point 3; `CalculateLevelOfDetailUnclamped` already has it); - plus the instruction's bias; - then clamped as `desc` makes the view and the sampler: from below by the larger of the S# MIN_LOD and the T#'s MIN_LOD (word 1 [19:8], the SRV's `ResourceMinLODClamp`; point 2), from above by MAX_LOD, which is MIN_LOD without a mip filter (S# word 2 [27:26] = 0; point 1); rounded, and clamped to the view's last mip. - A comparison sample's offset moves by the mip that the emitted sample reads (point 4): mip 0 outside a PS (`SampleCmpLevelZero`), and in a PS the pixel's own LOD, because `SampleCmp` takes neither gradients nor a bias in SM 6.6. The level-0 size comes from a new `mip_size`, which `texel_offset` also calls (point 5). The LOD is unclamped before the bias, so a bias on a magnified pixel starts below 0. @⁠ryotdev found that the first head (`fd45f20`) got this wrong. The plain form, lz, gather and given-LOD forms take the same path as before. - `crates/xcl/src/gpu/recomp/tests.rs`: nine new GPU tests on a 2-mip texture (8², 4²) with point min, mag and mip filters, so each pixel reads exactly one mip. Four of them are for the review: `gpu_ps_image_sample_offset_without_a_mip_filter`, `…_resource_min_lod`, `…_sampler_bias`, and `gpu_image_sample_c_b_d_offset_moves_by_the_mip_read` (PS and VS). The last one samples a checkerboard (one in each mip's own texels) at offsets 0 and +1. Moving by one texel of the mip that was read flips every pixel, so the test doesn't depend on which mip that is. - Overlap with #349 and #350: they make the PS `SampleCmp` take the bias and the gradients. In a tree with either of them and this PR, the matching line here (`lod_bias` for #349, `lod_grads` for #350) has to take them too. The two lines are separate, so neither follow-up conflicts with the other. **Tested** - RTX 5070 Ti, NVIDIA 610.74, Ryzen 9 9950X, Windows 11 Pro 25H2 (build 26200.9711), Rust 1.99.0, debug build, SDK DXC 1.7.2308.16. - `cargo test --workspace -- --test-threads=4` on `227a60a`: 785 passed, 0 failed, 41 ignored (the `xcl` library: 736 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). - The 11 offset tests (`image_sample_offset`, and the new comparison test) on `c14bd12` (the same patch on `dd2ae9a`): 11 passed. With `emit.rs` from `287ca93` (the same tests), the four review tests fail and the other seven pass. Each of their 12 cases run on its own (a scratch test, not in the PR): 11 fail on `287ca93`, all 12 pass on `c14bd12`. The 12th, `b_o` with the sampler's LOD_BIAS, is a control and passes on both. - `cargo test --workspace -- --test-threads=4` on `287ca93`: 695 passed, 0 failed, 41 ignored (the `xcl` library: 655 passed, 21 ignored). SKIPPED GPU tests: `gpu_geometry_wave32_prefix_count_over_a_mask` and `gpu_wave32_program_in_wave64_hardware`, both "no wave64". The six `gpu_ps_image_sample_offset` tests (this PR's five and #229's): 6 passed. - The earlier head `a60db9f`, on `main` `9ab7d76`: 656 passed, 0 failed, 40 ignored, with the same two SKIPPED tests. - The new tests, built from `main` with and without the `emit.rs` change (the same test code in both): | test | main | this PR | |---|---|---| | `gpu_ps_image_sample_offset_point_mip` (control, plain `sample_o`) | pass | pass | | `gpu_ps_image_sample_offset_bias_lod` (`b_o`, LOD 0 + bias 1) | FAIL: pixel (0,0) = 100, expected 101 | pass | | `gpu_ps_image_sample_offset_bias_lod_magnified` (`b_o`, LOD -1 + bias 1, @⁠ryotdev's case) | pass | pass (`fd45f20`: FAIL, (0,0) = 2, expected 1) | | `gpu_ps_image_sample_offset_gradient_lod` (`d_o` and `cd_o`, gradient LOD 1) | FAIL: pixel (0,0) = 100, expected 101 (`cd_o` fails the same way, 48 of 256 pixels) | pass | | `gpu_ps_image_sample_offset_compare_lod` (`c_o`, implicit LOD 1, LESS_EQUAL) | FAIL: pixel (0,0) = 0, expected 1 | pass | | `gpu_ps_image_sample_offset_implicit_lod_between_mips` (#229's) | pass | pass | - `gpu::recomp::` on `287ca93`: 188 passed, 0 failed, 18 ignored (on `a60db9f`: 187 passed, 0 failed, 18 ignored). - @⁠WarmMilkCodes ran the previous head `fd45f20`, before the magnification fix, on `main` `9ab7d76` with an RX 6600 XT (RDNA2). `cargo test --workspace`: main 651 passed, 0 failed; PR 655 passed, 0 failed. No GPU test was skipped, and the four new tests of that head passed. - Also run by @⁠denio4321 on an RTX 3060 (NVIDIA 610.88), head `a60db9f`: `cargo test --workspace`, 656 passed, 0 failed, 40 ignored, and the 5 new tests pass (https://github.com/ivall/xcl/pull/247#issuecomment-7115578260). - Also run by @⁠PHeitor1 on an RTX 5060 Ti (NVIDIA 621.24), Windows 11, debug, head `a60db9f`: `cargo test --workspace`, 656 passed, 0 failed, 40 ignored (https://github.com/ivall/xcl/pull/247#issuecomment-7115669307). - Also run by @⁠PHeitor1 on `a60db9f` merged onto `main` `2b4bb43`, on an RTX 5060 Ti, debug, with the debug-layer tests enabled: `cargo test --workspace`, 675 passed, 0 failed, 41 ignored; the only SKIPPED tests are the two "no wave64" ones (https://github.com/ivall/xcl/pull/247#issuecomment-7117533720). - Also run by @⁠nullmarsh on an RX 9060 XT (RDNA4, driver 32.0.32029.2010), Ryzen 7 5800X3D, Windows 11 Pro 26200, Rust 1.100.0, DXC 1.9.2602.17, debug. They ran `a60db9f` merged onto `main` `4017f8f` (a clean merge) (https://github.com/ivall/xcl/pull/247#issuecomment-7116443830): - `scripts/test.ps1`: 657 passed, 0 failed, 40 ignored, with no SKIPPED GPU tests. - With only this PR's `tests.rs` (no `emit.rs` change), `…_bias_lod`, `…_gradient_lod` and `…_compare_lod` fail; `…_point_mip` and `…_bias_lod_magnified` pass with and without the fix. - Also run by @⁠futurepro62 on the exact head `227a60a` (on `9e3831e`) (https://git.gtahub.st/github/xcl-dev--xcl/pulls/247), debug, DXC 1.9.2602: on an RTX 5070 Ti (NVIDIA 621.40), `XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4` with 8 `--skip` filters, 784 passed, 0 failed, 41 ignored, and all of this PR's tests ran and passed. On the Radeon integrated GPU (iGPU) of a Ryzen 7 9800X3D (RDNA2), 785 passed, 0 failed, 41 ignored; its only SKIPPED test is `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). Of the skip filters, only that test exists at this head (it is not this PR's); the other seven name tests that reached `main` after `9e3831e`, so they skipped nothing here. - Earlier smoke runs by @⁠srcamarda, RX 7800 XT (RDNA3), release, 90 s, three of each on `main` `9ab7d76` and this head: `main` 901 / 1180 / 1184 frames, this PR 1168 / 1167 / 1357, no crash or device removal (https://github.com/ivall/xcl/pull/247#issuecomment-7117441417). No `_o` sample form appears in the title's first menus, so these runs and ours below are a regression check, not a test of the change. **Regression run** `scripts/smoke.ps1`, the same retail title for 60 s each, one after the other on the machine under **Tested** (RTX 5070 Ti, NVIDIA 610.74), release builds, no uncommitted changes. `main` `9e3831e`: ``` xcl-smoke v1 commit: 9e3831e1f570d3646e53ab753b19ec07eb8f1485 gpu: NVIDIA GeForce RTX 5070 Ti title: ea3b5e4d seconds: 60 exit: 0x0 frames shown: 1274 (PresentX 1274) presents per 2 s (last 3): 8 31 32 device removals: 0 crashes: 0 peak commit: 27459 MB ``` this PR's head `227a60a`: ``` xcl-smoke v1 commit: 227a60a977b9ab43b1bb77875ec547a5403d3972 gpu: NVIDIA GeForce RTX 5070 Ti title: ea3b5e4d seconds: 60 exit: 0x0 frames shown: 1313 (PresentX 1313) presents per 2 s (last 3): 6 36 56 device removals: 0 crashes: 0 peak commit: 27471 MB ``` PR vs `main`: 1313 / 1274 frames (103 %), peak commit 27471 / 27459 MB (100 %); no device removal and no crash on either run. **Not tested** - On `image_sample_l_o` the offset uses the given LOD before the sampler's bias and MIN/MAX_LOD, as on main. Sampler bias on `image_sample_b_o` follows it on NVIDIA 610.74 (measured); AMD not measured. - No title is known to use any of these forms with a VGPR offset. They come from the ISA, not from a shader seen in use. - AMD RDNA2 for the head `a60db9f`: the RX 6600 XT run above is of `fd45f20`. RDNA4 ran `a60db9f` (@⁠nullmarsh, above). - Linear mip filters on these forms. Only the level choice is fixed; the per-mip blend #229 does for the plain form is not extended here. - `b_o` and `d_o` outside a pixel shader, 1D / 3D / array textures, A16 addresses, and a min-LOD clamp (`_cl_`) together with an offset. - A T# with MIN_LOD whose base level isn't 0. The offset applies MIN_LOD in the view's levels; I didn't check whether D3D12 applies `ResourceMinLODClamp` in the view's levels or the resource's. - `image_sample_c_l_o` in a PS: the offset moves by the given LOD, while `SampleCmp` reads the pixel's own, as on main. - AMD RDNA3 and RDNA4 for `227a60a`: only the RDNA2 iGPU run above (@⁠futurepro62) is of this head. - Anisotropic samplers. The gradient LOD here is the isotropic `log2` of the longer gradient, which can differ from the hardware's at a mip boundary. The plain form's `CalculateLevelOfDetail` has the same limit. **AI use** - Claude Code (Claude Opus 5.5), code, tests and this description; Claude Code (Claude Fable 5.2), the rebase onto `dd2ae9a` and its runs; Claude Code (Claude Opus 5.5), the fixes for @⁠JGonzalezRodriguez's review, their tests and the runs on `c14bd12` and `227a60a`
#229 picks the offset's mip for the plain form only; the bias, gradient
and (in a PS) comparison forms still divided by mip 0's size. The level
is now the given LOD, else that of the given gradients or the pixel's
own (screen derivatives for comparison samplers, which
CalculateLevelOfDetail does not take), plus the bias. That LOD is the
unclamped one, so a bias on a magnified pixel starts below 0 (found by
ryotdev); the sampler's MIN_LOD / MAX_LOD and the view's last mip are
applied after the bias.

The level follows what the view and the sampler are made of and the
sample that is emitted (found by JGonzalezRodriguez): the sampler's
LOD_BIAS is added to a LOD from gradients, as SampleGrad and SampleCmp
add it; the lower clamp includes the T#'s MIN_LOD (the SRV's
ResourceMinLODClamp); without a mip filter MAX_LOD is MIN_LOD, as
desc::sampler_d3d12 sets the sampler up. A comparison sample is
SampleCmpLevelZero outside a PS and SampleCmp, which takes neither
gradients nor a bias, in a PS, so its offset moves by mip 0 there and by
the pixel's own LOD here.

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

@⁠ryotdev on GitHub · 2026-11-23 21:58 UTC · original

I reproduced a magnification edge case on native Windows 11 with an RTX 5070 (driver 32.0.16.1088) and DXC 1.9.2609.5. I applied fd45f206's diff on main@7a033c8c and used the same synthetic test code for both builds.

I duplicated gpu_ps_image_sample_offset_bias_lod, changed the scale from 1/8 to 1/16, kept the instruction bias and offset at +1, and expected texel_moved(0, u). That gives implicit LOD −1, plus bias 1, so the sample and offset should both use mip 0.

Case Main PR
Original LOD 0 + bias 1 (0,0) = 100, expected 101 Pass
Magnification LOD −1 + bias 1 Pass (0,0) = 2, expected 1

Using CalculateLevelOfDetailUnclamped in the biased pixel path let the instruction bias see the raw negative LOD. With that local change, all six gpu_ps_image_sample_offset_ tests passed on the GPU, including the original positive case and the magnification regression. This checks the sampler in the existing fixture. Any sampler and view bounds still need to be applied after bias. Direct3D LOD calculation

Synthetic textures only. Rust 1.100.0, clang-cl/lld 19.1.1 with xwin SDK 10.0.26100. AI-assisted (Codex).

**@⁠ryotdev** on GitHub · 2026-11-23 21:58 UTC · [original](https://github.com/xcl-dev/xcl/pull/247#issuecomment-7115170373) I reproduced a magnification edge case on native Windows 11 with an RTX 5070 (driver 32.0.16.1088) and DXC 1.9.2609.5. I applied `fd45f206`'s diff on `main@7a033c8c` and used the same synthetic test code for both builds. I duplicated `gpu_ps_image_sample_offset_bias_lod`, changed the scale from `1/8` to `1/16`, kept the instruction bias and offset at +1, and expected `texel_moved(0, u)`. That gives implicit LOD −1, plus bias 1, so the sample and offset should both use mip 0. | Case | Main | PR | | --- | --- | --- | | Original LOD 0 + bias 1 | (0,0) = 100, expected 101 | Pass | | Magnification LOD −1 + bias 1 | Pass | (0,0) = 2, expected 1 | Using `CalculateLevelOfDetailUnclamped` in the biased pixel path let the instruction bias see the raw negative LOD. With that local change, all six `gpu_ps_image_sample_offset_` tests passed on the GPU, including the original positive case and the magnification regression. This checks the sampler in the existing fixture. Any sampler and view bounds still need to be applied after bias. [Direct3D LOD calculation](https://microsoft.github.io/DirectX-Specs/d3d/archive/D3D11_3_FunctionalSpec.htm#LODCalculation) Synthetic textures only. Rust 1.100.0, clang-cl/lld 19.1.1 with xwin SDK 10.0.26100. AI-assisted (Codex).
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-23 22:07 UTC · original

Thanks @⁠ryotdev, that was a real regression. Your case is now gpu_ps_image_sample_offset_bias_lod_magnified: on fd45f20 it fails as you saw it ((0,0) = 2, expected 1), and on the new head it passes. RTX 5070 Ti, 610.74: all 6 gpu_ps_image_sample_offset_* pass, and gpu::recomp:: gives 187 passed, 0 failed, 18 ignored.

The new head a60db9f (one commit, rebased on 9ab7d76) uses CalculateLevelOfDetailUnclamped in the biased path, as you suggested. The sampler's MIN_LOD / MAX_LOD and the view's last mip are applied after the bias. The gradient log2 and the c_o ddx/ddy LOD were already unclamped before the bias.

🤖 Claude Opus 5.5

**@⁠Kalmarv** on GitHub · 2026-11-23 22:07 UTC · [original](https://github.com/xcl-dev/xcl/pull/247#issuecomment-7115356976) Thanks @⁠ryotdev, that was a real regression. Your case is now `gpu_ps_image_sample_offset_bias_lod_magnified`: on `fd45f20` it fails as you saw it ((0,0) = 2, expected 1), and on the new head it passes. RTX 5070 Ti, 610.74: all 6 `gpu_ps_image_sample_offset_*` pass, and `gpu::recomp::` gives 187 passed, 0 failed, 18 ignored. The new head `a60db9f` (one commit, rebased on `9ab7d76`) uses `CalculateLevelOfDetailUnclamped` in the biased path, as you suggested. The sampler's MIN_LOD / MAX_LOD and the view's last mip are applied after the bias. The gradient `log2` and the `c_o` ddx/ddy LOD were already unclamped before the bias. 🤖 Claude Opus 5.5
Author
Owner

@⁠WarmMilkCodes on GitHub · 2026-11-23 22:09 UTC · original

Tested #247 fd45f20 merged onto main 9ab7d76 on AMD Radeon RX 6600 XT (RDNA2), driver 32.0.21045.29003, Windows 11 23H2 (22631.6199): pass

cargo test --workspace --no-fail-fast -- --test-threads=4, no XCL_SAMPLE_* data: main 651 passed / 0 failed; this 655 passed / 0 failed, 0 GPU tests skipped. The PR's 4 new tests pass on RDNA2; no new failures.

**@⁠WarmMilkCodes** on GitHub · 2026-11-23 22:09 UTC · [original](https://github.com/xcl-dev/xcl/pull/247#issuecomment-7115393736) Tested #247 `fd45f20` merged onto main `9ab7d76` on AMD Radeon RX 6600 XT (RDNA2), driver 32.0.21045.29003, Windows 11 23H2 (22631.6199): pass `cargo test --workspace --no-fail-fast -- --test-threads=4`, no `XCL_SAMPLE_*` data: main 651 passed / 0 failed; this 655 passed / 0 failed, 0 GPU tests skipped. The PR's 4 new tests pass on RDNA2; no new failures.
Author
Owner

@⁠denio4321 on GitHub · 2026-11-23 22:17 UTC · original

Tested a60db9f merged onto main 9ab7d76 on RTX 3060 12 GB (Ampere, 32-lane waves), NVIDIA 610.88, Windows 11 Pro 23H2 (22631), rustc 1.100.0 MSVC, DXC 1.9.2602.17: pass.

.\scripts\test.ps1 (debug, --test-threads=4), no XCL_SAMPLE_* set. Baseline main 9ab7d76 alone on the same machine: 651 passed, 0 failed, 40 ignored.

  • This PR: 656 passed, 0 failed, 40 ignored.
  • The five new tests pass on this card: gpu_ps_image_sample_offset_point_mip, _bias_lod, _bias_lod_magnified, _gradient_lod and _compare_lod.
  • GPU skips are the same 2 as on main (no wave64).

The magnification case from the comment above (_bias_lod_magnified) passes here too.

Not checked: the negative control, or any game.

AI-assisted (Claude Code).

**@⁠denio4321** on GitHub · 2026-11-23 22:17 UTC · [original](https://github.com/xcl-dev/xcl/pull/247#issuecomment-7115578260) Tested `a60db9f` merged onto `main` `9ab7d76` on RTX 3060 12 GB (Ampere, 32-lane waves), NVIDIA 610.88, Windows 11 Pro 23H2 (22631), rustc 1.100.0 MSVC, DXC 1.9.2602.17: **pass**. `.\scripts\test.ps1` (debug, `--test-threads=4`), no `XCL_SAMPLE_*` set. Baseline `main` `9ab7d76` alone on the same machine: 651 passed, 0 failed, 40 ignored. - This PR: **656 passed, 0 failed, 40 ignored**. - The five new tests pass on this card: `gpu_ps_image_sample_offset_point_mip`, `_bias_lod`, `_bias_lod_magnified`, `_gradient_lod` and `_compare_lod`. - GPU skips are the same 2 as on `main` (`no wave64`). The magnification case from the comment above (`_bias_lod_magnified`) passes here too. Not checked: the negative control, or any game. AI-assisted (Claude Code).
Author
Owner

@⁠PHeitor1 on GitHub · 2026-11-23 22:22 UTC · original

Tested on RTX 5060 Ti 8 GB, driver 621.24, Ryzen 5 5600X, Windows 11 Pro 26300 (native), Rust 1.100.0 msvc, debug. cargo test --workspace --no-fail-fast -- --test-threads=4 on the head a60db9f: 656 passed, 0 failed, 40 ignored (main 9ab7d76: 651 / 0 / 40). SKIPPED: only the usual two no wave64 (gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware).

Run and written with Claude Code (Claude Opus 5.5).

**@⁠PHeitor1** on GitHub · 2026-11-23 22:22 UTC · [original](https://github.com/xcl-dev/xcl/pull/247#issuecomment-7115669307) Tested on RTX 5060 Ti 8 GB, driver 621.24, Ryzen 5 5600X, Windows 11 Pro 26300 (native), Rust 1.100.0 msvc, debug. `cargo test --workspace --no-fail-fast -- --test-threads=4` on the head `a60db9f`: **656 passed, 0 failed, 40 ignored** (main `9ab7d76`: 651 / 0 / 40). SKIPPED: only the usual two `no wave64` (`gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`). _Run and written with Claude Code (Claude Opus 5.5)._
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-23 22:30 UTC · original

Regression run wanted. We have no title on our machine. If you can run scripts/smoke.ps1 -Game <your title folder> twice, once built from main (9ab7d76) and once from this PR's head (a60db9f), please paste both xcl-smoke blocks here. I'll copy them into the description with your name and hardware.

🤖 Claude Opus 5.5

**@⁠Kalmarv** on GitHub · 2026-11-23 22:30 UTC · [original](https://github.com/xcl-dev/xcl/pull/247#issuecomment-7115833643) **Regression run wanted.** We have no title on our machine. If you can run `scripts/smoke.ps1 -Game <your title folder>` twice, once built from `main` (`9ab7d76`) and once from this PR's head (`a60db9f`), please paste both `xcl-smoke` blocks here. I'll copy them into the description with your name and hardware. 🤖 Claude Opus 5.5
Author
Owner

@⁠JGonzalezRodriguez on GitHub · 2026-11-23 22:35 UTC · original

Tested PR #247 head a60db9f against base 9ab7d76 on both NVIDIA and AMD RDNA2 (native wave64).

Tested

  • Host / stack: CachyOS Linux, NVIDIA RTX 4090 (NVIDIA 610.57.4, wave32) and AMD RDNA2 iGPU (RADV RAPHAEL_MENDOCINO, radv 26.2.4, native wave64 + wave32) via Proton Experimental wine + relaxed vkd3d-proton; DXC 1.9.2609.5; cross-built x86_64-pc-windows-msvc debug (rustc 1.98.1, clang-cl 23.1.1 + lld-link, 0 errors, 0 warnings).
  • image_sample_offset tests (a60db9f vs 9ab7d76 emit.rs with a60db9f tests.rs):
Test Base 9ab7d76 (RTX 4090 / RADV) PR a60db9f (RTX 4090 / RADV)
gpu_image_sample_offset pass / pass pass / pass
gpu_ps_image_sample_offset_implicit_lod_between_mips pass / pass pass / pass
gpu_ps_image_sample_offset_point_mip pass / pass pass / pass
gpu_ps_image_sample_offset_bias_lod_magnified pass / pass pass / pass
gpu_ps_image_sample_offset_bias_lod FAIL (100, want 101) / FAIL (100, want 101) pass / pass
gpu_ps_image_sample_offset_gradient_lod FAIL (100, want 101) / FAIL (100, want 101) pass / pass
gpu_ps_image_sample_offset_compare_lod FAIL (0, want 1) / FAIL (0, want 1) pass / pass
  • Confirmed a60db9f fixes the symmetric b_o minification + negative bias case (LOD +2 + bias -1 → 101), b_o with MaxLOD = 0 (MIP_FILTER = point → 1), and d_o with MinLOD = 1 (101) on both GPUs.

Findings (synthetic probes reproduced identically on both RTX 4090 and AMD RDNA2)

  1. MIP_FILTER == 0 (NONE, S# w[2][27:26]) is ignored (emit.rs:2190-2212) — regresses vs 9ab7d76:

    • desc::sampler_d3d12 (desc.rs:290,322) forces MaxLOD = MinLOD when MIP_FILTER == 0, while a60db9f reads only S# w[1] (MAX_LOD). With MIP_FILTER = NONE and MAX_LOD = 0xFFF:
      • d_o (grad 1): pass (1) on 9ab7d76 → FAIL (2, want 1) on a60db9f
      • b_o (LOD 0, bias +1): pass (1) on 9ab7d76 → FAIL (2, want 1) on a60db9f
      • c_o (implicit LOD 1): pass (1) on 9ab7d76 → FAIL (0, want 1) on a60db9f
    • Reading S# w[2] (as emit.rs:2257 already does) and setting lod_max = lod_min when ((w2 >> 26) & 3u) == 0u matches desc::sampler_d3d12.
  2. T# ResourceMinLODClamp (tw1[19:8] u4.8, desc.rs:73,251) is dropped on b_o (emit.rs:2203-2212) — new regression in a60db9f:

    • CalculateLevelOfDetail included SRV.ResourceMinLODClamp, whereas CalculateLevelOfDetailUnclamped omits it, and a60db9f clamps only against S# w[1] MIN_LOD:
      • b_o (LOD 0, bias 0) with ResourceMinLODClamp = 1.0: pass (101) on 9ab7d76 → FAIL (100, want 101) on a60db9f
    • tw1 is already bound at emit.rs:2088, so lod_min = max(s_min, (float)((tw1 >> 8) & 0xFFFu) / 256.0f) fixes this for b_o, d_o, cd_o, and c_o.
  3. S# MipLODBias (w[2][13:0] s5.8) is omitted on grad_lod paths (d_o, cd_o, c_o) (emit.rs:2201-2202):

    • SampleGrad and SampleCmp both apply sampler.MipLODBias, whereas raw log2(...) does not:
      • d_o (grad 0) + MipLODBias = +1.0: FAIL (100, want 101)
      • c_o (implicit LOD 0) + MipLODBias = +1.0: FAIL (0, want 1)
    • Adding (float)(((int)(w2 << 18)) >> 18) / 256.0f to the grad_lod branches aligns them with CalculateLevelOfDetailUnclamped (which already includes sampler.MipLODBias).
  4. Comparison forms with explicit gradients/bias (c_d_o, c_cd_o, c_b_o) regress against SampleCmp / SampleCmpLevelZero (emit.rs:2200-2209 vs 2233-2234):

    • emit.rs:2233-2234 emits SampleCmp (implicit LOD, ignoring grads/bias) in PS and SampleCmpLevelZero (mip 0) outside PS, while the offset-level path now uses grad_lod(dx, dy) / + bias:
      • c_d_o in PS (implicit LOD 0, grad 1, GREATER_EQUAL z=1.5): pass (1) on 9ab7d76 → FAIL (0, want 1) on a60db9f
      • c_b_o in PS (implicit LOD 0, bias +1, GREATER_EQUAL z=1.5): pass (1) on 9ab7d76 → FAIL (0, want 1) on a60db9f
    • Until SM 6.7 SampleCmpGrad/SampleCmpBias/SampleCmpLevel are used, has_c should match the emitted instruction (0u when !ps || has_lz, pure screen-derivative LOD + sampler bias/clamps when ps).
  5. Minor: emit.rs:2188 calls self.texel_offset(&t, dim, o, "0u", "0") just to obtain {t}_w0/{t}_h0/{t}_d0/{t}_n0, leaving an unused float3 {t}_o0.

Not tested

  • Native Windows, Windows SDK DXC 1.7, full workspace test run on a60db9f (ran targeted image_sample_offset + probes on a60db9f; full gpu::recomp::tests:: ran on fd45f20), retail titles.

AI use

Antigravity (Gemini frontier model) assisted with code review, dual-GPU synthetic probe execution, and drafting this report; every line cited and repro result was directly verified on this host.

**@⁠JGonzalezRodriguez** on GitHub · 2026-11-23 22:35 UTC · [original](https://github.com/xcl-dev/xcl/pull/247#issuecomment-7115935497) Tested PR #247 head `a60db9f` against base `9ab7d76` on both NVIDIA and AMD RDNA2 (native wave64). ### Tested - **Host / stack**: CachyOS Linux, NVIDIA RTX 4090 (`NVIDIA 610.57.4`, wave32) and AMD RDNA2 iGPU (`RADV RAPHAEL_MENDOCINO`, `radv 26.2.4`, native wave64 + wave32) via Proton Experimental `wine` + relaxed `vkd3d-proton`; DXC `1.9.2609.5`; cross-built `x86_64-pc-windows-msvc` debug (`rustc 1.98.1`, `clang-cl 23.1.1` + `lld-link`, `0 errors, 0 warnings`). - `image_sample_offset` tests (`a60db9f` vs `9ab7d76` `emit.rs` with `a60db9f` `tests.rs`): | Test | Base `9ab7d76` (RTX 4090 / RADV) | PR `a60db9f` (RTX 4090 / RADV) | |---|---|---| | `gpu_image_sample_offset` | pass / pass | pass / pass | | `gpu_ps_image_sample_offset_implicit_lod_between_mips` | pass / pass | pass / pass | | `gpu_ps_image_sample_offset_point_mip` | pass / pass | pass / pass | | `gpu_ps_image_sample_offset_bias_lod_magnified` | pass / pass | pass / pass | | `gpu_ps_image_sample_offset_bias_lod` | FAIL (`100`, want `101`) / FAIL (`100`, want `101`) | pass / pass | | `gpu_ps_image_sample_offset_gradient_lod` | FAIL (`100`, want `101`) / FAIL (`100`, want `101`) | pass / pass | | `gpu_ps_image_sample_offset_compare_lod` | FAIL (`0`, want `1`) / FAIL (`0`, want `1`) | pass / pass | - Confirmed `a60db9f` fixes the symmetric `b_o` minification + negative bias case (`LOD +2` + bias `-1` → `101`), `b_o` with `MaxLOD = 0` (`MIP_FILTER = point` → `1`), and `d_o` with `MinLOD = 1` (`101`) on both GPUs. ### Findings (synthetic probes reproduced identically on both RTX 4090 and AMD RDNA2) 1. **`MIP_FILTER == 0` (`NONE`, S# `w[2][27:26]`) is ignored (`emit.rs:2190-2212`) — regresses vs `9ab7d76`:** - `desc::sampler_d3d12` (`desc.rs:290,322`) forces `MaxLOD = MinLOD` when `MIP_FILTER == 0`, while `a60db9f` reads only S# `w[1]` (`MAX_LOD`). With `MIP_FILTER = NONE` and `MAX_LOD = 0xFFF`: - `d_o` (grad `1`): **pass (`1`) on `9ab7d76` → FAIL (`2`, want `1`) on `a60db9f`** - `b_o` (LOD `0`, bias `+1`): **pass (`1`) on `9ab7d76` → FAIL (`2`, want `1`) on `a60db9f`** - `c_o` (implicit LOD `1`): **pass (`1`) on `9ab7d76` → FAIL (`0`, want `1`) on `a60db9f`** - Reading S# `w[2]` (as `emit.rs:2257` already does) and setting `lod_max = lod_min` when `((w2 >> 26) & 3u) == 0u` matches `desc::sampler_d3d12`. 2. **T# `ResourceMinLODClamp` (`tw1[19:8]` u4.8, `desc.rs:73,251`) is dropped on `b_o` (`emit.rs:2203-2212`) — new regression in `a60db9f`:** - `CalculateLevelOfDetail` included `SRV.ResourceMinLODClamp`, whereas `CalculateLevelOfDetailUnclamped` omits it, and `a60db9f` clamps only against S# `w[1]` `MIN_LOD`: - `b_o` (LOD `0`, bias `0`) with `ResourceMinLODClamp = 1.0`: **pass (`101`) on `9ab7d76` → FAIL (`100`, want `101`) on `a60db9f`** - `tw1` is already bound at `emit.rs:2088`, so `lod_min = max(s_min, (float)((tw1 >> 8) & 0xFFFu) / 256.0f)` fixes this for `b_o`, `d_o`, `cd_o`, and `c_o`. 3. **S# `MipLODBias` (`w[2][13:0]` s5.8) is omitted on `grad_lod` paths (`d_o`, `cd_o`, `c_o`) (`emit.rs:2201-2202`):** - `SampleGrad` and `SampleCmp` both apply `sampler.MipLODBias`, whereas raw `log2(...)` does not: - `d_o` (grad `0`) + `MipLODBias = +1.0`: **FAIL (`100`, want `101`)** - `c_o` (implicit LOD `0`) + `MipLODBias = +1.0`: **FAIL (`0`, want `1`)** - Adding `(float)(((int)(w2 << 18)) >> 18) / 256.0f` to the `grad_lod` branches aligns them with `CalculateLevelOfDetailUnclamped` (which already includes `sampler.MipLODBias`). 4. **Comparison forms with explicit gradients/bias (`c_d_o`, `c_cd_o`, `c_b_o`) regress against `SampleCmp` / `SampleCmpLevelZero` (`emit.rs:2200-2209` vs `2233-2234`):** - `emit.rs:2233-2234` emits `SampleCmp` (implicit LOD, ignoring `grads`/`bias`) in PS and `SampleCmpLevelZero` (mip 0) outside PS, while the offset-level path now uses `grad_lod(dx, dy)` / `+ bias`: - `c_d_o` in PS (implicit LOD `0`, grad `1`, `GREATER_EQUAL` z=`1.5`): **pass (`1`) on `9ab7d76` → FAIL (`0`, want `1`) on `a60db9f`** - `c_b_o` in PS (implicit LOD `0`, bias `+1`, `GREATER_EQUAL` z=`1.5`): **pass (`1`) on `9ab7d76` → FAIL (`0`, want `1`) on `a60db9f`** - Until SM 6.7 `SampleCmpGrad`/`SampleCmpBias`/`SampleCmpLevel` are used, `has_c` should match the emitted instruction (`0u` when `!ps || has_lz`, pure screen-derivative LOD + sampler bias/clamps when `ps`). 5. **Minor:** `emit.rs:2188` calls `self.texel_offset(&t, dim, o, "0u", "0")` just to obtain `{t}_w0/{t}_h0/{t}_d0/{t}_n0`, leaving an unused `float3 {t}_o0`. ### Not tested - Native Windows, Windows SDK DXC 1.7, full workspace test run on `a60db9f` (ran targeted `image_sample_offset` + probes on `a60db9f`; full `gpu::recomp::tests::` ran on `fd45f20`), retail titles. ### AI use Antigravity (Gemini frontier model) assisted with code review, dual-GPU synthetic probe execution, and drafting this report; every line cited and repro result was directly verified on this host.
Author
Owner

@⁠ghost on GitHub · 2026-11-23 23:00 UTC · original

Tested a60db9f merged onto main 4017f8f (clean merge) on AMD RDNA4: pass, and three of the five new tests fail without the fix.

Tested

  • AMD Radeon RX 9060 XT (RDNA4), 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: 657 passed, 0 failed, 40 ignored; no SKIPPED GPU tests on this adapter.
  • XCL_REQUIRE_GPU=wave64,mesh cargo test -p xcl --lib image_sample_offset: 7 passed, 0 failed (the five new gpu_ps_image_sample_offset_* tests, ..._implicit_lod_between_mips and gpu_image_sample_offset).
  • Negative control: only this PR's tests.rs on main 4017f8f (the emit.rs change left out): ..._bias_lod, ..._gradient_lod and ..._compare_lod fail (tests.rs:2005). ..._point_mip and ..._bias_lod_magnified pass with or without the fix, so on this adapter they guard against regressions rather than show this change.

Not tested

  • No XCL_SAMPLE_* set and no retail title, so no smoke.ps1 regression run; vertex/compute stages with a bias or gradients (the new tests are PS only); NVIDIA.

AI use

  • Claude Code (Claude Opus 5.5) ran the commands and wrote this report from the logs; I checked it before posting.
**@⁠ghost** on GitHub · 2026-11-23 23:00 UTC · [original](https://github.com/xcl-dev/xcl/pull/247#issuecomment-7116443830) Tested `a60db9f` merged onto `main` `4017f8f` (clean merge) on AMD RDNA4: **pass**, and three of the five new tests fail without the fix. **Tested** - AMD Radeon RX 9060 XT (RDNA4), 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`: 657 passed, 0 failed, 40 ignored; no `SKIPPED` GPU tests on this adapter. - `XCL_REQUIRE_GPU=wave64,mesh cargo test -p xcl --lib image_sample_offset`: 7 passed, 0 failed (the five new `gpu_ps_image_sample_offset_*` tests, `..._implicit_lod_between_mips` and `gpu_image_sample_offset`). - Negative control: only this PR's `tests.rs` on `main` `4017f8f` (the `emit.rs` change left out): `..._bias_lod`, `..._gradient_lod` and `..._compare_lod` fail (`tests.rs:2005`). `..._point_mip` and `..._bias_lod_magnified` pass with or without the fix, so on this adapter they guard against regressions rather than show this change. **Not tested** - No `XCL_SAMPLE_*` set and no retail title, so no `smoke.ps1` regression run; vertex/compute stages with a bias or gradients (the new tests are PS only); NVIDIA. **AI use** - Claude Code (Claude Opus 5.5) ran the commands and wrote this report from the logs; I checked it before posting.
Author
Owner

@⁠srcamarda on GitHub · 2026-11-23 23:51 UTC · original

@⁠Kalmarv the regression run you asked for, plus the first RDNA3 run.

Tested

  • AMD Radeon RX 7800 XT (RDNA3, native 64-lane waves), driver 32.0.32029.2010; Ryzen 5 5600G, 32 GB; Windows 11 Pro 26300; Rust 1.100.0 MSVC; DXC 1.8.2502.11 (SDK 10.0.26100)
  • Built from the head a60db9f itself (on 9ab7d76), no uncommitted changes
  • XCL_REQUIRE_GPU=wave64,mesh cargo test -p xcl --lib image_sample_offset: 7 passed, 0 failed (the five new tests, …_implicit_lod_between_mips, gpu_image_sample_offset)
  • cargo test --workspace -- --test-threads=4 (debug): 656 passed, 0 failed, 40 ignored, no SKIPPED

Regression run (retail title, scripts/smoke.ps1, 90 s, release). Three runs of each binary, the first with a cold translation cache: main 901 / 1 180 / 1 184 frames, this PR 1 168 / 1 167 / 1 357. No crash or device removal in any, and the same peak commit. gpu: names a virtual display adapter on this machine; XCL ran on the RX 7800 XT. The second run of each:

main 9ab7d76:

xcl-smoke v1
commit: 9ab7d763197c7f420bff10cd9bf1310f07e2a9aa
gpu: SudoMaker Virtual Display Adapter
title: RetailGame_Dump
seconds: 90
exit: 0x0
frames shown: 1180 (PresentX 1180)
presents per 2 s (last 3): 27 28 26
device removals: 0
crashes: 0
peak commit: 17197 MB

this PR's head a60db9f:

xcl-smoke v1
commit: a60db9f3e5f279e66b7e1a73ba66a8c13a98d14c
gpu: SudoMaker Virtual Display Adapter
title: RetailGame_Dump
seconds: 90
exit: 0x0
frames shown: 1167 (PresentX 1167)
presents per 2 s (last 3): 25 26 25
device removals: 0
crashes: 0
peak commit: 17201 MB

Not tested

  • The changed forms in a title. In these 90 s (the title's first menus) the shaders it loads use image_sample, _l, _lz, _c_lz, _d and _b (report.json → shaders.rdna2_mnemonics), but no _o form, so this run is a regression check only. The negative control was also not run here; nullmarsh did that on RDNA4.

AI use

  • Claude Code with Claude Opus 5.5: built both commits, ran the tests and the smoke runs, wrote this report.
**@⁠srcamarda** on GitHub · 2026-11-23 23:51 UTC · [original](https://github.com/xcl-dev/xcl/pull/247#issuecomment-7117441417) @⁠Kalmarv the regression run you asked for, plus the first RDNA3 run. **Tested** - AMD Radeon RX 7800 XT (RDNA3, native 64-lane waves), driver 32.0.32029.2010; Ryzen 5 5600G, 32 GB; Windows 11 Pro 26300; Rust 1.100.0 MSVC; DXC 1.8.2502.11 (SDK 10.0.26100) - Built from the head `a60db9f` itself (on `9ab7d76`), no uncommitted changes - `XCL_REQUIRE_GPU=wave64,mesh cargo test -p xcl --lib image_sample_offset`: 7 passed, 0 failed (the five new tests, `…_implicit_lod_between_mips`, `gpu_image_sample_offset`) - `cargo test --workspace -- --test-threads=4` (debug): 656 passed, 0 failed, 40 ignored, no `SKIPPED` **Regression run** (retail title, `scripts/smoke.ps1`, 90 s, release). Three runs of each binary, the first with a cold translation cache: `main` 901 / 1 180 / 1 184 frames, this PR 1 168 / 1 167 / 1 357. No crash or device removal in any, and the same peak commit. `gpu:` names a virtual display adapter on this machine; XCL ran on the RX 7800 XT. The second run of each: `main` `9ab7d76`: ``` xcl-smoke v1 commit: 9ab7d763197c7f420bff10cd9bf1310f07e2a9aa gpu: SudoMaker Virtual Display Adapter title: RetailGame_Dump seconds: 90 exit: 0x0 frames shown: 1180 (PresentX 1180) presents per 2 s (last 3): 27 28 26 device removals: 0 crashes: 0 peak commit: 17197 MB ``` this PR's head `a60db9f`: ``` xcl-smoke v1 commit: a60db9f3e5f279e66b7e1a73ba66a8c13a98d14c gpu: SudoMaker Virtual Display Adapter title: RetailGame_Dump seconds: 90 exit: 0x0 frames shown: 1167 (PresentX 1167) presents per 2 s (last 3): 25 26 25 device removals: 0 crashes: 0 peak commit: 17201 MB ``` **Not tested** - The changed forms in a title. In these 90 s (the title's first menus) the shaders it loads use `image_sample`, `_l`, `_lz`, `_c_lz`, `_d` and `_b` (`report.json` → `shaders.rdna2_mnemonics`), but no `_o` form, so this run is a regression check only. The negative control was also not run here; nullmarsh did that on RDNA4. **AI use** - Claude Code with Claude Opus 5.5: built both commits, ran the tests and the smoke runs, wrote this report.
Author
Owner

@⁠PHeitor1 on GitHub · 2026-11-23 23:56 UTC · original

Re-tested a60db9f merged onto main 2b4bb43 (clean merge) on RTX 5060 Ti 8 GB (Blackwell, 32-lane waves), NVIDIA 621.24, Ryzen 5 5600X, Windows 11 Pro 26300 (native, Graphics Tools + XGameRuntime installed, so the debug-layer tests run), rustc 1.100.0 MSVC, debug, cargo test --workspace --no-fail-fast -- --test-threads=4, no XCL_SAMPLE_*.

Pass: 675 passed, 0 failed, 41 ignored. SKIPPED: only the 2 no wave64 tests.

Run and written with Claude Code (Claude Opus 5.5).

**@⁠PHeitor1** on GitHub · 2026-11-23 23:56 UTC · [original](https://github.com/xcl-dev/xcl/pull/247#issuecomment-7117533720) Re-tested `a60db9f` merged onto `main` `2b4bb43` (clean merge) on RTX 5060 Ti 8 GB (Blackwell, 32-lane waves), NVIDIA 621.24, Ryzen 5 5600X, Windows 11 Pro 26300 (native, Graphics Tools + XGameRuntime installed, so the debug-layer tests run), rustc 1.100.0 MSVC, debug, `cargo test --workspace --no-fail-fast -- --test-threads=4`, no `XCL_SAMPLE_*`. **Pass:** 675 passed, 0 failed, 41 ignored. SKIPPED: only the 2 `no wave64` tests. _Run and written with Claude Code (Claude Opus 5.5)._
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-23 23:57 UTC · original

@⁠srcamarda thank you, both blocks are in the description under Regression run, with your three-run spread and the note that the title's first menus don't reach an _o form.

🤖 Claude Opus 5.5

**@⁠Kalmarv** on GitHub · 2026-11-23 23:57 UTC · [original](https://github.com/xcl-dev/xcl/pull/247#issuecomment-7117547178) @⁠srcamarda thank you, both blocks are in the description under **Regression run**, with your three-run spread and the note that the title's first menus don't reach an `_o` form. 🤖 Claude Opus 5.5
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-24 17:36 UTC · original

@⁠JGonzalezRodriguez thank you, and sorry this took a day. I checked all five points against the code and on the GPU, and they all hold. They're fixed in 227a60a, squashed into the PR's commit and rebased onto main 9e3831e. A whole-suite run on the old base stops in the #344 deadlock, which #443 fixed later. Each fix has a GPU test, and each test fails on 287ca93:

  1. No mip filter. When S# word 2 [27:26] is 0, the offset's level now takes MAX_LOD = MIN_LOD, as desc::sampler_d3d12 sets up the sampler. Test gpu_ps_image_sample_offset_without_a_mip_filter: your three cases, d_o (gradient LOD 1), b_o (LOD 0 + bias 1) and c_o (implicit LOD 1), read mip 0 and move by one of its texels.
  2. T# MIN_LOD. The lower clamp is now max(S# MIN_LOD, T# word 1 [19:8]); the T# field is the SRV's ResourceMinLODClamp. Test gpu_ps_image_sample_offset_resource_min_lod: b_o and d_o at LOD 0 with a clamp of 1.0 move by mip 1's texels.
  3. S# LOD_BIAS. It is now added to a LOD taken from gradients: the given ones (d_o, cd_o) and the screen derivatives of c_o. That matches SampleGrad and SampleCmp, which add it. b_o in a PS uses CalculateLevelOfDetailUnclamped, which already includes it. Test gpu_ps_image_sample_offset_sampler_bias: d_o at gradient LOD 0 and c_o at LOD 0 with LOD_BIAS +1 move by mip 1's texels. b_o is a control and passed before too.
  4. Comparison forms. You're right that the level has to follow the sample that is actually emitted. A comparison offset now moves by mip 0 outside a PS (SampleCmpLevelZero) and by the pixel's own LOD in a PS (SampleCmp, which takes neither gradients nor a bias in SM 6.6). Test gpu_image_sample_c_b_d_offset_moves_by_the_mip_read covers c_b_o and c_d_o in a PS and in a VS. It samples a checkerboard (one in each mip's own texels) at offsets 0 and +1. Moving by one texel of the mip that was read flips every pixel; moving by the other mip's texels flips half of them or none. So the test doesn't assume which mip is read.
    #349 and #350 make the PS SampleCmp take the bias and the gradients. In a tree with either of them and this PR, the matching line here has to take them too: lod_bias for #349, lod_grads for #350. The two lines are separate, so the two follow-ups don't conflict. I'll check this on a tree with all three, and push the one-line change to whichever of the three lands last.
  5. {t}_o0 is gone. The level-0 size now comes from mip_size, which texel_offset also calls.

Tested (RTX 5070 Ti, NVIDIA 610.74, Ryzen 9 9950X, Windows 11 Pro 26200, debug, SDK DXC 1.7)

  • gpu_ps_image_sample_offset*, gpu_image_sample_offset and the new comparison test on c14bd12 (the same patch before the rebase): 11 passed, 0 failed.
  • The same 11 with emit.rs from 287ca93: the four new tests fail and the other seven pass. Each case on its own (a scratch test, not in the PR): 11 of the 12 cases fail on 287ca93, and all 12 pass on c14bd12; the 12th is the b_o control.
  • cargo test --workspace -- --test-threads=4 on 227a60a: 785 passed, 0 failed, 41 ignored (the xcl library: 736 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).

Not tested

  • AMD, and a title using these forms with an offset (none is known).
  • A T# with MIN_LOD whose base level isn't 0. The offset applies MIN_LOD in the view's levels; I didn't check whether D3D12 applies ResourceMinLODClamp in the view's levels or the resource's.
  • c_l_o in a PS still moves by the given LOD while SampleCmp reads the pixel's own, as on main.

AI use: Claude Code (Claude Opus 5.5)

**@⁠Kalmarv** on GitHub · 2026-11-24 17:36 UTC · [original](https://github.com/xcl-dev/xcl/pull/247#issuecomment-7139452651) @⁠JGonzalezRodriguez thank you, and sorry this took a day. I checked all five points against the code and on the GPU, and they all hold. They're fixed in `227a60a`, squashed into the PR's commit and rebased onto `main` `9e3831e`. A whole-suite run on the old base stops in the #344 deadlock, which #443 fixed later. Each fix has a GPU test, and each test fails on `287ca93`: 1. **No mip filter.** When S# word 2 [27:26] is 0, the offset's level now takes MAX_LOD = MIN_LOD, as `desc::sampler_d3d12` sets up the sampler. Test `gpu_ps_image_sample_offset_without_a_mip_filter`: your three cases, `d_o` (gradient LOD 1), `b_o` (LOD 0 + bias 1) and `c_o` (implicit LOD 1), read mip 0 and move by one of its texels. 2. **T# MIN_LOD.** The lower clamp is now max(S# MIN_LOD, T# word 1 [19:8]); the T# field is the SRV's `ResourceMinLODClamp`. Test `gpu_ps_image_sample_offset_resource_min_lod`: `b_o` and `d_o` at LOD 0 with a clamp of 1.0 move by mip 1's texels. 3. **S# LOD_BIAS.** It is now added to a LOD taken from gradients: the given ones (`d_o`, `cd_o`) and the screen derivatives of `c_o`. That matches SampleGrad and SampleCmp, which add it. `b_o` in a PS uses `CalculateLevelOfDetailUnclamped`, which already includes it. Test `gpu_ps_image_sample_offset_sampler_bias`: `d_o` at gradient LOD 0 and `c_o` at LOD 0 with LOD_BIAS +1 move by mip 1's texels. `b_o` is a control and passed before too. 4. **Comparison forms.** You're right that the level has to follow the sample that is actually emitted. A comparison offset now moves by mip 0 outside a PS (`SampleCmpLevelZero`) and by the pixel's own LOD in a PS (`SampleCmp`, which takes neither gradients nor a bias in SM 6.6). Test `gpu_image_sample_c_b_d_offset_moves_by_the_mip_read` covers `c_b_o` and `c_d_o` in a PS and in a VS. It samples a checkerboard (one in each mip's own texels) at offsets 0 and +1. Moving by one texel of the mip that was read flips every pixel; moving by the other mip's texels flips half of them or none. So the test doesn't assume which mip is read. #349 and #350 make the PS `SampleCmp` take the bias and the gradients. In a tree with either of them and this PR, the matching line here has to take them too: `lod_bias` for #349, `lod_grads` for #350. The two lines are separate, so the two follow-ups don't conflict. I'll check this on a tree with all three, and push the one-line change to whichever of the three lands last. 5. `{t}_o0` is gone. The level-0 size now comes from `mip_size`, which `texel_offset` also calls. **Tested** (RTX 5070 Ti, NVIDIA 610.74, Ryzen 9 9950X, Windows 11 Pro 26200, debug, SDK DXC 1.7) - `gpu_ps_image_sample_offset*`, `gpu_image_sample_offset` and the new comparison test on `c14bd12` (the same patch before the rebase): 11 passed, 0 failed. - The same 11 with `emit.rs` from `287ca93`: the four new tests fail and the other seven pass. Each case on its own (a scratch test, not in the PR): 11 of the 12 cases fail on `287ca93`, and all 12 pass on `c14bd12`; the 12th is the `b_o` control. - `cargo test --workspace -- --test-threads=4` on `227a60a`: 785 passed, 0 failed, 41 ignored (the `xcl` library: 736 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). **Not tested** - AMD, and a title using these forms with an offset (none is known). - A T# with MIN_LOD whose base level isn't 0. The offset applies MIN_LOD in the view's levels; I didn't check whether D3D12 applies `ResourceMinLODClamp` in the view's levels or the resource's. - `c_l_o` in a PS still moves by the given LOD while `SampleCmp` reads the pixel's own, as on main. **AI use:** Claude Code (Claude Opus 5.5)
Author
Owner

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

Retest of the new head 227a60a, merged onto main 4178e88 (clean): passes on Blackwell, and five of its tests fail here without the fix.

Tested

  • RTX 5060 Ti 8 GB (32-lane waves), NVIDIA 621.24, Ryzen 5 5600X, Windows 11 Pro 26300, rustc 1.100.0 MSVC, DXC 1.9.2602.17, debug, no XCL_SAMPLE_*.
  • cargo build --workspace, then cargo test --workspace --no-fail-fast -- --test-threads=4: 900 passed, 0 failed, 42 ignored. SKIPPED: the 2 no wave64 tests, heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows, and pso_measurement_compiles_an_exact_synthetic_record (Developer Mode is off here).
  • The 11 offset tests (image_sample_offset, image_sample_c_b_d_offset), --test-threads=1, no SKIPPED: 11 passed. The same tree with only emit.rs from main: 6 passed, 5 failed.
test emit.rs from main 227a60a
…_bias_lod FAIL: (0,0) = 100, expected 101 pass
…_gradient_lod FAIL: d_o (0,0) = 100, expected 101 pass
…_compare_lod FAIL: (0,0) = 0, expected 1 pass
…_resource_min_lod FAIL: d_o (0,0) = 100, expected 101 pass
…_sampler_bias FAIL: d_o (0,0) = 100, expected 101 pass
…_without_a_mip_filter, gpu_image_sample_c_b_d_offset_moves_by_the_mip_read pass pass
the other four pass pass

The two review tests that pass with main's emit.rs read mip 0 in the cases they check, which is the mip main already uses, so they guard the new code rather than show a bug on main.

Not tested: 287ca93's emit.rs, AMD / Intel, release, a title.

Run and written with Claude Code (Claude Opus 5.5).

**@⁠PHeitor1** on GitHub · 2026-11-24 21:21 UTC · [original](https://github.com/xcl-dev/xcl/pull/247#issuecomment-7144831864) Retest of the new head `227a60a`, merged onto `main` `4178e88` (clean): passes on Blackwell, and five of its tests fail here without the fix. **Tested** - RTX 5060 Ti 8 GB (32-lane waves), NVIDIA 621.24, Ryzen 5 5600X, Windows 11 Pro 26300, rustc 1.100.0 MSVC, DXC 1.9.2602.17, debug, no `XCL_SAMPLE_*`. - `cargo build --workspace`, then `cargo test --workspace --no-fail-fast -- --test-threads=4`: 900 passed, 0 failed, 42 ignored. SKIPPED: the 2 `no wave64` tests, `heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows`, and `pso_measurement_compiles_an_exact_synthetic_record` (Developer Mode is off here). - The 11 offset tests (`image_sample_offset`, `image_sample_c_b_d_offset`), `--test-threads=1`, no SKIPPED: 11 passed. The same tree with only `emit.rs` from `main`: 6 passed, 5 failed. | test | `emit.rs` from `main` | `227a60a` | |---|---|---| | `…_bias_lod` | FAIL: (0,0) = 100, expected 101 | pass | | `…_gradient_lod` | FAIL: `d_o` (0,0) = 100, expected 101 | pass | | `…_compare_lod` | FAIL: (0,0) = 0, expected 1 | pass | | `…_resource_min_lod` | FAIL: `d_o` (0,0) = 100, expected 101 | pass | | `…_sampler_bias` | FAIL: `d_o` (0,0) = 100, expected 101 | pass | | `…_without_a_mip_filter`, `gpu_image_sample_c_b_d_offset_moves_by_the_mip_read` | pass | pass | | the other four | pass | pass | The two review tests that pass with `main`'s `emit.rs` read mip 0 in the cases they check, which is the mip `main` already uses, so they guard the new code rather than show a bug on `main`. **Not tested:** `287ca93`'s `emit.rs`, AMD / Intel, release, a title. _Run and written with Claude Code (Claude Opus 5.5)._
Author
Owner

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

CI checks (Build and test and PR description) are green on 227a60a.

Remaining before merge: an independent AMD GPU pass on the current revised head 227a60a.

**@⁠raylitebull** on GitHub · 2026-11-25 01:08 UTC · [original](https://github.com/xcl-dev/xcl/pull/247#issuecomment-7149242718) CI checks (`Build and test` and `PR description`) are green on `227a60a`. **Remaining before merge:** an independent **AMD** GPU pass on the current revised head `227a60a`.
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-25 01:10 UTC · original

Thanks, @⁠raylitebull. An AMD pass on the current head 227a60a is the one missing piece. We have no AMD card here, so this needs someone who does. @⁠srcamarda and @⁠DarkPanda69, you've run AMD passes on related heads before. If either of you has time:

git fetch https://github.com/xcl-dev/xcl.git pull/247/head && git checkout FETCH_HEAD
cargo test --release -p xcl --lib -- --test-threads=4

Please post the passed, failed and ignored counts, any SKIPPED lines, and your GPU, driver and DXC version.

AI use: Claude Code (Claude Opus 5.5) wrote this.

**@⁠Kalmarv** on GitHub · 2026-11-25 01:10 UTC · [original](https://github.com/xcl-dev/xcl/pull/247#issuecomment-7149282285) Thanks, @⁠raylitebull. An AMD pass on the current head `227a60a` is the one missing piece. We have no AMD card here, so this needs someone who does. @⁠srcamarda and @⁠DarkPanda69, you've run AMD passes on related heads before. If either of you has time: ~~~ git fetch https://github.com/xcl-dev/xcl.git pull/247/head && git checkout FETCH_HEAD cargo test --release -p xcl --lib -- --test-threads=4 ~~~ Please post the passed, failed and ignored counts, any SKIPPED lines, and your GPU, driver and DXC version. AI use: Claude Code (Claude Opus 5.5) wrote this.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 15:16 UTC · original

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

  • cargo test -p xcl --lib: 1038 passed, 1 failed in one parallel run; the failing test passes on a single-threaded rerun (1039/0). Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-25 15:16 UTC · [original](https://github.com/xcl-dev/xcl/pull/247#issuecomment-7166587217) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: 1038 passed, 1 failed in one parallel run; the failing test passes on a single-threaded rerun (1039/0). Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun. Thanks!
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-26 08:49 UTC · original

NVIDIA and AMD full-suite run, to go with the reports above by PHeitor1, since none of them covers AMD. Tested exact head 227a60a9 (on its base 9e3831e).

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: 784 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_image_sample_offset_point_mip, gpu_ps_image_sample_offset_bias_lod, gpu_ps_image_sample_offset_bias_lod_magnified, gpu_ps_image_sample_offset_gradient_lod, gpu_ps_image_sample_offset_compare_lod, gpu_ps_image_sample_offset_without_a_mip_filter, gpu_ps_image_sample_offset_resource_min_lod, gpu_ps_image_sample_offset_sampler_bias, gpu_image_sample_c_b_d_offset_moves_by_the_mip_read.
  • 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: 785 passed, 0 failed, 41 ignored. SKIPPED: heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • --skip leaves out tests that fail on main b49be183 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.
**@⁠futurepro62** on GitHub · 2026-11-26 08:49 UTC · [original](https://github.com/xcl-dev/xcl/pull/247#issuecomment-7187072023) NVIDIA and AMD full-suite run, to go with the reports above by PHeitor1, since none of them covers AMD. Tested exact head `227a60a9` (on its base `9e3831e`). **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`: **784 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_image_sample_offset_point_mip`, `gpu_ps_image_sample_offset_bias_lod`, `gpu_ps_image_sample_offset_bias_lod_magnified`, `gpu_ps_image_sample_offset_gradient_lod`, `gpu_ps_image_sample_offset_compare_lod`, `gpu_ps_image_sample_offset_without_a_mip_filter`, `gpu_ps_image_sample_offset_resource_min_lod`, `gpu_ps_image_sample_offset_sampler_bias`, `gpu_image_sample_c_b_d_offset_moves_by_the_mip_read`. - 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`: **785 passed, 0 failed, 41 ignored**. SKIPPED: `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). - `--skip` leaves out tests that fail on main `b49be183` 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://git.gtahub.st/github/xcl-dev--xcl/issues/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.
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-26 08:51 UTC · original

@⁠futurepro62 thank you. That's the first AMD run of this exact head, on the RDNA2 iGPU, and with the 5070 Ti run it's in the description under Tested with your name.

On the --skip list: at 227a60a (base 9e3831e) only heap_window_out_of_memory_falls_back_to_the_switch_form exists. It isn't this PR's, and the iGPU run printed it as SKIPPED (no heap windows), so it ran on neither card. The other seven filters name tests that reached main after this PR's base, so they matched nothing here, and none of this PR's own tests was skipped.

AI use: Claude Code (Claude Opus 5.5) checked the skip list against the head and wrote this.

**@⁠Kalmarv** on GitHub · 2026-11-26 08:51 UTC · [original](https://github.com/xcl-dev/xcl/pull/247#issuecomment-7187112344) @⁠futurepro62 thank you. That's the first AMD run of this exact head, on the RDNA2 iGPU, and with the 5070 Ti run it's in the description under **Tested** with your name. On the `--skip` list: at `227a60a` (base `9e3831e`) only `heap_window_out_of_memory_falls_back_to_the_switch_form` exists. It isn't this PR's, and the iGPU run printed it as SKIPPED (no heap windows), so it ran on neither card. The other seven filters name tests that reached `main` after this PR's base, so they matched nothing here, and none of this PR's own tests was skipped. AI use: Claude Code (Claude Opus 5.5) checked the skip list against the head and wrote this.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

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

Merge

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