Recompiler: simplify rotate and FFT swizzles in direct DXIL #2151
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2161"
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?
Imported from ivall/xcl. Originally posted by wasonidas on 2026-11-25T06:34:46Z.
Part of #1269. Direct DXIL now computes the source lanes for rotate and FFT
DS_SWIZZLE_B32with bit operations and lane arithmetic. The emitted shaders are smaller and take less time to translate in the synthetic benchmark.What is in it
lower_mem.rscomputes rotate source lanes and uses bit reversal for FFT. The calculation preserves each wave64 half.core_tests.rschecks emitted DXIL and compares GPU output lane by lane with the CPU oracle.Tested
cargo test --release -p xcl --lib gpu::dxil::swizzle_bench_tmp::swizzle_synthetic_bench -- --nocapture --exact --test-threads=1used four runs and 50 samples per shape per run. Byte size fell 30.22–40.85% and median translation time fell 35.70–42.35% across rotate, FFT and mixed shapes. The bit/quad control emitted the same number of bytes and selects.6ea813a61fand clean head0c7665c4afbuilt withcargo build --release -p xcl.cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapturecounts are passed / failed / ignored / internal skips. Cargo includes internal skips in the passed count.Regression run
main:
PR:
Not tested
AI use
gemini-4-neon, medium) implemented the change and tests, and ran the first validation. T3 Code / OpenAI Codex (gpt-6.2-sol) reviewed the diff, independently ran the paired validation and prepared this draft.Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T06:59:05Z.
Independent Windows x64 + Intel Arc A770 test report on commit
0c7665c4affbdd368436910d8fd6be20ce9ade41.Environment
32.0.101.9175, Tiled Resources Tier 4, Resource Heap Tier 1,DoublePrecisionFloatShaderOps=0)rustc 1.100.0 (0ef1bc386 2026-11-09), DXC1.9.2609.5 (01b62ad47)Command
Executed under serialized Arc A770 GPU mutex (
XCL_ADAPTER=A770) with pre/post-mutex executable SHA-256 verified (2939D617B118A1D897505245A91890F088BFADC390856E611437353D2BDC0ACD):Results
ds_swizzlerotate/FFT tests (including the Arc A770 GPU oracle test) passed withoutSKIPPEDoutput.Not tested
AI use
gemini-4-neon).Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-25T07:06:17Z.
Full-suite run, since this PR has no test report yet. Tested exact head
0c7665c(on its base6ea813a).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::recomp::lower_dxil::tests::mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests: 1144 passed, 0 failed, 44 ignored. SKIPPED (no wave64):a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu,a_per_lane_2d_or_3d_group_runs_on_the_gpu,coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu,cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu,gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware,the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu.ds_swizzle_rotate_and_fft_emit_compact_dxil,gpu_direct_ds_swizzle_rotate_fft_matches_oracle.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1: 1155 passed, 0 failed, 46 ignored. SKIPPED:f16_programs_on_the_gpu(f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))),f32_programs_on_the_gpu(f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))),f32_programs_on_the_gpu(f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).--skipleaves out tests that fail on main568e7dbtoo, not because of this PR. On NVIDIA:heap_window_out_of_memory_falls_back_to_the_switch_form(#1651), the fourgpu::recomp::lower_dxil::tests::*_programs_on_the_gputests,const_and_null_mask_operands_agree_with_hlsl_on_the_gpuandmask_ff0_and_flbit_agree_with_hlsl_on_the_gpu(follow-up on #1651) fail becauserunner::skip_testturns their skips into failures underXCL_REQUIRE_GPU=mesh, andgpu::dxil::fuzz_testsseeds 70, 545, 1019 and 1507 failCreateComputePipelineStatewithE_OUTOFMEMORYon this card (drivers 616.64 and 621.40). On AMD:fuzz_validate_and_gpu_1fails on seed 540 (res[833]0x7 vs CPU 0x6). The AMD run does not setXCL_REQUIRE_GPU.Not tested
AI use
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T07:20:29Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-25T07:40:23Z.
Independent RX 6800M check on exact head
0c7665c4affbdd368436910d8fd6be20ce9ade41(PR base568e7db7729c8fa6c8f0f4b32d798faaf11462bb).Environment: Windows 11 build 26200; Ryzen 9 5980HX; Radeon RX 6800M, driver
30.0.13002.13003; Rust 1.99.0 MSVC; DXC/DXIL 1.9.2609.5. Clean detached worktree.XCL_ADAPTER=6800M,XCL_REQUIRE_GPU=wave64,XCL_DIRECT_DXIL=1, andXCL_DXC_DIRpointed at the matching DXC/DXIL binaries.Command:
cargo test --locked -p xcl --lib -j 2 swizzle_rotate -- --test-threads=1 --show-outputResult: 2 passed, 0 failed, 0 ignored, 0
SKIPPEDlines.ds_swizzle_rotate_and_fft_emit_compact_dxilpassed its emitted-DXIL checks.gpu_direct_ds_swizzle_rotate_fft_matches_oraclepassed GPU-to-CPU lane parity for the listed rotate, FFT, bit-mode, and quad controls. The test code runs wave32, split wave64, and native wave64 on an adapter that exposes both wave widths; all variants completed.Scope: Focused debug-build tests only. I did not run the full workspace suite, paired main tests, a title smoke comparison, or the synthetic translation benchmark on this PR head.
AI use: OpenAI Codex ran the tests, inspected the test branches and clean revision, checked the log, and prepared this report.
Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-28T20:19:02Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T07:30:08Z.
Triage (#1607) – head
0c7665cNo open or merged PR makes the same change; #1739 changes typed-buffer component decoding, not
ds_swizzle_b32. Main still lowers rotate/FFT swizzles inlower_mem.rs:swizzle_lanewith the 32-entry select chain.I checked the new rotate and FFT arithmetic against
recomp::emit::swizzle_lane, including mask 0 and mask 0x1F (shift >= 32 returns the lane unchanged). It matches, andgpu_direct_ds_swizzle_rotate_fft_matches_oraclecompares every lane on the GPU.The branch conflicts with main and needs a rebase.
Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.