Repository navigation
D3D12-PIPELINE-CACHE-CONCURRENT-PUBLISH: tolerate Windows AccessDenied on concurrent cache publish - #2674
Conversation
|
Independent Windows cache publication test. I used I added a local probe with eight real writer threads per round. All eight first miss the key. One publishes, and a reader opens that hit with One diff/description mismatch: the recovery guard currently accepts any rename error when AI-assisted with OpenAI Codex (GPT-6.2 Sol). |
|
Thanks for the independent 8-writer probe and for catching the description mismatch, @ecox982745! Updated the PR description to accurately reflect that the guard recovers on any rename error when AI-assisted: Antigravity (Gemini 4 Neon) |
59399da to
be2a1ab
Compare
Cross-process publication and retry on the current headMEASURED. I tested
The open reader saw the expected 32,768 bytes before and after the second writer's attempt. The cache shard contained exactly one entry after every publish attempt and retry. In the directory case the failed attempt left only the directory entry, and retry after removing it left just the expected file. A further lookup reused that file without calling the converter again. Stock Scope: synthetic temporary files and Windows file-sharing semantics under Wine. AI-assisted: Codex (GPT-6.2 Sol). |
|
RUN - native Windows red/green (Verified by OreoFR) - Intel Core Ultra 7 155H, Windows 11 Pro 10.0.26300, CPU only.
Result: PASS
Not covered:
This run was AI-assisted (Claude Code, oreofr-agent). |
|
Native Windows cross-process verification. I checked Two separate publisher processes entered the converter after missing the same key. Each case ran 12 times per tree.
The published output always matched all 32,768 expected bytes. In the directory case the shard contained just the directory after the failed attempt. In all cases it contained just the published file after success, and the next lookup returned it without converting again. Stock library tests passed 7/7 on the base and 8/8 with the PR. Synthetic file I/O only. AI-assisted with OpenAI Codex (GPT-6.2 Sol). |
|
RUN · VERIFY-2674-RTX4060 · by MoonEyes (another person than the author) on head
AI-assisted (Claude Code). |
|
Merging. Head AI-assisted (Claude Code). |
Claimed in #2570 as
D3D12-PIPELINE-CACHE-CONCURRENT-PUBLISH(#issuecomment-7261030254).What and why
In
d3d12/crates/leonida-pipeline/src/cache.rs,get_or_convert()stages a converted asset into a temporary file and publishes it viastd::fs::rename(&tmp, &path). On Windows, when another thread/process concurrently publishes or holds&pathopen withoutFILE_SHARE_DELETE,std::fs::renamefails withERROR_ACCESS_DENIED(os error 5/ErrorKind::PermissionDenied). Currentlyget_or_convert()removes&tmpand propagates that error even though&pathis already published on disk.This change cleans up
&tmpand returnsOk(path)wheneverstd::fs::rename(&tmp, &path)fails andpath.is_file()is already true (a peer won the race), while continuing to propagate errors when&pathis not present as a file on disk.Verification (Red -> Green)
Hardware / OS: native Windows 11 Pro (
10.0.26200), AMD Ryzen 7 7800X3D, Rust1.98.concurrent_publish_while_reader_holds_destination_succeeds_and_cleans_stagingfailed withOs { code: 5, kind: PermissionDenied, message: "Access is denied." }.main40e7fe69d):cargo test -p leonida-pipeline --lib—8 passed; 0 failed.python -I scripts/check_no_game_data.py d3d12/crates/leonida-pipeline/src/cache.rs— PASS.AI-assisted: Antigravity (Gemini 4 Neon)