Repository navigation
Direct DXIL: translate ds_permute_b32 as the HLSL path does - #2228
NWProgramming00 wants to merge 2 commits into
Conversation
Each active lane sends DATA0 to lane ((ADDR + offset) >> 2) & 31 of its own 32-lane half, in wave64 too; of several senders the highest lane wins, an active lane nobody sends to gets 0, inactive lanes take no part. Each receiver looks at the 32 senders of its half (rla_half_fn, as ds_swizzle), so the split wave64 form needs no exchange. A wave64 VS / PS that may run in 32-lane waves still refuses it: upper_lanes does not model its writes to lanes 32..63. The model was measured on an RDNA2 gfx1036 in native wave64 and wave32 (26 cases: collisions, partial EXEC, high address bits, cross-half addresses), and matches the measurements reported on xcl-dev#925. The emitted code follows xcl-dev#925 by @maximecmb, which was closed unmerged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The direct translator refused ds_permute_b32. It now lowers it as the HLSL path (xcl-dev#2222) and RDNA2 hardware do: each active lane sends DATA0 to lane ((ADDR + offset) >> 2) & 31 of its own 32-lane half; of several senders the highest wins, an active lane nobody sends to gets 0. Each receiver reads the 32 senders of its half in lane order (unrolled) through read_lane_half, so the split form needs no exchange. A wave64 VS / PS that may run in 32-lane waves still refuses it. gpu_ds_permute_b32 runs its cases through the direct translator too (gpu_ds_permute_b32_direct), whatever XCL_DIRECT_DXIL says. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Independent RDNA2 check on exact, clean PR head Environment: Windows 11 build 26200; Ryzen 9 5980HX; Radeon RX 6800M driver I ran
Both runs include AI assistance: OpenAI Codex (GPT-6; exact variant not exposed) ran the commands, checked the logs and head revision, and drafted this report. No game data was used or attached. |
Stacked on #2222. Only commit
03d0ba8belongs to this PR;22133f3is #2222.#2222 translates
ds_permute_b32in the HLSL path. The direct DXIL translator (XCL_DIRECT_DXIL) still refused it. This PR lowers it there the same way, so the two backends agree and match the RDNA2 measurements on #2222:((ADDR + offset) >> 2) & 31of its own 32-lane half, so it never crosses the halves.What is in it
crates/xcl/src/gpu/dxil/lower_mem.rs:ds_permute_b32inLw::ds. Each receiver reads the 32 senders of its half in lane order (the loop is unrolled) throughread_lane_half, asds_swizzle_b32does, so the split form needs no exchange. A wave64 VS / PS that may run in 32-lane waves refuses it, as in the HLSL path.crates/xcl/src/gpu/recomp/tests.rs:gpu_ds_permute_b32and a newgpu_ds_permute_b32_directshare one body. The new test runs the same five cases through the direct translator whateverXCL_DIRECT_DXILsays, in wave32, native wave64 and split wave64.Tested
XCL_ADAPTER=radeon). Rust 1.100 MSVC, release.runner::direct_kernel_full) on each adapter and were compared bit for bit with the gfx1036's own results. They give 26/26 equal on the RTX 5070 Ti and 26/26 equal on the Radeon.ds_permutefilter). With the half bit dropped,gpu_ds_permute_b32_directfails on both adapters. With the offset dropped, it also fails on both.cargo build --release --workspace, thencargo test --release --workspace --no-fail-fast -- --test-threads=4, with and withoutXCL_DIRECT_DXIL=all, against base568e7dbon the same machine:568e7db03d0ba8)XCL_DIRECT_DXIL=allXCL_DIRECT_DXIL=allThe +4 are the four
ds_permutetests (three from #2222, one here). The failing tests are the same on base and PR, and all are tracked: #1905, #2115 / #2170, #2046 and #1674 (listed on #2222).Regression run
The same as on #2222. On this machine the title currently exits at the same point on
mainand on #2222, with fresh data and shader caches and on both adapters, so a smoke pair for this head cannot meet the no-crash rule yet. This PR stays a draft with #2222. I'll add both blocks when the title runs past 60 s here again.Not tested
ds_permute_b32.AI use
🤖 Generated with Claude Code