Recompiler: track four image resource SGPRs with R128 set #1990
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2000"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by MiguelMachado-dev on 2026-11-25T00:35:17Z.
Part of #1269. With
R128=1,MIMG.SRSRCnames four SGPRs. Counting eight made the per-lane backend refuseIMAGE_LOADwhen the next SGPR held a lane mask.What is in it
rdna2::sgpr_usesandx64_masks::uses. WithR128=0, use the table width, including the four-SGPR BVH entries.IMAGE_LOADwave32 case throughlower_dxil::compute_code. The shader is accepted withR128=1. WithR128=0,s8is part of the descriptor and the mask read is refused.Tested
263a5e0, Windows 11 build 26300.9974, i7-14700KF, RTX 5080 (driver 621.24), Rust 1.97.1 and DXC 1.8.2502.11. Cargo tests ran in debug.cargo test -p xcl --lib mimg_r128 -- --test-threads=4reported 2 passed, 0 failed, 0 ignored and 0SKIPPED. Both regressions failed before the fix.cargo build --workspacepassed.cargo test --workspace --no-fail-fast -- --test-threads=4reported 993 passed, 4 failed and 45 ignored. The fourfuzz_validate_and_gpu_*tests also failed on cleanmainat8c4a46awith0x8007000EinCreateComputePipelineStateat the same seeds (70, 545, 1019 and 1507).SKIPPEDreports. 19 had no wave64, 3 were f16 lowering refusals, 1 could not disable the driver cache, and 1 had no heap windows.Regression run
scripts/smoke.ps1ran release builds on the same title for 60 seconds with the default backend.Not tested
XCL_SAMPLE_*fixtures.AI use
Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-25T01:34:42Z.
Diff audit passed (
rdna2::sgpr_operand_dwordscheckingMIMGR128 == 1-> 4 SGPRs shared acrossrdna2::sgpr_usesandx64_masks::uses, plusmimg_r128_leaves_the_mask_outside_the_descriptor).Build and test (Windows, no GPU)andPR descriptionare both green on263a5e0, and RTX 5080 passed.Remaining before merge: one independent AMD GPU verification pass on
263a5e0.Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T03:21:15Z.
Tested
PR #2000 at
263a5e011d80270ebc8a3617badedc09d0a1e2bd, in a clean detached checkout. STOR-WINLAB ran Windows 11 Enterprise Evaluation 26200.9974 on a Ryzen 7 3800X, with an Intel Arc A770 (driver 32.0.101.9175) installed. The CPU-only run used Rust and Cargo 1.100.0 (x86_64-pc-windows-msvc), the unoptimized test profile, and DXC/DXIL 1.9.2609.5 for DXIL validation.cargo test -p xcl --locked --lib mimg_r128 -- --nocapture --test-threads=1selected exactly two tests. Both passed, with 0 failed, 0 ignored, 0 explicit skips, and 971 filtered out. The harness reported 0.02 seconds.gpu::recomp::x64_masks::tests::mimg_r128_descriptor_readschecked both SGPR trackers. ForIMAGE_LOAD, they tracked reads ofs4–s7withR128=1ands4–s11withR128=0. Both BVH opcodes retained four SGPR reads withR128=0. All four cases had zero SGPR writes.gpu::recomp::lower_dxil::tests::mimg_r128_leaves_the_mask_outside_the_descriptorchecked per-lane wave32IMAGE_LOADtranslation throughcompute_code. WithR128=1, the fixture kept the lane mask ins8outside the descriptor and produced DXIL that passed validation. WithR128=0, it returned the expected refusal for reading that mask as a number.Not tested
GPU execution on any adapter, fuzzing, retail titles, and the full workspace suite.
AI use
T3 Code / Codex gpt-6.2-sol verified the checkout, ran the two checked-in fixtures, and wrote this report.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T03:43:38Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: 3 real failures, deterministic (also fail--test-threads=1, 1038/3):Looks like the R128/mask handling for IMAGE_LOAD regressed (the mask is being folded into the descriptor operand instead of staying outside it). Needs a fix before merge.
— Devin
Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-25T14:02:10Z.
Independent integration recheck of 263a5e0 on main 06c9f55. Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti / 621.35, Rust 1.99.1 MSVC, DXC 1.8.2502.11.
The clean local merge reproduced all three failures from DavidM1911’s run. The two register-use trackers disagreed for
IMAGE_LOAD R128=1, and the per-lane translator rejected the read ofs8.For a local control, I made the precomputed operand plan use the same R128 descriptor-width rule as the fallback tracker. With that change, the same three tests passed, including the stock comparison across all RDNA2 instructions. The offline workspace build passed, and the patched workspace suite finished with 1,267 passed, 0 failed, 46 ignored, including 26 runtime skips in the pass count.
Focused command:
cargo test --offline --locked -p xcl --lib -j 6 -- --test-threads=1 --nocapture mimg_r128 use_plan_matches_fallback_across_all_rdna2_instructions. Workspace command:cargo test --offline --locked --workspace --no-fail-fast -j 6 -- --test-threads=4 --nocapture.Synthetic tests only. The patched result is local. AMD GPU verification remains open.
AI-assisted. Codex (GPT-6, exact variant unavailable) ran the reproduction, wrote the local control, and drafted this report.
Imported from ivall/xcl. Originally posted by ClosetPie107 on 2026-11-26T06:49:16Z.
Tested head
263a5e01merged onto currentmain(b49be183) on AMD RDNA4 / Linux (Proton Experimental): 3 unit tests fail after merging withmain.Hardware & environment
experimental-11.0-20261112), DXC1.9.2609.5, Rustx86_64-pc-windows-gnu(debug)Targeted unit tests (
mainb49be183+ #2000263a5e01,--test-threads=1):xcl.exe gpu::rdna2:: -- --test-threads=1: 18 passed, 0 failed, 0 ignored (0 skipped).xcl.exe gpu::recomp::x64_masks:: -- --test-threads=1: 18 passed, 2 failed, 1 ignored (mimg_r128_descriptor_readsanduse_plan_matches_fallback_across_all_rdna2_instructions).xcl.exe r128 -- --test-threads=1: 0 passed, 2 failed, 0 ignored:gpu::recomp::x64_masks::tests::mimg_r128_descriptor_reads(x64_masks.rs:794):assertion left == right failed: IMAGE_LOAD R128=1: left: [4, 5, 6, 7, 8, 9, 10, 11], right: [4, 5, 6, 7]gpu::recomp::lower_dxil::tests::mimg_r128_leaves_the_mask_outside_the_descriptor(lower_dxil.rs:482):called Result::unwrap() on an Err value: "unsupported IMAGE_LOAD (s8: a mask read as a number)"Looks like #2000 needs a rebase onto current
main(it auto-merged without git conflicts, but theR128descriptor width isn't taking effect againstmain's currentrdna2.rs/x64_masks.rs).Not tested
263a5e01on its original base without mergingmain, or retail title run (excluded due to the unit test failures).AI use
main, ran the Proton unit tests on this machine, and drafted this report.Imported from ivall/xcl. Originally posted by throny on 2026-11-28T02:30:48Z.
merge-check claim
head:
263a5e011dImported from ivall/xcl. Originally posted by throny on 2026-11-28T02:45:27Z.
merge-check
base:
753e8b1ahead:
263a5e011dmerge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 1511 passed, 3 failed, 47 ignored; failing: gpu::recomp::x64_masks::tests::mimg_r128_descriptor_reads, gpu::recomp::x64_masks::tests::use_plan_matches_fallback_across_all_rdna2_instructions, gpu::recomp::lower_dxil::tests::mimg_r128_leaves_the_mask_outside_the_descriptor. All three pass on the base (the first and third are the PR's own tests) (26 SKIPPED lines); base alone: 1512 passed, 0 failed, 47 ignored
review: blocking, and the cause of the three failures: on current main x64_masks::uses goes through a precomputed use-plan table (uses_with_table / UsePlanTable::build), which sizes each operand from its declared size and never sees the R128 bit. The PR's change lands in the fallback function only, so after the merge the plan still returns eight registers where the fallback returns four, and the two disagree on the default path. The same three failures are reported by three testers in the thread. The R128 rule itself is right (the emitter reads only descriptor words 0, 1 and 3).
performance: no runtime cost; it changes translator sources (every tester re-translates once), and the HLSL changes for programs with R128 images.
verdict: not yet: the use-plan table needs the same R128 rule; I will rerun on the new head.
hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).
Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-28T11:38:20Z.
merge-check claim
head:
263a5e011dImported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-28T12:04:50Z.
merge-check
base:
e429936c10head:
263a5e011dmerge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2125 passed, 12 failed, 48 ignored, 25 SKIPPED: 21 no wave64, 3 per-lane f16/f32 forms refused (#1426 semantics), 1 no heap windows; failing because of this PR: gpu::recomp::lower_dxil::tests::mimg_r128_leaves_the_mask_outside_the_descriptor, gpu::recomp::x64_masks::tests::mimg_r128_descriptor_reads, gpu::recomp::x64_masks::tests::use_plan_matches_fallback_across_all_rdna2_instructions: each also failed when rerun alone on this merge and none fails on the base
e429936c; see review; failing: gpu::dxil::module::split::tests::dispatch_chain_oversized_loop_matches_whole, gpu::dxil::module::split::tests::dispatch_chain_wave32_live_loops, gpu::dxil::module::split::tests::dispatch_chain_wave64_live_loops_and_exchange, gpu::recomp::heap_window_tests::gpu_heap_flat_reads_match_guarded_and_root_output, gpu::recomp::tests::gpu_compute_mode_dispatch_abi, gpu::recomp::tests::gpu_float_cas_uses_ieee_equality, test_title_draws_with_a_root_signature_under_the_debug_layer, test_title_runs_and_game_folder_is_untouched, test_title_runs_under_the_debug_layer_with_dred: these 9 fail on the base too (the base e429936c's suite, run alone on this PC with the same command: 2126 passed, 9 failed, 48 ignored, 25 SKIPPED, these same 9 failing), and each also failed when rerun alone on this merge (the two debug-layer e2e tests stop on the D3D12 debug layer rejecting a pixel shader as corrupt or unsigned, and test_title_runs_and_game_folder_is_untouched on the test title's console command list memory-methods check, "post-Wait32/64 write failed"); not caused by this PR. The suite ran on this PC at the same time as 3 other PRs' suites, in one queued job.review: [major] crates/xcl/src/gpu/rdna2.rs:457-464 (sgpr_operand_dwords) and its callers: on this merge the R128 case does not take effect: rdna2::sgpr_uses still gives IMAGE_LOAD with R128 = 1 eight descriptor SGPRs, so the program the PR means to accept is still refused ("s8: a mask read as a number"), and x64_masks' use plan and fallback tracker now disagree on IMAGE_LOAD -> the PR's two new tests and the existing use_plan_matches_fallback_across_all_rdna2_instructions fail. Evidence: the solo reruns (x64_masks.rs:794 left [4..11] right [4..7]; x64_masks.rs:1156 (1044480, 0) vs (61440, 0); lower_dxil.rs:494 unwrap on Err). (confirmed by the suite and solo reruns; cause not traced further.) Rest of the diff read (README line; the BVH ops keep the table's 4).
performance: reasoned, not measured: one field read per MIMG SRSRC operand during translation.
verdict: not yet: 3 tests fail on the merge because of this PR (its 2 new tests and use_plan_matches_fallback_across_all_rdna2_instructions); make the R128 count take effect in both trackers
hardware / tool and model: Windows 11 build 26300.9974, NVIDIA GeForce RTX 2070 SUPER 8 GB (driver 621.40, wave32 only), AMD Ryzen 5 3600XT; rustc 1.100.1 (20ddd0171 2026-11-25) x86_64-pc-windows-msvc, debug test profile; trial merge 63ed9e493f5555a961ab601ec7daf15a5c00bc26 (local, not pushed). Claude Code: Claude Opus 5.5 (coordination, full-diff review, draft).
correction (2026-11-28): the base counts above were first given as 2128 passed: that base run reused this PC's merge test binary (one cargo target dir for both sides). The base was rerun with its own target dir; the same 9 tests fail on it, so the classification and the verdict stand.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T07:11:22Z.
Triage (#1607) – head
263a5e0No open or merged PR makes the same change; main still counts MIMG SRSRC by the table width in
rdna2::sgpr_usesandx64_masks::uses.No problems found in the diff (R128=1 means a 128-bit T#, four SGPRs). The README line describes an internal detail in the user-facing feature table; it could be left out.
Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Pull request closed