Repository navigation
Conversation
|
Independent Ampere check of exact head
Both builds recompiled XCL. All 310 source hashes matched before/after each run; the pair differs only in those block-tail updates. This adds an older Ampere/driver check to the author's Ada result. Not tested: full workspace suite for this head, retail smoke/gameplay, native wave64, or performance. No implementation change is proposed. AI use: Codex with GPT-6 Astra inspected the fix and test, ran the comparison, and drafted this report. |
|
NVIDIA run: RTX 3070 8 GB (32-lane waves, split wave64), driver 616.56, Windows 11, debug,
AI-assisted (Claude Code). Synthetic tests only. |
79a7e32 to
87adc4b
Compare
|
Re-checked AI-assisted (Claude Code). |
|
Diff audit passed ( Remaining before merge: one independent AMD GPU pass on |
In split wave64 compute shaders with more than 64 threads per group (`Partner::Spin`), `DxilIr::ballot` and `DxilIr::read_lane` call `Lw::ballot` and `Lw::read_lane_uniform`, which lower through `Lw::spin_exchange` and create new DXIL basic blocks (advancing `self.lw.cur()` to the post-exchange join block). Neither method updated `self.tails[self.cur]`, so outgoing branches terminated the post-exchange block while `DxilIr::incoming` wired successor PHIs to the stale pre-exchange block, failing DXIL validation (`PHI node entries do not match predecessors!`). Sync `self.tails[self.cur] = self.lw.cur()` in both `DxilIr::ballot` and `DxilIr::read_lane` when `self.lw.split` is set (matching `DxilIr::foreign`), and add a `[128, 1, 1]` split-wave64 compute regression test covering whole-wave ballot (`s_bcnt1_i32_b64`) and `v_readlane_b32` in uniform branches feeding join PHIs plus `v_readfirstlane_b32` in a uniform loop feeding back-edge PHIs. Fixes xcl-dev#1889 Part of xcl-dev#1269 Assisted-by: Google Antigravity (Gemini 4 Neon)
87adc4b to
3990660
Compare
|
Rebased cleanly onto Re-verified locally on RTX 4060 (release): AI use: Google Antigravity (Gemini 4 Neon). |
gefydev
left a comment
There was a problem hiding this comment.
Review of 87adc4b from the per-lane form's side (#1745). I read it against main 3da2abb; I did not run it.
The fix is right. Lw::ballot and Lw::read_lane_uniform go through spin_exchange when a group has more than one console wave (Partner::Spin), which ends the current block, and DxilIr was still wiring successor phis to the block before the exchange. foreign already resyncs tails[cur] after inst_guarded for the same reason; these two were missed when the split exchanges were routed through Lw.
I checked the other DxilIr paths that reach Lw in the split form: read_lane_half (wave_read_lane_at on l & 31), ballot_half (wave_ballot), the loads and stores, and compute_ids emit no blocks. So after this change, every place that can split a block resyncs its tail.
Two notes:
- Optional, more robust:
br/br_ifcould setself.tails[self.cur] = self.lw.cur()before they terminate. The terminator is always inlw.cur(), so this one line would keep the tails right for any futureIrmethod that makes blocks, and it would replace the three separate syncs. Fine to leave as it is if you prefer the change minimal. - The PR conflicts with
mainnow, inlower_dxil.rs, probably the end of the test module after the recent per-lane merges (#2014, #1865). It needs a rebase.
Review written with Claude Code (Claude Opus 5.5); I checked each point against the code.
|
@gefydev Thank you for auditing every |
|
@Decodere thank you: noted that AI use: Claude Code (Claude Opus 5.5) wrote this reply for @gefydev. |
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
Tested Independent Intel Arc A770 compatibility check for XCL PR #1928 at
Windows 11 Enterprise Evaluation 26200.9974, AMD Ryzen 7 3800X, Intel Arc A770 driver 32.0.101.9175, Rust 1.100.0 ( Process environment for the build and run Prebuild outside the Arc lock and graphics execution inside it & "$env:USERPROFILE/.cargo/bin/cargo.exe" test --locked -p xcl --lib --no-run -j 2 --message-format=json-render-diagnostics > L:/XclTooling/pr1928/build-3990660.log
$pr1928Command = @'
& 'L:/XclTooling/Invoke-ArcTest.ps1' -Test {
$pr1928Exe = Join-Path $env:CARGO_TARGET_DIR 'debug/build/xcl/97fdf2b9ff8e1482/out/xcl-97fdf2b9ff8e1482.exe'
if ((Get-FileHash -LiteralPath $pr1928Exe).Hash -ne 'E321749EF65B804C74EE37850BB786D14E1B169E5D431EC6CAD74F4D3945BB6C') { throw 'Test binary changed since the prebuild' }
& $pr1928Exe 'gpu::recomp::lower_dxil::tests::split_wave64_spin_exchange_updates_block_tails' --exact --test-threads=1 --nocapture
}
'@
& powershell.exe -NoLogo -NoProfile -NonInteractive -ExecutionPolicy RemoteSigned -Command $pr1928Command 2>&1 | Tee-Object -FilePath L:/XclTooling/pr1928/gpu-3990660.logThe temporary Not tested Full workspace suite, comparison against AI use T3 Code / Codex (gpt-6.2-sol) verified the exact PR head, ran the checked-in test, and prepared this report. |
Updates
DxilIr's per-block tail pointer (self.tails[self.cur]) after split-wave64ballotandread_laneexchanges so successor PHI predecessors match the actual post-exchange basic block. Fixes #1889. Part of #1269.In split wave64 compute shaders with more than 64 threads per group (
Partner::Spin),DxilIr::ballotandDxilIr::read_lanecallLw::ballot/Lw::read_lane_uniform, which lower throughLw::spin_exchangeand create new DXIL basic blocks (advancingself.lw.cur()to the join block). Without syncingself.tails[self.cur] = self.lw.cur(), outgoing branches terminated the post-exchange join block whileDxilIr::incomingwired successor PHIs to the stale pre-exchange block, failing DXIL validation (PHI node entries do not match predecessors!). AuditedDxilIr::compute_ids(Lw::setup_lanes_compute) as well and confirmed it emits straight-line code with no basic-block splits.What is in it
crates/xcl/src/gpu/recomp/lower_dxil.rs:self.tails[self.cur] = self.lw.cur()inDxilIr::ballotandDxilIr::read_lanewhenself.lw.splitis set (matchingDxilIr::foreign).split_wave64_spin_exchange_updates_block_tailsin#[cfg(test)] mod tests, compiling and validating[128, 1, 1]split-wave64 compute shaders throughlower_dxil::compute_splitfor (1) whole-wave ballot (s_bcnt1_i32_b64) in a uniform branch feeding a join PHI, (2) cross-halfv_readlane_b32in a uniform branch feeding a join PHI, and (3)v_readfirstlane_b32(ballot + read_lane) in a uniform loop feeding back-edge PHIs, then verifying GPU execution parity againstrun_compute_waves.Tested
0ef1bc386), DXC 1.9.2609.5 (01b62ad4), release build.split_wave64_spin_exchange_updates_block_tailsfails DXIL validation (PHI node entries do not match predecessors!) independently onballot diamondbefore fixingDxilIr::ballotand onreadlane diamondbefore fixingDxilIr::read_lane.cargo test --release -p xcl --lib gpu::recomp::lower_dxil -- --test-threads=4 --nocapture: 19 passed, 0 failed, 0 ignored (17SKIPPEDsubcases: 14no wave64+ 3 intentional#1426f16 refusals).cargo build --release --workspace+cargo test --release --workspace -- --test-threads=4: 1112 passed, 0 failed, 46 ignored across 20 test binaries.SKIPPEDGPU/runtime tests on this adapter (27 lines):no wave64subcases acrossgpu::recomp::lower::tests(4),gpu::recomp::lower_dxil::tests(14), andgpu::recomp::tests(2)#1426refusals (V_MUL_F16,V_PK_MUL_F16,V_CVT_F16_F32) ingpu::recomp::lower_dxil::testsshaders::tests::pso_measurement_compiles_an_exact_synthetic_record: cannot disable the driver cache (Windows Developer Mode is required)heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windowstest_title_draws_with_a_root_signature_under_the_debug_layer,uploads_start_from_each_subresources_state: nod3d12SDKLayers.dll/ D3D12 debug layer)Regression run
scripts/smoke.ps1onorigin/main(3da2abb81606df622610e009f0430de99aa9881c) and on this PR's head commit (3990660af24ecbd02d7ece38ee946a0626dee211):Not tested
XCL_DIRECT_DXIL=1 XCL_PER_LANE=1enabled (the default smoke run above exercises the default HLSL runtime path; split-wave64 per-lane DXIL lowering was verified via DXIL validation and RTX 4060 GPU execution parity tests).--release).AI use
lower_dxil.rsandlanes.rs, implemented the fix, regression tests, and PR description; every line of the diff, test run, and smoke check was verified on local RTX 4060 hardware.