Recompiler: sign-extend D16 IMAGE_STORE lanes for SINT textures #1194
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!1194
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1194"
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:04 UTC · original
b3IKK:recomp/image-store-d16-sint→main· +37 −1 · 2 files · 1 commits · openIMAGE_STOREwithD16 = 1passed zero-extended 16-bit halves for bothUINT(t_cls == 1) andSINT(t_cls == 2) UAVs, turning negativei16values such as-1(0xFFFF) into+65535and clamping them to+32767when written toRWTexture<int4>.This sign-extends each 16-bit half when
t_cls == 2u, keepingf16tof32for float formats and zero-extension forUINTformats.What is in it
crates/xcl/src/gpu/recomp/emit.rs: sign-extend 16-bit halves inD16IMAGE_STOREwhent_cls == 2u(SINT).crates/xcl/src/gpu/recomp/tests.rs: add GPU testgpu_image_store_d16_sign_extends_sinttestingD16IMAGE_STOREtoR16G16B16A16_SINT([-1, -1234, 42, i16::MIN]) andR16G16B16A16_UINTcontrol (verified failing on the GPU before the fix with[32767, 32767, 42, 32767]).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_image_store_d16_sign_extends_sint: 1 passed, 0 failed (failed on the GPU before the fix, clamping negative values to32767)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:21 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 image_store: 1 passed, 0 failed —gpu_image_store_d16_sign_extends_sinton 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
6aa7f05(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_image_store_d16_sign_extends_sintpassedNot 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.
@0xTehuti on GitHub · 2026-11-24 13:30 UTC · original
Test report on NVIDIA GeForce RTX 2070 SUPER (Turing, wave32)
Commit tested
6aa7f058d96adb76a5985646703efff61a01bf5d(PR #1194 head)Tested
cargo test -p xcl --lib gpu_image_store_d16_sign_extends_sint:1 passed; 0 failed; 0 ignored; finished in 0.31sIMAGE_STOREwithD16 = 1fort_cls == 2(SINT) sign-extends 16-bit negative values ([-1, -1234, 42, i16::MIN]) correctly on Turing architecture.32767inRWTexture<int4>.Not tested
AI use
@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.6aa7f05as it is (based on47efa2e), no uncommitted changes. The lib test binary runs under Wine, one test per process (--exact).gpu::recomp::tests::gpu_image_store_d16_sign_extends_sint: ok, no SKIPPED.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.