You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MUBUF buffer_store_format_* (including d16 variants) previously ignored the V# resource descriptor's DST_SEL fields (d3[11:0]) in both Direct DXIL (crates/xcl/src/gpu/dxil/lower_mem.rs) and HLSL (crates/xcl/src/gpu/recomp/emit.rs), packing VGPR channels [v0, v1, v2, v3] straight to memory in identity order. Any typed RWBuffer store through a swizzled V# (such as B8G8R8A8_UNORM[6, 5, 4, 7], B8G8R8X8_UNORM[6, 5, 4, 1], A8_UNORM[0, 0, 0, 4], or swapped 2-channel YX01[5, 4, 0, 1]) therefore wrote swapped or zeroed components to memory:
Adds dst_sel_store in crates/xcl/src/gpu/dxil/lower_mem.rs and crates/xcl/src/gpu/recomp/emit.rs to route each memory channel m (0..4, selector 4 + m) from the VGPR component k whose DST_SEL[k] == 4 + m (or 0 when unmapped).
Applies dst_sel_store in BufKind::FormatStore for MUBUF buffer_store_format_* (both 32-bit and d16 forms), while keeping MTBUF tbuffer_store_format_* unswizzled (matching RDNA2 hardware, where tbuffer_store_format_* ignores DST_SEL).
Adds gpu_buffer_store_format_honors_vsharp_dst_sel (testing BGRA8, BGRX8, A8_UNORM, YX01, D16 BGRA8, MTBUF unswizzled control, and BGRA8/A8 round-trip loads on both Direct DXIL and HLSL) and no-GPU codegen/validation test buffer_store_format_emits_dst_sel_store_for_mubuf_only in crates/xcl/src/gpu/dxil/core_tests.rs.
Before fix: gpu_buffer_store_format_honors_vsharp_dst_sel failed on direct-dxil BGRA8 store with [255, 128, 0, 64] instead of [0, 128, 255, 64].
After fix: 6 passed, 0 failed, verifying Direct DXIL and HLSL on GPU across all 6 store cases and BGRA8/A8 round-trips, plus all existing typed-buffer store tests.
Full workspace test suite (cargo test --workspace --no-fail-fast -j 2 -- --test-threads=4 --skip test_title_runs_and_game_folder_is_untouched --skip uma_driver::tests::, RTX 5070 Ti + DXC 1.9): 41 binaries, 2713 passed, 4 failed, 49 ignored, 9 filtered; 27 SKIPPED (22 no wave64, 3 refused #1426, 2 no heap windows). All 4 failures are pre-existing geometry test failures on main (3b6a91ed, tracked in Tests: fix 4 geometry tests broken on main by split-ES safe-barrier and no-store epilogue merges #3411): gpu::dxil::geometry_tests::gpu_geometry_msg_gs_done_records, gpu::dxil::geometry_tests::msg_gs_done_emits_in_dxil, gpu::dxil::lower_geom::tests::gpu_epilogue_filters_oob_triangles_and_no_store_emits, and gpu::dxil::lower_mem::stage_guard_tests::geometry_export_rejected.
Head 6a05c038: gpu_buffer_store_format_honors_vsharp_dst_sel now also skips when the adapter has no wave32 (runner::wave32_supported(), as the neighbouring wave32 tests do). On the CI runner and WARP (4-lane waves) the wave32 kernel was refused at CreateComputePipelineState (E_INVALIDARG) for every single instruction of the test, with or without dst_sel_store. On WARP (XCL_ADAPTER=warp): SKIPPED … no GPU / wave32 / DXC, 1 passed; buffer_store_format_emits_dst_sel_store_for_mubuf_only: 1 passed.
Not tested
Hardware adapters with wave64-only shaders or non-NVIDIA drivers (22 wave64 tests skipped on RTX 5070 Ti).
Full title execution for games other than ea3b5e4d or paths requiring uma_driver::tests:: kernel driver tests.
The GPU part of gpu_buffer_store_format_honors_vsharp_dst_sel on the CI runner and WARP (no wave32 there: it skips).
AI use
Used an AI coding assistant to audit BufKind::FormatStore in lower_mem.rs and emit.rs, reproduce the BGRA8 store mismatch on GPU, implement dst_sel_store and synthetic GPU/codegen tests, and run local verification.
Claude Code (Claude Opus 5.5) added the wave32 skip in head 6a05c038 and the lines about it above.
github-actionsBot
added
area:recompiler
RDNA2 decoder, HLSL/direct-DXIL recompiler, wave64/wave32
area:tests
Unit, integration, e2e tests, or testtitle
gpu:amd
Code is specific to AMD / RDNA / wave64 GPUs (scope tag; see needs:amd-test)
labels
Nov 29, 2026
Review (head 6a05c03, diff read, not a merge-check: the PR description check fails, so not built or run here yet):
The PR's smoke block is on c0e7aa2, not the head 6a05c03, which is why PR description fails. It needs a rerun on the head. The stale run is within the limits (92 % of main's frames, 106 % of its peak commit).
No source is cited for MUBUF format stores applying the inverse of DST_SEL. For swizzles that can't be inverted, the PR picks its own behaviour: a channel selected twice takes the first matching VGPR, and a channel no DST_SEL maps is written as 0. So a title-built V# with a 0/1 select on a data channel now writes zeros where main wrote the data (lower_mem.rs ~1078-1094 / ~1665, emit.rs ~2278). None of these cases is tested. A reference (ISA doc table or a hardware trace) would settle it.
MTBUF load and store now disagree:tbuffer_store ignores DST_SEL while tbuffer_load on main applies it in both backends (lower_mem.rs FormatLoad, emit.rs ~2250/2272). Low impact, but worth a line in the description.
On CI the GPU test skips (no wave32), so CI only checks the HLSL string and that the Direct DXIL output validates.
AI use names Claude Opus 5.5 for the follow-up commit only; the original work is credited to an unnamed "AI coding assistant".
Fine: Direct DXIL and HLSL route channels the same way. The expected values for BGRA8, BGRX8, A8, YX01, D16 BGRA8 and MTBUF check out by hand. D16 values are converted before routing, and fmt_pack drops channels the format lacks and uses each memory channel's width. V#s that XCL builds itself (identity DST_SEL, desc.rs ~701) store as before. This is the store-side counterpart #3419 needs (with #3419 alone, BGRA8 UAV stores swap red and blue).
AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
Test report (not a merge-check: PR description red)
base: b2b1f10
head: 6a05c03
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2904 passed, 0 failed, 51 ignored; SKIPPED: 28 (20 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 no heap windows, 1 cannot disable the driver cache, 3 others; the same set as on main); failing: none
review: not repeated here; my review of this same head is at #3421 (comment), and its findings stand. This run adds what reading couldn't: whether the change merges, builds and passes the whole suite on current main.
performance: no smoke run.
assessment: merges, builds and passes the whole suite on current main; the findings in my review stand
hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5
AI-written and posted by Foniass without a human check of each point.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
area:recompilerRDNA2 decoder, HLSL/direct-DXIL recompiler, wave64/wave32area:testsUnit, integration, e2e tests, or testtitlegpu:amdCode is specific to AMD / RDNA / wave64 GPUs (scope tag; see needs:amd-test)
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is in it
MUBUF
buffer_store_format_*(includingd16variants) previously ignored the V# resource descriptor'sDST_SELfields (d3[11:0]) in both Direct DXIL (crates/xcl/src/gpu/dxil/lower_mem.rs) and HLSL (crates/xcl/src/gpu/recomp/emit.rs), packing VGPR channels[v0, v1, v2, v3]straight to memory in identity order. Any typedRWBufferstore through a swizzled V# (such asB8G8R8A8_UNORM[6, 5, 4, 7],B8G8R8X8_UNORM[6, 5, 4, 1],A8_UNORM[0, 0, 0, 4], or swapped 2-channelYX01[5, 4, 0, 1]) therefore wrote swapped or zeroed components to memory:dst_sel_storeincrates/xcl/src/gpu/dxil/lower_mem.rsandcrates/xcl/src/gpu/recomp/emit.rsto route each memory channelm(0..4, selector4 + m) from the VGPR componentkwhoseDST_SEL[k] == 4 + m(or0when unmapped).dst_sel_storeinBufKind::FormatStorefor MUBUFbuffer_store_format_*(both 32-bit andd16forms), while keeping MTBUFtbuffer_store_format_*unswizzled (matching RDNA2 hardware, wheretbuffer_store_format_*ignoresDST_SEL).gpu_buffer_store_format_honors_vsharp_dst_sel(testing BGRA8, BGRX8, A8_UNORM, YX01, D16 BGRA8, MTBUF unswizzled control, and BGRA8/A8 round-trip loads on both Direct DXIL and HLSL) and no-GPU codegen/validation testbuffer_store_format_emits_dst_sel_store_for_mubuf_onlyincrates/xcl/src/gpu/dxil/core_tests.rs.Tested
cargo test -p xcl --lib -- gpu_buffer_store_format_honors_vsharp_dst_sel buffer_store_format_emits_dst_sel_store_for_mubuf_only gpu_typed_buffer_loads_and_stores gpu_format_stores_atomics_global_lds gpu_buffer_store_two_bit_snorm_rounds_half_away gpu_direct_unaligned_multi_dword_format_store):gpu_buffer_store_format_honors_vsharp_dst_selfailed ondirect-dxil BGRA8 storewith[255, 128, 0, 64]instead of[0, 128, 255, 64].6 passed, 0 failed, verifying Direct DXIL and HLSL on GPU across all 6 store cases and BGRA8/A8 round-trips, plus all existing typed-buffer store tests.cargo test --workspace --no-fail-fast -j 2 -- --test-threads=4 --skip test_title_runs_and_game_folder_is_untouched --skip uma_driver::tests::, RTX 5070 Ti + DXC 1.9):41 binaries, 2713 passed, 4 failed, 49 ignored, 9 filtered; 27 SKIPPED (22 no wave64, 3 refused #1426, 2 no heap windows). All 4 failures are pre-existing geometry test failures onmain(3b6a91ed, tracked in Tests: fix 4 geometry tests broken on main by split-ES safe-barrier and no-store epilogue merges #3411):gpu::dxil::geometry_tests::gpu_geometry_msg_gs_done_records,gpu::dxil::geometry_tests::msg_gs_done_emits_in_dxil,gpu::dxil::lower_geom::tests::gpu_epilogue_filters_oob_triangles_and_no_store_emits, andgpu::dxil::lower_mem::stage_guard_tests::geometry_export_rejected.Regression run
6a05c038:gpu_buffer_store_format_honors_vsharp_dst_selnow also skips when the adapter has no wave32 (runner::wave32_supported(), as the neighbouring wave32 tests do). On the CI runner and WARP (4-lane waves) the wave32 kernel was refused atCreateComputePipelineState(E_INVALIDARG) for every single instruction of the test, with or withoutdst_sel_store. On WARP (XCL_ADAPTER=warp):SKIPPED … no GPU / wave32 / DXC, 1 passed;buffer_store_format_emits_dst_sel_store_for_mubuf_only: 1 passed.Not tested
22wave64 tests skipped on RTX 5070 Ti).ea3b5e4dor paths requiringuma_driver::tests::kernel driver tests.buffer_view/buffer_words_at(handled separately in D3D12.X: encode BGRA8, BGRX8, and A8 typed buffer V# formats and swizzles #3419).gpu_buffer_store_format_honors_vsharp_dst_selon the CI runner and WARP (no wave32 there: it skips).AI use
Used an AI coding assistant to audit
BufKind::FormatStoreinlower_mem.rsandemit.rs, reproduce the BGRA8 store mismatch on GPU, implementdst_sel_storeand synthetic GPU/codegen tests, and run local verification.Claude Code (Claude Opus 5.5) added the wave32 skip in head
6a05c038and the lines about it above.