fix(agc): preserve GPU results in CPU-stamped full image blocks #1997
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1997"
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 ToyuAU on 2026-10-09T04:19:49Z.
What
Withdrawn as a proposed fix for #1970. The new #1995 evidence identifies guest allocator reuse inside a still-registered allocation. This candidate's baseline/allocation checks cannot establish ownership in that case. Its passing tests cover images that still own their memory, not the reported lifetime failure. #1994 and #1995 already provide the author's hardware-tested workaround; preserve this branch and its test results for reference rather than merge a competing byte policy without lifetime proof.
A draft candidate for the full 64 KiB page-stamp behavior discussed in #1970. A CPU page stamp currently discards an entire aligned image block even when guest bytes still equal the upload baseline, losing pending GPU results. Extend #1918's immutable byte merge to every watched image block: unchanged destination bytes accept changed GPU results, actual CPU edits survive, and newer ordered driver stores or replaced allocations still veto the merge.
Depends on #1918 at
97655b677e273d93fb8fdfe1393ae7a372904a1b, which is included in this branch. This PR adds the full-block extension and regression cases; it does not replace that partial-edge PR. Open alternative #1599 addresses partial-edge equality and does not implement this full-block byte merge. Existing fixes #1968 and #1969 do not establish byte ownership for CPU-stamped full blocks.New #1995 reports write-trap evidence of Unity allocator reuse and a Windows/NVIDIA Silksong workaround,
APS5_STORE_AT_FLIP=1, with #1994's opt-in watched imports. That is distinct from this byte merge and already provides the reported title's tested workaround. A baseline cannot prove that bytes still belong to the image when a guest allocator reuses memory inside the same registered allocation; unchanged or reset bytes may belong to the new object. This PR therefore does not resolve #1970's allocator-lifetime cause and must not be treated as a substitute for storing results before guest GPU completion is exposed. Keep draft pending that ownership decision and hardware evidence.Pack block baselines and merge outputs into shared buffers instead of allocating a Vulkan buffer per block. Capture and ordinary writeback retain baselines across uploads, clears, copies and aliases. Add a separate CTest invocation covering mixed CPU/GPU bytes, same-value CPU writes, uncollected page writes, refresh, second merge cycles, driver precedence, allocation replacement, unchanged GPU results, aliases, pending operations, CPU fallback and an aligned 8 MiB surface with every block CPU-stamped.
Keep this draft pending native CI and runtime/performance validation. Baseline storage scales with image size, upload capture copies guest bytes, and snapshot-covered blocks bypass unit shadows. The exact Silksong format-56/tile-7 stack on Windows/NVIDIA has not been reproduced; this is a general ownership fix candidate, not a playability claim.
Tested
Texture.cppand the runtime fixture using pinned Vulkan/SDL headers. This does not execute the Linux/Windows runtime.690ebaded1e266df03954a0816236845c8b24376(Build run); the subsequent commit updates only this validation debt entry.Checklist
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-09T04:36:43Z.
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/TechnicalDebt.mdL242core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cppL770docs/dev/TechnicalDebt.mdL242-243docs/dev/TechnicalDebt.mdL242-243docs/dev/TechnicalDebt.mdL242Pull request closed