Repository navigation
Direct DXIL: translate ds_permute_b32 as the HLSL path does - #2228
NWProgramming00 wants to merge 1 commit into
Conversation
|
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. |
|
Independent AMD RDNA4 (native wave64) test report on exact head Tested
Regression run (60 s retail-title smoke, (Matched Not tested
AI use
|
|
Found by reading the code at Thanks for the direct-path lowering. The permute itself matches the HLSL lowering in #2222 as far as I can trace it: same sender set, highest sender wins, 0 for an active lane nobody sends to, inactive receivers keep their old value. One question about the refusal:
if self.wave64 && self.split && self.gfx.as_ref().is_some_and(|g| g.vs.is_some() || g.ps.is_some()) {I don't see any path where this condition can be true:
So with By reading only, I can't say whether the direct output is actually wrong there. Its lanes are the real host lanes 0..31, and the direct translator has no |
03d0ba8 to
1aa9794
Compare
|
@upipibi you are right, thanks. The check could not fire: Fixed in
I rebased the stack onto AI use: Claude Code (Claude Opus 5.5) checked the trace, wrote the fix and the test, ran the suite and the smoke pair, and wrote this. |
|
@NWProgramming00 thanks, 1aa9794 looks right to me by reading. Tested head Debug profile (not release), no game files. 1. The five ds_permute tests on head,
2. Negative control. Parent 3.
Skips (25
Not tested: retail title; AMD wave64 hardware. AI-assisted (Claude Code, Claude Sonnet 5.5 ran the tests; Claude Opus 5.5 checked and posted). |
|
Tested: Clean Not tested: Retail smoke, full workspace suite, and native wave64 hardware. AI use: T3 Code / Codex ( |
|
Independent desktop NVIDIA (Wave32-only Ada) verification of PR #2228 at head Environment
Targeted release tests & build (
|
| Command | Result |
|---|---|
cargo test --release -p xcl --lib ds_permute_reference_matches_rdna2_values -- --nocapture (3 consecutive runs) |
1 passed; 0 failed; 0 ignored; 1346 filtered out × 3 (0.00s × 3) |
cargo test --release -p xcl --lib gpu_ds_permute_b32 -- --nocapture (3 consecutive runs; executes both gpu_ds_permute_b32 and gpu_ds_permute_b32_direct) |
2 passed; 0 failed; 0 ignored; 1345 filtered out × 3 (0.31s, 0.24s, 0.23s, 0 skipped; live on RTX 4060 + DXC 1.9.2609.5) |
cargo test --release -p xcl --lib gpu_ds_permute_b32_direct -- --nocapture (3 consecutive runs) |
1 passed; 0 failed; 0 ignored; 1346 filtered out × 3 (0.19s, 0.19s, 0.21s, 0 skipped) |
cargo test --release -p xcl --lib ds_permute_b32_refused_where_upper_lanes_do_not_exist -- --nocapture (3 consecutive runs) |
1 passed; 0 failed; 0 ignored; 1346 filtered out × 3 (0.00s × 3) |
cargo test --release -p xcl --lib ds_permute_b32_direct_refused_where_upper_lanes_do_not_exist -- --nocapture (3 consecutive runs) |
1 passed; 0 failed; 0 ignored; 1346 filtered out × 3 (0.01s × 3) |
cargo test --release -p xcl --lib gpu::dxil:: -- --test-threads=4 (3 consecutive runs) |
184 passed; 0 failed; 3 ignored; 1160 filtered out × 3 (4.03s, 4.39s, 4.15s; 183 executed + 1 expected Wave32-only skip dispatch_chain_native_wave64_builds_whole: no wave64) |
cargo test --release -p xcl --lib gpu::recomp::pso:: (3 consecutive runs) |
27 passed; 0 failed; 1 ignored; 1319 filtered out × 3 (0.08s × 3, 0 skipped) |
cargo build --release -p xcl |
Clean build (1m 14s, exit 0, 0 new warnings) |
Paired quiet 60 s retail smoke (title: 29640639)
Exact merge-base (e120925e3abc9956a8b9bae631969d32e8ccd43c, cached baseline on the same machine):
xcl-smoke v1
commit: e120925e3abc9956a8b9bae631969d32e8ccd43c
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1602 (PresentX 1602)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13979 MB
PR #2228 (1aa97946e97e71e5baca0a62d088e552d0214ad5):
xcl-smoke v1
commit: 1aa97946e97e71e5baca0a62d088e552d0214ad5
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1606 (PresentX 1606)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13975 MB
Runtime log observations (xcl.log)
9221log lines,0[ERROR]/ device-removal / panic lines.- Final draw/memory telemetry in log:
19585 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped); last memory sample13975 MB committed by the process; video memory 6115 MB local, 4651 MB non-local.
Limits of coverage
- Both HLSL (
gpu_ds_permute_b32) and direct DXIL (gpu_ds_permute_b32_direct)ds_permute_b32lowering matched the RDNA2 reference live on desktop Wave32-only RTX 4060 (3/3,0skipped), alongside both VS/PS upper-lane refusal tests (3/3),gpu::dxil::(183executed +1expectedno wave64skip × 3), andgpu::recomp::pso::(27/0/1× 3). - Native Wave64 GPU execution is not available on this Wave32-only NVIDIA RTX 4060 (
dispatch_chain_native_wave64_builds_wholeskipped as expected), and the warm-cache 60 s retail smoke ontitle: 29640639confirms zero runtime regression rather than exercising a retail shader usingds_permute_b32.
AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).
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 is refused before this, by the upper-lane read check (upper_lanes classes DS_PERMUTE_B32 as an Unknown read), so the lowering needs no refusal of its own. gpu_ds_permute_b32 runs its cases through the direct translator too (gpu_ds_permute_b32_direct), whatever XCL_DIRECT_DXIL says. ds_permute_b32_direct_refused_where_upper_lanes_do_not_exist checks that a wave64 VS / PS asked to split is refused and translated otherwise. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1aa9794 to
f3f2922
Compare
|
No open or merged PR adds AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human. |
|
merge-check claim |
|
merge-check |
#2222 (merged) 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.Rebased onto
main0fe06ebafter #2222 merged: now one commit,f3f2922.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.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.ds_permute_b32_direct_refused_where_upper_lanes_do_not_existrunstranslate_pixelandtranslate_vertexon a wave64 program with and without split. With split it must be refused; without split it must translate.Change since the review
@upipibi found that this PR's own refusal of a wave64 VS / PS that may run in 32-lane waves could never fire (it tested
split, whichLw::newclears for a VS / PS). The earlier head fixed that with agfx_splitfield (1aa9794).Since then
maingot50e85c5(#2252 adapted). It passes the requested split todirect_graphics, andtranslate_on_this_threadrefuses a wave64 VS / PS asked to split whenupper_lanes::analyzefinds a read that is not native.upper_lanesclasses everyDS_PERMUTE_B32as anUnknownread, somainalready refuses these programs beforeLw::new. So I dropped1aa9794and the dead refusal in the lowering. The refusal test now checksmain's message (wave64 VS / PS in 32-lane waves: a read of lanes 32–63).Tested
XCL_ADAPTER=radeon). Rust 1.100 MSVC, release.f3f2922,ds_permutefilter): 5 passed, 0 failed on each adapter, with and withoutXCL_DIRECT_DXIL=all.03d0ba8and1aa9794; the lowering has not changed since):runner::direct_kernel_full). Bit for bit against the gfx1036's own results they gave 26/26 equal on the RTX 5070 Ti and 26/26 equal on the Radeon.gpu_ds_permute_b32_directfails on both adapters. With the offset dropped it fails too.f3f2922):cargo build --release --workspace, thencargo test --release --workspace --no-fail-fast -- --test-threads=4, with and withoutXCL_DIRECT_DXIL=all, against basemain0fe06ebon the same machine:0fe06ebf3f2922)XCL_DIRECT_DXIL=allXCL_DIRECT_DXIL=alltwo_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs(gpu_two_pass_cache_e2e). It is not stable on this machine: it passed in the first base run, then failed in 3 of 3 reruns of that test alone on base.xcllib test process exits with0x80004005afterhle::d3d12x::bindtests. That is why only 138 tests are counted there, and why theds_permutetests were run alone there (above).Regression run
Both runs with
XCL_PREPARE=0: it skips the startup shader preparation that #2555 added (about 5 hours from an empty cache here), so the title starts as it did before #2555. The two runs differ only in the commit.Base (
main0fe06eb), NVIDIA GeForce RTX 5070 Ti:This PR (
f3f2922), same card, run right after:Not tested
ds_permute_b32.AI use
🤖 Generated with Claude Code