fix(agc): tolerate mapping changes during committed snapshots #10498
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10498"
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 dotaku22 on 2026-10-24T04:30:56Z.
What
Build on merged #10575's shared
visitReadablePageshelper rather than adding a second checked-read implementation. A failed Windows committed read now invalidates cached page states and re-queries each page before retrying, excluding guard/no-access pages. Expected mapping-race errors recover; unexpected errors throw. Copies zero inaccessible bytes and comparisons ignore them, retaining #10575's semantics. Linux is unchanged.The Windows-only regression covers no-access/guard pages, surrounding readable bytes, stale-cache invalidation, both copy and comparison paths, guard preservation, and 500 snapshots during concurrent protection changes. Snapshots are not atomic with respect to guest writes.
Tested
Rebased onto
cccdaa2734after #10575 merged. Windows 11 build 26200; NVIDIA GeForce RTX 5070 Ti, NVIDIA 610.88; GCC 15.2 Release.ctest --test-dir build -R '^(agc_driver_committed_read_mapping|agc_driver_graphics)$' -Vagc_driver_graphicspasses (including #10575's released-page copy/comparison regression);agc_driver_committed_read_mappingfails withfailed snapshot retained stale readable page states.ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, SDK 1.4.363.0 viaVK_LAYER_PATH, implicit layers disabled. Both verbose logs confirm the validation layer loaded; neither has missing-layer messages orVUID-errors.python tools/check_conventions.py --base origin/main: passes.Linux, macOS, other GPUs and gameplay on this rebased head were not tested. Earlier combined Demon's Souls runs are not evidence for this exact revision.
The local overlap check lists only this PR itself as confirmed overlap. Several other branches conflict with main and could not be compared automatically; this is not a guarantee that those branches have no overlap.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-24T04:42:52Z.
Review: CHANGES_REQUESTED
Thanks, the Windows fix looks right and the test targets the crash. One thing blocks it:
core/libs/prx/libSceAgcDriver/tests/execution/CommittedReadMapping.cpp:96-98: on Linux the test returnsVulkanTestSkippedwithout printing a reason. The Linux job runstools/check_skips.pyon the junit and fails any skip whose reason doesn't matchDEVICE_LIMITATION, so this would turn the Linux Build red ("skipped for a reason that is not expected"). Print askipped, ...line for the Windows-only case and makecheck_skips.pyaccept that reason for the linux job (or register the test only on Windows), so the Linux job doesn't lose coverage silently.Everything else in the diff checked out (no comments in code, registered through the
tests/executionglob, unexpected errors still throw).Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T11:21:45Z.
Review: DISMISSED
The Windows recovery path is carefully bounded: it invalidates stale page-state entries, zeros the destination, then re-queries and reads each page so stable readable bytes survive while guard/no-access bytes remain zero. The new test covers both no-access and guard pages, surrounding bytes, and concurrent protection changes. I also confirmed the current CMake change registers this GPU regression only on Windows, addressing the Linux skip concern from the earlier review. The author reports focused Windows validation-layer tests passing; hosted build jobs skipped, and I did not rerun them locally.
One merge-order blocker remains: #10575 is open and changes the same GuestMemory read path with ReadProcessMemory for released-page races. The overlap bot identifies exact shared lines, and this PR currently says Depends on: none. Please coordinate with #10575's author on whether this mapping/protection fix is layered after their released-page fix, then declare the agreed order here. The two regressions cover different failure modes, but the implementation overlap needs an explicit merge sequence under CONTRIBUTING.
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-26T18:31:35Z.
Review: CHANGES_REQUESTED
The Linux skip point is resolved:
CommittedReadMappingis now only registered on Windows (core/libs/prx/libSceAgcDriver/CMakeLists.txt:2178), so the Linux job loses nothing andcheck_skips.pyis not involved.One blocker left, the one @MarcZX10 raised:
GuestMemory.cppcommitted-read path (ReadProcessMemory, released-page races) and this PR still saysDepends on: none. You and @Mouhand-Kaddo agreed on #10575 first, then this PR rebased onto it with the shared checked-read helper consolidated. Please setDepends on: #10575in the body, and once #10575 merges, rebase and foldcopyCommittedRuninto its helper, keeping the protection-change regression and the unexpected-error handling.