Recompiler: a V# with ADD_TID_ENABLE indexes buffers by lane #2066
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!2066
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2066"
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?
@upipibi on GitHub · 2026-11-25 02:36 UTC · original
upipibi:fix/buffer-add-tid→main· +53 −5 · 3 files · 1 commits · openBoth paths ignored
ADD_TID_ENABLE(V# word 3 bit 23). Every lane of a buffer access withoutIDXENused index 0, so a 64-lanebuffer_load_dwordthrough such a V# read element 0 in every lane. RDNA2 takes the lane as the index whenIDXENis clear, and ignoresADD_TIDwhenIDXENis set.Source for the rule: boykopovar/AnyPS5#21970 measured it on gfx1036 with their hardware oracle (compute), and boykopovar/AnyPS5#24781 applies the same rule to graphics stages.
What is in it
recomp/emit.rsanddxil/lower_mem.rs: whenIDXENis clear, the MUBUF index isselect(V# word 3 bit 23, lane, 0)instead of 0. This applies at all five sites: loads and stores, sub-dword D16, and atomics. The atomic sites now read V# word 3.recomp/tests.rs:gpu_buffer_add_tid_indexes_by_laneuses a stride-4 V# withADD_TID, and each lane should read its own dword. The test sits next to the other buffer tests rather than at the end of the file.Tested
b81d47c, as-is: Radeon RX 7800 XT (RDNA3, driver 32.0.31035.1003), Windows 11, debug, DXC 1.9.0.5512.gpu_buffer_add_tid_indexes_by_lanepasses;cargo test --workspace --no-fail-fast -- --test-threads=4: 1146 passed, 1 failed, 46 ignored. The failure,fuzz_validate_and_gpu_1(seed 722), fails the same way onmain1a0bbe3on that machine.main5ce558f:mainfails on both paths (every lane reads0xA000). This branch passes withXCL_DIRECT_DXIL=0and1.gpu_tests (--skip gpu_sparse_vram): 133 passed withXCL_DIRECT_DXIL=0; with1, 132 passed and 1 failed,gpu_image_get_resinfo_1d_array, which also fails onmain(#2046 fixes it).dxil::andbuffer_formatunits: 138 passed.Regression run
Run by Toons29 on an AMD Radeon RX 9070 (comment),
mainand this head, pasted unedited:Not tested
stride * laneaddress after the new index (recomp/emit.rs:2089,:2099,:4117,:4124,:4174,:4184;dxil/lower_mem.rs:1179-1181,:1840-1842). boykopovar/AnyPS5#21970 measured on gfx1036 (compute, through HIP; the PR is open) that the swizzle does apply with ADD_TID:step = 8 << INDEX_STRIDE,addr = ((idx/step)*stride + (off&~3))*step + (idx%step)*4 + (off&3). This doesn't make anything worse, becausemainhas no buffer swizzle on either path (withIDXENeither). The test here uses stride 4 with the bit clear, where both rules give4l, so it can't tell them apart. Swizzle is a separate change: #2325, stacked on this one.AI use
🤖 Generated with Claude Code
@JJAutoCompare on GitHub · 2026-11-25 03:00 UTC · original
Tested
I ran the checked-in stride-4
gpu_buffer_add_tid_indexes_by_lanefixture on an Intel Arc A770 at clean PR headb81d47c33ef0529b6707496ce44de3b43a1d1850. GitHub showed this exact open head before and after execution. The post-run conversation showed no separate verification report. PR #2066stable-x86_64-pc-windows-msvc. Unoptimized Cargo test profile with debug info and incremental compilation disabled. DXC/DXIL 1.9.2609.5.The following ran once with
XCL_DIRECT_DXIL=0for HLSL/DXC and once withXCL_DIRECT_DXIL=1for direct DXIL. The test runner uses direct DXIL without a fallback in the second mode.The fixture's exact vector assertion passed on both backends. For each lane from 0 through 63, the readback equaled
0xA000 + lane, so the two backend outputs matched on all 64 lanes. Both runs exited 0 and released the Arc lock. The initial shell attempts were blocked before test execution by Windows PowerShell's default policy. The successful commands used process-scopedRemoteSigned.Not tested
Other descriptor or address combinations, writes, atomics, other GPU adapters, the full workspace suite, and retail-title smoke runs.
AI use
T3 Code / Codex (
gpt-6.2-sol) ran the checked-in fixture, verified the logs, and wrote this report.@JoaoPauluu on GitHub · 2026-11-25 03:14 UTC · original
A run with vkd3d-proton as the host D3D12. The DXIL goes through dxil-spirv and then the NVIDIA Vulkan driver, a different compiler from a native-Windows run: this PR's new test passes.
Tested
x86_64-pc-windows-gnu.b81d47cas it is (merge base withmain5ce558f), no uncommitted changes. The lib test binary runs under Wine, one test per process.gpu_buffer_add_tid_indexes_by_lane: ok, not skippedNot tested
AI use
@DavidM1911 on GitHub · 2026-11-25 04:55 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
@Toons29 on GitHub · 2026-11-25 09:40 UTC · original
Regression run of
b81d47c3on the retail title, for this PR's Regression run section. Both blocks are fromscripts/smoke.ps1as printed, not edited:mainon568e7db7, 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; a script posted this right after the run, with both blocks exactly as printed.@raylitebull on GitHub · 2026-11-25 10:46 UTC · original
Code review on
b81d47clooks solid, CI is green, and it has Arc A770, vkd3d-proton, RTX 3060 Ti, and RX 9070 smoke coverage.Only missing piece before merge is an AMD synthetic GPU test run (
gpu_buffer_add_tid_indexes_by_lane) onb81d47c.@oni-swr on GitHub · 2026-11-25 12:14 UTC · original
AMD synthetic GPU run of
b81d47c33ef0529b6707496ce44de3b43a1d1850(exact PR head, tested as-is, not merged ontomain; the diff touches the recompiler and its test only). Synthetic Cargo tests only: no retail title, nosmoke.ps1.Tested
Compiling xcl v0.1.0came from the PR checkout.cargo test -p xcl --lib gpu_buffer_add_tid -- --nocapture:gpu::recomp::tests::gpu_buffer_add_tid_indexes_by_lane ... ok(1 passed, 0 failed, 0 ignored).cargo test --workspace --no-fail-fast -- --test-threads=4: 1146 passed, 1 failed, 46 ignored, 7 distinctSKIPPEDlines. These are not coverage: f16/f32 per-lane form refused (6, wave32 and wave64) andheap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1(seed 722: res[30] = 0x1, CPU 0x7fffffff). It fails the same way onmain1a0bbe3on this machine (cargo test -p xcl --lib fuzz_validate_and_gpu_1: 0 passed, 1 failed), so the PR did not cause it. I did not look into it further.--workspaceand no priorcargo build --workspace,e2efailed 2 of 3 becausexcl_testtitle.exewas not built yet. Aftercargo build --workspace,e2egave 3 passed, 0 failed.Not tested
scripts/smoke.ps1regression run, NVIDIA, Intel, Wine/vkd3d.mainstill passes.AI use
Claude Code, Claude Sonnet 5.5 ran the tests, checked the diff, and wrote this report.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.