Recompiler: first structured form stops at a taken jump to a pending target and runs an else it jumps into (#701) #721
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!721
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/721/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?
@dadnotdaddy on GitHub · 2026-11-24 04:04 UTC · original
dadnotdaddy:fix-701→main· +56 −0 · 2 files · 1 commits · closed without mergingFixes #701: the first structured form ran code after a taken jump to a pending target, and skipped an else that the if branch jumps into.
What is in it
crates/xcl/src/gpu/recomp/mod.rs: a skip flag set inside an open guard closes it, so the next item tests the flags again;else_okrefusesif/elsewhen the if branch jumps to the else's start.crates/xcl/src/gpu/recomp/tests.rs:first_structured_form_follows_jumps_to_pending_targets_and_into_the_else, both shapes from the issue, structured andstructured: false.Tested
maingives the issue's results ([1,1,1,1,1], [1,1,0,0,1]); with the fix [1,1,0,1,0], [1,1,0,1,1].cargo test --workspace -- --test-threads=4: 658 passed, 3 failed, 21 ignored. The 3 (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) fail the same way onmainin the full run here and pass when run alone, onmainand on this branch.gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware(no wave64).Regression run
scripts/smoke.ps1on. A smoke run from a tester would be appreciated.Not tested
AI use
@MesshM on GitHub · 2026-11-24 04:14 UTC · original
Test run of
1b4a1402fc299a65559170464c1e1bd618face5don AMD RDNA4. I merged it onto currentmainf4ce27clocally (clean merge) and tested that tree.Tested
stable-x86_64-pc-windows-msvc, debugcargo build --workspace+cargo test --workspace -- --test-threads=4on the merge: 702 passed, 0 failed, 41 ignored, exit code 0;xcllib tests 661 passed, 0 failed, 21 ignoredSKIPPED;first_structured_form_follows_jumps_to_pending_targets_and_into_the_elsepasses.Review: Both halves are small: a skip flag raised inside an open guard now closes it, and
else_okrefuses anif/elsewhose if-branch jumps to the else's start. The test runs the two shapes from #701 structured and unstructured. I did not go through every caller of the structurizer.Not tested: no retail title or regression run (I have no unpacked game), no
XCL_SAMPLE_*tests, release build; the PR's head on its old base was not run, only its merge ontomain.Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.
@lordon1a on GitHub · 2026-11-24 04:15 UTC · original
Independent test report on
1b4a140:Tested
616.64, wave32, SM 6.6), Intel i7-12700H, Windows 11 Home 26H2 (build 26200),rustc 1.100.0(x86_64-pc-windows-gnullvm), debug build, DXC1.9.2609.5(01b62ad4)cargo test -p xcl --lib first_structured_form_follows_jumps_to_pending_targets_and_into_the_else -- --nocapture0.64sNot tested
xcl-smoke)AI use
1b4a140in a detached worktree, audited the diff, ran the test suite, and posted this report.@ItsMrDubey on GitHub · 2026-11-24 04:57 UTC · original
Test report for
1b4a1402fc299a65559170464c1e1bd618face5d(this PR's head)Tested
stable-x86_64-pc-windows-msvc), debug; DXC 1.9.2602.17 from Windows SDK 10.0.2610017 test binaries: 701 passed, 1 failed, 41 ignored. Same machine,
main64b3f3559: 700 passed, 1 failed, 41 ignored.This PR's tests:
gpu::recomp::tests::first_structured_form_follows_jumps_to_pending_targets_and_into_the_else: 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.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.
@upipibi on GitHub · 2026-11-24 05:10 UTC · original
A wider check of
1b4a140with @QemmHD's random-program differential tests from #701 (structure_fuzz.rs, test-only commit6e9c949onreview/172-structure). They need #172's general form as the reference, so the tree wasmain64b3f35+ #172 (ca66c4a) +6e9c949, run without and with this PR. The two test files conflict only by both appending at the end, and I kept both.random_programs_structure_like_their_graph,XCL_STRUCTURE_FUZZ=5000(CPU): first structured form walks unlike its graphgpu_random_programs_match_the_reference,XCL_STRUCTURE_FUZZ=600(600 seeds × wave32 and split wave64, 34 052 blocks run): differences in the first structured form /pcchainfirst_form_runs_code_a_taken_jump_skips,first_form_skips_the_else_branch_it_jumps_into(#[should_panic]until fixed)first_structured_form_follows_jumps_to_pending_targets_and_into_the_elseThe general form matched the CPU reference in all 1 200 GPU programs both times. So on this corpus the fix covers the whole class, not only the two shapes in #701. The structured count moves from 1117 to 1119 because
else_oknow declines a few if/else shapes. Once both land, the two#[should_panic]markers instructure_fuzz.rscan be dropped.Tested: NVIDIA GeForce RTX 3070 (driver 616.56, wave32), Ryzen 9 5950X, Windows 11 Pro 26100, rustc 1.100.0, debug.
AI-assisted (Claude Code).
@throny on GitHub · 2026-11-24 06:26 UTC · original
Retail regression run for
1b4a1402fc299a65559170464c1e1bd618face5d(this PR's head) on NVIDIA, as asked for in #42. Uneditedscripts/smoke.ps1output; themainblock is this PR's merge basef4ce27c, so the two builds differ only by this PR.Tested
stable-x86_64-pc-windows-msvc; release builds (cargo build --release -p xcl), no uncommitted changes.scripts/smoke.ps1 -Game <folder> -Seconds 60, a retail title, warm shader cache. Each build ran twice in a row; the blocks are the second runs. The first runs:f4ce27c1630 frames, this PR 1634 frames, both exit 0x0, 0 device removals, 0 crashes.Regression run
main (
f4ce27c):PR (
1b4a140):Not tested
AI use
@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