perf(agc): settle Windows private imports larger than 64 KiB at the import #10443
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10443"
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 Dripl1x on 2026-10-24T00:30:38Z.
What
On Windows a host import of private memory under 1 MiB is compared until its deferred settle, and the deferred return to the write watch is skipped while a live storage image overlaps the range (the rewatch stamps it as a CPU store, which the image would take as a write over its results). SuperTuxKart (PPSA69421) views its small textures (96 KiB to 352 KiB) from storage images, so they stayed compared for good and every draw sampling one took the full revalidation walk with a byte compare.
[buffers]line's "settled inside their window" counts them). In SuperTuxKart they are made once; a title that makes such imports every frame would pay a wait per import.APS5_SETTLE_FLOOR_KIBsets the floor (1024 restores the old one). The retire test needs a 128 KiB import on the deferred path and sets it to 1024; with the default floor, an import replaced while its deferred read runs is now only reached by 64 KiB imports and has no test of its own.SuperTuxKart main menu with the tutorial prompt (about 59 draws a frame), on a stack based on
maina0900b9d99(#7464, #9402, two local direct-memory changes and three other local changes),APS5_PROFILE_DRAWover 10 s, the old floor against this one on the same build:APS5_SETTLE_FLOOR_KIB=1024Dumped menu frames 0 to 6 of both matched within a mean difference of 0.001. The menu runs at the title's 60 FPS cap either way, so this shows as spare time per frame, not FPS: on current heads (
main9d4fb4fb70+ #7464 + #9402 + this and three other local changes, the menu without the tutorial prompt, about 33 draws a frame) 59.94 FPS with and without it, the longest idle gap of queue worker 0 and the committer per frame 6.7–7.0 ms (median) with it against 5.9 and 6.2 ms without (a third run without it lost the window focus and is left out).Overlap: #9941 also changes
importRunAt(it marks partial-block importssettleOnDemandand settles them on demand before an initial multisampled DCC import, for #9724). With this PR a private import of more than 64 KiB, partial or not, settles at the import, which may already cover #9724's 784 KiB import; that was not tested on those titles. Whichever lands second needs a small rebase there.Tested
This head:
main9d4fb4fb70+ this commit; merges cleanly into5e6ae6e3d0. Windows 11 Pro 26300, Ryzen 7 5800H, RTX 3070 Laptop GPU (NVIDIA 621.01), WinLibs GCC 15.2.0 r7, Release: every ctest entry ofagc_driver_recorder_tests(86, theagc_import_settle_*entries included),agc_driver_host_import_windows_tests,agc_driver_host_import_at_map_tests,agc_driver_host_import_teardown_tests,agc_host_import_retire_testsandagc_driver_guest_memory_lifetime_tests(6) passes.Linux (Ubuntu 26.04 in WSL, llvmpipe), on the measurement stack:
agc_driver_recorderpasses (the change is Windows-only code).Titles: SuperTuxKart menu as above. vkQuake (PPSA99010), on the earlier stack: 27 imports settled at the import over a run, 82–85 FPS with this series and without it. Not run: the full CTest suite, other titles, other GPUs.
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)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T22:00:29Z.
Review: CHANGES_REQUESTED
Reviewed exact head
90b9574ad52da6ecf26c1cec51bd1fea2587d592against refreshed upstreammainc8d34aa8f4d8058d57169cc1e423ba6db00faaf0.The threshold change is narrowly scoped to Windows private imports and preserves the 64 KiB deferred-settle path; the new 128 KiB retirement case restores the old 1 MiB floor for that test. The recorded Windows suite and SuperTuxKart measurements are useful, but they were run on a stack based on
9d4fb4fb70with three additional local changes. The current branch is based on that same9d4fb4fb70commit, while current main has 20 commits not present here, including subsequent AGC import/write-watch changes. A merge-tree preview is clean, but that does not verify the changed settle behavior with the current integrated import paths.Please update this branch to current main and rerun the focused Windows tests on the final composition: the recorder suite, host-import Windows/map/teardown suites, retire and guest-memory lifetime tests. Report which tests actually ran and whether the existing GPU/title comparison still holds on that base. Keep the environment floor override exercised so the retire test still covers deferred settling.
Local review: current-main merge-tree is clean; current-main conventions and diff-check pass. Hosted eligibility, intake, labels, report, and conventions pass; hosted product/relinker jobs are skipped. I cannot reproduce Windows/GPU tests locally. This request is for fresh integration evidence, not a claim that the implementation is incorrect.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T09:31:15Z.
Review: COMMENTED
Reviewed — no blocking findings
The changed logic and added test show no verified blocking defect; the author’s reported checks were not run in this review.
What I ran
Reviewed head
17cee297fbae905fb15bafd76ce5528b0a6f84c8using the prepared review bundle andrepo_read.pyat the pinned head. No tests or other commands were run.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The author reports passing Windows and Linux checks and title runs in the PR description; these were not independently verified. The full test suite, other titles, and other GPUs were not run.
Recorder.cppwas excluded from the prepared files because it was too large; I read its changed test region through the pinned reader. The changed files reviewed werecore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp,core/libs/prx/libSceAgcDriver/tests/Recorder.cpp,core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake, anddocs/dev/ENVIRONMENT.md.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T23:02:12Z.
Review: APPROVED
Reviewed — looks good
The review covers head
71dad17b46b484e92643878c2de04aea20e2187c; I found no verified blocking defect, and the author reports the relevant Windows test suites passed.What I ran
Read the prepared diff and the changed code around the new threshold, test, CMake properties, and environment documentation. No commands or tests were run in this review.
Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The author reports successful Windows 11 tests and a Linux recorder test, but those runs were not independently verified. I did not inspect the full contents of
GuestBufferMemory.cpporRecorder.cpp; I read the changed lines and relevant surrounding functions. No other files were excluded by the review bundle.To get this to a good state
Nothing is required.