Direct DXIL: translate ds_permute_b32 as the HLSL path does #2228
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!2228
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2228"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@NWProgramming00 on GitHub · 2026-11-25 10:44 UTC · original
NWProgramming00:dxil/ds-permute→main· +179 −0 · 3 files · 2 commits · openStacked 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
Base (
main06c9f55), NVIDIA GeForce RTX 5070 Ti:This PR (
03d0ba8), same card:Earlier runs here ended at about 44 s on
mainand on this PR alike. The cause was #695: this PC had no active playback device. With one active, both runs reach their end.Not tested
ds_permute_b32.AI use
🤖 Generated with Claude Code
@luckyteagirl on GitHub · 2026-11-25 10:47 UTC · original
Independent RDNA2 check on exact, clean PR head
03d0ba8bd7e7d3079a227565bce8b07b2f5051c7.Environment: Windows 11 build 26200; Ryzen 9 5980HX; Radeon RX 6800M driver
30.0.13002.13003; Rust 1.99.0 MSVC, debug; DXC/DXIL 1.9.2609.5.XCL_ADAPTER=6800M,XCL_REQUIRE_GPU=wave64.I ran
cargo test --locked -p xcl --lib -j 2 ds_permute -- --test-threads=1 --show-outputtwice with separate environment settings:XCL_DIRECT_DXIL10Both runs include
gpu_ds_permute_b32and the newgpu_ds_permute_b32_direct; the latter explicitly takes the direct translator regardless of the environment setting. The reference-model and graphics-refusal tests passed too. This extends the reported RDNA2 test coverage from the author's gfx1036 iGPU to a discrete RX 6800M on an older driver. It is focused test evidence only: I did not repeat the full workspace suite, a hardware ISA measurement, or a retail smoke comparison for this head.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.
@emirduran707 on GitHub · 2026-11-25 20:09 UTC · original
Independent AMD RDNA4 (native wave64) test report on exact head
03d0ba8bd7e7d3079a227565bce8b07b2f5051c7(clean detached checkout, no local changes).Tested
stable-x86_64-pc-windows-msvc), DXC 1.9.2602.17; tests debug, smoke release.cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4: 1156 passed, 2 failed, 46 ignored; 8 SKIPPED (6 inlower_dxil::tests::{f16,f32}_programs_on_the_gpurefused by per-lane form;heap_window_out_of_memory_falls_back_to_the_switch_form;pso_measurement_compiles_an_exact_synthetic_record). All native wave64 GPU tests ran and passed.gpu::recomp::tests::ds_permute_reference_matches_rdna2_values,ds_permute_b32_refused_where_upper_lanes_do_not_exist,gpu_ds_permute_b32, andgpu_ds_permute_b32_direct.gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1seed 722 andfuzz_validate_and_gpu_3seed 1599) are pre-existing on unmodifiedmainon this GPU.Regression run (60 s retail-title smoke,
XCL_NETWORK=0, release)(Matched
main68a284abaseline on the same machine today: 1573 frames, 14420 MB peak, 0 device removals, 0 crashes.)Not tested
AI use
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.