Skip to content

Direct DXIL: image_get_resinfo of a 1D array gives the layers in y - #2046

Merged
raylitebull merged 1 commit into
xcl-dev:mainfrom
upipibi:fix/direct-resinfo-1d-array
Nov 25, 2026
Merged

raylitebull merged 1 commit into
xcl-dev:mainfrom
upipibi:fix/direct-resinfo-1d-array

Conversation

@upipibi

@upipibi upipibi commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

image_get_resinfo of a 1D array (DIM 4) in the direct translator went through the catch-all arm. That arm puts the layer count in z and 1 in y. RDNA gives the layers in y, which the HLSL path has done since #1266 (cafda82). So gpu_image_get_resinfo_1d_array, added by #1266, fails on main with XCL_DIRECT_DXIL=1:

assertion `left == right` failed: lane 0 resinfo (w, layers, mips)
  left: [4, 1, 1]
 right: [4, 3, 1]

That's not new with #1874: it fails the same way at fb32c87.

What is in it

  • crates/xcl/src/gpu/dxil/lower_image.rs: a DIM 4 arm, (width, layers, layers, mips), matching the HLSL path's {t}_d = {t}_h.

Tested

Regression run
Run by Toons29 on an AMD Radeon RX 9070 (comment), main and this head, pasted unedited:

xcl-smoke v1
commit: 568e7db7729c8fa6c8f0f4b32d798faaf11462bb
gpu: AMD Radeon RX 9070
title: 34df7c50
seconds: 60
exit: 0x0
frames shown: 1566 (PresentX 1566)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14592 MB
xcl-smoke v1
commit: f884dc52d76f8e12c1f332dde4cf3b99c5b90ef4
gpu: AMD Radeon RX 9070
title: 34df7c50
seconds: 60
exit: 0x0
frames shown: 1639 (PresentX 1639)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14767 MB

Not tested

  • AMD, titles.

AI use

  • AI-assisted (Claude Code, Claude Opus 5.5): wrote the change, the tests and this description, and ran the tests above. Synthetic tests only; no game files.

🤖 Generated with Claude Code

The direct translator took a 1D array (DIM 4) through the catch-all arm,
which put the layer count in z and 1 in y. RDNA gives it in y, as the
HLSL path does since xcl-dev#1266 (cafda82), so gpu_image_get_resinfo_1d_array
failed with XCL_DIRECT_DXIL=1 ([4, 1, 1] for [4, 3, 1]).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nnonno91

Copy link
Copy Markdown

Independent AMD verification on head f884dc52d76f8e12c1f332dde4cf3b99c5b90ef4 and its parent c00f3fcfce59bb4dfd3a1f96bbc84c60e765b538. I reproduced the wrong layer count before the fix, including in a separate test of packed 16-bit output.

Tested

  • AMD Radeon(TM) Graphics (driver 32.0.21042.62, native wave64), Ryzen 7 9800X3D, Windows 11 25H2 build 26200.9974, Rust 1.100.0 MSVC and SDK DXC/DXIL 1.8.2502.11, unoptimized test profile. Selected XCL_ADAPTER=AMD Radeon and XCL_REQUIRE_GPU=wave64.
  • Ran cargo test --locked -p xcl --lib resinfo -- --nocapture --test-threads=1 in separate processes with XCL_DIRECT_DXIL=0 and 1. The head passed all 3 tests in each run. On the parent, 0 passed all 3 and 1 gave 2 passed and 1 failed. The direct 1D-array query produced [4, 1, 1] for width, layers and mips instead of [4, 3, 1].
  • I adapted the fixture locally to query an 11-wide, five-layer 1D array with D16=1 and checked both packed words for all 64 lanes. Ran cargo test --locked -p xcl --lib gpu::recomp::tests::local_resinfo_1d_array_d16 -- --exact --nocapture --test-threads=1 with XCL_DIRECT_DXIL=1 on each revision. The parent failed with lane 0 words [0001000b, 00010005]. The head passed with [0005000b, 00010005], which packs width 11, layers 5 in both fields and 1 mip level. The temporary test was removed from both checkouts. All runs had 0 ignored and no skips.

Not tested

Retail smoke, the full workspace suite and other GPUs.

AI use

OpenAI Codex (GPT-6.2 Sol) adapted the extra test, ran the comparisons and wrote this report.

@JJAutoCompare

Copy link
Copy Markdown

Independent Intel Arc A770 verification of #2046 at clean head f884dc52d76f8e12c1f332dde4cf3b99c5b90ef4. The ordinary image_get_resinfo query at mip 0 returned width 4, layer count 3 in y, and mip count 1 on all 64 lanes in both HLSL/DXC and direct DXIL.

Tested

  • Intel Arc A770 (driver 32.0.101.9175), AMD Ryzen 7 3800X, Windows 11 Enterprise Evaluation 25H2 (26200.9974), Rust 1.100.0 (x86_64-pc-windows-msvc), DXC/DXIL 1.9.2609.5, unoptimized test profile.
  • Built outside the Arc mutex with cargo test --locked -p xcl --lib --no-run, using CARGO_BUILD_JOBS=2, CARGO_INCREMENTAL=0, CARGO_PROFILE_DEV_DEBUG=0, and CARGO_PROFILE_TEST_DEBUG=0. CARGO_TARGET_DIR was L:/XclTooling/pr1844-71f2ceb-t3-737e5ee5/target. TMP and TEMP were L:/XclTooling/pr2046/temp.
  • Set XCL_ADAPTER=A770 and XCL_DXC_DIR=%LOCALAPPDATA%/XclTooling/dxc-1.9.2609/bin/x64. Ran the built library test binary in two separate processes under the Arc mutex.
$exe = 'L:\XclTooling\pr1844-71f2ceb-t3-737e5ee5\target\debug\build\xcl\97fdf2b9ff8e1482\out\xcl-97fdf2b9ff8e1482.exe'
$env:XCL_DIRECT_DXIL = '0'
& 'L:/XclTooling/Invoke-ArcTest.ps1' -Test { & $exe resinfo --nocapture --test-threads=1 2>&1 }
$env:XCL_DIRECT_DXIL = '1'
& 'L:/XclTooling/Invoke-ArcTest.ps1' -Test { & $exe resinfo --nocapture --test-threads=1 2>&1 }
  • HLSL/DXC (XCL_DIRECT_DXIL=0) had 3 passed, 0 failed, 0 ignored, and 0 GPU skips. 1090 tests were filtered out.
  • direct DXIL (XCL_DIRECT_DXIL=1) had 3 passed, 0 failed, 0 ignored, and 0 GPU skips. 1090 tests were filtered out.

gpu_image_get_resinfo_1d_array is the GPU test that switches backends. The filter also runs the CPU check for HLSL GetDimensions emission and the direct-only packed 2D/MSAA query test under both settings.

Not tested

Packed D16 1D-array output, the ordinary query’s z output, multiple mip levels or nonzero mip indices, the parent revision, other GPUs, the full workspace suite, and retail-title smoke runs.

AI use

T3 Code / Codex (gpt-6.2-sol) ran the checked-in tests and wrote this report.

@DavidM1911

Copy link
Copy Markdown
Contributor

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

Thanks!

@onlynullpoint

Copy link
Copy Markdown

Test report on f884dc5 applied onto current main 6020a33: RTX 5090 Laptop GPU (Blackwell, 32-lane waves), driver 616.92. gpu_image_get_resinfo_1d_array fails on main with XCL_DIRECT_DXIL=1 and passes with this change; the whole suite shows no new failure on either path. The reports so far are AMD, Intel Arc and RTX 30; this adds an RTX 50 card with the direct translator.

Tested

  • NVIDIA GeForce RTX 5090 Laptop GPU 24 GB (32-lane waves), driver 616.92 (32.0.16.1692); Intel Core Ultra 9 275HX; 96 GB RAM; Windows 11 Pro build 26300; rustc 1.99.1 msvc; DXC 1.8.2502.11 (Windows SDK 10.0.26100.0); debug
  • Tree: f884dc5 cherry-picked onto main 6020a33 in a clean worktree (applies cleanly, 1 file, +2)
  • cargo test -p xcl --lib -- resinfo --test-threads=1 with XCL_DIRECT_DXIL=1: on main, 2 passed, 1 failed, gpu_image_get_resinfo_1d_array with left: [4, 1, 1], right: [4, 3, 1]; with the change, 3 passed, 0 failed. Without the variable: 3 passed on both trees
  • cargo test --workspace --no-fail-fast -- --test-threads=4 with the change: 1150 passed, 4 failed, 46 ignored; with XCL_DIRECT_DXIL=1: 1149 passed, 5 failed, 46 ignored. None of them comes from this change: the four fuzz_validate_and_gpu_* are the RTX 50 refusal of DXIL GPU fuzz tests reproducibly fail with E_OUTOFMEMORY on RTX 5060 #1905 (fixed by Recompiler: LDS ds_sub_u32 hides its negation from the driver (RTX 50 refuses it) #1919), the fifth with XCL_DIRECT_DXIL=1 is offline_compute_pipeline_is_reused_by_a_second_process (Tests: offline compute pipeline test finds the driver blob with XCL_D… #1674)
  • SKIPPED, 25 lines in each whole-suite run (default run: 20 no wave64, 3 per-lane form: refused (V_MUL_F16, V_PK_MUL_F16, V_CVT_F16_F32), 1 Developer Mode off, 1 no heap windows)

Not tested

  • the PR head as it is (only applied onto 6020a33), the whole suite on main without the change, release, any smoke pair or title

AI use

  • Claude Code with Claude Opus 5.5 ran the commands in a clean worktree and wrote this report.

@Swagi-REDACTED

Copy link
Copy Markdown

RTX 3060 reproduction and validation report for this exact 1D-array failure.

Hardware: Ryzen 7 9800X3D, RTX 3060 12 GB (driver 621.14), approximately 16 GB RAM, Windows 11 Home 26200. Rust 1.95.0 MSVC; DXC/DXIL 1.9.2602.17.

Before: #2057 reference head f7e08e6c1eb801215dd045cf46dd35631dca0d2c, with an optional local input harness. cargo test --locked -p xcl --lib gpu_image_get_resinfo_1d_array -- --test-threads=1:

  • Direct DXIL off, heap windows off: passes.
  • Direct DXIL off, heap windows on: passes.
  • Direct DXIL on, heap windows off: fails, lane 0 [4, 1, 1] instead of [4, 3, 1].
  • Direct DXIL, heap windows and UMA shadow all on: same failure.

After cherry-picking only f884dc52d76f8e12c1f332dde4cf3b99c5b90ef4 (local head 9b44d4bcb70eb488fac7bb328ca8929918f86dd0): XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_UMA_SHADOW=1 cargo test --locked -p xcl --lib gpu_ -- --test-threads=4 gives 143 passed, 0 failed, 1 ignored, including gpu_image_get_resinfo_1d_array. Two explicit skips: native-wave64 geometry-prefix and wave32-in-wave64-hardware cases. The synthetic test's assertions were unchanged.

This is a local integration report, not a clean main/PR-head test or a title smoke comparison. The local input harness and a separate one-line wrapping-arithmetic correction in #2057's texture-upload test-data generator were also present. No title data is attached; no gameplay claim is made.

AI use: Codex, GPT-6 (exact serving variant not exposed), reproduced the failure, integrated this existing patch, ran the tests and wrote this report. The fix remains its original author's work.

@Toons29

Toons29 commented Nov 25, 2026

Copy link
Copy Markdown

Regression run of f884dc52 on the retail title, for this PR's Regression run section. Both blocks are from scripts/smoke.ps1 as printed, not edited: main on 568e7db7, this PR on its head commit with no uncommitted changes, same title and time.

xcl-smoke v1
commit: 568e7db7729c8fa6c8f0f4b32d798faaf11462bb
gpu: AMD Radeon RX 9070
title: 34df7c50
seconds: 60
exit: 0x0
frames shown: 1566 (PresentX 1566)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14592 MB
xcl-smoke v1
commit: f884dc52d76f8e12c1f332dde4cf3b99c5b90ef4
gpu: AMD Radeon RX 9070
title: 34df7c50
seconds: 60
exit: 0x0
frames shown: 1639 (PresentX 1639)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14767 MB

Against the limits in CONTRIBUTING.md: 105 % of main's frames, 101 % of its peak commit, no crash, no device removal.

AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, cargo build --release -p xcl, 60 s, XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.

AI use: Claude Code (Claude Opus 5.5) built both trees and ran scripts/smoke.ps1; a script posted this right after the run, with both blocks exactly as printed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants