Skip to content

perf(agc): store whole words of 1- and 2-byte texels in the detile shader - #6905

Merged
oneandonlydean merged 2 commits into
boykopovar:mainfrom
parl0v:perf/detile-word-copies
Nov 3, 2026
Merged

oneandonlydean merged 2 commits into
boykopovar:mainfrom
parl0v:perf/detile-word-copies

Conversation

@parl0v

@parl0v parl0v commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

What

TextureDetile.comp moves one element per invocation. For 1- and 2-byte elements (R8, R16 and the other 8/16-bit formats) the destination word is shared by 4 or 2 invocations, so every element is written with an atomicAnd + atomicOr pair on that word (copyElement in the buffer paths, loadElement in the image retile). Neighbouring invocations hit the same word, and those paths run at 9-44 GB/s on an RTX 4060 against 253 GB/s for 4-byte elements.

  • perf: two new variants of the shader (-DWORD_GROUPS=1, buffer and image) combine the elements of each destination word in workgroup shared memory and store the word once. Each invocation still locates its own element (locate, the per-element addressing split out of main unchanged); after a barrier, a group of 4 (1-byte) or 2 (2-byte) neighbouring invocations whose elements are all in the window's range and land in one aligned 4-byte word, in order, store that word with a plain write. Any other group (a row or window edge, a partial word at a range boundary, an unaligned base) falls back to the existing per-element atomic path, so the bytes written are exactly the old ones.
  • The host (TextureDetiler::pipeline) picks the word variants only where they help: 1- and 2-byte buffer detiles (the linear destination always keeps neighbours in one word), and retiles of the linear and standard (non-equation) layouts. Equation-swizzled retiles (_X, thick) keep the old shader: their tiled words hold elements of other rows, and grouping them measured slower. 4-, 8- and 16-byte elements are unchanged and use the same SPIR-V as before.
  • test: agc_detile_small_elements (agc_driver_recorder_tests --small-element-detile-only) runs the buffer retile, buffer detile and image retile on the device for 1- and 2-byte elements over SW_64KB_S, SW_4KB_S, SW_64KB_R_X and linear, odd sizes (37x21, 70x9, 37x5), a tail mip of each 64 KB mode, and three windows (whole mip, a byte range with unaligned ends, columns 3 to width-2). Every byte of each destination is compared with a CPU reference (the swizzle equations for _X, the shader's standard-swizzle bit layout for SW_*_S), including the bytes no element maps to. Breaking the word store (^ 1u) fails it at the first byte.

This is a throughput fix for those paths: no title I have is bound by 1- or 2-byte detiles yet, so it makes no frame-rate claim (title runs under Tested).

Tested

Windows 10 19045, MinGW GCC, Release.

  • RTX 4060 8 GB (NVIDIA 617.42): agc_detile_small_elements, agc_driver_graphics, agc_unit_shadow, agc_shadowed_key_stores and the agc_storage_* tests pass.
  • Microbenchmark on the RTX 4060 (a local --detile-bench harness timing 20 dispatches per path with timestamp queries, 1920x1080, median; main 4524944 vs this PR in the same build tree, two runs each, mean of the two):
path layout element main this PR
buffer detile SW_64KB_S 1 B 228.9 us 37.9 us 6.0x
buffer detile SW_64KB_R_X 1 B 231.9 us 74.8 us 3.1x
buffer detile SW_64KB_S 2 B 94.5 us 35.8 us 2.6x
image retile SW_64KB_S 1 B 79.9 us 35.8 us 2.2x
buffer detile SW_64KB_R_X 2 B 95.2 us 71.7 us 1.3x
image retile SW_64KB_S 2 B 37.9 us 33.8 us 1.1x
image retile SW_64KB_R_X 1 / 2 B 62.5 us 63.5 / 63.2 us unchanged path
every path both 4 / 8 B 0.98-1.05x (unchanged SPIR-V)
  • In a title, RTX 3060 12 GB (NVIDIA 617.42), title screens, 200 s rows alternating, APS5_PROFILE_GPU=1: no change, because their per-frame write-backs are not 1- or 2-byte standard-layout retiles. Minecraft Dungeons II (PPSA16064): 6.60 / 6.71 / 6.60 FPS on main, 6.68 / 6.58 / 6.67 with this PR, storage-writeback 17.3-17.6 ms per present on both. Sword of the Sea (PPSA25344): 9.62 / 9.60 FPS on main, 9.60 / 9.60 with this PR, storage-writeback 15.3-15.5 ms and storage-upload 5.0-5.1 ms per present on both. The paths this speeds up are the buffer detile of 8- and 16-bit textures (sampled texture uploads) and the standard-layout storage write-backs of such images; I have no title scene yet that is bound by them, so this is offered as a throughput fix with the benchmark above, not a frame-rate claim.
  • tools/check_conventions.py --base upstream/main passes.

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 283b057:

Frame and GPU times (ms):

Metric Baseline Candidate Change Change (%)
frame_ms.p50 117.162 116.903 -0.259 -0.221
frame_ms.p90 145.047 144.762 -0.285 -0.196
frame_ms.p99 158.422 163.666 +5.244 +3.310
frame_ms.max 158.422 163.666 +5.244 +3.310
mean_frame_ms 121.758 120.905 -0.852 -0.700
gpu_busy_ms_per_present 100.711 100.576 -0.135 -0.134

Top phases (ms per frame):

Metric Baseline Candidate Change Change (%)
Driver.Dispatch 85.879 83.654 -2.225 -2.591
Driver.Packet 242.204 240.507 -1.697 -0.701
Driver.Packet.device_lock 34.172 36.328 +2.156 +6.309
Driver.Packet.dispatch 86.382 84.174 -2.208 -2.556
Driver.Packet.memory_wait 68.067 67.603 -0.464 -0.682
Driver.Packet.prepare_memory 30.126 28.913 -1.213 -4.026
Vulkan.Dispatch 40.265 39.326 -0.939 -2.332
Vulkan.Dispatch.shader_resources 38.025 37.045 -0.980 -2.577
{"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":"283b057afe16","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":2159,"ms":12090.542},"presents":100,"frame_ms":{"p50":116.903,"p90":144.762,"p99":163.666,"max":163.666},"gpu_busy_ms_per_present":100.576,"worker_busy_pct":{"queue worker 0x0":99.411,"queue worker 0x20":99.593},"top_phases_ms_per_frame":{"Driver.Packet":240.507,"Driver.Packet.dispatch":84.174,"Driver.Dispatch":83.654,"Driver.Packet.memory_wait":67.603,"Vulkan.Dispatch":39.326,"Vulkan.Dispatch.shader_resources":37.045,"Driver.Packet.device_lock":36.328,"Driver.Packet.prepare_memory":28.913},"trace_dropped":false,"trace":"aps5-trace-283b057afe16-15136.json.gz"}

Traces: aps5-trace-48d61f53b46f-9720.json.gz (main) and aps5-trace-283b057afe16-15136.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 2159: 100 presents, frame p50 116.9 / p90 144.8 / p99 163.7 / max 163.7 ms, GPU busy 100.6 ms per present
NVIDIA GeForce RTX 3060, NVIDIA 617.42, Windows 10.0.19045, 3840x2160, commit 283b057, dropped: no

{"commit":"283b057afe16","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":2159,"ms":12090.542},"presents":100,"frame_ms":{"p50":116.903,"p90":144.762,"p99":163.666,"max":163.666},"gpu_busy_ms_per_present":100.576,"worker_busy_pct":{"queue worker 0x0":99.411,"queue worker 0x20":99.593},"top_phases_ms_per_frame":{"Driver.Packet":240.507,"Driver.Packet.dispatch":84.174,"Driver.Dispatch":83.654,"Driver.Packet.memory_wait":67.603,"Vulkan.Dispatch":39.326,"Vulkan.Dispatch.shader_resources":37.045,"Driver.Packet.device_lock":36.328,"Driver.Packet.prepare_memory":28.913},"trace_dropped":false,"trace":"aps5-trace-283b057afe16-15136.json.gz"}

Slowest frames (largest slices inside each, inclusive)

  • present 2244: 163.7 ms at 10263 ms: Driver.Packet (queue worker 0x20) 162.1, Driver.Packet (queue worker 0x0) 157.3, batch (gpu) 108.6, Driver.Packet.dispatch (queue worker 0x20) 83.3
  • present 2165: 160.1 ms at 726 ms: Driver.Packet (queue worker 0x20) 158.4, Driver.Packet (queue worker 0x0) 153.9, batch (gpu) 106.1, Driver.Packet.dispatch (queue worker 0x20) 76.1
  • present 2197: 156.0 ms at 4595 ms: Driver.Packet (queue worker 0x20) 154.4, Driver.Packet (queue worker 0x0) 149.8, batch (gpu) 105.3, Driver.Packet.dispatch (queue worker 0x20) 82.8
  • present 2228: 151.6 ms at 8333 ms: Driver.Packet (queue worker 0x20) 150.0, Driver.Packet (queue worker 0x0) 145.4, batch (gpu) 107.6, Driver.Packet.dispatch (queue worker 0x20) 70.9
  • present 2212: 150.4 ms at 6399 ms: Driver.Packet (queue worker 0x20) 148.7, Driver.Packet (queue worker 0x0) 144.3, batch (gpu) 106.0, Driver.Packet.dispatch (queue worker 0x20) 76.7

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
queue worker 0x0 87.1 (72 %) 27.5 (23 %) 6.3 34.0 Driver.Packet 114.6, Driver.EndSubmission 0.0
queue worker 0x20 39.5 (33 %) 79.6 (66 %) 1.8 7.2 Driver.Packet 119.0, Driver.EndSubmission 0.1
presenter 0.6 (1 %) 0.0 (0 %) 120.3 0.1 VideoOut.Flip 0.6, Driver.Present 0.0
gpu 100.5 (83 %) 0.0 (0 %) 20.4 0.0 batch 100.5

Largest slices (ms per frame, inclusive, all threads): Driver.Packet 233.6, batch 100.5, Driver.Packet.dispatch 83.9, Driver.Dispatch 83.0, Driver.Packet.memory_wait 67.5, Vulkan.Dispatch 38.4, Vulkan.Dispatch.shader_resources 36.1, Driver.Packet.device_lock 34.3, Driver.Packet.prepare_memory 26.5, Recorder.WaitSerial 20.3

Longest waits

  • Driver.Packet.memory_wait (queue worker 0x20) 45.0 ms at 10382 ms, present 2244
  • Driver.Packet.memory_wait (queue worker 0x20) 44.5 ms at 842 ms, present 2165
  • Driver.Packet.memory_wait (queue worker 0x20) 43.6 ms at 684 ms, present 2164
  • Driver.Packet.memory_wait (queue worker 0x20) 43.2 ms at 8441 ms, present 2228
  • Driver.Packet.memory_wait (queue worker 0x20) 42.6 ms at 6507 ms, present 2212
  • Driver.Packet.memory_wait (queue worker 0x20) 42.6 ms at 4710 ms, present 2197
  • Driver.Packet.memory_wait (queue worker 0x20) 41.7 ms at 4554 ms, present 2196
  • Driver.Packet.memory_wait (queue worker 0x20) 41.3 ms at 6653 ms, present 2213
  • Driver.Packet.memory_wait (queue worker 0x20) 40.8 ms at 8589 ms, present 2229
  • Driver.Packet.memory_wait (queue worker 0x20) 40.7 ms at 2771 ms, present 2181

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

  • batch 365: 14.6 ms at 650 ms, present 2164: GPU no ranges; recorded by Recorder.WaitSerial (queue worker 0x20) 16.3, Driver.Packet (queue worker 0x20) 1.8, Driver.Packet.dispatch (queue worker 0x20) 1.4, Driver.Dispatch (queue worker 0x20) 1.4
  • batch 3045: 11.9 ms at 5433 ms, present 2203: GPU no ranges; recorded by Driver.Packet (queue worker 0x20) 1.4, Driver.Packet.dispatch (queue worker 0x20) 1.3, Driver.Dispatch (queue worker 0x20) 1.2, Vulkan.Dispatch (queue worker 0x20) 0.6
  • batch 1756: 11.6 ms at 3113 ms, present 2184: GPU no ranges; recorded by Driver.Packet (queue worker 0x20) 2.1, Driver.Packet.dispatch (queue worker 0x20) 1.6, Driver.Dispatch (queue worker 0x20) 1.5, Driver.Packet.prepare_memory (queue worker 0x20) 0.6
  • batch 667: 11.5 ms at 1189 ms, present 2168: 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.3, Driver.Dispatch (queue worker 0x20) 1.3
  • batch 3920: 11.5 ms at 6998 ms, present 2216: GPU no ranges; recorded by Driver.Packet (queue worker 0x20) 1.5, Driver.Packet.dispatch (queue worker 0x20) 1.1, Driver.Dispatch (queue worker 0x20) 1.0, Driver.Packet.prepare_memory (queue worker 0x20) 0.5

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: none
  • GPUs tested: NVIDIA GeForce RTX 4060 8 GB, driver 617.42, Windows 10 (tests and benchmark); NVIDIA GeForce RTX 3060 12 GB, driver 617.42, Windows 10 (title runs)
  • AI-assisted: yes

@github-actions

github-actions Bot commented Oct 16, 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 9508 core/libs/prx/libSceAgcDriver/Graphics/include/TextureDetiler.hpp L94
core/libs/prx/libSceAgcDriver/Graphics/src/TextureDetiler.cpp L8, L178-180, L191
PR 12840 core/libs/prx/libSceAgcDriver/CMakeLists.txt L377
PR 13251 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp L13699

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 1368 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 1395 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 1896 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 5925 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
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
PR 6187 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/tests/Recorder.cpp
PR 6192 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6209 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6280 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6412 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6481 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6808 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6970 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6987 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6989 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6995 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7002 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7085 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
PR 7223 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7275 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7457 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7508 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7514 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7604 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7642 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/TextureDetiler.hpp
core/libs/prx/libSceAgcDriver/Graphics/shaders/TextureDetile.comp
core/libs/prx/libSceAgcDriver/Graphics/src/TextureDetiler.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
PR 7668 core/libs/prx/libSceAgcDriver/Graphics/include/TextureDetiler.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/TextureDetiler.cpp
PR 7689 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 8246 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/TextureDetiler.hpp
core/libs/prx/libSceAgcDriver/Graphics/shaders/TextureDetile.comp
core/libs/prx/libSceAgcDriver/Graphics/src/TextureDetiler.cpp
PR 8484 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/TextureDetiler.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/TextureDetiler.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 8592 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 8707 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 9020 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 9335 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 9712 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 9852 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 9884 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 9898 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
PR 10049 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 10193 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/TextureDetiler.hpp
core/libs/prx/libSceAgcDriver/Graphics/shaders/TextureDetile.comp
core/libs/prx/libSceAgcDriver/Graphics/src/TextureDetiler.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
PR 10233 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 10359 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 10442 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 10757 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 10867 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 10920 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 11351 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 11485 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 11825 core/libs/prx/libSceAgcDriver/Graphics/include/TextureDetiler.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/TextureDetiler.cpp
PR 12120 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 12323 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 12324 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 12746 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 12828 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 12921 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
PR 13148 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 13262 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 13707 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 13863 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
PR 13920 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
PR 13928 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/TextureDetiler.hpp
core/libs/prx/libSceAgcDriver/Graphics/shaders/TextureDetile.comp
core/libs/prx/libSceAgcDriver/Graphics/src/TextureDetiler.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
PR 13929 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/TextureDetiler.hpp
core/libs/prx/libSceAgcDriver/Graphics/shaders/TextureDetile.comp
core/libs/prx/libSceAgcDriver/Graphics/src/TextureDetiler.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
PR 13963 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 14261 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
PR 14262 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
PR 14302 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake

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

@CnRJay CnRJay left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good PR: the microbenchmark is clear (buffer detile 1-byte SW_64KB_S 228.9 to 37.9 us, 6x; image retile 2.2x), unchanged SPIR-V for 4/8/16-byte elements is shown (0.98-1.05x), the fallback to the per-element atomic path keeps the bytes identical, and the test compares every byte against a CPU reference including bytes no element maps to.

  • The title runs (Minecraft Dungeons II, Sword of the Sea) show no change, which the description explains. The gain is therefore real only for titles that write back 1- or 2-byte standard-layout images each frame. Name one, or say it is a latent improvement; the speed-up claim in the title shouldn't read as a game-level one.
  • Two new shader variants (WORD_GROUPS, buffer and image) are compiled for every title that detiles 1- or 2-byte formats. Please state the extra compile time on a cold cache and whether the variants are built on first use or prewarmed (the journal/prewarm path has to know them, otherwise they compile on the queue worker at the first write-back).
  • The groups use workgroup shared memory and a barrier. Post the shared memory use per workgroup, since it caps occupancy on some devices (the RTX 4060 only was measured); an AMD or Intel run of agc_detile_small_elements would show the barrier path is correct there too.

@keravyn-ops

Copy link
Copy Markdown
Contributor

AMD / Windows run of this PR at 1061179: Radeon 780M (RDNA 3, 0x15bf), AMD driver 25.10.20.01 (32.0.21020.1007), Windows 11 Home 10.0.26100, WinLibs GCC 15.2.0 r7, Release.

  • agc_detile_small_elements: pass (0.65 s)
  • agc_driver_graphics: pass (4.95 s)
  • agc_unit_shadow, agc_shadowed_key_stores: pass
  • agc_storage_kept_unit_settle, agc_storage_baseline_settled, agc_storage_integer_clear, agc_storage_upload_lifetime, agc_storage_upload_failure, agc_storage_written_buffer_order, agc_storage_split_writeback, agc_storage_cpu_snapshot: pass

No benchmark run on this device.

AI-assisted: yes (runs made on the device above).

@parl0v

parl0v commented Oct 17, 2026

Copy link
Copy Markdown
Contributor Author

@CnRJay thanks for the review. On the three points:

Latent, not game-level. Agreed. I have no title yet whose frames are bound by 1- or 2-byte detiles: Minecraft Dungeons II and Sword of the Sea write back other formats each frame, so they show no change. I've changed the description to say that this is a throughput fix for those paths and that it makes no frame-rate claim. The title only names what the shader does.

Compile cost and prewarm.

  • The detiler pipelines are driver-internal and have never gone through the journal/prewarm path. TextureDetiler::pipeline creates each one on first use, keyed by (tile mode, element size, retile, thick, image), through context.pipelineCache, and that is unchanged here.
  • The word variants don't add pipelines. Each key selects exactly one variant (words = elementBytes < 4 && ...), so a title that detiles a 1-byte SW_64KB_S texture still creates one pipeline for that key, compiled from the word SPIR-V instead of the old one.
  • The added runtime cost is one vkCreateShaderModule per variant on first use. The difference in pipeline compile time is that of a shader with 3 shared arrays and a barrier over the same addressing code.
  • I'll measure the cold-cache vkCreateComputePipelines time for both variants on my RTX 4060 and post it here; my test box is off for the weekend.

Shared memory and other vendors. groupWords[32], groupLanes[32] and groupDestinations[64] are 128 uints, 512 bytes per 8x8 workgroup. That's 3 % of the 16 KiB Vulkan minimum for maxComputeSharedMemorySize, about 1 % of NVIDIA's 48 KiB and 0.8 % of the 64 KiB LDS on RDNA, so shared memory doesn't limit occupancy on any of them. On the barrier path on AMD: thanks @keravyn-ops for the Radeon 780M (RDNA 3) run at 1061179. agc_detile_small_elements passes there, and so do agc_driver_graphics, agc_unit_shadow and the storage tests. Intel hasn't been run yet.

AI-assisted: yes (Claude Code)

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 18, 2026

@jotitadev jotitadev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apple GPU run of the new word-group detile variants. This is a third vendor after NVIDIA and AMD, and Apple GPUs differ here in threadgroup memory and in subgroup width (32).

Machine: Apple M2 Max, macOS 27.2, x86-64 build under Rosetta. Head 1061179. Method: macos-port @ b7eb6b6 + ImportWatched + PR diff, not main. The shader, TextureDetiler.cpp and the shader build rules applied cleanly. Three conflicts came from code the port doesn't have, and I resolved them by hand:

  • TextureDetiler.hpp: added the two new module handles and kept the port's image descriptor pools (the port has no DescriptorRing).

  • CMakeLists.txt: added the agc_detile_small_elements test next to the port's tests.

  • Recorder.cpp: inserted the SmallElementDetileTest namespace and the --small-element-detile-only dispatch without the other recorder tests from main.

  • agc_detile_small_elements passes on MoltenVK 1.4.2 (small element detile tests passed) and on MoltenVK main + SPIRV-Cross #2704. With --repeat until-fail:10 it passes 10/10 on each driver.

  • The word path really runs on this device: with the whole-word store in TextureDetile.comp changed to groupWords[slot] ^ 1u (local mutation, reverted afterwards), the test fails at its first case: SW_64KB_S 1B 37x21, whole mip, buffer retile: byte 0 is 10, expected 11. So the host selects the word variant on Apple, and the test catches a wrong combined word.

  • Neighbouring tests pass: agc_storage_baseline_settled, agc_storage_upload_lifetime, agc_storage_upload_failure and agc_unit_shadow.

No timing measured.

GPUs tested: Apple M2 Max (MoltenVK 1.4.2 and MoltenVK main + SPIRV-Cross #2704)

Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.

@github-actions github-actions Bot added perf Performance change perf numbers missing perf pull request without a before and after summary line labels Oct 18, 2026
@parl0v
parl0v force-pushed the perf/detile-word-copies branch from 1061179 to 283b057 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):

@jotitadev

Copy link
Copy Markdown
Contributor

Follow-up to my Apple run above: the full suite, which I left out there, is now done.

Full ^agc suite with the PR on Apple M2 Max (MoltenVK 1.4.2, -j1 --timeout 30, flip/display/lds_atomics64 excluded; macos-port @ b7eb6b6 + ImportWatched + PR diff, not main): 14 failures out of 434, the same 14 as the unchanged port on this machine today (14 out of 433). The extra test is agc_detile_small_elements, which passes. No timeouts.

The new head 283b057 is a rebase: git range-diff against 1061179 shows only context lines from main, so this applies to it too.

Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.

@oneandonlydean oneandonlydean self-assigned this Oct 19, 2026
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 19, 2026
@parl0v
parl0v force-pushed the perf/detile-word-copies branch from 283b057 to 33b1953 Compare October 19, 2026 07:08
@github-actions github-actions Bot added needs rebase Conflicts with main, rebase needed and removed needs rebase Conflicts with main, rebase needed labels Oct 19, 2026
@oneandonlydean

Copy link
Copy Markdown
Collaborator

@parl0v this now conflicts with main in Graphics/src/TextureDetiler.cpp (around lines 171-182). #6436 merged today and routes every shader module creation through Graphics::CreateShaderModule(..., label), so modules are keyed by the pipeline-library mode. This PR still builds its word-variant modules inline with its own VkShaderModuleCreateInfo.

Could you rebase onto current main and create the word variants (words / imageWordModule) through CreateShaderModule, each with its own label? The other files merge cleanly. Once the head moves we'll re-review the delta and re-run CI.

@parl0v
parl0v force-pushed the perf/detile-word-copies branch from 33b1953 to f41aa95 Compare October 21, 2026 01:11
@parl0v

parl0v commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

@oneandonlydean rebased onto current main (f41aa95). The word variants now go through CreateShaderModule, each with its own label: vkCreateShaderModule detile words for the buffer word module and vkCreateShaderModule detile image words for imageWordModule; the existing image module keeps its label. Nothing else changed in the PR.

RTX 4060 (NVIDIA 617.42, Windows 10 19045), with VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1: agc_detile_small_elements, agc_import_watch and the other recorder/detile/retile tests pass (6 of 6), 0 VUID- lines, and the layer loaded.

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 21, 2026
@babyhuey

Copy link
Copy Markdown
Contributor

Linux run of this head f41aa959863, merged onto main 442c43a574d (clean merge, local only), with the selection CI's skipped Linux product job uses: anyps5-build CI image (Ubuntu 24.04, GCC 13, Release, BUILD_TESTING=ON), lavapipe with ANYPS5_REQUIRE_VULKAN=1 GALLIUM_OVERRIDE_CPU_CAPS=avx. The tree was configured fresh after the merge and built in full, then select_tests.py select / ninja -f select.ninja selected / --target libs / select_tests.py ctest --timeout 120.

  • Selected 1,506 tests: all pass. (main itself passes its full suite in this container.)

AI-assisted: yes (Claude Code)

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 29, 2026
@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head f41aa95 merged onto main 52c09d5 · tested 2026-10-29 10:05 UTC · 23 min

GPU NVIDIA RTX 2000 Ada Generation, driver 595.99.02, Vulkan 1.4.329
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-38-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 2,275 passed · 6 failed (0 new, 5 also fail on main, 1 unstable on main) · 39 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Test selection 2,320 of 2,873 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ✅ no new validation IDs vs main (894 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_bda_device 64.9 s, ⚠️ agc_driver_pipeline_journal 54.0 s
Unstable on main (1, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_submit_progress: failed in 2 of the last 4 main runs
Failing on main too (5, not counted against this PR)
agc_compute_pipeline_inspection
agc_submit_progress
agc_submit_progress_no_timeline
guest_mmap_executable
guest_socket_options_multicast
Validated but not compared (1, not in the main baseline's validation pass)
agc_detile_small_elements
Validation IDs already present on main (4 IDs in 436 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (436 tests): agc_compute_pipeline_replay, agc_driver, agc_driver_address_passes_draw_transitions, agc_driver_address_passes_targets_split, agc_driver_alias_copy_label, agc_driver_array_layer_target, agc_driver_array_layer_target_cpu, agc_driver_bda_anchor_reads, and 428 more
VUID-vkCmdCopyImage-srcImage-01548 (11 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_cpu_write_after_memo, agc_driver_depth_plane_cpu_write_after_page_unwatch, agc_driver_depth_plane_cpu_write_after_partial_unwatch, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_partial_store_unimported, agc_driver_depth_storage_dispatch, and 3 more
VUID-vkCmdCopyImage-srcImage-01551 (11 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_cpu_write_after_memo, agc_driver_depth_plane_cpu_write_after_page_unwatch, agc_driver_depth_plane_cpu_write_after_partial_unwatch, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_partial_store_unimported, agc_driver_depth_storage_dispatch, and 3 more
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (2 tests): agc_driver_prepared_exports, agc_driver_srgb8_color_target
Skipped (39)
agc_driver_bda_reads_shadowed_results: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_bda_reads_shadowed_results_per_build: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_msaa_dcc_compared_import_2: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_msaa_dcc_compared_import_4: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_msaa_dcc_compared_import_8: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_sample_order_grid_reference: skipped, the device does not keep depth drawn at custom sample locations at those locations, even after a transition that names them: the composite of uniform renders holds the guest's depth in 0 of 3005 sloped samples, so no path can be compared with it bit for bit
agc_driver_sparse_dma_buf_import: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_stencil_ref_export: skipped, the device lacks VK_EXT_shader_stencil_export
agc_host_import_sparse: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_import_settle_initial_dcc: skipped, the device has no deferred settle of host imports: imports under 1 MiB wait for one only on Windows
agc_unit_shadow_completion_store: skipped, the device reports watched host memory written when it imports or reads it
guest_net_ctl: skipped, the host has no IPv4 address
guest_video_out_color_space: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_hdr: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_high_frame_rate: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_output_mode: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_resolution_status: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_wqhd_detection: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
video_out_flip_controls: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip_in_order: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_aftergpu: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_main: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_fresh: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_labels: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SD
Reproduce
git fetch origin f41aa959863fd49eb84c33f3e34131ac67bc032c 52c09d567d2fa453494dd720fcf53a98149468e4
git checkout 52c09d567d2fa453494dd720fcf53a98149468e4 && git merge --no-ff f41aa959863fd49eb84c33f3e34131ac67bc032c
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
VK_DRIVER_FILES=/nonexistent/icd.json ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 32 --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 4 --output-on-failure
# failures are then re-run alone: --timeout 360 --parallel 2; new validation IDs: the test alone, twice, --parallel 1

Automated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs.

# Conflicts:
#	core/libs/prx/libSceAgcDriver/CMakeLists.txt
#	core/libs/prx/libSceAgcDriver/Graphics/shaders/TextureDetile.comp
@fogydes

fogydes commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Verdict: should-fix

  1. [verified] Freshness & Clean Merge: Head commit 2afe6febaedba0cb30cab6024276bb1175ccef73 merges cleanly with origin/main (git merge-tree --write-tree origin/main pull/6905 exited 0 with clean tree d9d949512d4ec0ec0d77157b77115609930e8e8e), only 141 commits behind origin/main.
  2. [verified] Conventions & Commits: python tools/check_conventions.py --base c674f8c14da93df7a6b37657117ca3f58357477f passed with 0 findings in an isolated worktree. The branch history includes a non-conventional merge commit 2afe6febae (Merge main into perf/detile-word-copies) that should be rebased cleanly or squashed onto the root feature commit.
  3. [read-only] Checklist Template Compliance: The checklist in the PR description omits the - [ ] Fixes: <!-- issue it closes as Fixes #N, or none --> line from .github/pull_request_template.md. Per repository conventions, all template lines must be retained and ticked (e.g., - [x] Fixes: none).
  4. [author-reported] Performance Evidence & Testing: Author supplied detailed microbenchmark timings demonstrating 2.2x to 6.0x throughput speedups on 1-byte and 2-byte detile paths on RTX 4060, along with title trace summaries on RTX 3060 and passing device tests in agc_detile_small_elements.

Freshness Envelope

  • Head SHA: 2afe6febaedba0cb30cab6024276bb1175ccef73
  • Merge-base: c674f8c14da93df7a6b37657117ca3f58357477f
  • Behind count: 141 commits behind origin/main
  • Merge-tree result: exit 0 (clean tree d9d949512d4ec0ec0d77157b77115609930e8e8e)

Cross-PR Ledger

@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head 2afe6fe merged onto main d5ec8e6 · tested 2026-11-01 12:46 UTC · 23 min

GPU NVIDIA RTX 2000 Ada Generation, driver 595.99.02, Vulkan 1.4.329
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-38-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 2,487 passed · 5 failed (0 new, 3 also fail on main, 2 unstable on main) · 45 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Test selection 2,537 of 3,148 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ✅ no new validation IDs vs main (934 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 120.2 s, ⚠️ agc_driver_interpolation_modes 44.2 s, ⚠️ agc_driver_lazy_resolved_abi 34.1 s, ⚠️ agc_driver_graphics_maps_fallback 30.8 s
Unstable on main (2, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_pipeline_journal: failed in 1 of the last 10 main runs
agc_submit_progress: failed in 6 of the last 10 main runs
Failing on main too (3, not counted against this PR)
agc_driver_image_table
guest_mmap_executable
guest_socket_options_multicast
Validated but not compared (1, not in the main baseline's validation pass)
agc_detile_small_elements
Validation IDs already present on main (5 IDs in 484 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (484 tests): agc_driver, agc_driver_address_passes, agc_driver_alias_copy_label, agc_driver_alpha_to_coverage, agc_driver_array_layer_target, agc_driver_bc_block_copy, agc_driver_bda_anchor_reads, agc_driver_bda_span_reads, and 476 more
VUID-vkCmdCopyImage-srcImage-01548 (7 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_sampling, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-vkCmdCopyImage-srcImage-01551 (7 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_sampling, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (1 test): agc_driver_prepared_exports
VUID-VkShaderModuleCreateInfo-pCode-08737 (1 test): agc_driver_image_sample_derivatives
Skipped (45)
agc_driver_bda_reads_shadowed_results: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_bda_reads_shadowed_results_per_build: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_sample_order_grid_reference: skipped, the device does not keep depth drawn at custom sample locations at those locations, even after a transition that names them: the composite of uniform renders holds the guest's depth in 0 of 3005 sloped samples, so no path can be compared with it bit for bit
agc_host_import_sparse: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_import_settle_initial_dcc: skipped, the device has no deferred settle of host imports: imports under 1 MiB wait for one only on Windows
agc_unit_shadow_completion_store: skipped, the device reports watched host memory written when it imports or reads it
guest_http_uri_locale: 
guest_net_ctl: skipped, the host has no IPv4 address
guest_video_out_color_space: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_hdr: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_high_frame_rate: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_output_mode: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_resolution_status: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_wqhd_detection: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
video_out_flip_aftergpu: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_backtoback: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_controls: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip_in_order: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_dcc: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_deferred: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_aftergpu: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_main: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_fps_limit: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_o
Reproduce
git fetch origin 2afe6febaedba0cb30cab6024276bb1175ccef73 d5ec8e6575be37f4340ded9c64c51b1d07076b51
git checkout d5ec8e6575be37f4340ded9c64c51b1d07076b51 && git merge --no-ff 2afe6febaedba0cb30cab6024276bb1175ccef73
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
VK_DRIVER_FILES=/nonexistent/icd.json ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 32 --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 4 --output-on-failure
# failures are then re-run alone: --timeout 360 --parallel 2; new validation IDs: the test alone, twice, --parallel 1

Automated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs.

@oneandonlydean
oneandonlydean merged commit 37c53ef into boykopovar:main Nov 3, 2026
11 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants