Recompiler: fix trivial phi collapse, 0-pred phis, and chains in recomp::ssa #2138

Merged
Decodere merged 1 commit from upstream-pr/2148 into main 2026-11-29 22:50:46 +00:00
Decodere commented 2026-11-25 06:18:19 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Decodere on 2026-11-25T06:18:19Z.


What is in it

Fixes four Braun et al. SSA construction bugs in crates/xcl/src/gpu/recomp/ssa.rs (used by recomp/lower.rs and recomp/lower_dxil.rs, where uncollapsed trivial phis break resolve_value(v) checks against num_marker / bit_marker):

  1. Missing users transfer on trivial phi collapse (remove_trivial / replace_phi): Previously, self.users.remove(&phi) dropped every user of a collapsed phi that remained non-trivial at that moment (for example, phi3 = phi(phi2, a) when phi2 collapsed to an unsealed outer phi1). When phi1 later collapsed to a (or collapsed later in the same users loop when users[phi2] ordered [phi3, phi1]), phi3 was never revisited and remained live as a trivial phi(a, a). Live users (user != phi && user != replacement && self.operands.contains_key(&user)) are now transferred into self.users[replacement] before cascading remove_trivial().
  2. Stale return value from remove_trivial (replace_phi): When a mutual phi cycle (phi1 = phi(a, phi2) and phi2 = phi(phi1, phi2)) collapsed phi2 -> phi1 and cascaded phi1 -> a, remove_trivial returned the already-replaced same (phi1) instead of self.resolve(same) (a). Now returns self.resolve(replacement).
  3. Malformed 0-operand phis on unsealed 0-predecessor blocks and complete operand registration (add_operands): Sealing an unsealed block with preds[block].is_empty() previously left a 0-operand phi live (same == None) instead of replacing it with sink.undef(var). add_operands() now replaces 0-predecessor incomplete phis with sink.undef(var) via replace_phi() (transferring and cascading any users), and for non-empty predecessors collects all incoming (pred, value) pairs and resolves each value before populating operands/users so a half-populated phi is never exposed to a recursive remove_trivial() cascade.
  4. Iterative single-predecessor chain walk with cycle detection (read): read() previously recursed unconditionally on preds[block].len() == 1, overflowing the stack on deep straight-line chains and on unreachable sealed 1-predecessor cycles (preds[b] = [b] or a <-> b). Sealed single-predecessor chains are now walked iteratively with HashSet cycle detection, returning and caching sink.undef(var) on unreachable 1-predecessor cycles.

Adds four deterministic pure-CPU regression tests in gpu::recomp::ssa::tests covering all four bugs.

Part of #1269

Tested

Hardware/toolchain: Windows 11 (26200), NVIDIA GeForce RTX 4060 (32-lane waves, driver 621.14), DXC 1.9.2609.5 (01b62ad4), Rust 1.100.0.

  • Verified pre-fix failures on all 4 new regression tests before applying the fixes (delayed_trivial_phi_collapse_transfers_users: live phis left: [4]; mutual_phi_cycle_collapse_returns_resolved_value: returned stale 3 instead of 1; unsealed_zero_pred_block_replaces_incomplete_phi_with_undef: 0-pred phi stayed live: [1, 2]; sealed_single_pred_cycle_and_deep_chain_do_not_overflow: STATUS_STACK_OVERFLOW 0xc00000fd).
  • cargo test --release -p xcl --lib gpu::recomp::ssa::tests::: 10 passed, 0 failed, 0 ignored (pure CPU, CI WARP-safe).
  • cargo test --release -p xcl --lib gpu::recomp::lower::tests:: -- --test-threads=1: 35 passed, 0 failed, 0 ignored.
  • cargo test --release -p xcl --lib gpu::recomp::lower_dxil::tests:: -- --test-threads=1: 18 passed, 0 failed, 0 ignored.
  • cargo build --release --workspace: exit 0.
  • cargo test --release --workspace -- --test-threads=4: 1158 passed, 0 failed, 46 ignored across 21 test suites, with 25 pre-existing runtime SKIPPED lines (23 native wave64 / unsupported per-lane lowering skips on 32-lane RTX 4060, 1 Windows driver-cache skip, 1 heap-window skip; 0 new skips).

Regression run

Paired 60-second scripts/smoke.ps1 runs on the same retail title build (29640639) from clean origin/main (6ea813a) and this branch (a7f059b):

Base (origin/main):

xcl-smoke v1
commit: 6ea813a61f7d324e2fcbeb0c6a068edcd37e818b
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1588 (PresentX 1588)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14476 MB

PR (fix-1269-recomp-ssa-braun-bugs):

xcl-smoke v1
commit: a7f059b9972bda022a825b6bf3e079b143082b50
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1584 (PresentX 1585)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14476 MB

Not tested

  • Native 64-lane wave64 GPU hardware (the test GPU is a 32-lane NVIDIA RTX 4060; recomp::ssa is wave-size-independent SSA construction and all new tests are deterministic CPU unit tests).
  • Non-Windows host platforms.

AI use

Drafted with Google Antigravity (Gemini 4 Neon) and verified locally by reproducing all four failures before the fix (including stack overflow on the 1-predecessor cycle/chain test), running recomp::ssa, recomp::lower, recomp::lower_dxil, and the full release workspace test suite, and completing the paired 60-second smoke run above.

<!-- greyfinch-sync:ivall/xcl:issue:5486253900 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2148). Originally posted by [Decodere](https://github.com/Decodere) on 2026-11-25T06:18:19Z. --- **What is in it** Fixes four Braun et al. SSA construction bugs in `crates/xcl/src/gpu/recomp/ssa.rs` (used by `recomp/lower.rs` and `recomp/lower_dxil.rs`, where uncollapsed trivial phis break `resolve_value(v)` checks against `num_marker` / `bit_marker`): 1. **Missing `users` transfer on trivial phi collapse (`remove_trivial` / `replace_phi`)**: Previously, `self.users.remove(&phi)` dropped every user of a collapsed phi that remained non-trivial at that moment (for example, `phi3 = phi(phi2, a)` when `phi2` collapsed to an unsealed outer `phi1`). When `phi1` later collapsed to `a` (or collapsed later in the same `users` loop when `users[phi2]` ordered `[phi3, phi1]`), `phi3` was never revisited and remained live as a trivial `phi(a, a)`. Live users (`user != phi && user != replacement && self.operands.contains_key(&user)`) are now transferred into `self.users[replacement]` before cascading `remove_trivial()`. 2. **Stale return value from `remove_trivial` (`replace_phi`)**: When a mutual phi cycle (`phi1 = phi(a, phi2)` and `phi2 = phi(phi1, phi2)`) collapsed `phi2 -> phi1` and cascaded `phi1 -> a`, `remove_trivial` returned the already-replaced `same` (`phi1`) instead of `self.resolve(same)` (`a`). Now returns `self.resolve(replacement)`. 3. **Malformed 0-operand phis on unsealed 0-predecessor blocks and complete operand registration (`add_operands`)**: Sealing an unsealed block with `preds[block].is_empty()` previously left a 0-operand phi live (`same == None`) instead of replacing it with `sink.undef(var)`. `add_operands()` now replaces 0-predecessor incomplete phis with `sink.undef(var)` via `replace_phi()` (transferring and cascading any users), and for non-empty predecessors collects all incoming `(pred, value)` pairs and resolves each value before populating `operands`/`users` so a half-populated phi is never exposed to a recursive `remove_trivial()` cascade. 4. **Iterative single-predecessor chain walk with cycle detection (`read`)**: `read()` previously recursed unconditionally on `preds[block].len() == 1`, overflowing the stack on deep straight-line chains and on unreachable sealed 1-predecessor cycles (`preds[b] = [b]` or `a <-> b`). Sealed single-predecessor chains are now walked iteratively with `HashSet` cycle detection, returning and caching `sink.undef(var)` on unreachable 1-predecessor cycles. Adds four deterministic pure-CPU regression tests in `gpu::recomp::ssa::tests` covering all four bugs. Part of #1269 **Tested** Hardware/toolchain: Windows 11 (26200), NVIDIA GeForce RTX 4060 (32-lane waves, driver 621.14), DXC `1.9.2609.5 (01b62ad4)`, Rust `1.100.0`. - Verified pre-fix failures on all 4 new regression tests before applying the fixes (`delayed_trivial_phi_collapse_transfers_users`: `live phis left: [4]`; `mutual_phi_cycle_collapse_returns_resolved_value`: returned stale `3` instead of `1`; `unsealed_zero_pred_block_replaces_incomplete_phi_with_undef`: `0-pred phi stayed live: [1, 2]`; `sealed_single_pred_cycle_and_deep_chain_do_not_overflow`: `STATUS_STACK_OVERFLOW` `0xc00000fd`). - `cargo test --release -p xcl --lib gpu::recomp::ssa::tests::`: **10 passed, 0 failed, 0 ignored** (pure CPU, CI WARP-safe). - `cargo test --release -p xcl --lib gpu::recomp::lower::tests:: -- --test-threads=1`: **35 passed, 0 failed, 0 ignored**. - `cargo test --release -p xcl --lib gpu::recomp::lower_dxil::tests:: -- --test-threads=1`: **18 passed, 0 failed, 0 ignored**. - `cargo build --release --workspace`: exit 0. - `cargo test --release --workspace -- --test-threads=4`: **1158 passed, 0 failed, 46 ignored** across 21 test suites, with 25 pre-existing runtime `SKIPPED` lines (23 native wave64 / unsupported per-lane lowering skips on 32-lane RTX 4060, 1 Windows driver-cache skip, 1 heap-window skip; 0 new skips). **Regression run** Paired 60-second `scripts/smoke.ps1` runs on the same retail title build (`29640639`) from clean `origin/main` (`6ea813a`) and this branch (`a7f059b`): Base (`origin/main`): ``` xcl-smoke v1 commit: 6ea813a61f7d324e2fcbeb0c6a068edcd37e818b gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1588 (PresentX 1588) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14476 MB ``` PR (`fix-1269-recomp-ssa-braun-bugs`): ``` xcl-smoke v1 commit: a7f059b9972bda022a825b6bf3e079b143082b50 gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1584 (PresentX 1585) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14476 MB ``` **Not tested** - Native 64-lane wave64 GPU hardware (the test GPU is a 32-lane NVIDIA RTX 4060; `recomp::ssa` is wave-size-independent SSA construction and all new tests are deterministic CPU unit tests). - Non-Windows host platforms. **AI use** Drafted with Google Antigravity (Gemini 4 Neon) and verified locally by reproducing all four failures before the fix (including stack overflow on the 1-predecessor cycle/chain test), running `recomp::ssa`, `recomp::lower`, `recomp::lower_dxil`, and the full release workspace test suite, and completing the paired 60-second smoke run above.
futurepro62 commented 2026-11-25 07:05:45 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-25T07:03:17Z.


Full-suite run, since this PR has no test report yet. Tested exact head a7f059b (on its base 6ea813a).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::recomp::lower_dxil::tests::mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests: 1146 passed, 0 failed, 44 ignored. SKIPPED (no wave64): a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu, a_per_lane_2d_or_3d_group_runs_on_the_gpu, coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu, cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu, gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware, the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu.
  • The new tests ran and passed: delayed_trivial_phi_collapse_transfers_users, mutual_phi_cycle_collapse_returns_resolved_value, unsealed_zero_pred_block_replaces_incomplete_phi_with_undef, sealed_single_pred_cycle_and_deep_chain_do_not_overflow.
  • Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1: 1157 passed, 0 failed, 46 ignored. SKIPPED: f16_programs_on_the_gpu (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), f32_programs_on_the_gpu (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), f32_programs_on_the_gpu (f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • --skip leaves out tests that fail on main 568e7db too, not because of this PR. On NVIDIA: heap_window_out_of_memory_falls_back_to_the_switch_form (#1651), the four gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu tests, const_and_null_mask_operands_agree_with_hlsl_on_the_gpu and mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu (follow-up on #1651) fail because runner::skip_test turns their skips into failures under XCL_REQUIRE_GPU=mesh, and gpu::dxil::fuzz_tests seeds 70, 545, 1019 and 1507 fail CreateComputePipelineState with E_OUTOFMEMORY on this card (drivers 616.64 and 621.40). On AMD: fuzz_validate_and_gpu_1 fails on seed 540 (res[833] 0x7 vs CPU 0x6). The AMD run does not set XCL_REQUIRE_GPU.

Not tested

  • a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
<!-- greyfinch-sync:ivall/xcl:comment:7155437640 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2148#issuecomment-7155437640). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-25T07:03:17Z. --- Full-suite run, since this PR has no test report yet. Tested exact head `a7f059b` (on its base `6ea813a`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::recomp::lower_dxil::tests::mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests`: **1146 passed, 0 failed, 44 ignored**. SKIPPED (no wave64): `a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu`, `a_per_lane_2d_or_3d_group_runs_on_the_gpu`, `coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu`, `cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu`, `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`, `the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu`. - The new tests ran and passed: `delayed_trivial_phi_collapse_transfers_users`, `mutual_phi_cycle_collapse_returns_resolved_value`, `unsealed_zero_pred_block_replaces_incomplete_phi_with_undef`, `sealed_single_pred_cycle_and_deep_chain_do_not_overflow`. - Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, `XCL_ADAPTER=radeon`), `cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1`: **1157 passed, 0 failed, 46 ignored**. SKIPPED: `f16_programs_on_the_gpu` (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), `f16_programs_on_the_gpu` (f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), `f16_programs_on_the_gpu` (f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), `f16_programs_on_the_gpu` (f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), `f32_programs_on_the_gpu` (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), `f32_programs_on_the_gpu` (f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). - `--skip` leaves out tests that fail on main `568e7db` too, not because of this PR. On NVIDIA: `heap_window_out_of_memory_falls_back_to_the_switch_form` (#1651), the four `gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu` tests, `const_and_null_mask_operands_agree_with_hlsl_on_the_gpu` and `mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu` ([follow-up on #1651](https://github.com/xcl-dev/xcl/issues/1651#issuecomment-7146069648)) fail because `runner::skip_test` turns their skips into failures under `XCL_REQUIRE_GPU=mesh`, and `gpu::dxil::fuzz_tests` seeds 70, 545, 1019 and 1507 fail `CreateComputePipelineState` with `E_OUTOFMEMORY` on this card (drivers 616.64 and 621.40). On AMD: `fuzz_validate_and_gpu_1` fails on seed 540 (`res[833]` 0x7 vs CPU 0x6). The AMD run does not set `XCL_REQUIRE_GPU`. **Not tested** - a release build, a game (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
DavidM1911 commented 2026-11-25 08:08:08 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T07:05:48Z.


Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: 1038 passed, 1 failed in one parallel run; the failing test passes on a single-threaded rerun (1039/0). Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7155483029 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2148#issuecomment-7155483029). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T07:05:48Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: 1038 passed, 1 failed in one parallel run; the failing test passes on a single-threaded rerun (1039/0). Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun. Thanks!
upipibi commented 2026-11-26 23:19:06 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by upipibi on 2026-11-26T23:19:06Z.


Tested head a7f059b9972bda022a825b6bf3e079b143082b50, merge-base 6ea813a61f7d324e2fcbeb0c6a068edcd37e818b, RTX 3070 (Ampere) driver 616.56, Windows 11, rustc 1.100.0

  • cargo test -p xcl --lib -- gpu::recomp::ssa --test-threads=1 --nocapture, 3 runs on head: 10 passed, 0 failed (each run; the 4 new tests included). CPU-only, no GPU involved.
  • Negative control: the PR's ssa.rs test hunk (4 new tests) applied alone to the merge-base (compiles): delayed_trivial_phi_collapse_transfers_users, mutual_phi_cycle_collapse_returns_resolved_value and unsealed_zero_pred_block_replaces_incomplete_phi_with_undef fail (assertion panics); sealed_single_pred_cycle_and_deep_chain_do_not_overflow overflows the stack and aborts the test process (exit code 0xc00000fd). The 6 older tests pass.
  • cargo test -p xcl --lib -- --test-threads=4: head 1102 passed, 0 failed, 26 ignored; merge-base (unmodified) 1098 passed, 0 failed, 26 ignored.
  • SKIPPED lines (24, same set on both): 20 "no wave64" (32-lane waves only), 3 refused f16/conversion fixtures (#1426), 1 driver-cache test needing Windows Developer Mode.

Not tested: retail title; AMD hardware.

AI-assisted (Claude Code, Claude Sonnet 5.5 ran the tests; Claude Opus 5.5 checked and posted).

<!-- greyfinch-sync:ivall/xcl:comment:7205439871 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2148#issuecomment-7205439871). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-26T23:19:06Z. --- Tested head `a7f059b9972bda022a825b6bf3e079b143082b50`, merge-base `6ea813a61f7d324e2fcbeb0c6a068edcd37e818b`, RTX 3070 (Ampere) driver 616.56, Windows 11, rustc 1.100.0 - `cargo test -p xcl --lib -- gpu::recomp::ssa --test-threads=1 --nocapture`, 3 runs on head: 10 passed, 0 failed (each run; the 4 new tests included). CPU-only, no GPU involved. - Negative control: the PR's `ssa.rs` test hunk (4 new tests) applied alone to the merge-base (compiles): `delayed_trivial_phi_collapse_transfers_users`, `mutual_phi_cycle_collapse_returns_resolved_value` and `unsealed_zero_pred_block_replaces_incomplete_phi_with_undef` fail (assertion panics); `sealed_single_pred_cycle_and_deep_chain_do_not_overflow` overflows the stack and aborts the test process (exit code 0xc00000fd). The 6 older tests pass. - `cargo test -p xcl --lib -- --test-threads=4`: head 1102 passed, 0 failed, 26 ignored; merge-base (unmodified) 1098 passed, 0 failed, 26 ignored. - SKIPPED lines (24, same set on both): 20 "no wave64" (32-lane waves only), 3 refused f16/conversion fixtures (#1426), 1 driver-cache test needing Windows Developer Mode. Not tested: retail title; AMD hardware. AI-assisted (Claude Code, Claude Sonnet 5.5 ran the tests; Claude Opus 5.5 checked and posted).
throny commented 2026-11-29 00:12:18 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-29T00:12:18Z.


merge-check claim
head: a7f059b997

<!-- greyfinch-sync:ivall/xcl:comment:7247948496 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2148#issuecomment-7247948496). Originally posted by [throny](https://github.com/throny) on 2026-11-29T00:12:18Z. --- merge-check claim head: a7f059b9972bda022a825b6bf3e079b143082b50
throny commented 2026-11-29 00:29:50 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-29T00:29:50Z.


merge-check
base: b10cc4c6
head: a7f059b997
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2611 passed, 0 failed, 49 ignored on the merge result with main b10cc4c6 (27 SKIPPED lines).
review: no blocking finding; all hunks read. When a phi collapses, its users are now also registered on the value that replaces it, so they are looked at again if that value collapses later; the function returns the resolved value instead of a phi already replaced; operands are all read before any user is registered, so a half-filled phi cannot be collapsed in a cascade; a phi in a block without predecessors becomes undefined; chains of single-predecessor blocks are walked with a seen-set, so an unreachable cycle ends. Every collapse removes one live phi, so the loop terminates. No signature changes. Minor: the user lists use a linear search, which is quadratic when one value has very many users.
performance: none measurable expected. It changes a per-lane source only: only per-lane cache entries (XCL_PER_LANE) are re-translated.
verdict: safe to merge
hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).

<!-- greyfinch-sync:ivall/xcl:comment:7248152803 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2148#issuecomment-7248152803). Originally posted by [throny](https://github.com/throny) on 2026-11-29T00:29:50Z. --- merge-check base: b10cc4c6 head: a7f059b9972bda022a825b6bf3e079b143082b50 merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2611 passed, 0 failed, 49 ignored on the merge result with main b10cc4c6 (27 SKIPPED lines). review: no blocking finding; all hunks read. When a phi collapses, its users are now also registered on the value that replaces it, so they are looked at again if that value collapses later; the function returns the resolved value instead of a phi already replaced; operands are all read before any user is registered, so a half-filled phi cannot be collapsed in a cascade; a phi in a block without predecessors becomes undefined; chains of single-predecessor blocks are walked with a seen-set, so an unreachable cycle ends. Every collapse removes one live phi, so the loop terminates. No signature changes. Minor: the user lists use a linear search, which is quadratic when one value has very many users. performance: none measurable expected. It changes a per-lane source only: only per-lane cache entries (XCL_PER_LANE) are re-translated. verdict: safe to merge hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).
moombathepilot commented 2026-11-29 17:05:22 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by moombathepilot on 2026-11-29T17:05:22Z.


merge-check

base: 0fe06eb0f0

head: a7f059b997

merge: clean

build: cargo build --workspace passed.

tests: cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture reported 2,739 passed, 2 failed, and 49 ignored, with 12 explicit SKIPPED notices. All 10 SSA unit tests passed, including the four added by this PR. The native-wave branch test and mixed-mask branch comparison against HLSL also passed on AMD.

Both failures matched targeted runs previously made on the exact unmodified base on this machine:

  • fuzz_validate_and_gpu_1 produced the same GPU/CPU mismatch at seed 722.
  • two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs failed the same assertion on releasing two-pass state.

review: Read the full PR and trial-merge diffs. Phi replacement transfers users before cascading and returns the resolved value. The iterative predecessor walk handles cycles and deep chains. The new tests cover delayed cascades, mutual phi cycles, zero-predecessor blocks, and a 20,000-block chain. No blocking findings. git diff --cached --check passed.

performance: The change affects per-lane shader translation. The predecessor walk uses a visited set, and phi-user deduplication uses linear scans. Translation time and frame time were not measured. No retail smoke run was performed for this Tier 1 check.

verdict: safe to merge

hardware / tool and model: Windows 11 Home build 26300, Ryzen 7 5700X3D, Radeon RX 7800 XT (driver 32.0.32029.2010), Rust 1.100.0 x86_64-pc-windows-msvc. Codex (GPT-6, exact variant unavailable) verified refs, reviewed the diffs, ran the build and tests, compared the baseline logs, and drafted this report.

<!-- greyfinch-sync:ivall/xcl:comment:7259412340 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2148#issuecomment-7259412340). Originally posted by [moombathepilot](https://github.com/moombathepilot) on 2026-11-29T17:05:22Z. --- merge-check base: 0fe06eb0f05459007ebfffc67bb9983acb3a832d head: a7f059b9972bda022a825b6bf3e079b143082b50 merge: clean build: `cargo build --workspace` passed. tests: `cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture` reported **2,739 passed, 2 failed, and 49 ignored**, with 12 explicit `SKIPPED` notices. All 10 SSA unit tests passed, including the four added by this PR. The native-wave branch test and mixed-mask branch comparison against HLSL also passed on AMD. Both failures matched targeted runs previously made on the exact unmodified base on this machine: - `fuzz_validate_and_gpu_1` produced the same GPU/CPU mismatch at seed 722. - `two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs` failed the same assertion on releasing two-pass state. review: Read the full PR and trial-merge diffs. Phi replacement transfers users before cascading and returns the resolved value. The iterative predecessor walk handles cycles and deep chains. The new tests cover delayed cascades, mutual phi cycles, zero-predecessor blocks, and a 20,000-block chain. No blocking findings. `git diff --cached --check` passed. performance: The change affects per-lane shader translation. The predecessor walk uses a visited set, and phi-user deduplication uses linear scans. Translation time and frame time were not measured. No retail smoke run was performed for this Tier 1 check. verdict: safe to merge hardware / tool and model: Windows 11 Home build 26300, Ryzen 7 5700X3D, Radeon RX 7800 XT (driver 32.0.32029.2010), Rust 1.100.0 x86_64-pc-windows-msvc. Codex (GPT-6, exact variant unavailable) verified refs, reviewed the diffs, ran the build and tests, compared the baseline logs, and drafted this report.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!2138
No description provided.