Windows SMB: shader disk-cache retained-reader replacement fails; local NTFS passes #10833
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-25T03:36:14Z.
Resolved on main via #11434, merge
a453b29ebe4b. The selected contract is now in main: atomic production replacement semantics remain; affected retained-reader/mapped-replacement test subcases are omitted only when the filesystem POSIX-rename probe reports error87, and the SMB limitation is documented. This does not add atomic SMB replacement support. Our original real-NAS reproduction remains historical; we have not independently retested the merged change on that NAS. AI-assisted report maintenance: yes (Codex).Maintainer decision and existing candidate — 26 October 2026
MarcZX10 selected option 1: retain atomic production replacement semantics, document the SMB limitation, and omit only retained-reader replacement assertions when the POSIX rename probe specifically returns
ERROR_INVALID_PARAMETER(87). Other replacement failures must remain failures. The rename-aside approach is not accepted because it introduces a missing-path window.Existing candidate: #11434 by @LeandroLP23, reviewed here at head
b95b22cf162225e99d1cb88735e946c32757adc6. Its source extracts the existing Windows POSIX rename operation, checks error 87 in a synthetic filesystem probe, records the limitation, and conditionally omits affected mapped/retained-reader replacement subcases. This is partial subcase coverage, not a claim that SMB supports atomic replacement or that every assertion ran. The patch also corrects extended UNC test paths. We are tracking that contribution rather than implementing a duplicate.The author's reported NTFS/loopback-SMB runs and GPU cache checks are in #11434; they are independent evidence, not runs performed by us. Our real-NAS reproduction below remains source-pinned historical evidence; we have not independently qualified this candidate on that NAS. Keep this issue open until the accepted change is merged and its remaining scope is clear. The unrelated long-path report #7452 has been closed after its own focused verification.
AI-assisted report maintenance: yes (Codex).
Previous evidence and source-pinned history
What happens
agc_shader_disk_cachefails withcannot replace cache entry with a retained readerwhen its temporary directory is on the tested Windows-mapped NAS share. The same executable passes when onlyTEMP/TMPare changed to local NTFS storage.Title, test or build step
CPU-only CTest
agc_shader_disk_cache, specificallyverifyAtomicReplacement. No game dump or GPU is needed.AnyPS5 commit
Executed integration:
29a63ec975692203def21882bfd3f279639bea16, based on mainbd8e13428a10d9332c2911816ab672ea1b41418f, with our retained Sonic integration changes. This is not an execution of unchanged main.The complete production
ShaderCacheDirectory.hppis byte-identical to checked main390e44c7893c386cec76834152d54570c15df318(Git blob9b3893ce2a3d1c403550368f3ce132dfac0550c2). TheverifyAtomicReplacementfunction also matches the integration's base main. A separate minimal program including the actual production header reproduces the difference with synthetic three-/four-byte entries; no AnyPS5 replacement runtime libraries are linked into that probe.System
Windows 11 Enterprise, build 26200; WinLibs MinGW-w64 GCC 15.2.0/UCRT r7. One local NTFS directory and one writable NAS share mapped as
P:. Exact server/filesystem feature support and the failing Windows API/error code have not been determined. GPU/driver: not exercised by this CPU-only check.Steps to reproduce
Build the real
agc_shader_disk_cache_teststarget with testing enabled. Use existing writable short temporary directories on the two storage locations, and run from the same shell against the same build:The executable and build remain unchanged between runs. The failing case completes in 0.56 seconds, within the 30-second CTest timeout. This is the ordinary cache test, not its optional large-file case.
Log
What was checked
The probe opens the retained reader with
GENERIC_READandFILE_SHARE_READ | FILE_SHARE_DELETE, matching the fixture, then callsWriteFileAtomicallyto replace the existing entry. It preserves the original reader and independently reads the published path. No corruption was observed.CTest executable SHA-256 before/after the storage control:
e637cddb5cabb3497e7e635c7b0fbed660698dbc6947de1f497fb940d59e5467.Related merged #3660 introduced the retained-reader replacement behavior and explicitly did not test the unsupported-filesystem fallback. #5552 concerns delete sharing. Open #7452 concerns long paths; this report uses short paths and isolates replacement while a reader remains open. Searches for the exact error,
WriteFileAtomically,FileRenameInfoEx, retained readers, NTFS/SMB and cache replacement found no matching open report.This establishes a compatibility/test limitation on the tested share, not a general claim that every SMB server fails, a regression introduction, a Sonic startup blocker, or an FPS effect. A local NTFS temporary/cache directory passes this check. It remains to establish the underlying API failure and whether network-filesystem cache replacement should be supported or explicitly documented as unsupported; no non-atomic replacement or relaxed assertion is proposed.
AI-assisted: yes (Codex).