Recompiler: a DXC folder that fails to load leaves its dxil.dll unloaded (#2413) #2457
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2467"
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?
Imported from ivall/xcl. Originally posted by crastinator on 2026-11-25T19:34:12Z.
load()loads a candidate folder'sdxil.dllbefore itsdxcompiler.dll. Whendxcompiler.dlldid not load, or had noDxcCreateInstance, the loop went on to the next folder and left both libraries loaded. Adxil.dllkept from a failed folder is then the one the next folder'sdxcompiler.dllgets when it loadsdxil.dllby name, so the validator could come from the wrong DXC.Part of #2413 (the empty-blob half is #2441; the two touch different functions of
dxc.rs).What is in it
crates/xcl/src/gpu/recomp/dxc.rs: the per-folder attempt moves intoload_candidate, which freesdxcompiler.dllanddxil.dllwhen the folder gives noDxcCreateInstance. The success path is unchanged. A unit test gives it a folder with a copy of a realdxil.dlland adxcompiler.dllthat is not a library, and checks that the copy is no longer loaded afterwards. It fails without theFreeLibrarycalls ("the failed folder's dxil.dll is still loaded"), and skips withno DXCwhen there is no DXC to copy from.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; with the twoFreeLibrarycalls removed, the new test fails (16 passed, 1 failed).cargo test -p xcl --lib -- --test-threads=1and every integration test), merged ontomain06055a7and compared per test with the same run of thatmain: 1394 passed, 17 failed, 46 ignored (main: 1393 / 17 / 46; the extra pass is the new test). The 17 failures all fail onmaintoo.tests/d3d12_create_placed_resource.rsstops without a result line on bothmainand this PR under Wine.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
dxcompiler.dllloads but has noDxcCreateInstance(the second failure branch): it frees the same two handles, but the test only covers adxcompiler.dllthat does not load.LoadLibraryWof a seconddxil.dllwhile one is already loaded may behave differently from Wine; the test's check holds either way.AI use
Imported from ivall/xcl. Originally posted by frenziedcoder on 2026-11-25T19:40:53Z.
NVIDIA test report for
eaecb86: no new test failures (the 4 that fail also fail on2898511), its own testa_folder_whose_dxcompiler_does_not_load_leaves_its_dxil_unloadedpasses, and a clean smoke pair on the retail title (1650 vs 1671 frames). Native Windows, so the test's check thatFreeLibraryreally unloads the failed folder'sdxil.dllholds outside Wine too (it ran here, nono DXCskip; it copies the Windows SDK'sdxil.dll).Tested
stable-x86_64-pc-windows-msvc, DXC 1.8.2502.11 (SDK 10.0.26100.0). Exact headeaecb86dc7315fb52c11cffaaf8c2ec13dca129c, no local changes.cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4(debug): 1360 passed, 4 failed, 46 ignored; the PR's own testa_folder_whose_dxcompiler_does_not_load_leaves_its_dxil_unloadedpasses. 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))).fuzz_validate_and_gpu_0,fuzz_validate_and_gpu_1,fuzz_validate_and_gpu_2,fuzz_validate_and_gpu_3ingpu::dxil::fuzz_tests. They fail the same way on the base2898511here (0x8007000EfromCreateComputePipelineStateon seeds 70, 545, 1019 and 1507, the NVIDIA refusal @PHeitor1 reported on #1679), 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 (
2898511, 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 covers it).
AI use: Claude Code (Claude Opus 5.5) built and ran the tests and smoke runs on my machine and wrote this report.
Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-25T20:02:48Z.
gpu_suite (cold cache): 160 passed / 4 failed, no crashes. The four are the known baseline on this lane (seed-1003 fuzz, mad/mac contraction, depth-buffer state refusal, andgpu_promoted_uav_clear_values_pass_create_committed_resource(report); none caused by this PR.Targeted run of the new
a_folder_whose_dxcompiler_does_not_load_leaves_its_dxil_unloaded: passed.Imported from ivall/xcl. Originally posted by bmjask on 2026-11-25T20:37:58Z.
Review: COMMENTED
No confirmed code defect found: failure cleanup releases dxcompiler before the explicit dxil handle, and success behavior is unchanged. Merge evidence is insufficient: current head has no Windows Build/test, and Linux/Wine is unsupported here. Please provide a Windows run/current CI and add coverage for missing DxcCreateInstance or a later candidate that successfully loads with its own dxil.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T20:21:58Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
Imported from ivall/xcl. Originally posted by ahmetbagci8 on 2026-11-25T20:47:54Z.
Tested
eaecb86dc7315fb52c11cffaaf8c2ec13dca129c32.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.57s)Not tested
scripts/smoke.ps1(no unpacked title locally).AI use
Imported from ivall/xcl. Originally posted by throny on 2026-11-26T16:18:32Z.
Two contributors checked independently and found that this PR makes the same change as #2643 (for #2413): #1607, group D125. They suggest keeping #2643. If you agree, closing this PR or joining the other one would save the maintainers a review. If the two differ in a way the checks missed, a note in #1607 helps.
This is a hint from the community triage in #1607, not a maintainer decision.
AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.
Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-28T21:13:22Z.
Closing as a duplicate of #2643 (confirmed by 2+ contributors in #1607, group D125). Thanks for the contribution — feel free to comment if this covers something #2643 does not.
Pull request closed