D3D12.X: guard disk_stores removal on ShaderCacheSession SetDeleteOnDestroy #1591

Open
b3IKK wants to merge 1 commit from upstream-pr/1601 into main
b3IKK commented 2026-11-24 18:07:50 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by b3IKK on 2026-11-24T18:07:50Z.


In shader_cache_session::release, when delete_on_destroy was set on a disk-mode session, disk_stores().lock().unwrap().remove(&k) removed key k unconditionally. If two sessions S1 and S2 shared the same store Arc1 with SetDeleteOnDestroy(), releasing S1 removed k, S3 opened a fresh store Arc2 for k and cached shaders in it, and releasing S2 later evicted S3's newer Arc2 from disk_stores().

This removes k from disk_stores() only when the currently stored Arc is still Arc::ptr_eq to boxed.store.

What is in it

  • crates/xcl/src/hle/d3d12x/shader_cache_session.rs: check Arc::ptr_eq(cur, &boxed.store) before removing k from disk_stores(); add unit test stale_delete_on_destroy_does_not_evict_newer_disk_store (verified failing with DXGI_ERROR_NOT_FOUND before the fix).

Tested

  • hardware (GPU + driver, CPU), Windows build, Rust version, debug / release: NVIDIA GeForce RTX 5080 (driver 32.0.16.1088), AMD Ryzen 9 9950X3D, Windows 11 10.0.26300, Rust 1.100.0 (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: 2 no wave64 — gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask, gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware; 1 no 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_store failed before the fix)

Regression run

main:

xcl-smoke v1
commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3
gpu: NVIDIA GeForce RTX 5080
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1226 (PresentX 1226)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15341 MB

PR:

xcl-smoke v1
commit: 0003178b8c8bd642a8916b4687e8698a5afe99cc
gpu: NVIDIA GeForce RTX 5080
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1642 (PresentX 1642)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14606 MB

Not tested

  • AMD GPUs and native wave64 hardware
  • other titles (Minecraft Preview, Unicorn Overlord, Fortnite, XDefiant) and Linux / Wine

AI use

  • OpenCode, Gemini 4 Neon: audited shader_cache_session.rs, wrote the fix and unit test, ran the test suite and scripts/smoke.ps1 regression runs, and drafted this PR description.
<!-- greyfinch-sync:ivall/xcl:issue:5477692111 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1601). Originally posted by [b3IKK](https://github.com/b3IKK) on 2026-11-24T18:07:50Z. --- In `shader_cache_session::release`, when `delete_on_destroy` was set on a disk-mode session, `disk_stores().lock().unwrap().remove(&k)` removed key `k` unconditionally. If two sessions `S1` and `S2` shared the same store `Arc1` with `SetDeleteOnDestroy()`, releasing `S1` removed `k`, `S3` opened a fresh store `Arc2` for `k` and cached shaders in it, and releasing `S2` later evicted `S3`'s newer `Arc2` from `disk_stores()`. This removes `k` from `disk_stores()` only when the currently stored `Arc` is still `Arc::ptr_eq` to `boxed.store`. **What is in it** - `crates/xcl/src/hle/d3d12x/shader_cache_session.rs`: check `Arc::ptr_eq(cur, &boxed.store)` before removing `k` from `disk_stores()`; add unit test `stale_delete_on_destroy_does_not_evict_newer_disk_store` (verified failing with `DXGI_ERROR_NOT_FOUND` before the fix). **Tested** - hardware (GPU + driver, CPU), Windows build, Rust version, debug / release: NVIDIA GeForce RTX 5080 (driver 32.0.16.1088), AMD Ryzen 9 9950X3D, Windows 11 10.0.26300, Rust 1.100.0 (`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: 2 `no wave64` — `gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware`; 1 `no 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_store` failed before the fix) **Regression run** main: ``` xcl-smoke v1 commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3 gpu: NVIDIA GeForce RTX 5080 title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1226 (PresentX 1226) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15341 MB ``` PR: ``` xcl-smoke v1 commit: 0003178b8c8bd642a8916b4687e8698a5afe99cc gpu: NVIDIA GeForce RTX 5080 title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1642 (PresentX 1642) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14606 MB ``` **Not tested** - AMD GPUs and native wave64 hardware - other titles (Minecraft Preview, Unicorn Overlord, Fortnite, XDefiant) and Linux / Wine **AI use** - OpenCode, Gemini 4 Neon: audited `shader_cache_session.rs`, wrote the fix and unit test, ran the test suite and `scripts/smoke.ps1` regression runs, and drafted this PR description.
Aniseto commented 2026-11-24 19:07:21 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Aniseto on 2026-11-24T18:14:48Z.


Ran the shader_cache_session module at 0003178. 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.

XCL_ADAPTER=nvidia cargo test -p xcl --lib shader_cache_session
2 passed; 0 failed; 0 ignored      (exit 0)

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 whose disk_stores registration 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.

<!-- greyfinch-sync:ivall/xcl:comment:7140368979 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1601#issuecomment-7140368979). Originally posted by [Aniseto](https://github.com/Aniseto) on 2026-11-24T18:14:48Z. --- Ran the `shader_cache_session` module at `0003178`. 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. ``` XCL_ADAPTER=nvidia cargo test -p xcl --lib shader_cache_session 2 passed; 0 failed; 0 ignored (exit 0) ``` 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 whose `disk_stores` registration 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 commented 2026-11-24 19:07:35 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by b3IKK on 2026-11-24T18:44:22Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7141082658 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1601#issuecomment-7141082658). Originally posted by [b3IKK](https://github.com/b3IKK) on 2026-11-24T18:44:22Z. --- 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 commented 2026-11-24 21:09:26 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T20:21:58Z.


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 unmodified main.)

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7143434026 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1601#issuecomment-7143434026). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T20:21:58Z. --- 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 unmodified `main`.) Thanks!
upipibi commented 2026-11-26 16:08:23 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by upipibi on 2026-11-26T16:08:23Z.


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 base 9e3831e.

  • 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_store with --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).
<!-- greyfinch-sync:ivall/xcl:comment:7197233563 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1601#issuecomment-7197233563). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-26T16:08:23Z. --- 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 base `9e3831e`. - `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_store` with `--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).
thehollowedone commented 2026-11-30 12:57:02 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-30T12:57:02Z.


merge-check
base: 9dfbe3ea66
head: 0003178b8c
merge: clean (local merge tree 16667840d8df2e49d4476d7626c7272873ec7fa0)
build: cargo build --workspace --offline --locked -> ok
tests: cargo test --workspace --offline --locked --no-fail-fast -- --test-threads=4 -> 2885 passed, 2 failed, 51 ignored; SKIPPED: 24 (22 no wave64; 2 no heap windows, one requires XCL_HEAP_WINDOWS=1); failing: gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16 and gpu::recomp::pso::shader_cache_tests::console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk; both also fail in exact-base filtered runs.
review: The one-file change removes the shared key only when its current Arc still matches the releasing session’s store. The regression recreates the replacement-store sequence and confirms the newer value remains readable. The store lock is released before taking the registry lock. No default frame-path work added.
performance: Reasoned cost is limited to session release. Matched 60-second RTX 3080 Ti smokes held 60 presents per 2-second interval with zero device removals or crashes. Base/merge tree: 1662/1692 frames; peak commit 16288/16341 MB (single-run delta, not attributed to this change).
verdict: safe to merge — clean merge, successful build, no new test failures, and matched smoke runs passed.
hardware / tool and model: RTX 3080 Ti, driver 32.0.16.2140; Ryzen 7 9800X3D; Windows 11 Pro build 26300; rustc 1.99.1 / Codex GPT-6.2 Sol.

Regression run

main:

xcl-smoke v1
commit: 9dfbe3ea6653a9c76ef3ea0d66187a4b5407483b
gpu: NVIDIA GeForce RTX 3080 Ti
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1662 (PresentX 1662)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16288 MB

merged PR tree:

xcl-smoke v1
commit: 16667840d8df2e49d4476d7626c7272873ec7fa0
gpu: NVIDIA GeForce RTX 3080 Ti
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1692 (PresentX 1692)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16341 MB
<!-- greyfinch-sync:ivall/xcl:comment:7279144694 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1601#issuecomment-7279144694). Originally posted by [thehollowedone](https://github.com/thehollowedone) on 2026-11-30T12:57:02Z. --- merge-check base: 9dfbe3ea6653a9c76ef3ea0d66187a4b5407483b head: 0003178b8c8bd642a8916b4687e8698a5afe99cc merge: clean (local merge tree 16667840d8df2e49d4476d7626c7272873ec7fa0) build: cargo build --workspace --offline --locked -> ok tests: cargo test --workspace --offline --locked --no-fail-fast -- --test-threads=4 -> 2885 passed, 2 failed, 51 ignored; SKIPPED: 24 (22 no wave64; 2 no heap windows, one requires XCL_HEAP_WINDOWS=1); failing: gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16 and gpu::recomp::pso::shader_cache_tests::console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk; both also fail in exact-base filtered runs. review: The one-file change removes the shared key only when its current Arc still matches the releasing session’s store. The regression recreates the replacement-store sequence and confirms the newer value remains readable. The store lock is released before taking the registry lock. No default frame-path work added. performance: Reasoned cost is limited to session release. Matched 60-second RTX 3080 Ti smokes held 60 presents per 2-second interval with zero device removals or crashes. Base/merge tree: 1662/1692 frames; peak commit 16288/16341 MB (single-run delta, not attributed to this change). verdict: safe to merge — clean merge, successful build, no new test failures, and matched smoke runs passed. hardware / tool and model: RTX 3080 Ti, driver 32.0.16.2140; Ryzen 7 9800X3D; Windows 11 Pro build 26300; rustc 1.99.1 / Codex GPT-6.2 Sol. Regression run main: ``` xcl-smoke v1 commit: 9dfbe3ea6653a9c76ef3ea0d66187a4b5407483b gpu: NVIDIA GeForce RTX 3080 Ti title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1662 (PresentX 1662) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 16288 MB ``` merged PR tree: ``` xcl-smoke v1 commit: 16667840d8df2e49d4476d7626c7272873ec7fa0 gpu: NVIDIA GeForce RTX 3080 Ti title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1692 (PresentX 1692) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 16341 MB ```
SzczepanGrela commented 2026-11-30 13:15:33 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by SzczepanGrela on 2026-11-30T13:15:33Z.


merge-check
base: 9dfbe3ea66
head: 0003178b8c
merge: clean; staged merge tree 8df2ff5de0244d00548123970d13cc7d5156c6a1, no local production edits.
build: cargo build --workspace --release --target x86_64-pc-windows-gnu --offline --locked -j 3 --message-format=json-render-diagnostics -> ok on base and merge.
tests: cargo test --workspace --release --target x86_64-pc-windows-gnu --offline --locked -j 3 --no-fail-fast -- --test-threads=4 --nocapture -> exit 101 on both. On each, 41 of 42 harnesses completed with 136 passed, 12 failed, 20 ignored; the library harness exited 5 without a summary. These are completed-harness counts, not full-suite totals. Four SKIPPED notices on each: three missing D3D12 debug layer and one disabled heap-window path.
review: Read the complete one-file diff and current module. Registry lookup, Arc::ptr_eq and removal share one lock; the store-clear guard is released before that lock. Targeted stale-store regression is red on base and green on merge, as below. No blocking finding in this change itself.
performance: One pointer comparison on delete-on-destroy session release; no added draw/dispatch work. Reasoned, not timed.
verdict: not yet: this Wine run cannot establish full-suite non-regression because both library harnesses abort. Targeted fix verified; no PR-specific failure observed among the completed harnesses. A complete independent merge check remains needed.
hardware / tool and model: RX 9070 16 GB, RADV GFX1201 / Mesa 26.3.1-arch3.5; Ryzen 7 7700, 30 GiB RAM; CachyOS 7.3.6-3-cachyos; GE-Proton11-12 / Wine 11.0 Staging, vkd3d-proton 8293130ebe370b1+; Rust 1.97.1, Windows GNU release executables. Codex, GPT-6 (exact serving variant not exposed).

Tested

Targeted runner: Wine <unit.exe> hle::d3d12x::shader_cache_session::tests:: --nocapture --test-threads=1, then --test-threads=4.

Source / filter Threads 1, per run Threads 4, per run Repeats per setting
Unmodified base, existing cache-session module 1 passed, 0 failed 1 passed, 0 failed 1
Base plus verbatim PR regression, that test alone with --exact 0 passed, 1 failed 0 passed, 1 failed 3
Merged PR, cache-session module 2 passed, 0 failed 2 passed, 0 failed 3

Zero targeted skips. Negative controls fail at FindValue with 0x887A0002; the unchanged base production code loses the replacement store. The device/session test also exercises XCL's actual fallback after vkd3d-proton returns 0x80004001.

The same 12 completed-harness failures occur on both sides in d3d12_resource_and_sync, e2e, gpu_compute_e2e (six), gpu_two_pass_cache_e2e, pls_quota, predication_e2e and sparse_reinit. Both library runs report gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_2 failed before exiting 5; neither produces library totals. No cause or PR attribution claimed for those interruptions.

Separate source worktrees and final target directories; source hashes, test inventories and distinct executable hashes verified. An initial shared-target attempt reused the base executable; it was rejected and excluded from all PR results above.

Not tested

Native Windows/MSVC, retail titles, scripts/smoke.ps1, timing/FPS, or the library tests left unexecuted after the abort. XCL_SAMPLE_* unset; XCL_NETWORK=0.

AI use

Codex (GPT-6, exact serving variant not exposed) reviewed the diff, prepared the verbatim-test negative control, ran the comparisons, verified source/binary provenance and drafted this report. Publication authorized by the account owner.

<!-- greyfinch-sync:ivall/xcl:comment:7279583942 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1601#issuecomment-7279583942). Originally posted by [SzczepanGrela](https://github.com/SzczepanGrela) on 2026-11-30T13:15:33Z. --- merge-check base: 9dfbe3ea6653a9c76ef3ea0d66187a4b5407483b head: 0003178b8c8bd642a8916b4687e8698a5afe99cc merge: clean; staged merge tree 8df2ff5de0244d00548123970d13cc7d5156c6a1, no local production edits. build: cargo build --workspace --release --target x86_64-pc-windows-gnu --offline --locked -j 3 --message-format=json-render-diagnostics -> ok on base and merge. tests: cargo test --workspace --release --target x86_64-pc-windows-gnu --offline --locked -j 3 --no-fail-fast -- --test-threads=4 --nocapture -> exit 101 on both. On each, 41 of 42 harnesses completed with 136 passed, 12 failed, 20 ignored; the library harness exited 5 without a summary. These are completed-harness counts, not full-suite totals. Four SKIPPED notices on each: three missing D3D12 debug layer and one disabled heap-window path. review: Read the complete one-file diff and current module. Registry lookup, Arc::ptr_eq and removal share one lock; the store-clear guard is released before that lock. Targeted stale-store regression is red on base and green on merge, as below. No blocking finding in this change itself. performance: One pointer comparison on delete-on-destroy session release; no added draw/dispatch work. Reasoned, not timed. verdict: not yet: this Wine run cannot establish full-suite non-regression because both library harnesses abort. Targeted fix verified; no PR-specific failure observed among the completed harnesses. A complete independent merge check remains needed. hardware / tool and model: RX 9070 16 GB, RADV GFX1201 / Mesa 26.3.1-arch3.5; Ryzen 7 7700, 30 GiB RAM; CachyOS 7.3.6-3-cachyos; GE-Proton11-12 / Wine 11.0 Staging, vkd3d-proton 8293130ebe370b1+; Rust 1.97.1, Windows GNU release executables. Codex, GPT-6 (exact serving variant not exposed). **Tested** Targeted runner: Wine `<unit.exe> hle::d3d12x::shader_cache_session::tests:: --nocapture --test-threads=1`, then `--test-threads=4`. | Source / filter | Threads 1, per run | Threads 4, per run | Repeats per setting | |---|---|---|---| | Unmodified base, existing cache-session module | 1 passed, 0 failed | 1 passed, 0 failed | 1 | | Base plus verbatim PR regression, that test alone with `--exact` | 0 passed, 1 failed | 0 passed, 1 failed | 3 | | Merged PR, cache-session module | 2 passed, 0 failed | 2 passed, 0 failed | 3 | Zero targeted skips. Negative controls fail at `FindValue` with `0x887A0002`; the unchanged base production code loses the replacement store. The device/session test also exercises XCL's actual fallback after vkd3d-proton returns `0x80004001`. The same 12 completed-harness failures occur on both sides in `d3d12_resource_and_sync`, `e2e`, `gpu_compute_e2e` (six), `gpu_two_pass_cache_e2e`, `pls_quota`, `predication_e2e` and `sparse_reinit`. Both library runs report `gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_2` failed before exiting 5; neither produces library totals. No cause or PR attribution claimed for those interruptions. Separate source worktrees and final target directories; source hashes, test inventories and distinct executable hashes verified. An initial shared-target attempt reused the base executable; it was rejected and excluded from all PR results above. **Not tested** Native Windows/MSVC, retail titles, `scripts/smoke.ps1`, timing/FPS, or the library tests left unexecuted after the abort. `XCL_SAMPLE_*` unset; `XCL_NETWORK=0`. **AI use** Codex (GPT-6, exact serving variant not exposed) reviewed the diff, prepared the verbatim-test negative control, ran the comparisons, verified source/binary provenance and drafted this report. Publication authorized by the account owner.
Pipodi commented 2026-11-30 14:20:22 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Pipodi on 2026-11-30T14:20:22Z.


merge-check claim
head: 0003178b8c

<!-- greyfinch-sync:ivall/xcl:comment:7281216126 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1601#issuecomment-7281216126). Originally posted by [Pipodi](https://github.com/Pipodi) on 2026-11-30T14:20:22Z. --- merge-check claim head: 0003178b8c8bd642a8916b4687e8698a5afe99cc
Pipodi commented 2026-11-30 14:37:38 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Pipodi on 2026-11-30T14:37:38Z.


merge-check
base: 9dfbe3ea66
head: 0003178b8c
merge: clean (local merge tree 5dcb48bc75218a0a547cceb1b9823963b1b8be8b)
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> first run: the library harness aborted (0xc0000409, STATUS_STACK_BUFFER_OVERRUN, no summary), the other harnesses 148 passed, 0 failed, 20 ignored. The library harness alone rerun: 2738 passed, 1 failed, 31 ignored, so 2886 passed, 1 failed, 51 ignored in all; failing: gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16 (also fails on main 9dfbe3ea, fixed by #3513). New test shader_cache_session::tests::stale_delete_on_destroy_does_not_evict_newer_disk_store passes on the merge and fails with the production hunk reverted (uncommitted; FindValue returns 0x887A0002). 24 SKIPPED: 22 "no wave64", two_pass_binds_set_the_shared_view_heap (no heap windows) and pso_measurement_compiles_an_exact_synthetic_record (cannot disable the driver cache).
disagreement of the two earlier checks: thehollowedone lists console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk as failing on the merge and on base; SzczepanGrela (Wine, RADV) could not get library totals because the library harness aborts. Here console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk passes (in the library rerun, and also on the merge for #1781), so it is not caused by this PR and is not a failure on this setup. The library-harness abort is not specific to this PR: it did not repeat on the rerun of the same binary and was reported on unmodified main by DavidM1911 on this PR (0xc0000005 under parallel scheduling); the PR changes only the release path of a fallback shader cache session. The Wine run therefore does not block: its targeted result (test red on base, green on merge) matches mine.
review: read the whole diff (crates/xcl/src/hle/d3d12x/shader_cache_session.rs, +50 -1). release() now removes the shared disk_stores key only when the entry is still this session store (Arc::ptr_eq), under one lock held for the get and the remove; the store lock is dropped before it. This closes the sequence where an older session, released late, evicts a newer store of the same (id, version). No blocker.
performance: one pointer comparison when a delete-on-destroy session is released; nothing in the frame path.
verdict: safe to merge
hardware / tool and model: NVIDIA RTX 4090, driver 621.40; i9-13900K; Windows 11 Pro 10.0.26300; rustc 1.100.0; debug. Claude Code, Claude Opus 5.5.

<!-- greyfinch-sync:ivall/xcl:comment:7281672995 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1601#issuecomment-7281672995). Originally posted by [Pipodi](https://github.com/Pipodi) on 2026-11-30T14:37:38Z. --- merge-check base: 9dfbe3ea6653a9c76ef3ea0d66187a4b5407483b head: 0003178b8c8bd642a8916b4687e8698a5afe99cc merge: clean (local merge tree 5dcb48bc75218a0a547cceb1b9823963b1b8be8b) build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> first run: the library harness aborted (0xc0000409, STATUS_STACK_BUFFER_OVERRUN, no summary), the other harnesses 148 passed, 0 failed, 20 ignored. The library harness alone rerun: 2738 passed, 1 failed, 31 ignored, so 2886 passed, 1 failed, 51 ignored in all; failing: gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16 (also fails on main 9dfbe3ea, fixed by #3513). New test shader_cache_session::tests::stale_delete_on_destroy_does_not_evict_newer_disk_store passes on the merge and fails with the production hunk reverted (uncommitted; FindValue returns 0x887A0002). 24 SKIPPED: 22 "no wave64", two_pass_binds_set_the_shared_view_heap (no heap windows) and pso_measurement_compiles_an_exact_synthetic_record (cannot disable the driver cache). disagreement of the two earlier checks: thehollowedone lists console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk as failing on the merge and on base; SzczepanGrela (Wine, RADV) could not get library totals because the library harness aborts. Here console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk passes (in the library rerun, and also on the merge for #1781), so it is not caused by this PR and is not a failure on this setup. The library-harness abort is not specific to this PR: it did not repeat on the rerun of the same binary and was reported on unmodified main by DavidM1911 on this PR (0xc0000005 under parallel scheduling); the PR changes only the release path of a fallback shader cache session. The Wine run therefore does not block: its targeted result (test red on base, green on merge) matches mine. review: read the whole diff (crates/xcl/src/hle/d3d12x/shader_cache_session.rs, +50 -1). release() now removes the shared disk_stores key only when the entry is still this session store (Arc::ptr_eq), under one lock held for the get and the remove; the store lock is dropped before it. This closes the sequence where an older session, released late, evicts a newer store of the same (id, version). No blocker. performance: one pointer comparison when a delete-on-destroy session is released; nothing in the frame path. verdict: safe to merge hardware / tool and model: NVIDIA RTX 4090, driver 621.40; i9-13900K; Windows 11 Pro 10.0.26300; rustc 1.100.0; debug. Claude Code, Claude Opus 5.5.
brainhay5 commented 2026-11-30 23:55:12 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by brainhay5 on 2026-11-30T23:55:12Z.


merge-check claim
head: 0003178b8c

Claiming for a tie-break: the three checks on this head disagree because one was run under Wine (x86_64-pc-windows-gnu), where both library harnesses abort. A native Windows run on the same head should settle whether that verdict reflects the PR or the environment.

<!-- greyfinch-sync:ivall/xcl:comment:7295681355 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1601#issuecomment-7295681355). Originally posted by [brainhay5](https://github.com/brainhay5) on 2026-11-30T23:55:12Z. --- merge-check claim head: 0003178b8c8bd642a8916b4687e8698a5afe99cc Claiming for a tie-break: the three checks on this head disagree because one was run under Wine (x86_64-pc-windows-gnu), where both library harnesses abort. A native Windows run on the same head should settle whether that verdict reflects the PR or the environment.
brainhay5 commented 2026-12-01 00:12:32 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by brainhay5 on 2026-12-01T00:12:32Z.


merge-check
base: d0832e614f
head: 0003178b8c
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2890 passed, 1 failed, 51 ignored; 29 SKIPPED lines; failing: test_title_runs_and_game_folder_is_untouched — also fails on the base alone with the same command, verified by running it there
review: one file (+50), and the change is the right shape: release now removes the disk store only when the entry is still the same Arc (Arc::ptr_eq), so a session that is stale (its store already replaced by a newer session for the same identifier/version) can no longer evict the newer one. The lock is taken once and the check and removal happen under it, so there is no window between them. The added test builds exactly that ordering — s1 and s2 delete-on-destroy, s1 dropped, s3 opens a fresh store and writes, s2 dropped — and asserts s3's value survives; that test fails without the change. Contained, no unrelated edits, no new dependency.
performance: none in a hot path — the guard runs once per session release, and ptr_eq is a pointer comparison. No per-frame or per-draw cost.
verdict: safe to merge
comment on the disagreement above: this head has three checks and two verdicts. The not yet came from a run under Wine with --target x86_64-pc-windows-gnu, where the check itself reports that both library harnesses abort — so it could not establish non-regression, which is a statement about that environment rather than this PR. On native Windows the full suite completes (2,774 lib tests present, 2,890 passed overall) and the only failure is the one that fails on base regardless. That matches the two safe to merge verdicts above.
hardware / tool and model: RTX 5070 Ti 16 GB, driver 610.88 (32.0.16.1088); Ryzen 7 5800X3D, 64 GB; Windows 11 22631; OpenCode agent, DeepSeek V4.1 Flash 1017

<!-- greyfinch-sync:ivall/xcl:comment:7296059706 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1601#issuecomment-7296059706). Originally posted by [brainhay5](https://github.com/brainhay5) on 2026-12-01T00:12:32Z. --- merge-check base: d0832e614fa7d6ae027bb4feb27ccb9121f54a8f head: 0003178b8c8bd642a8916b4687e8698a5afe99cc merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2890 passed, 1 failed, 51 ignored; 29 SKIPPED lines; failing: test_title_runs_and_game_folder_is_untouched — also fails on the base alone with the same command, verified by running it there review: one file (+50), and the change is the right shape: `release` now removes the disk store only when the entry is still the same `Arc` (`Arc::ptr_eq`), so a session that is stale (its store already replaced by a newer session for the same identifier/version) can no longer evict the newer one. The lock is taken once and the check and removal happen under it, so there is no window between them. The added test builds exactly that ordering — s1 and s2 delete-on-destroy, s1 dropped, s3 opens a fresh store and writes, s2 dropped — and asserts s3's value survives; that test fails without the change. Contained, no unrelated edits, no new dependency. performance: none in a hot path — the guard runs once per session release, and `ptr_eq` is a pointer comparison. No per-frame or per-draw cost. verdict: safe to merge comment on the disagreement above: this head has three checks and two verdicts. The `not yet` came from a run under Wine with `--target x86_64-pc-windows-gnu`, where the check itself reports that both library harnesses abort — so it could not establish non-regression, which is a statement about that environment rather than this PR. On native Windows the full suite completes (2,774 lib tests present, 2,890 passed overall) and the only failure is the one that fails on base regardless. That matches the two `safe to merge` verdicts above. hardware / tool and model: RTX 5070 Ti 16 GB, driver 610.88 (32.0.16.1088); Ryzen 7 5800X3D, 64 GB; Windows 11 22631; OpenCode agent, DeepSeek V4.1 Flash 1017
Foniass commented 2026-12-01 06:14:22 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T06:14:22Z.


Triage (#1607) – head 0003178

No open or merged PR makes the same change: main's release in shader_cache_session.rs still removes the disk_stores() entry by key alone. #2878 and #2332 edit the same file (shared memory-mode sessions, StoreValue capacity) but keep that removal as it is. The new test fails without the Arc::ptr_eq guard (stale s2 evicts s3's store).
No problems found in the diff.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7302647605 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1601#issuecomment-7302647605). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T06:14:22Z. --- **Triage (#1607)** – head 0003178 No open or merged PR makes the same change: main's `release` in `shader_cache_session.rs` still removes the `disk_stores()` entry by key alone. #2878 and #2332 edit the same file (shared memory-mode sessions, StoreValue capacity) but keep that removal as it is. The new test fails without the `Arc::ptr_eq` guard (stale s2 evicts s3's store). No problems found in the diff. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Decodere commented 2026-12-02 08:33:34 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Decodere on 2026-12-02T08:33:34Z.


merge-check
base: 1c8b551475
head: 0003178b8c
merge: clean trial merge into 1c8b551475e1e7bfe48f94448492a4c3544a2e0f (trial-merge commit c3a132c75e5c7bae7bd7c41b907b50273757c6a7; git diff --check clean).
build: cargo build --workspace -> ok.
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture (43 targets) -> 2910 passed, 0 failed, 51 ignored (+1 new test vs main 1c8b5514; all 43 targets green including gpu_two_pass_cache_e2e). Both hle::d3d12x::shader_cache_session::tests passed with 0 skips: stale_delete_on_destroy_does_not_evict_newer_disk_store and rejected_create_shader_cache_session_falls_back_to_working_in_memory_session. 28 SKIPPED lines — all hardware/environment-expected on RTX 4060 (22 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 2 no heap windows, 1 cannot disable the driver cache (Windows Developer Mode required)).
review: read the full merged diff (1 file: crates/xcl/src/hle/d3d12x/shader_cache_session.rs, +50/-1). Production change is 4 lines in release (shader_cache_session.rs:157-160): before removing k from disk_stores() on SetDeleteOnDestroy, it checks Arc::ptr_eq(cur, &boxed.store) under the disk_stores() lock so a stale session handle holding an older Arc cannot evict a newer session's store opened under the same (id, version). Clean, race-free, properly mutex-scoped, and covered by the new regression test. No UB, lock-ordering, or correctness issues found. Note on the prior disagreement: the earlier not yet was an unrelated Wine lib-test-harness abort (0x40000015) with no defect attributed to this PR, and the entire native Windows workspace suite passed 2910/0 here.
performance: Tier 1 — cold teardown path (release of fallback ID3D12ShaderCacheSession with SetDeleteOnDestroy); adds a single Arc::ptr_eq check while already holding the disk_stores() mutex. No runtime or hot-path impact (retail smoke not required per TESTING.md).
verdict: safe to merge
hardware / tool and model: NVIDIA GeForce RTX 4060 8 GB (driver 621.40), Intel Core i5-11400F, 32 GB RAM, Windows 11 Build 26200, Rust 1.100.1 MSVC, DXC 1.9.2602.17 / Antigravity (Gemini 4 Neon)

<!-- greyfinch-sync:ivall/xcl:comment:7339615203 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1601#issuecomment-7339615203). Originally posted by [Decodere](https://github.com/Decodere) on 2026-12-02T08:33:34Z. --- merge-check base: 1c8b551475e1e7bfe48f94448492a4c3544a2e0f head: 0003178b8c8bd642a8916b4687e8698a5afe99cc merge: clean trial merge into `1c8b551475e1e7bfe48f94448492a4c3544a2e0f` (trial-merge commit `c3a132c75e5c7bae7bd7c41b907b50273757c6a7`; `git diff --check` clean). build: `cargo build --workspace` -> ok. tests: `cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture` (43 targets) -> 2910 passed, 0 failed, 51 ignored (+1 new test vs `main` `1c8b5514`; all 43 targets green including `gpu_two_pass_cache_e2e`). Both `hle::d3d12x::shader_cache_session::tests` passed with 0 skips: `stale_delete_on_destroy_does_not_evict_newer_disk_store` and `rejected_create_shader_cache_session_falls_back_to_working_in_memory_session`. 28 `SKIPPED` lines — all hardware/environment-expected on RTX 4060 (22 `no wave64`, 2 `no d3d12SDKLayers.dll`, 1 `no D3D12 debug layer`, 2 `no heap windows`, 1 `cannot disable the driver cache (Windows Developer Mode required)`). review: read the full merged diff (1 file: `crates/xcl/src/hle/d3d12x/shader_cache_session.rs`, +50/-1). Production change is 4 lines in `release` (`shader_cache_session.rs:157-160`): before removing `k` from `disk_stores()` on `SetDeleteOnDestroy`, it checks `Arc::ptr_eq(cur, &boxed.store)` under the `disk_stores()` lock so a stale session handle holding an older `Arc` cannot evict a newer session's store opened under the same `(id, version)`. Clean, race-free, properly mutex-scoped, and covered by the new regression test. No UB, lock-ordering, or correctness issues found. Note on the prior disagreement: the earlier `not yet` was an unrelated Wine lib-test-harness abort (`0x40000015`) with no defect attributed to this PR, and the entire native Windows workspace suite passed 2910/0 here. performance: Tier 1 — cold teardown path (`release` of fallback `ID3D12ShaderCacheSession` with `SetDeleteOnDestroy`); adds a single `Arc::ptr_eq` check while already holding the `disk_stores()` mutex. No runtime or hot-path impact (retail smoke not required per `TESTING.md`). verdict: safe to merge hardware / tool and model: NVIDIA GeForce RTX 4060 8 GB (driver 621.40), Intel Core i5-11400F, 32 GB RAM, Windows 11 Build 26200, Rust 1.100.1 MSVC, DXC 1.9.2602.17 / Antigravity (Gemini 4 Neon)
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1601:upstream-pr/1601'
git switch 'upstream-pr/1601'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/1601'
git switch 'upstream-pr/1601'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1601'
git switch 'upstream-pr/1601'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1601'
git switch 'main'
git merge --squash 'upstream-pr/1601'
git switch 'main'
git merge --ff-only 'upstream-pr/1601'
git switch 'main'
git merge 'upstream-pr/1601'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!1591
No description provided.