Repository navigation
Conversation
…c_b64 Collect all direct branch targets and prospective far-jump targets before annotating ar_target in dna2::resolve_far_jumps, and leave any four-instruction GETPC/add/addc/SETPC (or sub/subb) sequence indirect if any branch targets its lo, hi, or set instruction (bypassing s_getpc_b64). Also verify contiguity across the four instructions and clear prior annotations so esolve_far_jumps is idempotent. Fixes xcl-dev#863. Assisted-by: Antigravity (Gemini 4 Neon)
anoyarou
added a commit
to anoyarou/xcl
that referenced
this pull request
Nov 24, 2026
…c_b64 (xcl-dev#1632) Fixes rdna2::resolve_far_jumps so a four-instruction s_getpc_b64 / s_add_u32+s_addc_u32 / s_setpc_b64 sequence is left indirect (far_target = None) whenever any direct branch or prospective far jump targets one of its interior instructions (lo, hi, or set). Assisted-by: Antigravity
Contributor
|
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 AI use: Claude Code (Claude Opus 5.5) compared the diffs and wrote this. |
Contributor
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes
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 D3D12.X: map a one-slice title texture's packed mips where D3D12 addresses them #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.