Recompiler: a bridged v_cmp writes 0 for the lanes outside EXEC (#2458) #2497
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2507"
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 xpatfussy69x on 2026-11-25T21:07:17Z.
Part of #2458 (bug 1 only). In the per-lane form, a
V_CMP_*that goes through #1426's lowering (float, 16- and 64-bit,V_CMP_CLASS, VOP3-modified) kept its raw result in the lanes outside EXEC, where the console writes 0.lane_masksnever guards aV_CMP, so the bridge ran it with the guardtrue, andfe78c81masked the result with EXEC only forv_cmpx. Under a narrowed EXEC, a later branch orv_cndmaskon VCC then saw those lanes as set. Every bridgedV_CMP*now ANDs its lane bit with EXEC, as the per-lane form's own U32/I32 compares already do.What is in it
crates/xcl/src/gpu/recomp/lower.rs: the bridge takes the lane's EXEC bit into the result of everyV_CMP*, not onlyV_CMPX*crates/xcl/src/gpu/recomp/lower_dxil.rs:a_bridged_v_cmp_writes_0_for_the_lanes_outside_exec: EXEC = lanes 0–15,v_cmp_le_f32true in every lane, EXEC restored,v_cndmaskon VCC. Fails without the fix (7 in lane 16), passes with itTested
cargo test --workspace -- --test-threads=4: 1422 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 (the new test and the existingv_cmpxone)Regression run
main:
PR:
Not tested
v_cmpunder a narrowed EXEC (smoke run with default settings, notXCL_PER_LANE=1): it is a regression check only. The frame difference is most likely run-to-run variance in loadingNULL); #2136 touchesNULLdestinations inupper_lanesAI use
Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-25T21:15:37Z.
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_writes_0_for_the_lanes_outside_exec: passed. Pairs with #2503's test (a_bridged_v_cmp_clears_inactive_lanes_outside_exec), also green here.Imported from ivall/xcl. Originally posted by xpatfussy69x on 2026-11-25T21:23:52Z.
Closing as a duplicate of #2503, which makes the same change to
Lower::bridgeand was opened first. I'll post this branch's test and smoke results there instead.Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T21:24:00Z.
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!
Pull request closed