perf(agc): take a storage image's generation baseline only when its guest bytes are settled #2791
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2791"
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 alfalfa-star on 2026-10-10T15:13:40Z.
What
#1599 keeps a baseline of a storage image's guest bytes (images up to 1 MiB) when its layers get their generation, so a write-back can store the GPU results over CPU-stamped blocks whose bytes didn't change. The upload takes it with
GuestMemory::ReadCommitted, also on the host-import path, where the upload itself runs on the GPU.That read goes through the flush hook. When a unit shadow, another image's pending results or a recorded GPU store covers the surface, the hook publishes the shadow and the worker waits for the GPU on every such upload. Stack from PPSA14632, sampled at those waits:
Driver::dispatch→ShaderResources::buildComplete/Revalidate→lookupStorageTexture→StorageTexture::Refresh→upload→ (generation stamp) →ReadCommitted→FlushForAccess.The baseline is now taken only when nothing of that kind overlaps the surface (
StorageTexture::guestBytesSettled:AnyShadowedOverlaps,AnyPendingOverlaps,Recorder::PendingWriteOverlaps). Otherwise the image has no baseline, and its write-back keeps the CPU's bytes for stamped blocks, the rule before #1599. The TechnicalDebt entry from #1599 now names the condition.New ctest
agc_storage_baseline_settled(agc_driver_recorder_tests --settled-baseline-only): it creates a storage image over a watched host import while a recorded store is pending over part of it, and checks that the upload did not submit the open batch. Without this change it fails ("an upload over a pending recorded store submitted the open batch to read its generation baseline").agc_unchanged_cpu_stamps(#1599) still passes, so settled surfaces keep the baseline.Tested
Linux (Arch), RX 9070 XT, RADV, Release:
maindb343a93plus #1157, #425, #2699, #423/#1077 and local stand-ins needed to reach gameplay), steady state per 10 s:On its own this barely moves presents (~100 → ~104 per 10 s): the GPU wait moves to DMA_DATA copies, which #2792 addresses.
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)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by popcoder565 on 2026-10-10T15:57:44Z.
Native Windows run, since no Windows results were posted. Setup: Windows 10 (19045), RTX 3060 Laptop (NVIDIA 616.92), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. Head
75b540c2, merged ontomain57f96fd2bin one build with 4 other new PRs.agc_driver_recorder_tests(not in ctest), which holds this PR's test change, passes 10 of 10, built explicitly.No title was run.
🤖 Addressed by Claude Code
Imported from boykopovar/AnyPS5. Originally posted by orbz22 on 2026-10-10T16:37:33Z.
Checked on Windows with Hollow Knight: Silksong (PPSA12544), the title whose boxed menu letters #1599 fixed.
Setup: Windows 11 Pro (26300), i7-11800H, RTX 3060 Laptop (driver 617.42), WinLibs GCC 15.2.0 r7, Release.
mainde5e541d+ #846 (for the plugins), with and without this PR. Each run used the same scripted input for 250 s (title menu, profile select, New Game, the opening, into Moss Grotto) withAPS5_PROFILE_DRAW=1.pending writesyncs fromFlushForAccessdropped to 0 with this PR. Without it there were 3 to 5 per run, in three runs. They took no measurable time here. The other GPU waits did not change, and most of them come fromWaitForKeyWriters.keeping the CPU's blockslines appear with and without the PR.🤖 Generated with Claude Code