Repository navigation
D3D12.X: preserve replaced driver blobs after stale rejection - #2614
luckyteagirl wants to merge 4 commits into
Conversation
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! — Devin |
|
I independently prepared a fix for #2601 before noticing this PR had opened concurrently, so I will not open a competing PR. One generation-identity edge remains in An alternative is to retain the exact file handle used to read A through PSO creation, opened with delete access and I have an unsubmitted reference implementation and an identical-byte cross-process regression here: mokkamokacaffe@06d0868 That branch has only passed Windows-target compilation from Linux, whereas this PR has real Windows/AMD execution, so I am offering it as a design/test contribution rather than claiming it is better validated. AI-assisted review: OpenAI Codex (GPT-6.2 Astra, Ultra reasoning). |
A byte-identical replacement defeated the prior path-and-content check, and a writer from an older XCL process did not honor its lock. Retain the handle that supplied each cached blob through native PSO creation, then dispose that file object on rejection. Strengthen the cross-process regression to replace the still-open old generation directly. Adapted from mokkamokacaffe/xcl@06d0868 (GPL-2.0-only), offered in the xcl-dev#2614 review. Assisted-by: OpenAI Codex (GPT-6; exact serving variant unavailable)
943947c to
cbc165f
Compare
|
Interesting |
|
Thanks for catching the generation-identity gap and offering the reference implementation. I reproduced the identical-byte failure on the previous On Windows, the new cross-process test passes; all six |
Thanks for the clear provenance, the failing-first reproduction, and the Windows/AMD validation. I compared revised head Either approach would work:
The existing commit-message and PR-body attribution is appreciated; this request is only so the authorship survives in Git/GitHub history. AI-assisted comment: OpenAI Codex (GPT-6.2 Astra, Ultra reasoning). |
cbc165f to
cd7be10
Compare
|
Done. I rewrote the draft PR as two commits: The paired title smoke remains pending. This reply was prepared with OpenAI Codex (GPT-6; exact serving variant unavailable). |
|
Thank you, @luckyteagirl — I really appreciate you restructuring the history to preserve my original Git authorship and keeping your test adjustment as a separate commit. I verified the resulting tree matches the revision that was already tested, so I’ll close #2616 as superseded and delete its branch. Thanks again for handling this so thoughtfully. AI-assisted comment: OpenAI Codex (GPT-6.2 Astra, Ultra reasoning). |
|
A complete GPU workspace suite on NVIDIA (both listed under Not tested): passes, and the Tested:
The library process ran to the end here (no Not tested: a refusal in a real title (no stale blob was produced), a release build, AMD (covered above). AI use: Claude Code (Claude Opus 5.5) ran the suite and the repeats, and wrote this report. |
|
NVIDIA test report for
Lib tests only; no title run. AI-assisted (Claude Code, Claude Opus 5.5). |
|
NVIDIA and AMD full-suite run, to go with the reports above by fromthemoonx, upipibi, since none of them covers AMD. Tested exact head Tested
Not tested
AI use
|
|
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
Thanks! — Devin |
…nvalidation (port upstream xcl-dev#2574 + xcl-dev#2614) (cherry picked from commit a37262db59ac82c615618b034d149e7c54a23ff6)
|
Wine/Proton concern with the open Under Wine, renaming over a file that has any open handle fails. In Where it breaks: the refused, not-over-cap branch of Suggested change: once the driver has refused the blob, invalidate it (which closes the handle) before the uncached compile, as the over-cap branch above already does: } else {
if let Some(loaded) = loaded.take() {
let _ = loaded.invalidate();
}
desc.CachedPSO = D3D12_CACHED_PIPELINE_STATE::default();
let pso = unsafe { self.dev.CreateComputePipelineState::<ID3D12PipelineState>(&desc) };The runtime call sites in Not tested: this comes from reading Wine master's source on the GitHub mirror. The AI use: found and written with Claude Code (Claude Opus 5.5) and checked by me. |
Retain the Windows file handle used to read each persisted driver blob. If the driver or offline precompiler rejects it, dispose that exact file object rather than a pathname another process may already have replaced. Open entries with read/delete sharing and OPEN_REPARSE_POINT, falling back to read-only and failing closed when exact-object deletion is unavailable. Preserve cache-I/O stall attribution and cover cross-process replacement and link safety. Adapted from xcl-dev#2614. Locally cross-checked with the GNU Windows target; Windows filesystem tests and execution remain untested here. Assisted-by: Codex (GPT-5.6-sol)
Capture and persist the exact successful uncached pipeline result whose driver build crossed the slow threshold, even when bounded RAM-cache admission fails. Same-key builders reserve capture/publication, and disk-path turns prevent distinct RAM identities from racing one pathname. Publish disk before RAM visibility, remember cap-refused persisted keys, clear that marker on cached-blob rejection, and preserve exact-generation invalidation plus AMD default-off policy. Adapted from xcl-dev#2574 after prerequisites xcl-dev#2577 and xcl-dev#2614. Locally cross-checked with the GNU Windows target; Windows filesystem and driver execution remain untested here. Assisted-by: Codex (GPT-5.6-sol)
Retain the Windows file handle used to read each persisted driver blob. If the driver or offline precompiler rejects it, dispose that exact file object rather than a pathname another process may already have replaced. Open entries with read/delete sharing and OPEN_REPARSE_POINT, falling back to read-only and failing closed when exact-object deletion is unavailable. Preserve cache-I/O stall attribution and cover cross-process replacement and link safety. Adapted from xcl-dev#2614. Locally cross-checked with the GNU Windows target; Windows filesystem tests and execution remain untested here. Assisted-by: Codex (GPT-5.6-sol)
Capture and persist the exact successful uncached pipeline result whose driver build crossed the slow threshold, even when bounded RAM-cache admission fails. Same-key builders reserve capture/publication, and disk-path turns prevent distinct RAM identities from racing one pathname. Publish disk before RAM visibility, remember cap-refused persisted keys, clear that marker on cached-blob rejection, and preserve exact-generation invalidation plus AMD default-off policy. Adapted from xcl-dev#2574 after prerequisites xcl-dev#2577 and xcl-dev#2614. Locally cross-checked with the GNU Windows target; Windows filesystem and driver execution remain untested here. Assisted-by: Codex (GPT-5.6-sol)
Retain the Windows file handle used to read each persisted driver blob. If the driver or offline precompiler rejects it, dispose that exact file object rather than a pathname another process may already have replaced. Open entries with read/delete sharing and OPEN_REPARSE_POINT, falling back to read-only and failing closed when exact-object deletion is unavailable. Preserve cache-I/O stall attribution and cover cross-process replacement and link safety. Adapted from xcl-dev#2614. Locally cross-checked with the GNU Windows target; Windows filesystem tests and execution remain untested here. Assisted-by: Codex (GPT-5.6-sol)
Capture and persist the exact successful uncached pipeline result whose driver build crossed the slow threshold, even when bounded RAM-cache admission fails. Same-key builders reserve capture/publication, and disk-path turns prevent distinct RAM identities from racing one pathname. Publish disk before RAM visibility, remember cap-refused persisted keys, clear that marker on cached-blob rejection, and preserve exact-generation invalidation plus AMD default-off policy. Adapted from xcl-dev#2574 after prerequisites xcl-dev#2577 and xcl-dev#2614. Locally cross-checked with the GNU Windows target; Windows filesystem and driver execution remain untested here. Assisted-by: Codex (GPT-5.6-sol)
Retain the Windows file handle used to read each persisted driver blob. If the driver or offline precompiler rejects it, dispose that exact file object rather than a pathname another process may already have replaced. Open entries with read/delete sharing and OPEN_REPARSE_POINT, falling back to read-only and failing closed when exact-object deletion is unavailable. Preserve cache-I/O stall attribution and cover cross-process replacement and link safety. Adapted from xcl-dev#2614. Locally cross-checked with the GNU Windows target; Windows filesystem tests and execution remain untested here. Assisted-by: Codex (GPT-5.6-sol)
Capture and persist the exact successful uncached pipeline result whose driver build crossed the slow threshold, even when bounded RAM-cache admission fails. Same-key builders reserve capture/publication, and disk-path turns prevent distinct RAM identities from racing one pathname. Publish disk before RAM visibility, remember cap-refused persisted keys, clear that marker on cached-blob rejection, and preserve exact-generation invalidation plus AMD default-off policy. Adapted from xcl-dev#2574 after prerequisites xcl-dev#2577 and xcl-dev#2614. Locally cross-checked with the GNU Windows target; Windows filesystem and driver execution remain untested here. Assisted-by: Codex (GPT-5.6-sol)
|
I moved this PR back to draft while I address the Wine open-handle concern. On the current head The existing Windows GPU suite and paired title smoke remain valid results for AI-assisted source review: OpenAI Codex, including a GPT-6.2 Sol agent. |
Keep the handle that supplied each on-disk PSO blob through the native creation call. A refusal now disposes that exact file object, so an older reader cannot remove a replacement published at the same path. Fixes xcl-dev#2601 Assisted-by: OpenAI Codex (GPT-6.2 Astra, Ultra reasoning)
Exercise the cross-process case with a direct publication over the old file generation, including byte-identical payloads. This tightens the regression from mokkamokacaffe/xcl@06d0868. Assisted-by: OpenAI Codex (GPT-6; exact serving variant unavailable)
Wine refuses replacement while the old cache generation stays open. Invalidate that exact generation before retrying, as the over-cap branch does, so the retry can publish a fresh blob. Assisted-by: OpenAI Codex (GPT-6.2 Sol)
Retain the disk handle alongside the shared PSO bytes and discard a refused generation before the cold retry. A refused RAM blob has no disk-generation identity, so evict only the same RAM entry.
8927d18 to
d50210a
Compare
Fixes #2601. A driver can reject a cached blob after another process replaces the same path. A pathname delete then removes the replacement, even if both generations have identical bytes. Keep the handle that supplied the old blob through PSO creation and invalidate that file object on refusal.
What is in it
crates/xcl/src/hle/d3d12x/real.rs: retain the exact opened file generation and dispose that handle on runtime refusal; a cross-process regression directly replaces a still-open blob with identical bytes. On the current main's two-pass mesh path, retain the loaded disk generation through the driver call and invalidate it before a refused cold retry; a RAM hit evicts only the matching RAM entry.crates/xcl/src/shaders.rs: retain and invalidate the same file generation for an offline over-cap refusal; on a refused under-cap blob, release and invalidate that generation before an uncached retry so Wine can publish a replacement.Tested
d50210a8on main83b00818:cargo build --locked -p xcl -j 1passed.cargo test --locked -p xcl --lib -j 1 hle::d3d12x::real:: -- --nocapturepassed 65 tests, 0 failed, 0 ignored, 0 explicit SKIPPED (1,293 filtered). This includes the exact-file cache tests, graphics rejection/retry, five two-pass identity tests and a real RX 6800M mesh passthrough test. The corresponding unpatched GitHub merge failed to compile at the graphics cache call sites.git diff --checkand the worktree are clean. This is focused validation, not a full GPU workspace suite or retail title run.8927d18f: a cap-disabled stale-blob regression failed with the test-only addition on previous headcd7be10fand passed with the fix.cargo test -p xcl --lib driver_cache::tests -- --nocapture: 6 passed, 0 failed;cargo test -p xcl --lib pipeline_cap_tests -- --nocapture --test-threads=1: 3 passed, 0 failed. The pipeline-cap group also passed five parallel reruns after one initial split-cache reuse failure; the split test passed in isolation. These are focused Windows tests, not a Wine run or completed GPU suite.8927d18ftests and oldercd7be10fbuild, workspace, and retail results below are historical; they do not validate current headd50210a8.cargo build --locked --workspace -j 1: passed.943947c: a new identical-byte replacement regression failed 0 passed, 1 failed, showing that the replacement was deleted. This draft revision uses the exact file handle instead.cargo test --locked -p xcl --lib -j 1 hle::d3d12x::real::driver_cache::tests -- --test-threads=1 --show-output: 6 passed, 0 failed, 0 ignored, 1332 filtered. The direct cross-process, identical-byte replacement test passed separately (1 passed, 0 failed).cargo test --locked -p xcl --test gpu_compute_e2e -j 1 -- --test-threads=1 --show-output: 7 passed, 0 failed, 0 ignored; one test reportedSKIPPEDfor unavailable heap windows.XCL_ADAPTER=nomatchwithcargo test --locked --workspace --no-fail-fast -j 1 -- --test-threads=1 --show-output: 37 target summaries, 1437 passed, 0 failed, 47 ignored. The log contains 138 standaloneSKIPPEDnotices, many repeated subcases, and more inline skip notices; adapter-dependent GPU cases are not coverage. No complete RX 6800M suite is claimed.cbc165f, which has the same source tree as the previous headcd7be10,XCL_ADAPTER=6800M XCL_REQUIRE_GPU=1with the same workspace command stopped in the library test process atgpu::dxil::core_tests::raw_loads_in_root_windows_respect_exec_and_boundswith0xc0000005(STATUS_ACCESS_VIOLATION), before a library summary. The--no-fail-fastintegration targets continued, includinggpu_compute_e2eat 7 passed / 0 failed. A prior clean-main control on this RX 6800M crashed in the same focused raw-load test; I have not rerun that control onb49be18.cd7be10on an RTX 5070 Ti and an AMD Ryzen 7 9800X3D iGPU. With explicitly listed exclusions for tests that also fail on main on those systems, the NVIDIA workspace run reported 1,425 passed, 0 failed, 45 ignored; the AMD iGPU run reported 1,436 passed, 0 failed, 47 ignored. The new blob-replacement tests passed. These were debug test runs, not game runs. Independent report with hardware, exclusions and SKIPPED notices.cargo test --workspace --no-fail-fast -- --test-threads=4: 1,437 passed, 0 failed, 47 ignored, 25 explicit GPU skips (native wave64 and refused per-lane forms). All sixdriver_cachetests passed, and the six-test group passed 30 of 30 parallel reruns at eight test threads. These are the independent reporter's results, not runs on our RX 6800M.Regression run
A paired main/current-head retail run is pending for
d50210a8; the pluggable SSD containing the owned title is not mounted. The blocks below were collected on the previous headcd7be10fand do not validate the current code.Guarded 30-second debug builds on the owned title, same RX 6800M and fresh per-run cache/data. The previous head showed 315/385 frames (81.8% of main) and 8267/8284 MB peak commit (99.8% of main). Both exited normally with no device removal or crash.
main:
PR:
Not tested
AI use
bb54f23; my follow-up commitcd7be10strengthens the child-process replacement test. OpenAI Codex (GPT-6; exact serving variant unavailable), with Luna subagents, adapted that test, reviewed the code, ran the stated checks, and prepared this description.8927d18f. The same model rebased the PR ontomain83b00818, fixed the two-pass graphics cache integration, and ran the current-head focused build and tests; Codex reviewed the diff and updated this description.