Repository navigation
Conversation
…anch a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier (xcl-dev#2074) counted the group barriers of the whole program and wanted exactly one. Since xcl-dev#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 xcl-dev#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 xcl-dev#2074.
|
@raylitebull or anyone with the Triage role: this is the fix for the test of #2074 that fails on AI use: Claude Code (Claude Sonnet 5.5) wrote this comment for @gefydev. |
The DXIL adapter's half of the VS / PS stages (xcl-dev#1269): - `DxilIr` sets a VS / PS up in `Lw`'s entry block, as `kernel.rs` does: `setup_lanes_gfx`, then xcl-dev#1426's `setup_vertex` / `setup_pixel`, whose input loads must come before every use. `graphics_start` hands the lowering the initial VGPRs and the lane's bit of the launch EXEC (`ballot(true)`, without a PS's helper lanes); `graphics_end` is xcl-dev#1426's `finish_gfx`. - A VS / PS's ballots and lane reads go through `Lw`'s `ballot`, `rla` and `read_lane_half`, which know a wave32 program's half in 64-lane hardware and see a PS's helper lanes through quad reads. - `lower_dxil::vertex` / `pixel` give the signed containers. - The bridge passes an export's EXEC only as the guard, which xcl-dev#1426's `export_gfx` takes, as it does for `v_cmpx`: passed as a number, EXEC refused every export ("s126: a mask read as a number"). The exports write xcl-dev#1426's output temporaries. These reach `finish_gfx` in the exit block through `Lw`'s SSA, since the adapter's branches go through `Lw` (gefydev's point in xcl-dev#1269), so the lowering needs no variable of its own for them. Tested on an RTX 4090 (32-lane waves; Windows 10 22H2, DXC 1.8.2502): - per_lane_vs_and_ps_with_a_branch_before_their_exports_draw_as_the_hlsl_path (new): a VS and a PS whose exports follow a branch draw what the HLSL path's stages draw for both branch directions, and each links with the HLSL path's other stage. It fails without the bridge change (the VS is refused) and with the adapter's branches bypassing `Lw` (the VS fails validation); - cargo test --workspace -- --test-threads=1 on main 68a284a with this commit: 1289 passed, 2 failed, 46 ignored (lib 1219 passed). Neither failure is in this change: main fails a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier the same way (its test-only fix is xcl-dev#2379), and d32s8_targets_take_their_own_size_of_video_memory passes on its own, with and without this commit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tested Bisect: I bisected main's first-parent history from #2074's base Tested:
Not tested: the whole workspace on AI use: Claude Code, Claude Opus 5.5 ran the bisect and the tests and wrote this report. |
|
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
On AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report. |
|
@Anon64 @DarkPanda69 thank you both. @Anon64: the bisect closes the open point of the description. The first bad commit is @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 I added both reports to the description. What is left is the AI use: Claude Code (Claude Sonnet 5.5) wrote this comment for @gefydev. |
|
Diff review on exact head Two items remain before merge:
|
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
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 AI use: Claude Code (Claude Opus 5.5) wrote this on the maintainer's behalf. |
|
Closing: AI use: Claude Code (Claude Sonnet 5.5) wrote this comment for @gefydev. |
The test of #2074,
a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier, fails onmain(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,main50a9fde) 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 ofs_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
CARGO_BUILD_JOBS=2.main68a284a:left: 3, right: 1in 0.02 s (the static count; no GPU run). With the change the test passes in 0.4 s, including its GPU dispatch.self.lw.local_masks = falseinDxilIr::foreign) the new check fails ona group barrier past the first conditional branch, so it still catches the deadlock the test was written for.cargo build --workspace, thencargo test --workspace --no-fail-fast -- --test-threads=4onfeb33f2: 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
test-onlylabel after reading the diff (12 lines added, 4 removed), which waives the smoke check for this revision.Reported by others on this PR
fef1d5d, the merge of recomp: enable whole-wave branches and dead-SCC elision in split wave64 #2203 (whole-wave branches in split wave64), applying Recompiler: a bridged mask write in the split form meets no barrier #2074's commit254a058at each step from3da2abb. The test passes on Recompiler: a bridged mask write in the split form meets no barrier #2074's own head and onca04ad6with254a058applied, so it is the interaction of the two PRs and neither is broken alone. The two extra barriers surround the exchange recomp: enable whole-wave branches and dead-SCC elision in split wave64 #2203 needs fors_cbranch_execz, in the entry block.feb33f2onmain68a284a, the bridged test: passes on an RX 9070 XT (RDNA4) native wave64, on the same card withXCL_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 DXIL fuzz tests: fuzz_validate_and_gpu_1 fails on AMD (seed 722 and others, RDNA2-4), so the default suite is red there #2115 fuzz seeds only). @Anon64:gpu::recomp::lower_dxil21 passed, 0 failed on the RTX 3060.Not tested
AI use