feat(memory): track changes to mapped address ranges #1360
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1360"
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 TibixDev on 2026-10-08T00:13:40Z.
Status after review
Do not land range history without its first consumer.
Audited the actual compare commits: this head contains the two targeted-lease/range-update commits from #1324 and the history commit. Its new validation API is used by its tests, with no production history consumer in this PR. That remains a valid blocker.
Main now has a range invalidator for page states and a GPU-map observer for imports. These are not automatically equivalent to retained-history queries, but a proposed import consumer must show why the existing notifications are insufficient before adding another 1,024-entry mechanism. #1366 was rebuilt without this API, so it is no longer a reason to land it. If #1361 is revived with measured benefit, its first real history consumer should be developed and reviewed together with the history implementation. No mechanical adoption of the suggested rebase or standalone API push.
What
Record a bounded history of changed guest address ranges. A cache can keep an unchanged range across unrelated mapping changes. Overlapping changes and expired history reject the proof. Record changes during main-image registration too.
Tested
Earlier branch-specific tests and measurements remain in the discussion. They have not been rerun on a redesigned current-main version of this PR. The review audit and shared NGS-assisted title exploration do not establish that this head is merge-ready. No full Linux/Windows platform CI was dispatched in this pass.
Checklist
Imported from boykopovar/AnyPS5. Originally posted by TibixDev on 2026-10-08T07:23:34Z.
Rebased on
58a1bd66. Kept both mapping-history and upstream time-conversion test registration, including Windows paths. The upstream mprotect tests are also retained.Fedora 44 Release:
guest_memory_tests,guest_mapping_history_tests,guest_time_conversion_testsbuild; the targeted tests and contribution checks pass. Windows CI is pending.Imported from boykopovar/AnyPS5. Originally posted by rmz-24 on 2026-10-09T12:45:33Z.
Windows run: Windows 11 Pro 25H2 (10.0.26200.9457), RTX 5060 Ti (NVIDIA 617.42), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release,
-DANYPS5_ENABLE_SPIRV_TOOLS=ON, full build pluslibs.7fe5e9c1cherry-picked onto currentmaind70b8998(applies cleanly).guest_mapping_historyandagc_driver_graphics(which carries theGuestAllocations.cppcases) pass.AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-11T09:09:16Z.
Hi! This PR currently conflicts with
main, so I rebased its 3 commits onto the latestmain. This one interleaved heavily with main's newer GuestAllocations work, so the rebased branch combines both:replaceRange: this PR'sRangeReplacement/fragmentsmachinery is kept, with main's newergpuparameter threaded through the insert lambda andRangeliterals.GuestAllocationsAcquireRange: renamed to_nid_no_patchas in the PR, alongside main'sAcquireAll.UploadFinishimport lookup: the PR's targeted-lease logic is kept, with itsimportAllocationcall adapted to main's current 4-argument signature.GuestAllocationsEnd: the PR'spublishChanges(which now bumps the generation itself) replaces main's rawfetch_add, withendedloaded after it for main's gpu-map observer.registerImage: main's newer multi-image refactor is kept — it supersedes this PR's main-image-only registration export.gpuparameter onMutation::Add/Protect.It builds, and
guest_mapping_history_testsplus the affected agc suites (bda_device,graphics,mesh,shader_memory,write_tracking) all pass locally.The rebased branch is available to pull:
Feel free to ignore this if you'd rather rebase yourself.
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T11:40:00Z.
Review: CHANGES_REQUESTED
Thanks for the work here. This can't be merged as is:
main, so nothing here can land before them.main(GuestBufferMemory.cpp,libc/CMakeLists.txt,GuestAllocations.hpp,GuestAllocations.cpp). The conflicts are inreplaceRangeand the host-import lookup, so they need the author, not a mechanical rebase (the rebase suggested in the thread merges both versions of that logic and hasn't been pushed here).GuestAllocationsValidateMapping_nid_no_patchand the 1024-entry history have no caller in this PR; only the new test uses them. Please land it together with its first consumer (#1361/#1364/#1366), or say which existing code uses it.GuestAllocationsAcquireRange_nid_no_patchis wired intoGuestBufferMemory.cppas a perf change. Please name a title/scene where it helps: on #1324 @oneandonlydean measured no frame-time change and the question is still unanswered.Please rebase once the base PRs are merged (or fold the stack so each PR keeps one topic) and we will review it again.
Imported from boykopovar/AnyPS5. Originally posted by TibixDev on 2026-10-12T04:52:12Z.
Review-pass update:
Audited the actual compare commits: this head contains the two targeted-lease/range-update commits from #1324 and the history commit. Its new validation API is used by its tests, with no production history consumer in this PR. That remains a valid blocker.
Main now has a range invalidator for page states and a GPU-map observer for imports. These are not automatically equivalent to retained-history queries, but a proposed import consumer must show why the existing notifications are insufficient before adding another 1,024-entry mechanism. #1366 was rebuilt without this API, so it is no longer a reason to land it. If #1361 is revived with measured benefit, its first real history consumer should be developed and reviewed together with the history implementation. No mechanical adoption of the suggested rebase or standalone API push.
I have updated the PR description to match this status. The PR remains open; the outstanding review requirements are not being marked resolved. AI-assisted audit.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T05:09:34Z.
Closing for now: no title is known to need it. With the queue this large we're closing stalled perf PRs that don't show a gain in a title; reopen it with before/after numbers from a title scene (the summary lines from the performance report form) if you pick it up again.
Pull request closed