Recompiler: the first structured form runs code a taken jump skips, and skips an else it jumps into #701
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#701
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@QemmHD on GitHub · 2026-11-24 03:48 UTC · original
Two shapes that the first structured form (
emit_structured/structured_span, used for single-entry stretches when the general structurizer isn't on) translates wrongly onmain(checked atdd2ae9a). Found while reviewing #172; neither comes from #172, and #172's general form gets both right.1. A jump to a target whose skip flag is already pending leaves the open guard in place (
gpu/recomp/mod.rs:924)The jump doesn't close the open
if (!(xcl_skip_…)), so the items after it still run. Shape: a loop with two exits to the same block, plus anifbefore the latch (two_breaks_programwith s11 = 2).s0..s4 expected
[1,1,0,1,0]; thepcchain path (Options { structured: false }) and the default path give[1,1,1,1,1].2. A jump from the if branch to the start of the else branch is treated as a skip to the end of the if branch (
gpu/recomp/mod.rs:693,item_at)The else branch never runs. Expected
[1,1,0,1,1], got[1,1,0,0,1].Both reproduce on the GPU (RTX 4070 SUPER, NVIDIA 621.24, wave32) and against a CPU reference run. In a random run of 1 200 small programs (600 wave32, 600 split wave64), the
pcchain and the default path differed from the CPU reference in 13; the general form of #172 in none.Tests (test-only commit
6e9c949, branch https://github.com/QemmHD/xcl/tree/review/172-structure,crates/xcl/src/gpu/recomp/tests/structure_fuzz.rs):first_form_runs_code_a_taken_jump_skipsandfirst_form_skips_the_else_branch_it_jumps_into: CPU,#[should_panic]until fixed;gpu_first_form_counter_examples_are_right_in_the_general_form: both shapes on the GPU, in every form.Since
Options { structured: false }still goes through this form for single-entry stretches, it also affects #172's own GPU test, which uses that path as its reference.AI-assisted (Claude Code, Claude Opus 5.5).
Discord: bigpeppa.
@towiice on GitHub · 2026-11-24 04:11 UTC · original
Both shapes reproduced on a GTX 1650 SUPER (wave32, DXC 1.9) and fixed in two draft PRs: #728 (shape 2, the jump into the else branch) and #729 (shape 1, stacked on #728 for the test helper). Both wait for
xcl-smokeruns from someone with a title. Claude Code (Claude Sonnet 5.5).@NathanTheophile on GitHub · 2026-11-24 07:02 UTC · original
On Windows with an RTX 4060 Laptop GPU, the same synthetic regression passed 18/24 register comparisons on main (
beaa245), 24/24 on #721 (1b4a140) and #765 (4cfd951), 20/24 on #728 (cff9cf7), and 22/24 on #729 (4255402). The nested else jump still failed on #729. All PR-owned tests passed.I’d keep #765 as the candidate.
cargo test --workspace --no-fail-fast -- --test-threads=4reported 704 passed, 0 failed, 41 ignored, and two wave64 capability skips. Its description check passed. Required CI and maintainer validation still apply. The local comparison used synthetic fixtures only.AI use