fix(agc): save the bytes a GPU-side store writes outside the write watch #5760
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5760"
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 oneandonlydean on 2026-10-14T09:50:12Z.
What
A write-back stored on the GPU over memory outside the write watch left its units without saved guest bytes. Only the CPU path saved them. The next store of results there threw "storing storage image results pending over memory outside the write watch without the guest bytes saved before them is not implemented" (#5711, #5693), and every refresh re-uploaded the image.
originalwhen the batch completes (OnComplete). A write-back or refresh that needs them first syncs that batch. Anything that replaces or drops a unit's saved bytes in the meantime cancels the save for that unit.saveBeforeUnwatch, as the watch would store it whole.StoreOverUntracked: a surface outside the watch from the start is stored twice, with a CPU write to another block in between. On main the first store leaves no saved bytes (the test fails); with this change the CPU block is kept and the second result is stored.Stacked on #5707 (review only the top commit). Once #5679 is in, its capture at landing has to skip units whose save is still pending (
savedTicket[layer] == 0).Tested
BUILD_TESTING=ON:ctest -R "agc_|guest_memory|write_watch"504 of 504 (one skipped); the newStoreOverUntrackedcase fails on #5707's head and passes with this, 10 of 10 repeats.main+ #5671 + #5679 + #5707 + this (with thesavedTicketskip in #5679's capture): 509 of 509 (one skipped).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 Amoenus on 2026-10-14T11:04:49Z.
@oneandonlydean While refreshing the PPSA99902 validation stack, StoreOverUntracked access-violated on Windows NVIDIA. I reproduced it on unchanged main3e (initial failure, then nine passes followed by another failure); AMD passed20. Run can return while a Store is still queued, then destroy its local surfaces. #5789 records the reproduction.
The separate three-line cleanup wait in #5790 passed100 repetitions on each GPU, both before and after rebase onto main82. It leaves the GPU mutex before waiting and retains the original store assertions. Your new RunSecondStore also has early returns after submission, so it may need the same lifetime ordering. I have not tested #5760 or established that its new case crashes. This report concerns fixture lifetime, not validation/rejection of your production correction. AI-assisted: Codex.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T11:40:19Z.
Rebased on main (#5707 is in, so only this commit is left);
RunSecondStorenow waits for the GPU before freeing its surface, as #5790 does. Thanks @Amoenus for spotting it.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-14T18:20:04Z.
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.
main)docs/dev/debt/libSceAgcDriver.mdL56-57docs/dev/debt/libSceAgcDriver.mdL56-57