Skip to content

test(agc): wait for the tested surface's pending image - #6744

Merged
oneandonlydean merged 3 commits into
boykopovar:mainfrom
Ondra97:codex/fix-store-untracked-lifetime
Oct 17, 2026
Merged

oneandonlydean merged 3 commits into
boykopovar:mainfrom
Ondra97:codex/fix-store-untracked-lifetime

Conversation

@Ondra97

@Ondra97 Ondra97 commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

What

Fixes #6735. HoldPending accepted any pending storage image while waiting for the tested surface's store. A pending image left by an earlier case could make Settle flush before this store created an image, so UntrackedRepeat intermittently failed at the 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_identity CTest mode makes one live surface image pending under the GPU mutex, checks that HoldPending accepts 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 as 90b191e5b, preserving the original commit author.

#6359 corrects RunSecondStore's separate wait; #6385 corrects NeighbourCopied's separate wait. Neither changes HoldPending. Their current versions composed cleanly with the original fix in a local integration check.

Tested

Current base 332b0b1b79feb39a6e5fc5d4e4a5dfe4491d27b5, submitted head bf1ea515ebb6be3cd2c67ed135079f21532cbbd3. The original issue reproduction used base 5d9dcc42d2ec5401aebd089028b8d4d7410a77b4; the first fix head was bf861be946edd839a3ccbe1c6d0d42262ac8f57f.

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 sets ANYPS5_NO_SHADER_CACHE=1. The selected physical NVIDIA device was confirmed in verbose output.

Metric Before (old predicate, test-only reversal on 90b191e5b) After (90b191e5b)
agc_driver_store_pending_identity, fresh processes 1/1 failed at the wait accepted another surface's pending image 5/5 passed

The comparison uses the same test source and build settings with only the HoldPending predicate temporarily reversed; that reversal was removed. It verifies the test's regression signal, not title behavior or performance. On the final merged head bf1ea515e, the new CTest mode passed another 5/5 fresh processes and agc_driver_store_over_untracked passed 5/5; zero CTest skips. Four existing internal write-watch cases still printed not run, the surface is not write-watched in 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 ../build and git diff --check origin/main...HEAD passed. The submitted diff changes only CMakeLists.txt and StoreOverUntracked.cpp.

On the earlier bf861be9 fix 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 separate watch repeat 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 bf861be9 head, 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 final bf1ea515e head 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 bf861be9 fix 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

@MarcZX10 MarcZX10 mentioned this pull request Oct 16, 2026
11 tasks done
@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

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.

Pull request Shared files not compared
PR 1341 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 1368 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 1395 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 1896 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 4339 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 4650 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 4891 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5021 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5371 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5426 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5431 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5499 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5925 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6044 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6188 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/execution/StoreOverUntracked.cpp
PR 6259 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6373 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6412 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6447 core/libs/prx/libSceAgcDriver/tests/execution/StoreOverUntracked.cpp
PR 6503 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6535 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6718 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6747 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6763 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6808 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6937 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6946 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6947 core/libs/prx/libSceAgcDriver/CMakeLists.txt

@github-actions github-actions Bot added the agc libSceAgc* label Oct 16, 2026
@Amoenus

Amoenus commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Adopted: Ondra97 carried the test into #6744 with authorship preserved (confirmation). I verified final head bf1ea515e is 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 bf861be9 head. It adds the isolated agc_driver_store_pending_identity CTest 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.

Composition RTX 5080 Radeon Graphics Linux lavapipe
Main 5d9dcc42 + test only (96ac7201) 5/5 intended failures 5/5 intended failures 5/5 intended failures
Your exact head + test proposal (37e57bb1) 5/5 pass 5/5 pass 5/5 pass

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 5080 10de:2c02, driver 610.62 / 32.0.16.1062; AMD Radeon(TM) Graphics 1002:13c0, driver 32.0.21036.18. Ubuntu 24.04 WSL, GCC 13.3, Mesa 25.2.8 llvmpipe 10005: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.

@Ondra97

Ondra97 commented Oct 16, 2026

Copy link
Copy Markdown
Contributor Author

@Amoenus Thank you for the independent validation and focused test. I cherry-picked 37e57bb1 as 90b191e5b, preserving your authorship, and updated #6744 (head bf1ea515e). 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.

@github-actions github-actions Bot added the build label Oct 16, 2026

@Amoenus Amoenus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed bf1ea51. Its complete tree matches the previously validated test/fix at 37e57bb 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: #6744 (comment).

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows NVIDIA: StoreOverUntracked UntrackedRepeat intermittently finds no live storage image

3 participants