perf(agc): keep a host import across a split of its guest range #6499

Merged
parl0v merged 10 commits from upstream-pr/6499 into main 2026-10-19 06:54:36 +00:00
parl0v commented 2026-10-15 17:38:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by parl0v on 2026-10-15T17:38:32Z.


What

A guest mprotect/munmap over part of a registered range rebuilds every piece of that range as a new Range, the untouched ones included. A host import pinning the range is retired from the pin waiter during the guest call, and the next access imports the remaining tail again from scratch: a new VkDeviceMemory import, and on Windows since #6060 a new watched window (zero scan of every page, copy of the nonzero ones, write walks) and a settle. For a large range whose start moves up a little at a time, that is hundreds of milliseconds per step for pages that are still imported.

Now an import whose head or tail is cut off is kept, and so is the larger side of an import cut strictly inside its range (the tail when both sides are equal; the smaller side is imported again). At the next refresh it is re-attached to the largest current range inside the surviving piece: a new VkBuffer is bound to the same imported memory at the new offset, so nothing is pinned, scanned, copied or settled again. To keep this exact, GuestAllocations::Range carries a backing serial: new ranges get a fresh one, the untouched pieces of a split keep it, and every span whose pages a mutation replaces (the spans that pass RequireUnpinned: demote to a shared section, RemapFixedIntoRegistered, alias and resident mappings, protect and unmap) gets a fresh one. A trim is used only for a plain host-pointer import (no alias, dma-buf, chunked or joined import) whose surviving range has the same serial, does not overlap another import, is exactly what a new import would cover, and accepts a buffer at that offset; anything else is retired and re-imported as before. The original memory stays pinned until the trimmed import retires, and liveBytes and the eviction accounting count it. A trimmed import that is released instead of re-attached is held through the active recorder (KeepThroughHold), as a retired import is, so no batch in flight can still use its memory.

One exception since the rebase onto current main: an import that still has a deferred settle pending (pendingSettles, Windows) is retired as before instead of trimmed. That settle's read can still be in flight on the settle queue through the import's old buffer, and a trim moves the import's base, so the settle would no longer match it. Pending settles are short-lived (imports under 1 MiB until their read finishes, larger ones until the next poll), so the large re-imported ranges this is about still trim.

Tested

Windows 10 19045, MinGW-w64 GCC 15.2, NVIDIA 617.42, RTX 4060 and RTX 3060.

Synthetic (new agc_reimport_bench, RTX 4060): 1126 MiB of singly mapped direct memory, 1 page in 4 nonzero, imported through HostImportFor; then 5 times the next 1440 KiB of the head is protected and [start + k·1440 KiB, end) is accessed again. Medians of 3 runs:

main: guest protect / re-import this PR
first import, 1126 MiB – / 769 ms – / 719 ms (same path)
k = 1..5 27–30 ms / 472–560 ms 0.04–0.15 ms / 0.00–0.02 ms

On main each re-import was ~170 ms import create, ~30 ms settle and ~400 ms in ImportWatched (zero scan 75–150 ms, copy 73–122 ms, walks ~35 ms). The test also checks that after five trims the tail is still watched with no false writes, CPU stores at both ends are collected, and a GPU copy through the trimmed buffer (offset 0 and last page) equals guest memory.

This is the pattern @Sevthered measured on Astro Bot (PPSA21567) on #6060: five re-imports of a ~1.1 GiB range ending at 0x37e000000 with its start moving up, 295–348 ms each, as long frames in the logo sequence.

Cuts at the tail and inside the range (agc_reimport_bench, RTX 4060, NVIDIA 617.42): three patterns, each on a fresh 1126 MiB range, 5 cuts each, 3 runs. "Before" is this branch with the trim forced off, so every cut takes retireImport, main's path:

pattern before: kept side imported again / import after the cut after
head, 1440 KiB lose GPU access per cut 5/5 / 386–431 ms 0/5 / ≤0.02 ms
tail, the same at the end 5/5 / 379–416 ms 0/5 / ≤0.01 ms
inside: a 16 KiB no-access page 256 MiB in, then 1440 KiB above the last 5/5 / 285–306 ms 0/5 / ≤0.02 ms

The guest's protect drops from 18–22 ms to under 0.15 ms. A cut inside still imports the smaller side (256 MiB: 86–105 ms on both builds).

agc_trimmed_import (Windows): 32 MiB of singly mapped direct memory imported whole, then a 16 KiB no-access page near the start and near the end, an unmap of a 2 MiB run inside, an unmap of the first 2 MiB run, an unmap of the first 1440 KiB (which splits a 2 MiB resident run, so the kept side gets a new backing serial and is imported again), and an unmap of the whole kept side while the import waits trimmed. Every unmapped span is mapped again at the same address. Each case checks through a GPU copy that the import reads fresh CPU stores at both ends, that the write watch collects them and reports nothing else, and that pages mapped again are served by a new import. With the interior branch removed the first case fails; with the backing-serial check removed from reattachTrimmed the last case fails (the GPU reads the old pinned pages).

Titles without that pattern, no change (same relinked executables, alternating, APS5_PROFILE_DRAW=1): Minecraft Dungeons II (PPSA16064) title, both boxes, 2 × 240 s each: main 6.58–6.69 FPS, this PR 6.61–6.79, no faults. Sword of the Sea (PPSA25344) title, RTX 3060, 3 boots each: 9.70 / 9.70 / 9.70 vs 9.70 / 9.65 / 9.60 FPS, no faults.

  • ctest -R '^agc_' (RTX 4060): the same failures as on main (agc_shader_disk_cache; agc_driver_gpu_indirect_arguments_misaligned_writer_ahead doesn't compile with this toolchain on main either). agc_reimport_bench and every host-import test pass; 19 libc guest-memory tests (guest_memory, mmap/mprotect, heap, write-watch) pass.
  • Rebased onto main d17f456ea (conflicts with the import retirement and lease-wait rework in GuestBufferMemory.cpp). On the rebased branch, RTX 4060: agc_reimport_bench first import 561 ms, the five re-imports 0.00–0.02 ms each; 53 host-import, settle, guest-memory and libc tests pass and 2 skip (agc_import_settle_first_use: the race it looks for did not happen in that run; agc_host_import_sparse: Linux only).
  • Review round on 68f1d5e5f (RTX 4060): agc_trimmed_import, agc_reimport_bench, agc_driver_host_import_lifetime (its partialUnmap now expects the kept side to stay imported, with 1 MiB parts so the cut trims on Windows as on Linux), 56 host-import, settle, guest-memory and libc tests and all 57 agc_driver_recorder_tests entries pass, with the same two skips as before. The import tests also pass with APS5_ASSERT_GPU_LOCK=1, under which KeepThroughHold aborts when it is reached without GpuMutex. The bench and the new test are registered on Windows only (on Linux the bench's skip line would not pass check_skips.py).
  • tools/check_conventions.py --base origin/main passes; git diff --check clean.

Performance capture (as the Performance report form describes): Minecraft Dungeons II (PPSA16064) title screen, RTX 4060 8 GB (i5-14400F), NVIDIA 617.42, Windows 10.0.19045, 3840x2160 output. Only APS5_TRACE_SECONDS=120:12 and APS5_TEXTURE_CACHE_MIB=3072 (8 GB card) set, caches warm (the title ran once on the build and was restarted), stderr not redirected. main d17f456eac against this PR's head 99581456c367:

Frame and GPU times (ms):

Metric Baseline Candidate Change Change (%)
frame_ms.p50 131.361 131.524 +0.163 +0.124
frame_ms.p90 135.608 137.599 +1.991 +1.468
frame_ms.p99 139.872 152.670 +12.798 +9.150
frame_ms.max 139.872 152.670 +12.798 +9.150
mean_frame_ms 131.442 131.929 +0.487 +0.370
gpu_busy_ms_per_present 102.843 102.829 -0.014 -0.014

Top phases (ms per frame):

Metric Baseline Candidate Change Change (%)
Driver.Dispatch 87.488 88.871 +1.383 +1.581
Driver.Packet 260.994 261.940 +0.946 +0.362
Driver.Packet.device_lock 43.163 41.813 -1.350 -3.128
Driver.Packet.dispatch 88.228 89.777 +1.549 +1.756
Driver.Packet.memory_wait 72.045 71.524 -0.521 -0.723
Driver.Packet.prepare_memory 27.345 28.221 +0.876 +3.204
Vulkan.Dispatch 38.619 39.970 +1.351 +3.498
Vulkan.Dispatch.shader_resources 35.576 37.069 +1.493 +4.197
{"commit":"d17f456eac16","dirty":false,"env":{"APS5_TEXTURE_CACHE_MIB":"3072","APS5_TRACE_SECONDS":"120:12"},"gpu":"NVIDIA GeForce RTX 4060","driver":"NVIDIA 617.42","os":"Windows 10.0.19045","resolution":"3840x2160","window":{"spec":"seconds 120:12","first_present":2073,"ms":12092.669},"presents":92,"frame_ms":{"p50":131.361,"p90":135.608,"p99":139.872,"max":139.872},"gpu_busy_ms_per_present":102.843,"worker_busy_pct":{"queue worker 0x0":99.344,"queue worker 0x20":99.332},"top_phases_ms_per_frame":{"Driver.Packet":260.994,"Driver.Packet.dispatch":88.228,"Driver.Dispatch":87.488,"Driver.Packet.memory_wait":72.045,"Driver.Packet.device_lock":43.163,"Vulkan.Dispatch":38.619,"Vulkan.Dispatch.shader_resources":35.576,"Driver.Packet.prepare_memory":27.345},"trace_dropped":false,"trace":"aps5-trace-d17f456eac16-21960.json.gz"}
{"commit":"99581456c367","dirty":false,"env":{"APS5_TEXTURE_CACHE_MIB":"3072","APS5_TRACE_SECONDS":"120:12"},"gpu":"NVIDIA GeForce RTX 4060","driver":"NVIDIA 617.42","os":"Windows 10.0.19045","resolution":"3840x2160","window":{"spec":"seconds 120:12","first_present":2085,"ms":12137.451},"presents":92,"frame_ms":{"p50":131.524,"p90":137.599,"p99":152.670,"max":152.670},"gpu_busy_ms_per_present":102.829,"worker_busy_pct":{"queue worker 0x0":99.332,"queue worker 0x20":99.328},"top_phases_ms_per_frame":{"Driver.Packet":261.940,"Driver.Packet.dispatch":89.777,"Driver.Dispatch":88.871,"Driver.Packet.memory_wait":71.524,"Driver.Packet.device_lock":41.813,"Vulkan.Dispatch":39.970,"Vulkan.Dispatch.shader_resources":37.069,"Driver.Packet.prepare_memory":28.221},"trace_dropped":false,"trace":"aps5-trace-99581456c367-13492.json.gz"}

Traces: aps5-trace-d17f456eac16-21960.json.gz (main) and aps5-trace-99581456c367-13492.json.gz (this PR), attached below.

trace_digest.py, main

seconds 120:12 from present 2073: 92 presents, frame p50 131.4 / p90 135.6 / p99 139.9 / max 139.9 ms, GPU busy 102.8 ms per present
NVIDIA GeForce RTX 4060, NVIDIA 617.42, Windows 10.0.19045, 3840x2160, commit d17f456eac, dropped: no

{"commit":"d17f456eac16","dirty":false,"env":{"APS5_TEXTURE_CACHE_MIB":"3072","APS5_TRACE_SECONDS":"120:12"},"gpu":"NVIDIA GeForce RTX 4060","driver":"NVIDIA 617.42","os":"Windows 10.0.19045","resolution":"3840x2160","window":{"spec":"seconds 120:12","first_present":2073,"ms":12092.669},"presents":92,"frame_ms":{"p50":131.361,"p90":135.608,"p99":139.872,"max":139.872},"gpu_busy_ms_per_present":102.843,"worker_busy_pct":{"queue worker 0x0":99.344,"queue worker 0x20":99.332},"top_phases_ms_per_frame":{"Driver.Packet":260.994,"Driver.Packet.dispatch":88.228,"Driver.Dispatch":87.488,"Driver.Packet.memory_wait":72.045,"Driver.Packet.device_lock":43.163,"Vulkan.Dispatch":38.619,"Vulkan.Dispatch.shader_resources":35.576,"Driver.Packet.prepare_memory":27.345},"trace_dropped":false,"trace":"aps5-trace-d17f456eac16-21960.json.gz"}

Slowest frames (largest slices inside each, inclusive)

  • present 2155: 139.9 ms at 10764 ms: Driver.Packet (queue worker 0x20) 138.2, Driver.Packet (queue worker 0x0) 133.3, batch (gpu) 104.8, Driver.Packet.dispatch (queue worker 0x20) 63.8
  • present 2108: 139.8 ms at 4565 ms: Driver.Packet (queue worker 0x20) 138.1, Driver.Packet (queue worker 0x0) 133.3, batch (gpu) 105.0, Driver.Packet.dispatch (queue worker 0x20) 68.4
  • present 2156: 138.8 ms at 10904 ms: Driver.Packet (queue worker 0x20) 136.8, Driver.Packet (queue worker 0x0) 132.6, batch (gpu) 103.2, Driver.Packet.dispatch (queue worker 0x20) 62.3
  • present 2123: 138.6 ms at 6554 ms: Driver.Packet (queue worker 0x20) 136.8, Driver.Packet (queue worker 0x0) 132.2, batch (gpu) 105.0, Driver.Packet.dispatch (queue worker 0x20) 73.6
  • present 2091: 138.4 ms at 2348 ms: Driver.Packet (queue worker 0x20) 136.8, Driver.Packet (queue worker 0x0) 131.7, batch (gpu) 106.5, Driver.Packet.dispatch (queue worker 0x20) 72.3

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
queue worker 0x0 100.2 (76 %) 24.8 (19 %) 6.4 35.2 Driver.Packet 125.0, Driver.EndSubmission 0.0
queue worker 0x20 42.6 (32 %) 86.8 (66 %) 2.1 7.8 Driver.Packet 128.9, Driver.EndSubmission 0.1
presenter 0.7 (1 %) 0.1 (0 %) 130.7 0.1 VideoOut.Flip 0.8, Driver.Present 0.0
gpu 102.8 (78 %) 0.0 (0 %) 28.6 0.0 batch 102.8

Largest slices (ms per frame, inclusive, all threads): Driver.Packet 253.9, batch 102.8, Driver.Packet.dispatch 88.0, Driver.Dispatch 87.1, Driver.Packet.memory_wait 71.9, Driver.Packet.device_lock 41.1, Vulkan.Dispatch 37.9, Vulkan.Dispatch.shader_resources 34.7, Driver.Packet.draw 24.8, Driver.Draw 24.6

Longest waits

  • Driver.Packet.memory_wait (queue worker 0x0) 41.1 ms at 6084 ms, present 2119
  • Driver.Packet.memory_wait (queue worker 0x0) 40.3 ms at 3987 ms, present 2103
  • Driver.Packet.memory_wait (queue worker 0x0) 39.1 ms at 590 ms, present 2077
  • Driver.Packet.memory_wait (queue worker 0x0) 37.5 ms at 9510 ms, present 2145
  • Driver.Packet.memory_wait (queue worker 0x0) 37.1 ms at 3604 ms, present 2100
  • Driver.Packet.memory_wait (queue worker 0x0) 36.8 ms at 1760 ms, present 2086
  • Driver.Packet.memory_wait (queue worker 0x20) 36.0 ms at 8106 ms, present 2134
  • Driver.Packet.memory_wait (queue worker 0x20) 35.7 ms at 10599 ms, present 2153
  • Driver.Packet.memory_wait (queue worker 0x20) 35.7 ms at 5734 ms, present 2116
  • Driver.Packet.memory_wait (queue worker 0x20) 35.6 ms at 4940 ms, present 2110

Largest GPU batches (GPU ranges inside, and the CPU slices that recorded each, inclusive)

  • batch 1693: 13.8 ms at 3093 ms, present 2096: GPU no ranges; recorded by Recorder.WaitSerial (queue worker 0x20) 14.6, Driver.Packet (queue worker 0x20) 1.6, Driver.Packet.dispatch (queue worker 0x20) 1.2, Driver.Dispatch (queue worker 0x20) 1.1
  • batch 2597: 12.9 ms at 4781 ms, present 2109: GPU no ranges; recorded by no CPU slices
  • batch 406: 12.4 ms at 736 ms, present 2078: GPU no ranges; recorded by Recorder.WaitSerial (queue worker 0x20) 13.4, Driver.Packet (queue worker 0x20) 1.9, Driver.Packet.dispatch (queue worker 0x20) 1.5, Driver.Dispatch (queue worker 0x20) 1.4
  • batch 3795: 12.3 ms at 7030 ms, present 2126: GPU no ranges; recorded by Recorder.WaitSerial (queue worker 0x20) 13.2, Driver.Packet (queue worker 0x20) 1.5, Driver.Packet.dispatch (queue worker 0x20) 1.1, Driver.Dispatch (queue worker 0x20) 1.0
  • batch 1551: 12.3 ms at 2833 ms, present 2094: GPU no ranges; recorded by Recorder.WaitSerial (queue worker 0x20) 14.1, Driver.Packet (queue worker 0x20) 2.1, Driver.Packet.dispatch (queue worker 0x20) 1.4, Driver.Dispatch (queue worker 0x20) 1.4
trace_digest.py, this PR

seconds 120:12 from present 2085: 92 presents, frame p50 131.5 / p90 137.6 / p99 152.7 / max 152.7 ms, GPU busy 102.8 ms per present
NVIDIA GeForce RTX 4060, NVIDIA 617.42, Windows 10.0.19045, 3840x2160, commit 99581456c367, dropped: no

{"commit":"99581456c367","dirty":false,"env":{"APS5_TEXTURE_CACHE_MIB":"3072","APS5_TRACE_SECONDS":"120:12"},"gpu":"NVIDIA GeForce RTX 4060","driver":"NVIDIA 617.42","os":"Windows 10.0.19045","resolution":"3840x2160","window":{"spec":"seconds 120:12","first_present":2085,"ms":12137.451},"presents":92,"frame_ms":{"p50":131.524,"p90":137.599,"p99":152.67,"max":152.67},"gpu_busy_ms_per_present":102.829,"worker_busy_pct":{"queue worker 0x0":99.332,"queue worker 0x20":99.328},"top_phases_ms_per_frame":{"Driver.Packet":261.94,"Driver.Packet.dispatch":89.777,"Driver.Dispatch":88.871,"Driver.Packet.memory_wait":71.524,"Driver.Packet.device_lock":41.813,"Vulkan.Dispatch":39.97,"Vulkan.Dispatch.shader_resources":37.069,"Driver.Packet.prepare_memory":28.221},"trace_dropped":false,"trace":"aps5-trace-99581456c367-13492.json.gz"}

Slowest frames (largest slices inside each, inclusive)

  • present 2103: 152.7 ms at 2367 ms: Driver.Packet (queue worker 0x20) 150.8, Driver.Packet (queue worker 0x0) 146.1, batch (gpu) 107.1, Driver.Packet.dispatch (queue worker 0x20) 77.4
  • present 2119: 145.0 ms at 4479 ms: Driver.Packet (queue worker 0x20) 143.1, Driver.Packet (queue worker 0x0) 138.5, batch (gpu) 105.2, Driver.Packet.dispatch (queue worker 0x20) 66.9
  • present 2087: 144.1 ms at 266 ms: Driver.Packet (queue worker 0x20) 142.4, Driver.Packet (queue worker 0x0) 137.4, batch (gpu) 104.7, Driver.Packet.dispatch (queue worker 0x20) 64.6
  • present 2135: 144.1 ms at 6585 ms: Driver.Packet (queue worker 0x20) 142.2, Driver.Packet (queue worker 0x0) 137.5, batch (gpu) 104.3, Driver.Packet.dispatch (queue worker 0x20) 63.9
  • present 2145: 144.0 ms at 7913 ms: Driver.Packet (queue worker 0x20) 142.2, Driver.Packet (queue worker 0x0) 137.5, batch (gpu) 106.5, Driver.Packet.dispatch (queue worker 0x20) 72.9

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
queue worker 0x0 100.6 (76 %) 24.9 (19 %) 6.5 35.2 Driver.Packet 125.5, Driver.EndSubmission 0.0
queue worker 0x20 42.5 (32 %) 87.4 (66 %) 2.1 7.7 Driver.Packet 129.4, Driver.EndSubmission 0.1
presenter 0.7 (1 %) 0.1 (0 %) 131.2 0.1 VideoOut.Flip 0.8, Driver.Present 0.0
gpu 102.9 (78 %) 0.0 (0 %) 29.1 0.0 batch 102.9

Largest slices (ms per frame, inclusive, all threads): Driver.Packet 254.9, batch 102.9, Driver.Packet.dispatch 89.5, Driver.Dispatch 88.5, Driver.Packet.memory_wait 71.4, Driver.Packet.device_lock 39.8, Vulkan.Dispatch 39.3, Vulkan.Dispatch.shader_resources 36.2, Driver.Packet.prepare_memory 25.5, Driver.Packet.draw 25.2

Longest waits

  • Driver.Packet.memory_wait (queue worker 0x0) 40.4 ms at 5471 ms, present 2126
  • Driver.Packet.memory_wait (queue worker 0x0) 39.5 ms at 2973 ms, present 2107
  • Driver.Packet.memory_wait (queue worker 0x0) 39.1 ms at 10230 ms, present 2162
  • Driver.Packet.memory_wait (queue worker 0x0) 38.3 ms at 3484 ms, present 2111
  • Driver.Packet.memory_wait (queue worker 0x0) 37.3 ms at 7706 ms, present 2143
  • Driver.Packet.memory_wait (queue worker 0x0) 37.2 ms at 8631 ms, present 2150
  • Driver.Packet.memory_wait (queue worker 0x20) 36.7 ms at 2331 ms, present 2102
  • Driver.Packet.memory_wait (queue worker 0x20) 35.6 ms at 4989 ms, present 2122
  • Driver.Packet.memory_wait (queue worker 0x20) 35.6 ms at 5248 ms, present 2124
  • Driver.Packet.memory_wait (queue worker 0x20) 35.2 ms at 9595 ms, present 2157

Largest GPU batches (GPU ranges inside, and the CPU slices that recorded each, inclusive)

  • batch 4532: 13.6 ms at 8131 ms, present 2146: GPU no ranges; recorded by Recorder.WaitSerial (queue worker 0x20) 16.0, Driver.Packet (queue worker 0x20) 1.8, Driver.Packet.dispatch (queue worker 0x20) 1.3, Driver.Dispatch (queue worker 0x20) 1.3
  • batch 4898: 12.9 ms at 8783 ms, present 2151: GPU no ranges; recorded by Recorder.WaitSerial (queue worker 0x20) 12.9, Driver.Packet (queue worker 0x20) 1.7, Driver.Packet.dispatch (queue worker 0x20) 1.3, Driver.Dispatch (queue worker 0x20) 1.2
  • batch 272: 12.7 ms at 488 ms, present 2088: GPU no ranges; recorded by Recorder.WaitSerial (queue worker 0x20) 14.8, Driver.Packet (queue worker 0x20) 1.6, Driver.Packet.dispatch (queue worker 0x20) 1.1, Driver.Dispatch (queue worker 0x20) 1.1
  • batch 769: 12.5 ms at 1376 ms, present 2095: GPU no ranges; recorded by no CPU slices
  • batch 2633: 12.5 ms at 4701 ms, present 2120: GPU no ranges; recorded by no CPU slices

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: PPSA21567 (Astro Bot): hitches and boot time from re-imports, reported on #6060
  • GPUs tested: NVIDIA GeForce RTX 4060 8 GB, driver 617.42, Windows 10; NVIDIA GeForce RTX 3060 12 GB, driver 617.42, Windows 10
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4877406924 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6499). Originally posted by [parl0v](https://github.com/parl0v) on 2026-10-15T17:38:32Z. --- ### What A guest `mprotect`/`munmap` over part of a registered range rebuilds every piece of that range as a new `Range`, the untouched ones included. A host import pinning the range is retired from the pin waiter during the guest call, and the next access imports the remaining tail again from scratch: a new `VkDeviceMemory` import, and on Windows since #6060 a new watched window (zero scan of every page, copy of the nonzero ones, write walks) and a settle. For a large range whose start moves up a little at a time, that is hundreds of milliseconds per step for pages that are still imported. Now an import whose head or tail is cut off is kept, and so is the larger side of an import cut strictly inside its range (the tail when both sides are equal; the smaller side is imported again). At the next refresh it is re-attached to the largest current range inside the surviving piece: a new `VkBuffer` is bound to the same imported memory at the new offset, so nothing is pinned, scanned, copied or settled again. To keep this exact, `GuestAllocations::Range` carries a backing serial: new ranges get a fresh one, the untouched pieces of a split keep it, and every span whose pages a mutation replaces (the spans that pass `RequireUnpinned`: demote to a shared section, `RemapFixedIntoRegistered`, alias and resident mappings, protect and unmap) gets a fresh one. A trim is used only for a plain host-pointer import (no alias, dma-buf, chunked or joined import) whose surviving range has the same serial, does not overlap another import, is exactly what a new import would cover, and accepts a buffer at that offset; anything else is retired and re-imported as before. The original memory stays pinned until the trimmed import retires, and `liveBytes` and the eviction accounting count it. A trimmed import that is released instead of re-attached is held through the active recorder (`KeepThroughHold`), as a retired import is, so no batch in flight can still use its memory. One exception since the rebase onto current `main`: an import that still has a deferred settle pending (`pendingSettles`, Windows) is retired as before instead of trimmed. That settle's read can still be in flight on the settle queue through the import's old buffer, and a trim moves the import's base, so the settle would no longer match it. Pending settles are short-lived (imports under 1 MiB until their read finishes, larger ones until the next poll), so the large re-imported ranges this is about still trim. ### Tested Windows 10 19045, MinGW-w64 GCC 15.2, NVIDIA 617.42, RTX 4060 and RTX 3060. **Synthetic (new `agc_reimport_bench`, RTX 4060):** 1126 MiB of singly mapped direct memory, 1 page in 4 nonzero, imported through `HostImportFor`; then 5 times the next 1440 KiB of the head is protected and `[start + k·1440 KiB, end)` is accessed again. Medians of 3 runs: | | `main`: guest protect / re-import | this PR | |---|---|---| | first import, 1126 MiB | – / 769 ms | – / 719 ms (same path) | | k = 1..5 | 27–30 ms / **472–560 ms** | 0.04–0.15 ms / **0.00–0.02 ms** | On `main` each re-import was ~170 ms import create, ~30 ms settle and ~400 ms in `ImportWatched` (zero scan 75–150 ms, copy 73–122 ms, walks ~35 ms). The test also checks that after five trims the tail is still watched with no false writes, CPU stores at both ends are collected, and a GPU copy through the trimmed buffer (offset 0 and last page) equals guest memory. This is the pattern @Sevthered measured on Astro Bot (PPSA21567) on #6060: five re-imports of a ~1.1 GiB range ending at `0x37e000000` with its start moving up, 295–348 ms each, as long frames in the logo sequence. **Cuts at the tail and inside the range (`agc_reimport_bench`, RTX 4060, NVIDIA 617.42):** three patterns, each on a fresh 1126 MiB range, 5 cuts each, 3 runs. "Before" is this branch with the trim forced off, so every cut takes `retireImport`, `main`'s path: | pattern | before: kept side imported again / import after the cut | after | |---|---|---| | head, 1440 KiB lose GPU access per cut | 5/5 / 386–431 ms | 0/5 / ≤0.02 ms | | tail, the same at the end | 5/5 / 379–416 ms | 0/5 / ≤0.01 ms | | inside: a 16 KiB no-access page 256 MiB in, then 1440 KiB above the last | 5/5 / 285–306 ms | 0/5 / ≤0.02 ms | The guest's protect drops from 18–22 ms to under 0.15 ms. A cut inside still imports the smaller side (256 MiB: 86–105 ms on both builds). **`agc_trimmed_import` (Windows):** 32 MiB of singly mapped direct memory imported whole, then a 16 KiB no-access page near the start and near the end, an unmap of a 2 MiB run inside, an unmap of the first 2 MiB run, an unmap of the first 1440 KiB (which splits a 2 MiB resident run, so the kept side gets a new backing serial and is imported again), and an unmap of the whole kept side while the import waits trimmed. Every unmapped span is mapped again at the same address. Each case checks through a GPU copy that the import reads fresh CPU stores at both ends, that the write watch collects them and reports nothing else, and that pages mapped again are served by a new import. With the interior branch removed the first case fails; with the backing-serial check removed from `reattachTrimmed` the last case fails (the GPU reads the old pinned pages). **Titles without that pattern, no change** (same relinked executables, alternating, `APS5_PROFILE_DRAW=1`): Minecraft Dungeons II (PPSA16064) title, both boxes, 2 × 240 s each: `main` 6.58–6.69 FPS, this PR 6.61–6.79, no faults. Sword of the Sea (PPSA25344) title, RTX 3060, 3 boots each: 9.70 / 9.70 / 9.70 vs 9.70 / 9.65 / 9.60 FPS, no faults. - `ctest -R '^agc_'` (RTX 4060): the same failures as on `main` (`agc_shader_disk_cache`; `agc_driver_gpu_indirect_arguments_misaligned_writer_ahead` doesn't compile with this toolchain on `main` either). `agc_reimport_bench` and every host-import test pass; 19 libc guest-memory tests (guest_memory, mmap/mprotect, heap, write-watch) pass. - Rebased onto `main` d17f456ea (conflicts with the import retirement and lease-wait rework in `GuestBufferMemory.cpp`). On the rebased branch, RTX 4060: `agc_reimport_bench` first import 561 ms, the five re-imports 0.00–0.02 ms each; 53 host-import, settle, guest-memory and libc tests pass and 2 skip (`agc_import_settle_first_use`: the race it looks for did not happen in that run; `agc_host_import_sparse`: Linux only). - Review round on 68f1d5e5f (RTX 4060): `agc_trimmed_import`, `agc_reimport_bench`, `agc_driver_host_import_lifetime` (its `partialUnmap` now expects the kept side to stay imported, with 1 MiB parts so the cut trims on Windows as on Linux), 56 host-import, settle, guest-memory and libc tests and all 57 `agc_driver_recorder_tests` entries pass, with the same two skips as before. The import tests also pass with `APS5_ASSERT_GPU_LOCK=1`, under which `KeepThroughHold` aborts when it is reached without `GpuMutex`. The bench and the new test are registered on Windows only (on Linux the bench's skip line would not pass `check_skips.py`). - `tools/check_conventions.py --base origin/main` passes; `git diff --check` clean. **Performance capture** (as the Performance report form describes): Minecraft Dungeons II (PPSA16064) title screen, RTX 4060 8 GB (i5-14400F), NVIDIA 617.42, Windows 10.0.19045, 3840x2160 output. Only `APS5_TRACE_SECONDS=120:12` and `APS5_TEXTURE_CACHE_MIB=3072` (8 GB card) set, caches warm (the title ran once on the build and was restarted), stderr not redirected. `main` d17f456eac16 against this PR's head 99581456c367: Frame and GPU times (ms): | Metric | Baseline | Candidate | Change | Change (%) | | --- | ---: | ---: | ---: | ---: | | frame_ms.p50 | 131.361 | 131.524 | +0.163 | +0.124 | | frame_ms.p90 | 135.608 | 137.599 | +1.991 | +1.468 | | frame_ms.p99 | 139.872 | 152.670 | +12.798 | +9.150 | | frame_ms.max | 139.872 | 152.670 | +12.798 | +9.150 | | mean_frame_ms | 131.442 | 131.929 | +0.487 | +0.370 | | gpu_busy_ms_per_present | 102.843 | 102.829 | -0.014 | -0.014 | Top phases (ms per frame): | Metric | Baseline | Candidate | Change | Change (%) | | --- | ---: | ---: | ---: | ---: | | Driver.Dispatch | 87.488 | 88.871 | +1.383 | +1.581 | | Driver.Packet | 260.994 | 261.940 | +0.946 | +0.362 | | Driver.Packet.device_lock | 43.163 | 41.813 | -1.350 | -3.128 | | Driver.Packet.dispatch | 88.228 | 89.777 | +1.549 | +1.756 | | Driver.Packet.memory_wait | 72.045 | 71.524 | -0.521 | -0.723 | | Driver.Packet.prepare_memory | 27.345 | 28.221 | +0.876 | +3.204 | | Vulkan.Dispatch | 38.619 | 39.970 | +1.351 | +3.498 | | Vulkan.Dispatch.shader_resources | 35.576 | 37.069 | +1.493 | +4.197 | ```json {"commit":"d17f456eac16","dirty":false,"env":{"APS5_TEXTURE_CACHE_MIB":"3072","APS5_TRACE_SECONDS":"120:12"},"gpu":"NVIDIA GeForce RTX 4060","driver":"NVIDIA 617.42","os":"Windows 10.0.19045","resolution":"3840x2160","window":{"spec":"seconds 120:12","first_present":2073,"ms":12092.669},"presents":92,"frame_ms":{"p50":131.361,"p90":135.608,"p99":139.872,"max":139.872},"gpu_busy_ms_per_present":102.843,"worker_busy_pct":{"queue worker 0x0":99.344,"queue worker 0x20":99.332},"top_phases_ms_per_frame":{"Driver.Packet":260.994,"Driver.Packet.dispatch":88.228,"Driver.Dispatch":87.488,"Driver.Packet.memory_wait":72.045,"Driver.Packet.device_lock":43.163,"Vulkan.Dispatch":38.619,"Vulkan.Dispatch.shader_resources":35.576,"Driver.Packet.prepare_memory":27.345},"trace_dropped":false,"trace":"aps5-trace-d17f456eac16-21960.json.gz"} {"commit":"99581456c367","dirty":false,"env":{"APS5_TEXTURE_CACHE_MIB":"3072","APS5_TRACE_SECONDS":"120:12"},"gpu":"NVIDIA GeForce RTX 4060","driver":"NVIDIA 617.42","os":"Windows 10.0.19045","resolution":"3840x2160","window":{"spec":"seconds 120:12","first_present":2085,"ms":12137.451},"presents":92,"frame_ms":{"p50":131.524,"p90":137.599,"p99":152.670,"max":152.670},"gpu_busy_ms_per_present":102.829,"worker_busy_pct":{"queue worker 0x0":99.332,"queue worker 0x20":99.328},"top_phases_ms_per_frame":{"Driver.Packet":261.940,"Driver.Packet.dispatch":89.777,"Driver.Dispatch":88.871,"Driver.Packet.memory_wait":71.524,"Driver.Packet.device_lock":41.813,"Vulkan.Dispatch":39.970,"Vulkan.Dispatch.shader_resources":37.069,"Driver.Packet.prepare_memory":28.221},"trace_dropped":false,"trace":"aps5-trace-99581456c367-13492.json.gz"} ``` Traces: `aps5-trace-d17f456eac16-21960.json.gz` (`main`) and `aps5-trace-99581456c367-13492.json.gz` (this PR), attached below. <details><summary>trace_digest.py, main</summary> **seconds 120:12** from present 2073: 92 presents, frame p50 131.4 / p90 135.6 / p99 139.9 / max 139.9 ms, GPU busy 102.8 ms per present NVIDIA GeForce RTX 4060, NVIDIA 617.42, Windows 10.0.19045, 3840x2160, commit d17f456eac16, dropped: no ```json {"commit":"d17f456eac16","dirty":false,"env":{"APS5_TEXTURE_CACHE_MIB":"3072","APS5_TRACE_SECONDS":"120:12"},"gpu":"NVIDIA GeForce RTX 4060","driver":"NVIDIA 617.42","os":"Windows 10.0.19045","resolution":"3840x2160","window":{"spec":"seconds 120:12","first_present":2073,"ms":12092.669},"presents":92,"frame_ms":{"p50":131.361,"p90":135.608,"p99":139.872,"max":139.872},"gpu_busy_ms_per_present":102.843,"worker_busy_pct":{"queue worker 0x0":99.344,"queue worker 0x20":99.332},"top_phases_ms_per_frame":{"Driver.Packet":260.994,"Driver.Packet.dispatch":88.228,"Driver.Dispatch":87.488,"Driver.Packet.memory_wait":72.045,"Driver.Packet.device_lock":43.163,"Vulkan.Dispatch":38.619,"Vulkan.Dispatch.shader_resources":35.576,"Driver.Packet.prepare_memory":27.345},"trace_dropped":false,"trace":"aps5-trace-d17f456eac16-21960.json.gz"} ``` **Slowest frames** (largest slices inside each, inclusive) - present 2155: 139.9 ms at 10764 ms: Driver.Packet (queue worker 0x20) 138.2, Driver.Packet (queue worker 0x0) 133.3, batch (gpu) 104.8, Driver.Packet.dispatch (queue worker 0x20) 63.8 - present 2108: 139.8 ms at 4565 ms: Driver.Packet (queue worker 0x20) 138.1, Driver.Packet (queue worker 0x0) 133.3, batch (gpu) 105.0, Driver.Packet.dispatch (queue worker 0x20) 68.4 - present 2156: 138.8 ms at 10904 ms: Driver.Packet (queue worker 0x20) 136.8, Driver.Packet (queue worker 0x0) 132.6, batch (gpu) 103.2, Driver.Packet.dispatch (queue worker 0x20) 62.3 - present 2123: 138.6 ms at 6554 ms: Driver.Packet (queue worker 0x20) 136.8, Driver.Packet (queue worker 0x0) 132.2, batch (gpu) 105.0, Driver.Packet.dispatch (queue worker 0x20) 73.6 - present 2091: 138.4 ms at 2348 ms: Driver.Packet (queue worker 0x20) 136.8, Driver.Packet (queue worker 0x0) 131.7, batch (gpu) 106.5, Driver.Packet.dispatch (queue worker 0x20) 72.3 **Threads** (ms per frame) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | queue worker 0x0 | 100.2 (76 %) | 24.8 (19 %) | 6.4 | 35.2 | Driver.Packet 125.0, Driver.EndSubmission 0.0 | | queue worker 0x20 | 42.6 (32 %) | 86.8 (66 %) | 2.1 | 7.8 | Driver.Packet 128.9, Driver.EndSubmission 0.1 | | presenter | 0.7 (1 %) | 0.1 (0 %) | 130.7 | 0.1 | VideoOut.Flip 0.8, Driver.Present 0.0 | | gpu | 102.8 (78 %) | 0.0 (0 %) | 28.6 | 0.0 | batch 102.8 | **Largest slices** (ms per frame, inclusive, all threads): Driver.Packet 253.9, batch 102.8, Driver.Packet.dispatch 88.0, Driver.Dispatch 87.1, Driver.Packet.memory_wait 71.9, Driver.Packet.device_lock 41.1, Vulkan.Dispatch 37.9, Vulkan.Dispatch.shader_resources 34.7, Driver.Packet.draw 24.8, Driver.Draw 24.6 **Longest waits** - Driver.Packet.memory_wait (queue worker 0x0) 41.1 ms at 6084 ms, present 2119 - Driver.Packet.memory_wait (queue worker 0x0) 40.3 ms at 3987 ms, present 2103 - Driver.Packet.memory_wait (queue worker 0x0) 39.1 ms at 590 ms, present 2077 - Driver.Packet.memory_wait (queue worker 0x0) 37.5 ms at 9510 ms, present 2145 - Driver.Packet.memory_wait (queue worker 0x0) 37.1 ms at 3604 ms, present 2100 - Driver.Packet.memory_wait (queue worker 0x0) 36.8 ms at 1760 ms, present 2086 - Driver.Packet.memory_wait (queue worker 0x20) 36.0 ms at 8106 ms, present 2134 - Driver.Packet.memory_wait (queue worker 0x20) 35.7 ms at 10599 ms, present 2153 - Driver.Packet.memory_wait (queue worker 0x20) 35.7 ms at 5734 ms, present 2116 - Driver.Packet.memory_wait (queue worker 0x20) 35.6 ms at 4940 ms, present 2110 **Largest GPU batches** (GPU ranges inside, and the CPU slices that recorded each, inclusive) - batch 1693: 13.8 ms at 3093 ms, present 2096: GPU no ranges; recorded by Recorder.WaitSerial (queue worker 0x20) 14.6, Driver.Packet (queue worker 0x20) 1.6, Driver.Packet.dispatch (queue worker 0x20) 1.2, Driver.Dispatch (queue worker 0x20) 1.1 - batch 2597: 12.9 ms at 4781 ms, present 2109: GPU no ranges; recorded by no CPU slices - batch 406: 12.4 ms at 736 ms, present 2078: GPU no ranges; recorded by Recorder.WaitSerial (queue worker 0x20) 13.4, Driver.Packet (queue worker 0x20) 1.9, Driver.Packet.dispatch (queue worker 0x20) 1.5, Driver.Dispatch (queue worker 0x20) 1.4 - batch 3795: 12.3 ms at 7030 ms, present 2126: GPU no ranges; recorded by Recorder.WaitSerial (queue worker 0x20) 13.2, Driver.Packet (queue worker 0x20) 1.5, Driver.Packet.dispatch (queue worker 0x20) 1.1, Driver.Dispatch (queue worker 0x20) 1.0 - batch 1551: 12.3 ms at 2833 ms, present 2094: GPU no ranges; recorded by Recorder.WaitSerial (queue worker 0x20) 14.1, Driver.Packet (queue worker 0x20) 2.1, Driver.Packet.dispatch (queue worker 0x20) 1.4, Driver.Dispatch (queue worker 0x20) 1.4 </details> <details><summary>trace_digest.py, this PR</summary> **seconds 120:12** from present 2085: 92 presents, frame p50 131.5 / p90 137.6 / p99 152.7 / max 152.7 ms, GPU busy 102.8 ms per present NVIDIA GeForce RTX 4060, NVIDIA 617.42, Windows 10.0.19045, 3840x2160, commit 99581456c367, dropped: no ```json {"commit":"99581456c367","dirty":false,"env":{"APS5_TEXTURE_CACHE_MIB":"3072","APS5_TRACE_SECONDS":"120:12"},"gpu":"NVIDIA GeForce RTX 4060","driver":"NVIDIA 617.42","os":"Windows 10.0.19045","resolution":"3840x2160","window":{"spec":"seconds 120:12","first_present":2085,"ms":12137.451},"presents":92,"frame_ms":{"p50":131.524,"p90":137.599,"p99":152.67,"max":152.67},"gpu_busy_ms_per_present":102.829,"worker_busy_pct":{"queue worker 0x0":99.332,"queue worker 0x20":99.328},"top_phases_ms_per_frame":{"Driver.Packet":261.94,"Driver.Packet.dispatch":89.777,"Driver.Dispatch":88.871,"Driver.Packet.memory_wait":71.524,"Driver.Packet.device_lock":41.813,"Vulkan.Dispatch":39.97,"Vulkan.Dispatch.shader_resources":37.069,"Driver.Packet.prepare_memory":28.221},"trace_dropped":false,"trace":"aps5-trace-99581456c367-13492.json.gz"} ``` **Slowest frames** (largest slices inside each, inclusive) - present 2103: 152.7 ms at 2367 ms: Driver.Packet (queue worker 0x20) 150.8, Driver.Packet (queue worker 0x0) 146.1, batch (gpu) 107.1, Driver.Packet.dispatch (queue worker 0x20) 77.4 - present 2119: 145.0 ms at 4479 ms: Driver.Packet (queue worker 0x20) 143.1, Driver.Packet (queue worker 0x0) 138.5, batch (gpu) 105.2, Driver.Packet.dispatch (queue worker 0x20) 66.9 - present 2087: 144.1 ms at 266 ms: Driver.Packet (queue worker 0x20) 142.4, Driver.Packet (queue worker 0x0) 137.4, batch (gpu) 104.7, Driver.Packet.dispatch (queue worker 0x20) 64.6 - present 2135: 144.1 ms at 6585 ms: Driver.Packet (queue worker 0x20) 142.2, Driver.Packet (queue worker 0x0) 137.5, batch (gpu) 104.3, Driver.Packet.dispatch (queue worker 0x20) 63.9 - present 2145: 144.0 ms at 7913 ms: Driver.Packet (queue worker 0x20) 142.2, Driver.Packet (queue worker 0x0) 137.5, batch (gpu) 106.5, Driver.Packet.dispatch (queue worker 0x20) 72.9 **Threads** (ms per frame) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | queue worker 0x0 | 100.6 (76 %) | 24.9 (19 %) | 6.5 | 35.2 | Driver.Packet 125.5, Driver.EndSubmission 0.0 | | queue worker 0x20 | 42.5 (32 %) | 87.4 (66 %) | 2.1 | 7.7 | Driver.Packet 129.4, Driver.EndSubmission 0.1 | | presenter | 0.7 (1 %) | 0.1 (0 %) | 131.2 | 0.1 | VideoOut.Flip 0.8, Driver.Present 0.0 | | gpu | 102.9 (78 %) | 0.0 (0 %) | 29.1 | 0.0 | batch 102.9 | **Largest slices** (ms per frame, inclusive, all threads): Driver.Packet 254.9, batch 102.9, Driver.Packet.dispatch 89.5, Driver.Dispatch 88.5, Driver.Packet.memory_wait 71.4, Driver.Packet.device_lock 39.8, Vulkan.Dispatch 39.3, Vulkan.Dispatch.shader_resources 36.2, Driver.Packet.prepare_memory 25.5, Driver.Packet.draw 25.2 **Longest waits** - Driver.Packet.memory_wait (queue worker 0x0) 40.4 ms at 5471 ms, present 2126 - Driver.Packet.memory_wait (queue worker 0x0) 39.5 ms at 2973 ms, present 2107 - Driver.Packet.memory_wait (queue worker 0x0) 39.1 ms at 10230 ms, present 2162 - Driver.Packet.memory_wait (queue worker 0x0) 38.3 ms at 3484 ms, present 2111 - Driver.Packet.memory_wait (queue worker 0x0) 37.3 ms at 7706 ms, present 2143 - Driver.Packet.memory_wait (queue worker 0x0) 37.2 ms at 8631 ms, present 2150 - Driver.Packet.memory_wait (queue worker 0x20) 36.7 ms at 2331 ms, present 2102 - Driver.Packet.memory_wait (queue worker 0x20) 35.6 ms at 4989 ms, present 2122 - Driver.Packet.memory_wait (queue worker 0x20) 35.6 ms at 5248 ms, present 2124 - Driver.Packet.memory_wait (queue worker 0x20) 35.2 ms at 9595 ms, present 2157 **Largest GPU batches** (GPU ranges inside, and the CPU slices that recorded each, inclusive) - batch 4532: 13.6 ms at 8131 ms, present 2146: GPU no ranges; recorded by Recorder.WaitSerial (queue worker 0x20) 16.0, Driver.Packet (queue worker 0x20) 1.8, Driver.Packet.dispatch (queue worker 0x20) 1.3, Driver.Dispatch (queue worker 0x20) 1.3 - batch 4898: 12.9 ms at 8783 ms, present 2151: GPU no ranges; recorded by Recorder.WaitSerial (queue worker 0x20) 12.9, Driver.Packet (queue worker 0x20) 1.7, Driver.Packet.dispatch (queue worker 0x20) 1.3, Driver.Dispatch (queue worker 0x20) 1.2 - batch 272: 12.7 ms at 488 ms, present 2088: GPU no ranges; recorded by Recorder.WaitSerial (queue worker 0x20) 14.8, Driver.Packet (queue worker 0x20) 1.6, Driver.Packet.dispatch (queue worker 0x20) 1.1, Driver.Dispatch (queue worker 0x20) 1.1 - batch 769: 12.5 ms at 1376 ms, present 2095: GPU no ranges; recorded by no CPU slices - batch 2633: 12.5 ms at 4701 ms, present 2120: GPU no ranges; recorded by no CPU slices </details> ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: PPSA21567 (Astro Bot): hitches and boot time from re-imports, reported on #6060 - [x] GPUs tested: NVIDIA GeForce RTX 4060 8 GB, driver 617.42, Windows 10; NVIDIA GeForce RTX 3060 12 GB, driver 617.42, Windows 10 - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-15 18:27:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T18:27:06Z.


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.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 6457 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp L1458-1459, L1484, L1673
PR 6479 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp L1458-1459, L1484, L1673
PR 6565 core/libs/prx/libc/src/GuestAllocations.cpp L40, L47, L382
PR 6730 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp L1367, L1445, L1458-1459, L1484, L1673
PR 6955 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp L43

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 1191 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 1324 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libc/include/GuestAllocations.hpp
core/libs/prx/libc/src/GuestAllocations.cpp
PR 1341 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 1368 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 1395 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 1835 core/libs/prx/libc/src/GuestAllocations.cpp
PR 2434 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 4448 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 4449 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 4891 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5021 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libc/include/GuestAllocations.hpp
core/libs/prx/libc/src/GuestAllocations.cpp
PR 5371 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5372 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 5426 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5480 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5499 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5656 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5925 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
docs/dev/ARCHITECTURE.md
PR 6044 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/ARCHITECTURE.md
PR 6146 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6177 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6185 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6186 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6188 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6192 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6197 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6249 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6292 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6300 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6321 core/libs/prx/libc/src/GuestAllocations.cpp
PR 6501 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6548 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6588 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6611 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6615 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6636 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6683 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6701 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6718 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6747 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6759 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6763 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
docs/dev/ARCHITECTURE.md
PR 6786 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6788 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6808 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6820 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6868 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6879 core/libs/prx/libc/src/GuestAllocations.cpp
PR 6887 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6931 docs/dev/ARCHITECTURE.md
PR 6937 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6941 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6946 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
docs/dev/ARCHITECTURE.md
PR 6947 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
docs/dev/ARCHITECTURE.md
PR 6958 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6963 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6965 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6970 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6971 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6973 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6987 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6989 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6995 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7002 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7048 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7085 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7154 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 7201 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libc/src/GuestAllocations.cpp
PR 7223 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7233 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 7258 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7292 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 7332 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libc/include/GuestAllocations.hpp
core/libs/prx/libc/src/GuestAllocations.cpp
PR 7395 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7473 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 7505 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7514 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 7604 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7615 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7618 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7642 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
docs/dev/ARCHITECTURE.md
PR 7677 core/libs/prx/libSceAgcDriver/CMakeLists.txt
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6199320828 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6499#issuecomment-6199320828). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-15T18:27:06Z. --- <!-- pr-overlap --> 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**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | [PR 6457](https://www.github.com/boykopovar/AnyPS5/pull/6457) | `core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp` [L1458-1459](https://github.com/boykopovar/AnyPS5/blob/c1ca83479f4e3faad4064fce33afcbebb3ba60d0/core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp#L1458-L1459), [L1484](https://github.com/boykopovar/AnyPS5/blob/c1ca83479f4e3faad4064fce33afcbebb3ba60d0/core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp#L1484), [L1673](https://github.com/boykopovar/AnyPS5/blob/c1ca83479f4e3faad4064fce33afcbebb3ba60d0/core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp#L1673) | | | | [PR 6479](https://www.github.com/boykopovar/AnyPS5/pull/6479) | `core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp` [L1458-1459](https://github.com/boykopovar/AnyPS5/blob/c1ca83479f4e3faad4064fce33afcbebb3ba60d0/core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp#L1458-L1459), [L1484](https://github.com/boykopovar/AnyPS5/blob/c1ca83479f4e3faad4064fce33afcbebb3ba60d0/core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp#L1484), [L1673](https://github.com/boykopovar/AnyPS5/blob/c1ca83479f4e3faad4064fce33afcbebb3ba60d0/core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp#L1673) | | | | [PR 6565](https://www.github.com/boykopovar/AnyPS5/pull/6565) | `core/libs/prx/libc/src/GuestAllocations.cpp` [L40](https://github.com/boykopovar/AnyPS5/blob/c1ca83479f4e3faad4064fce33afcbebb3ba60d0/core/libs/prx/libc/src/GuestAllocations.cpp#L40), [L47](https://github.com/boykopovar/AnyPS5/blob/c1ca83479f4e3faad4064fce33afcbebb3ba60d0/core/libs/prx/libc/src/GuestAllocations.cpp#L47), [L382](https://github.com/boykopovar/AnyPS5/blob/c1ca83479f4e3faad4064fce33afcbebb3ba60d0/core/libs/prx/libc/src/GuestAllocations.cpp#L382) | | | | [PR 6730](https://www.github.com/boykopovar/AnyPS5/pull/6730) | `core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp` [L1367](https://github.com/boykopovar/AnyPS5/blob/c1ca83479f4e3faad4064fce33afcbebb3ba60d0/core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp#L1367), [L1445](https://github.com/boykopovar/AnyPS5/blob/c1ca83479f4e3faad4064fce33afcbebb3ba60d0/core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp#L1445), [L1458-1459](https://github.com/boykopovar/AnyPS5/blob/c1ca83479f4e3faad4064fce33afcbebb3ba60d0/core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp#L1458-L1459), [L1484](https://github.com/boykopovar/AnyPS5/blob/c1ca83479f4e3faad4064fce33afcbebb3ba60d0/core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp#L1484), [L1673](https://github.com/boykopovar/AnyPS5/blob/c1ca83479f4e3faad4064fce33afcbebb3ba60d0/core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp#L1673) | | | | [PR 6955](https://www.github.com/boykopovar/AnyPS5/pull/6955) | `core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp` [L43](https://github.com/boykopovar/AnyPS5/blob/c1ca83479f4e3faad4064fce33afcbebb3ba60d0/core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp#L43) | | | Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap. | Pull request | Shared files not compared | |---|---| | [PR 1191](https://www.github.com/boykopovar/AnyPS5/pull/1191) | `core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp` | | [PR 1324](https://www.github.com/boykopovar/AnyPS5/pull/1324) | `core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp`<br>`core/libs/prx/libc/include/GuestAllocations.hpp`<br>`core/libs/prx/libc/src/GuestAllocations.cpp` | | [PR 1341](https://www.github.com/boykopovar/AnyPS5/pull/1341) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 1368](https://www.github.com/boykopovar/AnyPS5/pull/1368) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 1395](https://www.github.com/boykopovar/AnyPS5/pull/1395) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 1835](https://www.github.com/boykopovar/AnyPS5/pull/1835) | `core/libs/prx/libc/src/GuestAllocations.cpp` | | [PR 2434](https://www.github.com/boykopovar/AnyPS5/pull/2434) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp` | | [PR 4448](https://www.github.com/boykopovar/AnyPS5/pull/4448) | `core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp` | | [PR 4449](https://www.github.com/boykopovar/AnyPS5/pull/4449) | `core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp` | | [PR 4891](https://www.github.com/boykopovar/AnyPS5/pull/4891) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 5021](https://www.github.com/boykopovar/AnyPS5/pull/5021) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp`<br>`core/libs/prx/libc/include/GuestAllocations.hpp`<br>`core/libs/prx/libc/src/GuestAllocations.cpp` | | [PR 5371](https://www.github.com/boykopovar/AnyPS5/pull/5371) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 5372](https://www.github.com/boykopovar/AnyPS5/pull/5372) | `core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp` | | [PR 5426](https://www.github.com/boykopovar/AnyPS5/pull/5426) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 5480](https://www.github.com/boykopovar/AnyPS5/pull/5480) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 5499](https://www.github.com/boykopovar/AnyPS5/pull/5499) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 5656](https://www.github.com/boykopovar/AnyPS5/pull/5656) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 5925](https://www.github.com/boykopovar/AnyPS5/pull/5925) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp`<br>`docs/dev/ARCHITECTURE.md` | | [PR 6044](https://www.github.com/boykopovar/AnyPS5/pull/6044) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`docs/dev/ARCHITECTURE.md` | | [PR 6146](https://www.github.com/boykopovar/AnyPS5/pull/6146) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp` | | [PR 6177](https://www.github.com/boykopovar/AnyPS5/pull/6177) | `core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp` | | [PR 6185](https://www.github.com/boykopovar/AnyPS5/pull/6185) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 6186](https://www.github.com/boykopovar/AnyPS5/pull/6186) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 6188](https://www.github.com/boykopovar/AnyPS5/pull/6188) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 6192](https://www.github.com/boykopovar/AnyPS5/pull/6192) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 6197](https://www.github.com/boykopovar/AnyPS5/pull/6197) | `core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp` | | [PR 6249](https://www.github.com/boykopovar/AnyPS5/pull/6249) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6292](https://www.github.com/boykopovar/AnyPS5/pull/6292) | `core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp` | | [PR 6300](https://www.github.com/boykopovar/AnyPS5/pull/6300) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6321](https://www.github.com/boykopovar/AnyPS5/pull/6321) | `core/libs/prx/libc/src/GuestAllocations.cpp` | | [PR 6501](https://www.github.com/boykopovar/AnyPS5/pull/6501) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6548](https://www.github.com/boykopovar/AnyPS5/pull/6548) | `core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp` | | [PR 6588](https://www.github.com/boykopovar/AnyPS5/pull/6588) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6611](https://www.github.com/boykopovar/AnyPS5/pull/6611) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6615](https://www.github.com/boykopovar/AnyPS5/pull/6615) | `core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp` | | [PR 6636](https://www.github.com/boykopovar/AnyPS5/pull/6636) | `core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp` | | [PR 6683](https://www.github.com/boykopovar/AnyPS5/pull/6683) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 6701](https://www.github.com/boykopovar/AnyPS5/pull/6701) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6718](https://www.github.com/boykopovar/AnyPS5/pull/6718) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 6747](https://www.github.com/boykopovar/AnyPS5/pull/6747) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 6759](https://www.github.com/boykopovar/AnyPS5/pull/6759) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 6763](https://www.github.com/boykopovar/AnyPS5/pull/6763) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp`<br>`docs/dev/ARCHITECTURE.md` | | [PR 6786](https://www.github.com/boykopovar/AnyPS5/pull/6786) | `core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp` | | [PR 6788](https://www.github.com/boykopovar/AnyPS5/pull/6788) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6808](https://www.github.com/boykopovar/AnyPS5/pull/6808) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6820](https://www.github.com/boykopovar/AnyPS5/pull/6820) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 6868](https://www.github.com/boykopovar/AnyPS5/pull/6868) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 6879](https://www.github.com/boykopovar/AnyPS5/pull/6879) | `core/libs/prx/libc/src/GuestAllocations.cpp` | | [PR 6887](https://www.github.com/boykopovar/AnyPS5/pull/6887) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6931](https://www.github.com/boykopovar/AnyPS5/pull/6931) | `docs/dev/ARCHITECTURE.md` | | [PR 6937](https://www.github.com/boykopovar/AnyPS5/pull/6937) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6941](https://www.github.com/boykopovar/AnyPS5/pull/6941) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6946](https://www.github.com/boykopovar/AnyPS5/pull/6946) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp`<br>`docs/dev/ARCHITECTURE.md` | | [PR 6947](https://www.github.com/boykopovar/AnyPS5/pull/6947) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp`<br>`docs/dev/ARCHITECTURE.md` | | [PR 6958](https://www.github.com/boykopovar/AnyPS5/pull/6958) | `core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 6963](https://www.github.com/boykopovar/AnyPS5/pull/6963) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6965](https://www.github.com/boykopovar/AnyPS5/pull/6965) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6970](https://www.github.com/boykopovar/AnyPS5/pull/6970) | `core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 6971](https://www.github.com/boykopovar/AnyPS5/pull/6971) | `core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 6973](https://www.github.com/boykopovar/AnyPS5/pull/6973) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 6987](https://www.github.com/boykopovar/AnyPS5/pull/6987) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 6989](https://www.github.com/boykopovar/AnyPS5/pull/6989) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 6995](https://www.github.com/boykopovar/AnyPS5/pull/6995) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 7002](https://www.github.com/boykopovar/AnyPS5/pull/7002) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 7048](https://www.github.com/boykopovar/AnyPS5/pull/7048) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 7085](https://www.github.com/boykopovar/AnyPS5/pull/7085) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7154](https://www.github.com/boykopovar/AnyPS5/pull/7154) | `core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp` | | [PR 7201](https://www.github.com/boykopovar/AnyPS5/pull/7201) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp`<br>`core/libs/prx/libc/src/GuestAllocations.cpp` | | [PR 7223](https://www.github.com/boykopovar/AnyPS5/pull/7223) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7233](https://www.github.com/boykopovar/AnyPS5/pull/7233) | `core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp` | | [PR 7258](https://www.github.com/boykopovar/AnyPS5/pull/7258) | `core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 7292](https://www.github.com/boykopovar/AnyPS5/pull/7292) | `core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp` | | [PR 7332](https://www.github.com/boykopovar/AnyPS5/pull/7332) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp`<br>`core/libs/prx/libc/include/GuestAllocations.hpp`<br>`core/libs/prx/libc/src/GuestAllocations.cpp` | | [PR 7395](https://www.github.com/boykopovar/AnyPS5/pull/7395) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7473](https://www.github.com/boykopovar/AnyPS5/pull/7473) | `core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp` | | [PR 7505](https://www.github.com/boykopovar/AnyPS5/pull/7505) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 7514](https://www.github.com/boykopovar/AnyPS5/pull/7514) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp` | | [PR 7604](https://www.github.com/boykopovar/AnyPS5/pull/7604) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 7615](https://www.github.com/boykopovar/AnyPS5/pull/7615) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7618](https://www.github.com/boykopovar/AnyPS5/pull/7618) | `core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 7642](https://www.github.com/boykopovar/AnyPS5/pull/7642) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp`<br>`docs/dev/ARCHITECTURE.md` | | [PR 7677](https://www.github.com/boykopovar/AnyPS5/pull/7677) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` |
frankea commented 2026-10-15 20:25:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by frankea on 2026-10-15T20:25:52Z.


@parl0v the same three-round setup with this PR on top, on today's main. Astro Bot (PPSA21564 v01.018.000), RTX 4090 (NVIDIA 616.92), Ryzen 7 5800X, 3840x2160, one executable relinked from main 44df21632 with --windows --registry, libs/ swapped between main 44df21632 and main + 6af7d2cbe (merge 6ed7f1c4d), alternating, APS5_TRACE_SECONDS the only switch, no input. Two windows: the title intro (120:40, as yesterday) and the logo sequence (10:60, 110 s cap).

Window Build Round Result
intro 120:40 main 44df21632 2 19.92 FPS, p50 50.2 / p99 55.0 / max 62 ms, GPU 32.1 ms, memory_wait 94 ms
intro 120:40 main 44df21632 3 20.28 FPS, p50 49.2 / p99 53.5 / max 55 ms, GPU 30.7 ms, memory_wait 93 ms
intro 120:40 main + this PR (6ed7f1c4d) 1 20.11 FPS, p50 49.6 / p99 53.5 / max 54 ms, GPU 32.0 ms, memory_wait 93 ms
intro 120:40 main + this PR (6ed7f1c4d) 2 20.10 FPS, p50 49.8 / p99 53.4 / max 55 ms, GPU 30.3 ms, memory_wait 94 ms
intro 120:40 main + this PR (6ed7f1c4d) 3 20.03 FPS, p50 49.9 / p99 53.7 / max 55 ms, GPU 30.5 ms, memory_wait 94 ms
logos 10:60 main 1 23.78 FPS, p50 24.1 / p99 99.8 / max 521 ms, GPU 28.8 ms, memory_wait 72 ms
logos 10:60 main 3 23.63 FPS, p50 24.2 / p99 100.9 / max 470 ms, GPU 29.3 ms, memory_wait 72 ms
logos 10:60 main 4 23.97 FPS, p50 24.2 / p99 108.2 / max 476 ms, GPU 28.6 ms, memory_wait 72 ms
logos 10:60 + this PR 2 23.64 FPS, p50 24.4 / p99 106.8 / max 461 ms, GPU 29.1 ms, memory_wait 72 ms
logos 10:60 + this PR 3 23.56 FPS, p50 24.2 / p99 97.4 / max 489 ms, GPU 29.4 ms, memory_wait 72 ms
logos 10:60 + this PR 4 24.24 FPS, p50 24.5 / p99 104.4 / max 467 ms, GPU 28.0 ms, memory_wait 71 ms
  • Intro: no difference. Today's main is at 20.0 to 20.3 FPS here, up from 15.1 for #6060's head 6c6a6c85a on a077a88df yesterday and above #5851's 16.0, so the gap I measured is closed on main itself (the 1 MiB settle floor and 400 other commits; I did not separate them). This PR on top: 20.0 to 20.1 FPS, the same 93 to 94 ms of memory_wait per frame.
  • Logos: no difference either. tools/trace_digest.py on the four clean traces shows the same slow frames in both builds: one 460 to 520 ms frame at about 15.5 s (present ~1210, all three queue workers in Driver.Packet.memory_wait), a 130 ms frame right after it, and otherwise ~120 ms frames that carry a 100 ms GPU batch. I don't see the five 295 to 348 ms re-import frames @Sevthered reported, on either build; the one long memory wait here is the same size with and without this PR, so it looks like the first import of a large range rather than a re-import.
  • Two runs are excluded: main logos round 2 ran at 44.6 FPS with a third of the GPU time after a stray click advanced the title during it, and this PR's logos round 1 logged two WAIT_REG_MEM_64 ... timed out after 1000ms lines after its window had closed, in the stretch where the same click may have landed (its window stats match the other rounds, and its three other rounds have no timeouts). A fourth round of both replaced them.
  • No stop, fault or device loss in the 14 runs. Trace events are dropped in every capture at these frame rates (trace_dropped: true), the phase totals are complete. Summary lines and the logo traces are available.
Summary lines (intro round 2, logos round 3, each build)
{"commit":"44df21632125","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"120:40"},"gpu":"NVIDIA GeForce RTX 4090","driver":"NVIDIA 616.92","os":"Windows 10.0.26200","resolution":"3840x2160","window":{"spec":"seconds 120:40","first_present":2937,"ms":40003.053},"presents":797,"frame_ms":{"p50":50.208,"p90":52.054,"p99":54.971,"max":61.794},"gpu_busy_ms_per_present":32.107,"worker_busy_pct":{"queue worker 0x0":98.797,"queue worker 0x40":99.798,"queue worker 0x48":99.429,"queue worker 0x3a":0.0},"top_phases_ms_per_frame":{"Driver.Packet":149.254,"Driver.Packet.memory_wait":94.376,"Driver.Packet.draw":19.06,"Driver.Draw":18.942,"Driver.Packet.dispatch":18.037,"Driver.Dispatch":13.472,"Driver.Draw.shader_compile_and_link":10.779,"Shader.DrawStage":8.96},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":8.557,"events_lost":921502,"totals_full":false}},"trace":"aps5-trace-44df21632125-19428.json.gz"}
{"commit":"6ed7f1c4d4f4","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"120:40"},"gpu":"NVIDIA GeForce RTX 4090","driver":"NVIDIA 616.92","os":"Windows 10.0.26200","resolution":"3840x2160","window":{"spec":"seconds 120:40","first_present":2925,"ms":40045.968},"presents":805,"frame_ms":{"p50":49.79,"p90":51.73,"p99":53.371,"max":54.656},"gpu_busy_ms_per_present":30.261,"worker_busy_pct":{"queue worker 0x0":98.767,"queue worker 0x40":99.798,"queue worker 0x48":99.205,"queue worker 0x3a":0.0},"top_phases_ms_per_frame":{"Driver.Packet":147.816,"Driver.Packet.memory_wait":93.727,"Driver.Packet.draw":18.863,"Driver.Draw":18.749,"Driver.Packet.dispatch":17.52,"Driver.Dispatch":13.248,"Driver.Draw.shader_compile_and_link":11.257,"Shader.DrawStage":9.362},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":8.406,"events_lost":951977,"totals_full":false}},"trace":"aps5-trace-6ed7f1c4d4f4-4952.json.gz"}
{"commit":"44df21632125","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"10:60"},"gpu":"NVIDIA GeForce RTX 4090","driver":"NVIDIA 616.92","os":"Windows 10.0.26200","resolution":"3840x2160","window":{"spec":"seconds 10:60","first_present":468,"ms":60000.299},"presents":1418,"frame_ms":{"p50":24.168,"p90":84.059,"p99":100.947,"max":469.92},"gpu_busy_ms_per_present":29.325,"worker_busy_pct":{"queue worker 0x0":98.903,"queue worker 0x40":99.496,"queue worker 0x48":98.717,"queue worker 0x3a":0.108},"top_phases_ms_per_frame":{"Driver.Packet":125.423,"Driver.Packet.memory_wait":72.056,"Driver.Packet.dispatch":23.116,"Driver.Dispatch":17.921,"Driver.Packet.draw":14.218,"Driver.Draw":14.16,"GpuMutex.wait.dispatch":10.324,"Driver.Present":7.786},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":18.295,"events_lost":928276,"totals_full":false}},"trace":"aps5-trace-44df21632125-11652.json.gz"}
{"commit":"6ed7f1c4d4f4","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"10:60"},"gpu":"NVIDIA GeForce RTX 4090","driver":"NVIDIA 616.92","os":"Windows 10.0.26200","resolution":"3840x2160","window":{"spec":"seconds 10:60","first_present":481,"ms":60024.466},"presents":1414,"frame_ms":{"p50":24.158,"p90":84.419,"p99":97.4,"max":489.061},"gpu_busy_ms_per_present":29.433,"worker_busy_pct":{"queue worker 0x0":98.893,"queue worker 0x40":99.481,"queue worker 0x48":98.62,"queue worker 0x3a":0.093},"top_phases_ms_per_frame":{"Driver.Packet":125.783,"Driver.Packet.memory_wait":72.103,"Driver.Packet.dispatch":23.379,"Driver.Dispatch":18.106,"Driver.Packet.draw":14.331,"Driver.Draw":14.272,"GpuMutex.wait.dispatch":10.543,"Driver.Present":7.955},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":18.207,"events_lost":929139,"totals_full":false}},"trace":"aps5-trace-6ed7f1c4d4f4-7936.json.gz"}

Tested with AI assistance (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6201569153 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6499#issuecomment-6201569153). Originally posted by [frankea](https://github.com/frankea) on 2026-10-15T20:25:52Z. --- @parl0v the same three-round setup with this PR on top, on today's `main`. Astro Bot (PPSA21564 v01.018.000), RTX 4090 (NVIDIA 616.92), Ryzen 7 5800X, 3840x2160, one executable relinked from `main` `44df21632` with `--windows --registry`, `libs/` swapped between `main` `44df21632` and `main` + `6af7d2cbe` (merge `6ed7f1c4d`), alternating, `APS5_TRACE_SECONDS` the only switch, no input. Two windows: the title intro (`120:40`, as yesterday) and the logo sequence (`10:60`, 110 s cap). | Window | Build | Round | Result | |---|---|---|---| | intro 120:40 | `main` 44df21632 | 2 | 19.92 FPS, p50 50.2 / p99 55.0 / max 62 ms, GPU 32.1 ms, memory_wait 94 ms | | intro 120:40 | `main` 44df21632 | 3 | 20.28 FPS, p50 49.2 / p99 53.5 / max 55 ms, GPU 30.7 ms, memory_wait 93 ms | | intro 120:40 | `main` + this PR (6ed7f1c4d) | 1 | 20.11 FPS, p50 49.6 / p99 53.5 / max 54 ms, GPU 32.0 ms, memory_wait 93 ms | | intro 120:40 | `main` + this PR (6ed7f1c4d) | 2 | 20.10 FPS, p50 49.8 / p99 53.4 / max 55 ms, GPU 30.3 ms, memory_wait 94 ms | | intro 120:40 | `main` + this PR (6ed7f1c4d) | 3 | 20.03 FPS, p50 49.9 / p99 53.7 / max 55 ms, GPU 30.5 ms, memory_wait 94 ms | | logos 10:60 | `main` | 1 | 23.78 FPS, p50 24.1 / p99 99.8 / max 521 ms, GPU 28.8 ms, memory_wait 72 ms | | logos 10:60 | `main` | 3 | 23.63 FPS, p50 24.2 / p99 100.9 / max 470 ms, GPU 29.3 ms, memory_wait 72 ms | | logos 10:60 | `main` | 4 | 23.97 FPS, p50 24.2 / p99 108.2 / max 476 ms, GPU 28.6 ms, memory_wait 72 ms | | logos 10:60 | + this PR | 2 | 23.64 FPS, p50 24.4 / p99 106.8 / max 461 ms, GPU 29.1 ms, memory_wait 72 ms | | logos 10:60 | + this PR | 3 | 23.56 FPS, p50 24.2 / p99 97.4 / max 489 ms, GPU 29.4 ms, memory_wait 72 ms | | logos 10:60 | + this PR | 4 | 24.24 FPS, p50 24.5 / p99 104.4 / max 467 ms, GPU 28.0 ms, memory_wait 71 ms | - **Intro:** no difference. Today's `main` is at 20.0 to 20.3 FPS here, up from 15.1 for #6060's head `6c6a6c85a` on `a077a88df` yesterday and above #5851's 16.0, so the gap I measured is closed on `main` itself (the 1 MiB settle floor and 400 other commits; I did not separate them). This PR on top: 20.0 to 20.1 FPS, the same 93 to 94 ms of `memory_wait` per frame. - **Logos:** no difference either. `tools/trace_digest.py` on the four clean traces shows the same slow frames in both builds: one 460 to 520 ms frame at about 15.5 s (present ~1210, all three queue workers in `Driver.Packet.memory_wait`), a 130 ms frame right after it, and otherwise ~120 ms frames that carry a 100 ms GPU batch. I don't see the five 295 to 348 ms re-import frames @Sevthered reported, on either build; the one long memory wait here is the same size with and without this PR, so it looks like the first import of a large range rather than a re-import. - Two runs are excluded: `main` logos round 2 ran at 44.6 FPS with a third of the GPU time after a stray click advanced the title during it, and this PR's logos round 1 logged two `WAIT_REG_MEM_64 ... timed out after 1000ms` lines after its window had closed, in the stretch where the same click may have landed (its window stats match the other rounds, and its three other rounds have no timeouts). A fourth round of both replaced them. - No stop, fault or device loss in the 14 runs. Trace events are dropped in every capture at these frame rates (`trace_dropped: true`), the phase totals are complete. Summary lines and the logo traces are available. <details><summary>Summary lines (intro round 2, logos round 3, each build)</summary> ```json {"commit":"44df21632125","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"120:40"},"gpu":"NVIDIA GeForce RTX 4090","driver":"NVIDIA 616.92","os":"Windows 10.0.26200","resolution":"3840x2160","window":{"spec":"seconds 120:40","first_present":2937,"ms":40003.053},"presents":797,"frame_ms":{"p50":50.208,"p90":52.054,"p99":54.971,"max":61.794},"gpu_busy_ms_per_present":32.107,"worker_busy_pct":{"queue worker 0x0":98.797,"queue worker 0x40":99.798,"queue worker 0x48":99.429,"queue worker 0x3a":0.0},"top_phases_ms_per_frame":{"Driver.Packet":149.254,"Driver.Packet.memory_wait":94.376,"Driver.Packet.draw":19.06,"Driver.Draw":18.942,"Driver.Packet.dispatch":18.037,"Driver.Dispatch":13.472,"Driver.Draw.shader_compile_and_link":10.779,"Shader.DrawStage":8.96},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":8.557,"events_lost":921502,"totals_full":false}},"trace":"aps5-trace-44df21632125-19428.json.gz"} {"commit":"6ed7f1c4d4f4","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"120:40"},"gpu":"NVIDIA GeForce RTX 4090","driver":"NVIDIA 616.92","os":"Windows 10.0.26200","resolution":"3840x2160","window":{"spec":"seconds 120:40","first_present":2925,"ms":40045.968},"presents":805,"frame_ms":{"p50":49.79,"p90":51.73,"p99":53.371,"max":54.656},"gpu_busy_ms_per_present":30.261,"worker_busy_pct":{"queue worker 0x0":98.767,"queue worker 0x40":99.798,"queue worker 0x48":99.205,"queue worker 0x3a":0.0},"top_phases_ms_per_frame":{"Driver.Packet":147.816,"Driver.Packet.memory_wait":93.727,"Driver.Packet.draw":18.863,"Driver.Draw":18.749,"Driver.Packet.dispatch":17.52,"Driver.Dispatch":13.248,"Driver.Draw.shader_compile_and_link":11.257,"Shader.DrawStage":9.362},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":8.406,"events_lost":951977,"totals_full":false}},"trace":"aps5-trace-6ed7f1c4d4f4-4952.json.gz"} {"commit":"44df21632125","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"10:60"},"gpu":"NVIDIA GeForce RTX 4090","driver":"NVIDIA 616.92","os":"Windows 10.0.26200","resolution":"3840x2160","window":{"spec":"seconds 10:60","first_present":468,"ms":60000.299},"presents":1418,"frame_ms":{"p50":24.168,"p90":84.059,"p99":100.947,"max":469.92},"gpu_busy_ms_per_present":29.325,"worker_busy_pct":{"queue worker 0x0":98.903,"queue worker 0x40":99.496,"queue worker 0x48":98.717,"queue worker 0x3a":0.108},"top_phases_ms_per_frame":{"Driver.Packet":125.423,"Driver.Packet.memory_wait":72.056,"Driver.Packet.dispatch":23.116,"Driver.Dispatch":17.921,"Driver.Packet.draw":14.218,"Driver.Draw":14.16,"GpuMutex.wait.dispatch":10.324,"Driver.Present":7.786},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":18.295,"events_lost":928276,"totals_full":false}},"trace":"aps5-trace-44df21632125-11652.json.gz"} {"commit":"6ed7f1c4d4f4","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"10:60"},"gpu":"NVIDIA GeForce RTX 4090","driver":"NVIDIA 616.92","os":"Windows 10.0.26200","resolution":"3840x2160","window":{"spec":"seconds 10:60","first_present":481,"ms":60024.466},"presents":1414,"frame_ms":{"p50":24.158,"p90":84.419,"p99":97.4,"max":489.061},"gpu_busy_ms_per_present":29.433,"worker_busy_pct":{"queue worker 0x0":98.893,"queue worker 0x40":99.481,"queue worker 0x48":98.62,"queue worker 0x3a":0.093},"top_phases_ms_per_frame":{"Driver.Packet":125.783,"Driver.Packet.memory_wait":72.103,"Driver.Packet.dispatch":23.379,"Driver.Dispatch":18.106,"Driver.Packet.draw":14.331,"Driver.Draw":14.272,"GpuMutex.wait.dispatch":10.543,"Driver.Present":7.955},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":18.207,"events_lost":929139,"totals_full":false}},"trace":"aps5-trace-6ed7f1c4d4f4-7936.json.gz"} ``` </details> Tested with AI assistance (Claude Code).
parl0v commented 2026-10-16 02:51:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by parl0v on 2026-10-16T02:51:29Z.


@frankea thank you, that's a clean null: no change at the intro or the logos on your copy, and none of the five ~300 ms re-import frames on either build. One difference worth noting: @Sevthered's runs were on PPSA21567 v01.019.000, yours on PPSA21564 v01.018.000, so the re-import pattern (a ~1.1 GiB range ending at 0x37e000000 re-imported with its start moving up) may depend on the version or region build. Your single 460–520 ms frame at ~15.5 s, the same in both builds, reads like a first import of a large range, which this PR doesn't touch.

So the evidence for this PR stays the synthetic test (472–560 ms → <0.02 ms per re-import) until someone with the pattern runs it. @Sevthered, if you can, your v01.019 setup is the one that showed it. Rebased onto main 5d9dcc42d (the only conflict was a comment main removed next to the new line).

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6206944527 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6499#issuecomment-6206944527). Originally posted by [parl0v](https://github.com/parl0v) on 2026-10-16T02:51:29Z. --- @frankea thank you, that's a clean null: no change at the intro or the logos on your copy, and none of the five ~300 ms re-import frames on either build. One difference worth noting: @Sevthered's runs were on PPSA21567 v01.019.000, yours on PPSA21564 v01.018.000, so the re-import pattern (a ~1.1 GiB range ending at `0x37e000000` re-imported with its start moving up) may depend on the version or region build. Your single 460–520 ms frame at ~15.5 s, the same in both builds, reads like a first import of a large range, which this PR doesn't touch. So the evidence for this PR stays the synthetic test (472–560 ms → <0.02 ms per re-import) until someone with the pattern runs it. @Sevthered, if you can, your v01.019 setup is the one that showed it. Rebased onto `main` 5d9dcc42d (the only conflict was a comment `main` removed next to the new line). AI-assisted: yes (Claude Code)
Sevthered commented 2026-10-17 17:30:51 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Sevthered on 2026-10-17T17:30:51Z.


@parl0v here is the v01.019 run. ASTRO BOT PPSA21567 v01.019.000 (my own copy, from a repack folder), Windows 11 build 26300, RTX 3080 Ti 12 GB on driver 616.56, Ryzen 7 5800X, 32 GB, WinLibs GCC 15.2.0, window 1152x648. I compared main 82f0c9aec against the same main with this PR's head 1d3b33985 merged locally (no conflicts). Both use one executable relinked with that main's relinker, the same run folder, save and warm shader cache, and the runs alternate between the builds.

main main + this PR
logo frames 300:300, three traces each 7.66 / 7.68 / 7.55 s 7.97 / 8.02 / 7.85 s
p50 20.6 / 20.5 / 20.5 ms 20.7 / 20.6 / 20.5 ms
frames of 200 ms or more (time in them) 4 / 4 / 5 (1.54 / 1.51 / 1.58 s) 5 / 5 / 5 (1.92 / 1.99 / 1.88 s)
first frame, three runs each 15, 15, 15 s 15, 15, 15 s

So no improvement here; the long frames are still there. The logo window with this PR is 0.30 to 0.34 s longer in each pair, but the probe runs below overlap (main 7.94 / 8.16 s, this PR 8.34 / 7.94 s), so I wouldn't call it slower. I don't have Crash Site numbers this time.

With the import timing probe from #6060 on both builds (two logo runs each), the tail of the range ending at 0x37e000000 is still imported fresh six times per run with this PR, as on main: 190 to 315 ms each, 140 to 195 ms of it creating the import. The one exception is the last re-import of one run with this PR, which took 52 ms.

To see why, I added prints to retireOrTrim, reattachTrimmed, refreshImports, WaitForLeasesAndImports and libc's replaceRange for this address window (local only). Every step is the guest protecting a 16 KiB page to no access (a guard page) in the middle of the imported range, not at either end:

[probe-6499] retireOrTrim change 0x3347ec000-0x3347f0000 import 0x324618000+0x599e8000 keep 0x0-0x0 alias 0 dmaBuf 0 chunk 0 joined 0 ranges 1 serial 1 memType 3 range 0x324618000+0x599e8000 trimmedHas 0 -> retire
[probe-6499] guest protect 0x3347ec000+0x4000 readable 0 writable 0 gpu 0
[probe-import] 0x324618000+0x101d4000 settled 1 total 140.0 ms create 39.3 ms settle 8.3 ms
[probe-import] 0x3347f0000+0x49810000 settled 1 total 289.1 ms create 164.3 ms settle 33.3 ms

The import is plain (no alias or dma-buf, not joined, one range, backing serial set), but the change is strictly inside it, so neither the head nor the tail case in retireOrTrim matches (first == last) and the whole import is retired. All 15 retireOrTrim calls in this address window ended in retire, none in trim, so reattachTrimmed never ran for it. The head and the ~1.15 GiB tail are then imported again. The next guard page lands inside the new tail, about 25 MiB above its start, and the later ones follow 1.44 MiB, 1.39 MiB, 288 KiB and 368 KiB apart (0x3347ec000, 0x3360e0000, 0x336250000, 0x3363b4000, 0x3363fc000, 0x336458000), each inside the tail imported after the previous one. That is the "start moves up" pattern I described on #6060. Keeping the larger side of a split in the middle (or both sides) should cover this title; I haven't tried it.

One more thing from that run, which may come from the prints: while the guest's protect at 0x336250000 was pending, the tail 0x3360e4000+0x47f1c000 was imported seven times and retired after each one (each import 257 to 292 ms), and 0x3363b8000+0x47c48000 four times while the protect at 0x3363fc000 was pending. From the log order, the waiter retires the import, an import of the still unchanged range comes back before the guest's change goes through, and the guest waits again. That run's logo window took 11.9 s, with three frames of 1.25, 1.48 and 1.58 s; by count and order, its trace has seven 267 to 358 ms Vulkan.Dispatch.shader_resources spans in the first two of them and four in the third, matching the seven and four imports. I didn't see it in the four probe runs without these prints (one import per tail each), so the extra stderr writes may have changed the timing enough to expose it; I can't say whether it happens without them.

No trace here dropped events (trace_dropped is false in all eleven); frame counts and times come from the presents. Traces, the summary lines and the diagnostic patch are available if useful.

AI-assisted: yes (Claude Code); the runs are from my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6237666862 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6499#issuecomment-6237666862). Originally posted by [Sevthered](https://github.com/Sevthered) on 2026-10-17T17:30:51Z. --- @parl0v here is the v01.019 run. ASTRO BOT PPSA21567 v01.019.000 (my own copy, from a repack folder), Windows 11 build 26300, RTX 3080 Ti 12 GB on driver 616.56, Ryzen 7 5800X, 32 GB, WinLibs GCC 15.2.0, window 1152x648. I compared `main` `82f0c9aec` against the same `main` with this PR's head `1d3b33985` merged locally (no conflicts). Both use one executable relinked with that `main`'s relinker, the same run folder, save and warm shader cache, and the runs alternate between the builds. | | `main` | `main` + this PR | |---|---|---| | logo frames 300:300, three traces each | 7.66 / 7.68 / 7.55 s | 7.97 / 8.02 / 7.85 s | | p50 | 20.6 / 20.5 / 20.5 ms | 20.7 / 20.6 / 20.5 ms | | frames of 200 ms or more (time in them) | 4 / 4 / 5 (1.54 / 1.51 / 1.58 s) | 5 / 5 / 5 (1.92 / 1.99 / 1.88 s) | | first frame, three runs each | 15, 15, 15 s | 15, 15, 15 s | So no improvement here; the long frames are still there. The logo window with this PR is 0.30 to 0.34 s longer in each pair, but the probe runs below overlap (`main` 7.94 / 8.16 s, this PR 8.34 / 7.94 s), so I wouldn't call it slower. I don't have Crash Site numbers this time. With the import timing probe from #6060 on both builds (two logo runs each), the tail of the range ending at `0x37e000000` is still imported fresh six times per run with this PR, as on `main`: 190 to 315 ms each, 140 to 195 ms of it creating the import. The one exception is the last re-import of one run with this PR, which took 52 ms. To see why, I added prints to `retireOrTrim`, `reattachTrimmed`, `refreshImports`, `WaitForLeasesAndImports` and libc's `replaceRange` for this address window (local only). Every step is the guest protecting a 16 KiB page to no access (a guard page) in the middle of the imported range, not at either end: ``` [probe-6499] retireOrTrim change 0x3347ec000-0x3347f0000 import 0x324618000+0x599e8000 keep 0x0-0x0 alias 0 dmaBuf 0 chunk 0 joined 0 ranges 1 serial 1 memType 3 range 0x324618000+0x599e8000 trimmedHas 0 -> retire [probe-6499] guest protect 0x3347ec000+0x4000 readable 0 writable 0 gpu 0 [probe-import] 0x324618000+0x101d4000 settled 1 total 140.0 ms create 39.3 ms settle 8.3 ms [probe-import] 0x3347f0000+0x49810000 settled 1 total 289.1 ms create 164.3 ms settle 33.3 ms ``` The import is plain (no alias or dma-buf, not joined, one range, backing serial set), but the change is strictly inside it, so neither the head nor the tail case in `retireOrTrim` matches (`first == last`) and the whole import is retired. All 15 `retireOrTrim` calls in this address window ended in `retire`, none in `trim`, so `reattachTrimmed` never ran for it. The head and the ~1.15 GiB tail are then imported again. The next guard page lands inside the new tail, about 25 MiB above its start, and the later ones follow 1.44 MiB, 1.39 MiB, 288 KiB and 368 KiB apart (`0x3347ec000`, `0x3360e0000`, `0x336250000`, `0x3363b4000`, `0x3363fc000`, `0x336458000`), each inside the tail imported after the previous one. That is the "start moves up" pattern I described on #6060. Keeping the larger side of a split in the middle (or both sides) should cover this title; I haven't tried it. One more thing from that run, which may come from the prints: while the guest's protect at `0x336250000` was pending, the tail `0x3360e4000+0x47f1c000` was imported seven times and retired after each one (each import 257 to 292 ms), and `0x3363b8000+0x47c48000` four times while the protect at `0x3363fc000` was pending. From the log order, the waiter retires the import, an import of the still unchanged range comes back before the guest's change goes through, and the guest waits again. That run's logo window took 11.9 s, with three frames of 1.25, 1.48 and 1.58 s; by count and order, its trace has seven 267 to 358 ms `Vulkan.Dispatch.shader_resources` spans in the first two of them and four in the third, matching the seven and four imports. I didn't see it in the four probe runs without these prints (one import per tail each), so the extra stderr writes may have changed the timing enough to expose it; I can't say whether it happens without them. No trace here dropped events (`trace_dropped` is false in all eleven); frame counts and times come from the presents. Traces, the summary lines and the diagnostic patch are available if useful. AI-assisted: yes (Claude Code); the runs are from my machine.
parl0v commented 2026-10-17 17:32:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by parl0v on 2026-10-17T17:32:32Z.


@Sevthered thank you, that run settles it, and the probe pins down exactly why it's a null.

You're right about the cause: retireOrTrim only keeps an import when the change touches its head (begin <= entry.base) or its tail (end >= entryEnd). A guard page strictly inside the range leaves first == last, so the whole import is retired, and Astro Bot's 16 KiB no-access pages always land in the middle: 0x3347ec000 sits about 260 MiB into a 1.4 GiB import. My synthetic test moves the start of the range, which is the one case this title never hits.

Next on this PR: for a change strictly inside a plain import, keep the larger side, which here is the ~1.15 GiB tail that is currently re-imported six times per run. Keeping both sides would need two buffers over one allocation, so I'll start with the larger side and see what is left. I'll add a test that protects a page in the middle of an import and expects the tail to be kept, not re-imported.

The repeated import/retire of the unchanged tail while the guest's protect is pending (seven and four times) is a separate path, the waiter in WaitForLeasesAndImports. I'll look at it after the middle split, since keeping the tail may take away what that waiter keeps re-importing. Your diagnostic patch would help; if you can attach it here, I'll build on it rather than add my own prints.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6237696869 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6499#issuecomment-6237696869). Originally posted by [parl0v](https://github.com/parl0v) on 2026-10-17T17:32:32Z. --- @Sevthered thank you, that run settles it, and the probe pins down exactly why it's a null. You're right about the cause: `retireOrTrim` only keeps an import when the change touches its head (`begin <= entry.base`) or its tail (`end >= entryEnd`). A guard page strictly inside the range leaves `first == last`, so the whole import is retired, and Astro Bot's 16 KiB no-access pages always land in the middle: `0x3347ec000` sits about 260 MiB into a 1.4 GiB import. My synthetic test moves the start of the range, which is the one case this title never hits. Next on this PR: for a change strictly inside a plain import, keep the larger side, which here is the ~1.15 GiB tail that is currently re-imported six times per run. Keeping both sides would need two buffers over one allocation, so I'll start with the larger side and see what is left. I'll add a test that protects a page in the middle of an import and expects the tail to be kept, not re-imported. The repeated import/retire of the unchanged tail while the guest's protect is pending (seven and four times) is a separate path, the waiter in `WaitForLeasesAndImports`. I'll look at it after the middle split, since keeping the tail may take away what that waiter keeps re-importing. Your diagnostic patch would help; if you can attach it here, I'll build on it rather than add my own prints. AI-assisted: yes (Claude Code)
parl0v commented 2026-10-18 22:09:13 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by parl0v on 2026-10-18T22:09:13Z.


Traces of the performance capture in the description (they open in ui.perfetto.dev):

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6255758911 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6499#issuecomment-6255758911). Originally posted by [parl0v](https://github.com/parl0v) on 2026-10-18T22:09:13Z. --- Traces of the performance capture in the description (they open in ui.perfetto.dev): - `main` d17f456ea: [aps5-trace-d17f456eac16-21960.json.gz](https://github.com/parl0v/AnyPS5/releases/download/perf-traces-2026-10-18/aps5-trace-d17f456eac16-21960.json.gz) - this PR: [aps5-trace-99581456c367-13492.json.gz](https://github.com/parl0v/AnyPS5/releases/download/perf-traces-2026-10-18/aps5-trace-99581456c367-13492.json.gz)
adriadam10 commented 2026-10-19 02:25:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-19T02:25:54Z.

Review: CHANGES_REQUESTED


Thanks for the detailed write-up. Points before this can merge:

  • No title shows the pattern this fixes. The synthetic bench (Recorder.cpp:2308) moves the start of the range, but both Astro Bot runs in the thread (@frankea PPSA21564, @Sevthered PPSA21567 v01.019) show no change, and your own note says its guard pages land strictly inside the import, which retireOrTrim (GuestBufferMemory.cpp:436) still retires whole. Please attach a trace/log from a real title where an import is re-imported after a head or tail cut (count of re-imports, ms before/after), or land the interior-split case this title actually hits.
  • munmap of the head is untested. The bench only uses sceKernelMprotect. After an unmap the trimmed VkDeviceMemory keeps the host pages pinned while the guest VA is freed or remapped. Add a case that unmaps the head, remaps it, and checks the tail's bytes and write watch still match guest memory.
  • releaseTrimmed (GuestBufferMemory.cpp:421) frees the memory immediately when the thread does not hold GpuMutex, while the old buffer, kept by the recorder, may still be in flight. Hold the memory with the recorder like retireImport does (KeepThroughHold/Keep), or show that path is unreachable.
  • docs/dev/ARCHITECTURE.md: the host-import lifecycle gains a trimmed state and a backing serial; describe it under the import section.

Happy to look again once the first point has data.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5566318246 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6499#pullrequestreview-5566318246). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-19T02:25:54Z. **Review:** CHANGES_REQUESTED --- Thanks for the detailed write-up. Points before this can merge: - **No title shows the pattern this fixes.** The synthetic bench (`Recorder.cpp:2308`) moves the *start* of the range, but both Astro Bot runs in the thread (@frankea PPSA21564, @Sevthered PPSA21567 v01.019) show no change, and your own note says its guard pages land strictly inside the import, which `retireOrTrim` (`GuestBufferMemory.cpp:436`) still retires whole. Please attach a trace/log from a real title where an import is re-imported after a head or tail cut (count of re-imports, ms before/after), or land the interior-split case this title actually hits. - **`munmap` of the head is untested.** The bench only uses `sceKernelMprotect`. After an unmap the trimmed `VkDeviceMemory` keeps the host pages pinned while the guest VA is freed or remapped. Add a case that unmaps the head, remaps it, and checks the tail's bytes and write watch still match guest memory. - **`releaseTrimmed` (`GuestBufferMemory.cpp:421`)** frees the memory immediately when the thread does not hold `GpuMutex`, while the old buffer, kept by the recorder, may still be in flight. Hold the memory with the recorder like `retireImport` does (`KeepThroughHold`/`Keep`), or show that path is unreachable. - docs/dev/ARCHITECTURE.md: the host-import lifecycle gains a `trimmed` state and a backing serial; describe it under the import section. Happy to look again once the first point has data.
parl0v commented 2026-10-19 03:19:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by parl0v on 2026-10-19T03:19:57Z.


@adriadam10 thanks for the review. I pushed six commits on top of 99581456c (head 5126b4601) that cover the four points.

1. Cut inside the import. I took the second option. retireOrTrim now also handles a protect or unmap strictly inside a plain import: it keeps the larger side (the tail when both sides are equal) with the same trim as a head or tail cut, and imports only the smaller side again (GuestBufferMemory.cpp:447-451). That is the case @Sevthered's probe showed: a 16 KiB no-access page ~260 MiB into a 1.4 GiB import, with the next ones inside the kept tail. The bench now runs three patterns on a fresh 1126 MiB range, 5 cuts each, 3 runs (RTX 4060, NVIDIA 617.42). "Before" is the branch with the trim forced off, so every cut takes retireImport, which is main's path:

pattern before: kept side imported again / import after a cut after
head, 1440 KiB lose GPU access per cut 5/5 / 386–431 ms 0/5 / ≤0.02 ms
tail, the same at the end 5/5 / 379–416 ms 0/5 / ≤0.01 ms
inside: a 16 KiB no-access page 256 MiB in, then 1440 KiB above the last 5/5 / 285–306 ms 0/5 / ≤0.02 ms

The guest's protect itself drops from 18–22 ms to under 0.15 ms. A cut inside still imports the smaller side (256 MiB: 86–105 ms on both builds). I don't have a title trace yet. @Sevthered, if you can rerun your import timing probe on the new head, I'd expect the six 190–315 ms tail re-imports per logo run to go away, with only the head side imported again.

2. munmap. New agc_trimmed_import (Windows, 32 MiB of singly mapped direct memory imported whole):

  • a no-access page near the start, and one near the end;
  • an unmap of a 2 MiB run inside;
  • an unmap of the first 2 MiB run;
  • an unmap of the first 1440 KiB, which splits a 2 MiB resident run, so the kept side gets a new backing serial and is imported again;
  • an unmap of the whole kept side while the import waits trimmed.

Every unmapped span is then mapped again at the same address. Each case checks through a GPU copy that the import reads fresh CPU stores at both ends, that the write watch collects them and reports nothing else, and that pages mapped again are served by a new import. With the backing-serial check removed from reattachTrimmed, the last case fails because the GPU reads the old pinned pages; with the interior branch removed, the first case fails.

3. releaseTrimmed. It now hands the memory to the active recorder with KeepThroughHold, as retireImport does in the same callers, so a batch in flight can't lose it. I don't think the immediate free was reachable with a live recorder: the waiter syncs before and after retireOrTrim while holding GpuMutex; releaseTrimmed only runs from importRunAt and refreshImports; and ImportMappedRanges without the lock refuses runs that overlap a trimmed import and only refreshes when it adopts a new device, which parks them. As a check, the import tests below also pass with APS5_ASSERT_GPU_LOCK=1, under which KeepThroughHold aborts when it is reached without GpuMutex.

4. ARCHITECTURE.md has a new paragraph after the host-import one, covering the trimmed state, memoryBase/pinnedBytes, reattachment and Range::backingSerial.

I also registered agc_reimport_bench and the new test only on Windows, since on Linux the bench's skip line would not pass check_skips.py. Tested on Windows 10 19045, MinGW GCC 15.2, NVIDIA 617.42, RTX 4060: both new tests, 56 host-import/settle/guest-memory/libc tests and all 57 agc_driver_recorder_tests entries pass, with the same two skips as before. The description is updated.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6258915696 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6499#issuecomment-6258915696). Originally posted by [parl0v](https://github.com/parl0v) on 2026-10-19T03:19:57Z. --- @adriadam10 thanks for the review. I pushed six commits on top of 99581456c (head 5126b4601) that cover the four points. **1. Cut inside the import.** I took the second option. `retireOrTrim` now also handles a protect or unmap strictly inside a plain import: it keeps the larger side (the tail when both sides are equal) with the same trim as a head or tail cut, and imports only the smaller side again (`GuestBufferMemory.cpp:447-451`). That is the case @Sevthered's probe showed: a 16 KiB no-access page ~260 MiB into a 1.4 GiB import, with the next ones inside the kept tail. The bench now runs three patterns on a fresh 1126 MiB range, 5 cuts each, 3 runs (RTX 4060, NVIDIA 617.42). "Before" is the branch with the trim forced off, so every cut takes `retireImport`, which is `main`'s path: | pattern | before: kept side imported again / import after a cut | after | |---|---|---| | head, 1440 KiB lose GPU access per cut | 5/5 / 386–431 ms | 0/5 / ≤0.02 ms | | tail, the same at the end | 5/5 / 379–416 ms | 0/5 / ≤0.01 ms | | inside: a 16 KiB no-access page 256 MiB in, then 1440 KiB above the last | 5/5 / 285–306 ms | 0/5 / ≤0.02 ms | The guest's protect itself drops from 18–22 ms to under 0.15 ms. A cut inside still imports the smaller side (256 MiB: 86–105 ms on both builds). I don't have a title trace yet. @Sevthered, if you can rerun your import timing probe on the new head, I'd expect the six 190–315 ms tail re-imports per logo run to go away, with only the head side imported again. **2. munmap.** New `agc_trimmed_import` (Windows, 32 MiB of singly mapped direct memory imported whole): - a no-access page near the start, and one near the end; - an unmap of a 2 MiB run inside; - an unmap of the first 2 MiB run; - an unmap of the first 1440 KiB, which splits a 2 MiB resident run, so the kept side gets a new backing serial and is imported again; - an unmap of the whole kept side while the import waits trimmed. Every unmapped span is then mapped again at the same address. Each case checks through a GPU copy that the import reads fresh CPU stores at both ends, that the write watch collects them and reports nothing else, and that pages mapped again are served by a new import. With the backing-serial check removed from `reattachTrimmed`, the last case fails because the GPU reads the old pinned pages; with the interior branch removed, the first case fails. **3. `releaseTrimmed`.** It now hands the memory to the active recorder with `KeepThroughHold`, as `retireImport` does in the same callers, so a batch in flight can't lose it. I don't think the immediate free was reachable with a live recorder: the waiter syncs before and after `retireOrTrim` while holding `GpuMutex`; `releaseTrimmed` only runs from `importRunAt` and `refreshImports`; and `ImportMappedRanges` without the lock refuses runs that overlap a trimmed import and only refreshes when it adopts a new device, which parks them. As a check, the import tests below also pass with `APS5_ASSERT_GPU_LOCK=1`, under which `KeepThroughHold` aborts when it is reached without `GpuMutex`. **4.** ARCHITECTURE.md has a new paragraph after the host-import one, covering the trimmed state, `memoryBase`/`pinnedBytes`, reattachment and `Range::backingSerial`. I also registered `agc_reimport_bench` and the new test only on Windows, since on Linux the bench's skip line would not pass `check_skips.py`. Tested on Windows 10 19045, MinGW GCC 15.2, NVIDIA 617.42, RTX 4060: both new tests, 56 host-import/settle/guest-memory/libc tests and all 57 `agc_driver_recorder_tests` entries pass, with the same two skips as before. The description is updated.
adriadam10 commented 2026-10-19 04:31:08 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-19T04:31:08Z.

Review: CHANGES_REQUESTED


The full Build (linux, run 39195696385) fails agc_driver_host_import_lifetime with AGC graphics: guest mutation reached host apply before vkFreeMemory completed; main does not fail it.

  • core/libs/prx/libSceAgcDriver/tests/HostImportLifetime.cpp:517-518 (partialUnmap): it unmaps the middle page of a 3-page import and requires that import to be freed (requireFreed(imported)) before the guest mutation is applied. With the cut inside the range, retireOrTrim (GuestBufferMemory.cpp:447) now keeps the larger side (the tail on equal sides) trimmed instead of retiring it, so no vkFreeMemory happens at that point. Please update the test to the new behaviour: the kept side stays imported (assert it is not freed and still covers its range), the smaller side is imported again, and everything is freed on mutation.Remove (lines 527-534). Check the other requireFreed callers that cut part of an import (protectRollback, partialUnmap) the same way.

Re-run ctest -R 'agc_driver_host_import_lifetime|agc_trimmed_import|agc_reimport_bench' on Linux (lavapipe) after the change.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5566939058 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6499#pullrequestreview-5566939058). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-19T04:31:08Z. **Review:** CHANGES_REQUESTED --- The full Build (linux, run 39195696385) fails `agc_driver_host_import_lifetime` with `AGC graphics: guest mutation reached host apply before vkFreeMemory completed`; `main` does not fail it. - `core/libs/prx/libSceAgcDriver/tests/HostImportLifetime.cpp:517-518` (`partialUnmap`): it unmaps the middle page of a 3-page import and requires that import to be freed (`requireFreed(imported)`) before the guest mutation is applied. With the cut inside the range, `retireOrTrim` (`GuestBufferMemory.cpp:447`) now keeps the larger side (the tail on equal sides) trimmed instead of retiring it, so no `vkFreeMemory` happens at that point. Please update the test to the new behaviour: the kept side stays imported (assert it is not freed and still covers its range), the smaller side is imported again, and everything is freed on `mutation.Remove` (lines 527-534). Check the other `requireFreed` callers that cut part of an import (`protectRollback`, `partialUnmap`) the same way. Re-run `ctest -R 'agc_driver_host_import_lifetime|agc_trimmed_import|agc_reimport_bench'` on Linux (lavapipe) after the change.
parl0v commented 2026-10-19 04:38:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by parl0v on 2026-10-19T04:38:17Z.


@adriadam10 thanks, you're right. Fixed in 68f1d5e5f.

partialUnmap now expects the new behaviour: during the unmap the import's memory is not freed; afterwards the tail (the kept side, equal sides) is served by the same VkDeviceMemory and covers exactly its remaining range, the head is imported again with new memory, and mutation.Remove frees both. With the interior branch of retireOrTrim disabled, it fails with "an unmap inside a host import freed the memory of the side it keeps".

Why it passed for me on Windows: the old test's 192 KiB import still had its deferred settle pending at the unmap, and retireOrTrim retires an import with a pending settle instead of trimming it. On Linux there are no settles, so it trimmed. The parts are now 1 MiB each (no deferred settle for imports of that size), so the cut takes the trim path on both platforms and the result no longer depends on when the settle read lands.

protectRollback protects the whole range, which neither trims nor changed, so it keeps requireFreed. No other requireFreed caller cuts part of an import.

Tested on Windows 10, RTX 4060, NVIDIA 617.42: agc_driver_host_import_lifetime, agc_driver_host_import_mutation_race, agc_trimmed_import, agc_reimport_bench, the host-import, settle, guest-memory and unit-shadow tests (28) and all 57 agc_driver_recorder_tests entries pass, with the usual skips. I don't have a Linux machine with lavapipe set up, so I couldn't run the ctest you asked for there. Could you rerun the full Linux build?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6259779034 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6499#issuecomment-6259779034). Originally posted by [parl0v](https://github.com/parl0v) on 2026-10-19T04:38:17Z. --- @adriadam10 thanks, you're right. Fixed in 68f1d5e5f. `partialUnmap` now expects the new behaviour: during the unmap the import's memory is not freed; afterwards the tail (the kept side, equal sides) is served by the same `VkDeviceMemory` and covers exactly its remaining range, the head is imported again with new memory, and `mutation.Remove` frees both. With the interior branch of `retireOrTrim` disabled, it fails with "an unmap inside a host import freed the memory of the side it keeps". Why it passed for me on Windows: the old test's 192 KiB import still had its deferred settle pending at the unmap, and `retireOrTrim` retires an import with a pending settle instead of trimming it. On Linux there are no settles, so it trimmed. The parts are now 1 MiB each (no deferred settle for imports of that size), so the cut takes the trim path on both platforms and the result no longer depends on when the settle read lands. `protectRollback` protects the whole range, which neither trims nor changed, so it keeps `requireFreed`. No other `requireFreed` caller cuts part of an import. Tested on Windows 10, RTX 4060, NVIDIA 617.42: `agc_driver_host_import_lifetime`, `agc_driver_host_import_mutation_race`, `agc_trimmed_import`, `agc_reimport_bench`, the host-import, settle, guest-memory and unit-shadow tests (28) and all 57 `agc_driver_recorder_tests` entries pass, with the usual skips. I don't have a Linux machine with lavapipe set up, so I couldn't run the ctest you asked for there. Could you rerun the full Linux build?
thuanquang commented 2026-10-19 08:04:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by thuanquang on 2026-10-19T08:04:04Z.


AMD Windows data for the new agc_trimmed_import: it fails on our RX 6700 XT (gfx1031, driver 32.0.21045.5002, Windows 11 26200, WinLibs GCC 15.2.0 r7, Release).

  • main d8d0222d0, unmodified: fails 10 of 10.
  • Two other main-based builds (one with an unrelated Texture.cpp change, one with several open PRs that don't touch host imports): 9 of 10 each.

In the logged failing runs, the first four cases pass. Those are the two inaccessible pages, and the unmaps of a 2 MiB run inside the import and of its first 2 MiB run, both checked again after the remap. The fifth fails:

AGC graphics: after an unmap of 1440 KiB at the start of the import's first 2 MiB run the pages mapped again are served from the import that pinned the old ones

So after the pages are unmapped and mapped again, HostImportFor over the whole range returns an import whose memory equals original, the import made before the unmap. 2d90ce58a's message says the GPU must read the new pages there, not the old pages the trimmed memory still pins.

In that case (trimmed = false), the checks before the remap pass: the kept side is imported again, and the GPU and the write watch see the guest's bytes. Only the lookup of the whole range after the 1440 KiB are mapped again still finds original. It passed 2 of the 20 runs on the other two builds, so timing seems to play a part. I haven't found the cause; a guess is that the original import is still registered when the remap lookup runs, for example before a deferred release. Happy to run a build with extra tracing on this GPU if that helps.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6262583081 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6499#issuecomment-6262583081). Originally posted by [thuanquang](https://github.com/thuanquang) on 2026-10-19T08:04:04Z. --- AMD Windows data for the new `agc_trimmed_import`: it fails on our RX 6700 XT (gfx1031, driver 32.0.21045.5002, Windows 11 26200, WinLibs GCC 15.2.0 r7, Release). - `main` `d8d0222d0`, unmodified: fails 10 of 10. - Two other `main`-based builds (one with an unrelated `Texture.cpp` change, one with several open PRs that don't touch host imports): 9 of 10 each. In the logged failing runs, the first four cases pass. Those are the two inaccessible pages, and the unmaps of a 2 MiB run inside the import and of its first 2 MiB run, both checked again after the remap. The fifth fails: ``` AGC graphics: after an unmap of 1440 KiB at the start of the import's first 2 MiB run the pages mapped again are served from the import that pinned the old ones ``` So after the pages are unmapped and mapped again, `HostImportFor` over the whole range returns an import whose `memory` equals `original`, the import made before the unmap. 2d90ce58a's message says the GPU must read the new pages there, not the old pages the trimmed memory still pins. In that case (`trimmed = false`), the checks before the remap pass: the kept side is imported again, and the GPU and the write watch see the guest's bytes. Only the lookup of the whole range after the 1440 KiB are mapped again still finds `original`. It passed 2 of the 20 runs on the other two builds, so timing seems to play a part. I haven't found the cause; a guess is that the original import is still registered when the remap lookup runs, for example before a deferred release. Happy to run a build with extra tracing on this GPU if that helps.
Sevthered commented 2026-10-19 14:40:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Sevthered on 2026-10-19T14:40:24Z.


@parl0v here is the import timing probe on the merged head, same machine and copy as my earlier report (PPSA21567 v01.019.000, Windows 11, Ryzen 7 5800X, 32 GB, RTX 3080 Ti, NVIDIA 616.56, WinLibs GCC 15.2.0 r7). Build: main 5eba12d6b (which has #6499 as 64a9caa62), relinked with that commit's relinker, libraries from the same commit plus the probe patch from #6060 (it prints an import only when it took 10 ms or more). Warm shader cache, no input, 160 s from start (PlayStation logo, then title_controller_ship).

One caveat first: on this main the default host import budget on a 32 GB machine is 8172 MiB (#6472), and the title's four large imports (2172, 4608, 1434 and 3232 MiB, all before its first frame) no longer fit in it. The 1434 MiB import of the range this PR is about (0x324618000+0x599e8000 in those runs) is the first one refused, so with default settings there is no import to split. All runs below therefore set APS5_HOST_IMPORT_MIB=14336, about what the old formula gave on 32 GB. I have put the numbers for that on #6472.

Before, from my 2026-10-17 runs (main 82f0c9aec + this PR at 1d3b33985, probe build, logos-Pp1 in the archive): after the 1.40 GiB import at 0x324618000 (924 ms) and the 0.25 GiB head (126 ms), the tail ending at 0x37e000000 was imported again six times with a rising start (0x3347d8000, 0x3360e0000, 0x336254000, 0x3363ac000, 0x3363f4000, 0x336444000), 270 to 293 ms each, of which create 150 to 172 ms. 49 imports in the run, import time summed 9.7 s.

After, three runs on 5eba12d6b:

  • r-Mp14-2 (probe): the 1.40 GiB import takes 988 ms (create 191 ms), then the head 0x324614000+0x101c8000 is imported again in 99 ms, and nothing of 10 ms or more follows for that range. 39 imports in 160 s, import time summed 8.2 s.
  • r-Mt14-1 (APS5_TRACE_HOST_IMPORT=1 instead of the probe, so every import is listed): the same head re-import, then only the smaller sides of the later cuts: 25 MiB at 0x3347dc000, 1.4 MiB at 0x3360e0000, 1.1 MiB at 0x336254000, 272 KiB at 0x336374000, 1.4 MiB at 0x3363bc000, 16 KiB at 0x336250000 and 0x3360dc000, and 7 MiB at 0x3359e4000. 48 imports; live bytes go from 12.1 GiB after the fourth large import to 12.4 GiB at the end and never drop, since the trimmed memory keeps counting.
  • r-Mp14-1 (probe): head re-import 97 ms, but then the whole tail 0x3347dc000+0x49824000 (1.15 GiB) is imported three times with identical bounds, 320, 272 and 268 ms (create 154 ms each), followed by 25 MiB at 0x3347dc000. 43 imports, import time summed 8.9 s. Same bounds each time, so that is a retire and re-import of an unchanged run rather than a trim; I did not trace which condition in retireOrTrim took the retire path there (a pending settle would be my first guess), and the other two runs did not show it.

So the six moving-start re-imports are gone, and in two of three runs only the small side of each cut is imported again, as you expected. The remaining case is the whole-tail retire in r-Mp14-1. The archive has the err, out and samples logs of every run named above plus the 2026-10-17 probe log and the probe patch.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6269895289 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6499#issuecomment-6269895289). Originally posted by [Sevthered](https://github.com/Sevthered) on 2026-10-19T14:40:24Z. --- @parl0v here is the import timing probe on the merged head, same machine and copy as my earlier report (PPSA21567 v01.019.000, Windows 11, Ryzen 7 5800X, 32 GB, RTX 3080 Ti, NVIDIA 616.56, WinLibs GCC 15.2.0 r7). Build: `main` `5eba12d6b` (which has #6499 as `64a9caa62`), relinked with that commit's relinker, libraries from the same commit plus the probe patch from #6060 (it prints an import only when it took 10 ms or more). Warm shader cache, no input, 160 s from start (PlayStation logo, then `title_controller_ship`). One caveat first: on this `main` the default host import budget on a 32 GB machine is 8172 MiB (#6472), and the title's four large imports (2172, 4608, 1434 and 3232 MiB, all before its first frame) no longer fit in it. The 1434 MiB import of the range this PR is about (`0x324618000+0x599e8000` in those runs) is the first one refused, so with default settings there is no import to split. All runs below therefore set `APS5_HOST_IMPORT_MIB=14336`, about what the old formula gave on 32 GB. I have put the numbers for that on #6472. **Before**, from my 2026-10-17 runs (`main` `82f0c9aec` + this PR at `1d3b33985`, probe build, `logos-Pp1` in the archive): after the 1.40 GiB import at `0x324618000` (924 ms) and the 0.25 GiB head (126 ms), the tail ending at `0x37e000000` was imported again six times with a rising start (`0x3347d8000`, `0x3360e0000`, `0x336254000`, `0x3363ac000`, `0x3363f4000`, `0x336444000`), 270 to 293 ms each, of which create 150 to 172 ms. 49 imports in the run, import time summed 9.7 s. **After**, three runs on `5eba12d6b`: - `r-Mp14-2` (probe): the 1.40 GiB import takes 988 ms (create 191 ms), then the head `0x324614000+0x101c8000` is imported again in 99 ms, and nothing of 10 ms or more follows for that range. 39 imports in 160 s, import time summed 8.2 s. - `r-Mt14-1` (`APS5_TRACE_HOST_IMPORT=1` instead of the probe, so every import is listed): the same head re-import, then only the smaller sides of the later cuts: 25 MiB at `0x3347dc000`, 1.4 MiB at `0x3360e0000`, 1.1 MiB at `0x336254000`, 272 KiB at `0x336374000`, 1.4 MiB at `0x3363bc000`, 16 KiB at `0x336250000` and `0x3360dc000`, and 7 MiB at `0x3359e4000`. 48 imports; live bytes go from 12.1 GiB after the fourth large import to 12.4 GiB at the end and never drop, since the trimmed memory keeps counting. - `r-Mp14-1` (probe): head re-import 97 ms, but then the whole tail `0x3347dc000+0x49824000` (1.15 GiB) is imported three times with identical bounds, 320, 272 and 268 ms (create 154 ms each), followed by 25 MiB at `0x3347dc000`. 43 imports, import time summed 8.9 s. Same bounds each time, so that is a retire and re-import of an unchanged run rather than a trim; I did not trace which condition in `retireOrTrim` took the retire path there (a pending settle would be my first guess), and the other two runs did not show it. So the six moving-start re-imports are gone, and in two of three runs only the small side of each cut is imported again, as you expected. The remaining case is the whole-tail retire in `r-Mp14-1`. The archive has the err, out and samples logs of every run named above plus the 2026-10-17 probe log and the probe patch. AI-assisted: yes (Claude Code)
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!6499
No description provided.