Tests: the bridged mask write checks for no barrier past the first branch #2379

Closed
github-bot wants to merge 1 commit from gh-pr/2379/head into gh-pr/2379/base
Owner

@⁠gefydev on GitHub · 2026-11-25 17:28 UTC · original
gefydev:lower-dxil-bridged-mask-test-entry-barriers → main · +12 −4 · 1 files · 1 commits · closed without merging

The test of #2074, a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier, fails on main (68a284a) on every machine that has DXC: it wanted exactly one group barrier in the whole program and the program has three. Reported on #2074 by @⁠DarkPanda69 (RX 9070 XT and RTX 3060, main 50a9fde) and traced by @⁠Gevroska: all three barriers are in the entry block, before the first conditional branch, and two of them surround the exchange that computes the whole-wave EXEC condition of s_cbranch_execz, which a change merged after #2074's base added. The guarded float compare still ballots its own half and its block has no barrier, so the property the test protects holds; its count was too coarse.

What is in it

  • crates/xcl/src/gpu/recomp/lower_dxil.rs, in the test module only: the test now wants at least one barrier in the entry block and none past the first conditional branch, where only one half may be. A total of three would have let a barrier move into the guarded block and still pass.

Tested

  • NVIDIA GeForce GTX 1650 4 GB (32-lane waves), driver 621.24, AMD Ryzen 5 1600, 16 GB RAM, Windows 11 Pro 26300, Rust 1.100.0, DXC 1.9.2602.17, debug, CARGO_BUILD_JOBS=2.
  • Reproduced on a clean checkout of main 68a284a: left: 3, right: 1 in 0.02 s (the static count; no GPU run). With the change the test passes in 0.4 s, including its GPU dispatch.
  • With the #2074 fix switched off (self.lw.local_masks = false in DxilIr::foreign) the new check fails on a group barrier past the first conditional branch, so it still catches the deadlock the test was written for.
  • cargo build --workspace, then cargo test --workspace --no-fail-fast -- --test-threads=4 on feb33f2: 1290 passed, 0 failed, 46 ignored. 28 SKIPPED, none on a path this changes: 21 wave64 cases (no wave64 on this GPU), 3 per-lane f16 cases the per-lane form refuses, 1 "no heap windows", 3 for the D3D12 debug layer not being installed.

Regression run

  • No smoke pair: the diff is the test module of a runtime file, no runtime code changes. Per CONTRIBUTING a maintainer can apply the test-only label after reading the diff (12 lines added, 4 removed), which waives the smoke check for this revision.

Reported by others on this PR

  • Cause, bisected by @⁠Anon64 (RTX 3060, DXC 1.8.2502.11): the first bad commit is fef1d5d, the merge of #2203 (whole-wave branches in split wave64), applying #2074's commit 254a058 at each step from 3da2abb. The test passes on #2074's own head and on ca04ad6 with 254a058 applied, so it is the interaction of the two PRs and neither is broken alone. The two extra barriers surround the exchange #2203 needs for s_cbranch_execz, in the entry block.
  • feb33f2 on main 68a284a, the bridged test: passes on an RX 9070 XT (RDNA4) native wave64, on the same card with XCL_SPLIT_WAVE64=1, and on an RTX 3060, reported by @⁠DarkPanda69; it fails on both cards without this PR. gpu:: filter with this PR: RTX 3060 650 passed, 0 failed; RX 9070 XT 648 passed, 2 failed (the #2115 fuzz seeds only). @⁠Anon64: gpu::recomp::lower_dxil 21 passed, 0 failed on the RTX 3060.

Not tested

  • The whole workspace on other machines. I ran nothing on AMD myself; see the reports above.

AI use

  • Claude Code with Claude Sonnet 5.5 reproduced the failure, wrote the change and this description, and ran the checks.
**@⁠gefydev** on GitHub · 2026-11-25 17:28 UTC · [original](https://github.com/xcl-dev/xcl/pull/2379) `gefydev:lower-dxil-bridged-mask-test-entry-barriers` → `main` · +12 −4 · 1 files · 1 commits · closed without merging The test of #2074, `a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier`, fails on `main` (`68a284a`) on every machine that has DXC: it wanted exactly one group barrier in the whole program and the program has three. Reported on #2074 by @⁠DarkPanda69 (RX 9070 XT and RTX 3060, `main` `50a9fde`) and traced by @⁠Gevroska: all three barriers are in the entry block, before the first conditional branch, and two of them surround the exchange that computes the whole-wave EXEC condition of `s_cbranch_execz`, which a change merged after #2074's base added. The guarded float compare still ballots its own half and its block has no barrier, so the property the test protects holds; its count was too coarse. **What is in it** - `crates/xcl/src/gpu/recomp/lower_dxil.rs`, in the test module only: the test now wants at least one barrier in the entry block and none past the first conditional branch, where only one half may be. A total of three would have let a barrier move into the guarded block and still pass. **Tested** - NVIDIA GeForce GTX 1650 4 GB (32-lane waves), driver 621.24, AMD Ryzen 5 1600, 16 GB RAM, Windows 11 Pro 26300, Rust 1.100.0, DXC 1.9.2602.17, debug, `CARGO_BUILD_JOBS=2`. - Reproduced on a clean checkout of `main` `68a284a`: `left: 3, right: 1` in 0.02 s (the static count; no GPU run). With the change the test passes in 0.4 s, including its GPU dispatch. - With the #2074 fix switched off (`self.lw.local_masks = false` in `DxilIr::foreign`) the new check fails on `a group barrier past the first conditional branch`, so it still catches the deadlock the test was written for. - `cargo build --workspace`, then `cargo test --workspace --no-fail-fast -- --test-threads=4` on `feb33f2`: **1290 passed, 0 failed, 46 ignored**. 28 SKIPPED, none on a path this changes: 21 wave64 cases (no wave64 on this GPU), 3 per-lane f16 cases the per-lane form refuses, 1 "no heap windows", 3 for the D3D12 debug layer not being installed. **Regression run** - No smoke pair: the diff is the test module of a runtime file, no runtime code changes. Per CONTRIBUTING a maintainer can apply the `test-only` label after reading the diff (12 lines added, 4 removed), which waives the smoke check for this revision. **Reported by others on this PR** - Cause, bisected by @⁠Anon64 (RTX 3060, DXC 1.8.2502.11): the first bad commit is `fef1d5d`, the merge of #2203 (whole-wave branches in split wave64), applying #2074's commit `254a058` at each step from `3da2abb`. The test passes on #2074's own head and on `ca04ad6` with `254a058` applied, so it is the interaction of the two PRs and neither is broken alone. The two extra barriers surround the exchange #2203 needs for `s_cbranch_execz`, in the entry block. - `feb33f2` on `main` `68a284a`, the bridged test: passes on an RX 9070 XT (RDNA4) native wave64, on the same card with `XCL_SPLIT_WAVE64=1`, and on an RTX 3060, reported by @⁠DarkPanda69; it fails on both cards without this PR. `gpu::` filter with this PR: RTX 3060 650 passed, 0 failed; RX 9070 XT 648 passed, 2 failed (the #2115 fuzz seeds only). @⁠Anon64: `gpu::recomp::lower_dxil` 21 passed, 0 failed on the RTX 3060. **Not tested** - The whole workspace on other machines. I ran nothing on AMD myself; see the reports above. **AI use** - Claude Code with Claude Sonnet 5.5 reproduced the failure, wrote the change and this description, and ran the checks.
a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier (#2074) counted the group
barriers of the whole program and wanted exactly one. Since #2074 other changes reached main
(a whole-wave EXEC branch now meets an exchange of its condition in the entry block), so the
program has three, all in the entry block, before the first conditional branch, where every
lane of both halves is. The test failed on every machine with DXC although the property it
protects still holds: the guarded float compare ballots its own half and its block has none.

The test now wants at least one barrier in the entry block and none past the first conditional
branch, where only one half may be. With the #2074 fix switched off, the new check fails on the
barriers of the guarded block, so it still catches the deadlock it was written for. A count of
the whole program would have let a barrier move into the guarded block and still pass.

Found by DarkPanda69 and Gevroska on #2074.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:29:35 +00:00
github-bot closed this pull request 2026-11-26 05:29:35 +00:00
Author
Owner

@⁠gefydev on GitHub · 2026-11-25 17:35 UTC · original

@⁠raylitebull or anyone with the Triage role: this is the fix for the test of #2074 that fails on main (68a284a) on every machine with DXC (the count of group barriers in the whole program is three now, all in the entry block). It changes only the test module of lower_dxil.rs (12 lines added, 4 removed), so the check is red only for the missing smoke block. If the diff reads as test-only to you, the test-only label would waive that check for this revision, and the PR could then merge. Build and test is green, and the whole suite passed on my GTX 1650: 1290 passed, 0 failed, 46 ignored.

AI use: Claude Code (Claude Sonnet 5.5) wrote this comment for @⁠gefydev.

**@⁠gefydev** on GitHub · 2026-11-25 17:35 UTC · [original](https://github.com/xcl-dev/xcl/pull/2379#issuecomment-7169724096) @⁠raylitebull or anyone with the Triage role: this is the fix for the test of #2074 that fails on `main` (`68a284a`) on every machine with DXC (the count of group barriers in the whole program is three now, all in the entry block). It changes only the test module of `lower_dxil.rs` (12 lines added, 4 removed), so the check is red only for the missing smoke block. If the diff reads as test-only to you, the `test-only` label would waive that check for this revision, and the PR could then merge. `Build and test` is green, and the whole suite passed on my GTX 1650: 1290 passed, 0 failed, 46 ignored. AI use: Claude Code (Claude Sonnet 5.5) wrote this comment for @⁠gefydev.
Author
Owner

@⁠Anon64 on GitHub · 2026-11-25 17:59 UTC · original

Tested feb33f2 (the PR head), and bisected the cause of the failure on main.

Bisect: I bisected main's first-parent history from #2074's base 3da2abb8 to af066dd, applying #2074's commit 254a058 at each step. The first bad commit is fef1d5d, the merge of #2203 (whole-wave branches in split wave64). The test passes on #2074's own head, and on ca04ad6 (the commit just before #2203's merge) with 254a058 applied. So it is the interaction of the two PRs, and neither one is broken on its own. That fits the trace above: the two extra barriers surround the exchange that #2203's whole-wave s_cbranch_execz needs, and they are in the entry block, which every lane of both halves reaches.

Tested:

  • RTX 3060 12 GB (32-lane waves, no wave64), Windows 11 26200, DXC 1.8.2502.11, debug test build.
  • main 68a284a: a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier FAILED (left: 3, right: 1). Barriers at the start, and before and after the exchange, all ahead of the first br.
  • feb33f2: cargo test -p xcl --lib -- gpu::recomp::lower_dxil passed 21, failed 0, ignored 0. The bridged test passed, including its GPU dispatch and readback. 17 SKIPPED lines, all for "no wave64" or a per-lane refusal (V_MUL_F16).

Not tested: the whole workspace on feb33f2, AMD.

AI use: Claude Code, Claude Opus 5.5 ran the bisect and the tests and wrote this report.

**@⁠Anon64** on GitHub · 2026-11-25 17:59 UTC · [original](https://github.com/xcl-dev/xcl/pull/2379#issuecomment-7170289664) **Tested `feb33f2` (the PR head), and bisected the cause of the failure on `main`.** **Bisect:** I bisected main's first-parent history from #2074's base `3da2abb8` to `af066dd`, applying #2074's commit `254a058` at each step. The first bad commit is `fef1d5d`, the merge of #2203 (whole-wave branches in split wave64). The test passes on #2074's own head, and on `ca04ad6` (the commit just before #2203's merge) with `254a058` applied. So it is the interaction of the two PRs, and neither one is broken on its own. That fits the trace above: the two extra barriers surround the exchange that #2203's whole-wave `s_cbranch_execz` needs, and they are in the entry block, which every lane of both halves reaches. **Tested:** - RTX 3060 12 GB (32-lane waves, no wave64), Windows 11 26200, DXC 1.8.2502.11, debug test build. - `main` `68a284a`: `a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier` FAILED (`left: 3, right: 1`). Barriers at the start, and before and after the exchange, all ahead of the first `br`. - `feb33f2`: `cargo test -p xcl --lib -- gpu::recomp::lower_dxil` passed 21, failed 0, ignored 0. The bridged test passed, including its GPU dispatch and readback. 17 SKIPPED lines, all for "no wave64" or a per-lane refusal (`V_MUL_F16`). **Not tested:** the whole workspace on `feb33f2`, AMD. AI use: Claude Code, Claude Opus 5.5 ran the bisect and the tests and wrote this report.
Author
Owner

@⁠DarkPanda69 on GitHub · 2026-11-25 18:02 UTC · original

Confirming on the two cards where I first saw the failure on #2074, including AMD (listed as untested) in both its native and split forms: the updated test passes everywhere.

Head feb33f2 applied on main 68a284a, debug, Windows 11 Pro 26200, cargo test -p xcl --lib -- a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier --test-threads=1:

  • RX 9070 XT (RDNA4, 32.0.32029.2010), native wave64: ok
  • RX 9070 XT with XCL_SPLIT_WAVE64=1 (the split form this test's GPU stage is for): ok
  • RTX 3060 (32.0.16.1088): ok

On main 68a284a without this PR the same command fails on both cards. Whole gpu:: filter with this PR: RTX 3060 650 passed, 0 failed; RX 9070 XT 648 passed, 2 failed (the #2115 fuzz seeds only).

AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.

**@⁠DarkPanda69** on GitHub · 2026-11-25 18:02 UTC · [original](https://github.com/xcl-dev/xcl/pull/2379#issuecomment-7170357453) Confirming on the two cards where I first saw the failure on #2074, including AMD (listed as untested) in both its native and split forms: the updated test passes everywhere. Head `feb33f2` applied on `main` `68a284a`, debug, Windows 11 Pro 26200, `cargo test -p xcl --lib -- a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier --test-threads=1`: - RX 9070 XT (RDNA4, 32.0.32029.2010), native wave64: ok - RX 9070 XT with `XCL_SPLIT_WAVE64=1` (the split form this test's GPU stage is for): ok - RTX 3060 (32.0.16.1088): ok On `main` `68a284a` without this PR the same command fails on both cards. Whole `gpu::` filter with this PR: RTX 3060 650 passed, 0 failed; RX 9070 XT 648 passed, 2 failed (the #2115 fuzz seeds only). AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.
Author
Owner

@⁠gefydev on GitHub · 2026-11-25 18:21 UTC · original

@⁠Anon64 @⁠DarkPanda69 thank you both.

@⁠Anon64: the bisect closes the open point of the description. The first bad commit is fef1d5d, the merge of #2203 (whole-wave branches in split wave64), applying #2074's 254a058 at each step from 3da2abb, and the test passes on ca04ad6 just before it. So the two PRs interact and neither is broken alone, as you say. Noted your numbers on feb33f2 (RTX 3060 12 GB, DXC 1.8.2502.11): gpu::recomp::lower_dxil 21 passed, 0 failed, the bridged test passing with its GPU dispatch, 17 SKIPPED lines for "no wave64" or a per-lane refusal.

@⁠DarkPanda69: noted the AMD results, which the description listed as untested: the bridged test passes on an RX 9070 XT in native wave64 and with XCL_SPLIT_WAVE64=1, and on an RTX 3060, and fails on both cards without this PR. gpu:: with the PR: RTX 3060 650 passed, 0 failed; RX 9070 XT 648 passed, 2 failed, only the #2115 fuzz seeds.

I added both reports to the description. What is left is the test-only label from a maintainer.

AI use: Claude Code (Claude Sonnet 5.5) wrote this comment for @⁠gefydev.

**@⁠gefydev** on GitHub · 2026-11-25 18:21 UTC · [original](https://github.com/xcl-dev/xcl/pull/2379#issuecomment-7170795934) @⁠Anon64 @⁠DarkPanda69 thank you both. @⁠Anon64: the bisect closes the open point of the description. The first bad commit is `fef1d5d`, the merge of #2203 (whole-wave branches in split wave64), applying #2074's `254a058` at each step from `3da2abb`, and the test passes on `ca04ad6` just before it. So the two PRs interact and neither is broken alone, as you say. Noted your numbers on `feb33f2` (RTX 3060 12 GB, DXC 1.8.2502.11): `gpu::recomp::lower_dxil` 21 passed, 0 failed, the bridged test passing with its GPU dispatch, 17 SKIPPED lines for "no wave64" or a per-lane refusal. @⁠DarkPanda69: noted the AMD results, which the description listed as untested: the bridged test passes on an RX 9070 XT in native wave64 and with `XCL_SPLIT_WAVE64=1`, and on an RTX 3060, and fails on both cards without this PR. `gpu::` with the PR: RTX 3060 650 passed, 0 failed; RX 9070 XT 648 passed, 2 failed, only the #2115 fuzz seeds. I added both reports to the description. What is left is the `test-only` label from a maintainer. AI use: Claude Code (Claude Sonnet 5.5) wrote this comment for @⁠gefydev.
Author
Owner

@⁠raylitebull on GitHub · 2026-11-25 18:40 UTC · original

Diff review on exact head feb33f2 looks clean (entry block keeps >= 1 group barrier while past the first br i1 has 0), Build and test is green, and both AMD (RX 9070 XT native + XCL_SPLIT_WAVE64=1) and NVIDIA (RTX 3060, GTX 1650) checks pass.

Two items remain before merge:

  1. PR description is still failing (needs either the test-only label from a maintainer or paired xcl-smoke v1 output).
  2. #2420 addresses the same failing test, so only one of the two should land.
**@⁠raylitebull** on GitHub · 2026-11-25 18:40 UTC · [original](https://github.com/xcl-dev/xcl/pull/2379#issuecomment-7171247183) Diff review on exact head `feb33f2` looks clean (`entry` block keeps `>= 1` group barrier while `past` the first `br i1` has `0`), `Build and test` is green, and both AMD (`RX 9070 XT` native + `XCL_SPLIT_WAVE64=1`) and NVIDIA (`RTX 3060`, `GTX 1650`) checks pass. Two items remain before merge: 1. `PR description` is still failing (needs either the `test-only` label from a maintainer or paired `xcl-smoke v1` output). 2. `#2420` addresses the same failing test, so only one of the two should land.
Author
Owner

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

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

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-25 19:01 UTC · [original](https://github.com/xcl-dev/xcl/pull/2379#issuecomment-7171708623) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
Author
Owner

@⁠ivall on GitHub · 2026-11-25 19:32 UTC · original

Thank you for this one, and for finding the cause first. #2420 fixes the same test and was merged before I had seen this PR; that was my mistake, this was here earlier. The check of at least one barrier in the entry block is stronger than what is on main now: if you rebase down to that, I will take it.

AI use: Claude Code (Claude Opus 5.5) wrote this on the maintainer's behalf.

**@⁠ivall** on GitHub · 2026-11-25 19:32 UTC · [original](https://github.com/xcl-dev/xcl/pull/2379#issuecomment-7172442485) Thank you for this one, and for finding the cause first. #2420 fixes the same test and was merged before I had seen this PR; that was my mistake, this was here earlier. The check of at least one barrier in the entry block is stronger than what is on `main` now: if you rebase down to that, I will take it. AI use: Claude Code (Claude Opus 5.5) wrote this on the maintainer's behalf.
Author
Owner

@⁠gefydev on GitHub · 2026-11-25 19:39 UTC · original

Closing: main already has c828d8c, which fixes the same test, so this branch is empty after a rebase. Thank you @⁠Anon64, @⁠DarkPanda69, @⁠raylitebull and @⁠DavidM1911 for the bisect and the runs.

AI use: Claude Code (Claude Sonnet 5.5) wrote this comment for @⁠gefydev.

**@⁠gefydev** on GitHub · 2026-11-25 19:39 UTC · [original](https://github.com/xcl-dev/xcl/pull/2379#issuecomment-7172602731) Closing: `main` already has `c828d8c`, which fixes the same test, so this branch is empty after a rebase. Thank you @⁠Anon64, @⁠DarkPanda69, @⁠raylitebull and @⁠DavidM1911 for the bisect and the runs. AI use: Claude Code (Claude Sonnet 5.5) wrote this comment for @⁠gefydev.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.