Tests: wave32 forms are compared with the RDNA2 reference #3746

Open
Royalflamejlh wants to merge 7 commits from upstream-pr/3746 into main
Royalflamejlh commented 2026-12-03 00:12:29 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Royalflamejlh on 2026-12-03T00:12:29Z.


Stacked on #3716; only the top commit belongs here.

#3716 compares XCL's wave64 forms with the RDNA2 reference. This adds the wave32 forms: a wave32 program translated with one console lane to one GPU lane (HLSL, direct DXIL, per-lane), the form most shaders take on a 32-lane GPU, compared with the reference running 32-lane waves. Test-only; no translator code is changed.

What is in it

  • rdna2_ref/forms.rs: a case carries its wave size; the three GPU forms translate a wave32 program with wave64 off, and the lowering on the CPU runs it at 32 lanes. 13 wave32 cases: the 8 wave64 cases whose masks need no change, 4 of wave32's own rules (lane selects of v_readlane / v_writelane modulo 32, ballots and lane counts in one SGPR, saveexec / wrexec on 32-bit masks, a scalar written in a wave32 branch), and a whole-wave section in a 48-thread group. Every (case, form) outcome is pinned in EXPECTED (12 CPU lines, 39 NVIDIA lines).
  • rdna2_ref/fuzz.rs: the generator writes wave32 programs (its mask instructions as _B32, groups of 48, 64 and 96 threads), run through the wave32 forms with their own floors, refusals and known classes. Every known class that names a cause reruns the program without that cause and requires a match. The wave64 programs are unchanged.
  • Flips: Flip::LaneClamp (lane selects clamped instead of wrapped). The flip checks also run over the wave32 forms and cases (LaneClamp, PermlaneOwnRow, ExecIgnored).

Mismatches in main's wave32 forms (pinned as known, not fixed)

  1. A whole-wave section (s_or_saveexec_b32 -1) in a group's last wave with lanes 16..31 empty: those lanes read 0, not the identity the section wrote. All three forms; the same as #3716's mismatch 2 for wave64.
  2. HLSL wave32: -0 for +0 from v_sub_f32 (fuzz seed 1000001), as in HLSL split.
  3. HLSL wave32: a scalar of a compute program differs where s_cmp_eq_u32 compares two s_mul_i32 products of s0 that overflowed (seed 1000015, shrunk). The class holds only when the program matches both without its s_cmps and with s0 = 1, where no product overflows. Likely the signed multiply found on #3716 (the compiler may assume no overflow).
  4. Lowering on the CPU at 32 lanes: a whole-wave section inside a loop, as #3716's mismatch 4.

ds_bpermute, which reads across the halves in the split forms, matches in all wave32 forms that translate it.

Tested

  • RTX 2070 SUPER (driver 621.01), Ryzen 7 5700X3D, Windows 11 26200, rustc 1.100.0, debug, at fa03c332: cargo test --workspace -- rdna2_ref --test-threads=4: 63 passed, 0 failed, 1 ignored; 1 SKIPPED (no llvm-mc).
    • Harness: HLSL wave32 12 match, 1 known mismatch; direct wave32 11 match, 1 known mismatch, 1 refused; per-lane wave32 8 match, 1 known mismatch, 4 refused. All three wave32 forms are checked against all three wave32 flips.
    • Fuzz, 50 seeds: HLSL wave32 50 compared (2 of mismatch 1, 1 of mismatch 2, 1 of mismatch 3); direct wave32 50 compared (2 of mismatch 1); per-lane wave32 17 compared (6 and 11 of 25; floor 20 %), 33 refused, no mismatch.
  • Linux, x86_64-pc-windows-gnu under Wine, CPU Vulkan only: cargo test -p xcl --lib rdna2_ref: 63 passed, 0 failed, 1 ignored; 11 SKIPPED (10 no GPU, 1 no llvm-mc). Lowering on the CPU at 32 lanes: 162 of 1,000 seeds compared, 3 mismatches (class 4).
  • Shown red: v_readlane's lane select clamped to the last lane instead of taken modulo 32 in the reference fails the CPU harness test and both CPU wave32 fuzz tests. The old, wider classes fail the three class tests (the_compare_class_…, the_empty_lanes_class_…, a_wave32_program_with_every_lane_on_…).

Not tested

  • AMD (wave32 is native there too; no lines for it in EXPECTED), the RTX 5070 Ti, the whole suite.

AI use

  • Claude Code (Claude Opus 5.5): wrote the code, the tests and this description, and ran the tests listed above.
<!-- greyfinch-sync:ivall/xcl:issue:5617096301 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3746). Originally posted by [Royalflamejlh](https://github.com/Royalflamejlh) on 2026-12-03T00:12:29Z. --- Stacked on #3716; only the top commit belongs here. #3716 compares XCL's wave64 forms with the RDNA2 reference. This adds the wave32 forms: a wave32 program translated with one console lane to one GPU lane (HLSL, direct DXIL, per-lane), the form most shaders take on a 32-lane GPU, compared with the reference running 32-lane waves. Test-only; no translator code is changed. **What is in it** - `rdna2_ref/forms.rs`: a case carries its wave size; the three GPU forms translate a wave32 program with wave64 off, and the lowering on the CPU runs it at 32 lanes. 13 wave32 cases: the 8 wave64 cases whose masks need no change, 4 of wave32's own rules (lane selects of v_readlane / v_writelane modulo 32, ballots and lane counts in one SGPR, saveexec / wrexec on 32-bit masks, a scalar written in a wave32 branch), and a whole-wave section in a 48-thread group. Every (case, form) outcome is pinned in `EXPECTED` (12 CPU lines, 39 NVIDIA lines). - `rdna2_ref/fuzz.rs`: the generator writes wave32 programs (its mask instructions as `_B32`, groups of 48, 64 and 96 threads), run through the wave32 forms with their own floors, refusals and known classes. Every known class that names a cause reruns the program without that cause and requires a match. The wave64 programs are unchanged. - Flips: `Flip::LaneClamp` (lane selects clamped instead of wrapped). The flip checks also run over the wave32 forms and cases (`LaneClamp`, `PermlaneOwnRow`, `ExecIgnored`). **Mismatches in main's wave32 forms** (pinned as known, not fixed) 1. A whole-wave section (`s_or_saveexec_b32 -1`) in a group's last wave with lanes 16..31 empty: those lanes read 0, not the identity the section wrote. All three forms; the same as #3716's mismatch 2 for wave64. 2. HLSL wave32: -0 for +0 from `v_sub_f32` (fuzz seed 1000001), as in HLSL split. 3. HLSL wave32: a scalar of a compute program differs where `s_cmp_eq_u32` compares two `s_mul_i32` products of s0 that overflowed (seed 1000015, shrunk). The class holds only when the program matches both without its `s_cmp`s and with s0 = 1, where no product overflows. Likely the signed multiply found on #3716 (the compiler may assume no overflow). 4. Lowering on the CPU at 32 lanes: a whole-wave section inside a loop, as #3716's mismatch 4. `ds_bpermute`, which reads across the halves in the split forms, matches in all wave32 forms that translate it. **Tested** - RTX 2070 SUPER (driver 621.01), Ryzen 7 5700X3D, Windows 11 26200, rustc 1.100.0, debug, at `fa03c332`: `cargo test --workspace -- rdna2_ref --test-threads=4`: 63 passed, 0 failed, 1 ignored; 1 SKIPPED (no llvm-mc). - Harness: HLSL wave32 12 match, 1 known mismatch; direct wave32 11 match, 1 known mismatch, 1 refused; per-lane wave32 8 match, 1 known mismatch, 4 refused. All three wave32 forms are checked against all three wave32 flips. - Fuzz, 50 seeds: HLSL wave32 50 compared (2 of mismatch 1, 1 of mismatch 2, 1 of mismatch 3); direct wave32 50 compared (2 of mismatch 1); per-lane wave32 17 compared (6 and 11 of 25; floor 20 %), 33 refused, no mismatch. - Linux, x86_64-pc-windows-gnu under Wine, CPU Vulkan only: `cargo test -p xcl --lib rdna2_ref`: 63 passed, 0 failed, 1 ignored; 11 SKIPPED (10 no GPU, 1 no llvm-mc). Lowering on the CPU at 32 lanes: 162 of 1,000 seeds compared, 3 mismatches (class 4). - Shown red: v_readlane's lane select clamped to the last lane instead of taken modulo 32 in the reference fails the CPU harness test and both CPU wave32 fuzz tests. The old, wider classes fail the three class tests (`the_compare_class_…`, `the_empty_lanes_class_…`, `a_wave32_program_with_every_lane_on_…`). **Not tested** - AMD (wave32 is native there too; no lines for it in `EXPECTED`), the RTX 5070 Ti, the whole suite. **AI use** - Claude Code (Claude Opus 5.5): wrote the code, the tests and this description, and ran the tests listed above.
Foniass commented 2026-12-03 00:17:57 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-03T00:17:57Z.


Review of 386053dd (code reading only, not a merge-check; draft) · 1 high, 4 medium

In short: Stacked on #3716; this reviews only the top commit 386053dd (+346/-68 in rdna2_ref/forms.rs and fuzz.rs, test-only). #3716's split request applies to the stack. The wave32 cases are right: lane selects wrap modulo 32, masks sit in one SGPR, saveexec and wrexec work on 32-bit masks, and the reference runs 32-lane waves for them. Outcomes are keyed by adapter, so other GPUs print their results and skip instead of going red. What blocks it: one known fuzz class excuses every scalar mismatch of a compute program on HLSL wave32, and two other classes are wider at 32 lanes than the cause they name.

High

  1. group_scalar excuses every scalar mismatch of a compute program on HLSL wave32.

    • The class (fuzz.rs ~597, registered at ~586) matches any mismatch whose first differing dword is at k % 28 >= 16, which is s4..s15 of any thread in any compute program. It never looks at the program.
    • Every compute program starts s4..s15 as s_mul_i32 products of s0 that overflow, so "from s_mul_i32 products" is always true. The description says the cause is not confirmed.
    • Any future scalar regression in the compute seeds on HLSL wave32 passes as known.

    Fix: confirm the cause the way section_with_lanes_off does with sections_cause_it (rerun without the overflowing multiplies or the s_cmp and require a match), or narrow the class to the shrunk shape from seed 1000015. Add a test like a_known_class_holds_only_for_the_mismatch_its_shape_causes for it.

Medium

  1. section_shape treats every wave32 kernel program as having lanes off. partial (fuzz.rs ~631) tests p.exec != !0. A wave32 program's exec is exec >> 16 & 0xFFFF_FFFF, so it is never !0. A program with a top-level whole-wave section and any if or loop then takes the "lanes are elsewhere" class on lowering on CPU wave32 even with all 32 lanes on. Compare with the full mask for p.lanes.

  2. upper_half_empty at 32 lanes excuses any mismatch in the last wave of a 48-thread group. The class (~589) checks only that the first differing dword belongs to thread 32..47, not that the program has the whole-wave section the class names. With 48 one of the three wave32 group sizes, a third of the threads of those programs are excused in all three wave32 forms, including the LDS and barrier paths a partial wave takes. Require the shape too, as the other section classes do.

  3. No flip check covers the wave32 forms or the modulo-32 rule.

    • gpu_every_form_is_checked_against_every_flip (forms.rs ~1074) runs only over gpu_forms() and cases().
    • Flip::Lane31 does nothing at 32 lanes (lanes.rs ~54), and neither does Flip::VccLow (mod.rs ~221). So "lane selects wrap at 32" is never shown to depend on its rule.

    Fix: add a wave32 lane-select flip with a FLIPS entry, and run the flip checks over gpu_wave32_forms() and wave32_cases() as well.

  4. The per-lane wave32 floor is far below what it compares. MIN_COMPARED_PERCENT has ("NVIDIA", "per-lane wave32", 10) (fuzz.rs ~532), but the description reports 17 of 50 seeds compared (34 %). A change that makes the form refuse two thirds of what it compares today still passes. Set the floor near the measured rate, with a margin.

Checked and fine
  • reference passes case.lanes == 64 to run_kernel and run_compute, which build Wave::new(32). Masks are read and written as one SGPR, and kernel_words, label and the taint loop all go over case.lanes.
  • The reference masks v_readlane / v_writelane lane selects with & (w.lanes - 1), and ds_bpermute wraps with & 31. Saveexec and wrexec at 32 lanes refuse a _B64 op and mask to 32 bits.
  • "lane selects wrap at 32" selects lanes 40, 100 and 50 (as 8, 4 and 18), reads the written lane back, and runs v_readfirstlane under EXEC 0xFF00.
  • The 5 cases in WAVE64_ONLY use _B64 mask ops, v_mbcnt_hi or s127. The 8 kept cases use one-SGPR carries and VCC reads only.
  • The generator's _B64 mask instructions are all in WAVE32_MASK_OPS, and wave32 programs never emit v_mbcnt_hi or s127.
  • EXPECTED and KNOWN are keyed by adapter. Outside "CPU" and "NVIDIA", forms_agree and fuzz_gpu print and skip, so AMD, Intel and WARP do not go red. A known class that does not occur fails nothing.
  • ON_CPU has 12 wave32 lines and ON_NVIDIA has 39 (13 cases × 3 forms). No translator code is changed.

Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7363029164 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3746#issuecomment-7363029164). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-03T00:17:57Z. --- **Review** of `386053dd` (code reading only, not a merge-check; draft) · 1 high, 4 medium **In short:** Stacked on #3716; this reviews only the top commit `386053dd` (+346/-68 in `rdna2_ref/forms.rs` and `fuzz.rs`, test-only). #3716's split request applies to the stack. The wave32 cases are right: lane selects wrap modulo 32, masks sit in one SGPR, saveexec and wrexec work on 32-bit masks, and the reference runs 32-lane waves for them. Outcomes are keyed by adapter, so other GPUs print their results and skip instead of going red. What blocks it: one known fuzz class excuses every scalar mismatch of a compute program on HLSL wave32, and two other classes are wider at 32 lanes than the cause they name. #### High 1. **`group_scalar` excuses every scalar mismatch of a compute program on HLSL wave32.** - The class (`fuzz.rs` ~597, registered at ~586) matches any mismatch whose first differing dword is at `k % 28 >= 16`, which is s4..s15 of any thread in any compute program. It never looks at the program. - Every compute program starts s4..s15 as `s_mul_i32` products of s0 that overflow, so "from s_mul_i32 products" is always true. The description says the cause is not confirmed. - Any future scalar regression in the compute seeds on HLSL wave32 passes as known. Fix: confirm the cause the way `section_with_lanes_off` does with `sections_cause_it` (rerun without the overflowing multiplies or the `s_cmp` and require a match), or narrow the class to the shrunk shape from seed 1000015. Add a test like `a_known_class_holds_only_for_the_mismatch_its_shape_causes` for it. #### Medium 2. **`section_shape` treats every wave32 kernel program as having lanes off.** `partial` (`fuzz.rs` ~631) tests `p.exec != !0`. A wave32 program's `exec` is `exec >> 16 & 0xFFFF_FFFF`, so it is never `!0`. A program with a top-level whole-wave section and any if or loop then takes the "lanes are elsewhere" class on `lowering on CPU wave32` even with all 32 lanes on. Compare with the full mask for `p.lanes`. 3. **`upper_half_empty` at 32 lanes excuses any mismatch in the last wave of a 48-thread group.** The class (~589) checks only that the first differing dword belongs to thread 32..47, not that the program has the whole-wave section the class names. With 48 one of the three wave32 group sizes, a third of the threads of those programs are excused in all three wave32 forms, including the LDS and barrier paths a partial wave takes. Require the shape too, as the other section classes do. 4. **No flip check covers the wave32 forms or the modulo-32 rule.** - `gpu_every_form_is_checked_against_every_flip` (`forms.rs` ~1074) runs only over `gpu_forms()` and `cases()`. - `Flip::Lane31` does nothing at 32 lanes (`lanes.rs` ~54), and neither does `Flip::VccLow` (`mod.rs` ~221). So "lane selects wrap at 32" is never shown to depend on its rule. Fix: add a wave32 lane-select flip with a `FLIPS` entry, and run the flip checks over `gpu_wave32_forms()` and `wave32_cases()` as well. 5. **The per-lane wave32 floor is far below what it compares.** `MIN_COMPARED_PERCENT` has `("NVIDIA", "per-lane wave32", 10)` (`fuzz.rs` ~532), but the description reports 17 of 50 seeds compared (34 %). A change that makes the form refuse two thirds of what it compares today still passes. Set the floor near the measured rate, with a margin. <details><summary>Checked and fine</summary> - `reference` passes `case.lanes == 64` to `run_kernel` and `run_compute`, which build `Wave::new(32)`. Masks are read and written as one SGPR, and `kernel_words`, `label` and the taint loop all go over `case.lanes`. - The reference masks `v_readlane` / `v_writelane` lane selects with `& (w.lanes - 1)`, and `ds_bpermute` wraps with `& 31`. Saveexec and wrexec at 32 lanes refuse a `_B64` op and mask to 32 bits. - "lane selects wrap at 32" selects lanes 40, 100 and 50 (as 8, 4 and 18), reads the written lane back, and runs `v_readfirstlane` under EXEC `0xFF00`. - The 5 cases in `WAVE64_ONLY` use `_B64` mask ops, `v_mbcnt_hi` or `s127`. The 8 kept cases use one-SGPR carries and VCC reads only. - The generator's `_B64` mask instructions are all in `WAVE32_MASK_OPS`, and wave32 programs never emit `v_mbcnt_hi` or `s127`. - `EXPECTED` and `KNOWN` are keyed by adapter. Outside "CPU" and "NVIDIA", `forms_agree` and `fuzz_gpu` print and skip, so AMD, Intel and WARP do not go red. A known class that does not occur fails nothing. - `ON_CPU` has 12 wave32 lines and `ON_NVIDIA` has 39 (13 cases × 3 forms). No translator code is changed. </details> <sub>Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.</sub>
Royalflamejlh commented 2026-12-03 00:54:27 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Royalflamejlh on 2026-12-03T00:54:27Z.


All five points are fixed in fa03c332, which replaces 386053dd (still one commit on #3716's de05c50e). On the RTX 2070 SUPER (driver 621.01, debug), cargo test --workspace -- rdna2_ref --test-threads=4 gave 63 passed, 0 failed, 1 ignored. Under Wine on the CPU, cargo test -p xcl --lib rdna2_ref gave the same 63 / 0 / 1.

  1. group_scalar: replaced by overflowed_compare (fuzz.rs ~600). It still requires a scalar dword of a compute program, and then two reruns that must both match: the program with every s_cmp taken out, and the same case with s0 = 1, where no s_mul_i32 product overflows. Seed 1000015 still falls in it on the GPU. The new test the_compare_class_holds_only_for_a_mismatch_the_compare_and_overflow_cause gives the class a form that is wrong only when it has an s_cmp and s0 overflows, which must be known, and a form that is always wrong, which must not be. With the old class the second form was known, and the test failed.
  2. section_shape: partial now compares exec with !0 >> (64 - p.lanes). The test a_wave32_program_with_every_lane_on_has_no_lanes_elsewhere failed with !0.
  3. upper_half_empty: now also requires sections_cause_it at both wave sizes. The test the_empty_lanes_class_holds_only_for_a_mismatch_the_section_causes failed without it. On the GPU, all 4 mismatches that fell in this class before still do (2 HLSL wave32, 2 direct wave32), and so does 1 of each in HLSL split and direct split.
  4. Flips: added Flip::LaneClamp (lane selects clamped to the last lane instead of wrapping). FLIPS now carries a wave size, with three wave32 entries: LaneClamp on "lane selects wrap at 32", plus PermlaneOwnRow and ExecIgnored on their cases. gpu_every_wave32_form_is_checked_against_every_flip runs the check over gpu_wave32_forms() and wave32_cases(). On the GPU, all three wave32 forms are checked against all three flips. With clamping made the reference's own rule, "lane selects wrap at 32" fails in the_wave32_lowering_on_the_cpu_agrees_with_the_reference (s10), and so do both CPU wave32 fuzz tests.
  5. Floor: per-lane wave32 is now 20 %. The floor applies to each 25-seed test, and on the GPU those compared 6 of 25 (24 %) and 11 of 25 (44 %), so a floor near the 34 % pooled rate would fail the first test today.

AI use: Claude Code (Claude Opus 5.5) made these changes, ran the tests and wrote this reply.

<!-- greyfinch-sync:ivall/xcl:comment:7363730167 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3746#issuecomment-7363730167). Originally posted by [Royalflamejlh](https://github.com/Royalflamejlh) on 2026-12-03T00:54:27Z. --- All five points are fixed in `fa03c332`, which replaces `386053dd` (still one commit on #3716's `de05c50e`). On the RTX 2070 SUPER (driver 621.01, debug), `cargo test --workspace -- rdna2_ref --test-threads=4` gave 63 passed, 0 failed, 1 ignored. Under Wine on the CPU, `cargo test -p xcl --lib rdna2_ref` gave the same 63 / 0 / 1. 1. **`group_scalar`**: replaced by `overflowed_compare` (`fuzz.rs` ~600). It still requires a scalar dword of a compute program, and then two reruns that must both match: the program with every `s_cmp` taken out, and the same case with s0 = 1, where no `s_mul_i32` product overflows. Seed 1000015 still falls in it on the GPU. The new test `the_compare_class_holds_only_for_a_mismatch_the_compare_and_overflow_cause` gives the class a form that is wrong only when it has an `s_cmp` and s0 overflows, which must be known, and a form that is always wrong, which must not be. With the old class the second form was known, and the test failed. 2. **`section_shape`**: `partial` now compares `exec` with `!0 >> (64 - p.lanes)`. The test `a_wave32_program_with_every_lane_on_has_no_lanes_elsewhere` failed with `!0`. 3. **`upper_half_empty`**: now also requires `sections_cause_it` at both wave sizes. The test `the_empty_lanes_class_holds_only_for_a_mismatch_the_section_causes` failed without it. On the GPU, all 4 mismatches that fell in this class before still do (2 HLSL wave32, 2 direct wave32), and so does 1 of each in HLSL split and direct split. 4. **Flips**: added `Flip::LaneClamp` (lane selects clamped to the last lane instead of wrapping). `FLIPS` now carries a wave size, with three wave32 entries: `LaneClamp` on "lane selects wrap at 32", plus `PermlaneOwnRow` and `ExecIgnored` on their cases. `gpu_every_wave32_form_is_checked_against_every_flip` runs the check over `gpu_wave32_forms()` and `wave32_cases()`. On the GPU, all three wave32 forms are checked against all three flips. With clamping made the reference's own rule, "lane selects wrap at 32" fails in `the_wave32_lowering_on_the_cpu_agrees_with_the_reference` (`s10`), and so do both CPU wave32 fuzz tests. 5. **Floor**: `per-lane wave32` is now 20 %. The floor applies to each 25-seed test, and on the GPU those compared 6 of 25 (24 %) and 11 of 25 (44 %), so a floor near the 34 % pooled rate would fail the first test today. **AI use**: Claude Code (Claude Opus 5.5) made these changes, ran the tests and wrote this reply.
Foniass commented 2026-12-03 00:56:44 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-03T00:56:44Z.


Follow-up review of fa03c332, since 386053dd (code reading only, not a merge-check; draft) · no new findings

In short: This push answers all five points from my last review. The HLSL wave32 scalar class now confirms its cause by running the program again. The two section classes are narrowed to their shape. Wave32 has its own flip checks, including a lane-clamp flip for the modulo-32 rule. The per-lane floor is raised. Only the top commit belongs here, and #3716's commits under it are unchanged. Nothing in this commit blocks it; #3716's split request applies to the stack.

Checked and fine
  • Earlier finding fixed: group_scalar excused every scalar mismatch. overflowed_compare (fuzz.rs) now requires a mismatch in s4..s15 that goes away both with every s_cmp removed and with s0 = 1, where no s_mul_i32 product overflows. the_compare_class_holds_only_for_a_mismatch_the_compare_and_overflow_cause checks it holds for a fake form that differs only with both, and not for one that always differs.
  • Earlier finding fixed: section_shape saw lanes off in every wave32 program. partial now compares with !0 >> (64 - p.lanes), which is 0xFFFF_FFFF at 32 lanes.
  • Earlier finding fixed: upper_half_empty excused any mismatch in a 48-thread group's last wave. It now also requires sections_cause_it(p, form).
  • Earlier finding fixed: no flip check covered wave32. FLIPS carries a wave size, and gpu_every_wave32_form_is_checked_against_every_flip runs Flip::LaneClamp on "lane selects wrap at 32", plus PermlaneOwnRow and ExecIgnored on the kept wave32 cases. The wave64 test runs only the 64-lane entries.
  • Earlier finding fixed: the per-lane wave32 floor is 20 %, against 34 % measured.
  • without(items, drop) is shared by the section and compare checks, so the section check works as before.

Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7363772479 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3746#issuecomment-7363772479). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-03T00:56:44Z. --- **Follow-up review** of `fa03c332`, since `386053dd` (code reading only, not a merge-check; draft) · no new findings **In short:** This push answers all five points from my last review. The HLSL wave32 scalar class now confirms its cause by running the program again. The two section classes are narrowed to their shape. Wave32 has its own flip checks, including a lane-clamp flip for the modulo-32 rule. The per-lane floor is raised. Only the top commit belongs here, and #3716's commits under it are unchanged. Nothing in this commit blocks it; #3716's split request applies to the stack. <details><summary>Checked and fine</summary> - Earlier finding fixed: `group_scalar` excused every scalar mismatch. `overflowed_compare` (`fuzz.rs`) now requires a mismatch in s4..s15 that goes away both with every `s_cmp` removed and with s0 = 1, where no `s_mul_i32` product overflows. `the_compare_class_holds_only_for_a_mismatch_the_compare_and_overflow_cause` checks it holds for a fake form that differs only with both, and not for one that always differs. - Earlier finding fixed: `section_shape` saw lanes off in every wave32 program. `partial` now compares with `!0 >> (64 - p.lanes)`, which is `0xFFFF_FFFF` at 32 lanes. - Earlier finding fixed: `upper_half_empty` excused any mismatch in a 48-thread group's last wave. It now also requires `sections_cause_it(p, form)`. - Earlier finding fixed: no flip check covered wave32. `FLIPS` carries a wave size, and `gpu_every_wave32_form_is_checked_against_every_flip` runs `Flip::LaneClamp` on "lane selects wrap at 32", plus `PermlaneOwnRow` and `ExecIgnored` on the kept wave32 cases. The wave64 test runs only the 64-lane entries. - Earlier finding fixed: the per-lane wave32 floor is 20 %, against 34 % measured. - `without(items, drop)` is shared by the section and compare checks, so the section check works as before. </details> <sub>Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.</sub>
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/3746:upstream-pr/3746'
git switch 'upstream-pr/3746'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/3746'
git switch 'upstream-pr/3746'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3746'
git switch 'upstream-pr/3746'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3746'
git switch 'main'
git merge --squash 'upstream-pr/3746'
git switch 'main'
git merge --ff-only 'upstream-pr/3746'
git switch 'main'
git merge 'upstream-pr/3746'
git push origin 'main'
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!3746
No description provided.