Direct DXIL: MSAA loads clamp out-of-range sample indices before loading #1908

Open
github-bot wants to merge 2 commits from github-bot/gh-1908 into main AGit
Owner

@⁠bmjask on GitHub · 2026-11-24 22:59 UTC · original
bmjask:fix/msaa-sample-clamp-main → main · +16 −8 · 2 files · 2 commits · open

Follow-up to #1679.

What is in it

  • Direct DXIL MSAA image loads now clamp an out-of-range sample index to sample 0 before the load. The result for such indices is still zeroed afterwards, so visible behavior for valid indices is unchanged, but the load itself never addresses a sample past the texture's count.
  • Based on main after #1900 and keeps its ordering: the sample count (getDimensions) is read in its own block, and the clamped textureLoads start a new block, so no textureLoad follows getDimensions in one basic block. direct_msaa_loads_precede_get_dimensions still passes.
  • TRANSLATOR_VERSION 7 -> 8 so cached direct containers re-key.
  • Patch as suggested by @⁠imnicho in the #1679 review. Thanks!

Tested

  • RTX 4090, Windows 11, Rust stable
  • cargo test -p xcl --lib msaa -- --include-ignored: 6 passed, incl. gpu_direct_msaa_image_loads on the GPU and direct_msaa_loads_precede_get_dimensions
  • cargo test -p xcl --lib gpu::dxil: 101 passed, 0 failed, 3 ignored
  • XCL_DIRECT_DXIL=1 cargo test -p xcl --lib gpu::recomp: 261 passed, 0 failed, 18 ignored
  • cargo build --workspace and cargo test --workspace -- --test-threads=4: 0 failed (xcl lib: 927 passed, 25 ignored)

Regression run
scripts/smoke.ps1, 60 s, XCL_PRESS_AT=2:B,4:B,6:B,8:B XCL_PRESS_A_AT=10,15,20,25,30,40 (B presses at 2/4/6/8 s, A presses at 10/15/20/25/30/40 s), run back to back. main is a release build of origin/main (20cf130); PR is a release build of the head (215528e). Each block comes from its own checkout's scripts/smoke.ps1.

main:

xcl-smoke v1
commit: 20cf13022f764208384c610c2ae6a3f4eed201a2
gpu: NVIDIA GeForce RTX 4090
title: 6ca5cab7
seconds: 60
exit: 0x0
frames shown: 1139 (PresentX 1139)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 18898 MB

PR:

xcl-smoke v1
commit: 215528eefe24c75cd336197e909393749fc15220
gpu: NVIDIA GeForce RTX 4090
title: 6ca5cab7
seconds: 60
exit: 0x0
frames shown: 1227 (PresentX 1228)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 18919 MB

Not tested

  • AMD (verification pending; the #1679 reporters are asked to re-test)

AI use

  • Claude Code (Claude Opus 5.5): applied the reviewer's patch on current main, ran tests and smoke, wrote this description

🤖 Generated with Claude Code

**@⁠bmjask** on GitHub · 2026-11-24 22:59 UTC · [original](https://github.com/xcl-dev/xcl/pull/1908) `bmjask:fix/msaa-sample-clamp-main` → `main` · +16 −8 · 2 files · 2 commits · open Follow-up to #1679. **What is in it** - Direct DXIL MSAA image loads now clamp an out-of-range sample index to sample 0 before the load. The result for such indices is still zeroed afterwards, so visible behavior for valid indices is unchanged, but the load itself never addresses a sample past the texture's count. - Based on main after #1900 and keeps its ordering: the sample count (`getDimensions`) is read in its own block, and the clamped `textureLoad`s start a new block, so no `textureLoad` follows `getDimensions` in one basic block. `direct_msaa_loads_precede_get_dimensions` still passes. - `TRANSLATOR_VERSION` 7 -> 8 so cached direct containers re-key. - Patch as suggested by @⁠imnicho in the #1679 review. Thanks! **Tested** - RTX 4090, Windows 11, Rust stable - `cargo test -p xcl --lib msaa -- --include-ignored`: 6 passed, incl. `gpu_direct_msaa_image_loads` on the GPU and `direct_msaa_loads_precede_get_dimensions` - `cargo test -p xcl --lib gpu::dxil`: 101 passed, 0 failed, 3 ignored - `XCL_DIRECT_DXIL=1 cargo test -p xcl --lib gpu::recomp`: 261 passed, 0 failed, 18 ignored - `cargo build --workspace` and `cargo test --workspace -- --test-threads=4`: 0 failed (xcl lib: 927 passed, 25 ignored) **Regression run** `scripts/smoke.ps1`, 60 s, `XCL_PRESS_AT=2:B,4:B,6:B,8:B XCL_PRESS_A_AT=10,15,20,25,30,40` (B presses at 2/4/6/8 s, A presses at 10/15/20/25/30/40 s), run back to back. main is a release build of origin/main (20cf130); PR is a release build of the head (215528e). Each block comes from its own checkout's `scripts/smoke.ps1`. main: ``` xcl-smoke v1 commit: 20cf13022f764208384c610c2ae6a3f4eed201a2 gpu: NVIDIA GeForce RTX 4090 title: 6ca5cab7 seconds: 60 exit: 0x0 frames shown: 1139 (PresentX 1139) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 18898 MB ``` PR: ``` xcl-smoke v1 commit: 215528eefe24c75cd336197e909393749fc15220 gpu: NVIDIA GeForce RTX 4090 title: 6ca5cab7 seconds: 60 exit: 0x0 frames shown: 1227 (PresentX 1228) presents per 2 s (last 3): 61 60 60 device removals: 0 crashes: 0 peak commit: 18919 MB ``` **Not tested** - AMD (verification pending; the #1679 reporters are asked to re-test) **AI use** - Claude Code (Claude Opus 5.5): applied the reviewer's patch on current main, ran tests and smoke, wrote this description 🤖 Generated with [Claude Code](https://claude.com/claude-code)
image_msaa_load / image_load on MSAA resources issued Texture2DMS.Load with
sample indices at or past the resource's count and only zeroed the result
afterwards. An out-of-range ld2dms index is undefined, and RDNA4 faults on it
(gpu_direct_msaa_image_loads, STATUS_ACCESS_VIOLATION on RX 9070 / 9070 XT).
The load now takes sample 0 for those lanes; the result mask is unchanged.
Patch as suggested by imnicho in review. TRANSLATOR_VERSION 7 -> 8.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Keeps #1900's ordering: the sample count is read in its own block and the
clamped loads start a new block, so no textureLoad follows getDimensions in
one basic block.

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

@⁠HKEY-Funk-Machine on GitHub · 2026-11-24 23:09 UTC · original

@⁠bmjask @⁠imnicho retested as asked: on the RX 9070, gpu_direct_msaa_image_loads still ends the process with 0xc0000005 on #1908 at b5cfa8c. It's the same as on 758e341, in debug and in release. I also split the test to find which instruction does it: every load from a multisampled texture crashes, including a plain IMAGE_LOAD with an in-range sample index. So the out-of-range clamp can't be the fix on this card.

The test's program reduced to one MIMG instruction at a time (local change only: S_ENDPGM after the one instruction, same T#s and VGPRs as the test):

# instruction result
0 IMAGE_LOAD 2D MSAA, DMASK 0xF (sample = fragment 0..3, count 4) 0xc0000005
1 IMAGE_MSAA_LOAD 2D MSAA 0xc0000005
2 IMAGE_GET_RESINFO 2D MSAA passes
3 IMAGE_LOAD 2D MSAA array, DMASK 0x1 (sample 0..1, count 2) 0xc0000005
4 IMAGE_MSAA_LOAD 2D MSAA array 0xc0000005
5 IMAGE_GET_RESINFO 2D MSAA array passes
6 IMAGE_MSAA_LOAD D16 0xc0000005

In every crashing case, translation and check() (validation) finish, and the access violation comes inside runner::run_with_statics, so at pipeline creation or dispatch. The size queries on the same two textures (same descriptors) run fine. So it looks like the direct path's Texture2DMS / Texture2DMSArray load itself (dx.op.textureLoad with a sample index) that the AMD driver doesn't take. It doesn't look like texture creation or binding. A compare that might help: the same multisampled load through the HLSL path on this card, to see whether DXC's form of Texture2DMS.Load differs from ours (the sample-index operand, or the offsets / unused coordinate). I haven't done that.

Tested

  • Clean PR head b5cfa8c (on main 689f2db). XCL_REQUIRE_GPU=1 cargo test -p xcl --lib gpu::dxil::msaa_tests -- --test-threads=1: direct_msaa_store_is_rejected ... ok, gpu_direct_msaa_image_loads exits 0xc0000005. Release, the test alone: same.
  • The per-instruction table: the same test with a local, uncommitted change that keeps only one MIMG instruction, debug.
  • AMD Radeon RX 9070 (RDNA4, native wave64), driver 32.0.32015.7029, Ryzen 9 7945HX3D, 32 GB, Windows 11 Pro 26300, Rust 1.100.0, DXC 1.9.2602.17.

Not tested: which module faults (no dump), pipeline creation vs dispatch, the HLSL-path compare above, other AMD generations.

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

**@⁠HKEY-Funk-Machine** on GitHub · 2026-11-24 23:09 UTC · [original](https://github.com/xcl-dev/xcl/pull/1908#issuecomment-7147080319) @⁠bmjask @⁠imnicho retested as asked: **on the RX 9070, `gpu_direct_msaa_image_loads` still ends the process with `0xc0000005` on #1908 at `b5cfa8c`.** It's the same as on `758e341`, in debug and in release. I also split the test to find which instruction does it: **every load from a multisampled texture crashes, including a plain `IMAGE_LOAD` with an in-range sample index.** So the out-of-range clamp can't be the fix on this card. The test's program reduced to one MIMG instruction at a time (local change only: `S_ENDPGM` after the one instruction, same T#s and VGPRs as the test): | # | instruction | result | |---|---|---| | 0 | `IMAGE_LOAD` 2D MSAA, DMASK 0xF (sample = fragment 0..3, count 4) | `0xc0000005` | | 1 | `IMAGE_MSAA_LOAD` 2D MSAA | `0xc0000005` | | 2 | `IMAGE_GET_RESINFO` 2D MSAA | passes | | 3 | `IMAGE_LOAD` 2D MSAA array, DMASK 0x1 (sample 0..1, count 2) | `0xc0000005` | | 4 | `IMAGE_MSAA_LOAD` 2D MSAA array | `0xc0000005` | | 5 | `IMAGE_GET_RESINFO` 2D MSAA array | passes | | 6 | `IMAGE_MSAA_LOAD` D16 | `0xc0000005` | In every crashing case, translation and `check()` (validation) finish, and the access violation comes inside `runner::run_with_statics`, so at pipeline creation or dispatch. The size queries on the same two textures (same descriptors) run fine. So it looks like the direct path's `Texture2DMS` / `Texture2DMSArray` load itself (`dx.op.textureLoad` with a sample index) that the AMD driver doesn't take. It doesn't look like texture creation or binding. A compare that might help: the same multisampled load through the HLSL path on this card, to see whether DXC's form of `Texture2DMS.Load` differs from ours (the sample-index operand, or the offsets / unused coordinate). I haven't done that. **Tested** - Clean PR head `b5cfa8c` (on `main` `689f2db`). `XCL_REQUIRE_GPU=1 cargo test -p xcl --lib gpu::dxil::msaa_tests -- --test-threads=1`: `direct_msaa_store_is_rejected ... ok`, `gpu_direct_msaa_image_loads` exits `0xc0000005`. Release, the test alone: same. - The per-instruction table: the same test with a local, uncommitted change that keeps only one MIMG instruction, debug. - AMD Radeon RX 9070 (RDNA4, native wave64), driver 32.0.32015.7029, Ryzen 9 7945HX3D, 32 GB, Windows 11 Pro 26300, Rust 1.100.0, DXC 1.9.2602.17. **Not tested:** which module faults (no dump), pipeline creation vs dispatch, the HLSL-path compare above, other AMD generations. AI use: Claude Code (Claude Opus 5.5) ran the tests, made the local bisect change and wrote this comment.
Author
Owner

@⁠imnicho on GitHub · 2026-11-24 23:09 UTC · original

@⁠HKEY-Funk-Machine thank you for the retest and for splitting the program - that settles it. @⁠bmjask the patch I suggested on #1679 does not fix the crash, and my heads-up there that main "will still crash" for want of it had the cause wrong. #1900 (merged at 23:08 UTC) has it: AMD's compiler fails when dx.op.getDimensions comes before dx.op.textureLoad on a dynamically indexed heap Texture2DMS in the same block, whatever the sample index.

Two consequences for this PR:

  • It now conflicts with #1900 in mimg_msaa, and the two changes pull in opposite directions: the clamp needs the sample count before the load, which is exactly the getDimensions in front of textureLoad that #1900 moved away. A plain rebase that keeps the clamp would bring the access violation back on the RDNA4 cards (the new direct_msaa_loads_precede_get_dimensions test on main should catch that).
  • What is left of the patch is hardening against an out-of-range sample index, which D3D leaves undefined but which no card in these threads has shown to misbehave (the test passes with and without the clamp on my RTX 5080, and on main after #1900 on the RX 9070 XT). If you still want it, the count would have to come from a block before the one with the loads (#1900 lists "different blocks" as not crashing). Otherwise I would close this one; sorry for the detour.

Not tested: anything on AMD (I have no such card); the "different blocks" form is taken from #1900's description, not run by me.

AI use: Claude Code with Claude Fable 5.2 read #1900 and this thread and wrote this comment.

**@⁠imnicho** on GitHub · 2026-11-24 23:09 UTC · [original](https://github.com/xcl-dev/xcl/pull/1908#issuecomment-7147086980) @⁠HKEY-Funk-Machine thank you for the retest and for splitting the program - that settles it. @⁠bmjask the patch I suggested on #1679 does not fix the crash, and my heads-up there that `main` "will still crash" for want of it had the cause wrong. #1900 (merged at 23:08 UTC) has it: AMD's compiler fails when `dx.op.getDimensions` comes before `dx.op.textureLoad` on a dynamically indexed heap `Texture2DMS` in the same block, whatever the sample index. Two consequences for this PR: - It now conflicts with #1900 in `mimg_msaa`, and the two changes pull in opposite directions: the clamp needs the sample count before the load, which is exactly the `getDimensions` in front of `textureLoad` that #1900 moved away. A plain rebase that keeps the clamp would bring the access violation back on the RDNA4 cards (the new `direct_msaa_loads_precede_get_dimensions` test on `main` should catch that). - What is left of the patch is hardening against an out-of-range sample index, which D3D leaves undefined but which no card in these threads has shown to misbehave (the test passes with and without the clamp on my RTX 5080, and on `main` after #1900 on the RX 9070 XT). If you still want it, the count would have to come from a block before the one with the loads (#1900 lists "different blocks" as not crashing). Otherwise I would close this one; sorry for the detour. Not tested: anything on AMD (I have no such card); the "different blocks" form is taken from #1900's description, not run by me. AI use: Claude Code with Claude Fable 5.2 read #1900 and this thread and wrote this comment.
Author
Owner

@⁠HKEY-Funk-Machine on GitHub · 2026-11-24 23:10 UTC · original

Update: on main 20cf130 (with #1900), msaa_tests passes on the RX 9070: 5 passed, 0 failed, including gpu_direct_msaa_image_loads (debug, XCL_REQUIRE_GPU=1 cargo test -p xcl --lib gpu::dxil::msaa_tests -- --test-threads=1). That fits #1900's root cause (getDimensions before textureLoad in one block), and the single-instruction loads above likely still emitted the sample-count query. So #1908's clamp isn't needed for the crash here.

AI use: Claude Code (Claude Opus 5.5) ran the test and wrote this comment.

**@⁠HKEY-Funk-Machine** on GitHub · 2026-11-24 23:10 UTC · [original](https://github.com/xcl-dev/xcl/pull/1908#issuecomment-7147102550) Update: on `main` `20cf130` (with #1900), `msaa_tests` passes on the RX 9070: 5 passed, 0 failed, including `gpu_direct_msaa_image_loads` (debug, `XCL_REQUIRE_GPU=1 cargo test -p xcl --lib gpu::dxil::msaa_tests -- --test-threads=1`). That fits #1900's root cause (`getDimensions` before `textureLoad` in one block), and the single-instruction loads above likely still emitted the sample-count query. So #1908's clamp isn't needed for the crash here. AI use: Claude Code (Claude Opus 5.5) ran the test and wrote this comment.
Author
Owner

@⁠eizispark on GitHub · 2026-11-24 23:10 UTC · original · edited 2026-11-24 23:42 UTC

Hardware test report — commit 215528e

Re-verified 215528eefe24c75cd336197e909393749fc15220 (rebased onto main 20cf13022f764208384c610c2ae6a3f4eed201a2): pass — splitting dx.op.getDimensions into its own block before br(loads_block) avoids the amdxc64.dll 0xc0000005 crash on AMD RDNA4 while clamping out-of-range MSAA sample indices (gpu_direct_msaa_image_loads and direct_msaa_loads_precede_get_dimensions both pass).

Tested

  • Hardware: Windows 11 x64, AMD Ryzen 7 9800X3D, AMD Radeon RX 9070 XT (RDNA4, native wave32 + wave64, driver 32.0.32015.16001), 32 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09) (stable-x86_64-pc-windows-msvc), debug tests + release smoke
  • cargo test -p xcl --lib msaa -- --include-ignored --test-threads=1: 6 passed, 0 failed, 0 ignored (0 skipped: gpu::dxil::msaa_tests::gpu_direct_msaa_image_loads, direct_msaa_loads_precede_get_dimensions, msaa_texture_ops_run, render_target_sample_ops_validate, direct_msaa_store_is_rejected, and hle::d3d12x::vram::tests::reserved_needs_tiled_format_and_tiled_msaa)
  • Unfiltered cargo test --workspace --no-fail-fast -- --test-threads=4: 974 passed, 2 failed, 45 ignored (8 skipped), matching main 20cf130 (0 new failures; the 2 failures are the pre-existing #1679 AMD fuzz seeds gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1 and fuzz_validate_and_gpu_3; 8 skipped = 6 lower_dxil f16/f32 #1426-semantics sub-cases, pso_measurement_compiles_an_exact_synthetic_record 0x887A002D, and heap_window_out_of_memory_falls_back_to_the_switch_form)
  • XCL_DIRECT_DXIL=1 cargo test -p xcl --lib gpu::recomp -- --test-threads=4: 261 passed, 0 failed, 18 ignored (6 skipped)

Regression run
main (20cf13022f764208384c610c2ae6a3f4eed201a2):

xcl-smoke v1
commit: 20cf13022f764208384c610c2ae6a3f4eed201a2
gpu: AMD Radeon RX 9070 XT
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1678 (PresentX 1678)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14859 MB

PR (215528eefe24c75cd336197e909393749fc15220):

xcl-smoke v1
commit: 215528eefe24c75cd336197e909393749fc15220
gpu: AMD Radeon RX 9070 XT
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1679 (PresentX 1679)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14858 MB

Not tested

  • retail run with XCL_SHADER_BACKEND=dxil / XCL_DIRECT_DXIL=1, NVIDIA/Intel GPUs, Wine/vkd3d-proton, gameplay past the menus

AI use

  • Antigravity (Google DeepMind, Gemini 4 Carbon) ran the MSAA tests, workspace test suite, and 60-second retail smoke pair and updated this report.

(Updated from earlier check on b5cfa8c)

**@⁠eizispark** on GitHub · 2026-11-24 23:10 UTC · [original](https://github.com/xcl-dev/xcl/pull/1908#issuecomment-7147099872) · edited 2026-11-24 23:42 UTC ### Hardware test report — commit `215528e` Re-verified `215528eefe24c75cd336197e909393749fc15220` (rebased onto `main` `20cf13022f764208384c610c2ae6a3f4eed201a2`): **pass** — splitting `dx.op.getDimensions` into its own block before `br(loads_block)` avoids the `amdxc64.dll` `0xc0000005` crash on AMD RDNA4 while clamping out-of-range MSAA sample indices (`gpu_direct_msaa_image_loads` and `direct_msaa_loads_precede_get_dimensions` both pass). **Tested** - Hardware: Windows 11 x64, AMD Ryzen 7 9800X3D, AMD Radeon RX 9070 XT (RDNA4, native wave32 + wave64, driver `32.0.32015.16001`), 32 GB RAM, `rustc 1.100.0 (0ef1bc386 2026-11-09)` (`stable-x86_64-pc-windows-msvc`), debug tests + release smoke - `cargo test -p xcl --lib msaa -- --include-ignored --test-threads=1`: `6 passed, 0 failed, 0 ignored` (`0 skipped`: `gpu::dxil::msaa_tests::gpu_direct_msaa_image_loads`, `direct_msaa_loads_precede_get_dimensions`, `msaa_texture_ops_run`, `render_target_sample_ops_validate`, `direct_msaa_store_is_rejected`, and `hle::d3d12x::vram::tests::reserved_needs_tiled_format_and_tiled_msaa`) - Unfiltered `cargo test --workspace --no-fail-fast -- --test-threads=4`: `974 passed, 2 failed, 45 ignored` (`8 skipped`), matching `main` `20cf130` (`0` new failures; the 2 failures are the pre-existing `#1679` AMD fuzz seeds `gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1` and `fuzz_validate_and_gpu_3`; `8 skipped` = 6 `lower_dxil` f16/f32 `#1426`-semantics sub-cases, `pso_measurement_compiles_an_exact_synthetic_record` `0x887A002D`, and `heap_window_out_of_memory_falls_back_to_the_switch_form`) - `XCL_DIRECT_DXIL=1 cargo test -p xcl --lib gpu::recomp -- --test-threads=4`: `261 passed, 0 failed, 18 ignored` (`6 skipped`) **Regression run** `main` (`20cf13022f764208384c610c2ae6a3f4eed201a2`): ``` xcl-smoke v1 commit: 20cf13022f764208384c610c2ae6a3f4eed201a2 gpu: AMD Radeon RX 9070 XT title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1678 (PresentX 1678) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14859 MB ``` PR (`215528eefe24c75cd336197e909393749fc15220`): ``` xcl-smoke v1 commit: 215528eefe24c75cd336197e909393749fc15220 gpu: AMD Radeon RX 9070 XT title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1679 (PresentX 1679) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14858 MB ``` **Not tested** - retail run with `XCL_SHADER_BACKEND=dxil` / `XCL_DIRECT_DXIL=1`, NVIDIA/Intel GPUs, Wine/vkd3d-proton, gameplay past the menus **AI use** - Antigravity (Google DeepMind, Gemini 4 Carbon) ran the MSAA tests, workspace test suite, and 60-second retail smoke pair and updated this report. *(Updated from earlier check on `b5cfa8c`)*
Author
Owner

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

Status check: #1900 (20cf130) already landed the MSAA textureLoad-before-getDimensions ordering fix, #1950 took TRANSLATOR_VERSION = 8, and #1947 now hashes gpu/dxil sources automatically. There is also an open [P3] review note from @⁠lewisnic94-max on cache key safety.

Please let us know whether this PR can be closed as superseded by #1900, or rebased (without the kernel.rs version bump) if there are still separate blocks you want hardened.

**@⁠raylitebull** on GitHub · 2026-11-25 01:08 UTC · [original](https://github.com/xcl-dev/xcl/pull/1908#issuecomment-7149241269) Status check: `#1900` (`20cf130`) already landed the MSAA `textureLoad`-before-`getDimensions` ordering fix, `#1950` took `TRANSLATOR_VERSION = 8`, and `#1947` now hashes `gpu/dxil` sources automatically. There is also an open `[P3]` review note from @⁠lewisnic94-max on cache key safety. Please let us know whether this PR can be closed as superseded by `#1900`, or rebased (without the `kernel.rs` version bump) if there are still separate blocks you want hardened.
Author
Owner

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

Empirical test report — PR #1908 (215528eefe24c75cd336197e909393749fc15220)

  • PR head commit: 215528eefe24c75cd336197e909393749fc15220 (refs/pull/1908/head)
  • origin/main commit: 5796cc467d80e3dac5d7d231ec34f1b0bebce169
  • Merge check (git merge-tree --write-tree origin/main HEAD): clean (exit 0, tree d39b01dfdf46a7ee75a82572dd7e3f94d1dd545b)
  • Diff scope (origin/main...HEAD): crates/xcl/src/gpu/dxil/kernel.rs (+1/-1), crates/xcl/src/gpu/dxil/lower_image.rs (+15/-7)

Tested

  • Hardware & OS: Intel Arc A770 Graphics (16258 MiB VRAM, driver 32.0.101.9175, XCL_ADAPTER=A770, wave32 / 8–32 lanes), AMD Ryzen 7 3800X (6 cores / 12 logical processors), Windows 11 Enterprise Evaluation 10.0.26200 (build 26200)
  • Toolchain & profile: rustc 1.100.0 (0ef1bc386 2026-11-09), cargo 1.100.0 (3acc79c0c 2026-11-05), debug (dev/test) profile, DXC 1.9.2609.5 (01b62ad4) (dxcompiler.dll + dxil.dll)
  • Build: cargo test --workspace --no-run and cargo build --workspace both exited 0.
  • Targeted MSAA / Direct DXIL tests:
    • cargo test -p xcl --lib gpu::dxil::msaa_tests -- --test-threads=4 --show-output: 5 passed, 0 failed, 0 ignored, 0 skipped (all 5 ran on the Arc A770 / validator):
      • gpu::dxil::msaa_tests::direct_msaa_loads_precede_get_dimensions (ok)
      • gpu::dxil::msaa_tests::direct_msaa_store_is_rejected (ok)
      • gpu::dxil::msaa_tests::gpu_direct_msaa_image_loads (ok)
      • gpu::dxil::msaa_tests::msaa_texture_ops_run (ok)
      • gpu::dxil::msaa_tests::render_target_sample_ops_validate (ok)
  • Full workspace suite:
    • cargo test --workspace -- --test-threads=4 --show-output: stopped after xcl --lib (903 passed, 24 failed, 25 ignored, 22 SKIPPED lines)
    • cargo test --workspace --no-fail-fast -- --test-threads=4 --show-output: 951 passed, 25 failed, 45 ignored across all 20 workspace test targets (exit 101):
      • xcl (--lib): 903 passed, 24 failed, 25 ignored
      • tests/e2e.rs: 2 passed, 1 failed, 0 ignored
      • Remaining 18 test targets (src/main.rs, bcpack_parity, console_dlls_e2e, console_shaders, disasm_e2e, gpu_compute_e2e, gpu_pso_e2e, heap_probe, low_va, pls_quota, predication_e2e, rpf_e2e, shaders_e2e, sparse_reinit, texture_states, xg_oracle, xcl-testtitle, doc-tests): 46 passed, 0 failed, 20 ignored
    • Failures (25 total, all Arc A770 / host-specific, none in MSAA):
      • 20× CreateComputePipelineState: The parameter is incorrect. (0x80070057) on Arc A770 (no native FP64 / rejected shader ops): gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_{0,1,2,3}, gpu::dxil::ops_tests::{doubles_match_cpu,groupshared_barrier_and_atomics_run}, gpu::dxil::round_tests::{gpu_direct_f32_round_modes_dynamic_and_denormals,gpu_direct_f32_round_modes_static}, gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu, gpu::recomp::tests::{gpu_clamp_and_omod_per_instruction,gpu_f64_class_compare,gpu_f64_compares_with_nan,gpu_f64_literal_high_word,gpu_f64_math_random,gpu_f64_roots,gpu_f64_rounding_and_conversions,gpu_float_compares_random,gpu_frexp_f64_exp_and_mant,gpu_ldexp_f64,gpu_rndne_f64}
      • 4× Arc A770 shader/driver value differences: gpu::recomp::tests::gpu_nonfused_mad_and_mac_prevent_fma_contraction, gpu::recomp::tests::gpu_ps_image_sample_offset_implicit_lod_between_mips, gpu::recomp::tests::gpu_valu_16_and_64_bit, gpu::recomp::tests::gpu_wave64_ps_whole_wave_reductions
      • 1× tests/e2e.rs (test_title_runs_and_game_folder_is_untouched): D3D12.X: dynamic depth bias via RSSetDepthBiasX (#94) (top-right [0, 0, 255, 255], expected green)
  • SKIPPED GPU tests (25 SKIPPED lines across 15 distinct tests — reported ok by Cargo, not counted as coverage):
    • no wave64 (18 lines across 10 tests): gpu::recomp::lower::tests::{a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu,coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu,cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu,the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu}, gpu::recomp::lower_dxil::tests::{a_per_lane_2d_or_3d_group_runs_on_the_gpu,f16_programs_on_the_gpu (2),f32_programs_on_the_gpu (6),integer_programs_on_the_gpu (2)}, gpu::recomp::tests::{gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware}
    • wave32, per-lane form: refused (#1426 semantics, 3 sub-cases inside 2 tests above): gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu (V_MUL_F16, V_PK_MUL_F16: VOP3 modifiers), gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu (V_CVT_F16_F32)
    • Host / adapter feature skips (5 tests):
      • shaders::tests::pso_measurement_compiles_an_exact_synthetic_record: cannot disable driver cache (Windows Developer Mode required, 0x887A002D)
      • placed_title_textures_share_vram_and_preserve_pixels: tiled tier < 2
      • test_title_draws_with_a_root_signature_under_the_debug_layer: no d3d12SDKLayers.dll
      • heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows
      • uploads_start_from_each_subresources_state: no D3D12 debug layer (0x887A002D)

Not tested

  • AMD GPUs (in particular RDNA4 out-of-range ld2dms fault behavior and amdxc64.dll basic-block compilation) and NVIDIA GPUs
  • Native wave64 hardware (all wave64-only GPU test cases skipped on Arc A770)
  • Retail title / scripts/smoke.ps1 regression run (no retail game package on this test host)
  • D3D12 debug-layer, Windows Developer Mode driver-cache, tiled tier 2, and heap-window test paths (skipped on this host)
  • Release build profile

AI use

  • T3 Code / Antigravity (gemini-4-neon) checked out PR #1908, built the workspace, ran the targeted and full-workspace test suites on the Intel Arc A770 host above, parsed the logs, and posted this test report.
**@⁠JJAutoCompare** on GitHub · 2026-11-25 01:22 UTC · [original](https://github.com/xcl-dev/xcl/pull/1908#issuecomment-7149478947) ### Empirical test report — PR #1908 (`215528eefe24c75cd336197e909393749fc15220`) - **PR head commit:** `215528eefe24c75cd336197e909393749fc15220` (`refs/pull/1908/head`) - **`origin/main` commit:** `5796cc467d80e3dac5d7d231ec34f1b0bebce169` - **Merge check (`git merge-tree --write-tree origin/main HEAD`):** clean (exit `0`, tree `d39b01dfdf46a7ee75a82572dd7e3f94d1dd545b`) - **Diff scope (`origin/main...HEAD`):** `crates/xcl/src/gpu/dxil/kernel.rs` (+1/-1), `crates/xcl/src/gpu/dxil/lower_image.rs` (+15/-7) **Tested** - **Hardware & OS:** Intel Arc A770 Graphics (`16258 MiB` VRAM, driver `32.0.101.9175`, `XCL_ADAPTER=A770`, wave32 / 8–32 lanes), AMD Ryzen 7 3800X (6 cores / 12 logical processors), Windows 11 Enterprise Evaluation `10.0.26200` (build `26200`) - **Toolchain & profile:** `rustc 1.100.0 (0ef1bc386 2026-11-09)`, `cargo 1.100.0 (3acc79c0c 2026-11-05)`, debug (`dev`/`test`) profile, DXC `1.9.2609.5 (01b62ad4)` (`dxcompiler.dll` + `dxil.dll`) - **Build:** `cargo test --workspace --no-run` and `cargo build --workspace` both exited `0`. - **Targeted MSAA / Direct DXIL tests:** - `cargo test -p xcl --lib gpu::dxil::msaa_tests -- --test-threads=4 --show-output`: **5 passed, 0 failed, 0 ignored, 0 skipped** (all 5 ran on the Arc A770 / validator): - `gpu::dxil::msaa_tests::direct_msaa_loads_precede_get_dimensions` (ok) - `gpu::dxil::msaa_tests::direct_msaa_store_is_rejected` (ok) - `gpu::dxil::msaa_tests::gpu_direct_msaa_image_loads` (ok) - `gpu::dxil::msaa_tests::msaa_texture_ops_run` (ok) - `gpu::dxil::msaa_tests::render_target_sample_ops_validate` (ok) - **Full workspace suite:** - `cargo test --workspace -- --test-threads=4 --show-output`: stopped after `xcl --lib` (`903 passed, 24 failed, 25 ignored`, 22 `SKIPPED` lines) - `cargo test --workspace --no-fail-fast -- --test-threads=4 --show-output`: **951 passed, 25 failed, 45 ignored** across all 20 workspace test targets (exit `101`): - `xcl` (`--lib`): 903 passed, 24 failed, 25 ignored - `tests/e2e.rs`: 2 passed, 1 failed, 0 ignored - Remaining 18 test targets (`src/main.rs`, `bcpack_parity`, `console_dlls_e2e`, `console_shaders`, `disasm_e2e`, `gpu_compute_e2e`, `gpu_pso_e2e`, `heap_probe`, `low_va`, `pls_quota`, `predication_e2e`, `rpf_e2e`, `shaders_e2e`, `sparse_reinit`, `texture_states`, `xg_oracle`, `xcl-testtitle`, doc-tests): 46 passed, 0 failed, 20 ignored - **Failures (25 total, all Arc A770 / host-specific, none in MSAA):** - 20× `CreateComputePipelineState: The parameter is incorrect. (0x80070057)` on Arc A770 (no native FP64 / rejected shader ops): `gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_{0,1,2,3}`, `gpu::dxil::ops_tests::{doubles_match_cpu,groupshared_barrier_and_atomics_run}`, `gpu::dxil::round_tests::{gpu_direct_f32_round_modes_dynamic_and_denormals,gpu_direct_f32_round_modes_static}`, `gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu`, `gpu::recomp::tests::{gpu_clamp_and_omod_per_instruction,gpu_f64_class_compare,gpu_f64_compares_with_nan,gpu_f64_literal_high_word,gpu_f64_math_random,gpu_f64_roots,gpu_f64_rounding_and_conversions,gpu_float_compares_random,gpu_frexp_f64_exp_and_mant,gpu_ldexp_f64,gpu_rndne_f64}` - 4× Arc A770 shader/driver value differences: `gpu::recomp::tests::gpu_nonfused_mad_and_mac_prevent_fma_contraction`, `gpu::recomp::tests::gpu_ps_image_sample_offset_implicit_lod_between_mips`, `gpu::recomp::tests::gpu_valu_16_and_64_bit`, `gpu::recomp::tests::gpu_wave64_ps_whole_wave_reductions` - 1× `tests/e2e.rs` (`test_title_runs_and_game_folder_is_untouched`): `D3D12.X: dynamic depth bias via RSSetDepthBiasX (#94)` (`top-right [0, 0, 255, 255]`, expected green) - **`SKIPPED` GPU tests (25 `SKIPPED` lines across 15 distinct tests — reported `ok` by Cargo, not counted as coverage):** - `no wave64` (18 lines across 10 tests): `gpu::recomp::lower::tests::{a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu,coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu,cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu,the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu}`, `gpu::recomp::lower_dxil::tests::{a_per_lane_2d_or_3d_group_runs_on_the_gpu,f16_programs_on_the_gpu (2),f32_programs_on_the_gpu (6),integer_programs_on_the_gpu (2)}`, `gpu::recomp::tests::{gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware}` - `wave32, per-lane form: refused` (`#1426` semantics, 3 sub-cases inside 2 tests above): `gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu` (`V_MUL_F16`, `V_PK_MUL_F16: VOP3 modifiers`), `gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu` (`V_CVT_F16_F32`) - Host / adapter feature skips (5 tests): - `shaders::tests::pso_measurement_compiles_an_exact_synthetic_record`: cannot disable driver cache (Windows Developer Mode required, `0x887A002D`) - `placed_title_textures_share_vram_and_preserve_pixels`: `tiled tier < 2` - `test_title_draws_with_a_root_signature_under_the_debug_layer`: `no d3d12SDKLayers.dll` - `heap_window_out_of_memory_falls_back_to_the_switch_form`: `no heap windows` - `uploads_start_from_each_subresources_state`: `no D3D12 debug layer (0x887A002D)` **Not tested** - AMD GPUs (in particular RDNA4 out-of-range `ld2dms` fault behavior and `amdxc64.dll` basic-block compilation) and NVIDIA GPUs - Native wave64 hardware (all wave64-only GPU test cases skipped on Arc A770) - Retail title / `scripts/smoke.ps1` regression run (no retail game package on this test host) - D3D12 debug-layer, Windows Developer Mode driver-cache, tiled tier 2, and heap-window test paths (skipped on this host) - Release build profile **AI use** - `T3 Code / Antigravity (gemini-4-neon)` checked out PR #1908, built the workspace, ran the targeted and full-workspace test suites on the Intel Arc A770 host above, parsed the logs, and posted this test report.
Author
Owner

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

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

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

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-25 02:16 UTC · [original](https://github.com/xcl-dev/xcl/pull/1908#issuecomment-7150510850) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
Author
Owner

@⁠lewisnic94-max on GitHub · 2026-11-25 02:27 UTC · original

@⁠raylitebull, I’m withdrawing my P3 cache objection for a rebase onto current main. It reproduced on the standalone 215528e head because the earlier preview and revised emitter both used v8. After #1947 merged, all 12 populated-cache upgrades on b8428c5 returned DXIL byte-for-byte identical to fresh translation. We tested v7 and v8 seeds with both the rounding and MSAA shaders, three runs per combination.

On main cbc296a, applying only the MSAA emitter change altered the direct source fingerprint with TRANSLATOR_VERSION held at 9. I’d drop the kernel.rs bump on rebase.

#1900 addressed the reported RDNA4 instruction-ordering crash. The remaining hardening is a separate decision. Main zeroes the result after the load. #1908 also redirects an out-of-range sample index to 0 before loading, while keeping getDimensions and textureLoad in separate blocks.

OpenAI Codex (GPT-6) assisted with the cache tests, source comparison and this reply.

**@⁠lewisnic94-max** on GitHub · 2026-11-25 02:27 UTC · [original](https://github.com/xcl-dev/xcl/pull/1908#issuecomment-7150743954) @⁠raylitebull, I’m withdrawing my P3 cache objection for a rebase onto current main. It reproduced on the standalone `215528e` head because the earlier preview and revised emitter both used v8. After #1947 merged, all 12 populated-cache upgrades on `b8428c5` returned DXIL byte-for-byte identical to fresh translation. We tested v7 and v8 seeds with both the rounding and MSAA shaders, three runs per combination. On main `cbc296a`, applying only the MSAA emitter change altered the direct source fingerprint with `TRANSLATOR_VERSION` held at 9. I’d drop the `kernel.rs` bump on rebase. #1900 addressed the reported RDNA4 instruction-ordering crash. The remaining hardening is a separate decision. Main zeroes the result after the load. #1908 also redirects an out-of-range sample index to 0 before loading, while keeping `getDimensions` and `textureLoad` in separate blocks. OpenAI Codex (GPT-6) assisted with the cache tests, source comparison and this reply.
This pull request has changes conflicting with the target branch.
  • crates/xcl/src/gpu/dxil/kernel.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

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

Merge

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