Skip to content

Tests: name the trailing VGPRs in the D16 resinfo kernel test - #3513

Merged
throny merged 1 commit into
xcl-dev:mainfrom
Pipodi:resinfo-d16-fix
Nov 30, 2026
Merged

throny merged 1 commit into
xcl-dev:mainfrom
Pipodi:resinfo-d16-fix

Conversation

@Pipodi

@Pipodi Pipodi commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16 fails on main on a GPU since 43c56dc (#3495): "2D D16 resinfo clobbered v2/v3", left (0, 0). CI is green because CI has no GPU and the test returns before the run. #3101's description reports the same failure on a clean d52ff48 from another machine.

Cause: the test kernel loads and stores only the registers its instructions name (touched, crates/xcl/src/gpu/dxil/kernel.rs:416-419). Before 43c56dc the two image_get_resinfo named v0..v3 and v4..v7 (VDATA from the spec's 128-bit operand), so v2/v3/v6/v7 were carried from the input state to the result. Since then mimg_vgpr_uses (crates/xcl/src/gpu/rdna2.rs:613) gives a D16 result two VGPRs, so the trailing ones are never stored and read 0. The translation is unchanged and does not write them. The test change names v2, v3, v6 and v7 with self-moves after the two queries, so a query that wrote four VGPRs would still fail.

Test-only, 5 lines.

What is in it

  • Tests: name the trailing VGPRs in the D16 resinfo kernel test (crates/xcl/src/gpu/dxil/msaa_tests.rs, gpu_direct_image_get_resinfo_d16)

Tested

  • RTX 4090, driver 621.40, i9-13900K, Windows 11 Pro 10.0.26300, rustc 1.100.0, debug
  • main (d52ff48): the test fails 5 of 5 runs
  • this branch: the test passes 3 of 3 runs
  • cargo test --workspace -- --test-threads=4 on 466b75c: 2877 passed, 0 failed, 51 ignored, 25 SKIPPED
  • Honest limit: a forced run with the translation's resinfo d16 set to false fails the fixed test, but at the v0 assertion, not at v2/v3. The v2/v3 assertions are covered by the self-moves, not by that run.

Regression run

  • Test-only diff: asks for the test-only label

Not tested

  • AMD and Intel GPUs

AI use

  • Claude Code: Claude Opus 5.5 (review) and Claude Fable 5.2 (diagnosis, fix, tests)

gpu_direct_image_get_resinfo_d16 fails on main on a GPU since 43c56dc
(xcl-dev#3495): "2D D16 resinfo clobbered v2/v3", left (0, 0).

The test kernel loads and stores only the registers its instructions
name (dxil/kernel.rs, `touched`). Until 43c56dc, `rdna2::vgpr_uses`
took an image instruction's VDATA from the spec's 128-bit operand, so
the two `image_get_resinfo` named v0..v3 and v4..v7 and the kernel
carried v2/v3/v6/v7 from the input state to the result. Since then
`mimg_vgpr_uses` gives a D16 result its two VGPRs, the trailing ones
are never stored, and the result buffer reads 0 for them. The
translation is unchanged and does not write them.

The test now names v2, v3, v6 and v7 with self-moves after the two
queries, so the kernel carries them and a query that wrote four VGPRs
would still fail the assertions. CI has no GPU and returns before the
run, which is why main's CI is green.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@vasanex

vasanex commented Nov 30, 2026

Copy link
Copy Markdown

Unattended test report. Posted automatically by an AI agent on the account owner's instruction. The account owner has not read or checked it. It is not a code review and not a merge-check.

Outcome: gpu_direct_image_get_resinfo_d16 failed in 3 of 3 runs on main and passed in 3 of 3 with this PR; the whole suite had no failures with it.

Tested tree

  • head 466b75c54d3e28b3895c491b1ccef43b38f2db4d, merged without conflicts onto main d52ff48caade1f5350d513bfffd370396dadfeb6 (merged tree ab3fa90e0080f692f89fa201789e489258cc7f66), in a separate worktree with no XCL_* variables set

Hardware and tools

  • NVIDIA GeForce RTX 3080 10 GB, driver 621.40 (the machine also has an AMD integrated GPU), AMD Ryzen 9 7950X, Windows 11 Pro build 26200, rustc 1.100.0, debug

Commands and results

  • cargo test -p xcl --lib gpu_direct_image_get_resinfo_d16 -- --test-threads=4 --nocapture, not skipped:
    • on d52ff48c without this PR, 3 runs: 0 passed, 1 failed in each ("2D D16 resinfo clobbered v2/v3")
    • on the merged tree, 3 runs: 1 passed, 0 failed in each
  • cargo build --workspace on the merged tree: ok
  • cargo test --workspace --no-fail-fast -- --test-threads=4 on the merged tree: 2877 passed, 0 failed, 51 ignored (42 targets). The changed test ran in it and passed.
  • 25 SKIPPED lines: 22 no wave64, 2 no heap windows, 1 the driver cache could not be disabled (Windows Developer Mode is off)

Not tested

  • The whole suite on main without this PR (only the changed test was run there)
  • AMD and Intel GPUs, wave64, release builds
  • No title run was made; the diff changes only a test file

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

@tiagonleal

tiagonleal commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

merge-check
base: 9dfbe3e
head: 466b75c
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -j 8 -- --test-threads=4 -> 2886 passed, 0 failed, 51 ignored; SKIPPED: 24 lines, the same as on the base; failing: none. Base alone on this PC: 2885 passed, 1 failed, 51 ignored, the failure being gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16 ("2D D16 resinfo clobbered v2/v3", left (0, 0)). That test alone, cargo test -p xcl --lib gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16 -- --exact --test-threads=1, 5 runs each: base 0 of 5 pass, merge 5 of 5 pass. With XCL_DIRECT_DXIL=0 set: base 0 of 3, merge 3 of 3, but the variable does not change this test: run_direct (msaa_tests.rs:172) always calls runner::direct_kernel_full, so it has no HLSL path to check.
review: whole diff read (+5/-0, gpu/dxil/msaa_tests.rs). The cause given in the description holds in the source. The test kernel loads and stores only the VGPRs its instructions name (gpu/dxil/kernel.rs:409-420, lw.init.touched from rdna2::vgpr_uses), and vgpr_uses now gives a D16 MIMG result comps.div_ceil(2) registers (rdna2.rs:616, 676), so for DMASK 0xF it names v0..v1 and v4..v5. v2, v3, v6 and v7 are then never written back and read 0. Two VGPRs is the right count for a D16 result of four 16-bit components, so the test's expectation was right and the harness stopped carrying the registers. The four self-moves (msaa_tests.rs:314-318) run after both queries and read the registers as the program sees them, so a translation that wrote four VGPRs would still fail the v2/v3 and v6/v7 assertions; I did not run such a broken translation to confirm it. Overlap: #3357 adds a test right after this one in the same file, and git merge-tree of the two heads reports a text conflict in msaa_tests.rs, so whichever lands second needs a rebase.
performance: test-only change; no smoke run.
verdict: safe to merge
hardware / tool and model: RTX 5070 Ti 16 GB (617.42, wave32), Ryzen 7 9800X3D, 32 GB, Windows 11 26300, rustc 1.100.0 / Claude Code (Claude Opus 5.5 ran the build, suite and repeated runs, reviewed the diff against the merged source and wrote this)

  • Tiago

@Edgaras0404

Copy link
Copy Markdown

Tested

  • Hardware & OS: AMD Radeon RX 6700 XT (RDNA2, driver 32.0.21045.29003), AMD Ryzen 5 5600X, Windows 10 Pro 22H2 (build 19045)
  • Toolchain & build: rustc 1.100.1 (20ddd0171 2026-11-25), dxcompiler 1.9.2609.5 (01b62ad4) / dxil 1.9.2609.5, D3D12 Agility SDK, debug
  • Commits: PR #3513 head 466b75c5 trial-merged onto main 9dfbe3ea
  • cargo test -p xcl --lib resinfo -- --test-threads=1 --nocapture: 5 passed; 0 failed; 0 ignored; 0 measured; 2764 filtered out (0 SKIPPED — gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16 and all 4 other resinfo tests passed on GPU; gpu_direct_image_get_resinfo_d16 previously failed on main 9dfbe3ea)
  • cargo test --workspace --no-fail-fast -- --test-threads=4:
    • All passing workspace binaries finished with 0 failed (including tests\gpu_compute_e2e.rs: 9 passed; 0 failed with SKIPPED heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows; tests\console_shaders.rs: 3 passed; 0 failed; 4 ignored; tests\heap_probe.rs: 0 passed; 0 failed; 4 ignored; tests\xg_oracle.rs: 6 passed; 0 failed; 12 ignored).
    • tests\gpu_two_pass_cache_e2e.rs: 0 passed; 1 failed; 0 ignored (two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs, pre-existing failure on main 9dfbe3ea).
    • -p xcl --lib: aborted with exit code: 0x80004005 (xcl: sparse upload preparation still failed after bounded retries – the title is stopped before its GPU submission), matching main 9dfbe3ea baseline behavior. Before aborting, it logged SKIPPED hle::d3d12x::bind::tests::two_pass_binds_set_the_shared_view_heap: no heap windows (opt-in: XCL_HEAP_WINDOWS=1), the 4 remaining pre-existing gpu:: baseline failures (gpu_compact_form_with_micro_blocks_and_literal_table_runs_as_the_plain_form, f32_programs_on_the_gpu, gpu_f32_compares_with_nan, gpu_float_compares_random), and hle::d3d12x::list_x::tests::a_reset_while_the_last_submit_runs_records_on_another_pc_list (FAILED under --test-threads=4); gpu_direct_image_get_resinfo_d16 did not fail.

Not tested

  • Isolated -p xcl --lib -- --skip gpu:: --skip hle::d3d12x:: run on the merged tree (did not finish -p xcl --lib due to the pre-existing 0x80004005 abort)
  • Opt-in XCL_HEAP_WINDOWS=1 tests (the 2 SKIPPED heap-window tests above)
  • Release build and scripts/smoke.ps1 (diff only adds 5 lines to crates/xcl/src/gpu/dxil/msaa_tests.rs)
  • NVIDIA, Intel, RDNA3, and RDNA4 GPUs

AI use

  • Gemini formatted this test report from the author's directly run commands and outputs (no code or diffs written).

@saintwolf

Copy link
Copy Markdown
Contributor

merge-check claim
head: 466b75c

@saintwolf

Copy link
Copy Markdown
Contributor

merge-check
base: 9dfbe3e
head: 466b75c
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2886 passed, 0 failed, 51 ignored; SKIPPED: 27 (22 no wave64, 2 no heap windows, 2 no xgameruntime.dll, 1 cannot disable the driver cache 0x887A002D); gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16 passed (previously failed on base 9dfbe3e alone)
review: none (read the full +5/-0 diff in crates/xcl/src/gpu/dxil/msaa_tests.rs: adds V_MOV_B32 self-moves for v2, v3, v6, and v7 in gpu_direct_image_get_resinfo_d16 so rdna2::vgpr_uses names the trailing VGPRs for kernel load/store, fixing the failure on main)
performance: none (test-only PR)
verdict: safe to merge
hardware / tool and model: NVIDIA GeForce RTX 4070 SUPER (32.0.16.2140), AMD Ryzen 7 7800X3D, Windows 11 Pro 26300, rustc 1.100.0, debug / Antigravity (Gemini 4 Hydrogen)

@github-actions github-actions Bot added ready-to-merge Has 2 independent safe merge-checks on current head (#3041) and removed needs-2nd-check Has 1 safe merge-check; needs second independent check (#3041) needs:amd-test Needs a test report or merge-check on an AMD GPU labels Nov 30, 2026
@throny
throny merged commit abec7ce into xcl-dev:main Nov 30, 2026
3 checks passed
Kalmarv added a commit to Kalmarv/xcl that referenced this pull request Nov 30, 2026
The MSAA test runs the HLSL itself on the GPU (runner::run_code_with runs the direct DXIL when that is on, the default), and names v56/v57 with self-moves: the kernel loads and stores only the registers its instructions name, and a D16 get_resinfo names its two result VGPRs, so the two after them read 0 whatever the translation wrote (as xcl-dev#3513 does for gpu_direct_image_get_resinfo_d16).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Kalmarv added a commit to Kalmarv/xcl that referenced this pull request Nov 30, 2026
The MSAA test runs the HLSL itself on the GPU (runner::run_code_with runs the direct DXIL when that is on, the default), and names v56/v57 with self-moves: the kernel loads and stores only the registers its instructions name, and a D16 get_resinfo names its two result VGPRs, so the two after them read 0 whatever the translation wrote (as xcl-dev#3513 does for gpu_direct_image_get_resinfo_d16).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Kalmarv added a commit to Kalmarv/xcl that referenced this pull request Dec 1, 2026
The MSAA test runs the HLSL itself on the GPU (runner::run_code_with runs the direct DXIL when that is on, the default), and names v56/v57 with self-moves: the kernel loads and stores only the registers its instructions name, and a D16 get_resinfo names its two result VGPRs, so the two after them read 0 whatever the translation wrote (as xcl-dev#3513 does for gpu_direct_image_get_resinfo_d16).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:recompiler RDNA2 decoder, HLSL/direct-DXIL recompiler, wave64/wave32 area:tests Unit, integration, e2e tests, or testtitle gpu:amd Code is specific to AMD / RDNA / wave64 GPUs (scope tag; see needs:amd-test) ready-to-merge Has 2 independent safe merge-checks on current head (#3041)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants