test(agc): run the second-store case on a surface that was never watched #22764
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/22764"
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 DerKarussellbremser on 2026-11-18T07:49:44Z.
What
agc_driver_store_over_untrackedfails intermittently on Windows in its "a second store over a surface outside the write watch" case withthe store left no saved guest bytes(#22670). The cause is the test's fixture, not a lost store.RunSecondStoreallocated its surface in the guest write-watch arena, took it out of the watch withGuestMemory::Unwatchand then required the first store to leave saved guest bytes. On Windows the host import that the store makes over the surface is settled, andrewatchSettledImportsputs the range back under the write watch. When that happens before the first store's write-back, the write-back sees watched memory and keeps no saved bytes (GuestMemory::Watched(firstStored, ...) ? {} : prepareStoredSave(...)inwriteBackLayers), and the case reportedOutcome::Lost.The case now uses a surface that is never in the write-watch arena (
Surface surface;, the fixture's existing unwatched constructor), requires it to be outside the watch at the start and again after the first store, and keeps every check after that: the saved bytes, the CPU's page surviving the second store, and the second result reaching the block the CPU left alone. The driver is unchanged.This fixture is the one @thalesdot1dot1 posted in #22670; the commit carries them as co-author. It replaces my first version of this PR, which let a surface that was watched again skip the saved-bytes check. As @u-instinct11 measured on Intel, that version skipped it in 98 of 300 runs, and on this machine in 21 of 40, so it no longer tested the unwatched second store it is named for.
Tested
Windows 11 Home 10.0.26200, Intel i7-10750H, NVIDIA GeForce RTX 2060 (driver 610.91), WinLibs GCC 15.2.0 r7, Release,
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1,ctest -R ^agc_driver_store_over_untracked$, built frommaind50640e264:mainthe store left no saved guest bytesWith this change none of the 30 runs printed a line for the second-store case, so each ran it to the end with saved bytes and
lost 0.Earlier measurements on this machine (local trace lines, not part of this PR): in all 9 failing traced runs on
mainrewatchSettledImportscovered the surface between the test'sUnwatchand the first write-back.Not tested, and limits:
not run, the surface is not write-watchedon Windows (second part of #22670) are not touched.python tools/check_conventions.py --base origin/mainpasses.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)🤖 Generated with Claude Code
https://claude.ai/code/session_011TXsSW8zeAgKgHLCFsYwM3
Imported from boykopovar/AnyPS5. Originally posted by Ethan-Hainline on 2026-11-19T00:11:44Z.
Review: COMMENTED
Reviewed and verified on Windows 11, Ryzen 5 7530U (Radeon Vega 8 iGPU), MinGW-w64 GCC 16.2.0 UCRT, Release, Vulkan available:
A/B on current
main168921678fagc_driver_store_over_untracked_testsfailed 1 of 3 runs with exactlya second store over a surface outside the write watch: the store left no saved guest bytes, so #22670 reproduces here.d1aaf844ddapplied: 10 of 10 runs passed.Other checks
AgcDriver::GuestMemory::Watched(address, SurfaceBytes)exists with that signature; reading it inside the sameGpuMutexcritical section asGuestSnapshotValid()matches howsettleUnwatchedImportsandrewatchSettledImportsuse it, so the decision is coherent.Not a blocker from me; the patch fixes the reproduced failure without weakening the assertions that still apply.
AI-assisted.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-19T00:51:54Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the optional points below are informational.
What I ran
Reviewed head
d1aaf844dd53b545b6d07c922bf5b311944c6cc9. No commands or tests were run; I inspected the prepared diff and pinned source through the repository reader.Results
Findings
Blocking
None.
Non-blocking
RunSecondStorenow accepts a rewatched surface and carries on to its second-store assertions. That addresses the reported timing-dependent early failure while retaining the saved-bytes requirement when the surface remains unwatched. The PR description also clarifies that the second store’s result and CPU-written page are checked in the rewatched path.Not verified
RunSecondStorelogic, the relatedGuestMemory::Watchedimplementation, and the adjacent fixture function.review/description.md,review/commits.md,review/manifest.json,review/diff.patch, andcore/libs/prx/libSceAgcDriver/tests/execution/StoreOverUntracked.cppranges 270–390 were read. No files were excluded by the manifest.To get this to a good state
Nothing is required. The optional point above is informational.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T03:53:39Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the test now allocates an unwatched surface and checks that the write watch remains absent after the first store, while retaining its saved-byte and second-store assertions.
What I ran
Reviewed head
5503a0cbff3d3cf44f63b62c8c3c9ea69bde66b2usingrepo_read.pyto read the supplied review materials and the changed source. No commands or tests were run.Files read:
description.md,commits.md,manifest.json,diff.patch, andcore/libs/prx/libSceAgcDriver/tests/execution/StoreOverUntracked.cpp(lines 1–25 and 260–355). The manifest lists one reviewed file, and its full text was available. No files were excluded by the manifest.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
No tests or conventions checks were run. The author reports Windows runs and a conventions check in the description; these results were not independently verified. Linux, macOS, and full-suite behavior were not verified.
To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by throny on 2026-11-22T01:04:48Z.
Review: APPROVED
Approving per the review above.
AI-assisted review (Claude Code)