Recompiler: preserve control flow across structured jumps #765

Open
github-bot wants to merge 1 commit from github-bot/gh-765 into main AGit
Owner

@⁠Abuudiii on GitHub · 2026-11-24 04:51 UTC · original
Abuudiii:xcl-701-control-flow → main · +103 −9 · 3 files · 1 commits · open

Fixes #701 in the legacy structured emitter. Reopen a skip guard when a later branch can set it and preserve actual jumps into the else arm.

What is in it

  • Emitter fixes plus synthetic branch and register-readback regressions.

Tested

  • Both emitter tests fail on unmodified base f4ce27c and pass with this patch. Exact SGPR results passed on RX 9070 under GE-Proton11-7 / vkd3d-proton 3.1 / DXC 1.9.2609.5: 2 CPU tests and 1 GPU test, no skips.
  • Independent Windows 11 / RTX 3060 Ti suite on the exact head: cargo test --workspace --no-fail-fast -- --test-threads=1: 704 passed, 0 failed, 41 ignored; the two wave64 tests skipped (gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware). All three PR regressions ran and passed.
  • Independent Windows 11 / RX 9070 XT suite with the PR merged onto 64b3f35: cargo test --workspace -- --test-threads=4: 704 passed, 0 failed, 41 ignored, no GPU skips.

Regression run
Native Windows runs reported by @⁠ryosen0.

xcl-smoke v1
commit: f4ce27ceb6d1b0576d0c659b713b674778bf1968
gpu: NVIDIA GeForce RTX 3060 Ti
title: ScarlettGame
seconds: 90
exit: 0x0
frames shown: 2336 (PresentX 2336)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14473 MB
xcl-smoke v1
commit: 4cfd95109706b8c95e80efe3a20469df9378bbd8
gpu: NVIDIA GeForce RTX 3060 Ti
title: ScarlettGame
seconds: 90
exit: 0x0
frames shown: 2340 (PresentX 2340)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14485 MB

Not tested

  • The smoke checks boot and menus, not gameplay beyond them or a retail reproduction of the #701 shader. The two branch patterns are covered by the synthetic tests.

AI use

  • omp (GPT-6.2 Sol) wrote and locally tested the change and drafted this description. The linked Windows results were produced by the credited contributors.
**@⁠Abuudiii** on GitHub · 2026-11-24 04:51 UTC · [original](https://github.com/xcl-dev/xcl/pull/765) `Abuudiii:xcl-701-control-flow` → `main` · +103 −9 · 3 files · 1 commits · open Fixes #701 in the legacy structured emitter. Reopen a skip guard when a later branch can set it and preserve actual jumps into the else arm. **What is in it** - Emitter fixes plus synthetic branch and register-readback regressions. **Tested** - Both emitter tests fail on unmodified base f4ce27c and pass with this patch. Exact SGPR results passed on RX 9070 under GE-Proton11-7 / vkd3d-proton 3.1 / DXC 1.9.2609.5: 2 CPU tests and 1 GPU test, no skips. - [Independent Windows 11 / RTX 3060 Ti suite](https://github.com/ivall/xcl/pull/765#issuecomment-7122701120) on the exact head: `cargo test --workspace --no-fail-fast -- --test-threads=1`: 704 passed, 0 failed, 41 ignored; the two wave64 tests skipped (`gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`). All three PR regressions ran and passed. - [Independent Windows 11 / RX 9070 XT suite](https://github.com/ivall/xcl/pull/765#issuecomment-7122546172) with the PR merged onto `64b3f35`: `cargo test --workspace -- --test-threads=4`: 704 passed, 0 failed, 41 ignored, no GPU skips. **Regression run** Native Windows runs reported by [@⁠ryosen0](https://github.com/ivall/xcl/pull/765#issuecomment-7122701120). ``` xcl-smoke v1 commit: f4ce27ceb6d1b0576d0c659b713b674778bf1968 gpu: NVIDIA GeForce RTX 3060 Ti title: ScarlettGame seconds: 90 exit: 0x0 frames shown: 2336 (PresentX 2336) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14473 MB ``` ``` xcl-smoke v1 commit: 4cfd95109706b8c95e80efe3a20469df9378bbd8 gpu: NVIDIA GeForce RTX 3060 Ti title: ScarlettGame seconds: 90 exit: 0x0 frames shown: 2340 (PresentX 2340) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14485 MB ``` **Not tested** - The smoke checks boot and menus, not gameplay beyond them or a retail reproduction of the #701 shader. The two branch patterns are covered by the synthetic tests. **AI use** - omp (GPT-6.2 Sol) wrote and locally tested the change and drafted this description. The linked Windows results were produced by the credited contributors.
Fix the legacy emitter’s repeated exit guard and jumps into an else arm. Verify both with small synthetic control-flow programs.
Refs: ivall/xcl#701
Assisted-by: GPT-6.2 Sol
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:31:47 +00:00
Author
Owner

@⁠JoaoPauluu on GitHub · 2026-11-24 04:54 UTC · original

Test report: #765 on NVIDIA under Wine + vkd3d-proton (Linux)

This complements the RX 9070 run in the description with a 32-lane NVIDIA GPU, through the same kind of stack (Wine, vkd3d-proton 3.1, DXC 1.9.2609.5).

Setup

  • CachyOS, kernel 7.3.3-1-cachyos, Intel i5-10400F, 16 GB RAM, NVIDIA GeForce RTX 3060 12 GB, driver 620.70.06
  • Proton Experimental experimental-11.0-20261112 (wine-11.0), vkd3d-proton v3.1 (4522cc1a) + the patch from #257, DXVK from Proton, DXC 1.9.2609.5, DXVK_CONFIG="dxgi.hideNvidiaGpu = False"
  • Rust 1.100.0, x86_64-pc-windows-gnu (mingw-w64-gcc 16.2.0), debug build of this PR's head 4cfd951

Results (lib test binary under Wine, --test-threads=1)

  • Filter structured_: 3 passed, 0 failed, 0 ignored, in 2 of 2 runs: gpu_structured_branch_targets_match_rdna2 (ran, not skipped), structured_jump_into_else_preserves_target, structured_repeated_loop_exit_rechecks_guard
  • Filter gpu::recomp, --skip gpu_more_atomics_sub_dword_scratch_valu (that test hangs NVIDIA under vkd3d-proton, dxil-spirv#372 / #175): 185 passed, 0 failed, 18 ignored. SKIPPED: gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware (no wave64)

Not tested

  • The two CPU tests on the base (the description covers that); Windows; the rest of the suite; a title run

AI use: Claude Code (Claude Opus 5.5) built the tests, ran them on the machine above and wrote this report. The counts are pasted from those runs. The account owner asked for test reports to be posted while they were away and has not reviewed this one.

**@⁠JoaoPauluu** on GitHub · 2026-11-24 04:54 UTC · [original](https://github.com/xcl-dev/xcl/pull/765#issuecomment-7122446183) ### Test report: #765 on NVIDIA under Wine + vkd3d-proton (Linux) This complements the RX 9070 run in the description with a 32-lane NVIDIA GPU, through the same kind of stack (Wine, vkd3d-proton 3.1, DXC 1.9.2609.5). **Setup** - CachyOS, kernel 7.3.3-1-cachyos, Intel i5-10400F, 16 GB RAM, NVIDIA GeForce RTX 3060 12 GB, driver 620.70.06 - Proton Experimental `experimental-11.0-20261112` (wine-11.0), vkd3d-proton v3.1 (`4522cc1a`) + the patch from #257, DXVK from Proton, DXC 1.9.2609.5, `DXVK_CONFIG="dxgi.hideNvidiaGpu = False"` - Rust 1.100.0, `x86_64-pc-windows-gnu` (mingw-w64-gcc 16.2.0), debug build of this PR's head `4cfd951` **Results** (lib test binary under Wine, `--test-threads=1`) - Filter `structured_`: 3 passed, 0 failed, 0 ignored, in 2 of 2 runs: `gpu_structured_branch_targets_match_rdna2` (ran, not skipped), `structured_jump_into_else_preserves_target`, `structured_repeated_loop_exit_rechecks_guard` - Filter `gpu::recomp`, `--skip gpu_more_atomics_sub_dword_scratch_valu` (that test hangs NVIDIA under vkd3d-proton, dxil-spirv#372 / #175): 185 passed, 0 failed, 18 ignored. `SKIPPED`: `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware` (no wave64) **Not tested** - The two CPU tests on the base (the description covers that); Windows; the rest of the suite; a title run **AI use:** Claude Code (Claude Opus 5.5) built the tests, ran them on the machine above and wrote this report. The counts are pasted from those runs. The account owner asked for test reports to be posted while they were away and has not reviewed this one.
Author
Owner

@⁠eizispark on GitHub · 2026-11-24 05:01 UTC · original

Hardware check of 4cfd95109706b8c95e80efe3a20469df9378bbd8 (verified clean merge with main 64b3f35): pass.

Tested

  • Hardware: AMD Radeon RX 9070 XT (RDNA4, driver 32.0.32015.16001), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11, rustc 1.100.0 (0ef1bc386 2026-11-09), release + test profile
  • cargo test --workspace -- --test-threads=4: 704 passed, 0 failed, 41 ignored (GPU tests skipped on this adapter: none)
  • gpu::recomp::tests (gpu_structured_branch_targets_match_rdna2, structured_jump_into_else_preserves_target, structured_repeated_loop_exit_rechecks_guard): 3 passed, 0 failed

Regression run
main (f4ce27c):

xcl-smoke v1
commit: f4ce27ceb6d1b0576d0c659b713b674778bf1968
gpu: AMD Radeon RX 9070 XT
title: GTA6.Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1667 (PresentX 1667)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14847 MB

PR (4cfd951):

xcl-smoke v1
commit: 4cfd95109706b8c95e80efe3a20469df9378bbd8
gpu: AMD Radeon RX 9070 XT
title: GTA6.Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1662 (PresentX 1662)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14855 MB

Not tested

  • wave32-only GPUs (NVIDIA / Intel); gameplay past the menus

AI use

  • Antigravity (Gemini 4 Carbon) ran the build, test suite, and scripts/smoke.ps1 harness on this machine and formatted this report.
**@⁠eizispark** on GitHub · 2026-11-24 05:01 UTC · [original](https://github.com/xcl-dev/xcl/pull/765#issuecomment-7122546172) Hardware check of `4cfd95109706b8c95e80efe3a20469df9378bbd8` (verified clean merge with `main` `64b3f35`): **pass**. **Tested** - Hardware: AMD Radeon RX 9070 XT (RDNA4, driver 32.0.32015.16001), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11, `rustc 1.100.0 (0ef1bc386 2026-11-09)`, release + test profile - `cargo test --workspace -- --test-threads=4`: `704 passed, 0 failed, 41 ignored` (GPU tests skipped on this adapter: `none`) - `gpu::recomp::tests` (`gpu_structured_branch_targets_match_rdna2`, `structured_jump_into_else_preserves_target`, `structured_repeated_loop_exit_rechecks_guard`): `3 passed, 0 failed` **Regression run** `main` (`f4ce27c`): ``` xcl-smoke v1 commit: f4ce27ceb6d1b0576d0c659b713b674778bf1968 gpu: AMD Radeon RX 9070 XT title: GTA6.Xbox.v1.0.2.1 seconds: 60 exit: 0x0 frames shown: 1667 (PresentX 1667) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14847 MB ``` PR (`4cfd951`): ``` xcl-smoke v1 commit: 4cfd95109706b8c95e80efe3a20469df9378bbd8 gpu: AMD Radeon RX 9070 XT title: GTA6.Xbox.v1.0.2.1 seconds: 60 exit: 0x0 frames shown: 1662 (PresentX 1662) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14855 MB ``` **Not tested** - wave32-only GPUs (NVIDIA / Intel); gameplay past the menus **AI use** - Antigravity (Gemini 4 Carbon) ran the build, test suite, and `scripts/smoke.ps1` harness on this machine and formatted this report.
Author
Owner

@⁠ryosen0 on GitHub · 2026-11-24 05:10 UTC · original

Native Windows cross-check for 4cfd951 (RTX 3060 Ti 8 GB, wave32, Ryzen 7 9800X3D, driver 32.0.16.1742, Windows 11), covering the two gaps in Not tested:

Native Windows GPU suite — cargo test --workspace --no-fail-fast -- --test-threads=1: 704 passed, 0 failed, 41 ignored, exit 0. 2 GPU SKIPPED (gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware — no wave64 on this adapter); your two emitter regressions and the register-readback test pass natively.

Paired retail smoke — same title, same duration, release builds, no uncommitted changes; both blocks verbatim.

Main (f4ce27c, this PR's merge-base):

xcl-smoke v1
commit: f4ce27ceb6d1b0576d0c659b713b674778bf1968
gpu: NVIDIA GeForce RTX 3060 Ti
title: ScarlettGame
seconds: 90
exit: 0x0
frames shown: 2336 (PresentX 2336)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14473 MB

Head (4cfd951):

xcl-smoke v1
commit: 4cfd95109706b8c95e80efe3a20469df9378bbd8
gpu: NVIDIA GeForce RTX 3060 Ti
title: ScarlettGame
seconds: 90
exit: 0x0
frames shown: 2340 (PresentX 2340)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14485 MB

Both steady 60 presents / 2 s, no device removal — a no-regression check on the retail boot/menus path, not a repro of #701's shader (that stays covered by your synthetic regressions).

AI use: GPT-6.2 Astra (API model selector) in DSH ran the suite and both smokes and drafted this comment; the human contributor reviewed the numbers before posting.

**@⁠ryosen0** on GitHub · 2026-11-24 05:10 UTC · [original](https://github.com/xcl-dev/xcl/pull/765#issuecomment-7122701120) Native Windows cross-check for `4cfd951` (RTX 3060 Ti 8 GB, wave32, Ryzen 7 9800X3D, driver 32.0.16.1742, Windows 11), covering the two gaps in **Not tested**: **Native Windows GPU suite** — `cargo test --workspace --no-fail-fast -- --test-threads=1`: **704 passed, 0 failed, 41 ignored**, exit 0. 2 GPU SKIPPED (`gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware` — no wave64 on this adapter); your two emitter regressions and the register-readback test pass natively. **Paired retail smoke** — same title, same duration, release builds, no uncommitted changes; both blocks verbatim. Main (`f4ce27c`, this PR's merge-base): ``` xcl-smoke v1 commit: f4ce27ceb6d1b0576d0c659b713b674778bf1968 gpu: NVIDIA GeForce RTX 3060 Ti title: ScarlettGame seconds: 90 exit: 0x0 frames shown: 2336 (PresentX 2336) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14473 MB ``` Head (`4cfd951`): ``` xcl-smoke v1 commit: 4cfd95109706b8c95e80efe3a20469df9378bbd8 gpu: NVIDIA GeForce RTX 3060 Ti title: ScarlettGame seconds: 90 exit: 0x0 frames shown: 2340 (PresentX 2340) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14485 MB ``` Both steady 60 presents / 2 s, no device removal — a no-regression check on the retail boot/menus path, not a repro of #701's shader (that stays covered by your synthetic regressions). **AI use:** GPT-6.2 Astra (API model selector) in DSH ran the suite and both smokes and drafted this comment; the human contributor reviewed the numbers before posting.
Author
Owner

@⁠mastrr9 on GitHub · 2026-11-24 05:14 UTC · original

Independent native Windows NVIDIA RTX 5080 build/test run and code review at head 4cfd95109706b8c95e80efe3a20469df9378bbd8.

Code Review

  • Clean fix for both #701 cases in the legacy structured emitter:
    1. else_ok scans c.edges directly (binary-searched by instruction-ordered src) to reject any branch from [end, t) targeting [t, u), catching nested conditionals to t that structurable_to previously swallowed as an inner if.
    2. emit_structured closes guard whenever !g.is_disjoint(&raised) so a subsequent branch raising the same skip flag re-opens a fresh guard check before the following block.
  • Both CPU emitter checks and the GPU SGPR readback test cover the exact regressions in both structured = true and false modes.

Tested

  • Environment: NVIDIA GeForce RTX 5080 (16 GB, wave32, driver 617.42 / 32.0.16.1742), Windows 11 Pro 25H2 (26200.9974), rustc 1.100.0 (0ef1bc386 2026-11-09), DXC from Windows SDK 10.0.26100.0, debug build.
  • Command: cargo build --workspace && cargo test --workspace -- --test-threads=4
  • Result: 704 passed, 0 failed, 41 ignored (0 new warnings).
  • PR-specific tests (3/3 ok):
    • gpu::recomp::tests::structured_repeated_loop_exit_rechecks_guard
    • gpu::recomp::tests::structured_jump_into_else_preserves_target
    • gpu::recomp::tests::gpu_structured_branch_targets_match_rdna2 (executed on RTX 5080, not skipped)
  • SKIPPED (2):
    • gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask (no wave64)
    • gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware (no wave64)

Not tested

  • D3D12 debug layer (d3d12SDKLayers.dll not installed on this host), AMD/wave64 hardware, release build, and retail titles.

AI use: Antigravity (Gemini 4 Neon) performed the code review, ran the RTX 5080 workspace tests, and drafted this comment.

**@⁠mastrr9** on GitHub · 2026-11-24 05:14 UTC · [original](https://github.com/xcl-dev/xcl/pull/765#issuecomment-7122752905) Independent native Windows NVIDIA RTX 5080 build/test run and code review at head `4cfd95109706b8c95e80efe3a20469df9378bbd8`. ### Code Review - Clean fix for both `#701` cases in the legacy structured emitter: 1. `else_ok` scans `c.edges` directly (binary-searched by instruction-ordered `src`) to reject any branch from `[end, t)` targeting `[t, u)`, catching nested conditionals to `t` that `structurable_to` previously swallowed as an inner `if`. 2. `emit_structured` closes `guard` whenever `!g.is_disjoint(&raised)` so a subsequent branch raising the same skip flag re-opens a fresh guard check before the following block. - Both CPU emitter checks and the GPU SGPR readback test cover the exact regressions in both `structured = true` and `false` modes. ### Tested - **Environment:** NVIDIA GeForce RTX 5080 (16 GB, wave32, driver `617.42` / `32.0.16.1742`), Windows 11 Pro 25H2 (`26200.9974`), `rustc 1.100.0 (0ef1bc386 2026-11-09)`, DXC from Windows SDK `10.0.26100.0`, debug build. - **Command:** `cargo build --workspace && cargo test --workspace -- --test-threads=4` - **Result:** **704 passed, 0 failed, 41 ignored** (0 new warnings). - **PR-specific tests (3/3 `ok`):** - `gpu::recomp::tests::structured_repeated_loop_exit_rechecks_guard` - `gpu::recomp::tests::structured_jump_into_else_preserves_target` - `gpu::recomp::tests::gpu_structured_branch_targets_match_rdna2` (executed on RTX 5080, not skipped) - **SKIPPED (2):** - `gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask` (`no wave64`) - `gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware` (`no wave64`) ### Not tested - D3D12 debug layer (`d3d12SDKLayers.dll` not installed on this host), AMD/wave64 hardware, release build, and retail titles. **AI use:** Antigravity (Gemini 4 Neon) performed the code review, ran the RTX 5080 workspace tests, and drafted this comment.
Author
Owner

@⁠NathanTheophile on GitHub · 2026-11-24 07:00 UTC · original

A random-program check of 4cfd951 with @⁠QemmHD's #701 harness (structure_fuzz.rs from 6e9c949). It's adapted to run without #172: on each tree it compares only main's two forms, the default path and the pc chain, against the harness's CPU reference. The same harness ran on main and on the other #701 PRs, each with its own build directory.

CPU: first-form programs that walk unlike their graph (seeds 1–5000) GPU: 300 seeds × wave32 / split wave64, differences (default / pc chain) the two #701 shapes
main beaa245 132 of 1177 8 / 6 both wrong
#765 4cfd951 0 of 1179 0 / 0 both right
#721 1b4a140 0 of 1179 0 / 0 both right
#729 4255402 (with #728) 3 of 1179 0 / 0 both right

On #729, seeds 431 and 3252 also give wrong SGPRs on the GPU with 16 inputs each, and identical ones on main, so they are real miscompiles. This matches @⁠QemmHD's leftovers on #728. On #765 and #721, those seeds are right.

Tested: NVIDIA GeForce RTX 4060 Laptop GPU (driver 616.87, 32-lane waves, so wave64 runs split), Windows 11 26200, Rust 1.100.0 MSVC, DXC 1.8.2502.11, debug. Not tested: AMD / native wave64; the harness's general-form (#172) checks, which this adaptation drops.

AI-assisted: Claude Code, Claude Opus 5.5.

**@⁠NathanTheophile** on GitHub · 2026-11-24 07:00 UTC · [original](https://github.com/xcl-dev/xcl/pull/765#issuecomment-7124514616) A random-program check of `4cfd951` with @⁠QemmHD's #701 harness (`structure_fuzz.rs` from `6e9c949`). It's adapted to run without #172: on each tree it compares only main's two forms, the default path and the `pc` chain, against the harness's CPU reference. The same harness ran on `main` and on the other #701 PRs, each with its own build directory. | | CPU: first-form programs that walk unlike their graph (seeds 1–5000) | GPU: 300 seeds × wave32 / split wave64, differences (default / pc chain) | the two #701 shapes | |---|---|---|---| | `main` `beaa245` | 132 of 1177 | 8 / 6 | both wrong | | #765 `4cfd951` | **0 of 1179** | **0 / 0** | both right | | #721 `1b4a140` | 0 of 1179 | 0 / 0 | both right | | #729 `4255402` (with #728) | 3 of 1179 | 0 / 0 | both right | On #729, seeds 431 and 3252 also give wrong SGPRs on the GPU with 16 inputs each, and identical ones on `main`, so they are real miscompiles. This matches @⁠QemmHD's leftovers on #728. On #765 and #721, those seeds are right. Tested: NVIDIA GeForce RTX 4060 Laptop GPU (driver 616.87, 32-lane waves, so wave64 runs split), Windows 11 26200, Rust 1.100.0 MSVC, DXC 1.8.2502.11, debug. Not tested: AMD / native wave64; the harness's general-form (#172) checks, which this adaptation drops. _AI-assisted: Claude Code, Claude Opus 5.5._
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-24 22:49 UTC · original

Independent confirmation of this fix on current main, from a different shape of the same bug: two conditional branches whose targets share the start of an else arm.

Tested

  • RTX 5070 Ti (NVIDIA 610.74), Ryzen 9 9950X, Windows 11 26200, release, DXC 1.9.2609.5.
  • A synthetic 12-instruction wave32 compute shader, one wave, where both branches land on the first instruction of the else arm. The case was found by an equivalence check of XCL's output against the guest program, then confirmed on the GPU.
    • main 689f2db: all 32 words store 9. The structured emitter nests the two conditions and skips the else arm, so the expected 13 is never written.
    • This PR rebased onto 689f2db (a local rebase; the one conflict was in recomp/mod.rs, next to main's separate pending-flag fix): all three branch outcomes give the expected values (13, 13, 11).
  • The retail compute pack has 7 programs with exactly this shape, each with one such else start: 305bbb77ddc3ff2d, 6e3fd903765f4376, bf82bfb95451bef8, c3ae68197a76d57f, d3c6619783fb3e57, ee2e847c35bba72c, fbf59c380949b267.
    • Re-exported with only this PR's else_ok edge rejection, all 7 pass a per-lane control-trace comparison against the guest branches; without it, all 7 fail.
    • In our title runs, the title asked for all 7, and 6e3fd903 was built and bound. We have no per-dispatch trace, so whether the title takes the wrong arm with real inputs is not shown.

Not tested

  • The full workspace suite on the rebased head (it's queued), AMD, a smoke pair.
  • Visible output differences in the title.

The rebased head and a second regression test (a compute dispatch with two branches to the else arm) are ready on our side. We can't push them to a fork just now, because our token lacks the workflow scope that main's new stale.yml requires. @⁠Abuudiii, if you rebase onto main, the conflict is a few lines in recomp/mod.rs.

AI use: Claude Code (Claude Opus 5.5) and Codex helpers ran the check and the GPU tests on our machine; Claude Code wrote this.

**@⁠Kalmarv** on GitHub · 2026-11-24 22:49 UTC · [original](https://github.com/xcl-dev/xcl/pull/765#issuecomment-7146687751) Independent confirmation of this fix on current `main`, from a different shape of the same bug: two conditional branches whose targets share the start of an else arm. **Tested** - RTX 5070 Ti (NVIDIA 610.74), Ryzen 9 9950X, Windows 11 26200, release, DXC 1.9.2609.5. - A synthetic 12-instruction wave32 compute shader, one wave, where both branches land on the first instruction of the else arm. The case was found by an equivalence check of XCL's output against the guest program, then confirmed on the GPU. - `main` `689f2db`: all 32 words store 9. The structured emitter nests the two conditions and skips the else arm, so the expected 13 is never written. - This PR rebased onto `689f2db` (a local rebase; the one conflict was in `recomp/mod.rs`, next to `main`'s separate pending-flag fix): all three branch outcomes give the expected values (13, 13, 11). - The retail compute pack has 7 programs with exactly this shape, each with one such else start: `305bbb77ddc3ff2d`, `6e3fd903765f4376`, `bf82bfb95451bef8`, `c3ae68197a76d57f`, `d3c6619783fb3e57`, `ee2e847c35bba72c`, `fbf59c380949b267`. - Re-exported with only this PR's `else_ok` edge rejection, all 7 pass a per-lane control-trace comparison against the guest branches; without it, all 7 fail. - In our title runs, the title asked for all 7, and `6e3fd903` was built and bound. We have no per-dispatch trace, so whether the title takes the wrong arm with real inputs is not shown. **Not tested** - The full workspace suite on the rebased head (it's queued), AMD, a smoke pair. - Visible output differences in the title. The rebased head and a second regression test (a compute dispatch with two branches to the else arm) are ready on our side. We can't push them to a fork just now, because our token lacks the `workflow` scope that `main`'s new `stale.yml` requires. @⁠Abuudiii, if you rebase onto `main`, the conflict is a few lines in `recomp/mod.rs`. AI use: Claude Code (Claude Opus 5.5) and Codex helpers ran the check and the GPU tests on our machine; Claude Code wrote this.
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-24 22:56 UTC · original

Follow-up to the check above: cargo test --workspace (debug) on 689f2db with this PR rebased plus the extra regression test: 979 passed, 0 failed, 45 ignored. The 22 skip notices are 18 native-wave64, 3 unsupported f16 variants and 1 heap windows. The two-branches-to-the-else GPU test ran without a skip. Still not tested: AMD and a smoke pair.

AI use: a Codex helper ran the suite on our machine; Claude Code wrote this.

**@⁠Kalmarv** on GitHub · 2026-11-24 22:56 UTC · [original](https://github.com/xcl-dev/xcl/pull/765#issuecomment-7146831879) Follow-up to the check above: `cargo test --workspace` (debug) on `689f2db` with this PR rebased plus the extra regression test: 979 passed, 0 failed, 45 ignored. The 22 skip notices are 18 native-wave64, 3 unsupported f16 variants and 1 heap windows. The two-branches-to-the-else GPU test ran without a skip. Still not tested: AMD and a smoke pair. AI use: a Codex helper ran the suite on our machine; Claude Code wrote this.
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-24 23:03 UTC · original

@⁠Abuudiii the rebase I mentioned above is now on a branch you can pull: Kalmarv:shared-else-765-rebased. It's ee80f924 (this PR rebased onto main 689f2db, with the one recomp/mod.rs conflict resolved) plus afc55fcd, the extra regression test (a compute dispatch with two branches into the else arm). The workspace run above was on that head. Take it, cherry-pick from it, or ignore it, whichever suits you.

AI use: Claude Code (Claude Opus 5.5) did the rebase and wrote this.

**@⁠Kalmarv** on GitHub · 2026-11-24 23:03 UTC · [original](https://github.com/xcl-dev/xcl/pull/765#issuecomment-7146964565) @⁠Abuudiii the rebase I mentioned above is now on a branch you can pull: [`Kalmarv:shared-else-765-rebased`](https://github.com/Kalmarv/xcl/tree/shared-else-765-rebased). It's `ee80f924` (this PR rebased onto `main` `689f2db`, with the one `recomp/mod.rs` conflict resolved) plus `afc55fcd`, the extra regression test (a compute dispatch with two branches into the else arm). The workspace run above was on that head. Take it, cherry-pick from it, or ignore it, whichever suits you. AI use: Claude Code (Claude Opus 5.5) did the rebase and wrote this.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 11:16 UTC · original

Verification on RTX 3060 Ti (Windows 11): merge conflict with current main — needs a rebase before it can be tested.

**@⁠DavidM1911** on GitHub · 2026-11-25 11:16 UTC · [original](https://github.com/xcl-dev/xcl/pull/765#issuecomment-7160823849) Verification on RTX 3060 Ti (Windows 11): **merge conflict with current `main`** — needs a rebase before it can be tested.
This pull request has changes conflicting with the target branch.
  • README.md
  • crates/xcl/src/gpu/recomp/mod.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/765/head:github-bot/gh-765'
git switch 'github-bot/gh-765'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-765'
git switch 'github-bot/gh-765'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-765'
git switch 'github-bot/gh-765'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-765'
git switch 'main'
git merge --squash 'github-bot/gh-765'
git switch 'main'
git merge --ff-only 'github-bot/gh-765'
git switch 'main'
git merge 'github-bot/gh-765'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.