[HOLD] perf(agc): pre-check memory coverage and flush pending images in indirect dispatch #5058
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5058"
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 Kikoarl on 2026-10-13T10:02:00Z.
What
Pre-checks memory registration and flushes pending storage images ahead of indirect compute dispatches (part 3 of the indirect decoupling requested by @oneandonlydean in #4868):
dispatchIndirect(IndirectDispatch.cpp), checksGraphics::RegisteredReadableCovers(arguments, 12)before submitting unresolved packets to the GPU. If unregistered or unmapped, routes toIndirectNotImportedto perform a safe CPU-side argument read and direct dispatch.dimX,dimY,dimZ), flushes them viaGraphics::StorageTexture::FlushPending(arguments, 12, nullptr, "indirect dispatch arguments")and routes toIndirectPendingImage.docs/dev/debt/libSceAgcDriver.md.tests/execution/IndirectArgumentsWrittenAhead.cppto exercise both the unregistered (CPU-fallback) and registered (GuestAllocations) indirect dispatch execution paths.Performance & Telemetry (Astro Bot PPSA21567)
Measured across alternating 10-second runs on Astro Bot intro/gameplay transition scene against base
8299b2f7e:main(8299b2f7e)main + PRmain(8299b2f7e)main + PRmain(8299b2f7e)main + PRTested
PPSA21567)agc_driver_indirect_arguments_written_ahead_tests(passes via ctest).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)Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-10-14T00:51:35Z.
Review: COMMENTED
Correction (2026-11-01): the title-ID/log demand below is not a CONTRIBUTING requirement;
Unblocks: noneis allowed. The technical points below are unaffected.I think this has the same problem the review of #4868 raised for indirect draws.
mainalready makes both of these decisions:DispatchRecipe/dispatchreportoutcome.cpuReasonasIndirectNotImportedorIndirectPendingImage, andcountIndirectrecords them. This makes the same decisions earlier, at a cost:RegisteredReadableCoversandStorageTexture::FlushPendingnow run on every GPU-side indirect dispatch, before the path the GPU would have taken anyway.FlushPendingreturning true means pending storage-image results were written back to guest memory: a GPU→CPU synchronization on the queue thread. The CPU then reads the arguments and issues a direct dispatch. That turns a GPU-resolved indirect dispatch into a full round trip. The point of the GPU indirect path is that the producer's results stay on the GPU and only a barrier separates the two dispatches. A flush can't take the "~1.3 µs per dispatch" in the table.ReadDispatchArgumentsreads mapped guest memory that just has no Vulkan import. If the memory really is unmapped, the CPU read faults; it isn't a fallback. As it stands the entry documents behaviour that this code doesn't have.mainalready takes. It doesn't show a case that behaves differently with the change.As with #4868, please reopen this with a title that reaches these paths. For a
perf(change, also attach theaps5-summary.jsonllines and traces showing that the earlier decision is cheaper than the onemainmakes.Imported from boykopovar/AnyPS5. Originally posted by Kikoarl on 2026-10-14T11:59:03Z.
putting this pr on hold while i re-evaluate telemetry and profiling on full in-engine scenes.
Pull request closed