Recompiler: add exact wave-local eligibility analysis for wave64 compute #3040

Closed
coolpersonnn wants to merge 1 commit from upstream-pr/3040 into main
coolpersonnn commented 2026-11-27 16:47:20 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by coolpersonnn on 2026-11-27T16:47:20Z.


Adds eligibility analysis for executing a wave64 compute program as independent wave32 halves. Part of #3011.

Adapted from Vice-Tay 1f69d67 (GPL-3.0-or-later), with upstream VIctory 63bcca4, victory-fork 9a9091d, and VIctory-NVIDIA-RT 0fae809e360a credited in the source and THIRD_PARTY.md.

What is in it

  • gpu/recomp/wave_local.rs implements the eligibility proof and its fixtures. It rejects DPP16 masks whose rows differ across the halves, and tracks the SGPR pair selected by SDWA compare destinations.
  • Adds a uniform-loop regression (rejects_vcc_clobbered_before_a_loop_backedge) that accepts a preserved VCC and a scalar overwrite after its final use, and rejects at byte PC 8 when a backward branch makes the header consume the overwritten VCC_LO. Review feedback
  • The analyzer is paired with its CPU tests and the optional shader-pack census.

Tested

  • Ryzen 9 9950X3D, RTX 5090 (621.01), Windows 11 build 26300, Rust 1.100.0 (0ef1bc386 2026-11-09) x64 MSVC, DXC 1.8.2502.11. Workspace tests in debug; retail census, differential, and smoke runs in release.
  • cargo test -p xcl --lib wave_local -- --test-threads=1 on stacked a92f307d (same wave_local.rs): 28 passed, 0 failed, 0 ignored.
  • Prior to the 7a572ab2 rebase, cargo test --workspace --no-fail-fast -- --test-threads=4 on e5e87e6e (identical patch): 2,687 passed, 4 failed, 49 ignored, and 30 SKIPPED lines (21 no wave64, 3 per-lane f16/f32-to-f16 refusals, 2 no heap windows, 2 mesh pipeline PC skips, 1 cannot disable driver cache, 1 gpu::recomp skip line). The 4 failures were gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_{0..3}.
  • cargo test --release -p xcl --lib retail_wave_local_census -- --nocapture --test-threads=1 on 5e470d3e with XCL_SAMPLE_RPF: 26,503 records, 2,689 compute shaders (1,535 wave32, 1,154 wave64); 359 accepted (340 NoCrossHalf, 19 SingleWave).
  • cargo test --release -p xcl --lib retail_wave_local_buffer_differential -- --nocapture --test-threads=1 on 5e470d3e with XCL_SAMPLE_RPF and XCL_SAMPLE_WAVE_LOCAL_DIFF=1: 1 passed, 0 failed, 0 ignored. Out of 359 accepted shaders, all 31 that wrote to the seeded buffers matched split-wave64 HLSL (0 mismatches), 105 produced no observable writes with those inputs, and 223 required image bindings.

Regression run

60 seconds per run on the same retail title with fresh per-run XCL_DATA_ROOT directories, XCL_PREPARE=0, and XCL_ADAPTER=RTX 5090.

Main

xcl-smoke v1
commit: 7a572ab261595d5153076053baadc60fb10201b0
gpu: NVIDIA GeForce RTX 5090
title: a93b40d7
seconds: 60
exit: 0x0
frames shown: 1705 (PresentX 1705)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 17213 MB

Analyzer head

xcl-smoke v1
commit: f197cb2dc50d2afc588243a41fd420e619cde740
gpu: NVIDIA GeForce RTX 5090
title: a93b40d7
seconds: 60
exit: 0x0
frames shown: 1698 (PresentX 1698)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 16399 MB

Not tested

  • In-world rendering and performance (paired smoke runs cover startup).
  • Full workspace suite rerun after the 7a572ab2 rebase (f197cb2d).
  • Native wave64, AMD, and Intel on f197cb2d.
  • Retail output parity for programs that require image bindings or produced no observable buffer writes, and a retail corpus comparison of the Direct and per-lane DXIL backends.

AI use

  • T3 Code with Antigravity (gemini-pro-orchestrator-neon) and Codex (gpt-6.2-sol) assisted the original adaptation. Codex (gpt-6.2-sol) handled the earlier review fixes, loop regression, and initial rebase.
  • Antigravity (Gemini 4 Hydrogen) in T3 Code rebased onto 7a572ab2, ran the workspace/census/differential tests and 60 s smoke runs, pushed f197cb2d, and updated this report.
<!-- greyfinch-sync:ivall/xcl:issue:5530154802 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3040). Originally posted by [coolpersonnn](https://github.com/coolpersonnn) on 2026-11-27T16:47:20Z. --- Adds eligibility analysis for executing a wave64 compute program as independent wave32 halves. Part of #3011. Adapted from Vice-Tay `1f69d67` (GPL-3.0-or-later), with upstream VIctory `63bcca4`, victory-fork `9a9091d`, and VIctory-NVIDIA-RT `0fae809e360a` credited in the source and `THIRD_PARTY.md`. **What is in it** - `gpu/recomp/wave_local.rs` implements the eligibility proof and its fixtures. It rejects DPP16 masks whose rows differ across the halves, and tracks the SGPR pair selected by SDWA compare destinations. - Adds a uniform-loop regression (`rejects_vcc_clobbered_before_a_loop_backedge`) that accepts a preserved `VCC` and a scalar overwrite after its final use, and rejects at byte PC 8 when a backward branch makes the header consume the overwritten `VCC_LO`. [Review feedback](https://github.com/xcl-dev/xcl/pull/3040#issuecomment-7247971228) - The analyzer is paired with its CPU tests and the optional shader-pack census. **Tested** - Ryzen 9 9950X3D, RTX 5090 (621.01), Windows 11 build 26300, Rust 1.100.0 (0ef1bc386 2026-11-09) x64 MSVC, DXC 1.8.2502.11. Workspace tests in debug; retail census, differential, and smoke runs in release. - `cargo test -p xcl --lib wave_local -- --test-threads=1` on stacked `a92f307d` (same `wave_local.rs`): 28 passed, 0 failed, 0 ignored. - Prior to the `7a572ab2` rebase, `cargo test --workspace --no-fail-fast -- --test-threads=4` on `e5e87e6e` (identical patch): 2,687 passed, 4 failed, 49 ignored, and 30 `SKIPPED` lines (21 no wave64, 3 per-lane f16/f32-to-f16 refusals, 2 no heap windows, 2 mesh pipeline PC skips, 1 cannot disable driver cache, 1 `gpu::recomp` skip line). The 4 failures were `gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_{0..3}`. - `cargo test --release -p xcl --lib retail_wave_local_census -- --nocapture --test-threads=1` on `5e470d3e` with `XCL_SAMPLE_RPF`: 26,503 records, 2,689 compute shaders (1,535 wave32, 1,154 wave64); 359 accepted (340 `NoCrossHalf`, 19 `SingleWave`). - `cargo test --release -p xcl --lib retail_wave_local_buffer_differential -- --nocapture --test-threads=1` on `5e470d3e` with `XCL_SAMPLE_RPF` and `XCL_SAMPLE_WAVE_LOCAL_DIFF=1`: 1 passed, 0 failed, 0 ignored. Out of 359 accepted shaders, all 31 that wrote to the seeded buffers matched split-wave64 HLSL (0 mismatches), 105 produced no observable writes with those inputs, and 223 required image bindings. **Regression run** 60 seconds per run on the same retail title with fresh per-run `XCL_DATA_ROOT` directories, `XCL_PREPARE=0`, and `XCL_ADAPTER=RTX 5090`. Main ``` xcl-smoke v1 commit: 7a572ab261595d5153076053baadc60fb10201b0 gpu: NVIDIA GeForce RTX 5090 title: a93b40d7 seconds: 60 exit: 0x0 frames shown: 1705 (PresentX 1705) presents per 2 s (last 3): 61 60 60 device removals: 0 crashes: 0 peak commit: 17213 MB ``` Analyzer head ``` xcl-smoke v1 commit: f197cb2dc50d2afc588243a41fd420e619cde740 gpu: NVIDIA GeForce RTX 5090 title: a93b40d7 seconds: 60 exit: 0x0 frames shown: 1698 (PresentX 1698) presents per 2 s (last 3): 61 60 60 device removals: 0 crashes: 0 peak commit: 16399 MB ``` **Not tested** - In-world rendering and performance (paired smoke runs cover startup). - Full workspace suite rerun after the `7a572ab2` rebase (`f197cb2d`). - Native wave64, AMD, and Intel on `f197cb2d`. - Retail output parity for programs that require image bindings or produced no observable buffer writes, and a retail corpus comparison of the Direct and per-lane DXIL backends. **AI use** - T3 Code with Antigravity (`gemini-pro-orchestrator-neon`) and Codex (`gpt-6.2-sol`) assisted the original adaptation. Codex (`gpt-6.2-sol`) handled the earlier review fixes, loop regression, and initial rebase. - Antigravity (`Gemini 4 Hydrogen`) in T3 Code rebased onto `7a572ab2`, ran the workspace/census/differential tests and 60 s smoke runs, pushed `f197cb2d`, and updated this report.
Gevroska commented 2026-11-27 18:39:17 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Gevroska on 2026-11-27T18:39:17Z.


I tested how WaveLocal handles a mask value that changes between loop iterations at 962cdca8. The 17 CPU fixtures I ran all passed, but none contained a backward branch. I added a local CPU test with a two-iteration uniform loop whose header reads VCC as a 64-bit mask at byte PC 8.

Case WaveLocal result
Preserve VCC and branch back to the header NoCrossHalf
Overwrite VCC_LO after its last use and remove the backward branch NoCrossHalf
Make the same overwrite and branch back to the header Rejected at PC 8 with mask op with non-mask source

The rejection occurs at the header where the next iteration would consume the overwritten value. The test also checked that the header had both expected incoming edges. It passed on Windows with zero skips. This verifies the static eligibility decision for this loop. I didn’t test shader lowering or GPU execution.

I used OpenAI Codex with GPT-6.2 Sol to write and run the test. A separate GPT-6.2 Sol agent verified the fixture and logs. GPT-6.2 Astra drafted this comment.

I reviewed and approved this comment before posting.

<!-- greyfinch-sync:ivall/xcl:comment:7225721978 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3040#issuecomment-7225721978). Originally posted by [Gevroska](https://github.com/Gevroska) on 2026-11-27T18:39:17Z. --- I tested how WaveLocal handles a mask value that changes between loop iterations at `962cdca8`. The 17 CPU fixtures I ran all passed, but none contained a backward branch. I added a local CPU test with a two-iteration uniform loop whose header reads `VCC` as a 64-bit mask at byte PC 8. | Case | WaveLocal result | |---|---| | Preserve `VCC` and branch back to the header | `NoCrossHalf` | | Overwrite `VCC_LO` after its last use and remove the backward branch | `NoCrossHalf` | | Make the same overwrite and branch back to the header | Rejected at PC 8 with `mask op with non-mask source` | The rejection occurs at the header where the next iteration would consume the overwritten value. The test also checked that the header had both expected incoming edges. It passed on Windows with zero skips. This verifies the static eligibility decision for this loop. I didn’t test shader lowering or GPU execution. I used OpenAI Codex with GPT-6.2 Sol to write and run the test. A separate GPT-6.2 Sol agent verified the fixture and logs. GPT-6.2 Astra drafted this comment. I reviewed and approved this comment before posting.
JJAutoCompare commented 2026-11-27 19:51:37 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-27T19:51:37Z.


Tested

Clean detached 962cdca84c402e0254cc1c6909bb82393164cd21 on Windows 11 25H2 build 26200.9974, Ryzen 7 3800X, and Rust 1.100.0 MSVC. I verified the fixture source, executable, and exact-head production library hashes, then ran the existing CPU harness with diamond.exe --test-threads=1 --nocapture.

Three synthetic RDNA2 programs use a uniform scalar branch, a [64, 1, 1] thread group, and a scalar read of VCC_LO after the two paths join.

  • Both predecessors overwrite VCC_LO: Ok(NoCrossHalf).
  • Either predecessor writes VCC_HI instead: rejected at byte 24 with mask read as data. Each predecessor was tested separately.

3 passed, 0 failed, 0 ignored, 0 skipped. Process exit 0.

Not tested

GPU execution, lowering, retail shaders, and the stock suite.

AI use

T3 Code / Codex (gpt-6.2-sol) wrote the synthetic fixture, independently reran it, and wrote this report.

<!-- greyfinch-sync:ivall/xcl:comment:7226940092 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3040#issuecomment-7226940092). Originally posted by [JJAutoCompare](https://github.com/JJAutoCompare) on 2026-11-27T19:51:37Z. --- **Tested** Clean detached `962cdca84c402e0254cc1c6909bb82393164cd21` on Windows 11 25H2 build 26200.9974, Ryzen 7 3800X, and Rust 1.100.0 MSVC. I verified the fixture source, executable, and exact-head production library hashes, then ran the existing CPU harness with `diamond.exe --test-threads=1 --nocapture`. Three synthetic RDNA2 programs use a uniform scalar branch, a `[64, 1, 1]` thread group, and a scalar read of `VCC_LO` after the two paths join. - Both predecessors overwrite `VCC_LO`: `Ok(NoCrossHalf)`. - Either predecessor writes `VCC_HI` instead: rejected at byte 24 with `mask read as data`. Each predecessor was tested separately. **3 passed, 0 failed, 0 ignored, 0 skipped.** Process exit 0. **Not tested** GPU execution, lowering, retail shaders, and the stock suite. **AI use** T3 Code / Codex (`gpt-6.2-sol`) wrote the synthetic fixture, independently reran it, and wrote this report.
razormontana commented 2026-11-28 00:49:41 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by razormontana on 2026-11-28T00:49:41Z.


Independent check of the eligibility analyzer at 962cdca84c402e0254cc1c6909bb82393164cd21, as included in the clean #3042 stack at becdecfe8895548fc6329e572b44cba010757acc. Windows 11 Pro build 22631, Core i7-10700K, RTX 3070 8 GB with NVIDIA 617.42, Rust 1.100.0 x64 MSVC.

Tested

cargo test --offline --locked -j 1 -p xcl --lib --no-run --message-format=json-render-diagnostics built the test executable. The run selected the 17 published CPU analyzer fixtures by exact name with --exact --test-threads=1 --nocapture. All 17 passed, with 0 failed, 0 ignored and 0 explicit skips. The fixtures cover eligibility and rejection at mask, branch, LDS, lane operation and workgroup boundaries.

Not tested

A detached #3040-only build, the game-data census, or retail behavior.

AI use

Codex GPT-6.2 ran the focused validation, checked the results, and prepared this report.

<!-- greyfinch-sync:ivall/xcl:comment:7231220453 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3040#issuecomment-7231220453). Originally posted by [razormontana](https://github.com/razormontana) on 2026-11-28T00:49:41Z. --- Independent check of the eligibility analyzer at `962cdca84c402e0254cc1c6909bb82393164cd21`, as included in the clean #3042 stack at `becdecfe8895548fc6329e572b44cba010757acc`. Windows 11 Pro build 22631, Core i7-10700K, RTX 3070 8 GB with NVIDIA 617.42, Rust 1.100.0 x64 MSVC. **Tested** `cargo test --offline --locked -j 1 -p xcl --lib --no-run --message-format=json-render-diagnostics` built the test executable. The run selected the 17 published CPU analyzer fixtures by exact name with `--exact --test-threads=1 --nocapture`. All 17 passed, with 0 failed, 0 ignored and 0 explicit skips. The fixtures cover eligibility and rejection at mask, branch, LDS, lane operation and workgroup boundaries. **Not tested** A detached #3040-only build, the game-data census, or retail behavior. **AI use** Codex GPT-6.2 ran the focused validation, checked the results, and prepared this report.
thehollowedone commented 2026-11-28 02:29:30 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-28T02:29:30Z.


Source review of #3040 at 962cdca8: I found two eligibility cases to resolve before #3042 uses this analyzer for wave-local lowering. These are source-traced cases; I have not run their GPU regressions.

  1. DPP16 row mask across two 32-lane waves. analyze allows DPP16 without examining ROW_MASK (scan). For a 64-thread group, identity quad permutation 0xE4, ROW_MASK=0xC, BANK_MASK=0xF, the console instruction writes rows 2–3 (lanes 32–63); the existing partition fixture uses that encoding. Wave-local HLSL sets lane_id = WaveGetLaneIndex() for each 32-lane wave, while DPP16 write enable selects ROW_MASK >> (lane_id >> 4). Both waves then select bits 0–1 and skip writes intended for the upper half. The direct and per-lane emitters also use their local lane index for this row selection. A conservative eligibility fix is to reject DPP16 for groups over 32 threads when (ROW_MASK & 3) != ((ROW_MASK >> 2) & 3), reading the field from the DPP extension encoding. Please add an analyzer rejection for 0xC, an eligible symmetric-mask control such as 0xA, and a split-vs-wave-local GPU comparison.

  2. SDWA compare destination. mask_op_dest checks d.enc.name and reads SD/SDST from the base encoding. For SDWA VOPC, those fields are in the extension: vopc_write correctly writes s[22:23] when SD=1, SDST=22, while the analyzer marks VCC instead. A later scalar read of s23 can pass eligibility even though the full-wave ballot's upper word differs from the local-wave value. An existing encoded fixture verifies the actual destination. Please resolve the SDWA destination from the extension and add an analyzer regression in which reading s23 as ordinary data rejects the 64-thread shader.

AI use: OpenAI Codex (GPT-6.2 Sol) checked the paths; OpenAI Codex (GPT-6.2 Astra) independently traced the low-level cases. No runtime result is claimed.

<!-- greyfinch-sync:ivall/xcl:comment:7232397194 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3040#issuecomment-7232397194). Originally posted by [thehollowedone](https://github.com/thehollowedone) on 2026-11-28T02:29:30Z. --- Source review of [#3040 at `962cdca8`](https://github.com/xcl-dev/xcl/commit/962cdca84c402e0254cc1c6909bb82393164cd21): I found two eligibility cases to resolve before [#3042](https://github.com/xcl-dev/xcl/pull/3042) uses this analyzer for wave-local lowering. These are source-traced cases; I have not run their GPU regressions. 1. **DPP16 row mask across two 32-lane waves.** `analyze` allows DPP16 without examining `ROW_MASK` ([scan](https://github.com/xcl-dev/xcl/blob/962cdca84c402e0254cc1c6909bb82393164cd21/crates/xcl/src/gpu/recomp/wave_local.rs#L55-L72)). For a 64-thread group, identity quad permutation `0xE4`, `ROW_MASK=0xC`, `BANK_MASK=0xF`, the console instruction writes rows 2–3 (lanes 32–63); [the existing partition fixture](https://github.com/xcl-dev/xcl/blob/962cdca84c402e0254cc1c6909bb82393164cd21/crates/xcl/src/gpu/recomp/partition.rs#L1181-L1186) uses that encoding. Wave-local HLSL sets `lane_id = WaveGetLaneIndex()` for each 32-lane wave, while [DPP16 write enable](https://github.com/xcl-dev/xcl/blob/becdecfe8895548fc6329e572b44cba010757acc/crates/xcl/src/gpu/recomp/emit.rs#L3144-L3153) selects `ROW_MASK >> (lane_id >> 4)`. Both waves then select bits 0–1 and skip writes intended for the upper half. The direct and per-lane emitters also use their local lane index for this row selection. A conservative eligibility fix is to reject DPP16 for groups over 32 threads when `(ROW_MASK & 3) != ((ROW_MASK >> 2) & 3)`, reading the field from the DPP extension encoding. Please add an analyzer rejection for `0xC`, an eligible symmetric-mask control such as `0xA`, and a split-vs-wave-local GPU comparison. 2. **SDWA compare destination.** [`mask_op_dest`](https://github.com/xcl-dev/xcl/blob/962cdca84c402e0254cc1c6909bb82393164cd21/crates/xcl/src/gpu/recomp/wave_local.rs#L149-L155) checks `d.enc.name` and reads `SD`/`SDST` from the base encoding. For SDWA VOPC, those fields are in the extension: [`vopc_write`](https://github.com/xcl-dev/xcl/blob/962cdca84c402e0254cc1c6909bb82393164cd21/crates/xcl/src/gpu/recomp/emit.rs#L4251-L4262) correctly writes `s[22:23]` when `SD=1, SDST=22`, while the analyzer marks VCC instead. A later scalar read of `s23` can pass eligibility even though the full-wave ballot's upper word differs from the local-wave value. [An existing encoded fixture](https://github.com/xcl-dev/xcl/blob/962cdca84c402e0254cc1c6909bb82393164cd21/crates/xcl/src/gpu/recomp/x64_masks.rs#L850-L863) verifies the actual destination. Please resolve the SDWA destination from the extension and add an analyzer regression in which reading `s23` as ordinary data rejects the 64-thread shader. AI use: OpenAI Codex (GPT-6.2 Sol) checked the paths; OpenAI Codex (GPT-6.2 Astra) independently traced the low-level cases. No runtime result is claimed.
bmjask commented 2026-11-28 22:04:17 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by bmjask on 2026-11-28T22:04:17Z.

Review: COMMENTED


Critical-review result: I did not find a concrete unsound acceptance in the eligibility analysis. The rejection set covers the principal cross-half hazards I checked: lane exchange, wave-wide counts, mask/SCC use, large-group LDS, divergent barriers, and scalar writes live across lane joins.

This remains a large proof surface. Before depending on it beyond the experimental path, please report differential GPU results comparing accepted shaders against split-wave64 over the available retail corpus, including acceptance counts and output mismatches. That evidence is more useful here than additional hand-selected positive tests.

Reviewed at 962cdca84c with Codex (GPT-5).

<!-- greyfinch-sync:ivall/xcl:review:6100275203 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3040#pullrequestreview-6100275203). Originally posted by [bmjask](https://github.com/bmjask) on 2026-11-28T22:04:17Z. **Review:** COMMENTED --- Critical-review result: I did not find a concrete unsound acceptance in the eligibility analysis. The rejection set covers the principal cross-half hazards I checked: lane exchange, wave-wide counts, mask/SCC use, large-group LDS, divergent barriers, and scalar writes live across lane joins. This remains a large proof surface. Before depending on it beyond the experimental path, please report differential GPU results comparing accepted shaders against split-wave64 over the available retail corpus, including acceptance counts and output mismatches. That evidence is more useful here than additional hand-selected positive tests. Reviewed at 962cdca84c402e0254cc1c6909bb82393164cd21 with Codex (GPT-5).
coolpersonnn commented 2026-11-28 23:41:30 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by coolpersonnn on 2026-11-28T23:41:30Z.


@bmjask Thanks for the review. The branch has been updated to c56cfcdd (rebased onto main 10373744, also addressing the DPP16 ROW_MASK and SDWA SD/SDST analyzer fixes), and the requested retail corpus differential check was run against the stacked lowering head (43d0c866):

  • Corpus census & differential (retail_wave_local_buffer_differential, RTX 5090, release): Out of 1,154 wave64 compute shaders in the retail pack, the analyzer accepted 359 (340 NoCrossHalf, 19 SingleWave).
  • Output comparison vs. split-wave64 (HLSL): All 31 accepted shaders that wrote to the seeded buffers matched split-wave64 with 0 mismatches (record 1d7d9f365982e397 initially differed due to overlapping synthetic buffer views in the test harness and matched once each view was given a disjoint range).
  • Uncovered in this corpus run: 105 accepted shaders produced no observable buffer writes with those inputs, and 223 required image bindings (not counted as output parity); the Direct/per-lane DXIL backends were not compared across the retail corpus, and the rebased head has not been run on native wave64, AMD, or Intel.

Full workspace/smoke numbers are in the updated PR description.

AI use: Codex (gpt-6.2-sol) implemented the review fixes, rebased the branch, ran the tests and retail corpus comparison, and updated the PR description. Antigravity (Gemini 4 Hydrogen) drafted and posted this reply from that session's recorded results.

<!-- greyfinch-sync:ivall/xcl:comment:7247598873 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3040#issuecomment-7247598873). Originally posted by [coolpersonnn](https://github.com/coolpersonnn) on 2026-11-28T23:41:30Z. --- @bmjask Thanks for the review. The branch has been updated to `c56cfcdd` (rebased onto `main` `10373744`, also addressing the DPP16 `ROW_MASK` and SDWA `SD`/`SDST` analyzer fixes), and the requested retail corpus differential check was run against the stacked lowering head (`43d0c866`): - **Corpus census & differential (`retail_wave_local_buffer_differential`, RTX 5090, release):** Out of 1,154 wave64 compute shaders in the retail pack, the analyzer accepted **359** (**340** `NoCrossHalf`, **19** `SingleWave`). - **Output comparison vs. split-wave64 (HLSL):** All **31** accepted shaders that wrote to the seeded buffers matched split-wave64 with **0 mismatches** (record `1d7d9f365982e397` initially differed due to overlapping synthetic buffer views in the test harness and matched once each view was given a disjoint range). - **Uncovered in this corpus run:** **105** accepted shaders produced no observable buffer writes with those inputs, and **223** required image bindings (not counted as output parity); the Direct/per-lane DXIL backends were not compared across the retail corpus, and the rebased head has not been run on native wave64, AMD, or Intel. Full workspace/smoke numbers are in the updated PR description. **AI use:** Codex (`gpt-6.2-sol`) implemented the review fixes, rebased the branch, ran the tests and retail corpus comparison, and updated the PR description. Antigravity (`Gemini 4 Hydrogen`) drafted and posted this reply from that session's recorded results.
Kalmarv commented 2026-11-29 00:14:12 +00:00 (Migrated from github.com)

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


merge-check
base: 929854811b
head: c56cfcdd3b
merge: clean (trial merge aeabe8bdc8edd20dfa098c0657dccd087d2c65db, local, not pushed; git diff --check clean)
build: cargo build --workspace -> ok (no new warnings from wave_local.rs)
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 (XCL_DXC_DIR = DXC 1.9.2609) -> 2628 passed, 0 failed, 49 ignored; SKIPPED: 26 (21 no wave64 on this 32-lane GPU, 3 per-lane f16/f32 forms refused (#1426 semantics), 2 no heap windows); failing: none. All 20 wave_local::tests ran and passed, including the two new ones, rejects_asymmetric_dpp16_rows_in_split_groups and rejects_sdwa_compare_destination_read_as_data. retail_wave_local_census returns early without XCL_SAMPLE_RPF; no sample pack here, so it checked nothing. In the first full run the xcl lib binary stopped itself during uma_driver::tests ("coherent window could not be restored ... Windows error 487 ... Map gave 0x20349c10000, wanted 0x2035e040000"): another test thread took the address between unmap and remap. Those tests come from main (2fc61b64), and this PR touches no UMA code. A rerun of cargo test -p xcl --lib on the same merge: 2489 passed, 0 failed; the count above uses that rerun plus the other targets of the first run.
review: none blocking; whole new-head diff read (wave_local.rs +914, the pub mod line, the THIRD_PARTY.md row, and a provenance header that matches it). Both findings from thehollowedone's source review at 962cdca8 are addressed in this head. (1) DPP16 is rejected for groups over 32 threads when ROW_MASK & 3 != ROW_MASK >> 2; the field is read from the DPP extension; the test covers 0xC (rejected) against the symmetric control 0xA (accepted), and 32 threads (accepted). (2) SDWA VOPC SD / SDST come from the extension encoding; the test covers SD=1, SDST=22 then a read of s23 (rejected as mask read as data) against SD=0 (accepted). Notes, none blocking:

  1. Nothing calls analyze yet (only pub mod wave_local), so this PR has no runtime effect. The split-vs-wave-local GPU comparison thehollowedone asked for can only run once #3042 wires the analyzer into lowering, and should be checked there.
  2. No test in the module has a backward branch. Gevroska's local loop fixture at 962cdca8 (a mask overwritten after its last use, then a branch back to the header, rejected at the header) would be a cheap regression test to add.
    performance: none at runtime (analysis code nobody calls yet). No title run: Recompiler / Tier 1.
    verdict: safe to merge
    hardware / tool and model: NVIDIA GeForce RTX 5070 Ti 16 GB (driver 610.74, wave32 only), AMD Ryzen 9 9950X, Windows 11 build 26200; rustc 1.99.0, debug test profile, DXC 1.9.2609 via XCL_DXC_DIR. Claude Code, Claude Opus 5.5: merge, build, suite and full-diff review; this report.
<!-- greyfinch-sync:ivall/xcl:comment:7247971228 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3040#issuecomment-7247971228). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-11-29T00:14:12Z. --- merge-check base: 929854811bab1be19a7182bcb553f7241ad18b46 head: c56cfcdd3b11ed13d894bdc4eff0edbf34ae2781 merge: clean (trial merge aeabe8bdc8edd20dfa098c0657dccd087d2c65db, local, not pushed; `git diff --check` clean) build: cargo build --workspace -> ok (no new warnings from `wave_local.rs`) tests: cargo test --workspace --no-fail-fast -- --test-threads=4 (XCL_DXC_DIR = DXC 1.9.2609) -> 2628 passed, 0 failed, 49 ignored; SKIPPED: 26 (21 no wave64 on this 32-lane GPU, 3 per-lane f16/f32 forms refused (#1426 semantics), 2 no heap windows); failing: none. All 20 `wave_local::tests` ran and passed, including the two new ones, `rejects_asymmetric_dpp16_rows_in_split_groups` and `rejects_sdwa_compare_destination_read_as_data`. `retail_wave_local_census` returns early without `XCL_SAMPLE_RPF`; no sample pack here, so it checked nothing. In the first full run the `xcl` lib binary stopped itself during `uma_driver::tests` ("coherent window could not be restored ... Windows error 487 ... Map gave 0x20349c10000, wanted 0x2035e040000"): another test thread took the address between unmap and remap. Those tests come from main (`2fc61b64`), and this PR touches no UMA code. A rerun of `cargo test -p xcl --lib` on the same merge: 2489 passed, 0 failed; the count above uses that rerun plus the other targets of the first run. review: none blocking; whole new-head diff read (`wave_local.rs` +914, the `pub mod` line, the THIRD_PARTY.md row, and a provenance header that matches it). Both findings from thehollowedone's source review at `962cdca8` are addressed in this head. (1) DPP16 is rejected for groups over 32 threads when `ROW_MASK & 3 != ROW_MASK >> 2`; the field is read from the DPP extension; the test covers `0xC` (rejected) against the symmetric control `0xA` (accepted), and 32 threads (accepted). (2) SDWA VOPC `SD` / `SDST` come from the extension encoding; the test covers `SD=1, SDST=22` then a read of `s23` (rejected as mask read as data) against `SD=0` (accepted). Notes, none blocking: 1. Nothing calls `analyze` yet (only `pub mod wave_local`), so this PR has no runtime effect. The split-vs-wave-local GPU comparison thehollowedone asked for can only run once #3042 wires the analyzer into lowering, and should be checked there. 2. No test in the module has a backward branch. Gevroska's local loop fixture at `962cdca8` (a mask overwritten after its last use, then a branch back to the header, rejected at the header) would be a cheap regression test to add. performance: none at runtime (analysis code nobody calls yet). No title run: Recompiler / Tier 1. verdict: safe to merge hardware / tool and model: NVIDIA GeForce RTX 5070 Ti 16 GB (driver 610.74, wave32 only), AMD Ryzen 9 9950X, Windows 11 build 26200; rustc 1.99.0, debug test profile, DXC 1.9.2609 via XCL_DXC_DIR. Claude Code, Claude Opus 5.5: merge, build, suite and full-diff review; this report.
coolpersonnn commented 2026-11-29 13:32:31 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by coolpersonnn on 2026-11-29T13:32:31Z.


@Kalmarv Thanks for the review. Both notes have been addressed:

  • Loop backedge regression (#3040, e5e87e6e): Added rejects_vcc_clobbered_before_a_loop_backedge, which accepts a uniform loop preserving VCC and an overwrite after final use without a backedge, and rejects at byte PC 8 when a backward branch makes the header consume the overwritten VCC_LO.
  • Stacked lowering & GPU comparison (#3042, 5e470d3e): Rebased onto main (7a649b0e) atop #3040 with the conflict resolved; retail_wave_local_buffer_differential passed (359 accepted of 1,154 wave64 compute shaders; all 31 with observable buffer writes matched split-wave64 HLSL with 0 mismatches; 105 no observable write; 223 requiring image bindings).

Full test counts and 60 s smoke results are in both updated PR descriptions.

AI use: Codex (gpt-6.2-sol) in T3 Code added the loop regression and rebased both branches onto 7a649b0e. Antigravity (Gemini 4 Hydrogen) in T3 Code ran the workspace tests, retail census/differential, and 60 s smoke runs, pushed both branches, updated the PR descriptions, and posted this reply.

<!-- greyfinch-sync:ivall/xcl:comment:7256615666 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3040#issuecomment-7256615666). Originally posted by [coolpersonnn](https://github.com/coolpersonnn) on 2026-11-29T13:32:31Z. --- @Kalmarv Thanks for the review. Both notes have been addressed: - **Loop backedge regression (#3040, `e5e87e6e`):** Added `rejects_vcc_clobbered_before_a_loop_backedge`, which accepts a uniform loop preserving `VCC` and an overwrite after final use without a backedge, and rejects at byte PC 8 when a backward branch makes the header consume the overwritten `VCC_LO`. - **Stacked lowering & GPU comparison (#3042, `5e470d3e`):** Rebased onto `main` (`7a649b0e`) atop `#3040` with the conflict resolved; `retail_wave_local_buffer_differential` passed (`359` accepted of `1,154` wave64 compute shaders; all `31` with observable buffer writes matched split-wave64 HLSL with `0` mismatches; `105` no observable write; `223` requiring image bindings). Full test counts and 60 s smoke results are in both updated PR descriptions. **AI use:** Codex (`gpt-6.2-sol`) in T3 Code added the loop regression and rebased both branches onto `7a649b0e`. Antigravity (`Gemini 4 Hydrogen`) in T3 Code ran the workspace tests, retail census/differential, and 60 s smoke runs, pushed both branches, updated the PR descriptions, and posted this reply.
Foniass commented 2026-12-01 09:24:27 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T09:24:27Z.


Triage (#1607) – head f197cb2

#3042 is stacked on this PR (it contains this commit plus the lowering that uses it), so that overlap is a stack, not a duplicate. No other open or merged PR adds a wave-local eligibility analysis. No problems found in the parts of wave_local.rs I read; the analysis is conservative (it rejects any cross-half op it cannot prove safe) and nothing calls it yet.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7306655477 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3040#issuecomment-7306655477). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T09:24:27Z. --- **Triage (#1607)** – head f197cb2 #3042 is stacked on this PR (it contains this commit plus the lowering that uses it), so that overlap is a stack, not a duplicate. No other open or merged PR adds a wave-local eligibility analysis. No problems found in the parts of `wave_local.rs` I read; the analysis is conservative (it rejects any cross-half op it cannot prove safe) and nothing calls it yet. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Foniass commented 2026-12-01 12:08:54 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T12:08:54Z.


merge-check
base: 493dbd3dd0
head: f197cb2dc5
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2921 passed, 0 failed, 51 ignored; SKIPPED: 28 (20 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 no heap windows, 1 cannot disable the driver cache, 3 others; the same set as on main); failing: none
review: read the whole diff (+948). It adds wave_local::analyze, which decides whether a wave64 compute program's two 32-lane halves never depend on each other. Nothing calls it yet, so there's no runtime effect. Findings: (1) Size. About 370 lines of code (wave_local.rs ~1-370) and 575 of tests; that fits "new code with its tests", but CONTRIBUTING asks for the reason in the description past 800. (2) Hard to check by hand. The dataflow is written as dense one-liners (~87, ~358, ~361), and soundness rests entirely on it; a few named steps would make review of the turn-on PR easier. (3) partial_blocks (~103) copies lower.rs ~1116 ("matching lower::partial_blocks"); reusing or extending that one keeps the two from drifting. (4) retail_wave_local_census (~888) only prints. Lanes of one console wave that talk through UAV memory aren't modelled, but the split form doesn't order that between halves either, so it's no regression (unverified). Fine: it conservatively rejects cross-lane reads (readlane / writelane, (b)permute, s_getreg, TG_SIZE), the s_bcnt1 / s_ff1 / v_mbcnt / readfirstlane family in groups over 32 threads, masks read as data, inverting mask ops, VCCZ / EXECZ reads, SCC set by a mask op, LDS and GDS in groups over 32 threads, barriers inside lane branches, scalar writes in a lane branch live at the join (back-edges included), indirect jumps, and asymmetric DPP16 ROW_MASK. The SDWA compare-destination fix is in. The PR's red CI is the pipeline_library lock-poisoning flake (the same commit passed in #3042's run). No smoke run: nothing calls it.
performance: no smoke run (the default path doesn't reach this change); not measured. Analysis only, not called: no runtime path changes. Its 21 wave_local tests passed here.
verdict: safe to merge (not called yet; the size reason belongs in the description, and reusing lower::partial_blocks would keep the two from drifting)
hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5

AI-written and posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7310720036 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3040#issuecomment-7310720036). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T12:08:54Z. --- merge-check base: 493dbd3dd0cd50b4c3e8d28f73ab9b504fcd8158 head: f197cb2dc50d2afc588243a41fd420e619cde740 merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2921 passed, 0 failed, 51 ignored; SKIPPED: 28 (20 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 no heap windows, 1 cannot disable the driver cache, 3 others; the same set as on main); failing: none review: read the whole diff (+948). It adds `wave_local::analyze`, which decides whether a wave64 compute program's two 32-lane halves never depend on each other. Nothing calls it yet, so there's no runtime effect. Findings: (1) **Size.** About 370 lines of code (`wave_local.rs` ~1-370) and 575 of tests; that fits "new code with its tests", but CONTRIBUTING asks for the reason in the description past 800. (2) **Hard to check by hand.** The dataflow is written as dense one-liners (~87, ~358, ~361), and soundness rests entirely on it; a few named steps would make review of the turn-on PR easier. (3) `partial_blocks` (~103) copies `lower.rs` ~1116 ("matching lower::partial_blocks"); reusing or extending that one keeps the two from drifting. (4) `retail_wave_local_census` (~888) only prints. Lanes of one console wave that talk through UAV memory aren't modelled, but the split form doesn't order that between halves either, so it's no regression (unverified). Fine: it conservatively rejects cross-lane reads (readlane / writelane, (b)permute, `s_getreg`, TG_SIZE), the `s_bcnt1` / `s_ff1` / `v_mbcnt` / readfirstlane family in groups over 32 threads, masks read as data, inverting mask ops, VCCZ / EXECZ reads, SCC set by a mask op, LDS and GDS in groups over 32 threads, barriers inside lane branches, scalar writes in a lane branch live at the join (back-edges included), indirect jumps, and asymmetric DPP16 `ROW_MASK`. The SDWA compare-destination fix is in. The PR's red CI is the `pipeline_library` lock-poisoning flake (the same commit passed in #3042's run). No smoke run: nothing calls it. performance: no smoke run (the default path doesn't reach this change); not measured. Analysis only, not called: no runtime path changes. Its 21 `wave_local` tests passed here. verdict: safe to merge (not called yet; the size reason belongs in the description, and reusing `lower::partial_blocks` would keep the two from drifting) hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5 AI-written and posted by Foniass without a human check of each point.
coolpersonnn commented 2026-12-01 14:27:14 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by coolpersonnn on 2026-12-01T14:27:14Z.


Closing: prerequisite for #3042, which is being closed after world testing showed no measurable speedup.

<!-- greyfinch-sync:ivall/xcl:comment:7314274921 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3040#issuecomment-7314274921). Originally posted by [coolpersonnn](https://github.com/coolpersonnn) on 2026-12-01T14:27:14Z. --- Closing: prerequisite for #3042, which is being closed after world testing showed no measurable speedup.

Pull request closed

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!3040
No description provided.