Recompiler: a vote's side may narrow EXEC through a whole-quad copy (#336) #947
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/953"
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?
Imported from ivall/xcl. Originally posted by emirduran707 on 2026-11-24T09:27:03Z.
Stacked on #517 (itself on #341); only the top commit (
38992ed) belongs here. Part of #336.#517's classifier accepts a mask vote only if the side the wave runs starts with an instruction that narrows EXEC by the vote's mask. The console compiler's pixel-shader discard early-out narrows it one step later:
So these votes were reported as
vote-branch. In the retail shader pack, this shape is behind most of the 2 409 programs whose only reason wasvote-branch.The side now only has to turn EXEC off in a half whose mask is empty before its first lane instruction. #517's zero flow checks this:
wqm(0)andx & 0are zero there. Before that point only scalar ALU ops, scalar loads,s_waitcntands_nopare allowed. Their writes are the wave's, and #517 already follows them as stale where the sides join.s_setreg,s_sendmsg, PC writes and any lane instruction end the search. Every shape the old first-instruction check accepted passes the new one.What is in it
crates/xcl/src/gpu/recomp/partition.rs:narrows_before_lane_workreplacesnarrows_exec_byinvote.a_discard_early_out_that_narrows_through_a_whole_quad_copy_is_exact:s_setregbefore it all stayvote-branch.Tested
x86_64-pc-windows-msvc; DXC 1.9.2602.17; debug for the suite, release for the runs.cargo test --workspace -- --test-threads=4at38992ed: 727 passed, 0 failed, 41 ignored; noSKIPPEDlines.cargo test -p xcl --lib recomp::partition: 44 passed.p1's reason list.cut: one 64-lane wave against its two 32-lane halves), in a local test that is not committed:vote-branch.vote-branchin 5 186 programs instead of 6 375;Regression run
Nothing in the runtime calls the classifier yet, so this only shows the build is unchanged in use. The
gpu:line names a virtual display adapter of this machine (what #281 / #282 / #285 fix); XCL's log namesbackend 'real' – AMD Radeon RX 9060 XT (16188 MiB VRAM).main:
PR:
Not tested
Exactmatch on a 32-lane GPU: there is no 64-lane reference on the GPU yet; the interpreter covers the idiom's shape.AI use
🤖 Generated with Claude Code
Imported from ivall/xcl. Originally posted by fromthemoonx on 2026-11-24T09:42:34Z.
NVIDIA run, since Not tested lists NVIDIA. The classifier is CPU-side and nothing calls it yet, so this mainly covers the build and suite on a 32-lane card.
Tested
stable-x86_64-pc-windows-msvc; DXC 1.9.2602.17; debug38992eddadc828da6857f0c7f0e63d454e7e5ef1(with #517 / #341 under it), clean worktree:cargo build --workspace, thencargo test --workspace -- --test-threads=4: 727 passed, 0 failed, 41 ignored (lib 687 / 0 / 21), the same total as yours. The new testpartition::tests::a_discard_early_out_that_narrows_through_a_whole_quad_copy_is_exactpassed.partition.rsas it is atdfc5578(#517's head) and ran it with--exact. It fails,assertion left == right failedat the exact/vote-branchcheck.main6bac4b4(git auto-mergedrecomp/mod.rs, no conflict):cargo test --workspace --no-fail-fast -- --test-threads=4 --skip a_freed_block_is_decommitted_before_its_address_is_reused, 2 runs: 769 passed, 0 failed, 41 ignored, 1 filtered out both times. The skip is #913, which fills video memory on this 12 GB card.real::readback_routing_tests::coherent_buffer_sanitizes_console_flags_and_state, at its finalassert_ne!(VirtualFree(..), 0). That test does not touch the recompiler. It has failed the same way now and then on plainmainhere too (see #913), so I don't count it against this PR.recomp::partition+recomp::cfg+recomp::upper_laneson the merged tree, 10 runs: 10 of 10 passed (60 tests each)XCL_D3D12_DEBUG=1run (test_title_draws_with_a_root_signature_under_the_debug_layer, which runs here because Graphics Tools are installed) logs the same set of debug-layer errors and warnings on the merged tree as onmain077ce40. Nothing new.gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardwareXCL_SAMPLE_*not setNot tested
AI use
Imported from ivall/xcl. Originally posted by hkgamingdk231-prog on 2026-11-24T09:44:11Z.
Test report for head
38992edda.Setup
main077ce40(all applied cleanly), debug build, Rust 1.100.0, Windows 11 Pro 26200, Ryzen 7 5800X, DXC 1.9.2602.17.cargo test -p xcl --lib -- gpu::recomp --test-threads=4, once withXCL_ADAPTER=radeonand once withXCL_ADAPTER=3060.Tested: no regressions on either GPU.
This PR adds no GPU test, so these runs only show that the existing recompiler GPU tests still pass with it, including native wave64 on AMD. They do not check the programs it makes
Exactagainst a 64-lane reference.AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.
Imported from ivall/xcl. Originally posted by dcastell1 on 2026-11-24T09:53:52Z.
Verified on Windows 11 10.0.26300, NVIDIA GeForce RTX 5090 (driver 621.24), Rust 1.100.0 MSVC 14.44.35207, debug build, on
main@077ce40(baseline 716 passed, 0 failed, 41 ignored on this box):51 more passing tests than the baseline — the whole-console-block EXEC narrowing change ships a lot of new fixtures and every one of them runs green here.
Tree restored afterwards (full diff against a clean checkout), hardware adapter, no Wine, no game data. AI-assisted (opencode): applied the patch to a built tree, ran the suite, reverted it.
Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-24T10:38:08Z.
Linux / AMD RDNA3 datapoint.
Merged state: head
38992edonto main9aec53d, clean merge.Full suite,
cargo test --workspace --release --no-fail-fast --target x86_64-pc-windows-gnu -- --test-threads=4: 764 passed, 11 failed, 41 ignored; failures are the known Wine-lane set from my #42 rows plus this rig's title-textures flake family (see #718). whole-quad-vote EXEC narrowing green on wave64.Not tested: retail titles (none here), Windows, RDNA4.
Counts only, no game data.
Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross
x86_64-pc-windows-gnu,XCL_NETWORK=0, release profile,--test-threads=4. My Linux rows: #42 / #718.AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T13:51:26Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:Thanks!
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T03:11:30Z.
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