Recompiler: preserve upper 16 bits in buffer_load_format_d16_x and _xyz #1198
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!1198
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1198"
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?
@b3IKK on GitHub · 2026-11-24 13:08 UTC · original
b3IKK:recomp/buffer-load-format-d16-preserve-hi→main· +50 −2 · 2 files · 1 commits · openOn RDNA2,
buffer_load_format_d16_xwritesXintoVDST[15:0]and preservesVDST[31:16], andbuffer_load_format_d16_xyzwritesZinto(VDST+1)[15:0]and preserves(VDST+1)[31:16](symmetric tod16_hi_xpreserving[15:0]). The emitter previously zeroed the upper 16 bits both in-bounds and out-of-bounds.This preserves
(v & 0xFFFF0000u)for the trailing odd 16-bit component inBufKind::FormatLoad.What is in it
crates/xcl/src/gpu/recomp/emit.rs: preserve the upper 16 bits of the last destination VGPR for odd-component D16 format loads (buffer_load_format_d16_x,buffer_load_format_d16_xyz, andtbuffer_equivalents).crates/xcl/src/gpu/recomp/tests.rs: add GPU testgpu_buffer_load_format_d16_x_and_xyz_preserve_upper_halfcovering in-bounds and out-of-boundsBUFFER_LOAD_FORMAT_D16_XandBUFFER_LOAD_FORMAT_D16_XYZ(verified failing before the fix).Tested
stable-x86_64-pc-windows-msvc), DXC 1.9.2609.5, debug (scripts/test.ps1) and release (scripts/smoke.ps1).\scripts\test.ps1(cargo build --workspace+cargo test --workspace -- --test-threads=4): 742 passed, 0 failed, 41 ignored (SKIPPED GPU tests: 2no wave64—gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask,gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware)cargo test -p xcl --lib gpu_buffer_load_format_d16_x_and_xyz_preserve_upper_half: 1 passed, 0 failed (failed on the GPU before the fix, zeroing upper 16 bits)Regression run
main:
PR:
Not tested
AI use
emit.rs, wrote the fix and GPU test, ran the test suite andscripts/smoke.ps1regression runs, and drafted this PR description.@DavidM1911 on GitHub · 2026-11-24 13:19 UTC · original
Independent verification on current
main384f7f7(branch already contains it — clean).Machine: Windows 11, Ryzen 9 7900X + RTX 3060 Ti; Rust stable MSVC, debug; DXC 1.8.2502.11.
cargo test -p xcl --lib buffer_load_format: 1 passed, 0 failed —gpu_buffer_load_format_d16_x_and_xyz_preserve_upper_halfon real hardware.AI use: test runs by Devin (Cognition, SWE-2); no code changes.
@bjarngard on GitHub · 2026-11-24 13:23 UTC · original
Test report for head
74276a0(AMD, native wave64)Tested
XCL_ADAPTER=radeon cargo test --workspace --no-fail-fast -- --test-threads=4: 742 passed, 0 failed, 41 ignored, no SKIPPEDXCL_REQUIRE_GPU=wave64:gpu_buffer_load_format_d16_x_and_xyz_preserve_upper_halfpassedNot tested: retail titles, RDNA3/RDNA4.
AI use: the tests were run and this report was written by an AI agent, Claude Code (Claude Opus 5.5), on the hardware above. The numbers are copied from the actual test output.
@JoaoPauluu on GitHub · 2026-11-24 13:57 UTC · original
A run on Linux with vkd3d-proton, where the shaders go through dxil-spirv to Vulkan instead of a Windows driver's DXIL compiler.
Tested
x86_64-pc-windows-gnu.74276a0as it is (based on47efa2e), no uncommitted changes. The lib test binary runs under Wine, one test per process (--exact).gpu::recomp::tests::gpu_buffer_load_format_d16_x_and_xyz_preserve_upper_half: ok, no SKIPPED.Not tested
AI use
@xpatfussy69x on GitHub · 2026-11-25 08:26 UTC · original
Test report for head
74276a0as pushed (not merged onto currentmain) – NVIDIA, wave32.Tested
.\scripts\test.ps1(cargo build --workspace+cargo test --workspace -- --test-threads=4): 742 passed, 0 failed, 41 ignoredgpu_buffer_load_format_d16_x_and_xyz_preserve_upper_halfran and passedXCL_SAMPLE_*data set (game-data tests not run)Not tested
mainAI 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.