Repository navigation
Conversation
In the split wave64 form, an instruction the per-lane form lowers through xcl-dev#1426's semantics (a float compare, a carry-out, v_cmpx) builds its mask with Lw::write_mask. When the mask is whole-live, as with a nested if whose float condition goes to s_and_saveexec, xcl-dev#1426 exchanges the words between the halves, and with one console wave per group that exchange is a group barrier. In a block only one half reaches, the other half never gets there (point 5 of Pipodi's review of xcl-dev#1745). The bridge reads back only each lane's own bit of the result, so this half's ballot is enough. DxilIr::foreign now sets Lw::local_masks around inst_guarded, and write_mask then builds the mask from this half's ballot, as it does for a mask that is never read whole. The new test's program had 3 group barriers before (two from the exchange inside the half's block) and has 1 now, the one at the start where the halves take their console lanes. Only XCL_PER_LANE=1 reaches this code.
|
Test report for Tested
Not tested
I read the diff. It matches point 5: the bridge reads back only each lane's own bit, so this half's ballot is enough. AI use: Claude Code with Claude Opus 5.5 ran the tests and wrote this report. |
|
@Pipodi thank you for the test report on AI use: Claude Code (Claude Opus 5.5) wrote this comment for @gefydev. |
PR #2074 split-wave64 mask-write verificationTested
$exe = 'L:/XclTooling/pr2014-1c971de6/target/debug/build/xcl/97fdf2b9ff8e1482/out/xcl-97fdf2b9ff8e1482.exe'
$fixture = 'gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier'
& 'L:/XclTooling/Invoke-ArcTest.ps1' -Test { & $exe $fixture --exact --nocapture }
The checked-in fixture’s DXIL disassembly assertion found exactly one group barrier, at entry. Its direct-DXIL dispatch checked 128 readback values across two groups. In each group, v7 was 5 in lanes 1–31 and 0 in lane 0 and lanes 32–63. The first two launches ended before the test ran. The default process policy blocked the wrapper and the first child invocation lost quoting. A subsequent exact run passed in 0.66s, but PowerShell reported a stderr parsing error. The table records the repeat with separate stdout and stderr so the skip count could be verified. Not tested The run covers the synthetic split-wave64 fixture on one Intel Arc A770. Native wave64, other adapters, the parent commit, stress/hang cases, the workspace suite, and retail title smoke are outside this run. Evidence Raw evidence in this directory includes environment.log, build.log, pr-before.log, pr-after.log, arc-command.txt, arc-verified.stdout.log, arc-verified.stderr.log, and arc-verified-exit.txt. The public PR discussion exposed 2 comment or review anchors at the final check. AI use T3 Code / Codex (gpt-6.2-sol) ran the checked-in fixture and wrote this empirical report. |
In the split wave64 form, the per-lane form (
XCL_PER_LANE=1, #1745) could put a group barrier in a block that only one 32-lane half reaches. Point 5 of Pipodi's review of #1745. Part of #1269.An instruction the per-lane form lowers through #1426's semantics (the bridge: float compares, carry-outs,
v_cmpx) writes its mask withLw::write_mask. When that mask is whole-live, as with a nestedifwhose float condition goes tos_and_saveexec, #1426 builds both words through an exchange between the halves, and with one console wave per group that exchange is a group barrier. In a block only the lower half reaches, the upper half never gets there. The bridge only reads back each lane's own bit of the result, so this half's ballot is enough: the bridge now asksLwfor the half-local mask, and the exchange is gone. OnlyXCL_PER_LANE=1reaches this code.What is in it
crates/xcl/src/gpu/dxil/lower.rs,kernel.rs:Lw::local_masks. When set in the split form,write_maskbuilds the mask from this half's ballot, as it already does for a mask that is never read whole.crates/xcl/src/gpu/recomp/lower_dxil.rs:DxilIr::foreignsets it aroundinst_guarded. New testa_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier: a nestedifin a block only lanes 0–31 reach, withv_cmp_lt_f32→s_and_saveexec. It counts the group barriers in the DXIL and checks the result on the GPU. Without the fix the program has 3 barriers (two from the exchange inside the half's block); with it, only the one at the start where the halves take their console lanes.Tested
left: 3, right: 1) and passes with it, including the GPU check: v7 = 5 in lanes 1–31 and 0 elsewhere, in both groups.cargo test --workspace -- --test-threads=4on254a058(onmain3da2abb): 1112 passed, 0 failed, 46 ignored; 24 SKIPPED (20 "no wave64" on this GPU, 1 "no heap windows", 3 per-lane halves refused on purpose for gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426's f16 rounding).Regression run
main:This PR's head:
Both with
XCL_PER_LANEoff (the default), which this change does not reach.Not tested
XCL_PER_LANE=1; the regression runs are with it off, the default.AI use
🤖 Generated with Claude Code
https://claude.ai/code/session_01Pu3TMXtx8TYFxrYEFhfdEp