Repository navigation
dxil: lower 64-bit icmp via 32-bit dwords and guard MIMG heap indices - #1969
Conversation
Hardware test report — commit
|
|
@eizispark Thank you for the comprehensive RX 9070 XT verification (995 passed, |
|
NVIDIA run (32-lane waves only), which this PR lists as not tested; the RX 9070 XT side is covered above. Tested: pass, head
Not tested: AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report. |
) Brings main to full parity with upstream/main (de36462): - xcl-dev#1969: official upstream merge of 64-bit icmp 32-bit lowering and MIMG heap guards - xcl-dev#1774: size-based commit headroom admission for big driver compiles and XCL_PIPELINE_MAX_KB cap for offline --pipelines precompile Conflicts resolved by keeping HEAD's already-merged xcl-dev#1969 emit.rs (with heap_index), combining xcl-dev#1996 + xcl-dev#1774 comments in real.rs, and combining xcl-dev#1871 + xcl-dev#1774 in shaders.rs. Assisted-by: Antigravity (Gemini 4)
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
Fixes two RDNA4 / Tier-3 D3D12 shader correctness and stability issues across both Direct DXIL and HLSL backends: (1) lowers all 64-bit integer comparisons (
v_cmp_*_{i64,u64},v_cmpx_*_{i64,u64}, andv_mad_{u64_u32,i64_i32}) as exact 32-bit high/low dword comparisons instead ofpack64 + icmp i64, avoiding driver miscompilation on shared-dword pairs; (2) clampsResourceDescriptorHeapandSamplerDescriptorHeapindices and guards non-derivative MIMG descriptor-heap ops against invalid/out-of-bounds T# views and inactive lanes.Part of #1269 and #1833.
What is in it
crates/xcl/src/gpu/dxil/lower_wide.rs,lower.rs, &crates/xcl/src/gpu/recomp/emit.rs: replacepack64 + icmp i64across 64-bitv_cmp_*/v_cmpx_*(Lw::cmp64in Direct DXIL and 32-bit dword comparisons in HLSL) andv_mad_{u64_u32,i64_i32}with 32-bit high/low dword comparisons (hi_cmp || (hi == hi && lo_cmp)) plus 32-bit carry/borrow arithmetic fors_addc_u32/s_subb_u32/s_lshl{1..4}_add_u32, eliminatingFeature::Int64Opsandicmp i64on 64-bit comparisons.crates/xcl/src/gpu/dxil/lower_image.rs&crates/xcl/src/gpu/recomp/emit.rs: validate T# descriptors (valid_tsharpcheckingtw3[31:28] >= 8,tw1[7:0] == 0, andtw0 < VIEW_HEAP_MAX_SRV(2_097_151) to block null/unpatched/OOB T# indices andtw0 + 1wraparound) and clamp dynamicSamplerDescriptorHeapindices withSAMPLER_HEAP_MASK(0x7FF); guard non-derivative MIMG ops (sample/gatherexplicit-LOD,get_resinfo,load/load_mip,mimg_msaa,store,atomic_*including moving HLSL atomic UAV handle inside the guard) onact && valid, while keeping PS implicit-LODsample/get_lodquad-convergent viaselect(valid, tw0, 0).dxil.dll 1.8validated):gpu::dxil::lower_wide::cmp64_tests(cmp64_uses_32bit_dwords_no_i64_icmp,carry_ops_avoid_i64_icmp) andgpu::dxil::lower_image::heap_bounds_tests(mimg_view_and_sampler_heap_indices_are_guarded,ps_implicit_lod_sample_and_get_lod_validate).Tested
10.0.22631.0),rustc 1.99.1 (58cf8f9c3 2026-10-13), DXC1.8.2502.11, rebased onto80f4819(5195e27).cargo check --workspace --tests,cargo test -p xcl --lib cmp64_tests(2 passed, 0 failed), andcargo test -p xcl --lib heap_bounds_tests(2 passed, 0 failed;dxil.dll 1.8validated).5195e27(@eizispark, driver32.0.32015.16001,rustc 1.100.0): unfilteredcargo test --workspace --no-fail-fast -- --test-threads=4passed995(2pre-existing#1679fuzz failures,0new failures,45ignored,8skipped);XCL_DIRECT_DXIL=1 cargo test -p xcl --lib gpu::recomp -- --test-threads=4passed265/0/18;cmp64_tests,heap_bounds_tests,msaa_tests(5/5),ops_tests,graphics::tests, and native wave64 GPU tests all passed, plus a clean 60 sscripts/smoke.ps1pair (1675/1675frames,0device removals/crashes).Regression run
60 s
scripts/smoke.ps1pair on AMD Radeon RX 9070 XT (Windows 11 x64, driver32.0.32015.16001, release), contributed by @eizispark:main:
PR:
Not tested
XCL_DIRECT_DXIL=1/XCL_SHADER_BACKEND=dxil, and Linux/Wine/vkd3d-proton.AI use