D3D12.X: guard disk_stores removal on ShaderCacheSession SetDeleteOnDestroy #1601
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!1601
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1601"
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?
@b3IKK on GitHub · 2026-11-24 18:07 UTC · original
b3IKK:d3d12x/shader-cache-delete-on-destroy-aba→main· +50 −1 · 1 files · 1 commits · openIn
shader_cache_session::release, whendelete_on_destroywas set on a disk-mode session,disk_stores().lock().unwrap().remove(&k)removed keykunconditionally. If two sessionsS1andS2shared the same storeArc1withSetDeleteOnDestroy(), releasingS1removedk,S3opened a fresh storeArc2forkand cached shaders in it, and releasingS2later evictedS3's newerArc2fromdisk_stores().This removes
kfromdisk_stores()only when the currently storedArcis stillArc::ptr_eqtoboxed.store.What is in it
crates/xcl/src/hle/d3d12x/shader_cache_session.rs: checkArc::ptr_eq(cur, &boxed.store)before removingkfromdisk_stores(); add unit teststale_delete_on_destroy_does_not_evict_newer_disk_store(verified failing withDXGI_ERROR_NOT_FOUNDbefore the fix).Tested
stable-x86_64-pc-windows-msvc), DXC 1.9.2609.5, debug (scripts/test.ps1) and release (scripts/smoke.ps1).\scripts\test.ps1(cargo build --workspace+cargo test --workspace -- --test-threads=4): 777 passed, 0 failed, 41 ignored (SKIPPED GPU tests: 2no wave64—gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask,gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware; 1no heap windows—heap_window_out_of_memory_falls_back_to_the_switch_form)cargo test -p xcl --lib shader_cache_session: 2 passed, 0 failed (stale_delete_on_destroy_does_not_evict_newer_disk_storefailed before the fix)Regression run
main:
PR:
Not tested
AI use
shader_cache_session.rs, wrote the fix and unit test, ran the test suite andscripts/smoke.ps1regression runs, and drafted this PR description.@Aniseto on GitHub · 2026-11-24 18:14 UTC · original
Ran the
shader_cache_sessionmodule at0003178. The PR adds no test of its own, so this is a regression check:Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, wave32 only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC 14.44.35207, DXC 1.9.2609.5, debug build.
Both tests pass, and this machine takes the path the PR guards: the run logs
CreateShaderCacheSession failed on the PC runtime (0x80070057) - using an in-memory session, so the in-memory session whosedisk_storesregistration the PR touches is the one in use here. That makes it a real path rather than a mocked one, though by itself it does not prove the set-delete-on-destroy ordering; that needs a driver that accepts the session.Not tested: the destroy path on a driver that accepts the session (this one refuses it), RDNA2/RDNA4 and Intel GPUs, Wine, release profile.
AI-assisted (OpenCode), model: DeepSeek V4.1 Flash 1017 - built the PR's head commit from a clean tree and ran the tests on this machine; no local changes were made.
@b3IKK on GitHub · 2026-11-24 18:44 UTC · original
Thanks for testing @Aniseto! Quick note: one of those 2 tests (\stale_delete_on_destroy_does_not_evict_newer_disk_store) is the regression test added by this PR — it directly exercises the fallback \SetDeleteOnDestroy\ / \disk_stores()\ ABA eviction path (which is only used by the fallback session itself) and fails without the \Arc::ptr_eq\ check.
@DavidM1911 on GitHub · 2026-11-24 20:21 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~22 ignored. (Intermittent 0xc0000005 abort under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodifiedmain.)Thanks!
github-bot referenced this pull request2026-11-26 09:04:53 +00:00
@upipibi on GitHub · 2026-11-26 16:08 UTC · original
NVIDIA test report for
0003178: RTX 3070 8 GB (Ampere, driver 616.56), Windows 11 26100, Rust 1.100.0, debug. Head tested as-is on its base9e3831e.cargo test -p xcl --lib -- --skip hle::xaudio2 --test-threads=4: 719 passed, 0 failed, 21 ignored; 2 SKIPPED (no wave64: gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware), neither in a file this PR changes.hle::d3d12x::shader_cache_session::tests::stale_delete_on_destroy_does_not_evict_newer_disk_storewith--exact --test-threads=1 --nocapture, 3 runs: 3/3 passed, 0 SKIPPED.Lib tests only; no title run.
AI-assisted (Claude Code, Claude Opus 5.5).
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.