Repository navigation
D3D12.X: share fallback memory shader cache sessions - #2878
andrewDoing wants to merge 2 commits into
Conversation
|
Ran the shader-cache session tests at 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: Not tested: the native D3D12 comparison probe, the full workspace suite and its known failures, a paired smoke run, AMD and Intel GPUs, native wave64 hosts, Wine, release profile, game data. AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used. |
luckyteagirl
left a comment
There was a problem hiding this comment.
Could the shared MEMORY store reject duplicate keys before modifying the value? Native ID3D12ShaderCacheSession::StoreValue specifies DXGI_ERROR_ALREADY_EXISTS for an existing key. The fallback already overwrote same-session duplicates, but sharing the store makes a second live session able to replace the first session's cached bytes.
I compiled the exact parent and PR fallback modules into a Windows CPU harness and opened two same-ID MEMORY sessions in each. A stored byte A in the first session, then a store of B under the same key in the second, gave S_OK for the second store on both revisions. Reading through the first session returned A on the parent and B on the PR head. The native API contract calls for rejection of the duplicate and preservation of A in the shared cache. The harness used no native D3D12 device.
Shared-store lookup · Insertion · D3D12 shader cache contract
AI-assisted review (GPT-6.2 Sol).
Import public XCL PR xcl-dev#2878, by @andrewDoing. Source: xcl-dev#2878 Original head: c1a8ecc GPL-2.0-only; original attribution retained. Imported for authorized synthetic test validation; not yet independently tested. Assisted-by: ChatGPT (GPT-6.2)
|
Addressed the duplicate-key review in The lifetime regression now tries to replace the first value both through its original session and through a second live session with the same ID and version. Both calls returned the expected HRESULT. After the first session closed, the second still read the original six bytes. The two focused shader-cache tests passed on Windows/Ryzen 7 5700X3D with no skips, including the device-backed forced-fallback path. This revision has focused test coverage only; the draft is still awaiting the required clean retail smoke comparison. AI assistance: OpenAI Codex (GPT-6) implemented and tested the correction. |
|
The duplicate-key review is addressed in The outstanding item is the runtime regression check. Our paired smoke attempts both stopped during title startup before the first present. If someone has a title that renders on current main, could you run |
|
The first commit, sharing MEMORY-mode fallback stores between live sessions with the same identifier and version, is not in any other PR or on main. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human. |
Fallback D3D12 MEMORY shader-cache sessions with the same identifier and version previously used separate stores. A second live session could not find a value written by the first. Share the store while any matching session remains alive, then discard it after the last session closes, matching the native behavior measured on this machine.
What is in it
crates/xcl/src/hle/d3d12x/shader_cache_session.rs: share matching memory-session stores, serialize creation and last-session cleanup, reject duplicate stores without replacing existing bytes, and test lifetime, isolation and duplicate handling.Tested
c1a8ecc7, a local native-D3D12 versus fallback probe: before the fix, a live second fallback session returnedDXGI_ERROR_NOT_FOUNDwhere native returned the 13-byte value. After the fix, both returned the value and a fresh session after the final release missed it. An earlySetDeleteOnDestroydid not prevent the live peer reading the value. One post-fix parity run passed; this probe is not included in the PR.1f4cf9ef, both focused fallback tests passed with zero skips. The original session and a second live session each receivedDXGI_ERROR_ALREADY_EXISTSwhen trying to replace a key. The surviving session read the original bytes.0x887a0036on duplicateStoreValue, and the peer read back the original byte. This is also relevant to the replacement assumptions in the independently proposed capacity fix. Native results on #2332cargo test --workspace --locked --offline --no-fail-fast -- --test-threads=4: head1f4cf9efhad 1,442 passed, 5 failed, 47 ignored. Base8b957bechad 1,441 passed, 5 failed, 47 ignored. Each logged 26 GPU skips (21 wave64, three unsupported per-lane forms, one driver-cache option, one heap-windows feature).Regression run
The same game image and requested 60-second duration were used with clean release builds, separate empty data and shader cache directories, and networking disabled. Both processes exited during startup with zero presents. The retail regression gate remains outstanding and the PR remains a draft.
Main:
PR:
Not tested
AI use