Skip to content

perf(agc): retile storage write-back windows straight into their unit-shadow slabs - #6490

Merged
adriadam10 merged 2 commits into
boykopovar:mainfrom
parl0v:perf/write-back-into-slabs
Oct 19, 2026
Merged

adriadam10 merged 2 commits into
boykopovar:mainfrom
parl0v:perf/write-back-into-slabs

Conversation

@parl0v

@parl0v parl0v commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

What

A storage write-back retiled each window into a device scratch buffer and then copied the kept bytes from the scratch into the import's unit-shadow slabs, so every stored byte was written twice (plus a padding copy into the scratch and the barriers between them). Now a window retiles straight into its slabs when:

  • its kept range is its whole tiled range;
  • every piece of it maps to a unit-shadow slab that needs no seed, and each piece is tile-block and 4-byte aligned;
  • it isn't a tail, a thick slice, or a write-back with a save buffer.

A window that crosses a slab boundary gets one dispatch per slab piece, with its range narrowed to that piece. This is exact: the retile writes only the elements inside the window's range, and every other byte the scratch copy would have stored is padding, which is copied into the slab from its current source before the retile, or left alone when the slab already holds it at that offset. Every other window keeps the scratch path.

Tested

Windows 10 19045, MinGW-w64 GCC 15.2, NVIDIA 617.42.

Minecraft Dungeons II (PPSA16064), title screen, same relinked executable and libraries on a lab build with a switch for the old path, alternating 2 × 240 s, APS5_PROFILE_DRAW=1 APS5_PROFILE_GPU=1; box 1 with APS5_TEXTURE_CACHE_MIB=3072 on both sides so storage-cache eviction doesn't mask it:

RTX 3060 12 GB: scratch direct RTX 4060 8 GB: scratch direct
[gputime] storage-writeback per present 17.39 / 17.36 ms 9.45 / 9.44 ms 14.85 / 14.80 ms 8.33 / 8.36 ms
GPU busy per frame 104 / 104 ms 98 / 97 ms 101 / 99 ms 94 / 93 ms
title FPS 6.70 / 6.70 6.80 / 6.89 6.42 / 6.61 6.60 / 6.79
scratch → slab copies per 10 s 50k regions, 53.7 GB 138 regions, 8.6 MB ~53 GB ~0
windows straight into slabs per 10 s 0 44,600 (4,760 across slabs) 0 43,600

Storage write-back GPU time drops about 45 % on both cards. The frame rate moves 2–3 % at this title because the frame isn't purely GPU-bound there; the saving applies to every title that writes storage images back. In isolation the detile/retile dispatch itself runs at 150–280 GB/s on the RTX 4060, so the copies, not the shader, were the cost.

  • ctest -R '^agc_' -j 6 on RTX 4060: upstream/main 0029e62 3 failed of 598, this branch 3 failed of 599, the same three (agc_shader_disk_cache, agc_driver_preparation_scope_settle, and agc_driver_gpu_indirect_arguments_misaligned_writer_ahead, which doesn't compile with this toolchain on main either). The new agc_storage_write_back passes.
  • New test agc_storage_write_back (--storage-write-back-only): runs the storage refresh, write-back padding and single-pass tests, and the padding test gains three watched surfaces written back twice each (512x512 with 3 mips and no padding, 1000x700 padded, 1900x1100 across two 8 MiB slabs) plus the existing 520x260 case, all required to go direct, with exact texel and untouched-byte checks after each write-back.
  • tools/check_conventions.py --base upstream/main passes; git diff --check clean.

Found while working on Minecraft Dungeons II in the working group with @AlxcBTW (AlxcBTW/AnyPS5#56), where storage write-back is our side of the split.

Performance capture (as the Performance report form describes): Minecraft Dungeons II (PPSA16064) title screen, RTX 3060 12 GB (i5-12400F), NVIDIA 617.42, Windows 10.0.19045, 3840x2160 output. Only APS5_TRACE_SECONDS=120:12 set, caches warm (the title ran once on the build and was restarted), stderr not redirected. main 48d61f5 against this PR's head b4cb4f8:

Frame and GPU times (ms):

Metric Baseline Candidate Change Change (%)
frame_ms.p50 117.162 109.015 -8.147 -6.954
frame_ms.p90 145.047 142.643 -2.404 -1.657
frame_ms.p99 158.422 156.665 -1.757 -1.109
frame_ms.max 158.422 157.261 -1.161 -0.733
mean_frame_ms 121.758 113.738 -8.019 -6.586
gpu_busy_ms_per_present 100.711 92.346 -8.365 -8.306

Top phases (ms per frame):

Metric Baseline Candidate Change Change (%)
Driver.Dispatch 85.879 78.648 -7.231 -8.420
Driver.Packet 242.204 226.218 -15.986 -6.600
Driver.Packet.device_lock 34.172 32.937 -1.235 -3.614
Driver.Packet.dispatch 86.382 79.226 -7.156 -8.284
Driver.Packet.memory_wait 68.067 64.104 -3.963 -5.822
Driver.Packet.prepare_memory 30.126 26.819 -3.307 -10.977
Vulkan.Dispatch 40.265 35.801 -4.464 -11.087
Vulkan.Dispatch.shader_resources 38.025 33.341 -4.684 -12.318
{"commit":"48d61f53b46f","dirty":false,"env":{"APS5_TRACE_SECONDS":"120:12"},"gpu":"NVIDIA GeForce RTX 3060","driver":"NVIDIA 617.42","os":"Windows 10.0.19045","resolution":"3840x2160","window":{"spec":"seconds 120:12","first_present":2158,"ms":12053.995},"presents":99,"frame_ms":{"p50":117.162,"p90":145.047,"p99":158.422,"max":158.422},"gpu_busy_ms_per_present":100.711,"worker_busy_pct":{"queue worker 0x0":99.421,"queue worker 0x20":99.581},"top_phases_ms_per_frame":{"Driver.Packet":242.204,"Driver.Packet.dispatch":86.382,"Driver.Dispatch":85.879,"Driver.Packet.memory_wait":68.067,"Vulkan.Dispatch":40.265,"Vulkan.Dispatch.shader_resources":38.025,"Driver.Packet.device_lock":34.172,"Driver.Packet.prepare_memory":30.126},"trace_dropped":false,"trace":"aps5-trace-48d61f53b46f-9720.json.gz"}
{"commit":"b4cb4f8dbdf6","dirty":false,"env":{"APS5_TRACE_SECONDS":"120:12"},"gpu":"NVIDIA GeForce RTX 3060","driver":"NVIDIA 617.42","os":"Windows 10.0.19045","resolution":"3840x2160","window":{"spec":"seconds 120:12","first_present":2200,"ms":12056.238},"presents":106,"frame_ms":{"p50":109.015,"p90":142.643,"p99":156.665,"max":157.261},"gpu_busy_ms_per_present":92.346,"worker_busy_pct":{"queue worker 0x0":99.376,"queue worker 0x20":99.610},"top_phases_ms_per_frame":{"Driver.Packet":226.218,"Driver.Packet.dispatch":79.226,"Driver.Dispatch":78.648,"Driver.Packet.memory_wait":64.104,"Vulkan.Dispatch":35.801,"Vulkan.Dispatch.shader_resources":33.341,"Driver.Packet.device_lock":32.937,"Driver.Packet.prepare_memory":26.819},"trace_dropped":false,"trace":"aps5-trace-b4cb4f8dbdf6-2632.json.gz"}

Traces: aps5-trace-48d61f53b46f-9720.json.gz (main) and aps5-trace-b4cb4f8dbdf6-2632.json.gz (this PR), attached below.

trace_digest.py, main

seconds 120:12 from present 2158: 99 presents, frame p50 117.2 / p90 145.0 / p99 158.4 / max 158.4 ms, GPU busy 100.7 ms per present
NVIDIA GeForce RTX 3060, NVIDIA 617.42, Windows 10.0.19045, 3840x2160, commit 48d61f5, dropped: no

{"commit":"48d61f53b46f","dirty":false,"env":{"APS5_TRACE_SECONDS":"120:12"},"gpu":"NVIDIA GeForce RTX 3060","driver":"NVIDIA 617.42","os":"Windows 10.0.19045","resolution":"3840x2160","window":{"spec":"seconds 120:12","first_present":2158,"ms":12053.995},"presents":99,"frame_ms":{"p50":117.162,"p90":145.047,"p99":158.422,"max":158.422},"gpu_busy_ms_per_present":100.711,"worker_busy_pct":{"queue worker 0x0":99.421,"queue worker 0x20":99.581},"top_phases_ms_per_frame":{"Driver.Packet":242.204,"Driver.Packet.dispatch":86.382,"Driver.Dispatch":85.879,"Driver.Packet.memory_wait":68.067,"Vulkan.Dispatch":40.265,"Vulkan.Dispatch.shader_resources":38.025,"Driver.Packet.device_lock":34.172,"Driver.Packet.prepare_memory":30.126},"trace_dropped":false,"trace":"aps5-trace-48d61f53b46f-9720.json.gz"}

Slowest frames (largest slices inside each, inclusive)

  • present 2199: 158.4 ms at 4990 ms: Driver.Packet (queue worker 0x20) 156.8, Driver.Packet (queue worker 0x0) 152.3, batch (gpu) 105.5, Driver.Packet.dispatch (queue worker 0x20) 75.5
  • present 2183: 157.2 ms at 3021 ms: Driver.Packet (queue worker 0x20) 155.6, Driver.Packet (queue worker 0x0) 150.7, batch (gpu) 105.6, Driver.Packet.dispatch (queue worker 0x20) 74.6
  • present 2246: 153.0 ms at 10688 ms: Driver.Packet (queue worker 0x20) 151.5, Driver.Packet (queue worker 0x0) 146.6, batch (gpu) 108.3, Driver.Packet.dispatch (queue worker 0x20) 74.8
  • present 2166: 149.2 ms at 933 ms: Driver.Packet (queue worker 0x20) 147.7, Driver.Packet (queue worker 0x0) 142.9, batch (gpu) 107.0, Driver.Packet.dispatch (queue worker 0x20) 68.2
  • present 2198: 148.9 ms at 4841 ms: Driver.Packet (queue worker 0x20) 147.2, Driver.Packet (queue worker 0x0) 142.6, batch (gpu) 106.4, Driver.Packet.dispatch (queue worker 0x20) 69.5

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
queue worker 0x0 85.8 (70 %) 29.6 (24 %) 6.3 34.1 Driver.Packet 115.4, Driver.EndSubmission 0.0
queue worker 0x20 39.7 (33 %) 80.2 (66 %) 1.8 7.3 Driver.Packet 119.8, Driver.EndSubmission 0.1
presenter 0.6 (0 %) 0.0 (0 %) 121.1 0.1 VideoOut.Flip 0.6, Driver.Present 0.0
gpu 100.7 (83 %) 0.0 (0 %) 21.1 0.0 batch 100.7

Largest slices (ms per frame, inclusive, all threads): Driver.Packet 235.3, batch 100.7, Driver.Packet.dispatch 86.1, Driver.Dispatch 85.2, Driver.Packet.memory_wait 68.0, Vulkan.Dispatch 39.4, Vulkan.Dispatch.shader_resources 37.1, Driver.Packet.device_lock 32.2, Driver.Packet.prepare_memory 27.8, Recorder.Sync 20.7

Longest waits

  • Driver.Packet.memory_wait (queue worker 0x20) 45.5 ms at 10797 ms, present 2246
  • Driver.Packet.memory_wait (queue worker 0x20) 45.1 ms at 5104 ms, present 2199
  • Driver.Packet.memory_wait (queue worker 0x20) 44.3 ms at 1038 ms, present 2166
  • Driver.Packet.memory_wait (queue worker 0x20) 43.9 ms at 8841 ms, present 2230
  • Driver.Packet.memory_wait (queue worker 0x20) 43.0 ms at 3137 ms, present 2183
  • Driver.Packet.memory_wait (queue worker 0x20) 41.8 ms at 6905 ms, present 2214
  • Driver.Packet.memory_wait (queue worker 0x20) 41.5 ms at 4949 ms, present 2198
  • Driver.Packet.memory_wait (queue worker 0x20) 41.1 ms at 8989 ms, present 2231
  • Driver.Packet.memory_wait (queue worker 0x20) 41.1 ms at 2981 ms, present 2182
  • Driver.Packet.memory_wait (queue worker 0x20) 40.4 ms at 7050 ms, present 2215

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

  • batch 4140: 11.6 ms at 7393 ms, present 2218: GPU no ranges; recorded by Recorder.WaitSerial (queue worker 0x20) 11.7, Driver.Packet (queue worker 0x20) 1.9, Driver.Packet.dispatch (queue worker 0x20) 1.4, Driver.Dispatch (queue worker 0x20) 1.3
  • batch 163: 11.5 ms at 303 ms, present 2160: GPU no ranges; recorded by Driver.Packet (queue worker 0x20) 1.5, Driver.Packet.dispatch (queue worker 0x20) 1.0, Driver.Dispatch (queue worker 0x20) 0.9, Driver.Packet.prepare_memory (queue worker 0x20) 0.5
  • batch 2466: 11.5 ms at 4439 ms, present 2194: GPU no ranges; recorded by Recorder.WaitSerial (queue worker 0x20) 13.9, Driver.Packet (queue worker 0x20) 1.5, Driver.Packet.dispatch (queue worker 0x20) 1.3, Driver.Dispatch (queue worker 0x20) 1.2
  • batch 3269: 11.5 ms at 5830 ms, present 2205: GPU no ranges; recorded by Driver.Packet (queue worker 0x20) 1.8, Driver.Packet.dispatch (queue worker 0x20) 1.2, Driver.Dispatch (queue worker 0x20) 1.1, GpuMutex.wait.label (queue worker 0x20) 0.8
  • batch 988: 11.4 ms at 1761 ms, present 2172: GPU no ranges; recorded by Driver.Packet (queue worker 0x20) 1.6, Driver.Packet.dispatch (queue worker 0x20) 1.1, Driver.Dispatch (queue worker 0x20) 1.1, GpuMutex.wait.label (queue worker 0x20) 0.6
trace_digest.py, this PR

seconds 120:12 from present 2200: 106 presents, frame p50 109.0 / p90 142.6 / p99 156.7 / max 157.3 ms, GPU busy 92.3 ms per present
NVIDIA GeForce RTX 3060, NVIDIA 617.42, Windows 10.0.19045, 3840x2160, commit b4cb4f8, dropped: no

{"commit":"b4cb4f8dbdf6","dirty":false,"env":{"APS5_TRACE_SECONDS":"120:12"},"gpu":"NVIDIA GeForce RTX 3060","driver":"NVIDIA 617.42","os":"Windows 10.0.19045","resolution":"3840x2160","window":{"spec":"seconds 120:12","first_present":2200,"ms":12056.238},"presents":106,"frame_ms":{"p50":109.015,"p90":142.643,"p99":156.665,"max":157.261},"gpu_busy_ms_per_present":92.346,"worker_busy_pct":{"queue worker 0x0":99.376,"queue worker 0x20":99.61},"top_phases_ms_per_frame":{"Driver.Packet":226.218,"Driver.Packet.dispatch":79.226,"Driver.Dispatch":78.648,"Driver.Packet.memory_wait":64.104,"Vulkan.Dispatch":35.801,"Vulkan.Dispatch.shader_resources":33.341,"Driver.Packet.device_lock":32.937,"Driver.Packet.prepare_memory":26.819},"trace_dropped":false,"trace":"aps5-trace-b4cb4f8dbdf6-2632.json.gz"}

Slowest frames (largest slices inside each, inclusive)

  • present 2211: 157.3 ms at 1231 ms: Driver.Packet (queue worker 0x20) 155.4, Driver.Packet (queue worker 0x0) 151.0, batch (gpu) 96.4, Driver.Packet.dispatch (queue worker 0x20) 74.8
  • present 2291: 156.7 ms at 10367 ms: Driver.Packet (queue worker 0x20) 155.0, Driver.Packet (queue worker 0x0) 150.2, batch (gpu) 98.1, Driver.Packet.dispatch (queue worker 0x20) 81.5
  • present 2242: 156.3 ms at 4753 ms: Driver.Packet (queue worker 0x20) 154.6, Driver.Packet (queue worker 0x0) 149.8, batch (gpu) 97.7, Driver.Packet.dispatch (queue worker 0x20) 79.5
  • present 2227: 155.0 ms at 3069 ms: Driver.Packet (queue worker 0x20) 153.3, Driver.Packet (queue worker 0x0) 148.3, batch (gpu) 96.8, Driver.Packet.dispatch (queue worker 0x20) 78.0
  • present 2226: 154.4 ms at 2914 ms: Driver.Packet (queue worker 0x20) 152.8, Driver.Packet (queue worker 0x0) 148.4, batch (gpu) 99.4, Driver.Packet.dispatch (queue worker 0x20) 84.7

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
queue worker 0x0 80.6 (71 %) 26.8 (24 %) 6.3 34.0 Driver.Packet 107.5, Driver.EndSubmission 0.0
queue worker 0x20 36.3 (32 %) 75.7 (67 %) 1.8 7.3 Driver.Packet 111.9, Driver.EndSubmission 0.1
presenter 0.6 (1 %) 0.0 (0 %) 113.1 0.1 VideoOut.Flip 0.6, Driver.Present 0.0
gpu 92.3 (81 %) 0.0 (0 %) 21.4 0.0 batch 92.3

Largest slices (ms per frame, inclusive, all threads): Driver.Packet 219.3, batch 92.3, Driver.Packet.dispatch 78.9, Driver.Dispatch 78.0, Driver.Packet.memory_wait 64.0, Vulkan.Dispatch 35.0, Vulkan.Dispatch.shader_resources 32.4, Driver.Packet.device_lock 30.9, Driver.Packet.prepare_memory 24.4, Recorder.WaitSerial 20.5

Longest waits

  • Driver.Packet.memory_wait (queue worker 0x20) 44.5 ms at 1345 ms, present 2211
  • Driver.Packet.memory_wait (queue worker 0x20) 44.1 ms at 5019 ms, present 2243
  • Driver.Packet.memory_wait (queue worker 0x20) 43.8 ms at 10481 ms, present 2291
  • Driver.Packet.memory_wait (queue worker 0x20) 43.6 ms at 10325 ms, present 2290
  • Driver.Packet.memory_wait (queue worker 0x20) 43.5 ms at 8655 ms, present 2275
  • Driver.Packet.memory_wait (queue worker 0x20) 43.3 ms at 4867 ms, present 2242
  • Driver.Packet.memory_wait (queue worker 0x20) 43.0 ms at 6690 ms, present 2258
  • Driver.Packet.memory_wait (queue worker 0x20) 41.6 ms at 1190 ms, present 2210
  • Driver.Packet.memory_wait (queue worker 0x20) 41.4 ms at 3028 ms, present 2226
  • Driver.Packet.memory_wait (queue worker 0x20) 41.2 ms at 8504 ms, present 2274

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

  • batch 5013: 12.4 ms at 8472 ms, present 2274: GPU no ranges; recorded by no CPU slices
  • batch 683: 11.9 ms at 1161 ms, present 2210: GPU no ranges; recorded by Recorder.WaitSerial (queue worker 0x20) 14.4, Driver.Packet (queue worker 0x20) 1.7, Driver.Dispatch (queue worker 0x20) 1.1, Driver.Packet.dispatch (queue worker 0x20) 1.1
  • batch 2855: 11.5 ms at 4825 ms, present 2242: GPU no ranges; recorded by Recorder.WaitSerial (queue worker 0x20) 16.0, Driver.Packet (queue worker 0x20) 0.8, Driver.Dispatch (queue worker 0x20) 0.4, Driver.Packet.prepare_memory (queue worker 0x20) 0.4
  • batch 35: 11.4 ms at 60 ms, present 2200: GPU no ranges; recorded by Driver.Packet (queue worker 0x20) 1.5, Driver.Packet.dispatch (queue worker 0x20) 0.9, Driver.Dispatch (queue worker 0x20) 0.8, GpuMutex.wait.label (queue worker 0x20) 0.7
  • batch 4881: 11.4 ms at 8243 ms, present 2272: GPU no ranges; recorded by Driver.Packet (queue worker 0x20) 1.8, Driver.Packet.dispatch (queue worker 0x20) 1.2, Driver.Dispatch (queue worker 0x20) 1.1, Driver.Packet.prepare_memory (queue worker 0x20) 0.6

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: PPSA16064 (Minecraft Dungeons II): storage write-back GPU time at the title
  • GPUs tested: NVIDIA GeForce RTX 3060 12 GB, driver 617.42, Windows 10; NVIDIA GeForce RTX 4060 8 GB, driver 617.42, Windows 10
  • AI-assisted: yes

@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 7048 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp L3143
PR 7085 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp L3243-3245

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

Pull request Shared files not compared
PR 1341 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 1368 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 1395 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 2434 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 4448 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 4650 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 4891 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5021 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 5371 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5426 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5431 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5499 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5609 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 5925 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6044 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6185 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6186 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6188 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6192 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6197 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6202 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6280 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6292 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6300 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6360 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6451 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6481 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6501 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6503 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6535 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6539 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6606 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6615 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6683 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6701 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6718 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6743 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6747 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6759 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6763 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6788 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6808 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6820 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6868 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6937 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6941 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6946 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6947 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6960 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6963 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6970 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6971 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6977 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 7201 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7223 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7254 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 7256 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 7258 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7332 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7395 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7505 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7514 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 7604 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7642 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp

@parl0v

parl0v commented Oct 15, 2026

Copy link
Copy Markdown
Contributor Author

Same measurement on this PR's exact head (bde6e2f17) against its merge base (0029e62f9), both built from the same tree, same relinked executables, alternating, APS5_PROFILE_DRAW=1 APS5_PROFILE_GPU=1:

main 0029e62 this PR
Sword of the Sea (PPSA25344) title, RTX 3060, 3 boots × 150 s 9.60 / 9.60 / 9.60 FPS 10.12 / 10.16 / 10.10 FPS (+5.5 %)
storage-writeback per present 15.43 ms 9.71 ms
GPU busy per frame 80 ms 74 ms
Minecraft Dungeons II (PPSA16064) title, RTX 3060, 2 × 240 s 6.70 / 6.62 FPS 6.96 / 7.00 FPS (+4.8 %)
storage-writeback per present 17.49 ms 9.46 ms
GPU busy per frame 105 ms 96 ms
Minecraft Dungeons II title, RTX 4060 8 GB (APS5_TEXTURE_CACHE_MIB=3072 both sides), 2 × 240 s 6.61 / 6.83 FPS 6.96 / 6.83 FPS (GPU 100 → 91 ms)

No faults in any of the 14 runs. So a second title (Sword of the Sea) gains as well, and on the RTX 3060 both titles move about 5 %. @AlxcBTW is running the same pair on an RTX 5070 Laptop.

AI-assisted: yes (Claude Code)

@AlxcBTW

AlxcBTW commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Third card, as @parl0v asked in the working group: RTX 5070 Laptop 8 GB, Ryzen AI 9 365, NVIDIA 617.42, Windows 11, on AC. Minecraft Dungeons II (PPSA16064 01.100.100), title screen, no input, APS5_TEXTURE_CACHE_MIB=3072 on both sides so the storage cache does not evict. Base = this PR's merge base 0029e62f9, PR = bde6e2f17, both built on our fork CI with the default configuration. Each side ran from its own run directory with a warm shader cache: one cold row per side after the relink, then alternating warm rows of 200 s. Numbers are the means of the title windows (10 s each, after the splash).

base cold PR cold base 1 PR 1 base 2 PR 2
title FPS 7.98 8.21 7.93 8.27 7.99 8.29
GPU busy per frame 79.9 ms 74.7 ms 79.8 ms 74.8 ms 80.1 ms 74.6 ms
idle gaps per frame 43.2 ms 44.4 ms 43.8 ms 44.5 ms 44.8 ms 43.6 ms
storage-writeback per present 11.72 ms (800 MiB) 5.88 ms (801 MiB) 11.91 ms (812 MiB) 5.85 ms (798 MiB) 11.79 ms (804 MiB) 5.89 ms (804 MiB)
label timeouts / fatal lines 0 / 0 0 / 0 0 / 0 0 / 0 0 / 0 0 / 0

Storage write-back halves on this card too (−50 %, same bytes), GPU busy drops by ~5.3 ms, and the title gains ~4 % (warm rows 7.93-7.99 against 8.27-8.29). The frame is not GPU-bound here either (~44 ms of idle gaps per frame on both sides), so most of the GPU saving does not show as frame rate at this scene; the other classes (draw ~25 ms, copy ~5.3 ms, shadow-publish ~5.7 ms) are unchanged within noise. The last screenshot of both warm PR rows shows the title image as on main (logo, campfire, lighting); the other shots were not reviewed one by one. Not run: the test target, Linux, gameplay.

AI-assisted: yes

@github-actions github-actions Bot added build agc libSceAgc* labels Oct 16, 2026
@parl0v

parl0v commented Oct 16, 2026

Copy link
Copy Markdown
Contributor Author

@AlxcBTW thanks for the third card: write-back −50 % (11.8 → 5.9 ms per present, same bytes) and +4 % at the title on the RTX 5070 Laptop, no timeouts or fatals, matching the RTX 3060 / 4060 rows. With ~44 ms of CPU-side idle per frame on all three, that's about what this scene can show.

AI-assisted: yes (Claude Code)

@parl0v

parl0v commented Oct 16, 2026

Copy link
Copy Markdown
Contributor Author

Fresh numbers on current main (4524944, 60 commits past the base of my earlier rows); the head (bde6e2f) still merges cleanly. RTX 3060 12 GB (NVIDIA 617.42), i5-12400F, Windows 10 19045, Minecraft Dungeons II (PPSA16064 01.100.100) title screen, no input, APS5_PROFILE_DRAW=1, automatic budgets, 200 s rows alternating. FPS is the mean of the last 10 [present] windows, GPU busy and idle gaps per frame over the last 8.

libs FPS mean GPU busy idle gaps
main 4524944 6.68 / 6.80 / 6.70 6.73 104 / 103 / 104 ms 46 / 44 / 45 ms
+ this PR 6.95 / 7.01 / 6.97 6.98 (+3.7 %) 97 / 95 / 96 ms 47 / 47 / 47 ms

The gain is GPU time only (-7.7 ms per frame, idle gaps unchanged), the same signature as on the three cards in the description. Write-back volume is unchanged (53.4 vs 55.6 GB of storage write-backs per 10 s, ~all of them retiled through the unit shadow on both sides); the difference is the per-window scratch copy this PR removes. 0 fatal, 0 wait timeouts.

AI-assisted: yes (Claude Code)

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 18, 2026
@github-actions github-actions Bot added perf Performance change perf numbers missing perf pull request without a before and after summary line unblocks title Names a title ID on the Unblocks line labels Oct 18, 2026
…-shadow slabs

writeBackWindows retiled every window into a device scratch buffer and
then copied the kept bytes from the scratch into the unit-shadow slabs,
so each stored byte was written twice.

A window now retiles straight into its slabs, one dispatch per slab
piece, when its kept range is its whole tiled range, every piece goes to
a slab that needs no seed, the pieces are tile-block and 4-byte aligned,
and it is not a tail, thick or saved slice. The bytes no element covers
are copied into the slab from their current source before the retile,
or left alone when the slab already holds them. Every other window keeps
the scratch path, and the scratch is not allocated when no window needs it.
…w slabs

The write-back padding test gains an unpadded surface, a padded one and
one that spans two slabs, writes each of them back twice and checks the
stored texels and the untouched bytes after each write-back. The storage
refresh, write-back padding and single-pass tests run as
agc_storage_write_back.
@parl0v
parl0v force-pushed the perf/write-back-into-slabs branch from bde6e2f to b4cb4f8 Compare October 18, 2026 20:48
@github-actions

Copy link
Copy Markdown

This pull request is labeled perf, so it needs the summary line of a capture on main and one with the change, from the same title, scene and machine, as the Performance report form asks. Please paste both aps5-summary.jsonl lines, attach the two traces and add the output of tools/trace_digest.py.

@github-actions github-actions Bot removed needs rebase Conflicts with main, rebase needed perf numbers missing perf pull request without a before and after summary line labels Oct 18, 2026
@parl0v

parl0v commented Oct 18, 2026

Copy link
Copy Markdown
Contributor Author

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

@adriadam10 adriadam10 self-assigned this Oct 19, 2026
@adriadam10
adriadam10 merged commit bcd473d into boykopovar:main Oct 19, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* build perf Performance change unblocks title Names a title ID on the Unblocks line

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants