Recompiler: track non-sequential image address registers #880
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/886"
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 nova-aryan on 2026-11-24T07:28:32Z.
MIMG instructions with NSA addresses read VGPRs from extension words. Register-use tracking instead reported a contiguous range starting at VADDR, so it could omit a high address register and underestimate max_vgpr, which bounds relative VGPR move/swap switches. Fixes #885.
What is in it
Tested
Independent test reports
077ce40. Reported 707 passed, 11 failed, 41 ignored; the image-register tests passed. The tester attributes the failures to Wine and existing texture-test flakes. This report supplies neither retail coverage nor a passing full suite.Regression run
Pending Windows main/head retail smoke runs.
Not tested
Main/head retail smoke runs are still missing. Windows and Linux results above are attributed independent reports. Native wave64 coverage was skipped in the Windows report; AMD RDNA4 and additional titles remain unverified. Local execution is stopped at the user's request.
All encoded NSA address slots, including padding, conservatively count as reads. Exact per-opcode/DIM/A16 address counts remain outside this change. This PR remains a public draft pending the required retail regression runs.
AI use
Codex with GPT-6.1-sol investigated the bug, wrote the code/tests and ran the standalone checks.
Imported from ivall/xcl. Originally posted by ettehn on 2026-11-24T07:40:03Z.
Verified the relative VGPR path on Windows x64 at
0d88bf8ba7(RTX 5070 Ti Laptop, driver 621.24, Windows SDK DXC 1.8.2502.11). I adapted gpu_image_sample_offset locally: set M0 to 32, used V_MOVRELD_B32 with base v16 to write the Y coordinate into v48, then sampled the 4脳4 texture with IMAGE_SAMPLE_LZ_O and NSA1 extension bytes [1, 48, 0, 0]. The resulting two-component texels matched on all 64 lanes after DXC compilation and GPU dispatch. Disabling only the new MIMG register-tracking branch made lane 8 read [1, 0] instead of [1, 1].Unmodified PR head: cargo build --workspace passed. The four-thread workspace run stopped in the library (673 passed, 3 failed, 21 ignored). The first assertion was cubemap extra_pages reuse in placed_title_textures_share_vram_and_preserve_pixels; transitions_apply_when_their_list_is_submitted and d32s8_targets_take_their_own_size_of_video_memory then reported PoisonError. The full one-thread rerun on the same head passed (717 passed, 0 failed, 41 ignored). Two native-wave64 checks reported SKIPPED inside those counts. Optional samples were unset; no retail smoke run.
OpenAI Codex (GPT-6.2 Astra) assisted with verification.
Follow-up on the four-thread failure: the page counts fell from 17,170,432 to 2,555,904 bytes, exactly the pair reported in #447. I applied only the test changes from #447 (
48e7434) on top of0d88bf8and reran the entire workspace twice with four threads. Both runs passed: 717 passed, 0 failed, 41 ignored each. The cubemap reuse check passed both times. These two runs used the combined tree.Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-24T09:34:07Z.
Linux / AMD RDNA3 datapoint.
Merged state: head
0d88bf8onto main077ce40, clean merge.Full suite,
cargo test --workspace --release --no-fail-fast --target x86_64-pc-windows-gnu -- --test-threads=4: 707 passed, 11 failed, 41 ignored; failures are the known Wine-lane set from my #42 rows plus this rig's title-textures flake family (see #718). non-sequential image-address tracking green; mirror-upload flake hit.Not tested: retail titles (none here), Windows, RDNA4.
Counts only, no game data.
Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross
x86_64-pc-windows-gnu,XCL_NETWORK=0, release profile,--test-threads=4. My Linux rows: #42 / #718.AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.
Imported from ivall/xcl. Originally posted by guinpereira on 2026-11-24T11:30:11Z.
Test report: NVIDIA RTX 5060 Ti (wave32), head
0d88bf8: 719 passed, 0 failed, 41 ignored; both new tests passTested
stable-x86_64-pc-windows-msvc, DXC 1.8.2502.11 (Windows SDK 10.0.26100.0). Debug build, noXCL_SAMPLE_*.0d88bf8as is (base1ec4c98, not rebased on currentmain), clean tree.cargo build --workspace: ok.cargo test --workspace --no-fail-fast -- --test-threads=4: 719 passed, 0 failed, 41 ignored (lib: 676 passed, 21 ignored).SKIPPED(no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware, the same as onmain.image_nsa_address_registers_are_not_a_contiguous_rangeandimage_sequential_address_registers_keep_the_operand_rangepass. They are CPU-only decoder tests, so the GPU does not matter for them.Not tested
scripts/smoke.ps1(no title on this machine).main.AI use: Claude Code (Claude Opus 5.5) ran the commands above and wrote this report. No code changes.
upstream-sync referenced this pull request2026-11-24 19:06:45 +00:00
Imported from ivall/xcl. Originally posted by MiguelMachado-dev on 2026-11-24T20:54:12Z.
#1797 also fixes #885, so it overlaps this PR. It changes the same part of
rdna2::vgpr_uses, and the two conflict textually.The difference is that #1797 counts an image instruction's registers exactly instead of conservatively:
recomp::emitanddxil::lower_imageread them. With NSA, VADDR is followed by only that many NSA bytes, so padding bytes are not counted.dxil::lower_imagenow readsVDATA + 1for a compare-swap only.The tests in #1797:
On an RTX 5080, the suite gives 893 passed, 0 failed, 42 ignored, against 891 / 0 / 42 on
main4178e88. The smoke runs there are still missing.The exact counts matter for the per-lane form in #1745. That form passes only the registers
vgpr_useslists, and refuses an instruction that reads any other.Thanks for finding and writing up #885. I'm posting this so the two don't get merged without the other in view. Happy to coordinate on which one goes in.
(Written with Claude Code, Claude Opus 5.5, xhigh.)
Imported from ivall/xcl. Originally posted by Toons29 on 2026-11-25T03:06:44Z.
Regression run of
0d88bf8bon the retail title, for this PR's Regression run section. Both blocks are fromscripts/smoke.ps1as printed, not edited:mainon4178e888, this PR on its head commit with no uncommitted changes, same title and time.Against the limits in CONTRIBUTING.md: 100 % of
main's frames, 100 % 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; I checked the blocks before posting.upstream-sync referenced this pull request2026-11-25 07:04:28 +00:00
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T09:52:32Z.
Verification on RTX 3060 Ti (Windows 11): merge conflict with current
main— needs a rebase before it can be tested.upstream-sync referenced this pull request2026-11-25 16:10:51 +00:00
Imported from ivall/xcl. Originally posted by throny on 2026-11-25T15:33:26Z.
Two contributors checked independently and found that #1797 #2287 solves the same problem (for #885) in a different way: #1607, group D81. You may want to compare them with the other author and agree on one, or say in the PR why both are needed.
This is a hint from the community triage in #1607, not a maintainer decision.
AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.
Imported from ivall/xcl. Originally posted by throny on 2026-11-28T23:28:26Z.
Two contributors checked independently and found that #1797 #1825 solves the same problem (for #885) in a different way: #1607, group D138. You may want to compare them with the other author and agree on one, or say in the PR why both are needed.
This is a hint from the community triage in #1607, not a maintainer decision.
AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T04:24:44Z.
Triage (#1607) – head
0d88bf8Main now handles image instructions in
rdna2::vgpr_usesthroughmimg_vgpr_uses(commit43c56dc, merged with #3502):vgpr_usesreturns early forENC_MIMG, and the address registers come from theMIMG_NSA{n}VADDRA..fields with NSA, or a range from VADDR without. TheENC_MIMGbranch this PR adds inside the generic operand loop is never reached on main, and the PR conflicts there.#1797 (same issue #885) also counts image registers exactly and still adds a compare-swap fix on top of main.
Recommendation: close (superseded by main commit
43c56dc, #3502).AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Imported from ivall/xcl. Originally posted by throny on 2026-12-01T12:40:29Z.
Closing as superseded: this change is already on
main(43c56dce). main rdna2::vgpr_uses returns early to mimg_vgpr_uses for ENC_MIMG, which reads the MIMG_NSA VADDRA.. fields; PR's NSA branch is coveredTwo independent checks found this: Foniass's close list on #1607 and ours against current
main. If something here is still missing onmain, say so and reopen it, or ask and I will.AI use: Claude Code (Claude Opus 5.5); the per-PR comparison was done by Claude Sonnet 5.5 sub-agents.
Pull request closed