Skip to content

Recompiler: preserve relative VGPR moves across compute lowering - #1961

Draft
WebIdentity1 wants to merge 1 commit into
xcl-dev:mainfrom
WebIdentity1:codex/nov24-relative-vgpr-current
Draft

WebIdentity1 wants to merge 1 commit into
xcl-dev:mainfrom
WebIdentity1:codex/nov24-relative-vgpr-current

Conversation

@WebIdentity1

@WebIdentity1 WebIdentity1 commented Nov 24, 2026 •

Copy link
Copy Markdown

Part of #1890. Compute-entry relative VGPR writes can be silently dropped when their destination is only referenced later; per-lane relative reads can also be refused. The old bound depended on lowering order and the bridge's per-instruction touched set.

What is in it

Tested

  • Head 4b4c111098a3b22e21dce00d41bc95ab3c11da8e, based on main aa9ab8a3e7b738ec48899e37805f6a7d2d22da53. Tested source snapshots match all 314 manifest hashes before/after and the committed files; each source switch recompiled xcl. Windows 10 Home 19045, Ryzen 7 7800X3D, Rust 1.98.1 MSVC, DXC 1.8.2502.11, debug. RTX 3090 driver 591.74; AMD Radeon(TM) Graphics iGPU driver 32.0.21030.2001.
  • cargo build --locked --workspace: passed on main + new test and head.
  • With XCL_ADAPTER=3090, cargo test --locked --workspace --no-fail-fast -- --test-threads=4 --show-output: main + test 1080 passed / 3 failed / 46 ignored; head 1082 passed / 1 failed / 46 ignored, across 20 targets, both exit 101. CLAMP fails in both. The baseline also fails this regression and d32s8_targets_take_their_own_size_of_video_memory (Close, 0x80004005); the latter is previously intermittent, not credited to this fix.
  • Both full runs emit the same 26 SKIPPED messages: 19 native-wave64 subcases, three refused per-lane arithmetic/conversion subcases, two unavailable debug-layer checks, one unavailable driver-cache-disable check, one disabled heap-window check. These are not coverage. Some suite fixtures choose adapter 0 independently; this regression prints and confirms RTX 3090. No optional game assets configured.
  • Head passes all 20 RTX 3090 dispatches, checking all 64 words each. With XCL_ADAPTER=AMD, cargo test --locked -p xcl --lib relative_registers_reach_compute_output -- --test-threads=1 --show-output: baseline 0/1/0, head 1/0/0, no skips. Head passes all 30 AMD dispatches, including native wave64, all 64 words each. Baselines produce 64/64 wrong words on four NVIDIA / six AMD write-before-use dispatches, then refuse the per-lane relative-read translation.

Regression run
Not run: no retail title available. This stays draft; required clean exact-head/main smoke blocks and CI remain outstanding. No synthetic result is a retail smoke result.

Not tested
Full suite on AMD, graphics-stage draws, retail gameplay, and game-scale compilation time or memory. The full NVIDIA-selected suite is not green.

AI use
Codex with GPT-6 Astra authored the original fix and regression. Codex with GPT-6 prepared this source-hash update, added native-wave64 coverage, ran the Windows comparisons, reviewed the diff, and wrote this report.

@raylitebull

Copy link
Copy Markdown
Member

Diff audit on draft 62b85c1 (max_vgpr scan up front in kernel.rs/lower.rs plus relative_registers_reach_compute_output covering both direct and per-lane compute) looks solid.

When ready to undraft: rebase onto main (dropping the manual TRANSLATOR_VERSION = 8 bump in kernel.rs, as #1947 now auto-hashes gpu/dxil sources), add the xcl-smoke block for PR description, and add AMD + NVIDIA verification.

Use the program-wide register bound for direct lowering and transfer the relative range through the per-lane bridge. Reapply onto source-hashed translator caching without a manual version bump. Synthetic GPU output passes on RTX 3090 and AMD native/split wave64; retail smoke remains outstanding.
@WebIdentity1
WebIdentity1 force-pushed the codex/nov24-relative-vgpr-current branch from 62b85c1 to 4b4c111 Compare November 25, 2026 01:16
@WebIdentity1

Copy link
Copy Markdown
Author

Addressed the source-hash and GPU-verification parts in 4b4c111098a3b22e21dce00d41bc95ab3c11da8e on main aa9ab8a3e7b738ec48899e37805f6a7d2d22da53. The old 62b85c1 worktree/revision is preserved; the manual cache bump is gone.

The new regression passes all 20 RTX 3090 dispatches and all 30 AMD Radeon(TM) Graphics iGPU dispatches (including native wave64), checking 64 output words per dispatch, with no regression-test skips. Main + the same test fails on both GPUs. Full Windows workspace comparison: baseline 1080/3/46, candidate 1082/1/46; both have the same 26 explicit skips and shared CLAMP failure. The baseline's additional intermittent depth/stencil Close failure did not recur; I am not attributing that to this fix. Exact commands, hardware/drivers and limits are in the updated description; 314 source hashes matched before/after each run.

Retail smoke is still outstanding, so this remains draft. No gameplay or compilation-performance claim. Current update/testing/report assisted by Codex (GPT-6); original fix by Codex (GPT-6 Astra).

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.

2 participants