fix(cache): replace entries while Windows readers retain old files #3660
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3660"
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 Celegans12 on 2026-10-11T15:01:26Z.
What
On Windows, publishing a replacement cache entry fails while a delete-sharing reader retains the old file.
WriteFileAtomicallynow uses the extended POSIX rename operation: existing readers keep the original bytes, while new opens see the replacement.The temporary rename handle closes before returning. Unsupported-operation errors retain the existing filesystem-rename fallback; other failures remove the temporary file and return false. The cache format and entry contents are unchanged.
The existing disk-cache test now retains old and replacement readers, checks exact contents across replacement and deletion, and verifies temporary-file cleanup. Windows uses native delete-sharing handles; POSIX uses file streams.
Tested
Based on
maina11c8f7f. Windows 11/MinGW-w64 GCC 15.2.0, -DBUILD_TESTING=ON; both OS builds, registration and libraries pass.agc_shader_disk_cachefails on main on Windows, then passes 1/1 (0.14 s); Linux passes 1/1 (0.11 s), exercising its unchanged path, not a Linux RED.Windows failures:
guest_kernel_sys,windows_exceptions,agc_driver_emulated_color_compare,guest_filesystem; all match main1e8fff68, whose core/tests equala11c8f7f.Linux
agc_driver_depth_compare_copyfails unchanged write-watch admission;agc_driver_emulated_color_comparematches exact main1e8fff68.agc_driver_image_plane_address_on_line_implicit_lodandguest_kernel_stack_protecthave historical0f863c10controls only, not exact-a11c8f7f proof. Unexpectedagc_write_trackingskip remains. Full suites remain failed.Not tested: unsupported-filesystem fallback, title behavior.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T21:44:21Z.
Checked the diff (
FILE_RENAME_INFOlayout assert,FileRenameInfoExclass 22, replace + POSIX flags, handle closed before return, fallback only on unsupported-operation errors, temp file removed on other failures) and ran build + ctest for libSceAgc/libSceAgcDriver on Linux (404/404,agc_shader_disk_cachepasses). The Windows path itself relies on your Windows run; merging.