fix(agc): release retired imports while waiting for pins #2864
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2864"
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 MarcZX10 on 2026-10-10T16:51:28Z.
What
Break the guest allocation pin wait cycle when import retirement runs under
GpuMutex. After synchronizing, hand off deferred recorder keeps so the retired import can release its allocation range before the waiter returns. Add a focused unit shadow CTest and correct its expectations for bytes published while the old full registration is still visible.Fixes #2833.
Tested
Linux x86_64, GCC 12.2, Release: built
agc_driver_recorder_tests.agc_unit_shadowwas registered and correctly skipped because this host does not support the required asynchronous userfaultfd write watch. The test uses a 3 second pin wait and a 30 second CTest timeout.git diff --checkandpython3 tools/check_conventions.py --base upstream/mainpassed.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)Additional hardware validation (2026-10-10)
On Arch Linux with GCC 16.2.1, Release, and
ANYPS5_REQUIRE_VULKAN=1, fma-rc ran the focusedagc_unit_shadowregression on an NVIDIA RTX 5080 and AMD Radeon 610M (RADV): with this fix it passed 3/3 on each GPU; with the waiter hand-off removed it failed 3/3 after the two 3-second pin waits. The focused host-import and recorder tests also passed on both GPUs.The full
agc_driver_recorder_testsexecutable passes the repaired unit-shadow step but still stops at the unrelated(s) results pending when their memory left the watch did not reach itassertion. That assertion also fails on the parent before the pin-wait change. The full executable is not green yet. Full setup and results.Imported from boykopovar/AnyPS5. Originally posted by fma-rc on 2026-10-10T17:19:43Z.
The run you asked for, on a Linux host where the write-watch path is active (the test runs, it is not skipped): the fix removes the pin wait on an NVIDIA and on an AMD device.
Setup: PR head b2a8590d merged onto
main57f96fd2. Arch Linux 7.2.9, GCC 16.2.1, Release,ANYPS5_REQUIRE_VULKAN=1. NVIDIA RTX 5080 (615.78.08); AMD Radeon 610M (RADV, Mesa 26.1.4)."Without the fix" is the same merge with
Graphics/src/GuestBufferMemory.cppchecked out frommain, so the new test and its expectations stay and only the hand-off in the waiter is gone.ctest -R '^agc_unit_shadow$', 3 runs eachThe failures are the reported stop, with the test's 3 s wait taken twice:
ctest -R '^agc_unit_shadow$|agc_host_import|recorder'(3 tests) also passes on both devices with the fix.Full run (
agc_driver_recorder_testswith no arguments,APS5_PIN_WAIT_MS=3000), one run per cell:(s) results pending when their memory left the watch did not reach itstill pinned … waited 3000 msSo with the fix the full run gets past the unit shadow step, corrected expectations included, and stops at the
(s)assertion. That is the stop the full run already had on2f655b12, the parent of the commit that introduced the pin wait, so it is not caused by this PR; the full run is still not green.Not run: the rest of the suite with this PR, and any title.
AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by eliyarson on 2026-10-10T22:50:41Z.
Third device data point for the new regression test, since the description says it skipped on the author's host.
Setup: PR head b2a8590d as submitted (not merged onto current
main), CachyOS (Arch), Linux 7.2.2, GCC, Release,-DBUILD_TESTING=ON. NVIDIA RTX 3080 Ti, driver 610.57.04. The startup probe printshost imports resolve write protection: no (0 of 4 … 4 after the import); imported ranges stay watched.ctest -R agc_unit_shadow, 5 runsANYPS5_REQUIRE_VULKAN=1 agc_driver_recorder_tests, 3 runs(s) results pending when their memory left the watch did not reach it, as in #2833ctest -j12, 699 testsagc_driver_dcc_keys_first_write(#2767) andguest_sce_net(#2820). No regressionsNot checked: that
agc_unit_shadowfails without the fix; the test does not exist onmain.AI-assisted: yes. Runs and this report were produced with AI assistance; I take responsibility for the content.
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T23:13:13Z.
Rebased onto current
main(adjacency conflict inRecorder.hppwithKeepBytes/OpenKeptBytes; both kept). Libraries build and the AgcDriver/Agc ctest scope are green.Checked
FlushDeferredReleases()after bothSync()calls inWaitForLeasesAndImports, the newagc_unit_shadowregistration (skip 77, 30 s timeout) and the corrected unit-shadow expectations. The test cannot run on my host (host imports are compared, not watched), so it relies on the 3/3 pass with / 3/3 fail without the fix reported by @fma-rc (RTX 5080, RADV) and the 5/5 pass by @eliyarson (RTX 3080 Ti). Merging once the full Build is green.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-10T23:17:50Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/prx/libSceAgcDriver/tests/Recorder.cppL4754