Tests: the bridged mask write test also checks that the entry block keeps a barrier #2573

Closed
grahamster2 wants to merge 1 commit from upstream-pr/2583 into main
grahamster2 commented 2026-11-26 00:14:42 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by grahamster2 on 2026-11-26T00:14:42Z.


#2420 fixed a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier by counting only the group barriers past the entry block's branch. That == 0 check alone also passes for a program with no barriers at all, i.e. one that is no longer the split form the test is about. This adds the other half of #2379's check (at least one group barrier in the entry block) and fixes the test's doc comment, which still says "the only barrier left is the one at the start".

@ivall offered to take this stronger check on #2379 after #2420 merged: https://github.com/xcl-dev/xcl/pull/2379#issuecomment-7172442485. Credit for the check goes to @gefydev (#2379).

Cause of the original failure: @Anon64's bisect on #2379 found the first bad commit fef1d5d, the merge of #2203 (whole-wave branches and dead-SCC elision in split wave64). I reran the bisect independently over main's first-parent history from #2074's base 3da2abb (good) to 50a9fde^1 (bad), applying #2074's 254a058 at each step, and got the same commit. #2203 moves the exchange of the s_cbranch_execz condition into the entry block, so the program has 3 barriers there instead of 1. That is a legitimate change, so the test was stale, not the lowering.

What is in it

  • crates/xcl/src/gpu/recomp/lower_dxil.rs (#[cfg(test)] only): assert >= 1 dx.op.barrier call before the first \n br , keep #2420's == 0 after it, update the doc comment (10 added, 4 removed)

Tested

  • Run on the previous head 17efe49; the current head cc426e6 differs from it only in the doc comment, the test code is identical
  • NVIDIA GeForce RTX 3080 (driver 610.88, wave32), Windows 11 Pro 26200, rustc 1.94.0, debug
  • cargo test -p xcl --lib -- --test-threads=4: 1304 passed, 0 failed, 27 ignored
  • SKIPPED: 24, all "no wave64" except the three per-lane f16 arithmetic / f16 packed / f32 conversions cases (per-lane form: refused)
  • cargo test -p xcl --lib a_bridged_mask_write_where: 1 passed, GPU stage ran (not skipped)
  • with self.lw.local_masks = true in lower_dxil.rs changed to false (#2074's fix switched off): the test fails on the after-branch check, left: 2, right: 0

Not tested

  • cargo test --workspace (only -p xcl --lib)
  • the new entry-block check is a guard against a future regression; there is no known failing case for it today
  • AMD and Intel GPUs, native wave64 hardware
  • the retail title (test-only change, no regression run)

AI use

  • Claude Code (Claude Opus 5.5): bisected, wrote the test change and this description, ran the tests.
<!-- greyfinch-sync:ivall/xcl:issue:5501494392 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2583). Originally posted by [grahamster2](https://github.com/grahamster2) on 2026-11-26T00:14:42Z. --- #2420 fixed `a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier` by counting only the group barriers past the entry block's branch. That `== 0` check alone also passes for a program with no barriers at all, i.e. one that is no longer the split form the test is about. This adds the other half of #2379's check (at least one group barrier in the entry block) and fixes the test's doc comment, which still says "the only barrier left is the one at the start". @ivall offered to take this stronger check on #2379 after #2420 merged: https://github.com/xcl-dev/xcl/pull/2379#issuecomment-7172442485. Credit for the check goes to @gefydev (#2379). Cause of the original failure: @Anon64's bisect on #2379 found the first bad commit `fef1d5d`, the merge of #2203 (whole-wave branches and dead-SCC elision in split wave64). I reran the bisect independently over `main`'s first-parent history from #2074's base `3da2abb` (good) to `50a9fde^1` (bad), applying #2074's `254a058` at each step, and got the same commit. #2203 moves the exchange of the `s_cbranch_execz` condition into the entry block, so the program has 3 barriers there instead of 1. That is a legitimate change, so the test was stale, not the lowering. **What is in it** - `crates/xcl/src/gpu/recomp/lower_dxil.rs` (`#[cfg(test)]` only): assert `>= 1` `dx.op.barrier` call before the first `\n br `, keep #2420's `== 0` after it, update the doc comment (10 added, 4 removed) **Tested** - Run on the previous head `17efe49`; the current head `cc426e6` differs from it only in the doc comment, the test code is identical - NVIDIA GeForce RTX 3080 (driver 610.88, wave32), Windows 11 Pro 26200, rustc 1.94.0, debug - `cargo test -p xcl --lib -- --test-threads=4`: 1304 passed, 0 failed, 27 ignored - `SKIPPED`: 24, all "no wave64" except the three per-lane f16 arithmetic / f16 packed / f32 conversions cases (per-lane form: refused) - `cargo test -p xcl --lib a_bridged_mask_write_where`: 1 passed, GPU stage ran (not skipped) - with `self.lw.local_masks = true` in `lower_dxil.rs` changed to `false` (#2074's fix switched off): the test fails on the after-branch check, `left: 2, right: 0` **Not tested** - `cargo test --workspace` (only `-p xcl --lib`) - the new entry-block check is a guard against a future regression; there is no known failing case for it today - AMD and Intel GPUs, native wave64 hardware - the retail title (test-only change, no regression run) **AI use** - Claude Code (Claude Opus 5.5): bisected, wrote the test change and this description, ran the tests.
DavidM1911 commented 2026-11-26 01:05:37 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T00:16:43Z.


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

  • cargo test -p xcl --lib: all passed, 0 failed, 26 ignored.

Thanks!

— Devin

<!-- greyfinch-sync:ivall/xcl:comment:7178588585 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2583#issuecomment-7178588585). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-26T00:16:43Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, 26 ignored. Thanks! — Devin
fromthemoonx commented 2026-11-26 02:08:23 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by fromthemoonx on 2026-11-26T01:44:26Z.


Whole suite on NVIDIA (listed under Not tested): passes. The changed test passes 3 of 3 with no SKIPPED line, so both the new entry-block check and the GPU part ran.

Tested: cc426e6 merged onto main b49be18 (clean). RTX 3060 12 GB (driver 610.88, 32-lane waves), Ryzen 7 5700X, Windows 11 Pro 26300, Rust 1.100.0 MSVC, DXC 1.9.2602.17, debug.

result
cargo test --workspace --no-fail-fast -- --test-threads=4 1435 passed, 0 failed, 47 ignored; 25 SKIPPED lines (no wave64, refused per-lane forms)
a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier --exact --nocapture, 3 runs 3 of 3, no SKIPPED

Not tested: a lowering that drops the entry-block barrier (there is none to try it on, as the description says); AMD.

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

<!-- greyfinch-sync:ivall/xcl:comment:7180076331 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2583#issuecomment-7180076331). Originally posted by [fromthemoonx](https://github.com/fromthemoonx) on 2026-11-26T01:44:26Z. --- **Whole suite on NVIDIA (listed under Not tested): passes. The changed test passes 3 of 3 with no `SKIPPED` line, so both the new entry-block check and the GPU part ran.** **Tested:** `cc426e6` merged onto `main` `b49be18` (clean). RTX 3060 12 GB (driver 610.88, 32-lane waves), Ryzen 7 5700X, Windows 11 Pro 26300, Rust 1.100.0 MSVC, DXC 1.9.2602.17, debug. | | result | |---|---| | `cargo test --workspace --no-fail-fast -- --test-threads=4` | 1435 passed, 0 failed, 47 ignored; 25 `SKIPPED` lines (`no wave64`, refused per-lane forms) | | `a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier --exact --nocapture`, 3 runs | 3 of 3, no `SKIPPED` | **Not tested:** a lowering that drops the entry-block barrier (there is none to try it on, as the description says); AMD. **AI use:** Claude Code (Claude Opus 5.5) ran the tests and wrote this report.
grahamster2 commented 2026-11-26 07:03:30 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by grahamster2 on 2026-11-26T06:11:49Z.


The "PR description" check fails only on the smoke requirement: the diff is a #[cfg(test)] change inside lower_dxil.rs, which the check counts as a runtime file, so it asks for an xcl-smoke pair. The rest of the description passes. Nothing in the runtime changes, so a retail run would measure nothing about this PR and I have not faked one. Could a maintainer review the diff and apply the test-only label? That waives the smoke check for this head, as CONTRIBUTING.md describes. The current head is cc426e6.

AI use: Claude Code (Claude Sonnet 5.5) wrote this reply.

<!-- greyfinch-sync:ivall/xcl:comment:7184187069 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2583#issuecomment-7184187069). Originally posted by [grahamster2](https://github.com/grahamster2) on 2026-11-26T06:11:49Z. --- The "PR description" check fails only on the smoke requirement: the diff is a `#[cfg(test)]` change inside `lower_dxil.rs`, which the check counts as a runtime file, so it asks for an `xcl-smoke` pair. The rest of the description passes. Nothing in the runtime changes, so a retail run would measure nothing about this PR and I have not faked one. Could a maintainer review the diff and apply the `test-only` label? That waives the smoke check for this head, as CONTRIBUTING.md describes. The current head is cc426e6. AI use: Claude Code (Claude Sonnet 5.5) wrote this reply.
github-actions[bot] commented 2026-11-30 08:43:07 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-30T08:43:07Z.


Nothing has happened on this PR for 3 days, so it is marked stale and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto main if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.

<!-- greyfinch-sync:ivall/xcl:comment:7273256209 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2583#issuecomment-7273256209). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-30T08:43:07Z. --- Nothing has happened on this PR for 3 days, so it is marked `stale` and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto `main` if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.
Foniass commented 2026-12-01 06:08:25 +00:00 (Migrated from github.com)

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


Review (head cc426e62, diff read, not a merge-check; it conflicts with main, so not built or run):

  • Superseded, and main is stricter. Since the #3203 merge (765b2c5b, building on c828d8c0), a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier (lower_dxil.rs ~1478) asserts exactly one mode-9 group barrier in the program, two mode-8 spin fences, no barrier of any other mode, and none of mode 9 after the entry branch, which pins exactly one group barrier in the entry block (stronger than >= 1).
  • The PR's comment about exchanging EXEC at group barriers no longer fits main, where the exchange uses spin fences, and its barriers() counts every kind of dx.op.barrier.

Fine: the reasoning and the bisect matched the tree when it was written. Recommendation: close as superseded.

AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7302526442 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2583#issuecomment-7302526442). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T06:08:25Z. --- Review (head cc426e62, diff read, not a merge-check; it conflicts with main, so not built or run): - **Superseded, and main is stricter.** Since the #3203 merge (765b2c5b, building on c828d8c0), `a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier` (`lower_dxil.rs` ~1478) asserts exactly one mode-9 group barrier in the program, two mode-8 spin fences, no barrier of any other mode, and none of mode 9 after the entry branch, which pins exactly one group barrier in the entry block (stronger than `>= 1`). - The PR's comment about exchanging EXEC at group barriers no longer fits main, where the exchange uses spin fences, and its `barriers()` counts every kind of `dx.op.barrier`. Fine: the reasoning and the bisect matched the tree when it was written. Recommendation: close as superseded. AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
throny commented 2026-12-01 12:54:42 +00:00 (Migrated from github.com)

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


Closing as superseded: this change is already on main (765b2c5b). main's test a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier asserts exactly one group barrier and two fences; PR is test-only and weaker

Two independent checks found this: Foniass's close list on #1607 and ours against current main. If something here is still missing on main, say so and reopen it, or ask and I will.

AI use: Claude Code (Claude Opus 5.5); the per-PR comparison was done by Claude Sonnet 5.5 sub-agents.

<!-- greyfinch-sync:ivall/xcl:comment:7311827606 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2583#issuecomment-7311827606). Originally posted by [throny](https://github.com/throny) on 2026-12-01T12:54:42Z. --- Closing as superseded: this change is already on `main` (765b2c5b). main's test a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier asserts exactly one group barrier and two fences; PR is test-only and weaker Two independent checks found this: Foniass's close list on #1607 and ours against current `main`. If something here is still missing on `main`, say so and reopen it, or ask and I will. AI use: Claude Code (Claude Opus 5.5); the per-PR comparison was done by Claude Sonnet 5.5 sub-agents.

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