test(agc): wait for the tested surface's pending image #6744
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6744"
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 Ondra97 on 2026-10-16T09:09:30Z.
What
Fixes #6735.
HoldPendingaccepted any pending storage image while waiting for the tested surface's store. A pending image left by an earlier case could makeSettleflush before this store created an image, soUntrackedRepeatintermittently failed atthe sampled surface has no live storage image. On the original base, a test-only diagnostic found 37 of 44 accepted waits with neither a live nor a pending image for the tested surface; the reported assertion occurred in that campaign. The shared wait now requires the image pending at the exact surface address and size to be the same live image. The result and CPU-write assertions remain in place.The separate
agc_driver_store_pending_identityCTest mode makes one live surface image pending under the GPU mutex, checks thatHoldPendingaccepts it with the lock held, then verifies that the same helper rejects a completed second surface while the first image remains pending. It deterministically covers the predicate without changing the default fixture. The test was cherry-picked from @Amoenus's 37e57bb1 as90b191e5b, preserving the original commit author.#6359 corrects
RunSecondStore's separate wait; #6385 correctsNeighbourCopied's separate wait. Neither changesHoldPending. Their current versions composed cleanly with the original fix in a local integration check.Tested
Current base
332b0b1b79feb39a6e5fc5d4e4a5dfe4491d27b5, submitted headbf1ea515ebb6be3cd2c67ed135079f21532cbbd3. The original issue reproduction used base5d9dcc42d2ec5401aebd089028b8d4d7410a77b4; the first fix head wasbf861be946edd839a3ccbe1c6d0d42262ac8f57f.Windows (native host): Windows 11 Pro build 26300, AMD Ryzen 9 7900X, WinLibs GCC 15.2.0, Release, NVIDIA GeForce RTX 4070 Ti SUPER, driver 617.42. The GPU runs set
ANYPS5_REQUIRE_VULKAN=1; CTest setsANYPS5_NO_SHADER_CACHE=1. The selected physical NVIDIA device was confirmed in verbose output.90b191e5b)90b191e5b)agc_driver_store_pending_identity, fresh processesthe wait accepted another surface's pending imageThe comparison uses the same test source and build settings with only the
HoldPendingpredicate temporarily reversed; that reversal was removed. It verifies the test's regression signal, not title behavior or performance. On the final merged headbf1ea515e, the new CTest mode passed another 5/5 fresh processes andagc_driver_store_over_untrackedpassed 5/5; zero CTest skips. Four existing internal write-watch cases still printednot run, the surface is not write-watchedin a verbose original-fixture run and are not claimed as covered. Each new-mode run finished well under the 30-second project limit.The complete Windows app/libs build of the final head plus #6452's exact test-only alignment correction passed. That correction was applied only for the full build and removed; it is absent from this PR. The new fixture target also built on the exact clean head.
python tools/check_conventions.py --base origin/main,python tools/check_test_registration.py ../buildandgit diff --check origin/main...HEADpassed. The submitted diff changes onlyCMakeLists.txtandStoreOverUntracked.cpp.On the earlier
bf861be9fix head, the original fixture passed 100/100 serial fresh processes and 10/10 after rebuilding that exact commit. The four related CTests passed 4/4; a separatewatchrepeat passed 10/10 with the same internal omissions. A local integration of that earlier head with #6359 and #6385 passed 20/20 fresh GPU processes. These earlier runs were not repeated on the final merged head.Linux (VirtualBox VM): Ubuntu 24.04.5 LTS, kernel 7.0.0-31-generic, GCC 13.3, VirtualBox 7.2.20, Windows 11 Pro host; graphics not exercised. On the earlier
bf861be9head, the full build and fixture executable build passed, and three non-graphics tests (agc_write_watch_coverage,texture_format_lookup,guest_memory) passed with no skips. The finalbf1ea515ehead was not built or tested in this VM: guestcontrol access and source transfer were unavailable while the VM had no network route. Linux graphics/Vulkan tests: NOT RUN — intentionally excluded from VirtualBox VM validation. Native/bare-metal Linux was not tested. Native Linux GPU validation: not tested.Separately, @Amoenus reported 5/5 expected failures with the old predicate and 5/5 passes with the new test on Windows RTX 5080, Windows Radeon Graphics and Ubuntu WSL lavapipe, using the pre-merge
bf861be9fix head. Those are contributor results, not my local runs or validation of the final merged head.No title or homebrew was run. The full CTest suite was not run.
Checklist
main(332b0b1b7merged into the head); no other open PR changes this shared waitImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-16T09:34:14Z.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
core/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/execution/StoreOverUntracked.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/execution/StoreOverUntracked.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtImported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-16T09:43:31Z.
Adopted: Ondra97 carried the test into #6744 with authorship preserved (confirmation). I verified final head
bf1ea515eis exactly our tested patch plus main332; the wait fixture is byte-identical. The upstream delta only changes logging outside the wait contract, so I retained the original test pins below and approved the rebased source without repeating the full matrix.Independent regression and cross-vendor validation for this fix. I reached the same exact-live/pending predicate while investigating #6735; I will use this PR rather than open a duplicate.
Test-only proposal: 37e57bb1, directly on your unchanged
bf861be9head. It adds the isolatedagc_driver_store_pending_identityCTest mode, without changing your predicate. It is available to cherry-pick if useful.The test creates a real stored surface, marks its retained live image pending under the GPU mutex, and verifies that the helper accepts that image with the lock held. It then tests a separate, already-completed surface with no live/pending image while the first surface remains pending. That wait must return false. Cleanup flushes the pending image before either allocation is destroyed; the default fixture does not run this setup.
5d9dcc42+ test only (96ac7201)37e57bb1)Every negative control reached
the wait accepted another surface's pending image, after passing setup and own-image checks. Every process verified both device selections; no CTest skips. Windows 11 Enterprise 10.0.26200, GCC 15.2.0 r7: NVIDIA RTX 508010de:2c02, driver 610.62 / 32.0.16.1062; AMD Radeon(TM) Graphics1002:13c0, driver 32.0.21036.18. Ubuntu 24.04 WSL, GCC 13.3, Mesa 25.2.8 llvmpipe10005:0000. Project shader cache disabled, driver caches uncontrolled. Selected target rebuilt separately on Windows and Linux; conventions, registration and diff checks passed. Cppcheck and clang-tidy found no selected diagnostics on the proposal.This deterministically verifies the helper contract; it does not independently reproduce your 37/44 diagnostic campaign or establish a title improvement. Your main reproduction and diagnostic connect it to the intermittent #6735 failure. These new runs cover the isolated mode, not a fresh full application build or full suite. Existing full-fixture write-watch omissions remain unclaimed.
AI-assisted: Codex; locally built and tested.
Imported from boykopovar/AnyPS5. Originally posted by Ondra97 on 2026-10-16T10:12:34Z.
@Amoenus Thank you for the independent validation and focused test. I cherry-picked
37e57bb1as90b191e5b, preserving your authorship, and updated #6744 (headbf1ea515e). On Windows 11 Pro / RTX 4070 Ti SUPER (617.42), the new test failed at the intended assertion with the old predicate and passed 5/5 on the final head; the original fixture also passed 5/5. The full Windows build passed with #6452 temporarily applied and then removed. I could not build the new head in Linux (VirtualBox VM) because source transfer was unavailable; the PR description attributes your cross-vendor and WSL/lavapipe results separately. AI-assisted: yes — Codex.Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-16T10:39:29Z.
Review: APPROVED
Reviewed
bf1ea515eb. Its complete tree matches the previously validated test/fix at 37e57bb1 merged with main332; the wait fixture is byte-identical. The upstream delta changes logging, not the pending-image lookup or helper contract, so I did not repeat the full matrix solely for that rebase.Our deterministic controls failed 5/5 on each of RTX 5080, Radeon Graphics and Linux lavapipe with the old predicate; the proposed test/fix passed 5/5 on each. The author has separately retested the final head on RTX 4070 Ti SUPER. Earlier evidence retains its original pins: https://github.com/boykopovar/AnyPS5/pull/6744#issuecomment-6212721822.
The exact live/pending identity, completion exit, held-lock contract and allocation lifetime look correct. No title improvement or fresh full-suite run is claimed. AI-assisted: Codex.