Recompiler: a jump from the if branch to its else branch runs the else branch (#701) #728
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!728
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/728/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?
@towiice on GitHub · 2026-11-24 04:11 UTC · original
towiice:recompiler-else-jump-target→main· +49 −1 · 2 files · 1 commits · closed without mergingPart of #701 (shape 2). In the first structured form, a conditional jump inside the if branch of an if / else to the start of the else branch ends at the end of the if branch (
hi).item_attook it for a skip to the end of the branch and built an if with no else around the rest of the branch, which includes thes_branchover the else. The jump then lands after the else and the else branch never runs. Now, in the if branch of an if / else (exitis set), a jump tohiis raised as a skip flag; the if / else is rejected as before and the else branch runs under the flag.Shape 1 of #701 (a second jump to a pending flag) is a separate bug and a separate PR: stacked on this one only for the test helper.
What is in it
crates/xcl/src/gpu/recomp/mod.rs(item_at): thet == hi && exit.is_some()case no longer forms an if.crates/xcl/src/gpu/recomp/tests.rs:run_scalar_program(runs a scalar-only program and returns s0..s15) andgpu_a_jump_from_the_if_branch_to_the_else_branch_runs_it, a hand-written program run on the GPU in the structured form and in thepcchain, for the four (s10, s11) combinations.Tested
x86_64-pc-windows-gnullvm(llvm-mingw 20261117), DXC 1.9.2609.5, debugmain(structured: true, s10 = 1, s11 = 0:[1, 0, 0, 1], want[1, 0, 1, 1]) and passes with the fixcargo test -p xcl --lib -- --test-threads=4(with DXC): 659 passed, 3 failed, 21 ignored on this branch plus the PR below; onmainthe same run gives 657 passed and the same 3 failures:title_textures::placed_title_textures_share_vram_and_preserve_pixels,title_textures::transitions_apply_when_their_list_is_submitted,vram::d32s8_targets_take_their_own_size_of_video_memory. They pass whenhle::d3d12xruns alone, so they look like GPU contention on this 4 GB card, not a change of mine.Regression run
None: I have no title for
scripts/smoke.ps1. This changescrates/xcl/src, so the twoxcl-smokeblocks have to come from someone with a title.main:
not run
PR:
not run
Not tested
scripts/smoke.ps1; wave64 (this GPU has none); AMD; MSVC; the rest of the workspace (e2e, integration tests) on this branchmainAI use
@LocranKing on GitHub · 2026-11-24 04:46 UTC · original
Tested on Windows 11 + NVIDIA GeForce RTX 3060 Ti (8 GB, wave32).
Tested
cff9cf70ce8d1c727402212d13102c6ec9b321e1(pr-728, clean tree)8024 MiB VRAM, driver32.0.16.2101),rustc 1.100.0(x86_64-pc-windows-msvc, MSVC14.44.35207), DXC1.9.2602.17(SDK10.0.26100.0),--releasecargo test --workspace --release --no-fail-fast -- --test-threads=4: 686 passed, 0 failed, 41 ignored, exit0;2 (no wave64)skipped (gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware)Regression run (
scripts/smoke.ps1, 60 s,XCL_NETWORK=0, title folder name redacted)main (
64b3f35):PR #728 (
cff9cf7):Not tested: Debug build,
XCL_SAMPLE_RPF/ shader corpus tests on this branch, AMD / wave64 hardware.AI use: Antigravity (
Gemini 4 Hydrogen) ran the build, tests, and smoke runs and drafted this report from the command outputs.@ItsMrDubey on GitHub · 2026-11-24 04:57 UTC · original
Test report for
cff9cf70ce8d1c727402212d13102c6ec9b321e1(this PR's head)Tested
stable-x86_64-pc-windows-msvc), debug; DXC 1.9.2602.17 from Windows SDK 10.0.2610016 test binaries: 685 passed, 1 failed, 41 ignored. Same machine,
main64b3f3559: 700 passed, 1 failed, 41 ignored.This PR's tests:
gpu::recomp::tests::gpu_a_jump_from_the_if_branch_to_the_else_branch_runs_it: okFailures:
hle::kernelx::tests::xmem_virtual_query_marks_cpu_readable_memoryfails on this machine on every run, on this PR's head and onmain64b3f3559alike (5 of 5 reruns onmain), so it is not from this PR. #650 fixes it here.16 test binaries instead of
main's 17 because this branch predatestests/sparse_reinit.rs; nothing crashed.SKIPPED (no wave64 on this GPU):
gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.AI use: Claude Code (Claude Opus 5.5) ran the builds and tests and wrote this report from their output.
@QemmHD on GitHub · 2026-11-24 05:03 UTC · original · edited 2026-11-24 05:04 UTC
Verified with the CPU-reference harness from #701, ported to
main+ #728 + #729: QemmHD/xclreview/701-fixes(fed3380, test-only). RTX 4070 SUPER (621.24), DXC 1.8.2502.11, main64b3f35.With both PRs, both #701 tests and both of your tests pass, and the full suite gives 715 passed, 0 failed, 41 ignored (main: 701 / 0 / 41; +14 = the 2 PR tests and 12 ported harness tests). No program that walked right on
maingoes wrong with both.main(seeds 2310, 10091, 19167, 19176: e.g. 2310 moves from thepcchain into the first form and is wrong without #729). All 4 are right with both.ifbranch, whoses_branchover its own else lands on the start of the outer else.else_endacceptsu == hi, so the jump is emitted as nothing and the outer else is skipped (s10 = s11 = 0: s3 comes out 0 instead of 1, in both forms). Test:first_form_runs_the_else_a_nested_jump_lands_in(should_panicuntil fixed), withgpu_nested_jump_into_else_in_each_formon the GPU. Adding&& !(u == hi && exit.is_some())to theelse_endfilter initem_at'sIfarm (mod.rs:701on #729) takes it to 0 / 4 789 on the CPU and 0 / 1 200 on the GPU, with your tests still passing.AI-assisted (Claude Code, Claude Opus 5.5).
Discord: bigpeppa.
@raylitebull on GitHub · 2026-11-24 10:44 UTC · original
Closing as a duplicate of #765 for #701, which passes the
PR descriptioncheck (whereas this PR failsPR description).Pull request closed