Recompiler: treat untargeted S_SETPC_B64 as Term::Other and track ES-to-GS edges #1518
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1528"
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 OtavioTadeu on 2026-11-24T17:17:47Z.
S_SETPC_B64hasF_BRANCH | F_INDIRECTwithoutF_TERMINATOR, soterm()misclassified untargetedS_SETPC_B64asTerm::Next, andedgesomitted the ES-to-GS handoff intogs_start(andxcl_entry_pcinsplit_wave64), allowingstructured_spanto break multi-block ES+GSMode::Geometryshaders. Fixes #1360.What is in it
crates/xcl/src/gpu/recomp/mod.rs: classify untargetedF_BRANCHinstructions asTerm::Otherinterm(), include ES-to-GSS_SETPC_B64andsplit_wave64entry edges inedges, and add a multi-block ES+GS test (verified with DXC)Tested
stable-x86_64-pc-windows-msvc), debug buildcargo test --workspace -- --test-threads=4: 777 passed, 0 failed, 41 ignored (SKIPPED GPU tests:gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask[no wave64],gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware[no wave64],heap_window_out_of_memory_falls_back_to_the_switch_form[no heap windows])cargo test -p xcl --lib recomp::geometry_tests: 1 passed, 0 failed (DXC compiled)cargo test -p xcl --lib recomp::attribute_tests: 3 passed, 0 failedcargo test -p xcl --lib recomp::tests::geometry: 2 passed, 0 failedRegression run
scripts/smoke.ps1 -Game retail_title -Seconds 60(mainbaseline vs PR head on NVIDIA GeForce GTX 1660 SUPER):Not tested
AI use
Imported from ivall/xcl. Originally posted by upipibi on 2026-11-24T17:47:53Z.
Duplicate note: #1375 (opened earlier, also a draft) fixes #1360 with the same rule. In
term, ans_setpc_b64without a known target ends its block, and an edge goes from it togs_start. The differences:s_setpc_b64whose target is a block start. Its test checks the emitted ES → GS handoff (pc = select(xcl_es_phase, …, gs_start)) in both forms.s_setpc_b64without a far target. In the split form it also adds a pseudo edge(u64::MAX, gs_start). Its test also covers a multi-block ES with twos_setpc_b64.Both edit the same lines of
recomp/mod.rs, so only one can land. Comparison only: I haven't run either.AI use: Claude Code (Claude Opus 5.5) compared the diffs and wrote this.
Imported from ivall/xcl. Originally posted by Xahinn1 on 2026-11-24T18:01:29Z.
Tested PR #1528 (head
c04e60f) against its merge base (9e3831e, "Merge PR #680"; the PR is 0 commits behind main). This covers the AMD / native wave64 / mesh-shader hardware listed under "Not tested" in the description.Environment
XCL_DXC_DIRI used two separate worktrees and target dirs (PR head and base) with
--locked.1. Targeted tests, native wave64 on RDNA4 (
--test-threads=1, none skipped)recomp::geometry_tests(new test)recomp::attribute_testsrecomp::tests::geometrygpu_geometrygpu_wave32_program_in_wave64_hardwaregpu_split_wave64gpu_wave64gpu_mesh_modegpu_dispatch_matches_native_wave64_reference2. Forced split path (
XCL_SPLIT_WAVE64=1), PR head onlyThis runs the NVIDIA-style 32-lane split path on the RDNA GPU.
recomp::geometry_tests(1),gpu_geometry(2),gpu_split_wave64(5),gpu_wave64(3),gpu_mesh_mode(2) andgpu_wave32_program_in_wave64_hardware(1) all passed. I did not run the forced-split set on base.gpu_split_wave64took 1.04s vs ~0.45s native, which suggests the variable took effect, but I didn't verify that directly.3. Full workspace (
cargo test --workspace --locked --no-fail-fast -- --test-threads=4)The one extra pass on the PR is the new test (lib tests: 749 vs 748). Both trees report the same failing target,
-p xcl --test e2e, so it is not introduced by this PR. I haven't identified the individual e2e test or its cause on this machine.XCL_SAMPLE_RPF not set – skippingappeared on both trees.Not tested / not done
scripts/smoke.ps1on a retail title (I don't have one)Review questions (from reading the diff only, so I may be missing context)
edgesentries are added for everyS_SETPC_B64with nofar_target, assuming each is the ES→GS handoff. Could an untargetedS_SETPC_B64appear inside GS code, and would the extra edge back togs_startmatter there?S_SETPC_B64by name, whileterm()now keys onF_BRANCH. IfS_SWAPPC_B64or another indirect branch can be a handoff, it would be aTerm::Otherwithout the matching edge. Is that intended?u64::MAXsentinel edge safe for everything that consumesedges?An AI assistant helped me run the tests and draft this comment. The commands and outputs are mine from the runs above.
Imported from ivall/xcl. Originally posted by Belox17 on 2026-11-24T18:48:47Z.
Test report for
0fda42fc/c04e60f2on NVIDIA (RTX 3060 Ti): passes, and the new test fails without the fixTested
0fda42fcas is, clean tree. The current headc04e60f2is the same patch rebased onto9e3831e(git range-diff), and its tree is identical to my merge of0fda42fcinto9e3831e, so the merged run below is the current head.cargo test -p xcl --lib multi_block_es_gs: 1 passed (DXC present, so both forms were compiled).cargo test --workspace -- --test-threads=4: 771 passed, 0 failed, 41 ignored; SKIPPED:gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware(no wave64). Its baseb7aa9f3on the same machine: 770 passed, 0 failed, 41 ignored, same skips.main9e3831e: 777 passed, 0 failed, 41 ignored (mainalone: 776).term()change and the ES→GS edges reverted (test kept), the test fails atassert_eq!(term(..), Term::Other): leftNext.Not tested
AI use: Claude Code (Claude Opus 5.5) ran the commands and wrote this report; I checked it before posting.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T18:58:41Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~21 ignored.Thanks!
Imported from ivall/xcl. Originally posted by CalvyPZ on 2026-11-25T22:38:43Z.
This PR has been marked as a duplicate and closed after multiple agreeing checks in #1607. If you believe this is incorrect please re-open with why.
Pull request closed