perf(agc): remember rejected texture descriptors in image table resolution #21501

Merged
slopezjur merged 2 commits from upstream-pr/21501 into main 2026-11-19 09:13:01 +00:00
slopezjur commented 2026-11-16 09:02:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by slopezjur on 2026-11-16T09:02:37Z.


What

ShaderResources::resolveImageTables decodes the elements of an image table at up to three places: variantRepresentatives, arrayPartners and the per-element decode. DecodeTextureResource reports an invalid T# by throwing, so every invalid table element threw a C++ exception at each of those places, on every resolution of the table. variantRepresentatives also runs on the reuse path, so a reused table paid it too.

TryDecodeTextureResource returns the decoder's rejection instead of throwing and remembers rejected descriptors. The decode depends only on the 8 descriptor words and on whether guest shaders are PS4 (GCN) shaders, so the key is those words plus that flag.

  • The three table sites call TryDecodeTextureResource. The rejection message is the one DecodeTextureResource throws, so a rejected element is poisoned with the same text as before.
  • Only rejections are remembered; a valid T# is decoded every time.
  • The map holds at most RememberedTextureRejections (4096) descriptors and is cleared when it is full.
  • Other callers of DecodeTextureResource are unchanged. One of them is prepareSampled in resolveImageTables, which decodes the first-layer words of a 2D array read as 2D. It runs only after the per-element decode accepted the full T#, and the narrowed words differ only in the last-slice field, set to the base slice, so the 2D-array check baseArray <= depth still holds. The one check that still depends on the slice count is the mip-fit check when baseLevel > maxMip (LevelsFitAllocation); if it throws, it throws as on main.

New cases in agc_driver_graphics (tests/GuestTextureResource.cpp): the rejection message matches the throwing decoder, a repeated rejected T# returns the remembered rejection and is not stored twice, a valid T# is not remembered and decodes as before, the same words decoded as a PS4 T# do not reuse the RDNA rejection, and the map stays within its bound. The count after a new rejection is checked exactly (before + 1, or 1 when the full map was cleared).

Tested

Windows 11, WinLibs GCC 15.2.0 r7, Release, NVIDIA GeForce RTX 4080 SUPER (driver 621.24).

Tests matching ^(agc_|shader_) (1997) with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation and VK_LOADER_DEBUG=layer, on main dcdb92d584 and on this change based on it, same tree and GPU (Vulkan SDK 1.4.363.0 layer):

passed skipped failed not run layer inserted VUID- lines
main 1976 18 2 (agc_driver_stencil_plane_memory, agc_driver_store_over_untracked) 1 1801 0
this PR 1975 18 3 (agc_driver_stencil_plane_memory, agc_driver_color_memo_baseline_disabled, agc_driver_color_memo_baseline_verify) 1 1801 0

agc_driver_upload_cache_read_only_flush is not built on either side: its test source calls setenv, which this toolchain does not declare. agc_driver_stencil_plane_memory and agc_driver_store_over_untracked also fail on main. The target memo cases of agc_driver_target_memo_tests are not stable on main either. Run alone five times each with the same environment, agc_driver_color_memo_baseline_disabled failed 4 of 5 on main and 4 of 5 on this PR, agc_driver_color_memo_baseline_verify 5 of 5 on main and 4 of 5 on this PR, and agc_driver_target_memo_verify (which failed in another full run of this change) 5 of 5 on main. None of these tests reaches the texture descriptor decode.

Reported by domx4q on Linux: Arch Linux, GCC 16.2.1, Release, NVIDIA GeForce RTX 4090 (driver 620.70.06, Vulkan 1.4.357, layer 1.4.363.1), head a2fa6aa512 merged onto main f0c01bc69d, ctest -R 'color_memo|target_memo|stencil_plane_memory|store_over_untracked|upload_cache_read_only|^agc_driver_graphics$' -V with the same environment: 64 of 64 pass on main and on this PR, the layer inserted 64 times on each side, no VUID-. The tests that fail or do not build on the Windows toolchain above pass there on both sides.

Ghost of Yōtei

PPSA26344 v02.002.000, DRS 1080p patch, Digital Deluxe "Press X" screen from a fresh save, warm shader cache. Plain main crawls at under 0.1 fps in this scene, so every arm uses one build of main 53f1b9a500 merged with #20017, #20018, #20519 and #20735 (APS5_BINDLESS_IMAGES=1 APS5_BINDLESS_LAZY=1). Only libSceAgcDriver.prx differs between arms. Runs alternate between arms; 330 s each with APS5_PROFILE_DRAW=1 and APS5_TRACE_SECONDS=270:5; fps counted from the presents between 200 s and 320 s.

Set 1 (NVIDIA 621.14):

arm runs (fps) mean vs base
base 2.825, 2.782, 2.802, 2.850 2.815
this PR 2.922, 2.962, 2.936 2.940 +4.4 %

Set 2 (NVIDIA 621.24), with a third arm that put a lock-free bit filter in front of the map so a never-rejected descriptor would skip the shared lock and the map search:

arm runs (fps) mean vs base
base 2.906, 2.838, 2.815 2.853
this PR 2.930, 2.986 2.958 +3.7 %
this PR + filter 2.901, 2.948, 2.916, 2.896 2.915 +2.2 %

Every run with this PR is faster than every base run in both sets. The filter arm overlaps this PR (2.896-2.948 against 2.930-2.986), so the shared lock and map search per valid descriptor are not a measurable cost here, and the filter is not part of this PR. Per frame (set 2 digests below), Vulkan.Dispatch.shader_resources went from 50.1 to 39.0 ms, Resources.Complete from 37.8 to 28.1 ms and queue worker 0x30 busy from 102.5 to 82.9 ms. Left out: runs that stopped in the title's own load crash (access violation at 35-60 s, seen with and without this change: 3 of 10 runs in set 1, 4 of 18 in set 2, whose warm-up also ended at 227 s), and the first two rounds and the warm-up of set 2, where the NVIDIA pipeline cache was cold and 1M-word pipelines took 13-48 s each to create, pushing the load into the measured window. Not measured: other titles, other GPUs, Linux, macOS.

tools/trace_digest.py: base, set 2 run 5

seconds 270:5 from present 1391: 15 presents, frame p50 354.1 / p90 382.5 / p99 393.3 / max 393.3 ms, GPU busy 160.6 ms per present
NVIDIA GeForce RTX 4080 SUPER, NVIDIA 621.24, Windows 10.0.26300, 3840x2160, commit e5dcdd285cfd, dropped: no

Threads (ms per frame, title threads omitted)

thread busy wait untraced in slices < 20 us largest
queue worker 0x0 194.3 (55 %) 151.6 (43 %) 9.6 53.8 Driver.Packet 327.0, Driver.Completion 0.0
queue worker 0x52 6.0 (2 %) 330.9 (93 %) 18.6 0.8 Driver.Packet 76.3, Driver.EndSubmission 0.4
queue worker 0x53 1.0 (0 %) 335.7 (94 %) 18.8 0.2 Driver.Packet 70.0, Driver.EndSubmission 0.1
queue worker 0x20 100.0 (28 %) 243.7 (69 %) 11.8 8.1 Driver.Packet 186.3, Driver.EndSubmission 0.1
queue worker 0x30 102.5 (29 %) 248.5 (70 %) 4.5 1.9 Driver.Packet 284.2, Driver.EndSubmission 0.0
queue worker 0x38 72.8 (20 %) 273.8 (77 %) 8.8 4.3 Driver.Packet 232.2, Driver.EndSubmission 0.0
queue worker 0x48 4.4 (1 %) 327.7 (92 %) 23.4 0.8 Driver.Packet 9.2, Driver.EndSubmission 0.1
draw committer 67.2 (19 %) 10.7 (3 %) 277.6 5.3 Graphics.Draw 66.1, Vulkan.DrawFromRecipe 1.0
presenter 0.8 (0 %) 12.4 (3 %) 342.3 0.1 VideoOut.Flip 13.2
queue worker 0x51 10.2 (3 %) 328.0 (92 %) 17.3 0.3 Driver.Packet 14.4, Driver.EndSubmission 0.3
queue worker 0x50 22.2 (6 %) 333.0 (94 %) 0.2 1.4 Driver.Packet 266.0
gpu 161.1 (45 %) 0.0 (0 %) 194.4 0.0 batch 161.1, staging-in 0.0
tools/trace_digest.py: this PR, set 2 run 5

seconds 270:5 from present 1420: 15 presents, frame p50 340.3 / p90 348.4 / p99 351.2 / max 351.2 ms, GPU busy 170.9 ms per present
NVIDIA GeForce RTX 4080 SUPER, NVIDIA 621.24, Windows 10.0.26300, 3840x2160, commit d9eb0ba1ddc8, dropped: no

Threads (ms per frame, title threads omitted)

thread busy wait untraced in slices < 20 us largest
queue worker 0x0 198.1 (59 %) 130.8 (39 %) 9.0 49.2 Driver.Packet 312.2, Driver.Completion 0.0
queue worker 0x53 1.0 (0 %) 319.0 (94 %) 17.9 0.2 Driver.Packet 68.6, Driver.EndSubmission 0.1
queue worker 0x20 96.9 (29 %) 231.2 (68 %) 9.7 7.9 Driver.Packet 184.5, Driver.EndSubmission 0.1
queue worker 0x52 6.5 (2 %) 314.1 (93 %) 17.2 0.9 Driver.Packet 75.6, Driver.EndSubmission 0.6
queue worker 0x30 82.9 (25 %) 250.5 (74 %) 4.5 1.9 Driver.Packet 266.0, Driver.EndSubmission 0.0
queue worker 0x38 78.8 (23 %) 251.7 (75 %) 7.3 4.1 Driver.Packet 228.5, Driver.EndSubmission 0.1
queue worker 0x48 4.4 (1 %) 311.5 (92 %) 21.9 0.8 Driver.Packet 9.6, Driver.EndSubmission 0.1
draw committer 71.6 (21 %) 13.0 (4 %) 253.2 5.3 Graphics.Draw 70.1, Vulkan.DrawFromRecipe 1.3
presenter 0.7 (0 %) 10.7 (3 %) 326.4 0.1 VideoOut.Flip 11.4
queue worker 0x51 8.2 (2 %) 314.5 (93 %) 15.1 0.3 Driver.Packet 13.6, Driver.EndSubmission 0.2
queue worker 0x50 21.2 (6 %) 316.4 (94 %) 0.2 1.3 Driver.Packet 244.2, Resources.Prepare 0.0
gpu 161.1 (48 %) 0.0 (0 %) 176.8 0.0 batch 160.2, draw 0.8
aps5-summary.jsonl: base, set 2 run 5
{"commit":"e5dcdd285cfd","dirty":false,"env":{"APS5_BINDLESS_IMAGES":"1","APS5_BINDLESS_LAZY":"1","APS5_MIMALLOC":"1","APS5_NO_PIPELINE_JOURNAL":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_PROFILE_DRAW":"1","APS5_PROFILE_GPU":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"270:5","APS5_TRACE_SUMMARY_EVERY":"2"},"gpu":"NVIDIA GeForce RTX 4080 SUPER","driver":"NVIDIA 621.24","os":"Windows 10.0.26300","cpu":"AMD Ryzen 7 7800X3D 8-Core Processor","cpu_threads":16,"memory_mib":32405,"title_id":"PPSA26344","title":"Ghost of Yōtei","content_version":"02.002.000","resolution":"3840x2160","window":{"spec":"seconds 270:5","first_present":1391,"ms":5332.338},"presents":15,"frame_ms":{"p50":354.149,"p90":382.494,"p99":393.280,"max":393.280},"gpu_busy_ms_per_present":160.571,"worker_busy_pct":{"queue worker 0x0":94.370,"queue worker 0x52":21.601,"queue worker 0x53":19.731,"queue worker 0x20":52.583,"queue worker 0x30":80.040,"queue worker 0x38":65.521,"queue worker 0x48":2.623,"queue worker 0x51":4.151,"queue worker 0x50":74.899},"phase_totals_ms":{"Driver.Completion":0.330,"Driver.Dispatch":6510.971,"Driver.Dispatch.capture_resources":1627.667,"Driver.Dispatch.decode_key_device_setup":51.798,"Driver.Dispatch.lookup_cache":1200.580,"Driver.Dispatch.materialize":490.045,"Driver.Dispatch.prepared_invocation":18.331,"Driver.Draw":427.129,"Driver.Draw.device_setup":5.196,"Driver.Draw.draw_enqueued":69.105,"Driver.Draw.empty_indirect_skipped":0.321,"Driver.Draw.post_compile_prepare":2.350,"Driver.Draw.prepare":21.606,"Driver.Draw.shader_compile_and_link":326.629,"Driver.EndSubmission":15.369,"Driver.Packet":22140.928,"Driver.Packet.device_lock":4.629,"Driver.Packet.dispatch":8597.908,"Driver.Packet.draw":429.028,"Driver.Packet.execute":21.577,"Driver.Packet.flip_flush":0.535,"Driver.Packet.flush_between_packets":51.458,"Driver.Packet.memory_wait":12406.662,"Driver.Packet.pipeline_drain":132.910,"Driver.Packet.pipeline_prepare":7.416,"Driver.Packet.prepare_memory":468.837,"Driver.Packet.rendering_wait":0.024,"Driver.Present":196.323,"Driver.Present.acquire_image":0.251,"Driver.Present.bindless_wait":185.274,"Driver.Present.device_setup":0.009,"Driver.Present.gpu_mutex_wait":0.716,"Driver.Present.inflight_wait":0.031,"Driver.Present.present_display_buffer":2.709,"Driver.Present.queue_present":6.745,"Driver.Present.release_and_callback":0.014,"Driver.Present.render_fence_wait":0.493,"Driver.Present.resize":0.027,"Driver.Present.validate":0.004,"Driver.Suspend":0.167,"GpuMutex.wait.copy":0.771,"GpuMutex.wait.dispatch":1209.091,"GpuMutex.wait.draw":61.484,"GpuMutex.wait.end":8.856,"GpuMutex.wait.fill":14.533,"GpuMutex.wait.flush":54.645,"GpuMutex.wait.hook":907.924,"GpuMutex.wait.indirect":19.381,"GpuMutex.wait.label":55.027,"GpuMutex.wait.other":4.470,"GpuMutex.wait.present":0.691,"Graphics.Draw":1007.219,"Graphics.Draw.draw_and_resource_release":614.216,"Graphics.Draw.index_upload":231.433,"Graphics.Draw.validate":8.928,"Graphics.Draw.vertex_upload":103.563,"Graphics.DrawWithRecipe":15.802,"Graphics.DrawWithRecipe.draw_and_resource_release":14.658,"Graphics.DrawWithRecipe.index_upload":0.014,"Graphics.DrawWithRecipe.validate":0.155,"Graphics.DrawWithRecipe.vertex_upload":0.137,"Graphics.Submit":0.145,"Graphics.Submit.command_end":0.013,"Graphics.Submit.queue_submit":0.129,"Graphics.Wait":11.738,"Graphics.Wait.fence_wait":11.529,"Recorder.Reap":21.154,"Recorder.Submit":77.913,"Recorder.Sync":209.222,"Recorder.WaitSerial":178.092,"Resources.Complete":567.245,"Resources.Prepare":136.594,"Shader.DrawStage":213.551,"Shader.DrawStage.capture_resources":185.357,"Shader.DrawStage.materialize":20.016,"Shader.DrawStage.prepared_invocation":7.438,"Shader.ResolveAbi":15.028,"Shader.ResolveGraphicsAbi":7.733,"Shader.ResolveGraphicsStagesAbi":17.931,"VideoOut.Flip":198.425,"VideoOut.Flip.completion_mutex_wait":0.016,"VideoOut.Flip.config_mutex_wait":0.002,"VideoOut.Flip.frame_limit":0.006,"VideoOut.Flip.notify_game":0.053,"VideoOut.Flip.present":196.998,"VideoOut.Flip.validate":0.015,"VideoOut.Flip.vblank_wait":0.008,"VideoOut.Flip.window_prepare":0.018,"VideoOut.Flip.window_title":1.303,"VideoOut.Readiness":0.028,"VideoOut.Readiness.locks_validate":0.012,"Vulkan.Acquire":0.237,"Vulkan.Acquire.acquire_fence_wait":0.024,"Vulkan.Acquire.acquire_image":0.175,"Vulkan.Acquire.fence_reset":0.028,"Vulkan.Acquire.retired_swapchains":0.005,"Vulkan.BindlessPresentWait":185.250,"Vulkan.BindlessPresentWait.after_present_wait":31.981,"Vulkan.BindlessPresentWait.early_prepare":2.357,"Vulkan.BindlessPresentWait.finish_up_to":0.397,"Vulkan.BindlessPresentWait.gpu_mutex_wait":0.134,"Vulkan.BindlessPresentWait.present_serial":4.314,"Vulkan.BindlessPresentWait.wait_serial":125.710,"Vulkan.Dispatch":1534.731,"Vulkan.Dispatch.command_record":776.294,"Vulkan.Dispatch.shader_resources":752.056,"Vulkan.DispatchRecipe":75.989,"Vulkan.DispatchRecipe.command_record":75.517,"Vulkan.DrawFromRecipe":15.926,"Vulkan.Present":1.644,"Vulkan.Present.command_record_scale":0.439,"Vulkan.Present.pixel_upload":0.574,"Vulkan.Present.queue_submit":0.621,"Vulkan.QueuePresent":6.719,"Vulkan.QueuePresent.queue_present":6.700,"Vulkan.Retire":0.487,"Vulkan.Retire.wait":0.317},"top_phases_ms_per_frame":{"Driver.Packet":1476.062,"Driver.Packet.memory_wait":827.111,"Driver.Packet.dispatch":573.194,"Driver.Dispatch":434.065,"Driver.Dispatch.capture_resources":108.511,"Vulkan.Dispatch":102.315,"GpuMutex.wait.dispatch":80.606,"Driver.Dispatch.lookup_cache":80.039},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":981,"Graphics.Barrier.dcc-clear":390,"Graphics.Barrier.dcc-keys":300,"Graphics.Barrier.dispatch-lead":10595,"Graphics.Barrier.dispatch-trail":19209,"Graphics.Barrier.draw":5298,"Graphics.Barrier.fill":417,"Graphics.Barrier.fill-clear":390,"Graphics.Barrier.indirect-args":460,"Graphics.Barrier.input-mirror":171,"Graphics.Barrier.label-run":1892,"Graphics.Barrier.present-blit":30,"Graphics.Barrier.shadow-publish":595,"Graphics.Barrier.staging-in":19387,"Graphics.Barrier.staging-out":9396,"Graphics.Barrier.storage-upload":4845,"Graphics.Barrier.storage-writeback":11441,"Graphics.Barrier.template-refresh":30,"Graphics.BarrierMerged.copy":192,"Graphics.BarrierMerged.dispatch-lead":9534,"Graphics.BarrierMerged.fill":187,"Graphics.BarrierMerged.label-run":27,"Graphics.BarrierMerged.shadow-publish":305,"Graphics.BarrierMerged.staging-in":9001,"Graphics.BarrierMerged.staging-out":9396,"Graphics.BarrierMerged.storage-writeback":1235,"Graphics.Copy":39554,"Graphics.Copy.bytes":12352872720,"Graphics.RenderPass":1683,"Graphics.RenderPass.Close.command":1185,"Graphics.RenderPass.Close.image":89,"Graphics.RenderPass.Close.key":64,"Graphics.RenderPass.Close.label":27,"Graphics.RenderPass.Close.new-batch":318,"Graphics.RenderPass.Continued":1884},"trace_dropped":false,"trace":"aps5-trace-e5dcdd285cfd-13456.json.gz"}
aps5-summary.jsonl: this PR, set 2 run 5
{"commit":"d9eb0ba1ddc8","dirty":false,"env":{"APS5_BINDLESS_IMAGES":"1","APS5_BINDLESS_LAZY":"1","APS5_MIMALLOC":"1","APS5_NO_PIPELINE_JOURNAL":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_PROFILE_DRAW":"1","APS5_PROFILE_GPU":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"270:5","APS5_TRACE_SUMMARY_EVERY":"2"},"gpu":"NVIDIA GeForce RTX 4080 SUPER","driver":"NVIDIA 621.24","os":"Windows 10.0.26300","cpu":"AMD Ryzen 7 7800X3D 8-Core Processor","cpu_threads":16,"memory_mib":32405,"title_id":"PPSA26344","title":"Ghost of Yōtei","content_version":"02.002.000","resolution":"3840x2160","window":{"spec":"seconds 270:5","first_present":1420,"ms":5067.444},"presents":15,"frame_ms":{"p50":340.320,"p90":348.408,"p99":351.163,"max":351.163},"gpu_busy_ms_per_present":170.875,"worker_busy_pct":{"queue worker 0x0":94.698,"queue worker 0x53":20.357,"queue worker 0x20":54.813,"queue worker 0x52":22.586,"queue worker 0x30":78.846,"queue worker 0x38":67.868,"queue worker 0x48":2.899,"queue worker 0x51":4.087,"queue worker 0x50":72.352},"phase_totals_ms":{"Driver.Completion":0.271,"Driver.Dispatch":6190.496,"Driver.Dispatch.capture_resources":1596.089,"Driver.Dispatch.decode_key_device_setup":50.724,"Driver.Dispatch.lookup_cache":1314.444,"Driver.Dispatch.materialize":468.829,"Driver.Dispatch.prepared_invocation":16.196,"Driver.Draw":388.947,"Driver.Draw.device_setup":5.335,"Driver.Draw.draw_enqueued":66.235,"Driver.Draw.empty_indirect_skipped":0.337,"Driver.Draw.post_compile_prepare":2.303,"Driver.Draw.prepare":21.526,"Driver.Draw.shader_compile_and_link":291.304,"Driver.EndSubmission":16.645,"Driver.Packet":21190.636,"Driver.Packet.device_lock":4.519,"Driver.Packet.dispatch":8403.373,"Driver.Packet.draw":390.873,"Driver.Packet.execute":18.352,"Driver.Packet.flip_flush":0.793,"Driver.Packet.flush_between_packets":54.127,"Driver.Packet.memory_wait":11672.379,"Driver.Packet.pipeline_drain":155.592,"Driver.Packet.pipeline_prepare":7.009,"Driver.Packet.prepare_memory":466.983,"Driver.Packet.rendering_wait":0.017,"Driver.Present":168.826,"Driver.Present.acquire_image":0.170,"Driver.Present.bindless_wait":159.109,"Driver.Present.device_setup":0.010,"Driver.Present.gpu_mutex_wait":0.609,"Driver.Present.inflight_wait":0.032,"Driver.Present.present_display_buffer":2.359,"Driver.Present.queue_present":5.948,"Driver.Present.release_and_callback":0.012,"Driver.Present.render_fence_wait":0.536,"Driver.Present.resize":0.028,"Driver.Present.validate":0.004,"Driver.Suspend":0.004,"GpuMutex.wait.copy":1.312,"GpuMutex.wait.dispatch":1050.984,"GpuMutex.wait.draw":76.284,"GpuMutex.wait.end":10.058,"GpuMutex.wait.fill":18.487,"GpuMutex.wait.flush":40.890,"GpuMutex.wait.hook":1216.310,"GpuMutex.wait.indirect":15.627,"GpuMutex.wait.label":80.066,"GpuMutex.wait.other":5.143,"GpuMutex.wait.present":0.585,"Graphics.Draw":1068.246,"Graphics.Draw.draw_and_resource_release":644.564,"Graphics.Draw.index_upload":276.510,"Graphics.Draw.validate":8.813,"Graphics.Draw.vertex_upload":89.549,"Graphics.DrawWithRecipe":19.649,"Graphics.DrawWithRecipe.draw_and_resource_release":17.756,"Graphics.DrawWithRecipe.index_upload":0.017,"Graphics.DrawWithRecipe.validate":0.154,"Graphics.DrawWithRecipe.vertex_upload":0.907,"Graphics.Submit":0.154,"Graphics.Submit.command_end":0.021,"Graphics.Submit.queue_submit":0.131,"Graphics.Wait":11.994,"Graphics.Wait.fence_wait":11.792,"Recorder.Reap":21.534,"Recorder.Submit":77.722,"Recorder.Sync":203.726,"Recorder.WaitSerial":148.087,"Resources.Complete":421.320,"Resources.Prepare":132.771,"Shader.DrawStage":192.778,"Shader.DrawStage.capture_resources":164.770,"Shader.DrawStage.materialize":19.824,"Shader.DrawStage.prepared_invocation":7.436,"Shader.ResolveAbi":15.263,"Shader.ResolveGraphicsAbi":7.953,"Shader.ResolveGraphicsStagesAbi":17.844,"VideoOut.Flip":170.815,"VideoOut.Flip.completion_mutex_wait":0.012,"VideoOut.Flip.config_mutex_wait":0.002,"VideoOut.Flip.frame_limit":0.007,"VideoOut.Flip.notify_game":0.051,"VideoOut.Flip.present":169.588,"VideoOut.Flip.validate":0.016,"VideoOut.Flip.vblank_wait":0.009,"VideoOut.Flip.window_prepare":0.019,"VideoOut.Flip.window_title":1.106,"VideoOut.Readiness":0.028,"VideoOut.Readiness.locks_validate":0.013,"Vulkan.Acquire":0.157,"Vulkan.Acquire.acquire_fence_wait":0.022,"Vulkan.Acquire.acquire_image":0.098,"Vulkan.Acquire.fence_reset":0.027,"Vulkan.Acquire.retired_swapchains":0.006,"Vulkan.BindlessPresentWait":159.086,"Vulkan.BindlessPresentWait.after_present_wait":29.847,"Vulkan.BindlessPresentWait.early_prepare":2.235,"Vulkan.BindlessPresentWait.finish_up_to":0.325,"Vulkan.BindlessPresentWait.gpu_mutex_wait":0.399,"Vulkan.BindlessPresentWait.present_serial":4.594,"Vulkan.BindlessPresentWait.wait_serial":101.454,"Vulkan.Dispatch":1321.102,"Vulkan.Dispatch.command_record":730.186,"Vulkan.Dispatch.shader_resources":585.532,"Vulkan.DispatchRecipe":86.714,"Vulkan.DispatchRecipe.command_record":86.110,"Vulkan.DrawFromRecipe":19.799,"Vulkan.Present":1.304,"Vulkan.Present.command_record_scale":0.452,"Vulkan.Present.pixel_upload":0.376,"Vulkan.Present.queue_submit":0.467,"Vulkan.QueuePresent":5.930,"Vulkan.QueuePresent.queue_present":5.914,"Vulkan.Retire":0.531,"Vulkan.Retire.wait":0.357},"top_phases_ms_per_frame":{"Driver.Packet":1412.709,"Driver.Packet.memory_wait":778.159,"Driver.Packet.dispatch":560.225,"Driver.Dispatch":412.700,"Driver.Dispatch.capture_resources":106.406,"Vulkan.Dispatch":88.073,"Driver.Dispatch.lookup_cache":87.630,"GpuMutex.wait.hook":81.087},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":1005,"Graphics.Barrier.dcc-clear":390,"Graphics.Barrier.dcc-keys":300,"Graphics.Barrier.dispatch-lead":10082,"Graphics.Barrier.dispatch-trail":17512,"Graphics.Barrier.draw":5335,"Graphics.Barrier.fill":415,"Graphics.Barrier.fill-clear":390,"Graphics.Barrier.indirect-args":464,"Graphics.Barrier.input-mirror":167,"Graphics.Barrier.label-run":1908,"Graphics.Barrier.present-blit":30,"Graphics.Barrier.shadow-publish":599,"Graphics.Barrier.staging-in":17790,"Graphics.Barrier.staging-out":8570,"Graphics.Barrier.storage-upload":4851,"Graphics.Barrier.storage-writeback":11282,"Graphics.Barrier.template-refresh":25,"Graphics.BarrierMerged.copy":204,"Graphics.BarrierMerged.dispatch-lead":8358,"Graphics.BarrierMerged.fill":187,"Graphics.BarrierMerged.label-run":22,"Graphics.BarrierMerged.shadow-publish":305,"Graphics.BarrierMerged.staging-in":8170,"Graphics.BarrierMerged.staging-out":8570,"Graphics.BarrierMerged.storage-writeback":1222,"Graphics.Copy":36711,"Graphics.Copy.bytes":12330944192,"Graphics.RenderPass":1724,"Graphics.RenderPass.Close.command":1222,"Graphics.RenderPass.Close.image":84,"Graphics.RenderPass.Close.key":65,"Graphics.RenderPass.Close.label":22,"Graphics.RenderPass.Close.new-batch":331,"Graphics.RenderPass.Continued":1888},"trace_dropped":false,"trace":"aps5-trace-d9eb0ba1ddc8-3348.json.gz"}

aps5-trace-e5dcdd285cfd-13456.json.gz
aps5-trace-d9eb0ba1ddc8-3348.json.gz

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: PPSA26344 #675
  • GPUs tested: NVIDIA GeForce RTX 4080 SUPER, driver 621.24, Windows 11. Reported by a reviewer: NVIDIA GeForce RTX 4090, driver 620.70.06, Linux (domx4q)
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5334098318 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/21501). Originally posted by [slopezjur](https://github.com/slopezjur) on 2026-11-16T09:02:37Z. --- ### What `ShaderResources::resolveImageTables` decodes the elements of an image table at up to three places: `variantRepresentatives`, `arrayPartners` and the per-element decode. `DecodeTextureResource` reports an invalid T# by throwing, so every invalid table element threw a C++ exception at each of those places, on every resolution of the table. `variantRepresentatives` also runs on the reuse path, so a reused table paid it too. `TryDecodeTextureResource` returns the decoder's rejection instead of throwing and remembers rejected descriptors. The decode depends only on the 8 descriptor words and on whether guest shaders are PS4 (GCN) shaders, so the key is those words plus that flag. - The three table sites call `TryDecodeTextureResource`. The rejection message is the one `DecodeTextureResource` throws, so a rejected element is poisoned with the same text as before. - Only rejections are remembered; a valid T# is decoded every time. - The map holds at most `RememberedTextureRejections` (4096) descriptors and is cleared when it is full. - Other callers of `DecodeTextureResource` are unchanged. One of them is `prepareSampled` in `resolveImageTables`, which decodes the first-layer words of a 2D array read as 2D. It runs only after the per-element decode accepted the full T#, and the narrowed words differ only in the last-slice field, set to the base slice, so the 2D-array check `baseArray <= depth` still holds. The one check that still depends on the slice count is the mip-fit check when `baseLevel > maxMip` (`LevelsFitAllocation`); if it throws, it throws as on `main`. New cases in `agc_driver_graphics` (`tests/GuestTextureResource.cpp`): the rejection message matches the throwing decoder, a repeated rejected T# returns the remembered rejection and is not stored twice, a valid T# is not remembered and decodes as before, the same words decoded as a PS4 T# do not reuse the RDNA rejection, and the map stays within its bound. The count after a new rejection is checked exactly (`before + 1`, or 1 when the full map was cleared). ### Tested Windows 11, WinLibs GCC 15.2.0 r7, Release, NVIDIA GeForce RTX 4080 SUPER (driver 621.24). Tests matching `^(agc_|shader_)` (1997) with `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1`, `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation` and `VK_LOADER_DEBUG=layer`, on `main` dcdb92d584 and on this change based on it, same tree and GPU (Vulkan SDK 1.4.363.0 layer): | | passed | skipped | failed | not run | layer inserted | `VUID-` lines | |---|---|---|---|---|---|---| | `main` | 1976 | 18 | 2 (`agc_driver_stencil_plane_memory`, `agc_driver_store_over_untracked`) | 1 | 1801 | 0 | | this PR | 1975 | 18 | 3 (`agc_driver_stencil_plane_memory`, `agc_driver_color_memo_baseline_disabled`, `agc_driver_color_memo_baseline_verify`) | 1 | 1801 | 0 | `agc_driver_upload_cache_read_only_flush` is not built on either side: its test source calls `setenv`, which this toolchain does not declare. `agc_driver_stencil_plane_memory` and `agc_driver_store_over_untracked` also fail on `main`. The target memo cases of `agc_driver_target_memo_tests` are not stable on `main` either. Run alone five times each with the same environment, `agc_driver_color_memo_baseline_disabled` failed 4 of 5 on `main` and 4 of 5 on this PR, `agc_driver_color_memo_baseline_verify` 5 of 5 on `main` and 4 of 5 on this PR, and `agc_driver_target_memo_verify` (which failed in another full run of this change) 5 of 5 on `main`. None of these tests reaches the texture descriptor decode. Reported by domx4q on Linux: Arch Linux, GCC 16.2.1, Release, NVIDIA GeForce RTX 4090 (driver 620.70.06, Vulkan 1.4.357, layer 1.4.363.1), head `a2fa6aa512` merged onto `main` f0c01bc69d, `ctest -R 'color_memo|target_memo|stencil_plane_memory|store_over_untracked|upload_cache_read_only|^agc_driver_graphics$' -V` with the same environment: 64 of 64 pass on `main` and on this PR, the layer inserted 64 times on each side, no `VUID-`. The tests that fail or do not build on the Windows toolchain above pass there on both sides. #### Ghost of Yōtei PPSA26344 v02.002.000, DRS 1080p patch, Digital Deluxe "Press X" screen from a fresh save, warm shader cache. Plain `main` crawls at under 0.1 fps in this scene, so every arm uses one build of `main` 53f1b9a500 merged with #20017, #20018, #20519 and #20735 (`APS5_BINDLESS_IMAGES=1 APS5_BINDLESS_LAZY=1`). Only `libSceAgcDriver.prx` differs between arms. Runs alternate between arms; 330 s each with `APS5_PROFILE_DRAW=1` and `APS5_TRACE_SECONDS=270:5`; fps counted from the presents between 200 s and 320 s. Set 1 (NVIDIA 621.14): | arm | runs (fps) | mean | vs base | |---|---|---|---| | base | 2.825, 2.782, 2.802, 2.850 | 2.815 | | | this PR | 2.922, 2.962, 2.936 | 2.940 | +4.4 % | Set 2 (NVIDIA 621.24), with a third arm that put a lock-free bit filter in front of the map so a never-rejected descriptor would skip the shared lock and the map search: | arm | runs (fps) | mean | vs base | |---|---|---|---| | base | 2.906, 2.838, 2.815 | 2.853 | | | this PR | 2.930, 2.986 | 2.958 | +3.7 % | | this PR + filter | 2.901, 2.948, 2.916, 2.896 | 2.915 | +2.2 % | Every run with this PR is faster than every base run in both sets. The filter arm overlaps this PR (2.896-2.948 against 2.930-2.986), so the shared lock and map search per valid descriptor are not a measurable cost here, and the filter is not part of this PR. Per frame (set 2 digests below), `Vulkan.Dispatch.shader_resources` went from 50.1 to 39.0 ms, `Resources.Complete` from 37.8 to 28.1 ms and queue worker 0x30 busy from 102.5 to 82.9 ms. Left out: runs that stopped in the title's own load crash (access violation at 35-60 s, seen with and without this change: 3 of 10 runs in set 1, 4 of 18 in set 2, whose warm-up also ended at 227 s), and the first two rounds and the warm-up of set 2, where the NVIDIA pipeline cache was cold and 1M-word pipelines took 13-48 s each to create, pushing the load into the measured window. Not measured: other titles, other GPUs, Linux, macOS. <details> <summary><code>tools/trace_digest.py</code>: base, set 2 run 5</summary> **seconds 270:5** from present 1391: 15 presents, frame p50 354.1 / p90 382.5 / p99 393.3 / max 393.3 ms, GPU busy 160.6 ms per present NVIDIA GeForce RTX 4080 SUPER, NVIDIA 621.24, Windows 10.0.26300, 3840x2160, commit e5dcdd285cfd, dropped: no **Threads** (ms per frame, title threads omitted) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | queue worker 0x0 | 194.3 (55 %) | 151.6 (43 %) | 9.6 | 53.8 | Driver.Packet 327.0, Driver.Completion 0.0 | | queue worker 0x52 | 6.0 (2 %) | 330.9 (93 %) | 18.6 | 0.8 | Driver.Packet 76.3, Driver.EndSubmission 0.4 | | queue worker 0x53 | 1.0 (0 %) | 335.7 (94 %) | 18.8 | 0.2 | Driver.Packet 70.0, Driver.EndSubmission 0.1 | | queue worker 0x20 | 100.0 (28 %) | 243.7 (69 %) | 11.8 | 8.1 | Driver.Packet 186.3, Driver.EndSubmission 0.1 | | queue worker 0x30 | 102.5 (29 %) | 248.5 (70 %) | 4.5 | 1.9 | Driver.Packet 284.2, Driver.EndSubmission 0.0 | | queue worker 0x38 | 72.8 (20 %) | 273.8 (77 %) | 8.8 | 4.3 | Driver.Packet 232.2, Driver.EndSubmission 0.0 | | queue worker 0x48 | 4.4 (1 %) | 327.7 (92 %) | 23.4 | 0.8 | Driver.Packet 9.2, Driver.EndSubmission 0.1 | | draw committer | 67.2 (19 %) | 10.7 (3 %) | 277.6 | 5.3 | Graphics.Draw 66.1, Vulkan.DrawFromRecipe 1.0 | | presenter | 0.8 (0 %) | 12.4 (3 %) | 342.3 | 0.1 | VideoOut.Flip 13.2 | | queue worker 0x51 | 10.2 (3 %) | 328.0 (92 %) | 17.3 | 0.3 | Driver.Packet 14.4, Driver.EndSubmission 0.3 | | queue worker 0x50 | 22.2 (6 %) | 333.0 (94 %) | 0.2 | 1.4 | Driver.Packet 266.0 | | gpu | 161.1 (45 %) | 0.0 (0 %) | 194.4 | 0.0 | batch 161.1, staging-in 0.0 | </details> <details> <summary><code>tools/trace_digest.py</code>: this PR, set 2 run 5</summary> **seconds 270:5** from present 1420: 15 presents, frame p50 340.3 / p90 348.4 / p99 351.2 / max 351.2 ms, GPU busy 170.9 ms per present NVIDIA GeForce RTX 4080 SUPER, NVIDIA 621.24, Windows 10.0.26300, 3840x2160, commit d9eb0ba1ddc8, dropped: no **Threads** (ms per frame, title threads omitted) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | queue worker 0x0 | 198.1 (59 %) | 130.8 (39 %) | 9.0 | 49.2 | Driver.Packet 312.2, Driver.Completion 0.0 | | queue worker 0x53 | 1.0 (0 %) | 319.0 (94 %) | 17.9 | 0.2 | Driver.Packet 68.6, Driver.EndSubmission 0.1 | | queue worker 0x20 | 96.9 (29 %) | 231.2 (68 %) | 9.7 | 7.9 | Driver.Packet 184.5, Driver.EndSubmission 0.1 | | queue worker 0x52 | 6.5 (2 %) | 314.1 (93 %) | 17.2 | 0.9 | Driver.Packet 75.6, Driver.EndSubmission 0.6 | | queue worker 0x30 | 82.9 (25 %) | 250.5 (74 %) | 4.5 | 1.9 | Driver.Packet 266.0, Driver.EndSubmission 0.0 | | queue worker 0x38 | 78.8 (23 %) | 251.7 (75 %) | 7.3 | 4.1 | Driver.Packet 228.5, Driver.EndSubmission 0.1 | | queue worker 0x48 | 4.4 (1 %) | 311.5 (92 %) | 21.9 | 0.8 | Driver.Packet 9.6, Driver.EndSubmission 0.1 | | draw committer | 71.6 (21 %) | 13.0 (4 %) | 253.2 | 5.3 | Graphics.Draw 70.1, Vulkan.DrawFromRecipe 1.3 | | presenter | 0.7 (0 %) | 10.7 (3 %) | 326.4 | 0.1 | VideoOut.Flip 11.4 | | queue worker 0x51 | 8.2 (2 %) | 314.5 (93 %) | 15.1 | 0.3 | Driver.Packet 13.6, Driver.EndSubmission 0.2 | | queue worker 0x50 | 21.2 (6 %) | 316.4 (94 %) | 0.2 | 1.3 | Driver.Packet 244.2, Resources.Prepare 0.0 | | gpu | 161.1 (48 %) | 0.0 (0 %) | 176.8 | 0.0 | batch 160.2, draw 0.8 | </details> <details> <summary><code>aps5-summary.jsonl</code>: base, set 2 run 5</summary> ```json {"commit":"e5dcdd285cfd","dirty":false,"env":{"APS5_BINDLESS_IMAGES":"1","APS5_BINDLESS_LAZY":"1","APS5_MIMALLOC":"1","APS5_NO_PIPELINE_JOURNAL":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_PROFILE_DRAW":"1","APS5_PROFILE_GPU":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"270:5","APS5_TRACE_SUMMARY_EVERY":"2"},"gpu":"NVIDIA GeForce RTX 4080 SUPER","driver":"NVIDIA 621.24","os":"Windows 10.0.26300","cpu":"AMD Ryzen 7 7800X3D 8-Core Processor","cpu_threads":16,"memory_mib":32405,"title_id":"PPSA26344","title":"Ghost of Yōtei","content_version":"02.002.000","resolution":"3840x2160","window":{"spec":"seconds 270:5","first_present":1391,"ms":5332.338},"presents":15,"frame_ms":{"p50":354.149,"p90":382.494,"p99":393.280,"max":393.280},"gpu_busy_ms_per_present":160.571,"worker_busy_pct":{"queue worker 0x0":94.370,"queue worker 0x52":21.601,"queue worker 0x53":19.731,"queue worker 0x20":52.583,"queue worker 0x30":80.040,"queue worker 0x38":65.521,"queue worker 0x48":2.623,"queue worker 0x51":4.151,"queue worker 0x50":74.899},"phase_totals_ms":{"Driver.Completion":0.330,"Driver.Dispatch":6510.971,"Driver.Dispatch.capture_resources":1627.667,"Driver.Dispatch.decode_key_device_setup":51.798,"Driver.Dispatch.lookup_cache":1200.580,"Driver.Dispatch.materialize":490.045,"Driver.Dispatch.prepared_invocation":18.331,"Driver.Draw":427.129,"Driver.Draw.device_setup":5.196,"Driver.Draw.draw_enqueued":69.105,"Driver.Draw.empty_indirect_skipped":0.321,"Driver.Draw.post_compile_prepare":2.350,"Driver.Draw.prepare":21.606,"Driver.Draw.shader_compile_and_link":326.629,"Driver.EndSubmission":15.369,"Driver.Packet":22140.928,"Driver.Packet.device_lock":4.629,"Driver.Packet.dispatch":8597.908,"Driver.Packet.draw":429.028,"Driver.Packet.execute":21.577,"Driver.Packet.flip_flush":0.535,"Driver.Packet.flush_between_packets":51.458,"Driver.Packet.memory_wait":12406.662,"Driver.Packet.pipeline_drain":132.910,"Driver.Packet.pipeline_prepare":7.416,"Driver.Packet.prepare_memory":468.837,"Driver.Packet.rendering_wait":0.024,"Driver.Present":196.323,"Driver.Present.acquire_image":0.251,"Driver.Present.bindless_wait":185.274,"Driver.Present.device_setup":0.009,"Driver.Present.gpu_mutex_wait":0.716,"Driver.Present.inflight_wait":0.031,"Driver.Present.present_display_buffer":2.709,"Driver.Present.queue_present":6.745,"Driver.Present.release_and_callback":0.014,"Driver.Present.render_fence_wait":0.493,"Driver.Present.resize":0.027,"Driver.Present.validate":0.004,"Driver.Suspend":0.167,"GpuMutex.wait.copy":0.771,"GpuMutex.wait.dispatch":1209.091,"GpuMutex.wait.draw":61.484,"GpuMutex.wait.end":8.856,"GpuMutex.wait.fill":14.533,"GpuMutex.wait.flush":54.645,"GpuMutex.wait.hook":907.924,"GpuMutex.wait.indirect":19.381,"GpuMutex.wait.label":55.027,"GpuMutex.wait.other":4.470,"GpuMutex.wait.present":0.691,"Graphics.Draw":1007.219,"Graphics.Draw.draw_and_resource_release":614.216,"Graphics.Draw.index_upload":231.433,"Graphics.Draw.validate":8.928,"Graphics.Draw.vertex_upload":103.563,"Graphics.DrawWithRecipe":15.802,"Graphics.DrawWithRecipe.draw_and_resource_release":14.658,"Graphics.DrawWithRecipe.index_upload":0.014,"Graphics.DrawWithRecipe.validate":0.155,"Graphics.DrawWithRecipe.vertex_upload":0.137,"Graphics.Submit":0.145,"Graphics.Submit.command_end":0.013,"Graphics.Submit.queue_submit":0.129,"Graphics.Wait":11.738,"Graphics.Wait.fence_wait":11.529,"Recorder.Reap":21.154,"Recorder.Submit":77.913,"Recorder.Sync":209.222,"Recorder.WaitSerial":178.092,"Resources.Complete":567.245,"Resources.Prepare":136.594,"Shader.DrawStage":213.551,"Shader.DrawStage.capture_resources":185.357,"Shader.DrawStage.materialize":20.016,"Shader.DrawStage.prepared_invocation":7.438,"Shader.ResolveAbi":15.028,"Shader.ResolveGraphicsAbi":7.733,"Shader.ResolveGraphicsStagesAbi":17.931,"VideoOut.Flip":198.425,"VideoOut.Flip.completion_mutex_wait":0.016,"VideoOut.Flip.config_mutex_wait":0.002,"VideoOut.Flip.frame_limit":0.006,"VideoOut.Flip.notify_game":0.053,"VideoOut.Flip.present":196.998,"VideoOut.Flip.validate":0.015,"VideoOut.Flip.vblank_wait":0.008,"VideoOut.Flip.window_prepare":0.018,"VideoOut.Flip.window_title":1.303,"VideoOut.Readiness":0.028,"VideoOut.Readiness.locks_validate":0.012,"Vulkan.Acquire":0.237,"Vulkan.Acquire.acquire_fence_wait":0.024,"Vulkan.Acquire.acquire_image":0.175,"Vulkan.Acquire.fence_reset":0.028,"Vulkan.Acquire.retired_swapchains":0.005,"Vulkan.BindlessPresentWait":185.250,"Vulkan.BindlessPresentWait.after_present_wait":31.981,"Vulkan.BindlessPresentWait.early_prepare":2.357,"Vulkan.BindlessPresentWait.finish_up_to":0.397,"Vulkan.BindlessPresentWait.gpu_mutex_wait":0.134,"Vulkan.BindlessPresentWait.present_serial":4.314,"Vulkan.BindlessPresentWait.wait_serial":125.710,"Vulkan.Dispatch":1534.731,"Vulkan.Dispatch.command_record":776.294,"Vulkan.Dispatch.shader_resources":752.056,"Vulkan.DispatchRecipe":75.989,"Vulkan.DispatchRecipe.command_record":75.517,"Vulkan.DrawFromRecipe":15.926,"Vulkan.Present":1.644,"Vulkan.Present.command_record_scale":0.439,"Vulkan.Present.pixel_upload":0.574,"Vulkan.Present.queue_submit":0.621,"Vulkan.QueuePresent":6.719,"Vulkan.QueuePresent.queue_present":6.700,"Vulkan.Retire":0.487,"Vulkan.Retire.wait":0.317},"top_phases_ms_per_frame":{"Driver.Packet":1476.062,"Driver.Packet.memory_wait":827.111,"Driver.Packet.dispatch":573.194,"Driver.Dispatch":434.065,"Driver.Dispatch.capture_resources":108.511,"Vulkan.Dispatch":102.315,"GpuMutex.wait.dispatch":80.606,"Driver.Dispatch.lookup_cache":80.039},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":981,"Graphics.Barrier.dcc-clear":390,"Graphics.Barrier.dcc-keys":300,"Graphics.Barrier.dispatch-lead":10595,"Graphics.Barrier.dispatch-trail":19209,"Graphics.Barrier.draw":5298,"Graphics.Barrier.fill":417,"Graphics.Barrier.fill-clear":390,"Graphics.Barrier.indirect-args":460,"Graphics.Barrier.input-mirror":171,"Graphics.Barrier.label-run":1892,"Graphics.Barrier.present-blit":30,"Graphics.Barrier.shadow-publish":595,"Graphics.Barrier.staging-in":19387,"Graphics.Barrier.staging-out":9396,"Graphics.Barrier.storage-upload":4845,"Graphics.Barrier.storage-writeback":11441,"Graphics.Barrier.template-refresh":30,"Graphics.BarrierMerged.copy":192,"Graphics.BarrierMerged.dispatch-lead":9534,"Graphics.BarrierMerged.fill":187,"Graphics.BarrierMerged.label-run":27,"Graphics.BarrierMerged.shadow-publish":305,"Graphics.BarrierMerged.staging-in":9001,"Graphics.BarrierMerged.staging-out":9396,"Graphics.BarrierMerged.storage-writeback":1235,"Graphics.Copy":39554,"Graphics.Copy.bytes":12352872720,"Graphics.RenderPass":1683,"Graphics.RenderPass.Close.command":1185,"Graphics.RenderPass.Close.image":89,"Graphics.RenderPass.Close.key":64,"Graphics.RenderPass.Close.label":27,"Graphics.RenderPass.Close.new-batch":318,"Graphics.RenderPass.Continued":1884},"trace_dropped":false,"trace":"aps5-trace-e5dcdd285cfd-13456.json.gz"} ``` </details> <details> <summary><code>aps5-summary.jsonl</code>: this PR, set 2 run 5</summary> ```json {"commit":"d9eb0ba1ddc8","dirty":false,"env":{"APS5_BINDLESS_IMAGES":"1","APS5_BINDLESS_LAZY":"1","APS5_MIMALLOC":"1","APS5_NO_PIPELINE_JOURNAL":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_PROFILE_DRAW":"1","APS5_PROFILE_GPU":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"270:5","APS5_TRACE_SUMMARY_EVERY":"2"},"gpu":"NVIDIA GeForce RTX 4080 SUPER","driver":"NVIDIA 621.24","os":"Windows 10.0.26300","cpu":"AMD Ryzen 7 7800X3D 8-Core Processor","cpu_threads":16,"memory_mib":32405,"title_id":"PPSA26344","title":"Ghost of Yōtei","content_version":"02.002.000","resolution":"3840x2160","window":{"spec":"seconds 270:5","first_present":1420,"ms":5067.444},"presents":15,"frame_ms":{"p50":340.320,"p90":348.408,"p99":351.163,"max":351.163},"gpu_busy_ms_per_present":170.875,"worker_busy_pct":{"queue worker 0x0":94.698,"queue worker 0x53":20.357,"queue worker 0x20":54.813,"queue worker 0x52":22.586,"queue worker 0x30":78.846,"queue worker 0x38":67.868,"queue worker 0x48":2.899,"queue worker 0x51":4.087,"queue worker 0x50":72.352},"phase_totals_ms":{"Driver.Completion":0.271,"Driver.Dispatch":6190.496,"Driver.Dispatch.capture_resources":1596.089,"Driver.Dispatch.decode_key_device_setup":50.724,"Driver.Dispatch.lookup_cache":1314.444,"Driver.Dispatch.materialize":468.829,"Driver.Dispatch.prepared_invocation":16.196,"Driver.Draw":388.947,"Driver.Draw.device_setup":5.335,"Driver.Draw.draw_enqueued":66.235,"Driver.Draw.empty_indirect_skipped":0.337,"Driver.Draw.post_compile_prepare":2.303,"Driver.Draw.prepare":21.526,"Driver.Draw.shader_compile_and_link":291.304,"Driver.EndSubmission":16.645,"Driver.Packet":21190.636,"Driver.Packet.device_lock":4.519,"Driver.Packet.dispatch":8403.373,"Driver.Packet.draw":390.873,"Driver.Packet.execute":18.352,"Driver.Packet.flip_flush":0.793,"Driver.Packet.flush_between_packets":54.127,"Driver.Packet.memory_wait":11672.379,"Driver.Packet.pipeline_drain":155.592,"Driver.Packet.pipeline_prepare":7.009,"Driver.Packet.prepare_memory":466.983,"Driver.Packet.rendering_wait":0.017,"Driver.Present":168.826,"Driver.Present.acquire_image":0.170,"Driver.Present.bindless_wait":159.109,"Driver.Present.device_setup":0.010,"Driver.Present.gpu_mutex_wait":0.609,"Driver.Present.inflight_wait":0.032,"Driver.Present.present_display_buffer":2.359,"Driver.Present.queue_present":5.948,"Driver.Present.release_and_callback":0.012,"Driver.Present.render_fence_wait":0.536,"Driver.Present.resize":0.028,"Driver.Present.validate":0.004,"Driver.Suspend":0.004,"GpuMutex.wait.copy":1.312,"GpuMutex.wait.dispatch":1050.984,"GpuMutex.wait.draw":76.284,"GpuMutex.wait.end":10.058,"GpuMutex.wait.fill":18.487,"GpuMutex.wait.flush":40.890,"GpuMutex.wait.hook":1216.310,"GpuMutex.wait.indirect":15.627,"GpuMutex.wait.label":80.066,"GpuMutex.wait.other":5.143,"GpuMutex.wait.present":0.585,"Graphics.Draw":1068.246,"Graphics.Draw.draw_and_resource_release":644.564,"Graphics.Draw.index_upload":276.510,"Graphics.Draw.validate":8.813,"Graphics.Draw.vertex_upload":89.549,"Graphics.DrawWithRecipe":19.649,"Graphics.DrawWithRecipe.draw_and_resource_release":17.756,"Graphics.DrawWithRecipe.index_upload":0.017,"Graphics.DrawWithRecipe.validate":0.154,"Graphics.DrawWithRecipe.vertex_upload":0.907,"Graphics.Submit":0.154,"Graphics.Submit.command_end":0.021,"Graphics.Submit.queue_submit":0.131,"Graphics.Wait":11.994,"Graphics.Wait.fence_wait":11.792,"Recorder.Reap":21.534,"Recorder.Submit":77.722,"Recorder.Sync":203.726,"Recorder.WaitSerial":148.087,"Resources.Complete":421.320,"Resources.Prepare":132.771,"Shader.DrawStage":192.778,"Shader.DrawStage.capture_resources":164.770,"Shader.DrawStage.materialize":19.824,"Shader.DrawStage.prepared_invocation":7.436,"Shader.ResolveAbi":15.263,"Shader.ResolveGraphicsAbi":7.953,"Shader.ResolveGraphicsStagesAbi":17.844,"VideoOut.Flip":170.815,"VideoOut.Flip.completion_mutex_wait":0.012,"VideoOut.Flip.config_mutex_wait":0.002,"VideoOut.Flip.frame_limit":0.007,"VideoOut.Flip.notify_game":0.051,"VideoOut.Flip.present":169.588,"VideoOut.Flip.validate":0.016,"VideoOut.Flip.vblank_wait":0.009,"VideoOut.Flip.window_prepare":0.019,"VideoOut.Flip.window_title":1.106,"VideoOut.Readiness":0.028,"VideoOut.Readiness.locks_validate":0.013,"Vulkan.Acquire":0.157,"Vulkan.Acquire.acquire_fence_wait":0.022,"Vulkan.Acquire.acquire_image":0.098,"Vulkan.Acquire.fence_reset":0.027,"Vulkan.Acquire.retired_swapchains":0.006,"Vulkan.BindlessPresentWait":159.086,"Vulkan.BindlessPresentWait.after_present_wait":29.847,"Vulkan.BindlessPresentWait.early_prepare":2.235,"Vulkan.BindlessPresentWait.finish_up_to":0.325,"Vulkan.BindlessPresentWait.gpu_mutex_wait":0.399,"Vulkan.BindlessPresentWait.present_serial":4.594,"Vulkan.BindlessPresentWait.wait_serial":101.454,"Vulkan.Dispatch":1321.102,"Vulkan.Dispatch.command_record":730.186,"Vulkan.Dispatch.shader_resources":585.532,"Vulkan.DispatchRecipe":86.714,"Vulkan.DispatchRecipe.command_record":86.110,"Vulkan.DrawFromRecipe":19.799,"Vulkan.Present":1.304,"Vulkan.Present.command_record_scale":0.452,"Vulkan.Present.pixel_upload":0.376,"Vulkan.Present.queue_submit":0.467,"Vulkan.QueuePresent":5.930,"Vulkan.QueuePresent.queue_present":5.914,"Vulkan.Retire":0.531,"Vulkan.Retire.wait":0.357},"top_phases_ms_per_frame":{"Driver.Packet":1412.709,"Driver.Packet.memory_wait":778.159,"Driver.Packet.dispatch":560.225,"Driver.Dispatch":412.700,"Driver.Dispatch.capture_resources":106.406,"Vulkan.Dispatch":88.073,"Driver.Dispatch.lookup_cache":87.630,"GpuMutex.wait.hook":81.087},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":1005,"Graphics.Barrier.dcc-clear":390,"Graphics.Barrier.dcc-keys":300,"Graphics.Barrier.dispatch-lead":10082,"Graphics.Barrier.dispatch-trail":17512,"Graphics.Barrier.draw":5335,"Graphics.Barrier.fill":415,"Graphics.Barrier.fill-clear":390,"Graphics.Barrier.indirect-args":464,"Graphics.Barrier.input-mirror":167,"Graphics.Barrier.label-run":1908,"Graphics.Barrier.present-blit":30,"Graphics.Barrier.shadow-publish":599,"Graphics.Barrier.staging-in":17790,"Graphics.Barrier.staging-out":8570,"Graphics.Barrier.storage-upload":4851,"Graphics.Barrier.storage-writeback":11282,"Graphics.Barrier.template-refresh":25,"Graphics.BarrierMerged.copy":204,"Graphics.BarrierMerged.dispatch-lead":8358,"Graphics.BarrierMerged.fill":187,"Graphics.BarrierMerged.label-run":22,"Graphics.BarrierMerged.shadow-publish":305,"Graphics.BarrierMerged.staging-in":8170,"Graphics.BarrierMerged.staging-out":8570,"Graphics.BarrierMerged.storage-writeback":1222,"Graphics.Copy":36711,"Graphics.Copy.bytes":12330944192,"Graphics.RenderPass":1724,"Graphics.RenderPass.Close.command":1222,"Graphics.RenderPass.Close.image":84,"Graphics.RenderPass.Close.key":65,"Graphics.RenderPass.Close.label":22,"Graphics.RenderPass.Close.new-batch":331,"Graphics.RenderPass.Continued":1888},"trace_dropped":false,"trace":"aps5-trace-d9eb0ba1ddc8-3348.json.gz"} ``` </details> [aps5-trace-e5dcdd285cfd-13456.json.gz](https://github.com/user-attachments/files/34967700/aps5-trace-e5dcdd285cfd-13456.json.gz) [aps5-trace-d9eb0ba1ddc8-3348.json.gz](https://github.com/user-attachments/files/34967712/aps5-trace-d9eb0ba1ddc8-3348.json.gz) ### 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: PPSA26344 #675 - [x] GPUs tested: NVIDIA GeForce RTX 4080 SUPER, driver 621.24, Windows 11. Reported by a reviewer: NVIDIA GeForce RTX 4090, driver 620.70.06, Linux (domx4q) - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
MarcZX10 commented 2026-11-17 02:58:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-17T02:58:02Z.

Review: COMMENTED


Reviewed — no blocking findings

Nothing blocks this; the points below are optional.

What I ran

  • Head 7755bf22a5013a5e486a1224c75c0eaf675277ff, base main. No build and no tests in this pass.
  • Read the title, commit list, manifest, files.json and the full diff.patch.
  • Read the house sections "Readable reviews", "Standard PR response format" and "Accuracy and evidence" from the ruling file.
  • Repository reads at the head, with the reader:
python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/GuestTextureResource.cpp 140 200
python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/GuestTextureResource.cpp 200 380
python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp 6410 6500
python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp 6618 6640
python3 repo_read.py search DecodeTextureResource core/libs/prx/libSceAgcDriver
python3 repo_read.py search GcnGuestShaders core/libs/prx/libSceAgcDriver
python3 repo_read.py search DecodedEntry core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
python3 repo_read.py search getenv core/libs/prx/libSceAgcDriver/Graphics/src/GuestTextureResource.cpp
python3 repo_read.py search base40 core/libs/prx/libSceAgcDriver/tests/GuestTextureResource.cpp
  • Files: all four in files.json under reviewed were covered. GuestTextureResource.hpp and tests/GuestTextureResource.cpp were read from the diff, plus the search above. GuestTextureResource.cpp was read from the diff and head lines 140–380. ShaderResources.cpp is partial (see Not verified). No file was excluded.

Results

Check Result Note
Build not run No-build review pass
Author's test run not run Author reports 1902 passed on Windows only; not reproduced
Decode inputs passed Depends only on the 8 words and the PS4 flag
Rejection callers passed The three table sites keep their previous outcome
Test assertions passed Read; one loose assertion below

Findings

Blocking

None.

Non-blocking

  1. core/libs/prx/libSceAgcDriver/tests/GuestTextureResource.cpp:116: remembered == before + 1u || remembered == 1u accepts a count of 1 whatever before was. The 1u branch is the full-map clear case, so the check is correct but loose. An exact form would be remembered == (before == RememberedTextureRejections ? 1u : before + 1u).
  2. core/libs/prx/libSceAgcDriver/Graphics/src/GuestTextureResource.cpp:412: every valid 8-word descriptor now takes a shared lock and a std::map lookup before it decodes (lines 412–413). The PR's timings cover this together with the saved throws and do not isolate it.

Not verified

  • Build and tests: not run here. The Windows run (GCC 15.2, Release, RTX 4080 SUPER) is author-reported. No Linux, macOS or MSVC evidence is given.
  • Performance: the +4.4 % fps figure and the throw cost (about 3 % of one thread) are author-reported. I did not reproduce them.
  • core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp is too large for the review folder. I read the changed hunks (new lines 6277–6280, 6337–6340, 6428–6433) and the image-table consumers (6410–6500, 6618–6640). The rest of the file was not read. This is why the verdict is a comment and not an approval.
  • Hosted CI status for this head was not checked.

Sources

To get this to a good state

Nothing is required.

The optional points are the two non-blocking items above. No command needs to be rerun on a new head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5932033915 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/21501#pullrequestreview-5932033915). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-17T02:58:02Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing blocks this; the points below are optional. **What I ran** - Head `7755bf22a5013a5e486a1224c75c0eaf675277ff`, base `main`. No build and no tests in this pass. - Read the title, commit list, manifest, `files.json` and the full `diff.patch`. - Read the house sections "Readable reviews", "Standard PR response format" and "Accuracy and evidence" from the ruling file. - Repository reads at the head, with the reader: ```sh python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/GuestTextureResource.cpp 140 200 python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/GuestTextureResource.cpp 200 380 python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp 6410 6500 python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp 6618 6640 python3 repo_read.py search DecodeTextureResource core/libs/prx/libSceAgcDriver python3 repo_read.py search GcnGuestShaders core/libs/prx/libSceAgcDriver python3 repo_read.py search DecodedEntry core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp python3 repo_read.py search getenv core/libs/prx/libSceAgcDriver/Graphics/src/GuestTextureResource.cpp python3 repo_read.py search base40 core/libs/prx/libSceAgcDriver/tests/GuestTextureResource.cpp ``` - Files: all four in `files.json` under `reviewed` were covered. `GuestTextureResource.hpp` and `tests/GuestTextureResource.cpp` were read from the diff, plus the search above. `GuestTextureResource.cpp` was read from the diff and head lines 140–380. `ShaderResources.cpp` is partial (see Not verified). No file was excluded. **Results** | Check | Result | Note | |---|---|---| | Build | not run | No-build review pass | | Author's test run | not run | Author reports 1902 passed on Windows only; not reproduced | | Decode inputs | passed | Depends only on the 8 words and the PS4 flag | | Rejection callers | passed | The three table sites keep their previous outcome | | Test assertions | passed | Read; one loose assertion below | **Findings** **Blocking** None. **Non-blocking** 1. `core/libs/prx/libSceAgcDriver/tests/GuestTextureResource.cpp:116`: `remembered == before + 1u || remembered == 1u` accepts a count of 1 whatever `before` was. The `1u` branch is the full-map clear case, so the check is correct but loose. An exact form would be `remembered == (before == RememberedTextureRejections ? 1u : before + 1u)`. 2. `core/libs/prx/libSceAgcDriver/Graphics/src/GuestTextureResource.cpp:412`: every valid 8-word descriptor now takes a shared lock and a `std::map` lookup before it decodes (lines 412–413). The PR's timings cover this together with the saved throws and do not isolate it. **Not verified** - Build and tests: not run here. The Windows run (GCC 15.2, Release, RTX 4080 SUPER) is author-reported. No Linux, macOS or MSVC evidence is given. - Performance: the +4.4 % fps figure and the throw cost (about 3 % of one thread) are author-reported. I did not reproduce them. - `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` is too large for the review folder. I read the changed hunks (new lines 6277–6280, 6337–6340, 6428–6433) and the image-table consumers (6410–6500, 6618–6640). The rest of the file was not read. This is why the verdict is a comment and not an approval. - Hosted CI status for this head was not checked. **Sources** - Rejection cache and decode entry point: https://github.com/boykopovar/AnyPS5/blob/7755bf22a5013a5e486a1224c75c0eaf675277ff/core/libs/prx/libSceAgcDriver/Graphics/src/GuestTextureResource.cpp#L397-L427 - Image-table consumer of the rejection: https://github.com/boykopovar/AnyPS5/blob/7755bf22a5013a5e486a1224c75c0eaf675277ff/core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp#L6426-L6433 **To get this to a good state** Nothing is required. The optional points are the two non-blocking items above. No command needs to be rerun on a new head.
MarcZX10 commented 2026-11-17 14:36:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-17T14:36:45Z.

Review: COMMENTED


Reviewed — no blocking findings

No verified defect in the changed code. I did not re-run the tests or the performance captures, so this is a comment, not an approval.

What I ran

  • Head: a2fa6aa512adc4410416730ad1dcc784ca86baa4 (base main).
  • Read the description, commits, manifest and diff from the review folder. Read the head text through the reader:
python3 repo_read.py search "decodeEntry" core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp 6276 6300
python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp 6336 6360
python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp 6434 6500
  • No build and no test run (the house rules for this review are read-only checks).

Results

Check Result Note
Diff of the four changed files passed All hunks read
Head context for the changed functions passed Partial, see Not verified
Build and unit tests not run No build in this review
Author-reported test and performance runs not run Author-reported, not repeated

Findings

Blocking

None.

Non-blocking

  • core/libs/prx/libSceAgcDriver/Graphics/src/GuestTextureResource.cpp:423: when the remembered map reaches RememberedTextureRejections, the whole map is cleared at once. A title that produces more than 4096 distinct rejected T# values would re-decode and re-insert them in cycles. This costs time and is not a correctness problem, since a miss just runs the decoder again. Keep it unless the traces show it.

Sources

Not verified

  • Build and tests: none run here. The author's table reports agc_driver_stencil_plane_memory failing on main too. It also reports agc_driver_color_memo_baseline_disabled and agc_driver_color_memo_baseline_verify failing on this PR and flaky on both sides. The author states these do not reach the descriptor decode. I did not check that.
  • Performance: the +2.2 % to +4.4 % figures and the linked traces are author-reported. I did not open the trace files or the digests.
  • Cache key: I checked GuestTextureResource.cpp for globals (only the GCN flag and two one-time log flags). I did not read the helpers in other files that DecodeTextureResource calls, so "depends only on the 8 words and the GCN flag" is not fully verified.
  • ShaderResources.cpp around line 6476 still calls DecodeTextureResource directly on the narrowed first-layer words. It is outside the three sites this PR changes. I did not check whether that call can throw for an element that the new code accepted.
  • Head copies of GuestTextureResource.hpp and the test file were read through their diff hunks only.

To get this to a good state

Nothing is required.

Optional, once:

  • Decide whether clearing the whole map on overflow is acceptable for the title's traces, or evict one entry instead.
  • Say in the description whether the 6476 decode can throw for a narrowed descriptor.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5940421605 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/21501#pullrequestreview-5940421605). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-17T14:36:45Z. **Review:** COMMENTED --- # Reviewed — no blocking findings No verified defect in the changed code. I did not re-run the tests or the performance captures, so this is a comment, not an approval. ## What I ran - Head: `a2fa6aa512adc4410416730ad1dcc784ca86baa4` (base `main`). - Read the description, commits, manifest and diff from the review folder. Read the head text through the reader: ``` python3 repo_read.py search "decodeEntry" core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp 6276 6300 python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp 6336 6360 python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp 6434 6500 ``` - No build and no test run (the house rules for this review are read-only checks). ## Results | Check | Result | Note | |---|---|---| | Diff of the four changed files | passed | All hunks read | | Head context for the changed functions | passed | Partial, see Not verified | | Build and unit tests | not run | No build in this review | | Author-reported test and performance runs | not run | Author-reported, not repeated | ## Findings **Blocking** None. **Non-blocking** - `core/libs/prx/libSceAgcDriver/Graphics/src/GuestTextureResource.cpp:423`: when the remembered map reaches `RememberedTextureRejections`, the whole map is cleared at once. A title that produces more than 4096 distinct rejected T# values would re-decode and re-insert them in cycles. This costs time and is not a correctness problem, since a miss just runs the decoder again. Keep it unless the traces show it. ## Sources - Line 423 of the changed file, pinned to the head: https://github.com/boykopovar/AnyPS5/blob/a2fa6aa512adc4410416730ad1dcc784ca86baa4/core/libs/prx/libSceAgcDriver/Graphics/src/GuestTextureResource.cpp#L423 ## Not verified - Build and tests: none run here. The author's table reports `agc_driver_stencil_plane_memory` failing on `main` too. It also reports `agc_driver_color_memo_baseline_disabled` and `agc_driver_color_memo_baseline_verify` failing on this PR and flaky on both sides. The author states these do not reach the descriptor decode. I did not check that. - Performance: the +2.2 % to +4.4 % figures and the linked traces are author-reported. I did not open the trace files or the digests. - Cache key: I checked `GuestTextureResource.cpp` for globals (only the GCN flag and two one-time log flags). I did not read the helpers in other files that `DecodeTextureResource` calls, so "depends only on the 8 words and the GCN flag" is not fully verified. - `ShaderResources.cpp` around line 6476 still calls `DecodeTextureResource` directly on the narrowed first-layer words. It is outside the three sites this PR changes. I did not check whether that call can throw for an element that the new code accepted. - Head copies of `GuestTextureResource.hpp` and the test file were read through their diff hunks only. ## To get this to a good state Nothing is required. Optional, once: - Decide whether clearing the whole map on overflow is acceptable for the title's traces, or evict one entry instead. - Say in the description whether the 6476 decode can throw for a narrowed descriptor.
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!21501
No description provided.