perf(agc): expand recent host imports cache to 16 entries and consult it in findImport #27270

Merged
birdmarty merged 2 commits from upstream-pr/27270 into main 2026-11-27 09:45:47 +00:00
birdmarty commented 2026-11-25 17:31:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by birdmarty on 2026-11-25T17:31:52Z.


What

HostImports kept a 4-entry recentImports fast-path cache that was consulted only in HostImportFor, leaving findImport and ExistingHostImportFor to walk the std::map (peekImport) on every lookup and thrashing when a frame alternates across more than 4 large host-imported arenas (buffers, vertex/index heaps, labels, and scratch regions).

Changes

  • core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp:
    • Expand HostImports::recentImports from 4 to 16 entries and reset recentNext = 0 when the cache is cleared on epoch or import-count change.
    • Check recentImport before peekImport in findImport and populate rememberImport on a map hit.
    • Remove the duplicate recentImport / lastUse / rememberImport work from HostImportFor, HostImportJoinedFor, and ExistingHostImportFor (follow-up 7861a468bd) so misses scan the cache once and write each entry into one slot, while keeping ExistingHostImportFor read-only (importsStale returns nullptr without mutating state).

Tested

Windows 11 Pro (build 26300), i9-9900K, MinGW-w64 GCC 15.3.0, Release build, AMD Radeon RX 6800 (vendor=0x1002, device=0x73bf), AMD proprietary driver 26.10.1 (Windows driver 32.0.21045.16010, Vulkan 1.4.315).

Unit tests on 7861a468bd (follow-up on 3bb93e7408, base origin/main c032ba7c52) compared against origin/main 0af6efad52 with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation (Vulkan SDK 1.4.363.0), VK_LOADER_DEBUG=layer:

  • Focused 20-test host-import and recorder set (agc_driver_host_import_*, agc_host_import_*, agc_driver_bda_device, agc_driver_linear_target_import_creation, agc_driver_sparse_heap_import, agc_driver_recorder): 19 / 20 passed on both origin/main 0af6efad52 and 7861a468bd, Insert instance layer "VK_LAYER_KHRONOS_validation" confirmed 25 times on both, 0 VUID- errors. The single failure on both sides is pre-existing agc_driver_linear_target_import_creation (verified identical with APS5_NO_RECENT_IMPORTS=1).
  • tools/check_conventions.py --base origin/main: passed.
  • tools/debt_fold.py --check: passed.

Lies of P (PPSA10621, v01.012.000, 3200x1800, Krat Central Station Plaza):

  • Measured in stack (local test stack on 61250ca018, ~6,800 live host imports): 10.97 → 11.25 FPS (p50 90.7 → 87.9 ms, gpu 59.8 → 58.4 ms/f), 0 mismatches across 243,421 live cross-checks.

Performance captures (APS5_TRACE_SECONDS=120:30, clean warm shader cache, no extra APS5_TRACE_* or APS5_PROFILE_* switches)

Same machine, title (PPSA10621, v01.012.000, 3200x1800, Krat Central Station Plaza), and flags (APS5_DRAW_PIPELINE=1 APS5_NO_DRAW_STAGING=1 APS5_PIPELINE_DISPATCH=1 APS5_PIPELINE_DISPATCH_MISSES=1 APS5_FAST_F32=1):

  • Baseline (main, c032ba7c52): 9.00 FPS, p50 110.5 ms, p90 117.7 ms, max 151.1 ms, gpu 70.31 ms/f, Graphics.Draw 72.33 ms/f (aps5-trace-c032ba7c5273-23148.json.gz).
  • This PR (3bb93e7408): 8.93 FPS (-0.07), p50 111.2 ms (+0.7 ms), p90 118.6 ms (+0.9 ms), max 153.6 ms, gpu 69.61 ms/f (-0.69 ms/f), Graphics.Draw 73.36 ms/f (+1.03 ms/f) (aps5-trace-3bb93e740836-35972.json.gz).

Baseline aps5-summary.jsonl (c032ba7c52):

{"commit":"c032ba7c5273","dirty":false,"env":{"APS5_DRAW_PIPELINE":"1","APS5_FAST_F32":"1","APS5_NO_DRAW_STAGING":"1","APS5_PIPELINE_DISPATCH":"1","APS5_PIPELINE_DISPATCH_MISSES":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"120:30"},"gpu":"AMD Radeon RX 6800","driver":"AMD proprietary driver 26.10.1 (AMD proprietary shader compiler)","os":"Windows 10.0.26300","cpu":"Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz","cpu_threads":16,"memory_mib":32705,"title_id":"PPSA10621","title":"Lies of P","content_version":"01.012.000","resolution":"3200x1800","window":{"spec":"seconds 120:30","first_present":1868,"ms":30000.335},"presents":270,"frame_ms":{"p50":110.451,"p90":117.685,"p99":136.262,"max":151.058},"gpu_busy_ms_per_present":70.305,"worker_busy_pct":{"queue worker 0x0":76.542,"queue worker 0x20":99.732},"phase_totals_ms":{"Driver.Completion":6.857,"Driver.Dispatch":2576.211,"Driver.Dispatch.capture_resources":776.998,"Driver.Dispatch.decode_key_device_setup":90.334,"Driver.Dispatch.lookup_cache":24.295,"Driver.Dispatch.materialize":107.798,"Driver.Dispatch.prepared_invocation":85.609,"Driver.Draw":11311.458,"Driver.Draw.device_setup":2083.563,"Driver.Draw.draw_enqueued":74.404,"Driver.Draw.draw_handed_off":2299.969,"Driver.Draw.post_compile_prepare":4.101,"Driver.Draw.prepare":6471.236,"Driver.Draw.shader_compile_and_link":335.428,"Driver.DrawFinish":13623.764,"Driver.DrawFinish.draw_enqueued":6140.677,"Driver.DrawFinish.post_compile_prepare":173.565,"Driver.DrawFinish.shader_compile_and_link":7239.851,"Driver.EndSubmission":360.907,"Driver.Packet":52514.955,"Driver.Packet.device_lock":253.798,"Driver.Packet.dispatch":3719.685,"Driver.Packet.draw":11447.079,"Driver.Packet.execute":2730.492,"Driver.Packet.flip_flush":6.178,"Driver.Packet.flush_between_packets":606.336,"Driver.Packet.memory_wait":26653.660,"Driver.Packet.pipeline_drain":3757.506,"Driver.Packet.pipeline_prepare":355.259,"Driver.Packet.prepare_memory":1068.661,"Driver.Packet.rendering_wait":0.887,"Driver.Present":1078.304,"Driver.Present.acquire_image":254.049,"Driver.Present.device_setup":0.153,"Driver.Present.gpu_mutex_wait":63.352,"Driver.Present.inflight_wait":0.586,"Driver.Present.present_display_buffer":36.162,"Driver.Present.queue_present":32.722,"Driver.Present.release_and_callback":0.469,"Driver.Present.render_fence_wait":690.093,"Driver.Present.resize":0.449,"Driver.Present.validate":0.114,"Driver.Suspend":0.074,"GpuMutex.wait.copy":0.000,"GpuMutex.wait.dispatch":413.521,"GpuMutex.wait.draw":184.806,"GpuMutex.wait.end":177.694,"GpuMutex.wait.fill":480.794,"GpuMutex.wait.flush":136.035,"GpuMutex.wait.hook":463.906,"GpuMutex.wait.indirect":0.179,"GpuMutex.wait.label":552.065,"GpuMutex.wait.other":282.692,"GpuMutex.wait.present":62.604,"Graphics.Draw":19528.738,"Graphics.Draw.draw_and_resource_release":16102.692,"Graphics.Draw.index_upload":1387.602,"Graphics.Draw.validate":733.456,"Graphics.Draw.vertex_upload":1141.137,"Recorder.Reap":861.632,"Recorder.Submit":1319.579,"Recorder.Sync":1178.759,"Resources.Complete":753.864,"Resources.Prepare":728.019,"Shader.DrawStage":6992.760,"Shader.DrawStage.capture_resources":3601.401,"Shader.DrawStage.materialize":2383.009,"Shader.DrawStage.prepared_invocation":927.267,"VideoOut.Flip":1083.682,"VideoOut.Flip.completion_mutex_wait":0.258,"VideoOut.Flip.config_mutex_wait":0.032,"VideoOut.Flip.frame_limit":0.133,"VideoOut.Flip.notify_game":4.699,"VideoOut.Flip.present":1075.826,"VideoOut.Flip.validate":0.307,"VideoOut.Flip.vblank_wait":0.170,"VideoOut.Flip.window_prepare":0.356,"VideoOut.Flip.window_title":1.683,"VideoOut.Readiness":0.685,"VideoOut.Readiness.locks_validate":0.254,"Vulkan.Acquire":253.762,"Vulkan.Acquire.acquire_fence_wait":232.181,"Vulkan.Acquire.acquire_image":20.320,"Vulkan.Acquire.fence_reset":0.655,"Vulkan.Acquire.retired_swapchains":0.489,"Vulkan.Dispatch":1208.475,"Vulkan.Dispatch.command_record":368.902,"Vulkan.Dispatch.shader_resources":822.450,"Vulkan.DispatchRecipe":32.147,"Vulkan.DispatchRecipe.command_record":31.604,"Vulkan.Present":17.962,"Vulkan.Present.command_record_scale":8.194,"Vulkan.Present.pixel_upload":5.610,"Vulkan.Present.queue_submit":3.959,"Vulkan.QueuePresent":32.203,"Vulkan.QueuePresent.queue_present":31.778,"Vulkan.Retire":1036.495,"Vulkan.Retire.wait":683.040},"top_phases_ms_per_frame":{"Driver.Packet":194.500,"Driver.Packet.memory_wait":98.717,"Graphics.Draw":72.329,"Graphics.Draw.draw_and_resource_release":59.640,"Driver.DrawFinish":50.458,"Driver.Packet.draw":42.397,"Driver.Draw":41.894,"Driver.DrawFinish.shader_compile_and_link":26.814},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":18469,"Graphics.Barrier.dcc-clear":6752,"Graphics.Barrier.dcc-keys":4044,"Graphics.Barrier.dispatch-lead":29397,"Graphics.Barrier.dispatch-trail":44403,"Graphics.Barrier.draw":200066,"Graphics.Barrier.fill":5996,"Graphics.Barrier.fill-clear":1620,"Graphics.Barrier.indirect-args":1080,"Graphics.Barrier.input-mirror":31,"Graphics.Barrier.label-run":285608,"Graphics.Barrier.present-blit":540,"Graphics.Barrier.shadow-publish":927,"Graphics.Barrier.staging-in":43119,"Graphics.Barrier.staging-out":20753,"Graphics.Barrier.storage-upload":292,"Graphics.Barrier.storage-writeback":10235,"Graphics.BarrierMerged.copy":201,"Graphics.BarrierMerged.dispatch-lead":17166,"Graphics.BarrierMerged.fill":2374,"Graphics.BarrierMerged.label-run":1753,"Graphics.BarrierMerged.shadow-publish":927,"Graphics.BarrierMerged.staging-in":19140,"Graphics.BarrierMerged.staging-out":20753,"Graphics.BarrierMerged.storage-writeback":2277,"Graphics.Copy":63947,"Graphics.Copy.bytes":18255207206,"Graphics.RenderPass":119930,"Graphics.RenderPass.Close.command":8707,"Graphics.RenderPass.Close.image":48617,"Graphics.RenderPass.Close.key":14146,"Graphics.RenderPass.Close.label":1753,"Graphics.RenderPass.Close.new-batch":46707,"Graphics.RenderPass.Continued":378527},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":19.158,"events_lost":147525,"totals_full":false},"draw committer":{"events_full_after_s":12.580,"events_lost":360672,"totals_full":false},"draw finisher":{"events_full_after_s":19.018,"events_lost":151019,"totals_full":false}},"trace":"aps5-trace-c032ba7c5273-23148.json.gz"}

Candidate aps5-summary.jsonl (3bb93e7408):

{"commit":"3bb93e740836","dirty":false,"env":{"APS5_DRAW_PIPELINE":"1","APS5_FAST_F32":"1","APS5_NO_DRAW_STAGING":"1","APS5_PIPELINE_DISPATCH":"1","APS5_PIPELINE_DISPATCH_MISSES":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"120:30"},"gpu":"AMD Radeon RX 6800","driver":"AMD proprietary driver 26.10.1 (AMD proprietary shader compiler)","os":"Windows 10.0.26300","cpu":"Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz","cpu_threads":16,"memory_mib":32705,"title_id":"PPSA10621","title":"Lies of P","content_version":"01.012.000","resolution":"3200x1800","window":{"spec":"seconds 120:30","first_present":1912,"ms":30004.592},"presents":268,"frame_ms":{"p50":111.173,"p90":118.568,"p99":139.138,"max":153.619},"gpu_busy_ms_per_present":69.612,"worker_busy_pct":{"queue worker 0x0":76.635,"queue worker 0x20":99.701},"phase_totals_ms":{"Driver.Completion":6.846,"Driver.Dispatch":2694.247,"Driver.Dispatch.capture_resources":861.527,"Driver.Dispatch.decode_key_device_setup":92.428,"Driver.Dispatch.lookup_cache":24.033,"Driver.Dispatch.materialize":107.671,"Driver.Dispatch.prepared_invocation":85.793,"Driver.Draw":11438.769,"Driver.Draw.device_setup":2121.221,"Driver.Draw.draw_enqueued":76.744,"Driver.Draw.draw_handed_off":2300.675,"Driver.Draw.post_compile_prepare":4.088,"Driver.Draw.prepare":6561.039,"Driver.Draw.shader_compile_and_link":331.256,"Driver.DrawFinish":13433.053,"Driver.DrawFinish.draw_enqueued":5929.424,"Driver.DrawFinish.post_compile_prepare":176.848,"Driver.DrawFinish.shader_compile_and_link":7249.040,"Driver.EndSubmission":319.585,"Driver.Packet":52582.243,"Driver.Packet.device_lock":252.358,"Driver.Packet.dispatch":3897.309,"Driver.Packet.draw":11577.544,"Driver.Packet.execute":2671.210,"Driver.Packet.flip_flush":5.600,"Driver.Packet.flush_between_packets":633.028,"Driver.Packet.memory_wait":26384.049,"Driver.Packet.pipeline_drain":3668.255,"Driver.Packet.pipeline_prepare":352.975,"Driver.Packet.prepare_memory":1196.402,"Driver.Packet.rendering_wait":0.902,"Driver.Present":914.360,"Driver.Present.acquire_image":207.833,"Driver.Present.device_setup":0.148,"Driver.Present.gpu_mutex_wait":73.111,"Driver.Present.inflight_wait":0.579,"Driver.Present.present_display_buffer":35.424,"Driver.Present.queue_present":32.439,"Driver.Present.release_and_callback":0.479,"Driver.Present.render_fence_wait":563.670,"Driver.Present.resize":0.455,"Driver.Present.validate":0.055,"Driver.Suspend":0.073,"GpuMutex.wait.dispatch":405.622,"GpuMutex.wait.draw":185.851,"GpuMutex.wait.end":150.701,"GpuMutex.wait.fill":495.629,"GpuMutex.wait.flush":171.544,"GpuMutex.wait.hook":482.135,"GpuMutex.wait.indirect":0.243,"GpuMutex.wait.label":632.810,"GpuMutex.wait.other":367.961,"GpuMutex.wait.present":72.343,"Graphics.Draw":19660.882,"Graphics.Draw.draw_and_resource_release":16183.788,"Graphics.Draw.index_upload":1441.258,"Graphics.Draw.validate":737.672,"Graphics.Draw.vertex_upload":1136.986,"Recorder.Reap":868.828,"Recorder.Submit":1224.997,"Recorder.Sync":1255.496,"Resources.Complete":787.875,"Resources.Prepare":751.415,"Shader.DrawStage":7001.175,"Shader.DrawStage.capture_resources":3616.001,"Shader.DrawStage.materialize":2408.002,"Shader.DrawStage.prepared_invocation":894.368,"VideoOut.Flip":921.564,"VideoOut.Flip.completion_mutex_wait":0.269,"VideoOut.Flip.config_mutex_wait":0.034,"VideoOut.Flip.frame_limit":0.134,"VideoOut.Flip.notify_game":4.896,"VideoOut.Flip.present":913.665,"VideoOut.Flip.validate":0.281,"VideoOut.Flip.vblank_wait":0.186,"VideoOut.Flip.window_prepare":0.435,"VideoOut.Flip.window_title":1.419,"VideoOut.Readiness":0.619,"VideoOut.Readiness.locks_validate":0.210,"Vulkan.Acquire":207.569,"Vulkan.Acquire.acquire_fence_wait":185.929,"Vulkan.Acquire.acquire_image":20.322,"Vulkan.Acquire.fence_reset":0.720,"Vulkan.Acquire.retired_swapchains":0.489,"Vulkan.Dispatch":1178.051,"Vulkan.Dispatch.command_record":370.675,"Vulkan.Dispatch.shader_resources":790.282,"Vulkan.DispatchRecipe":33.829,"Vulkan.DispatchRecipe.command_record":33.289,"Vulkan.Present":17.422,"Vulkan.Present.command_record_scale":8.232,"Vulkan.Present.pixel_upload":5.006,"Vulkan.Present.queue_submit":3.988,"Vulkan.QueuePresent":31.900,"Vulkan.QueuePresent.queue_present":31.459,"Vulkan.Retire":801.947,"Vulkan.Retire.wait":556.754},"top_phases_ms_per_frame":{"Driver.Packet":196.202,"Driver.Packet.memory_wait":98.448,"Graphics.Draw":73.362,"Graphics.Draw.draw_and_resource_release":60.387,"Driver.DrawFinish":50.123,"Driver.Packet.draw":43.200,"Driver.Draw":42.682,"Driver.DrawFinish.shader_compile_and_link":27.049},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":18436,"Graphics.Barrier.dcc-clear":6700,"Graphics.Barrier.dcc-keys":4012,"Graphics.Barrier.dispatch-lead":29072,"Graphics.Barrier.dispatch-trail":44086,"Graphics.Barrier.draw":198524,"Graphics.Barrier.fill":5945,"Graphics.Barrier.fill-clear":1606,"Graphics.Barrier.indirect-args":1072,"Graphics.Barrier.input-mirror":26,"Graphics.Barrier.label-run":283745,"Graphics.Barrier.present-blit":536,"Graphics.Barrier.shadow-publish":824,"Graphics.Barrier.staging-in":42563,"Graphics.Barrier.staging-out":20495,"Graphics.Barrier.storage-upload":356,"Graphics.Barrier.storage-writeback":9949,"Graphics.BarrierMerged.copy":61,"Graphics.BarrierMerged.dispatch-lead":17158,"Graphics.BarrierMerged.fill":2363,"Graphics.BarrierMerged.label-run":1726,"Graphics.BarrierMerged.shadow-publish":824,"Graphics.BarrierMerged.staging-in":18922,"Graphics.BarrierMerged.staging-out":20495,"Graphics.BarrierMerged.storage-writeback":2155,"Graphics.Copy":63203,"Graphics.Copy.bytes":20972889217,"Graphics.RenderPass":119209,"Graphics.RenderPass.Close.command":8454,"Graphics.RenderPass.Close.image":48587,"Graphics.RenderPass.Close.key":13950,"Graphics.RenderPass.Close.label":1726,"Graphics.RenderPass.Close.new-batch":46493,"Graphics.RenderPass.Continued":377611},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":18.966,"events_lost":153493,"totals_full":false},"draw committer":{"events_full_after_s":12.722,"events_lost":359190,"totals_full":false},"draw finisher":{"events_full_after_s":18.933,"events_lost":155514,"totals_full":false}},"trace":"aps5-trace-3bb93e740836-35972.json.gz"}

Series context & interleaved ablation

This PR is part of a general AGC/libc performance series measured on Lies of P (PPSA10621, v01.012.000, 3200x1800, UE4) covering #27249, #27250, #27251, #27252, #27253, #27254, #27268, #27269, #27270, #27271, and #27273 (tested together with #20130, #18757, #26778, #27117, and now-merged #26581 and #26681). Combined on base 61250ca018 (plus remaining unsplit stack changes), steady-state performance rose from 7.25 FPS (p50 135.6 ms, gpu 92.7 ms/f, default settings) to 12.15 FPS average (12.00 / 12.30 FPS, peak 12.33 FPS, p50 81.5 ms, gpu 57.12 ms/f, +67.6% to +70.1%).

Because five of the smaller PRs (#27253, #27254, #27270, #27271, and #27273) looked like they slightly lost average FPS (-0.03 to -0.31 FPS) in single isolated runs on c032ba7c52, we ran an interleaved 4-run ablation (A1 -> B1 -> A2 -> B2, APS5_TRACE_SECONDS=120:30, identical warm shader cache and flags) on the full stack to test whether removing those 5 PRs helped or hurt:

Run Build FPS p50 (ms) p90 (ms) max (ms) GPU busy (ms/f) DrawWithRecipe (ms/f) DrawFinish (ms/f)
A1 Arm A (base 61250ca018, WITH all 11 PRs incl. #27253, #27254, #27270, #27271, #27273) 12.00 81.9 90.5 117.9 58.58 46.22 42.16
B1 Arm B (base 61250ca018, MINUS #27253, #27254, #27270, #27271, #27273) 11.86 82.4 92.9 122.9 58.96 46.65 42.71
A2 Arm A (base 61250ca018, WITH all 11 PRs incl. #27253, #27254, #27270, #27271, #27273) 12.30 81.0 87.3 108.8 55.66 45.71 42.24
B2 Arm B (base 61250ca018, MINUS #27253, #27254, #27270, #27271, #27273) 11.65 84.7 94.1 124.8 61.69 47.32 43.45
Arm A avg Full stack (WITH all 11 PRs) 12.15 81.5 88.9 113.4 57.12 45.96 42.20
Arm B avg Minus #27253, #27254, #27270, #27271, #27273 11.76 83.5 93.5 123.9 60.33 46.98 43.08
Effect of the 5 PRs (A vs B) — +0.39 FPS (+3.3%) -2.1 ms -4.6 ms -10.5 ms -3.21 ms/f -1.02 ms/f -0.88 ms/f

Removing those 5 PRs hurt every run (A1 > B1 and A2 > B2 across all metrics), showing that their single-run isolated dips on c032ba7c52 were within ±0.25 FPS scene variance while larger bottlenecks (#27268, #27249, #27252, #20130, #18757) still dominated. Individual PR captures above remain isolated against c032ba7c52.

Not tested: Linux, NVIDIA/Intel GPUs, fresh Lies of P capture on follow-up 7861a468bd (captures above are from 3bb93e7408).

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 and the licence notice of code adapted from upstream (see AGENTS.md)
  • 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
  • Fixes: none
  • Unblocks: none
  • GPUs tested: AMD Radeon RX 6800 (vendor=0x1002, device=0x73bf), AMD proprietary driver 26.10.1 (Windows driver 32.0.21045.16010, Vulkan 1.4.315), Windows 11 Pro (build 26300); Khronos validation layer on main 0af6efad52 and this change, 0 VUIDs
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5496076862 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/27270). Originally posted by [birdmarty](https://github.com/birdmarty) on 2026-11-25T17:31:52Z. --- ### What `HostImports` kept a 4-entry `recentImports` fast-path cache that was consulted only in `HostImportFor`, leaving `findImport` and `ExistingHostImportFor` to walk the `std::map` (`peekImport`) on every lookup and thrashing when a frame alternates across more than 4 large host-imported arenas (buffers, vertex/index heaps, labels, and scratch regions). #### Changes - `core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp`: - Expand `HostImports::recentImports` from 4 to 16 entries and reset `recentNext = 0` when the cache is cleared on epoch or import-count change. - Check `recentImport` before `peekImport` in `findImport` and populate `rememberImport` on a map hit. - Remove the duplicate `recentImport` / `lastUse` / `rememberImport` work from `HostImportFor`, `HostImportJoinedFor`, and `ExistingHostImportFor` (follow-up 7861a468bd) so misses scan the cache once and write each entry into one slot, while keeping `ExistingHostImportFor` read-only (`importsStale` returns `nullptr` without mutating state). ### Tested Windows 11 Pro (build 26300), i9-9900K, MinGW-w64 GCC 15.3.0, Release build, AMD Radeon RX 6800 (`vendor=0x1002`, `device=0x73bf`), AMD proprietary driver `26.10.1` (Windows driver `32.0.21045.16010`, Vulkan `1.4.315`). Unit tests on 7861a468bd (follow-up on 3bb93e7408, base `origin/main` c032ba7c52) compared against `origin/main` 0af6efad52 with `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1`, `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation` (Vulkan SDK `1.4.363.0`), `VK_LOADER_DEBUG=layer`: - Focused 20-test host-import and recorder set (`agc_driver_host_import_*`, `agc_host_import_*`, `agc_driver_bda_device`, `agc_driver_linear_target_import_creation`, `agc_driver_sparse_heap_import`, `agc_driver_recorder`): **19 / 20 passed** on both `origin/main` 0af6efad52 and 7861a468bd, `Insert instance layer "VK_LAYER_KHRONOS_validation"` confirmed 25 times on both, **0 `VUID-` errors**. The single failure on both sides is pre-existing `agc_driver_linear_target_import_creation` (verified identical with `APS5_NO_RECENT_IMPORTS=1`). - `tools/check_conventions.py --base origin/main`: passed. - `tools/debt_fold.py --check`: passed. Lies of P (`PPSA10621`, `v01.012.000`, `3200x1800`, Krat Central Station Plaza): - Measured in stack (local test stack on 61250ca018, `~6,800` live host imports): `10.97 → 11.25 FPS` (`p50 90.7 → 87.9 ms`, `gpu 59.8 → 58.4 ms/f`), **0 mismatches** across 243,421 live cross-checks. #### Performance captures (`APS5_TRACE_SECONDS=120:30`, clean warm shader cache, no extra `APS5_TRACE_*` or `APS5_PROFILE_*` switches) Same machine, title (`PPSA10621`, `v01.012.000`, `3200x1800`, Krat Central Station Plaza), and flags (`APS5_DRAW_PIPELINE=1 APS5_NO_DRAW_STAGING=1 APS5_PIPELINE_DISPATCH=1 APS5_PIPELINE_DISPATCH_MISSES=1 APS5_FAST_F32=1`): - Baseline (`main`, c032ba7c5273): `9.00 FPS`, `p50 110.5 ms`, `p90 117.7 ms`, `max 151.1 ms`, `gpu 70.31 ms/f`, `Graphics.Draw 72.33 ms/f` (`aps5-trace-c032ba7c5273-23148.json.gz`). - This PR (3bb93e740836): `8.93 FPS` (`-0.07`), `p50 111.2 ms` (`+0.7 ms`), `p90 118.6 ms` (`+0.9 ms`), `max 153.6 ms`, `gpu 69.61 ms/f` (`-0.69 ms/f`), `Graphics.Draw 73.36 ms/f` (`+1.03 ms/f`) (`aps5-trace-3bb93e740836-35972.json.gz`). Baseline `aps5-summary.jsonl` (c032ba7c5273): ```json {"commit":"c032ba7c5273","dirty":false,"env":{"APS5_DRAW_PIPELINE":"1","APS5_FAST_F32":"1","APS5_NO_DRAW_STAGING":"1","APS5_PIPELINE_DISPATCH":"1","APS5_PIPELINE_DISPATCH_MISSES":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"120:30"},"gpu":"AMD Radeon RX 6800","driver":"AMD proprietary driver 26.10.1 (AMD proprietary shader compiler)","os":"Windows 10.0.26300","cpu":"Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz","cpu_threads":16,"memory_mib":32705,"title_id":"PPSA10621","title":"Lies of P","content_version":"01.012.000","resolution":"3200x1800","window":{"spec":"seconds 120:30","first_present":1868,"ms":30000.335},"presents":270,"frame_ms":{"p50":110.451,"p90":117.685,"p99":136.262,"max":151.058},"gpu_busy_ms_per_present":70.305,"worker_busy_pct":{"queue worker 0x0":76.542,"queue worker 0x20":99.732},"phase_totals_ms":{"Driver.Completion":6.857,"Driver.Dispatch":2576.211,"Driver.Dispatch.capture_resources":776.998,"Driver.Dispatch.decode_key_device_setup":90.334,"Driver.Dispatch.lookup_cache":24.295,"Driver.Dispatch.materialize":107.798,"Driver.Dispatch.prepared_invocation":85.609,"Driver.Draw":11311.458,"Driver.Draw.device_setup":2083.563,"Driver.Draw.draw_enqueued":74.404,"Driver.Draw.draw_handed_off":2299.969,"Driver.Draw.post_compile_prepare":4.101,"Driver.Draw.prepare":6471.236,"Driver.Draw.shader_compile_and_link":335.428,"Driver.DrawFinish":13623.764,"Driver.DrawFinish.draw_enqueued":6140.677,"Driver.DrawFinish.post_compile_prepare":173.565,"Driver.DrawFinish.shader_compile_and_link":7239.851,"Driver.EndSubmission":360.907,"Driver.Packet":52514.955,"Driver.Packet.device_lock":253.798,"Driver.Packet.dispatch":3719.685,"Driver.Packet.draw":11447.079,"Driver.Packet.execute":2730.492,"Driver.Packet.flip_flush":6.178,"Driver.Packet.flush_between_packets":606.336,"Driver.Packet.memory_wait":26653.660,"Driver.Packet.pipeline_drain":3757.506,"Driver.Packet.pipeline_prepare":355.259,"Driver.Packet.prepare_memory":1068.661,"Driver.Packet.rendering_wait":0.887,"Driver.Present":1078.304,"Driver.Present.acquire_image":254.049,"Driver.Present.device_setup":0.153,"Driver.Present.gpu_mutex_wait":63.352,"Driver.Present.inflight_wait":0.586,"Driver.Present.present_display_buffer":36.162,"Driver.Present.queue_present":32.722,"Driver.Present.release_and_callback":0.469,"Driver.Present.render_fence_wait":690.093,"Driver.Present.resize":0.449,"Driver.Present.validate":0.114,"Driver.Suspend":0.074,"GpuMutex.wait.copy":0.000,"GpuMutex.wait.dispatch":413.521,"GpuMutex.wait.draw":184.806,"GpuMutex.wait.end":177.694,"GpuMutex.wait.fill":480.794,"GpuMutex.wait.flush":136.035,"GpuMutex.wait.hook":463.906,"GpuMutex.wait.indirect":0.179,"GpuMutex.wait.label":552.065,"GpuMutex.wait.other":282.692,"GpuMutex.wait.present":62.604,"Graphics.Draw":19528.738,"Graphics.Draw.draw_and_resource_release":16102.692,"Graphics.Draw.index_upload":1387.602,"Graphics.Draw.validate":733.456,"Graphics.Draw.vertex_upload":1141.137,"Recorder.Reap":861.632,"Recorder.Submit":1319.579,"Recorder.Sync":1178.759,"Resources.Complete":753.864,"Resources.Prepare":728.019,"Shader.DrawStage":6992.760,"Shader.DrawStage.capture_resources":3601.401,"Shader.DrawStage.materialize":2383.009,"Shader.DrawStage.prepared_invocation":927.267,"VideoOut.Flip":1083.682,"VideoOut.Flip.completion_mutex_wait":0.258,"VideoOut.Flip.config_mutex_wait":0.032,"VideoOut.Flip.frame_limit":0.133,"VideoOut.Flip.notify_game":4.699,"VideoOut.Flip.present":1075.826,"VideoOut.Flip.validate":0.307,"VideoOut.Flip.vblank_wait":0.170,"VideoOut.Flip.window_prepare":0.356,"VideoOut.Flip.window_title":1.683,"VideoOut.Readiness":0.685,"VideoOut.Readiness.locks_validate":0.254,"Vulkan.Acquire":253.762,"Vulkan.Acquire.acquire_fence_wait":232.181,"Vulkan.Acquire.acquire_image":20.320,"Vulkan.Acquire.fence_reset":0.655,"Vulkan.Acquire.retired_swapchains":0.489,"Vulkan.Dispatch":1208.475,"Vulkan.Dispatch.command_record":368.902,"Vulkan.Dispatch.shader_resources":822.450,"Vulkan.DispatchRecipe":32.147,"Vulkan.DispatchRecipe.command_record":31.604,"Vulkan.Present":17.962,"Vulkan.Present.command_record_scale":8.194,"Vulkan.Present.pixel_upload":5.610,"Vulkan.Present.queue_submit":3.959,"Vulkan.QueuePresent":32.203,"Vulkan.QueuePresent.queue_present":31.778,"Vulkan.Retire":1036.495,"Vulkan.Retire.wait":683.040},"top_phases_ms_per_frame":{"Driver.Packet":194.500,"Driver.Packet.memory_wait":98.717,"Graphics.Draw":72.329,"Graphics.Draw.draw_and_resource_release":59.640,"Driver.DrawFinish":50.458,"Driver.Packet.draw":42.397,"Driver.Draw":41.894,"Driver.DrawFinish.shader_compile_and_link":26.814},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":18469,"Graphics.Barrier.dcc-clear":6752,"Graphics.Barrier.dcc-keys":4044,"Graphics.Barrier.dispatch-lead":29397,"Graphics.Barrier.dispatch-trail":44403,"Graphics.Barrier.draw":200066,"Graphics.Barrier.fill":5996,"Graphics.Barrier.fill-clear":1620,"Graphics.Barrier.indirect-args":1080,"Graphics.Barrier.input-mirror":31,"Graphics.Barrier.label-run":285608,"Graphics.Barrier.present-blit":540,"Graphics.Barrier.shadow-publish":927,"Graphics.Barrier.staging-in":43119,"Graphics.Barrier.staging-out":20753,"Graphics.Barrier.storage-upload":292,"Graphics.Barrier.storage-writeback":10235,"Graphics.BarrierMerged.copy":201,"Graphics.BarrierMerged.dispatch-lead":17166,"Graphics.BarrierMerged.fill":2374,"Graphics.BarrierMerged.label-run":1753,"Graphics.BarrierMerged.shadow-publish":927,"Graphics.BarrierMerged.staging-in":19140,"Graphics.BarrierMerged.staging-out":20753,"Graphics.BarrierMerged.storage-writeback":2277,"Graphics.Copy":63947,"Graphics.Copy.bytes":18255207206,"Graphics.RenderPass":119930,"Graphics.RenderPass.Close.command":8707,"Graphics.RenderPass.Close.image":48617,"Graphics.RenderPass.Close.key":14146,"Graphics.RenderPass.Close.label":1753,"Graphics.RenderPass.Close.new-batch":46707,"Graphics.RenderPass.Continued":378527},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":19.158,"events_lost":147525,"totals_full":false},"draw committer":{"events_full_after_s":12.580,"events_lost":360672,"totals_full":false},"draw finisher":{"events_full_after_s":19.018,"events_lost":151019,"totals_full":false}},"trace":"aps5-trace-c032ba7c5273-23148.json.gz"} ``` Candidate `aps5-summary.jsonl` (3bb93e740836): ```json {"commit":"3bb93e740836","dirty":false,"env":{"APS5_DRAW_PIPELINE":"1","APS5_FAST_F32":"1","APS5_NO_DRAW_STAGING":"1","APS5_PIPELINE_DISPATCH":"1","APS5_PIPELINE_DISPATCH_MISSES":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"120:30"},"gpu":"AMD Radeon RX 6800","driver":"AMD proprietary driver 26.10.1 (AMD proprietary shader compiler)","os":"Windows 10.0.26300","cpu":"Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz","cpu_threads":16,"memory_mib":32705,"title_id":"PPSA10621","title":"Lies of P","content_version":"01.012.000","resolution":"3200x1800","window":{"spec":"seconds 120:30","first_present":1912,"ms":30004.592},"presents":268,"frame_ms":{"p50":111.173,"p90":118.568,"p99":139.138,"max":153.619},"gpu_busy_ms_per_present":69.612,"worker_busy_pct":{"queue worker 0x0":76.635,"queue worker 0x20":99.701},"phase_totals_ms":{"Driver.Completion":6.846,"Driver.Dispatch":2694.247,"Driver.Dispatch.capture_resources":861.527,"Driver.Dispatch.decode_key_device_setup":92.428,"Driver.Dispatch.lookup_cache":24.033,"Driver.Dispatch.materialize":107.671,"Driver.Dispatch.prepared_invocation":85.793,"Driver.Draw":11438.769,"Driver.Draw.device_setup":2121.221,"Driver.Draw.draw_enqueued":76.744,"Driver.Draw.draw_handed_off":2300.675,"Driver.Draw.post_compile_prepare":4.088,"Driver.Draw.prepare":6561.039,"Driver.Draw.shader_compile_and_link":331.256,"Driver.DrawFinish":13433.053,"Driver.DrawFinish.draw_enqueued":5929.424,"Driver.DrawFinish.post_compile_prepare":176.848,"Driver.DrawFinish.shader_compile_and_link":7249.040,"Driver.EndSubmission":319.585,"Driver.Packet":52582.243,"Driver.Packet.device_lock":252.358,"Driver.Packet.dispatch":3897.309,"Driver.Packet.draw":11577.544,"Driver.Packet.execute":2671.210,"Driver.Packet.flip_flush":5.600,"Driver.Packet.flush_between_packets":633.028,"Driver.Packet.memory_wait":26384.049,"Driver.Packet.pipeline_drain":3668.255,"Driver.Packet.pipeline_prepare":352.975,"Driver.Packet.prepare_memory":1196.402,"Driver.Packet.rendering_wait":0.902,"Driver.Present":914.360,"Driver.Present.acquire_image":207.833,"Driver.Present.device_setup":0.148,"Driver.Present.gpu_mutex_wait":73.111,"Driver.Present.inflight_wait":0.579,"Driver.Present.present_display_buffer":35.424,"Driver.Present.queue_present":32.439,"Driver.Present.release_and_callback":0.479,"Driver.Present.render_fence_wait":563.670,"Driver.Present.resize":0.455,"Driver.Present.validate":0.055,"Driver.Suspend":0.073,"GpuMutex.wait.dispatch":405.622,"GpuMutex.wait.draw":185.851,"GpuMutex.wait.end":150.701,"GpuMutex.wait.fill":495.629,"GpuMutex.wait.flush":171.544,"GpuMutex.wait.hook":482.135,"GpuMutex.wait.indirect":0.243,"GpuMutex.wait.label":632.810,"GpuMutex.wait.other":367.961,"GpuMutex.wait.present":72.343,"Graphics.Draw":19660.882,"Graphics.Draw.draw_and_resource_release":16183.788,"Graphics.Draw.index_upload":1441.258,"Graphics.Draw.validate":737.672,"Graphics.Draw.vertex_upload":1136.986,"Recorder.Reap":868.828,"Recorder.Submit":1224.997,"Recorder.Sync":1255.496,"Resources.Complete":787.875,"Resources.Prepare":751.415,"Shader.DrawStage":7001.175,"Shader.DrawStage.capture_resources":3616.001,"Shader.DrawStage.materialize":2408.002,"Shader.DrawStage.prepared_invocation":894.368,"VideoOut.Flip":921.564,"VideoOut.Flip.completion_mutex_wait":0.269,"VideoOut.Flip.config_mutex_wait":0.034,"VideoOut.Flip.frame_limit":0.134,"VideoOut.Flip.notify_game":4.896,"VideoOut.Flip.present":913.665,"VideoOut.Flip.validate":0.281,"VideoOut.Flip.vblank_wait":0.186,"VideoOut.Flip.window_prepare":0.435,"VideoOut.Flip.window_title":1.419,"VideoOut.Readiness":0.619,"VideoOut.Readiness.locks_validate":0.210,"Vulkan.Acquire":207.569,"Vulkan.Acquire.acquire_fence_wait":185.929,"Vulkan.Acquire.acquire_image":20.322,"Vulkan.Acquire.fence_reset":0.720,"Vulkan.Acquire.retired_swapchains":0.489,"Vulkan.Dispatch":1178.051,"Vulkan.Dispatch.command_record":370.675,"Vulkan.Dispatch.shader_resources":790.282,"Vulkan.DispatchRecipe":33.829,"Vulkan.DispatchRecipe.command_record":33.289,"Vulkan.Present":17.422,"Vulkan.Present.command_record_scale":8.232,"Vulkan.Present.pixel_upload":5.006,"Vulkan.Present.queue_submit":3.988,"Vulkan.QueuePresent":31.900,"Vulkan.QueuePresent.queue_present":31.459,"Vulkan.Retire":801.947,"Vulkan.Retire.wait":556.754},"top_phases_ms_per_frame":{"Driver.Packet":196.202,"Driver.Packet.memory_wait":98.448,"Graphics.Draw":73.362,"Graphics.Draw.draw_and_resource_release":60.387,"Driver.DrawFinish":50.123,"Driver.Packet.draw":43.200,"Driver.Draw":42.682,"Driver.DrawFinish.shader_compile_and_link":27.049},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":18436,"Graphics.Barrier.dcc-clear":6700,"Graphics.Barrier.dcc-keys":4012,"Graphics.Barrier.dispatch-lead":29072,"Graphics.Barrier.dispatch-trail":44086,"Graphics.Barrier.draw":198524,"Graphics.Barrier.fill":5945,"Graphics.Barrier.fill-clear":1606,"Graphics.Barrier.indirect-args":1072,"Graphics.Barrier.input-mirror":26,"Graphics.Barrier.label-run":283745,"Graphics.Barrier.present-blit":536,"Graphics.Barrier.shadow-publish":824,"Graphics.Barrier.staging-in":42563,"Graphics.Barrier.staging-out":20495,"Graphics.Barrier.storage-upload":356,"Graphics.Barrier.storage-writeback":9949,"Graphics.BarrierMerged.copy":61,"Graphics.BarrierMerged.dispatch-lead":17158,"Graphics.BarrierMerged.fill":2363,"Graphics.BarrierMerged.label-run":1726,"Graphics.BarrierMerged.shadow-publish":824,"Graphics.BarrierMerged.staging-in":18922,"Graphics.BarrierMerged.staging-out":20495,"Graphics.BarrierMerged.storage-writeback":2155,"Graphics.Copy":63203,"Graphics.Copy.bytes":20972889217,"Graphics.RenderPass":119209,"Graphics.RenderPass.Close.command":8454,"Graphics.RenderPass.Close.image":48587,"Graphics.RenderPass.Close.key":13950,"Graphics.RenderPass.Close.label":1726,"Graphics.RenderPass.Close.new-batch":46493,"Graphics.RenderPass.Continued":377611},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":18.966,"events_lost":153493,"totals_full":false},"draw committer":{"events_full_after_s":12.722,"events_lost":359190,"totals_full":false},"draw finisher":{"events_full_after_s":18.933,"events_lost":155514,"totals_full":false}},"trace":"aps5-trace-3bb93e740836-35972.json.gz"} ``` #### Series context & interleaved ablation This PR is part of a general AGC/libc performance series measured on Lies of P (`PPSA10621`, `v01.012.000`, `3200x1800`, UE4) covering #27249, #27250, #27251, #27252, #27253, #27254, #27268, #27269, #27270, #27271, and #27273 (tested together with #20130, #18757, #26778, #27117, and now-merged #26581 and #26681). Combined on base 61250ca018 (plus remaining unsplit stack changes), steady-state performance rose from `7.25 FPS` (`p50 135.6 ms`, `gpu 92.7 ms/f`, default settings) to `12.15 FPS` average (`12.00` / `12.30 FPS`, peak `12.33 FPS`, `p50 81.5 ms`, `gpu 57.12 ms/f`, `+67.6%` to `+70.1%`). Because five of the smaller PRs (#27253, #27254, #27270, #27271, and #27273) looked like they slightly lost average FPS (`-0.03` to `-0.31 FPS`) in single isolated runs on c032ba7c52, we ran an interleaved 4-run ablation (`A1 -> B1 -> A2 -> B2`, `APS5_TRACE_SECONDS=120:30`, identical warm shader cache and flags) on the full stack to test whether removing those 5 PRs helped or hurt: - **Arm A — Full stack on base 61250ca018 (WITH all 11 PRs):** #27249, #27250, #27251, #27252, #27253, #27254, #27268, #27269, #27270, #27271, #27273 + #20130, #18757, #26778, #27117, #26581, #26681 + remaining unsplit stack changes (per-64 KiB proof/pending tracking and ShapeRecipe). - **Arm B — Same stack on base 61250ca018 MINUS the 5 PRs (#27253, #27254, #27270, #27271, #27273):** keeps #27249, #27250, #27251, #27252, #27268, #27269 + #20130, #18757, #26778, #27117, #26581, #26681 + remaining unsplit stack changes. | Run | Build | FPS | p50 (ms) | p90 (ms) | max (ms) | GPU busy (ms/f) | `DrawWithRecipe` (ms/f) | `DrawFinish` (ms/f) | |---|---|---:|---:|---:|---:|---:|---:|---:| | **A1** | Arm A (base 61250ca018, WITH all 11 PRs incl. #27253, #27254, #27270, #27271, #27273) | **12.00** | **81.9** | **90.5** | **117.9** | **58.58** | **46.22** | **42.16** | | **B1** | Arm B (base 61250ca018, MINUS #27253, #27254, #27270, #27271, #27273) | 11.86 | 82.4 | 92.9 | 122.9 | 58.96 | 46.65 | 42.71 | | **A2** | Arm A (base 61250ca018, WITH all 11 PRs incl. #27253, #27254, #27270, #27271, #27273) | **12.30** | **81.0** | **87.3** | **108.8** | **55.66** | **45.71** | **42.24** | | **B2** | Arm B (base 61250ca018, MINUS #27253, #27254, #27270, #27271, #27273) | 11.65 | 84.7 | 94.1 | 124.8 | 61.69 | 47.32 | 43.45 | | **Arm A avg** | **Full stack (WITH all 11 PRs)** | **12.15** | **81.5** | **88.9** | **113.4** | **57.12** | **45.96** | **42.20** | | **Arm B avg** | **Minus #27253, #27254, #27270, #27271, #27273** | **11.76** | **83.5** | **93.5** | **123.9** | **60.33** | **46.98** | **43.08** | | **Effect of the 5 PRs (A vs B)** | — | **`+0.39 FPS` (`+3.3%`)** | **`-2.1 ms`** | **`-4.6 ms`** | **`-10.5 ms`** | **`-3.21 ms/f`** | **`-1.02 ms/f`** | **`-0.88 ms/f`** | Removing those 5 PRs hurt every run (`A1 > B1` and `A2 > B2` across all metrics), showing that their single-run isolated dips on c032ba7c52 were within `±0.25 FPS` scene variance while larger bottlenecks (#27268, #27249, #27252, #20130, #18757) still dominated. Individual PR captures above remain isolated against c032ba7c52. Not tested: Linux, NVIDIA/Intel GPUs, fresh Lies of P capture on follow-up 7861a468bd (captures above are from 3bb93e7408). ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [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) and the licence notice of code adapted from upstream (see AGENTS.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] Fixes: none - [x] Unblocks: none - [x] GPUs tested: AMD Radeon RX 6800 (vendor=0x1002, device=0x73bf), AMD proprietary driver 26.10.1 (Windows driver 32.0.21045.16010, Vulkan 1.4.315), Windows 11 Pro (build 26300); Khronos validation layer on `main` 0af6efad52 and this change, 0 VUIDs - [x] AI-assisted: yes
MarcZX10 commented 2026-11-25 18:03:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T18:03:04Z.

Review: APPROVED


Reviewed — looks good

Nothing blocks this change; the points below are optional.

What I ran

Reviewed head 3bb93e7408361844bbe4b4f947e600f70cb09b3a using the prepared diff and repo_read.py reader. No build or test commands were run. The author reports unit tests and conventions/debt checks passed; those results were not independently run here.

Results

Check Result Note
Diff and changed code passed One changed source file reviewed
Build and tests not run Author-reported results only
Performance captures not run Author-reported captures show mixed results

Findings

Blocking

None.

Non-blocking

  • The described larger recent-import cache and added lookup paths are present. Author-reported frame-time data is mixed: the candidate has slightly worse FPS and p50/p90 frame times, despite lower GPU time. Consider clarifying the intended performance benefit or providing a workload where the cache change improves measured performance.

Not verified

  • core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp was read through the pinned reader at relevant ranges; it was excluded from review/files/ because it was too large. The diff shows its changed lines. No other repository files were reviewed.
  • Build, tests, hardware behavior, and performance captures were not independently verified. Linux and NVIDIA/Intel GPU behavior were not tested per the description.

To get this to a good state

Nothing is required. The performance clarification above is optional.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6062552736 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/27270#pullrequestreview-6062552736). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-25T18:03:04Z. **Review:** APPROVED --- # Reviewed — looks good Nothing blocks this change; the points below are optional. ## What I ran Reviewed head `3bb93e7408361844bbe4b4f947e600f70cb09b3a` using the prepared diff and `repo_read.py` reader. No build or test commands were run. The author reports unit tests and conventions/debt checks passed; those results were not independently run here. ## Results | Check | Result | Note | |---|---|---| | Diff and changed code | passed | One changed source file reviewed | | Build and tests | not run | Author-reported results only | | Performance captures | not run | Author-reported captures show mixed results | ## Findings ### Blocking None. ### Non-blocking - The described larger recent-import cache and added lookup paths are present. Author-reported frame-time data is mixed: the candidate has slightly worse FPS and p50/p90 frame times, despite lower GPU time. Consider clarifying the intended performance benefit or providing a workload where the cache change improves measured performance. ## Not verified - `core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp` was read through the pinned reader at relevant ranges; it was excluded from `review/files/` because it was too large. The diff shows its changed lines. No other repository files were reviewed. - Build, tests, hardware behavior, and performance captures were not independently verified. Linux and NVIDIA/Intel GPU behavior were not tested per the description. ## To get this to a good state Nothing is required. The performance clarification above is optional.
MarcZX10 commented 2026-11-26 10:57:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-26T10:57:35Z.

Review: APPROVED


Reviewed — looks good

The cache changes appear internally consistent at head 7861a468bdc19c5652247e0188f947c346297469; one changed source file was read, while no checks were run and performance claims were not independently verified.

What I ran

No commands or tests were run. I read the prepared description, commit summary, manifest, diff, and the changed source ranges through the pinned reader.

Results

Check Result Note
Changed-code review passed Cache lookup and invalidation paths inspected
Tests and build not run Author reports tests; not independently run
Performance captures not run Author reports captures on earlier commits

Findings

Blocking

None.

Non-blocking

None.

Not verified

The complete GuestBufferMemory.cpp was not read; the inspected ranges covered all changed hunks and the cache helpers they use. No test or build was run. Author-reported focused tests, convention checks, debt checks, and performance measurements were not independently verified. The review-folder files.json was not available; the manifest and directory listing show one changed file, excluded from full-text inclusion due to size.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6072911514 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/27270#pullrequestreview-6072911514). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-26T10:57:35Z. **Review:** APPROVED --- # Reviewed — looks good The cache changes appear internally consistent at head `7861a468bdc19c5652247e0188f947c346297469`; one changed source file was read, while no checks were run and performance claims were not independently verified. ## What I ran No commands or tests were run. I read the prepared description, commit summary, manifest, diff, and the changed source ranges through the pinned reader. ## Results | Check | Result | Note | |---|---|---| | Changed-code review | passed | Cache lookup and invalidation paths inspected | | Tests and build | not run | Author reports tests; not independently run | | Performance captures | not run | Author reports captures on earlier commits | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified The complete `GuestBufferMemory.cpp` was not read; the inspected ranges covered all changed hunks and the cache helpers they use. No test or build was run. Author-reported focused tests, convention checks, debt checks, and performance measurements were not independently verified. The review-folder `files.json` was not available; the manifest and directory listing show one changed file, excluded from full-text inclusion due to size. ## To get this to a good state Nothing is required.
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!27270
No description provided.