Recompiler: keep far jumps indirect when entered after s_getpc_b64 (#863) #942
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!942
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/942/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?
@Youssefrah16 on GitHub · 2026-11-24 09:03 UTC · original
Youssefrah16:fix/far-jump-incoming-branches→main· +81 −3 · 2 files · 1 commits · closed without mergingFixes #863.
What changed
crates/xcl/src/gpu/rdna2.rs(resolve_far_jumps):far_targetbefore scanning sobranch_targetonly inspects direct branches.S_GETPC_B64/S_ADD_U32+S_ADDC_U32orS_SUB_U32+S_SUBB_U32/S_SETPC_B64) first (returning immediately with no allocation when there are none).far_targetonly when none of the sequence's post-S_GETPC_B64instructions (lo,hi,set) is targeted. Entering atS_GETPC_B64itself still resolves as a direct far jump.crates/xcl/src/gpu/recomp/tests.rs(far_jumps_stay_indirect_when_entered_after_getpc):get,lo,hi, andsetfor both add and subtract forms, verifyingfar_targetand thattranslatekeepss_setpc_b64indirect whens_getpc_b64is bypassed.get,lo,hi, andsetof a second far-jump sequence.Tested
stable-x86_64-pc-windows-msvc), DXC 1.9.2602.17 (Windows SDK 10.0.26100.0), debug build, no game data:cargo test -p xcl --lib far_jump: 3 passed, 0 failed.cargo test -p xcl --lib gpu:: -- --test-threads=4: 284 passed, 0 failed, 18 ignored (SKIPPED: no wave64on 2 tests).XCL_ADAPTER=radeon):cargo test -p xcl --lib far_jump: 3 passed, 0 failed.cargo test -p xcl --lib gpu:: -- --test-threads=4: 284 passed, 0 failed, 18 ignored (SKIPPED: no mesh shaderson 2 tests).cargo test --workspace -- --test-threads=4: 714 passed, 0 failed, 41 ignored) and @eizispark (RX 9070 XT).Regression run
scripts/smoke.ps1, 60 s. The blocks are copied unchanged from that comment.main(beaa245):PR (
a527eb3):Not tested
AI use
github-bot referenced this pull request2026-11-26 04:59:09 +00:00
@dcastell1 on GitHub · 2026-11-24 09:11 UTC · original
Verified on Windows 11 10.0.26300, NVIDIA GeForce RTX 5090 (driver 621.24), Rust 1.100.0 MSVC 14.44.35207, debug build, on clean
main@beaa245(713 passed, 0 failed, 41 ignored on this box):One more passing test than main: keeping entered far jumps indirect after
s_getpcis exercised and green.Tree restored afterwards (md5 and a full diff against a clean checkout), hardware adapter, no Wine, no game data. AI-assisted (opencode): applied the patch to a built tree, ran the suite, reverted it.
@eizispark on GitHub · 2026-11-24 09:28 UTC · original
Hardware check of
a527eb364b7c53b4155ebc5b207dffab54e3602b(verified clean merge withmain077ce40): pass.Tested
rustc 1.100.0 (0ef1bc386 2026-11-09), release + test profilecargo test --workspace -- --test-threads=4:714 passed, 3 failed, 41 ignored(GPU tests skipped on this adapter:none; the 3 failures under--test-threads=4are the known concurrent globalextra_pagescounter race inhle::d3d12x::title_textures::tests::placed_title_textures_share_vram_and_preserve_pixelsand 2 downstreamPoisonErrors)cargo test -p xcl --lib hle::d3d12x -- --test-threads=1:115 passed, 0 failed, 1 ignoredfar_jumps_stay_indirect_when_entered_after_getpc,far_jumps_are_direct_branches,a_far_jump_is_a_branch_not_an_unknown_jump, and native wave64 + mesh-shader GPU tests (gpu_dispatch_matches_native_wave64_reference,paired_halves_match_independent_native_wave64_references,dxc_mesh_shader_probe,gpu_mesh_mode_two_passes,gpu_mesh_mode_reads_memory_windows,retail_mesh_pipelines_through_the_hook,console_wave64_compute_through_the_pso_hook_dispatch_and_read_back,gpu_wave64_ps_whole_wave_reductions,gpu_wave64_vs_spill_slots_and_identity,gpu_wave64_ps_spill_slots): allok(0skips)Regression run
main(beaa245):PR (
a527eb3):Not tested
AI use
scripts/smoke.ps1harness on this machine and formatted this report.@SlopTart on GitHub · 2026-11-24 10:37 UTC · original
Linux / AMD RDNA3 datapoint.
Merged state: head
a527eb3onto main9aec53d, clean merge.Full suite,
cargo test --workspace --release --no-fail-fast --target x86_64-pc-windows-gnu -- --test-threads=4: 718 passed, 7 failed, 41 ignored; failures are the known Wine-lane set from my #42 rows. far-jump-indirect-after-s_getpc green.Not tested: retail titles (none here), Windows, RDNA4.
Counts only, no game data.
Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross
x86_64-pc-windows-gnu,XCL_NETWORK=0, release profile,--test-threads=4. My Linux rows: #42 / #718.AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.
@guinpereira on GitHub · 2026-11-24 11:30 UTC · original
Test report: NVIDIA RTX 5060 Ti (wave32), head
a527eb3: 719 passed, 0 failed, 41 ignored; the new test passesTested
stable-x86_64-pc-windows-msvc, DXC 1.8.2502.11 (Windows SDK 10.0.26100.0). Debug build, noXCL_SAMPLE_*.a527eb3as is (base077ce40, not rebased on currentmain), clean tree.cargo build --workspace: ok.cargo test --workspace --no-fail-fast -- --test-threads=4: 719 passed, 0 failed, 41 ignored (lib: 676 passed, 21 ignored).SKIPPED(no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware, the same as onmain.far_jumps_stay_indirect_when_entered_after_getpcpasses; the existing GPU testfar_jumps_are_direct_branchesalso passes.resolve_far_jumpsfor the same issue (#863), so the two will conflict.Not tested
scripts/smoke.ps1(no title on this machine).main.AI use: Claude Code (Claude Opus 5.5) ran the commands above and wrote this report. No code changes.
@DavidM1911 on GitHub · 2026-11-24 12:37 UTC · original
Independent verification, merged onto current
main384f7f7locally (clean merge).Machine: Windows 11, Ryzen 9 7900X + RTX 3060 Ti; Rust stable MSVC, debug; DXC 1.8.2502.11.
cargo test -p xcl --lib far_jump: 3 passed, 0 failed — includes the newfar_jumps_stay_indirect_when_entered_after_getpcfor the #863 case, alongsidea_far_jump_is_a_branch_not_an_unknown_jumpandfar_jumps_are_direct_branches.AI use: test runs by Devin (Cognition, SWE-2); no code changes.
@upipibi on GitHub · 2026-11-24 13:41 UTC · original
This and #865 (opened about two hours earlier) fix #863 the same way, so CONTRIBUTING's "one of several PRs for the same problem" applies. I cross-ran their tests to give the maintainer something to choose on.
The rule is the same in both. Every candidate far jump is resolved first. All direct branch targets plus all candidate far targets go into one set. A sequence keeps its fixed target only if none of its
add/sub,addc/subborsetpcis in that set. The differences:far_targetfirst and returns early when there is no candidate. Onmainevery caller passes freshly decoded instructions, so the reset changes nothing today; it only matters if a list is ever resolved twice after an edit.Tested (Windows 11 Pro 26100, Rust 1.100.0 MSVC, debug; CPU-only tests)
a527eb3(this PR) with #865's threerdna2tests added:cargo test -p xcl --lib far_jump: 6 passed, 0 failed.3544038(#865) with this PR'sfar_jumps_stay_indirect_when_entered_after_getpcadded (clean apply): 6 passed, 0 failed.So each PR passes the other's tests, and the two edit the same lines of
resolve_far_jumps, so only one can land. #865 already has the smoke pair. If this PR is the one kept, #865's tests would be worth carrying over: they cover a jump into theaddcand the subtract form throughrdna2alone.AI-assisted (Claude Code).
@throny on GitHub · 2026-11-24 19:59 UTC · original
Two contributors checked independently and found that this PR makes the same change as #865 #1632 (for #863): #1607, group D31. They suggest keeping #865. If you agree, closing this PR or joining the other one would save the maintainers a review. If the two differ in a way the checks missed, a note in #1607 helps.
This is a hint, not a request from the maintainers; nobody from the project has adopted #1607 so far.
AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.
@ivall on GitHub · 2026-11-24 20:42 UTC · original
Closing this as a duplicate: #865 makes the same change and was opened first (a far jump entered after its s_getpc_b64 stays indirect). It stays open and is the one that will be reviewed and merged.
This says nothing about the quality of the code here. I compared the two diffs; the pair was also found by independent checks in #1607. If this PR covers a case #865 does not, or #865 is closed without being merged, say so and I'll reopen it. A test that is only here is welcome on #865.
Thank you for the work.
AI use: Claude Code (Claude Opus 5.5) compared the diffs and wrote this comment; the decision is the maintainer's.
@DavidM1911 on GitHub · 2026-11-26 03:11 UTC · original
Re-verification on RTX 3060 Ti (Windows 11): still a merge conflict with current
mainon the new head — needs another rebase before it can be tested.Pull request closed