Skip to content

Tests: check divergent block barriers in a_bridged_mask_write - #2420

Merged
ivall merged 1 commit into
xcl-dev:mainfrom
Ritolino:test/bridged-mask-write-barrier-check
Nov 25, 2026
Merged

ivall merged 1 commit into
xcl-dev:mainfrom
Ritolino:test/bridged-mask-write-barrier-check

Conversation

@Ritolino

@Ritolino Ritolino commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Fixes gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier failing on main (left: 3, right: 1).

After whole-wave branches (#2178), the entry block before \n br legitimately contains the xcl_xw setup barrier and the two split-wave xcl_xs exchange barriers (total 3 barriers in the module), while the divergent half-only block (<label>:46) still emits 0 group barriers — which is the invariant introduced by #2074.

What is in it

  • crates/xcl/src/gpu/recomp/lower_dxil.rs (#[cfg(test)] only): update a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier to assert 0 dx.op.barrier calls after the entry \n br terminator instead of 1 barrier across the whole module, while keeping the GPU dispatch check intact (test-only).

Tested

  • Windows 11 x64, AMD Ryzen 9 7950X, NVIDIA GeForce RTX 4080 (wave32), DXC 1.9.2602.17, rustc 1.100.0 (stable-x86_64-pc-windows-msvc), debug (c828d8c)
  • cargo test -p xcl --lib a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier: 1 passed, 0 failed (0.93s)
  • .\scripts\test.ps1 (cargo test --workspace -- --test-threads=4): xcl --lib 1253 passed, 1 failed, 26 ignored (the single failure is the pre-existing NTFS blob_enumeration_sees_one_submitted_update issue tracked in XGameRuntime: blob_enumeration_sees_one_submitted_update fails on Windows NTFS (DirEntry::metadata cache) #2421; 23/24 other targets passed).
  • .\scripts\test.ps1 --skip blob_enumeration_sees_one_submitted_update: 1328 passed, 0 failed, 46 ignored, 1 filtered out (SKIPPED GPU tests across workspace: 23 no wave64, 3 per-lane form: refused, 1 no heap windows, 1 no D3D12 debug layer, 1 cannot disable the driver cache (Windows Developer Mode is required)).

Not tested

  • AMD GPU (wave64 / RDNA2–4) — no AMD adapter available locally.
  • scripts/smoke.ps1 (xcl-smoke) — test-only change (#[cfg(test)] only, no runtime files touched) and no Xbox GDK title available locally.

AI use

  • Antigravity with Gemini 4 Neon (Medium) for root-cause analysis and Gemini 4 Hydrogen (Medium) for editing the test assertion and running local verification; reviewed by human.

@raylitebull

Copy link
Copy Markdown
Member

Diff review on c828d8c (�_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier in crates/xcl/src/gpu/recomp/lower_dxil.rs): check after \n br cleanly isolates barriers past the entry terminator (divergent_barriers == 0) while keeping the test GPU execution check intact, and I have approved CI run 45674546417. Two items needed before merge: (1) complete the truncated PR description with What is in it, Tested (GPU suite counts), Not tested, and AI use (and est-only label if applicable) so PR description passes; (2) add AMD + NVIDIA verification counts for c828d8c.

@ivall

ivall commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator

Reviewed at c828d8c; the diff is inside #[cfg(test)] only, so I set test-only.

Why the count went from 1 to 3: since #2203 the outer S_CBRANCH_EXECZ is a whole-wave branch, and its exchange between the two halves adds two group barriers in the entry block, which both halves reach. What #2074 asked for (no barrier in the block only one half reaches) still holds and is what the test now checks.

Tested on AMD RDNA4 (native wave64), Windows, DXC 1.8.2502.11, debug, on main 3f27770 with #2420, #2257, #2408, #2247, #2338, #2097 and #2372 merged locally: cargo test --workspace --no-fail-fast -- --test-threads=4: 1367 passed, 2 failed, 46 ignored, 7 SKIPPED lines. main 3f27770 alone, same command: 1354 passed, 3 failed, 46 ignored. The difference in failures is this test. The other two, fuzz_validate_and_gpu_1 (seed 722) and _3 (seed 1599), fail the same way on main.

AI use: Claude Code (Claude Opus 5.5) reviewed the diff, ran the tests and wrote this on the maintainer's behalf.

@ivall ivall added the test-only A maintainer reviewed the diff: tests only, no smoke run needed for this revision (CONTRIBUTING.md) label Nov 25, 2026
@ivall
ivall merged commit c56e744 into xcl-dev:main Nov 25, 2026
2 of 4 checks passed
KOLESNiii added a commit to KOLESNiii/xcl that referenced this pull request Nov 25, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
raylitebull added a commit that referenced this pull request Nov 25, 2026
Keep amd-dev 0 commits behind origin/main (#2420, #2338, #2257, #2247).
Resolved shaders.rs by taking #2338's make_one/path_for dispatch-chain precompile.

Assisted-by: Antigravity (Gemini 4 Neon High)
grahamster2 added a commit to grahamster2/xcl that referenced this pull request Nov 26, 2026
… block

xcl-dev#2420 fixed this test after xcl-dev#2203 (whole-wave branches in split wave64)
put the exchange of the `s_cbranch_execz` condition into the entry block,
by counting only the barriers past the entry block's branch. A program
that is no longer the split form (no barrier anywhere) passes that check
too, so also require at least one group barrier in the entry block, as
xcl-dev#2379 did, and drop the doc comment's "the only barrier left is the one at
the start", which has not held since xcl-dev#2203.

With `Lw::local_masks` forced off (xcl-dev#2074's fix switched off) the test
still fails, on 2 barriers past the branch.

Assisted-by: Claude Code (Claude Opus 5.5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test-only A maintainer reviewed the diff: tests only, no smoke run needed for this revision (CONTRIBUTING.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants