Recompiler: read a second atomic operand only where it is used #1911
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!1911
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1911"
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?
@Kalmarv on GitHub · 2026-11-24 23:00 UTC · original
Kalmarv:atomic-operand-use→main· +80 −15 · 2 files · 1 commits · openPart of #1269. The 32-bit buffer, flat and LDS atomic lowering read a second VGPR before selecting the operation. For add, min, max and exchange that register is not one of the instruction's operands, so the per-lane bridge correctly refused the extra read and the whole program fell back to the HLSL form.
What is in it
crates/xcl/src/gpu/dxil/lower_mem.rs: the second register is resolved only for compare-exchange and masked OR, the two operations that use it.crates/xcl/src/gpu/recomp/lower_dxil.rs: a GPU test that checks the return values and memory of the per-lane atomics against HLSL.Tested
39601b4(basemaincbc296a, after #1910):cargo test --release -p xcl --lib, unfiltered with GPU tests included, 1,099 passed, 0 failed, 26 ignored, with 23 skip notices (20 for no native wave64, 3 for unsupported wave32 FP). The atomics GPU test and #1910's native-wave branch test both ran on the card.39601b4, Ryzen 7 5800X, DXC 1.9.2602,cargo test --release -p xcl --lib -- --test-threads=4: 1,097 passed, 2 failed, 26 ignored, with nono wave64skips, so every native-wave64 test ran. The two failures are the fuzz seeds 722 and 1599 tracked in #2115, which fail the same way onmainon that card. On an RTX 3060 on the same machine: 1,099 passed, 0 failed, 26 ignored.8ca5f81:cargo test --offline --release --workspace -- --test-threads=4gave 960 passed, 0 failed, 43 ignored. A native compute survey with four switch-selected memory windows put 329 of 2,689 programs in the per-lane form, up from 316 onmainc4d37be.Regression run
scripts/smoke.ps1, the same retail title for 60 s each, one after the other on the machine under Tested, release builds from clean trees.maincbc296a(this PR's base):this PR,
39601b4:PR vs
main: 1287 / 1113 frames (116 %), peak commit 26844 / 24774 MB (108 %); device removals 0 and crashes 0 on the PR run, 0 and 0 onmain.Both runs are on the rebased head and its new base.
main's run was still loading over its last 6 s (0, 2 and 0 presents), so the difference in frames is load timing, not this change.Not tested
AI use
OpenAI Codex (GPT-6.2) wrote the change and the test and ran the suite and the pack count. Claude Code (Claude Opus 5.5) wrote this description and opened the PR.
🤖 Generated with Claude Code
@thehollowedone on GitHub · 2026-11-24 23:11 UTC · original
Independent split-wave64 check of 14dec7f on an RTX 3080 Ti (621.35), Windows 11 build 26300, Rust 1.99.1 MSVC debug, DXC 1.8.2502.11.
I extended the bundled buffer, global, and LDS atomic fixture to run a 64-lane program on two hardware waves. The shader enabled 21 lanes across both halves. Per-lane DXIL matched the HLSL and CPU expectations for all 128 memory words and 448 destination values. The 43 inactive lanes retained their initial memory and register values, and both EXEC words restored correctly. With only main’s memory lowering restored, per-lane translation refused
BUFFER_ATOMIC_ADDbecause it read a second register that the instruction did not supply.cargo test --offline --locked -p xcl --lib per_lane_atomics -- --nocapture --test-threads=1: 2 passed (stock wave32 and the split-wave64 extension), zero skips. Synthetic inputs only.AI-assisted. Codex (GPT-6 family, exact variant unavailable) extended and ran the test and drafted this report.
@raylitebull on GitHub · 2026-11-25 01:08 UTC · original
Build and testandPR descriptionare green onb6e884fand the code review is approved.Remaining before merge: one independent AMD GPU pass on the current head
b6e884f(and if possible an NVIDIA sanity check onb6e884f, since prior NVIDIA runs were pre-rebase).@Kalmarv on GitHub · 2026-11-25 01:10 UTC · original
Thanks, @raylitebull. An AMD pass on the current head
b6e884fis the one missing piece. We have no AMD card here, so this needs someone who does. @srcamarda and @DarkPanda69, you've run AMD passes on related heads before. If either of you has time:Please post the passed, failed and ignored counts, any SKIPPED lines, and your GPU, driver and DXC version.
We will post the NVIDIA run on
b6e884fhere as soon as our GPU is free.AI use: Claude Code (Claude Opus 5.5) wrote this.
@Kalmarv on GitHub · 2026-11-25 01:30 UTC · original
NVIDIA run on the exact head
b6e884f(b6e884f88993a6febb6c8fbdd05f00e0374ea6db), from a clean worktree.cargo test --release -p xcl --lib -- --test-threads=4: 938 passed, 0 failed, 25 ignored. 11 tests printed 21 SKIPPED messages. 18 are native-wave64 subcases, which this card doesn't have, and 3 are per-lane FP subcases unsupported on wave32.per_lane_atomics_take_their_declared_operandsand the shared, buffer and global atomic cases.XCL_SAMPLE_*variables were set. Both commands exited 0.The AMD pass is still open; the request is above.
AI use: OpenAI Codex (GPT-6) ran the tests and summarized the logs; Claude Code (Claude Opus 5.5) wrote this comment.
@DavidM1911 on GitHub · 2026-11-25 02:15 UTC · original
Verification on RTX 3060 Ti (Windows 11): merge conflict with current
main— needs a rebase before it can be tested.@Kalmarv on GitHub · 2026-11-25 02:30 UTC · original
@DavidM1911 Rebased onto
maincbc296ab(after #1910) as39601b4. Thanks for the note.The one conflict was in the atomic lowering.
main's IEEEfcas32and this PR's integer compare-exchange now each fetch the second operand only in their own arm.Tested on the rebased head:
cargo test --release -p xcl --lib, unfiltered (GPU tests included): 1,099 passed, 0 failed, 26 ignored.Not tested: AMD.
AI use: a Codex (GPT-6.2) helper did the rebase and ran the suite; Claude Code (Claude Opus 5.5) pushed it and wrote this.
@DarkPanda69 on GitHub · 2026-11-25 12:24 UTC · original
@Kalmarv here's the AMD pass you asked for, on the rebased head
39601b4(39601b482), checked out as is (no local changes), in the form you gave.Tested: Windows 11 Pro 26200, Ryzen 7 5800X, rustc 1.100.0, DXC 1.9.2602.17, release.
cargo test --release -p xcl --lib -- --test-threads=4:fuzz_validate_and_gpu_1andfuzz_validate_and_gpu_3, the AMD fuzz seeds 722 and 1599 tracked in #2115, which fail the same way onmainon this card. SKIPPED (7): the 6 per-lanerefusedcases off16_programs_on_the_gpu/f32_programs_on_the_gpu(f16 arithmetic, f16 packed, f32 conversions; wave32 and wave64 each), andpso_measurement_compiles_an_exact_synthetic_record(cannot disable the driver cache without Developer Mode). Nono wave64skips, so every native-wave64 test ran.no wave64ones, the same 3 per-lane refusals for wave32, and the driver-cache one).Not tested: a title,
b6e884f(I ran the rebased head that is current now).AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.
@DavidM1911 on GitHub · 2026-11-26 00:34 UTC · original
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.Thanks!
— Devin
@Kalmarv on GitHub · 2026-11-26 01:00 UTC · original
@DarkPanda69 thank you. That is the AMD pass on the current head
39601b4. The 2 failures are the #2115 fuzz seeds, and they fail the same way onmainon that card.With it, the items @raylitebull listed on 11-25 are all in for
39601b4: both checks are green, there are two approving reviews, an NVIDIA run (RTX 5070 Ti) and this AMD run (RX 9070 XT, RDNA4). The head merges intomainb49be18without conflicts.AI use: Claude Code (Claude Opus 5.5) checked the merge with
git merge-treeand wrote this.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.