Recompiler: Wave32 pixel mask writes kill one SGPR, not a pair #2781
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!2781
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2781"
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?
@itsSio on GitHub · 2026-11-26 12:22 UTC · original
itsSio:recomp/wave32-pixel-mask-carry→main· +115 −12 · 4 files · 1 commits · openIn a Wave32 pixel shader, VALU mask writes (carry or compare
SDST) and scalarSAVEEXEC/WREXECwrite a single 32-bit SGPR, whereasx64_masksliveness used the wave64 pair kill sets from the ISA tables. A subsequent Wave32 carry intos20therefore killed a live mask ins21, causing the earliers21carry to be lowered withballot_px_localand lose WQM helper-lane bits at triangle edges (Fixes #2584).Carried onto
main(b49be183) fromakimfomin/xcl@d3e7725with his narrow liveness fix and regression tests preserved, adding thegpu_ready()guard on the new GPU test so WARP CI skips cleanly, and omitting the unrelated README line.What is in it
Recompiler: Wave32 pixel mask writes kill one SGPR, not a pair(e1e5bbf0):crates/xcl/src/gpu/recomp/x64_masks.rs: addliveness_uses(masking Wave32V_*,SAVEEXEC, andWREXECkill sets to one dword) andfull_mask_destinations(preserving the existing pair rule while forcing full ballots when a Wave32 pixel mask's single output word can still be read whole), plus unit testwave32_carry_into_s20_preserves_a_whole_read_of_s21.crates/xcl/src/gpu/recomp/emit.rs&crates/xcl/src/gpu/recomp/mod.rs: switchEmfrommask_whole_live(live & (3 << n) == 0) tofull_mask_destinations(live & (1 << n) == 0), passingopt.wave64for pixel shaders andtruefor split wave64 compute/mesh/kernel shaders.crates/xcl/src/gpu/recomp/tests.rs: add GPU regression testgpu_wave32_pixel_carry_preserves_adjacent_mask_at_triangle_edges(withgpu_ready()guard for WARP CI).Tested
Commit
e1e5bbf0d9bd5b1567c58d55acf2be7ce8d44bc3(based onmainb49be1836844fe0b0cdb3211dce3cb7fb4e21ac7), clean checkouts on both PCs, debug builds for workspace tests and release build for the retail smoke run.b49be183+ new GPU test only, DXC1.9.2609.5,XCL_ADAPTER=NVIDIA):gpu_wave32_pixel_carry_preserves_adjacent_mask_at_triangle_edgesFAILED as expected (mask popcount at 0: left 12.0, right 16.0).XCL_ADAPTER=warp):gpu_wave32_pixel_carry_preserves_adjacent_mask_at_triangle_edgesskips cleanly (SKIPPED: no wave64, 0.03 s); fork Windows CI green (2m43s).32.0.16.1088), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11 Pro build 26200,rustc 1.97.0(stable-x86_64-pc-windows-msvc), DXC1.9.2609.5, debug build (XCL_ADAPTER=NVIDIA).cargo build --workspace: exit 0.cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture: 1437 passed, 0 failed, 47 ignored (both new tests pass).SKIPPED: 26 (no wave64, 3 refused wave32 per-lane f16/cvt forms#1426, no heap windows, driver cache requiring Developer Mode).32.0.16.1088), AMD Ryzen 5 5600X, 16 GB RAM, Windows 11 Pro build 26200,rustc 1.99.1(stable-x86_64-pc-windows-msvc), Windows SDK 10.0.26100 DXC1.8.2502.11, debug build (XCL_ADAPTER=NVIDIA).cargo build --workspace: exit 0.cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture: 1437 passed, 0 failed, 47 ignored (both new tests pass).SKIPPED: 29 (same 26 as PC 1 plus 3 requiringd3d12SDKLayers.dll).Regression run
main(b49be183, RTX 5080, release):PR (
e1e5bbf0, RTX 5080, release):Not tested
d3e7725patch on RX 9070 XT, RX 6800M, and RTX 3060 in#2584).scripts/smoke.ps1on the RTX 2080 SUPER, Linux / Wine / vkd3d-proton, and past-world-load gameplay scenes (the 60 s smoke stays in loading and checks for regressions).AI use
Ran via Samaritan:
#2584, carriedakimfomin's fix ontomain(preservingCo-authored-by), reviewed the diff, and ran the pre-fix repro.gpu_ready()guard ine1e5bbf0, ran the dual-PC workspace suites and paired RTX 5080b49be183/e1e5bbf0smokes.scripts/pr_check.py --local, and prepared this description.akimfomin(assisted by OpenAI Codex (GPT-6) per#2584).@SzczepanGrela on GitHub · 2026-11-26 12:35 UTC · original
Confirmed the new pixel regression and its passing result on RX 9070 under Wine at exact head
e1e5bbf0d9bd5b1567c58d55acf2be7ce8d44bc3.Tested
b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7with only the new GPU test appended torecomp/tests.rs. Main's translator and mask analysis were unchanged. The head had no local source changes.8293130ebe370b1+(local asserts-disabled build), DXC/DXIL 1.9.2602.17, Rust 1.97.1, releasex86_64-pc-windows-gnu.XCL_ADAPTER="AMD Radeon RX 9070",XCL_REQUIRE_GPU=wave64,XCL_DIRECT_DXIL=0,XCL_NETWORK=0. Fresh process and XCL DXIL cache directory for each run; vkd3d shader cache disabled.Invoked the libtest binaries directly through GE-Proton Wine:
mask popcount at 32, withleft: 10.0,right: 16.0. Each run: 0 passed, 1 failed, 0 ignored, 0 skip markers.gpu::recomp::x64_masks::tests::, at both--test-threads=1and4: main control 19 passed / 0 failed / 1 ignored; head 20 passed / 0 failed / 1 ignored. The ignored test is the existing manualbench_whole_live_outbenchmark. No skip markers.All 22 raw summaries, the three repeated failure messages, source inventories and executable hashes were checked after testing.
Not tested
Native Windows, other GPUs, the Direct-DXIL graphics path, retail workloads, smoke runs, full workspace suite, or performance. The ignored benchmark was not run.
AI use
OpenAI Codex (GPT-6; exact serving variant not exposed) reviewed the diff, ran and checked the paired synthetic tests, and drafted this report. Publication authorized by the account owner.
@Aniseto on GitHub · 2026-11-26 12:42 UTC · original
Ran the Wave32 pixel mask tests at
e1e5bbf0:Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC 14.44.35207, DXC 1.9.2609.5, debug build.
Both new tests pass here. The GPU regression test runs on the real adapter, so the adjacent mask survives the Wave32 carry at triangle edges on this Blackwell part too.
What this adds: the author tested an RTX 5080 and an RTX 2080 SUPER. This is a third NVIDIA host, with a different driver and DXC version, and the thread has no report from another machine.
Not tested: the full workspace suite, a paired 60 s smoke run, AMD and Intel GPUs, WARP, Wine, release profile, title data.
AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.
@DarkPanda69 on GitHub · 2026-11-26 13:37 UTC · original
AMD and NVIDIA run on this exact rebased commit (listed as untested): the regression test passes on an RX 9070 XT and an RTX 3060, and nothing else changes in the GPU suite.
Head
e1e5bbfapplied onmainb49be18, debug, Windows 11 Pro 26200, card chosen withXCL_ADAPTER:gpu_wave32_pixel_carry_preserves_adjacent_mask_at_triangle_edges --nocapture: ok on both cards, no SKIPPED. Without the fix this test fails on both cards (mask popcount at 32, left 10.0, right 16.0 on the RX 9070 XT;mask popcount at 0, left 12.0, right 16.0 on the RTX 3060), as I reported ford3e7725in #2584.x64_masks: 20 passed, 0 failed on both cards.cargo test -p xcl --lib -- gpu:: --test-threads=4onmainand with the PR: the only result changes aregpu_wave32_pixel_carry_preserves_adjacent_mask_at_triangle_edgesandwave32_carry_into_s20_preserves_a_whole_read_of_s21, both ok, with no new skips. RX 9070 XT (RDNA4, 32.0.32029.2010): 708 → 710 passed, 2 failed (#2115, the same onmain), 6 SKIPPED. RTX 3060 (32.0.16.1088): 710 → 712 passed, 0 failed, 24 SKIPPED.Not tested: Intel, a title.
AI use: Claude Code (Claude Opus 5.5) ran the tests 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.