Recompiler: keep far jumps indirect when a branch enters after s_getpc_b64 #1632
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!1632
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1632/head"
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?
@AlpPesen on GitHub · 2026-11-24 18:26 UTC · original
AlpPesen:fix/far-jump-incoming-branches→main· +100 −1 · 2 files · 1 commits · closed without mergingFixes
rdna2::resolve_far_jumpsso a four-instructions_getpc_b64/s_add_u32+s_addc_u32(ors_sub_u32+s_subb_u32) /s_setpc_b64sequence is left indirect (far_target = None) whenever any direct branch or prospective far jump targets one of its interior instructions (lo,hi, orset), bypassings_getpc_b64.Fixes #863.
What is in it
crates/xcl/src/gpu/rdna2.rs:far_targetannotations at the start ofresolve_far_jumpsso repeated calls are idempotent.branch_target) plus all prospective far-jump targets before publishingfar_target, and verify PC contiguity across[get, lo, hi, set].insts[k].far_target = Some(target)only when none oflo.pc,hi.pc, orset.pcis in the collected target set (branches targetingget.pcitself still execute the full sequence and stay direct).crates/xcl/src/gpu/recomp/tests.rs:far_jumps_stay_indirect_when_branched_intocovering:get.pc(stays direct) vslo.pc,hi.pc, andset.pc(stays indirect) for both add and subtract forms;lo.pc) of sequence B (A stays direct, B stays indirect).main(b7aa9f3) atsub=false simm16=1(Some(24)instead ofNone) and passes with this fix.Regression run
Baseline (
main, warm shader/PSO cache):This PR (
fix/far-jump-incoming-branches, warm shader/PSO cache):Tested
Hardware: Windows 11 Pro for Workstations (Build 26300), Intel Core i9-9900K, 32 GB RAM, AMD Radeon RX 6800 (16337 MiB VRAM, Driver
32.0.21045.29003),rustc 1.100.0 (0ef1bc386 2026-11-09).cargo test -p xcl --lib far_jumps:2 passed; 0 failed; 0 ignored; 0 skipped.XCL_REQUIRE_GPU=wave64,mesh cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4:768 passed; 3 failed; 41 ignored; 0 skipped. All 3 failures are the pre-existing RDNA2placed_title_textures_share_vram_and_preserve_pixels+ 2VRAM_TEST_LOCKPoisonErrorcascades on unmodifiedmain(tracked in #470)..\scripts\smoke.ps1 -Game '<game folder>\YouKnowWho'on99e113c14bbca4138bc076084a5719186a81c0fa(see Regression run above).Not tested
AI use
Antigravity (Gemini 4 Neon) implemented the incoming-branch check in
crates/xcl/src/gpu/rdna2.rs, added the regression test incrates/xcl/src/gpu/recomp/tests.rs, and ran the test suite and smoke run.@upipibi on GitHub · 2026-11-24 18:57 UTC · original
Duplicate note: #863 already has two open PRs with the same rule. #865 (opened first) and #942 both collect the direct branch targets plus every candidate far jump's target, and keep the
s_setpc_b64indirect when any oflo/hi/setis a target. #942 also resetsfar_targetfirst, as this PR does. The earlier comparison on #942 found that each passes the other's tests. All three editresolve_far_jumps, so only one can land. If this one has a case the others miss, a test that fails on #865's or #942's head would show it. Comparison of the diffs only: I haven't run them.AI use: Claude Code (Claude Opus 5.5) compared the diffs and wrote this.
@AlpPesen on GitHub · 2026-11-24 20:21 UTC · original
Closing in favor of the earlier open PRs #865 and #942 for #863 to keep triage clean. Thanks @upipibi for flagging!
@DavidM1911 on GitHub · 2026-11-24 20:46 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~22 ignored. (Intermittent single-test flake under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodifiedmain.)Thanks!
github-bot referenced this pull request2026-11-26 06:18:31 +00:00
Pull request closed