Repository navigation
perf(agc): disambiguate completion label overlaps in CopyBuffer - #4496
oneandonlydean merged 1 commit into
Conversation
e1acd3f to
b0ce20c
Compare
|
Windows run, to go with the Linux one in the description. Setup: Windows 11 (26200), WinLibs GCC 15.2.0 r7, Release, CI configure flags, an RTX 4070 Laptop GPU and an Intel Raptor Lake-S iGPU. The head b0ce20c merged into
No title run here, so nothing on the Astro Bot frame rate. Written with AI assistance. |
|
Please split this into three PRs, each with its own before/after (#218): the
The two entries added to |
b0ce20c to
40cbac4
Compare
|
Thanks @oneandonlydean for the review and catching the GDS ordering hazard.
|
|
Two things before this can go in:
|
40cbac4 to
396b518
Compare
|
@oneandonlydean Both points addressed:
|
|
Thanks, the new |
|
@oneandonlydean Thanks! Here is the alternating multi-run telemetry across three 10-second windows each in Astro Bot (
Unit cost breakdown:
Updated the PR description with the multi-run table and breakdown. |
Use the existing completion-store range query when deciding whether resource acquisition needs a CPU write-back wait. An unrelated pending host completion must not turn an ordinary GPU label into a CPU dependency. This applies the distinction already used in CopyBuffer by merged PR boykopovar#4496. Cover fresh and cached direct consumers with an unrelated host completion, exact GPU output and deferred completion execution. The focused regression fails with the broad label query and passes with the completion-store query on an RTX 4070 under Vulkan validation. No gameplay speed claim.
Use the existing completion-store range query when deciding whether resource acquisition needs a CPU write-back wait. An unrelated pending host completion must not turn an ordinary GPU label into a CPU dependency. This applies the distinction already used in CopyBuffer by merged PR boykopovar#4496. Cover fresh and cached direct consumers with an unrelated host completion, exact GPU output and deferred completion execution. The focused regression fails with the broad label query and passes with the completion-store query on an RTX 4070 under Vulkan validation. No gameplay speed claim. (cherry picked from commit a9209d9)
Use the existing completion-store range query when deciding whether resource acquisition needs a CPU write-back wait. An unrelated pending host completion must not turn an ordinary GPU label into a CPU dependency. This applies the distinction already used in CopyBuffer by merged PR boykopovar#4496. Cover fresh and cached direct consumers with an unrelated host completion, exact GPU output and deferred completion execution. The focused regression fails with the broad label query and passes with the completion-store query on an RTX 4070 under Vulkan validation. No gameplay speed claim.
Use the existing completion-store range query when deciding whether resource acquisition needs a CPU write-back wait. An unrelated pending host completion must not turn an ordinary GPU label into a CPU dependency. This applies the distinction already used in CopyBuffer by merged PR #4496. Cover fresh and cached direct consumers with an unrelated host completion, exact GPU output and deferred completion execution. The focused regression fails with the broad label query and passes with the completion-store query on an RTX 4070 under Vulkan validation. No gameplay speed claim.
Use the existing completion-store range query when deciding whether resource acquisition needs a CPU write-back wait. An unrelated pending host completion must not turn an ordinary GPU label into a CPU dependency. This applies the distinction already used in CopyBuffer by merged PR boykopovar#4496. Cover fresh and cached direct consumers with an unrelated host completion, exact GPU output and deferred completion execution. Port of upstream 7ac63cb: the fork's merges kept its own libSceAgcDriver, so the condition and its regression test were lost. On the Ghost of Yotei DLC screen the draw committer synced once per frame, under the GPU mutex, on a queue 0x52 GPU label in a cached build's address space (GuestBufferMemory::ResumeSpace). With the port its locked GPU waits drop from 265-468 to 131-151 ms per 10 s; fps 5.666 -> 5.730 (interleaved, 3 runs, +1.1 %). agc_copied_direct_ordering passes; the focused label tests show the same results and VUIDs as the base under Vulkan validation. (cherry picked from commit 7ac63cb) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Use the existing completion-store range query when deciding whether resource acquisition needs a CPU write-back wait. An unrelated pending host completion must not turn an ordinary GPU label into a CPU dependency. This applies the distinction already used in CopyBuffer by merged PR boykopovar#4496. Cover fresh and cached direct consumers with an unrelated host completion, exact GPU output and deferred completion execution. Port of upstream 7ac63cb: the fork's merges kept its own libSceAgcDriver, so the condition and its regression test were lost. On the Ghost of Yotei DLC screen the draw committer synced once per frame, under the GPU mutex, on a queue 0x52 GPU label in a cached build's address space (GuestBufferMemory::ResumeSpace). With the port its locked GPU waits drop from 265-468 to 131-151 ms per 10 s; fps 5.666 -> 5.730 (interleaved, 3 runs, +1.1 %). agc_copied_direct_ordering passes; the focused label tests show the same results and VUIDs as the base under Vulkan validation. (cherry picked from commit 7ac63cb) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit efff1fd)
What
In
VulkanDevice::CopyBuffer, checksrecorder.CompletionLabelIn(address, bytes)rather thanrecorder.PendingLabelIn(address, bytes)insidecompletionStoreOverlaps.When asynchronous GPU batches have active completion actions pending elsewhere (
Recorder::PendingCompletionLabels() != 0), queryingPendingLabelIncaused ordinary GPU-recorded labels in the source or destination range (which are not deferred behind a completion) to be falsely classified as completion store overlaps. This forced unnecessary CPU batch wait synchronization (SyncThrough/outcome.synced = true) on subsequent buffer copies. QueryingCompletionLabelInensures only labels specifically deferred behind a completion trigger overlap waits.Tested
PPSA21567), 3D worldmap hub, alternating 10s windows (APS5_PROFILE_DRAW=1)ea2bbefb2waitSource)main(ea2bbefb2)main + PRmain(ea2bbefb2)main + PRmain(ea2bbefb2)main + PRUnit cost breakdown:
In
main, each false-positive copy sync stalled the CPU for an average of 18.2 ms (syncMs).Across a 10 s window (~550 frames), 42 syncs accumulated ~764 ms of CPU wait time, which amortizes to ~1.39 ms per frame.
In
main + PR, false-positive stalls are eliminated (0 syncs,outcome.synced == false), recovering ~1.3 ms/frame and bringing average frame rate from ~54.9 to ~59.2 FPS.Automated tests:
agc_driver_copied_writer_copy_testsincore/libs/prx/libSceAgcDriver/tests/execution/CopiedWriterCopy.cpp. An ordinary recorded label in the source range with an active completion action elsewhere (AfterRecordedWork) fails onmain(outcome.synced == true), and passes with this PR (outcome.synced == false).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)