Skip to content

fix(agc): retain import settle resources per device - #7269

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
JJenkx:fix/agc-settle-device-lifetime
Oct 17, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
JJenkx:fix/agc-settle-device-lifetime

Conversation

@JJenkx

@JJenkx JJenkx commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

What

Switching between two live Vulkan devices overwrites the global import-settle buffer, memory and fence handles. Clearing imports can then release only the last device's resources. Keep settle resources per device and destroy only the cleared device's entry. The regression imports through A -> B -> A and checks both cleanup orders, plus repeated cleanup.

Overlap review: #6678 changes the same settle state for deferred Windows imports; its captured adoptSettleDevice still resets the original handles when switching devices. This fix does not require its deferred scheduling. #6457, #6479 and #6730 touch the adjacent state declaration; #6913 adds a separate test at the same insertion point. Additive/context conflicts need reconciliation if those land first; none is a dependency. The overlap tool also reports older branches that cannot be compared against current main, so this is not a claim that every stale proposal merges together.

Tested

Linux, Ryzen 9 7950X, Radeon RX 6650 XT, RADV Mesa 26.2.4-arch1.1. New regression failed without the fix (10 failed assertions) and passed with it. Nine focused checks passed in 4.40 seconds with core validation enabled on the integration build: host-import unmap, parked-import unmap, retirement, sampled-storage views, CMASK, retire, sparse dma-buf, driver graphics and address-space teardown.

Native Infliction PPSA02688 on integration commit bfdd817a11abe21583643a695dc9093f72ffef02 reached the gameplay objective at 239.97 s, exited normally after 324.55 s, left no process and restored the kernel limit. Core validation reported zero VUIDs, including no previously observed leaked buffer/memory/fence teardown errors. This was the existing integration stack plus this fix; the main-based branch was not separately built or run. No performance gain or lighting improvement is claimed; the scene remains dark. The full Recorder suite retains a previously recorded pending-write assertion failure, so these are focused passes, not a full-suite pass.

Rebased onto 084bd39a085cf5a85a1dea19163184ba74ac1905; neither changed file changed upstream since the tested base. Conventions and diff checks pass. Game evidence: #6996 (comment)

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: PPSA02688 Infliction: Extended Cut (PPSA02688) #6996 teardown validation; remaining lighting unresolved
  • GPUs tested: AMD RX 6650 XT, RADV Mesa 26.2.4-arch1.1, Linux
  • AI-assisted: yes

@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

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.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 6457 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp L162
PR 6479 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp L162
PR 6678 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp L162, L187-194, L681-691, L751-753, L2340-2348
PR 6730 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp L162

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 1191 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 1324 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 2434 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 4448 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 4449 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 5021 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 5372 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6177 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6197 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6222 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/HostImportSparseDmaBuf.cpp
PR 6292 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6320 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6447 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6481 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6548 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6615 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6636 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6786 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6947 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 7154 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 7201 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/HostImportSparseDmaBuf.cpp

@github-actions github-actions Bot added the agc libSceAgc* label Oct 17, 2026
@oneandonlydean
oneandonlydean merged commit eea74c1 into boykopovar:main Oct 17, 2026
10 checks passed
oneandonlydean pushed a commit that referenced this pull request Oct 18, 2026
Main's #7269 keeps the synchronous settle's buffer, memory and fence
per device in ImportSettle, so clearing one device's imports releases
only that device's objects. This branch's settle batches move there
too: each device's ImportSettle holds its batch target, memory and
batches with their fences, so switching devices no longer drops a
device's batch handles, and clearing a device waits for and destroys
only its own batches. The per-import settle state is renamed
pendingSettles to stay clear of main's per-device map, and a submitted
settle records the device whose batch it is in.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc*

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants