Repository navigation
Recompiler: mask bridged V_CMP_* results with EXEC in per-lane lowering - #2503
ChalanaGimhanaX wants to merge 1 commit into
Conversation
|
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
No other test changes result on either card. On the "native wave64" gap: the test's wave64 case goes through Not tested: retail shaders, Intel, Linux / Wine. |
|
|
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
Independent AMD RDNA4 (native wave64) test report on exact head Tested
Regression run (60 s retail-title smoke, (Matched Not tested
AI use
|
|
Test run on exact head Tested
Regression run (60 s, default settings) main: this PR: No crash or device removal; frames 102 % of Not tested
AI use
|
…ev#2446, xcl-dev#2503 Integrates direct DXIL graphics shader flags (xcl-dev#2451), PS live-lane v_readfirstlane/SCC (xcl-dev#2501), MSG_GS_DONE emit/cut (xcl-dev#2485), VS/PS scalar reload CSE (xcl-dev#2446), and per-lane V_CMP EXEC masking (xcl-dev#2503). Assisted-by: Antigravity (Gemini 4 Neon)
… upstream xcl-dev#2503) Shared per-lane lowering soundness (recomp/lower.rs): a bridged (non-CMPX) V_CMP_* clears its destination bit in lanes outside EXEC, matching RDNA2 hardware; previously only cmpx read back old EXEC. The per-lane test vector lands verbatim in lower_dxil.rs (CPU translate asserts + GPU/dxc-gated checks, windows-gated on Linux like its neighbours).
|
Independent desktop NVIDIA (Wave32-only Ada) verification of PR #2503 at head Environment
Targeted release tests & build (
|
| Command | Result |
|---|---|
cargo test --release -p xcl --lib a_bridged_v_cmp_clears_inactive_lanes_outside_exec -- --nocapture (3 consecutive runs) |
1 passed; 0 failed; 0 ignored; 1324 filtered out × 3 (0.25s, 0.21s, 0.21s, 0 skipped — live execution on RTX 4060) |
cargo test --release -p xcl --lib gpu::recomp:: -- --test-threads=4 (3 consecutive runs) |
393 passed; 0 failed; 19 ignored; 913 filtered out × 3 (5.83s, 5.93s, 6.00s; 370 executed on RTX 4060 + 23 expected Wave32-only/env skips) |
cargo build --release -p xcl |
Clean build (1m 09s, exit 0, 0 new warnings) |
Paired quiet 60 s retail smoke (title: 29640639)
Exact parent & merge-base (6d12f58a229bc73889878a448c64dc3af25eeba0, cached baseline on the same machine):
xcl-smoke v1
commit: 6d12f58a229bc73889878a448c64dc3af25eeba0
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1606 (PresentX 1606)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14004 MB
PR #2503 (10514822001f2302cd102b9431a9d8613e45cf3a):
xcl-smoke v1
commit: 10514822001f2302cd102b9431a9d8613e45cf3a
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1634 (PresentX 1634)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13986 MB
Runtime log observations (xcl.log)
9222log lines,0[ERROR]/ device-removal / panic lines.- Final draw/memory telemetry in log:
19639 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped); last memory sample13986 MB committed by the process; video memory 6115 MB local, 4651 MB non-local.
Limits of coverage
- Masking bridged
V_CMP_*results withEXECin per-lane lowering was directly executed on desktop Wave32-only RTX 4060 viaa_bridged_v_cmp_clears_inactive_lanes_outside_exec(3/3,0skipped) andgpu::recomp::(370executed +23expected Wave32-only/env skips × 3). - Native Wave64 GPU execution is not available on this Wave32-only RTX 4060, and the warm-cache 60 s retail smoke on
title: 29640639confirms zero runtime regression rather than recompiling a cold shader set (frame-count delta vs. cached parent reflects single-run startup variance, not this PR).
AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).
Mask 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.