Recompiler: group-shared and texel sub as a compare-exchange loop #2752
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!2752
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2752"
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?
@jhincromwel-star on GitHub · 2026-11-26 10:09 UTC · original
jhincromwel-star:ds-sub-blackwell-main→main· +72 −14 · 4 files · 1 commits · openWhat is in it
Tested
cargo test --workspace -- --test-threads=4: N passed, N failed, N ignored (SKIPPED GPU tests: …)Regression run
main:
PR:
Not tested
AI use
@luckyteagirl on GitHub · 2026-11-26 10:16 UTC · original · reviewed
At
efb14e7, the LDS part of this PR replaces variableds_subwith a compare-exchange loop in bothemit.rsandlower_mem.rs. #1919 is already open for the same Blackwell LDS subtract failure and changes those same files and the fuzz/test fixtures. Its author first tried a compare-exchange loop, then replaced it after measuring 318.9 ms for that loop versus 9.7 ms for the current #1919 approach in a 32-lane, one-slot contention case. Those are #1919's published measurements, not a benchmark of this PR.Could you compare or coordinate the LDS approach with #1919 before both fixes proceed, and identify which texel-sub behavior here is distinct? A focused contention comparison of this head against #1919 would make the tradeoff reviewable. This is an exact-head source and overlap review assisted by Codex (GPT-6.2 Astra and GPT-6.2 Sol); I have not measured this head's performance or Blackwell behavior.
@luckyteagirl on GitHub · 2026-11-26 10:26 UTC · original
On the RX 6800M, the new
gpu_ds_sub_rtn_u32_with_a_variable_operandtest fails on the HLSL/DXC path at exact clean headefb14e746d6a4367ed56bb5468daa39f87fce4b2. The Direct DXIL path passes.Tested
Windows 11 Home build 26200, Ryzen 9 5980HX, AMD Radeon RX 6800M (PCI
1002:73df, driver30.0.13002.13003), Rust 1.99.0 MSVC, and Windows SDK DXC/DXIL 1.8.2502.11. I setXCL_ADAPTER=AMD Radeon RX 6800MandXCL_REQUIRE_GPU=1. The test does not print the adapter name. I independently enumerated it in DXGI, and the test runner requires the explicit name match.XCL_DIRECT_DXIL=0XCL_DIRECT_DXIL=1b49be18with this test added, HLSL/DXC-O0The failing HLSL runs read
0xffffffffat lane 0, expected0xfffff7e0(0 - (1 + … + 64)). The main control added the PR test plus an HLSL dump and kept main's translator unchanged. The two captured HLSL files differ only in the subtract statement: main usesInterlockedAddwith a negated value, while head uses a bounded compare-exchange loop. Both emitGroupMemoryBarrierWithGroupSync()before and after the subtraction. The optimization control changed only the test's compilation argument. These results isolate an optimization-sensitive failure with the new HLSL lowering on this stack. They do not identify the compiler or driver stage responsible.Not tested
Blackwell, other driver and DXC versions, #1919's alternate implementation, full workspace suite, retail title, and performance. The local control files were restored after testing.
AI use
OpenAI Codex (GPT-6.2 Sol) ran the tests and local controls, compared emitted HLSL, and drafted this report. OpenAI Codex (GPT-6.2 Astra) checked the logs and shader diff before posting.
@sage-sage on GitHub · 2026-11-26 10:30 UTC · original
Test report: passes on NVIDIA Ada; this card does not show the bug. Exact head
efb14e74(its base is currentmainb49be18, so head = merged).Tested
cargo test --workspace -- --test-threads=4: 1436 passed, 0 failed, 47 ignored;gpu_ds_sub_rtn_u32_with_a_variable_operandpassesmainon this machine (wave64, debug layer, Developer Mode, heap windows)lower_mem.rsandemit.rstaken back tomain(local only), the new test still passes here: Ada's driver accepts the group-sharedatomicrmw addof a negated value, so on this card the test checks the compare-exchange loop's result but does not reproduce the refusal.Not tested
Claude Code (Claude Opus 5.5) ran the tests and wrote this report.
@SzczepanGrela on GitHub · 2026-11-26 12:15 UTC · original
Additional RX 9070 / Wine result: I did not reproduce the HLSL failure reported above on this stack.
Tested
efb14e746d6a4367ed56bb5468daa39f87fce4b2, against mainb49be1836844fe0b0cdb3211dce3cb7fb4e21ac7with only the PR's new 35-line synthetic test appended. Main's translator was unchanged. No local source changes on the head.8293130ebe370b1+(local asserts-disabled build), DXC/DXIL 1.9.2602.17, Rust 1.97.1, releasex86_64-pc-windows-gnubinaries.XCL_ADAPTER="AMD Radeon RX 9070",XCL_REQUIRE_GPU=wave64,XCL_NETWORK=0, andXCL_DIRECT_DXIL=0or1. Fresh process and XCL DXIL cache directory for every run; vkd3d shader cache disabled.gpu::recomp::tests::gpu_ds_sub_rtn_u32_with_a_variable_operand: 3/3 fresh-process passes per backend on the head and 3/3 per backend on the main control. Each run reported 1 passed, 0 failed, 0 ignored, 0 skip markers. The test checks the final LDS value in all 64 lanes and 64 distinct returned old values.gpu::recomp::tests::gpu_ds_: 5 passed, 0 failed, 0 ignored, 0 skip markers per revision/backend.gpu::dxil::ops_tests::groupshared_barrier_and_atomics_run: 1 passed, 0 failed, 0 ignored, 0 skip markers per revision.The Windows libtest binaries were invoked directly through the GE-Proton Wine executable, with
--nocapture --test-threads=1and--exactfor individual tests. Raw summaries, source inventories, and executable hashes were checked after the runs. This establishes a passing result on this particular stack; it does not explain the RX 6800M result.Not tested
Native Windows, other GPUs, alternate DXC or driver versions, the full fuzz/workspace suites, retail workloads, smoke runs, or performance.
AI use
OpenAI Codex (GPT-6; exact serving variant not exposed) reviewed the diff, ran and checked the synthetic comparisons, and drafted this report. Publication authorized by the account owner.
@Anon64 on GitHub · 2026-11-26 12:15 UTC · original
Regression run of
efb14e7on a newer retail title: no device removal, no crash, frames and commit within the limits.Setup: RTX 3060 12 GB (NVIDIA 581.80), i9-14900KF, Windows 11 26200, release builds of main
b49be18(this PR's base) and of this PR's exact head,scripts/smoke.ps1 -Game <title>for 60 s withXCL_NETWORK=0and A pressed every 4 s from 20 s. Main was run right after this PR's head, since peak commit on this title drifted up over the day on this machine (main peaked at 19.2 GB this morning).main:
this PR:
102 % of main's frames, 107 % of its peak commit. One run each.
Not tested: the suite on this head; whether the title runs the group-shared/texel sub atomics this PR changes in its first 60 s; AMD.
AI use: Claude Code (Claude Opus 5.5) ran these runs on this machine 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.