D3D12.X: a create that fails on a lost device keeps the driver's blob #2426
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!2426
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2426"
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?
@Digit4w on GitHub · 2026-11-25 18:35 UTC · original
Digit4w:d3d12x-keep-driver-blob-on-device-loss→main· +96 −9 · 1 files · 1 commits · openA pipeline create that was given a driver blob and then failed dropped the blob, in memory and the file under
<DXIL cache>\driver\, whatever the HRESULT was. On a removed or hung device every create fails, so in the second or two before the title is stopped each pipeline it creates deletes a valid blob, and the next run builds those pipelines in the driver again. With this changeDXGI_ERROR_DEVICE_REMOVED,_HUNG,_RESETandE_OUTOFMEMORYkeep the blob; any other failure drops it as before. Part of #2088 (a warm run reuses the pipelines of the run before).What is in it
hle/d3d12x/real.rs:driver_cache::refused(hr), used by the three creates that take a blob (compute, graphics increate_graphics_pso_cached, the compute pass of a two-pass pipeline). The two compute creates had the same lines for a failed create with a blob; they are nowdrop_refused_compute_blob. The retry without the blob is unchanged. Incompute_containerthe early return ofComputeBuild::CachedWhole(#2371) comes after that decision, as it came after the old lines.a_lost_device_or_no_memory_does_not_refuse_a_blob,cached_graphics_blob_is_kept_when_the_device_is_removedanda_compute_blob_is_kept_when_the_device_is_lost_and_dropped_when_the_driver_refuses_it(the last two fail without the change).Tested
RTX 4070 SUPER 12 GB (driver 32.0.16.2101), Ryzen 5 7600, 32 GB, Windows 11 26200, rustc 1.100.0.
cargo test --workspace --no-fail-fast -- --test-threads=4(debug,XCL_ADAPTER=nvidia) on9c178b2, which is onmainb49be18: 1438 passed, 0 failed, 47 ignored. The three tests of this PR ran and passed.SKIPPED, 25 lines: 21 "no wave64", 3 f16 / f32 programs refused in the per-lane form (#1426),
heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).Before the rebases: a retail title, release builds of
68a284aand of68a284a+ this change, each with a local switch that is not in this PR and callsID3D12Device5::RemoveDevice()during loading;XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_PSO_TRACE=1, the same 2 975 blob files restored before every run. Compute creates with a blob that failed after the removal (all0x887a0005), and how many of their files were gone afterwards:The next run (100 s, the main build) under an exe name the NVIDIA driver's own cache had never seen: the 24 pipelines of the second row took 22.1 s in the driver without their blobs and 0.7 s with them (the largest: 308 KB of DXIL, 4.8 s). Under the usual exe name the driver's own cache gave a lost one back in 4 ms, so the cost shows only when that cache does not have the pipeline.
Regression run
Both through the same script, 60 s, with
XCL_ADAPTER=nvidia XCL_NETWORK=0 XCL_TRACE_FAULTS=1 XCL_FRAME_DUMP=300and A pressed at 14, 17 and 21 s.main:
this PR's head:
Not tested
drop_refused_compute_blobcovers what the two compute creates decide about the blob, not the retry around it: that is in twounsafefunctions that call the driver, and has no test.E_OUTOFMEMORY,DEVICE_HUNGandDEVICE_RESETin a real run: only the unit test of the decision.68a284a, not again onb49be18. TheCachedWholecreate of #2371 with a lost device was not run either.AI use
🤖 Generated with Claude Code
@emirduran707 on GitHub · 2026-11-25 19:13 UTC · original
Independent AMD RDNA4 (native wave64) test report on exact head
fdbccf573187f205e5e9a5980fab16af87bb6c7a(clean detached checkout, no local changes).Tested
stable-x86_64-pc-windows-msvc), DXC 1.9.2602.17; tests debug, smoke release.cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4: 1289 passed, 3 failed, 46 ignored; 8 SKIPPED (6 inlower_dxil::tests::{f16,f32}_programs_on_the_gpurefused by per-lane form;heap_window_out_of_memory_falls_back_to_the_switch_form;pso_measurement_compiles_an_exact_synthetic_record). All native wave64 GPU tests ran and passed.hle::d3d12x::real::driver_cache::tests::a_lost_device_or_no_memory_does_not_refuse_a_blobandhle::d3d12x::real::graphics_blob_tests::cached_graphics_blob_is_kept_when_the_device_is_removed.main:gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1(seed 722) andfuzz_validate_and_gpu_3(seed 1599) on this GPU, plusgpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier(from50a9fde/ #2074, fixed later onmainin #2420).Regression run (60 s retail-title smoke,
XCL_NETWORK=0, release)(Matched
main68a284abaseline on the same machine today: 1573 frames, 14420 MB peak, 0 device removals, 0 crashes.)Not tested
AI use
@GustavoEllwanger on GitHub · 2026-11-25 19:41 UTC · original
Test report on head
fdbccf5, as is and merged onto currentmain06055a7(mergec7f6dea, no conflicts), adding NVIDIA Blackwell (32-lane waves) and AMD RDNA2 (native wave64) to the RTX 4070 SUPER and RDNA4 runs above.Tested
XCL_ADAPTER=5060XCL_ADAPTER=Radeoncargo test --workspace --no-fail-fast -- --test-threads=4:main06055a706055a7fdbccf5mainplus the two new tests, with nothing else changed.gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1(seed 783 onmainand merged, seed 540 on the old base), the same as onmain, #2115.a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrierfails on both GPUs as described above; it passes on06055a7, so theBuild and testcheck should go green on a rerun.hle::d3d12x::real::driver_cache::tests::a_lost_device_or_no_memory_does_not_refuse_a_blobandhle::d3d12x::real::graphics_blob_tests::cached_graphics_blob_is_kept_when_the_device_is_removed.SKIPPED: RTX 5060 29 lines (wave64-only and per-lanegpu::tests,heap_window_out_of_memory_falls_back_to_the_switch_form,shaders::tests::pso_measurement_compiles_an_exact_synthetic_record,test_title_draws_with_a_root_signature_under_the_debug_layer,uploads_start_from_each_subresources_state); iGPU 18 lines (per-lane#1426refusals and the same four).XCL_ADAPTER=5060 cargo test -p xcl --lib -- hle::d3d12x::real::driver_cache hle::d3d12x::real::graphics_blob_tests --test-threads=8, 30 runs each: this PR (11 tests) 30 passed, 0 failed;main(9 tests) 30 passed, 0 failed. The new tests don't interfere with each other or with the existing ones.Not tested
Tests run and this report drafted with Claude Code (Claude Opus 5.5); I checked the numbers against the logs.
@DavidM1911 on GitHub · 2026-11-25 19:46 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
@Digit4w on GitHub · 2026-11-25 22:25 UTC · original
@bmjask thanks for the review. Rebased onto
maine1d84b7(the failingBuild and testcheck wasa_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrierfrom the old base) and added compute coverage; the head is now749cf86.compute_containerand the compute pass infinish_two_pass) had the same lines for a failed create with a blob. They are now one function,drop_refused_compute_blob, with a test: a removed, hung or reset device andE_OUTOFMEMORYkeep the blob in memory and on disk;E_INVALIDARGdrops it. The test fails with the old behaviour.create_graphics_pso_cachedthey call the driver directly, so a test like the graphics one would need them split up first; I left that out to keep this PR small. It is under Not tested, next to the missing real OOM / hung / reset runs.Suite on
749cf86(RTX 4070 SUPER): 1426 passed, 0 failed, 46 ignored. The smoke blocks are in the description.Written with Claude Code (Claude Fable 5.2).
@DavidM1911 on GitHub · 2026-11-26 02:22 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
github-bot referenced this pull request2026-11-26 06:18:31 +00:00
github-bot referenced this pull request2026-11-26 07:52:45 +00:00
749cf866c3to9c178b2d64@bmjask on GitHub · 2026-11-25 20:30 UTC · original · reviewed
No concrete code defect found. The retained-blob classifier preserves cache on device removal/hang/reset/OOM while keeping fallback retry without the blob across compute, graphics, and two-pass paths; successful retries replace stale blobs. Nonblocking gap: only graphics has focused retention coverage. Please add equivalent compute_container and finish_two_pass device-loss tests, and retain the disclosed lack of real OOM/hung/reset validation.
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.