Recompiler: mask bridged V_CMP_* results with EXEC in per-lane lowering #2503
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!2503
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2503"
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?
@ChalanaGimhanaX on GitHub · 2026-11-25 20:55 UTC · original
ChalanaGimhanaX:recomp/per-lane-bridged-vcmp-exec→main· +94 −2 · 2 files · 1 commits · openMask bridged non-
CMPXV_CMP_*results withEXECin per-lane direct DXIL lowering (Lower::bridge), matching RDNA2 hardware, nativeLower::valu_op, and the HLSL path.lane_masks::is_vectorexcludes allV_CMP*instructions so their PCs are never inself.guarded, andLower::valu_oponly lowers plainU32/I32compares natively. Every float (F32/F16/F64), 64-bit, 16-bit,V_CMP_CLASS_*, and VOP3-modified/SDWA compare falls through toLower::bridge, which previously only capturedold_execforV_CMPX*and passedguard = truetoIr::foreign. Inactive lanes outsideEXECtherefore left1inVCC/SDSTinstead of0, corrupting subsequent mask ops andS_CBRANCH_VCCZ/VCCNZbranches.Part of #2458, #1269, and #1833. (Issue #2458 item 2 —
NULL/SDST = 125writes — is already covered by open PR #2117 and intentionally left out to stay single-purpose and avoid conflicts.)What is in it
crates/xcl/src/gpu/recomp/lower.rs: inLower::bridge, captureold_execfor allV_CMP*instructions (when!in_guarded_run), not onlyV_CMPX*, so inactive lanes are ANDed out beforewrite_bit.crates/xcl/src/gpu/recomp/lower_dxil.rs: addeda_bridged_v_cmp_clears_inactive_lanes_outside_execcovering bridged VOPC (VCC) and VOP3 (s4)V_CMP_LT_F32under narrowedEXEC(exact register checks + HLSL GPU parity) and computeS_CBRANCH_VCCZunder both wave32 and split wave64 (with DXIL validation on CPU).Tested
rustc 1.100.0 (0ef1bc386 2026-11-09), DXC1.8.2502.11, release build.lower.rsfix:cargo test --release -p xcl --lib gpu::recomp::lower_dxil::tests::a_bridged_v_cmp_clears_inactive_lanes_outside_exec -- --exact --nocapturefailed withassertion left == right failed: vcc must clear inactive lanes 16..31 (left: 4294901760 [0xFFFF_0000], right: 0).1051482):cargo test --release -p xcl --lib gpu::recomp::lower_dxil::tests:: -- --test-threads=4 --nocapture: 22 passed, 0 failed.XCL_ADAPTER=warp):a_bridged_v_cmp_clears_inactive_lanes_outside_execpassed (all 3 DXIL containers compiled and validated on CPU; GPU execution skipped cleanly withno GPU with 32-lane waves).1051482):cargo build --release --workspace+cargo test --release --workspace --no-fail-fast -- --test-threads=4 --nocapture: 1424 passed, 0 failed, 46 ignored across 37 test binaries.SKIPPEDGPU/adapter tests (26): 21no wave64, 3 refused per-lane f16/f32 forms (#1426), 1no heap windows, 1pso_measurement_compiles_an_exact_synthetic_record(Windows Developer Mode required for driver cache disable).cargo test --release -p xcl --test e2e -- --test-threads=1(1051482): 4 passed, 0 failed.Regression run
main (
6d051da):this PR (
1051482):Not tested
split = falseGPU execution path), AMD / Intel GPUs, Linux / Wine, and retail gameplay beyond the 60-second smoke run.AI use
Lower::bridgeEXEC-masking fix and GPU/DXIL-validation regression test, ran the test suite and regression smoke run, and drafted this description.@DarkPanda69 on GitHub · 2026-11-25 21:07 UTC · original
Ran on an AMD RX 9070 XT (RDNA4) and an RTX 3060: the new test passes on both cards, and nothing else changes.
Diff applied on
main6d12f58, debug, Windows 11 Pro 26200,cargo test -p xcl --lib -- gpu:: --test-threads=4onmainand with the PR, card chosen withXCL_ADAPTER, run twice: once withXCL_PER_LANE=1alone, once withXCL_PER_LANE=1 XCL_DIRECT_DXIL=1. Both gave the same results:a_bridged_v_cmp_clears_inactive_lanes_outside_execok. 699 passed, 2 failed; the 2 failures are the AMD fuzz seeds tracked in #2115, the same onmain.No other test changes result on either card.
On the "native wave64" gap: the test's wave64 case goes through
compute_split, so on the RX 9070 XT it runs the split form too. This run doesn't cover the native (split = false) path either.Not tested: retail shaders, Intel, Linux / Wine.
AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.
@SlopTart on GitHub · 2026-11-25 21:08 UTC · original
gpu_suite (cold cache): 164 passed / 3 failed, no crashes. The three are the known baseline on this lane (seed-1003 fuzz, mad/mac contraction, promoted-UAV-clear driver gap, PR #2490); none caused by this PR.Targeted run of
a_bridged_v_cmp_clears_inactive_lanes_outside_exec: passed.@DavidM1911 on GitHub · 2026-11-25 21:14 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!
@emirduran707 on GitHub · 2026-11-25 21:14 UTC · original
Independent AMD RDNA4 (native wave64) test report on exact head
10514822001f2302cd102b9431a9d8613e45cf3a(clean detached checkout, no local changes).Tested
stable-x86_64-pc-windows-msvc), DXC 1.9.2602.17; tests debug, smoke release.cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4: 1422 passed, 2 failed, 46 ignored; 8 SKIPPED (6 inlower_dxil::tests::{f16,f32}_programs_on_the_gpurefused by per-lane form;heap_window_out_of_memory_falls_back_to_the_switch_form;pso_measurement_compiles_an_exact_synthetic_record). All native wave64 GPU tests ran and passed.gpu::recomp::lower_dxil::tests::a_bridged_v_cmp_clears_inactive_lanes_outside_exec.gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1seed 722 andfuzz_validate_and_gpu_3seed 1599) are pre-existing on unmodifiedmainon this GPU.Regression run (60 s retail-title smoke,
XCL_NETWORK=0, release)(Matched
main68a284abaseline on the same machine today: 1573 frames, 14420 MB peak, 0 device removals, 0 crashes.)Not tested
AI use
@xpatfussy69x on GitHub · 2026-11-25 21:34 UTC · original
Test run on exact head
1051482(10514822001f2302cd102b9431a9d8613e45cf3a, on base6d12f58), clean tree.Tested
cargo test --workspace -- --test-threads=4: 1424 passed, 0 failed, 46 ignoredV_MUL_F16/V_PK_MUL_F16/V_CVT_F16_F32(onmaintoo; #2182 removes them)cargo test -p xcl --lib a_bridged_v_cmp: 2 passed (a_bridged_v_cmp_clears_inactive_lanes_outside_execand the existinga_bridged_v_cmpx_keeps_the_lanes_outside_exec_out), not skippedmain, a program with EXEC = lanes 0–15, a bridgedv_cmp_le_f32true in every lane, EXEC restored andv_cndmaskon VCC gives 7 in lane 16 instead of 0; this PR's change gives 0Regression run (60 s, default settings)
main:
this PR:
No crash or device removal; frames 102 % of
main's, peak commit 100 %.Not tested
v_cmpunder a narrowed EXEC (not run withXCL_PER_LANE=1): a regression check onlyAI use
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.