Direct DXIL: sign-extend D16 image_store halves for SINT textures #1920
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!1920
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1920"
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?
@emirduran707 on GitHub · 2026-11-24 23:10 UTC · original
emirduran707:dxil-image-store-d16-sint→main· +38 −1 · 2 files · 1 commits · openIn the Direct DXIL translator,
image_storewithD16=1unpacked each 16-bit half with& 0xFFFFand passed it unchanged to theRWTexture<int4>store for SINT formats. A negative half such as -1 (0xFFFF) became 65535, and the R16 SINT store clamped it to 32767. The D16buffer_store_format_*path inlower_mem.rsalready sign-extends SINT halves withsx16;image_storenow does the same when the T# format class is SINT. (#1194 makes the same change in the HLSL recompiler,recomp/emit.rs; this is the Direct DXIL path.)What is in it
crates/xcl/src/gpu/dxil/lower_image.rs: in the D16storearm, selectsx16(half)when the format class is SINT (2).crates/xcl/src/gpu/dxil/core_tests.rs: GPU testgpu_direct_image_store_d16_sint_sign_extends: lane 0 stores the halves (-1, -100, 42, -32768) to a 16_16_16_16_SINT texture with D16 and the test checks the texture contents.Tested
cargo build --workspace, thencargo test --workspace --no-fail-fast -- --test-threads=4ona1e0ee8(rebased ontomain2aa2d1a): 1136 passed, 2 failed, 46 ignored; 8 SKIPPED (6 inlower_dxil::tests::{f16,f32}_programs_on_the_gpu;heap_window_out_of_memory_falls_back_to_the_switch_form;pso_measurement_compiles_an_exact_synthetic_record)gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1,gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_3) fail identically on unmodifiedmain2aa2d1aon this GPU (seeds 722 and 1599).gpu_direct_image_store_d16_sint_sign_extendsbefore the change failed (left: [32767, 32767, 42, 32767],right: [-1, -100, 42, -32768]); passes afterRegression run
main:
this PR:
Not tested
AI use
main2aa2d1a(a conflict incrates/xcl/src/gpu/dxil/core_tests.rs; both tests kept, this PR's now besideps_get_lod_with_a_static_sampler) and reran the suite and smoke runs above.@upipibi on GitHub · 2026-11-24 23:15 UTC · original
NVIDIA counterpart to the Radeon run: RTX 3070 8 GB, driver 616.56, Windows 11, debug,
c56f06donmain689f2db.gpu_direct_image_store_d16_sint_sign_extendsand the other tests matchingd16: 4 passed, 0 failed, with and withoutXCL_DIRECT_DXIL=1.AI-assisted (Claude Code). Synthetic tests only.
@raylitebull on GitHub · 2026-11-25 01:08 UTC · original
Both AMD and NVIDIA verification look good on
c56f06d. This is currentlyDIRTYwith merge conflicts againstmain— please rebase ontomainand letBuild and test (Windows, no GPU)run cleanly so we can merge.@raylitebull on GitHub · 2026-11-25 01:36 UTC · original
Build and test (Windows, no GPU)andPR descriptionboth passed on5f0e965, and#1922just landed onmaintouching the same spot at the end ofcrates/xcl/src/gpu/dxil/core_tests.rs. Please rebase ontomainto clear theDIRTYconflict so we can merge.@DavidM1911 on GitHub · 2026-11-25 02:26 UTC · original
Verification on RTX 3060 Ti (Windows 11): merge conflict with current
main(crates/xcl/src/gpu/dxil/core_tests.rs) — needs a rebase before it can be tested.@JJAutoCompare on GitHub · 2026-11-25 03:11 UTC · original
Tested
I ran
gpu_direct_image_store_d16_sint_sign_extendson Intel Arc A770 at clean PR heada1e0ee891c99b353c1d9ffabcdc8d6fa196e711f. The test builds the kernel withdirect_kernel_full, validates its DXIL, dispatches that same DXIL on D3D12, and reads the signed texture back. The GPU readback assertion matched all four channels of texel (0, 0), RGBA[-1, -100, 42, -32768]inR16G16B16A16_SINT. The other 15 texels read back as zero. This exercises ordinary signed D16 store conversion on the direct DXIL backend. PR #1920Intel Arc A770 driver
32.0.101.9175, AMD Ryzen 7 3800X, Windows 11 Enterprise Evaluation 25H2 build26200.9974, Rust1.100.0(x86_64-pc-windows-msvc), DXC and DXIL1.9.2609.5. Cargo test profile with debug info and incremental compilation disabled.The prebuild exited 0 outside the Arc lock. The GPU invocation acquired and released the lock and exited 0 in 1.88 s of test execution with 1 passed, 0 failed, 0 ignored, 0 skipped and 1,114 filtered out. The exact shader backend and values are verified by the fixture and its passing readback assertions. The PR was still open at the same head after the run. Seven visible comment blocks contained no comparable Arc A770 result.
Not tested
HLSL #1194, normalized texture loads, other signed formats and masks, a pre-fix baseline, the workspace suite, retail smoke, and other GPU vendors.
AI use
T3 Code / Codex (
gpt-6.2-sol) ran the test and wrote this report.@DavidM1911 on GitHub · 2026-11-26 00:42 UTC · original
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.Thanks!
— Devin
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.