perf(agc): reuse import decisions across mapping changes #1361

Closed
TibixDev wants to merge 10 commits from upstream-pr/1361 into main
TibixDev commented 2026-10-08 00:17:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by TibixDev on 2026-10-08T00:17:17Z.


Status after review

Awaiting title benefit and a consumer-led redesign.

The description now calls out the full legacy integration stack raised in review: #1324, #1357, #1359 and #1360. This does not make the old embedded copies equivalent to today's branch heads. In this pass, #1357 and #1359 were rebuilt independently on main; #1357 is now specifically a failed-import remap-identity fix. The old stack must not overwrite main's later span/import-lifetime work.

The 111–164 ns → 16–18 ns repeated-failure lookup result remains a microbenchmark, with no isolated frame-time result. The new Skyrim loading run does show failed host imports, but it does not establish that repeated decision lookup is a bottleneck: its measured resource cost is dominated by upload. If a title profile shows that cost, the next version should include #1360's first real consumer and compare against main's eager map observer. No code push or claimed gain from merely observing failures.

What

Reuse failed import decisions for unchanged allocation ranges and exact spans across mappings. Use range history before acquiring the full registry. Retain existing owners when history expires; discard decisions when a backing changes. Successful imports still take priority.

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

  • Current-main implementation and outstanding review requirements complete.
  • Isolated title benefit / reference validation established where required.
  • Depends on: #1324, #1357, #1359, #1360 (legacy integration; redesign required).
  • AI-assisted: yes.
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4780053627 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1361). Originally posted by [TibixDev](https://github.com/TibixDev) on 2026-10-08T00:17:17Z. --- ### Status after review **Awaiting title benefit and a consumer-led redesign.** The description now calls out the full legacy integration stack raised in review: #1324, #1357, #1359 and #1360. This does not make the old embedded copies equivalent to today's branch heads. In this pass, #1357 and #1359 were rebuilt independently on main; #1357 is now specifically a failed-import remap-identity fix. The old stack must not overwrite main's later span/import-lifetime work. The 111–164 ns → 16–18 ns repeated-failure lookup result remains a microbenchmark, with no isolated frame-time result. The new Skyrim loading run does show failed host imports, but it does not establish that repeated decision lookup is a bottleneck: its measured resource cost is dominated by upload. If a title profile shows that cost, the next version should include #1360's first real consumer and compare against main's eager map observer. No code push or claimed gain from merely observing failures. ### What Reuse failed import decisions for unchanged allocation ranges and exact spans across mappings. Use range history before acquiring the full registry. Retain existing owners when history expires; discard decisions when a backing changes. Successful imports still take priority. ### 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 - [ ] Current-main implementation and outstanding review requirements complete. - [ ] Isolated title benefit / reference validation established where required. - [x] Depends on: #1324, #1357, #1359, #1360 (legacy integration; redesign required). - [x] AI-assisted: yes.
TibixDev commented 2026-10-08 07:28:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by TibixDev on 2026-10-08T07:28:37Z.


Rebased on eaa6ccea. Updated #1357 with #1051’s Linux writable-range check and owner-aware failure caching. This fixes the merge-build compile failure while retaining the byte budget and existing ordering/remap behavior.

Fedora 44 Release: agc_driver_graphics_tests, guest_memory_tests, guest_mapping_history_tests, guest_time_conversion_tests, agc_driver_recorder_tests, agc_recorder_kept_bytes_tests build; the targeted tests and contribution checks pass. Windows CI is pending.
RADV and lavapipe: --shared-import-only, --failed-imports-only pass with core and synchronization validation; no validation errors.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6054913361 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1361#issuecomment-6054913361). Originally posted by [TibixDev](https://github.com/TibixDev) on 2026-10-08T07:28:37Z. --- Rebased on `eaa6ccea`. Updated #1357 with #1051’s Linux writable-range check and owner-aware failure caching. This fixes the merge-build compile failure while retaining the byte budget and existing ordering/remap behavior. Fedora 44 Release: `agc_driver_graphics_tests`, `guest_memory_tests`, `guest_mapping_history_tests`, `guest_time_conversion_tests`, `agc_driver_recorder_tests`, `agc_recorder_kept_bytes_tests` build; the targeted tests and contribution checks pass. Windows CI is pending. RADV and lavapipe: `--shared-import-only`, `--failed-imports-only` pass with core and synchronization validation; no validation errors.
popcoder565 commented 2026-10-08 08:03:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by popcoder565 on 2026-10-08T08:03:14Z.


Tested on Windows, since the description says it wasn't: Windows 10 (19045), RTX 3060 Laptop (driver 616.92), MinGW-w64 GCC 15.2.0, Release, main eaa6ccea merged with a0165b00.

  • It builds, and full ctest passes 419 of 421. The two failures happen on main without this PR too: agc_driver_srgb8_color_target (#1434) and an intermittent guest_raise_exception timeout (#1421).
  • agc_driver_recorder_tests, which is not in ctest, passes 3 of 3 runs.
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6055519859 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1361#issuecomment-6055519859). Originally posted by [popcoder565](https://github.com/popcoder565) on 2026-10-08T08:03:14Z. --- Tested on Windows, since the description says it wasn't: Windows 10 (19045), RTX 3060 Laptop (driver 616.92), MinGW-w64 GCC 15.2.0, Release, `main` eaa6ccea merged with a0165b00. - It builds, and full ctest passes 419 of 421. The two failures happen on `main` without this PR too: `agc_driver_srgb8_color_target` (#1434) and an intermittent `guest_raise_exception` timeout (#1421). - `agc_driver_recorder_tests`, which is not in ctest, passes 3 of 3 runs.
adriadam10 commented 2026-10-11 11:40:09 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T11:40:09Z.

Review: CHANGES_REQUESTED


Thanks for the work here. This can't be merged as is:

  • It is stacked on #1324, #1357, #1359 and #1360. All four are still open and conflict with main, so nothing here can land before them. The Depends on line lists only #1357 and #1360; please list all of them.
  • This head also conflicts with main (GuestBufferMemory.cpp, libc/CMakeLists.txt, GuestAllocations.{hpp,cpp}), in the replaceRange / host-import lookup logic, so it needs the author rather than a mechanical rebase.
  • The gain is a lookup microbenchmark (111–164 ns → 16–18 ns per repeated failed span). Please name a title and scene where repeated failed imports show up in a frame, with before/after frame times; on #1324 @oneandonlydean measured no frame-time change and that question is still open.
  • The caching relies on GuestAllocationsValidateMapping_nid_no_patch from #1360, which has no caller there; it should land together with this consumer or the stack should be folded so each PR keeps one topic.

Please rebase once the base PRs are merged and we will review it again.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5483160397 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1361#pullrequestreview-5483160397). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-11T11:40:09Z. **Review:** CHANGES_REQUESTED --- Thanks for the work here. This can't be merged as is: - It is stacked on #1324, #1357, #1359 and #1360. All four are still open and conflict with `main`, so nothing here can land before them. The **Depends on** line lists only #1357 and #1360; please list all of them. - This head also conflicts with `main` (`GuestBufferMemory.cpp`, `libc/CMakeLists.txt`, `GuestAllocations.{hpp,cpp}`), in the `replaceRange` / host-import lookup logic, so it needs the author rather than a mechanical rebase. - The gain is a lookup microbenchmark (111–164 ns → 16–18 ns per repeated failed span). Please name a title and scene where repeated failed imports show up in a frame, with before/after frame times; on #1324 @oneandonlydean measured no frame-time change and that question is still open. - The caching relies on `GuestAllocationsValidateMapping_nid_no_patch` from #1360, which has no caller there; it should land together with this consumer or the stack should be folded so each PR keeps one topic. Please rebase once the base PRs are merged and we will review it again.
TibixDev commented 2026-10-12 04:52:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by TibixDev on 2026-10-12T04:52:15Z.


Review-pass update:

The description now calls out the full legacy integration stack raised in review: #1324, #1357, #1359 and #1360. This does not make the old embedded copies equivalent to today's branch heads. In this pass, #1357 and #1359 were rebuilt independently on main; #1357 is now specifically a failed-import remap-identity fix. The old stack must not overwrite main's later span/import-lifetime work.

The 111–164 ns → 16–18 ns repeated-failure lookup result remains a microbenchmark, with no isolated frame-time result. The new Skyrim loading run does show failed host imports, but it does not establish that repeated decision lookup is a bottleneck: its measured resource cost is dominated by upload. If a title profile shows that cost, the next version should include #1360's first real consumer and compare against main's eager map observer. No code push or claimed gain from merely observing failures.

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.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6117976942 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1361#issuecomment-6117976942). Originally posted by [TibixDev](https://github.com/TibixDev) on 2026-10-12T04:52:15Z. --- Review-pass update: The description now calls out the full legacy integration stack raised in review: #1324, #1357, #1359 and #1360. This does not make the old embedded copies equivalent to today's branch heads. In this pass, #1357 and #1359 were rebuilt independently on main; #1357 is now specifically a failed-import remap-identity fix. The old stack must not overwrite main's later span/import-lifetime work. The 111–164 ns → 16–18 ns repeated-failure lookup result remains a microbenchmark, with no isolated frame-time result. The new Skyrim loading run does show failed host imports, but it does not establish that repeated decision lookup is a bottleneck: its measured resource cost is dominated by upload. If a title profile shows that cost, the next version should include #1360's first real consumer and compare against main's eager map observer. No code push or claimed gain from merely observing failures. 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.
oneandonlydean commented 2026-10-14 05:09:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T05:09:41Z.


Closing for now: only a microbenchmark is shown, no title. 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.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6161379651 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1361#issuecomment-6161379651). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-14T05:09:41Z. --- Closing for now: only a microbenchmark is shown, no title. 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

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!1361
No description provided.