Recompiler: an empty DXC blob reads as no bytes (#2413) #2441
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!2441
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2441"
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?
@crastinator on GitHub · 2026-11-25 19:03 UTC · original
crastinator:dxc-empty-blob-2413→main· +24 −3 · 1 files · 1 commits · openDXC can return an empty blob with a null buffer pointer: an empty error buffer when a compile fails, or an empty result.
compile_herepassed that pointer straight toslice::from_raw_parts, which needs a non-null pointer even for length 0. That is undefined behaviour, and a debug build aborts on the precondition check. Both places now read the blob throughblob_bytes, which returns an empty slice for a null pointer or a zero size.Part of #2413. The
dxil.dllhandle left loaded after a failed candidate folder (the second half of the issue) is a separate change.What is in it
crates/xcl/src/gpu/recomp/dxc.rs:blob_bytes/bytes_at, used for the error buffer and the result incompile_here; a unit test for the null and zero-size cases.Tested
53aac418); cross-built forx86_64-pc-windows-msvc, Rust stable, DXC 1.9.2609.5.cargo test -p xcl --lib -- recomp::dxc: 17 passed, 0 failed, 0 ignored.cargo test -p xcl --lib -- --test-threads=1and every integration test), merged ontomain2898511and compared per test with the same run of thatmain: 1350 passed, 14 failed, 46 ignored (main: 1346 / 17 / 46). The 14 failures all fail onmaintoo (Wine lane: e2e,pls_quota,predication_e2e, #1651's heap-window test, fma/f32/f64 recompiler GPU tests, Opus/XMA2 voices and others). The three that pass here and failed onmainare the #718 flake family, not fixes.uploads_start_from_each_subresources_state(no D3D12 debug layer under Wine).Regression run
The blocks come from #257's
scripts/linux/smoke.sh(thesmoke.ps1block under Wine; itstitle:line hashed assmoke.ps1does),XCL_COHERENT_MB=512for both.main:
this PR:
Not tested
from_raw_parts(GetBufferPointer…)calls on DXC blobs (gpu/recomp/dxil/assemble.rslines 21 and 53) are left as they are; root signature blobs elsewhere are never empty.AI use
@SlopTart on GitHub · 2026-11-25 19:18 UTC · original
Tested: current PR head merged onto current
origin/main(clean), Linux (Arch, kernel 7.2.15), Mesa 26.2.5 RADV, Radeon RX 7900 XT (NAVI31), cargo targetx86_64-pc-windows-gnurun under wine-11.0 (Proton), rustc 1.94.0, vkd3d-proton 3.1 with the XCL patch, official MS DXC (binaries 2026-09-29).gpu_suite, cold cache: 160 passed / 4 failed. Three are the known baseline trio on this lane; the fourth is the newgpu_promoted_uav_clear_values_pass_create_committed_resourcefailure that current main carries (reported here), not caused by this PR. Everything else is green.Targeted run of the new
an_empty_blob_with_a_null_pointer_reads_as_no_bytes(not caught by thegpu_sweep): passed.Not tested: retail titles (no title data on this lane, counts only).
AI use: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting.
@frenziedcoder on GitHub · 2026-11-25 19:28 UTC · original
NVIDIA test report for
d723284: no new test failures (the 5 that fail also fail on3ceb550), its own testan_empty_blob_with_a_null_pointer_reads_as_no_bytespasses, and a clean smoke pair on the retail title (1619 vs 1671 frames). Native Windows, MSVC build, for a second platform next to the Wine run above.Tested
stable-x86_64-pc-windows-msvc, DXC 1.8.2502.11 (SDK 10.0.26100.0). Exact headd723284fd75157b062296e53ac10bacd0b7b7601, no local changes.cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4(debug): 1343 passed, 5 failed, 46 ignored; the PR's own testan_empty_blob_with_a_null_pointer_reads_as_no_bytespasses. SKIPPED:gpu::dxil::kernel::dispatch_chain_native_wave64_builds_whole(no wave64),gpu::recomp::lower::tests::a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu(no wave64),gpu::recomp::lower::tests::coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu(no wave64),gpu::recomp::lower::tests::cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu(no wave64),gpu::recomp::lower::tests::the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu(no wave64),gpu::recomp::lower_dxil::tests::a_per_lane_2d_or_3d_group_runs_on_the_gpu(no wave64),gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu(const_mask, wave64: no wave64),gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu(f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))),gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu(f16 arithmetic, wave64: no wave64),gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu(f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))),gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu(f16 packed, wave64: no wave64),gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu(f32 arithmetic, wave64: no wave64),gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu(f32 compares, wave64: no wave64),gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu(f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))),gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu(f32 conversions, wave64: no wave64),gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu(f32 rounding, wave64: no wave64),gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu(f32 three-source, wave64: no wave64),gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu(f32 transcendentals, wave64: no wave64),gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu(f64, wave64: no wave64),gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu(integer arithmetic, wave64: no wave64),gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu(integer carries, wave64: no wave64),gpu::recomp::lower_dxil::tests::mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu(mask_ff0_flbit, wave64: no wave64),gpu_geometry_wave32_prefix_count_over_a_mask(no wave64),gpu_wave32_program_in_wave64_hardware(no wave64),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows),uploads_start_from_each_subresources_state(no D3D12 debug layer (The application requested an operation that depends on an SDK component that is missing or mismatched. (0x887A002D))).3ceb550here (rerun of just those tests):fuzz_validate_and_gpu_0–_3ingpu::dxil::fuzz_tests(0x8007000EfromCreateComputePipelineStateon seeds 70, 545, 1019 and 1507, the NVIDIA refusal @PHeitor1 reported on #1679), anda_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier, which #2420 fixed onmainafter this branch's base. So this PR adds no failure.Regression run (
scripts/smoke.ps1 -Seconds 60, release, the retail title of #505 at its start screen;XCL_PSO_PRELOAD=0for both builds, because this machine's preload list holds the program of #1307)base (
3ceb550, this PR's merge base withmain):this PR:
Not tested: the world load (the smoke runs stop at the start screen, so code that only runs later is not exercised there); AMD (the description and @SlopTart's run cover it).
AI use: Claude Code (Claude Opus 5.5) built and ran the tests and smoke runs on my machine and wrote this report.
@ahmetbagci8 on GitHub · 2026-11-25 19:40 UTC · original
Tested
d723284fd75157b062296e53ac10bacd0b7b760132.0.16.1714), Windows 11 Pro (Build 26300), DXCv1.9.2609cargo test -j 2 -p xcl --lib dxc -- --test-threads=4:41 passed; 0 failed; 3 ignored (0.46s)Not tested
scripts/smoke.ps1(no unpacked title locally).AI use
@DavidM1911 on GitHub · 2026-11-25 20:15 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: 1 real failure, deterministic (also fails--test-threads=1, 1219/1):The lowered program is missing an expected group barrier (or emits one where none is expected). Needs a fix before merge.
— Devin
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.