perf(agc): memoize the per-use write checks of native multisample targets #18288

Merged
JJenkx merged 1 commit from upstream-pr/18288 into main 2026-11-12 20:06:32 +00:00
JJenkx commented 2026-11-11 03:29:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-11-11T03:29:27Z.


What

A resident native multisample target is checked on every use for CPU writes over its planes: DepthSurface::CheckCurrent walks each of its ranges, and MultisampleTarget::checkDccCurrent its DCC and FMASK ranges, with CollectWritesUncached. Each walk is a PAGEMAP_SCAN over the whole plane. A 4K 4x depth plane is about 106 MiB, so each walk is cheap, but these checks run on every draw that uses the target, and in a title that samples its depth target on most draws the walks are most of the draw thread's time.

These three walks only decide whether to refuse the target because the guest wrote over it. This PR makes them use the memoized CollectWrites. Within one collect epoch, a range already walked is not walked again. A CPU write that lands between two collects of one epoch is seen at the next ordering point, which is the ordering GuestMemory.hpp states real hardware gives a CPU write made while a submission runs. So a write ordered before the draw is still refused at this check, and a later unordered one at the next use after an ordering point. The uncached walks that decide which bytes to keep stay as they are: those in CheckCurrent's clear-proof paths, in publication and in stores. #18102 makes the same argument for the walk in StorageTexture::markLayersPending.

Threads that never bump an epoch get a fresh epoch for every collect, so nothing changes there; the native multisample unit tests run on such threads, so they exercise the same walks as before.

Tested

Linux 7.2.14, Ryzen 9 7950X, RX 6650 XT (RADV NAVI23, Mesa 26.2.6), GCC 16.2.1, Release. main is f0bb282eed, this change is d1b5779bcb on it.

GPU tests. The same focused tests on both, ctest -V -R '^(agc_driver_graphics.*|agc_driver_.*(depth|stencil|multisample|msaa|sample|dcc|fmask|collect|memo).*)$' with VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ANYPS5_NO_SHADER_CACHE=1 and ANYPS5_REQUIRE_VULKAN=1: main 192 of 192. This change: 192 of 192. No VUID- lines and no was not found but was requested in any log. The same set on the earlier base fb26c5e4e0 (190 tests) also passed on both sides, twice for the change.

Snoopy & The Great Mystery Club (PPSA28795), the first backyard scene, where the native multisample depth target is sampled on most draws. Cross every 15 s from 30 s, APS5_PLAYGO_UNLISTED_CHUNKS=installed, 140 s runs in A, B, B, A order, a 20 s trace from 100 s (APS5_TRACE_SECONDS=100:20), a screenshot at 110 s.

run build FPS 60-100 s frame p50 ms p90 p99 GPU busy ms/present
A1 main 9.65 195.1 217.5 241.7 92.6
B2 change 12.36 93.6 112.7 123.6 68.8
B3 change 11.98 90.7 99.6 120.5 65.9
A4 main 6.78 195.1 237.0 259.6 92.9
  • In the traces of A1 and B2, the draw committer is busy 138.0 ms per frame on main (Graphics.Draw 129.9 ms) and 27.8 ms with the change (Graphics.Draw 20.7 ms). The graphics queue worker, which waits for the committer, goes from 91.6 to 21.3 ms.
  • The four screenshots at 110 s show the same frame: the mean absolute error between arms (0.00019 to 0.00042) is in the range of the error within an arm (0.00021 and 0.00037). No run aborted; all four exited at the scheduled close.
  • The same order on the earlier base fb26c5e4e0 gave the same split (frame p50 199.3 and 196.7 ms against 89.0 and 92.5 ms).

Bugsnax (PPSA01503), a title whose log shows multisampled colour targets, as a check on another title. Same input and timing:

run build FPS 60-100 s frame p50 ms p90 p99 GPU busy ms/present
A1 main 19.38 48.4 54.5 62.1 42.4
B2 change 20.68 47.6 52.9 56.3 42.2
B3 change 21.93 47.6 53.0 58.7 42.1
A4 main 21.75 48.7 55.6 63.1 42.3

No change beyond run-to-run spread; this title is GPU-bound.

Traces, summaries and screenshots: evidence/msaa-memo-20261111. Summary lines:

Snoopy (A1, B2, B3, A4)
{"commit":"f0bb282eed24","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_PLAYGO_UNLISTED_CHUNKS":"installed","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"100:20"},"gpu":"AMD Radeon RX 6650 XT (RADV NAVI23)","driver":"radv Mesa 26.2.6-arch1.1","os":"Linux 7.2.14-arch1-1","cpu":"AMD Ryzen 9 7950X 16-Core Processor","cpu_threads":32,"memory_mib":127901,"title_id":"PPSA28795","title":"Snoopy & The Great Mystery Club","content_version":"01.000.002","resolution":"3840x2160","window":{"spec":"seconds 100:20","first_present":1554,"ms":20007.781},"presents":101,"frame_ms":{"p50":195.131,"p90":217.523,"p99":241.704,"max":243.099},"gpu_busy_ms_per_present":92.606,"worker_busy_pct":{"queue worker 0x0":93.711},"top_phases_ms_per_frame":{"Driver.Packet":185.636,"Driver.Packet.draw":180.105,"Driver.Draw":179.572,"Graphics.Draw":143.039,"Graphics.Draw.draw_and_resource_release":132.545,"Driver.Draw.device_setup":125.705,"Driver.Draw.shader_compile_and_link":33.192,"Shader.DrawStage":21.388},"owned_draw_counts":{},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":10.857,"events_lost":221851,"totals_full":false}},"trace":"aps5-trace-f0bb282eed24-723611.json.gz"}
{"commit":"d1b5779bcbcd","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_PLAYGO_UNLISTED_CHUNKS":"installed","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"100:20"},"gpu":"AMD Radeon RX 6650 XT (RADV NAVI23)","driver":"radv Mesa 26.2.6-arch1.1","os":"Linux 7.2.14-arch1-1","cpu":"AMD Ryzen 9 7950X 16-Core Processor","cpu_threads":32,"memory_mib":127901,"title_id":"PPSA28795","title":"Snoopy & The Great Mystery Club","content_version":"01.000.002","resolution":"3840x2160","window":{"spec":"seconds 100:20","first_present":1939,"ms":20079.008},"presents":208,"frame_ms":{"p50":93.601,"p90":112.728,"p99":123.589,"max":124.357},"gpu_busy_ms_per_present":68.834,"worker_busy_pct":{"queue worker 0x0":88.952},"top_phases_ms_per_frame":{"Driver.Packet":85.867,"Driver.Packet.draw":80.671,"Driver.Draw":80.209,"Graphics.Draw":39.578,"Driver.Draw.device_setup":31.322,"Graphics.Draw.draw_and_resource_release":30.312,"Driver.Draw.shader_compile_and_link":30.074,"Shader.DrawStage":19.113},"owned_draw_counts":{},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":6.291,"events_lost":603358,"totals_full":false}},"trace":"aps5-trace-d1b5779bcbcd-770969.json.gz"}
{"commit":"d1b5779bcbcd","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_PLAYGO_UNLISTED_CHUNKS":"installed","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"100:20"},"gpu":"AMD Radeon RX 6650 XT (RADV NAVI23)","driver":"radv Mesa 26.2.6-arch1.1","os":"Linux 7.2.14-arch1-1","cpu":"AMD Ryzen 9 7950X 16-Core Processor","cpu_threads":32,"memory_mib":127901,"title_id":"PPSA28795","title":"Snoopy & The Great Mystery Club","content_version":"01.000.002","resolution":"3840x2160","window":{"spec":"seconds 100:20","first_present":1911,"ms":20072.737},"presents":219,"frame_ms":{"p50":90.715,"p90":99.634,"p99":120.489,"max":121.408},"gpu_busy_ms_per_present":65.925,"worker_busy_pct":{"queue worker 0x0":88.396},"top_phases_ms_per_frame":{"Driver.Packet":81.019,"Driver.Packet.draw":76.130,"Driver.Draw":75.699,"Graphics.Draw":36.827,"Driver.Draw.device_setup":29.852,"Graphics.Draw.draw_and_resource_release":28.152,"Driver.Draw.shader_compile_and_link":27.945,"Shader.DrawStage":17.782},"owned_draw_counts":{},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":6.149,"events_lost":591008,"totals_full":false}},"trace":"aps5-trace-d1b5779bcbcd-819171.json.gz"}
{"commit":"f0bb282eed24","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_PLAYGO_UNLISTED_CHUNKS":"installed","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"100:20"},"gpu":"AMD Radeon RX 6650 XT (RADV NAVI23)","driver":"radv Mesa 26.2.6-arch1.1","os":"Linux 7.2.14-arch1-1","cpu":"AMD Ryzen 9 7950X 16-Core Processor","cpu_threads":32,"memory_mib":127901,"title_id":"PPSA28795","title":"Snoopy & The Great Mystery Club","content_version":"01.000.002","resolution":"3840x2160","window":{"spec":"seconds 100:20","first_present":1387,"ms":20108.597},"presents":99,"frame_ms":{"p50":195.070,"p90":236.978,"p99":259.562,"max":259.562},"gpu_busy_ms_per_present":92.853,"worker_busy_pct":{"queue worker 0x0":93.990},"top_phases_ms_per_frame":{"Driver.Packet":190.909,"Driver.Packet.draw":185.172,"Driver.Draw":184.559,"Graphics.Draw":146.522,"Graphics.Draw.draw_and_resource_release":135.615,"Driver.Draw.device_setup":128.822,"Driver.Draw.shader_compile_and_link":34.148,"Shader.DrawStage":21.948},"owned_draw_counts":{},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":10.810,"events_lost":222354,"totals_full":false}},"trace":"aps5-trace-f0bb282eed24-866443.json.gz"}
Bugsnax (A1, B2, B3, A4)
{"commit":"f0bb282eed24","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_PLAYGO_UNLISTED_CHUNKS":"installed","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"100:20"},"gpu":"AMD Radeon RX 6650 XT (RADV NAVI23)","driver":"radv Mesa 26.2.6-arch1.1","os":"Linux 7.2.14-arch1-1","cpu":"AMD Ryzen 9 7950X 16-Core Processor","cpu_threads":32,"memory_mib":127901,"title_id":"PPSA01503","title":"Bugsnax","content_version":"02.000.000","resolution":"3840x2160","window":{"spec":"seconds 100:20","first_present":2141,"ms":20016.455},"presents":407,"frame_ms":{"p50":48.392,"p90":54.488,"p99":62.125,"max":71.656},"gpu_busy_ms_per_present":42.370,"worker_busy_pct":{"queue worker 0x0":54.812},"top_phases_ms_per_frame":{"Driver.Packet":26.955,"Driver.Packet.draw":23.504,"Driver.Draw":23.283,"VideoOut.Flip":21.746,"Driver.Present":21.734,"VideoOut.Flip.present":21.683,"Driver.Present.render_fence_wait":21.392,"Vulkan.Retire":21.392},"owned_draw_counts":{},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":12.744,"events_lost":169432,"totals_full":false}},"trace":"aps5-trace-f0bb282eed24-913572.json.gz"}
{"commit":"d1b5779bcbcd","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_PLAYGO_UNLISTED_CHUNKS":"installed","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"100:20"},"gpu":"AMD Radeon RX 6650 XT (RADV NAVI23)","driver":"radv Mesa 26.2.6-arch1.1","os":"Linux 7.2.14-arch1-1","cpu":"AMD Ryzen 9 7950X 16-Core Processor","cpu_threads":32,"memory_mib":127901,"title_id":"PPSA01503","title":"Bugsnax","content_version":"02.000.000","resolution":"3840x2160","window":{"spec":"seconds 100:20","first_present":2048,"ms":20013.711},"presents":417,"frame_ms":{"p50":47.575,"p90":52.906,"p99":56.276,"max":58.772},"gpu_busy_ms_per_present":42.154,"worker_busy_pct":{"queue worker 0x0":53.309},"top_phases_ms_per_frame":{"Driver.Packet":25.583,"Driver.Packet.draw":22.242,"Driver.Draw":22.030,"VideoOut.Flip":21.945,"Driver.Present":21.932,"VideoOut.Flip.present":21.885,"Driver.Present.render_fence_wait":21.590,"Vulkan.Retire":21.589},"owned_draw_counts":{},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":13.016,"events_lost":145379,"totals_full":false}},"trace":"aps5-trace-d1b5779bcbcd-961073.json.gz"}
{"commit":"d1b5779bcbcd","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_PLAYGO_UNLISTED_CHUNKS":"installed","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"100:20"},"gpu":"AMD Radeon RX 6650 XT (RADV NAVI23)","driver":"radv Mesa 26.2.6-arch1.1","os":"Linux 7.2.14-arch1-1","cpu":"AMD Ryzen 9 7950X 16-Core Processor","cpu_threads":32,"memory_mib":127901,"title_id":"PPSA01503","title":"Bugsnax","content_version":"02.000.000","resolution":"3840x2160","window":{"spec":"seconds 100:20","first_present":2231,"ms":20000.916},"presents":415,"frame_ms":{"p50":47.622,"p90":53.038,"p99":58.738,"max":68.293},"gpu_busy_ms_per_present":42.078,"worker_busy_pct":{"queue worker 0x0":53.053},"top_phases_ms_per_frame":{"Driver.Packet":25.567,"Driver.Packet.draw":22.258,"VideoOut.Flip":22.154,"Driver.Present":22.146,"VideoOut.Flip.present":22.095,"Driver.Draw":22.045,"Driver.Present.render_fence_wait":21.806,"Vulkan.Retire":21.805},"owned_draw_counts":{},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":13.253,"events_lost":131960,"totals_full":false}},"trace":"aps5-trace-d1b5779bcbcd-1007450.json.gz"}
{"commit":"f0bb282eed24","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_PLAYGO_UNLISTED_CHUNKS":"installed","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"100:20"},"gpu":"AMD Radeon RX 6650 XT (RADV NAVI23)","driver":"radv Mesa 26.2.6-arch1.1","os":"Linux 7.2.14-arch1-1","cpu":"AMD Ryzen 9 7950X 16-Core Processor","cpu_threads":32,"memory_mib":127901,"title_id":"PPSA01503","title":"Bugsnax","content_version":"02.000.000","resolution":"3840x2160","window":{"spec":"seconds 100:20","first_present":2305,"ms":20041.207},"presents":406,"frame_ms":{"p50":48.681,"p90":55.607,"p99":63.080,"max":67.545},"gpu_busy_ms_per_present":42.310,"worker_busy_pct":{"queue worker 0x0":55.544},"top_phases_ms_per_frame":{"Driver.Packet":27.416,"Driver.Packet.draw":23.884,"Driver.Draw":23.652,"VideoOut.Flip":21.430,"Driver.Present":21.425,"VideoOut.Flip.present":21.371,"Driver.Present.render_fence_wait":21.051,"Vulkan.Retire":21.051},"owned_draw_counts":{},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":11.619,"events_lost":172139,"totals_full":false}},"trace":"aps5-trace-f0bb282eed24-1054457.json.gz"}

Windows, AMD (reviewer run): @Ethan-Hainline ran this head merged onto main 22cc516f87 on Windows 11 with a Radeon Vega (GCN, AMD 23.19.24.04) and Khronos validation 1.4.363.1: agc_driver_cached_image_multisample_guard, agc_driver_native_multisample_depth and agc_driver_native_depth_separate_stencil passed 3 of 3 each, with no VUID- lines. That was those three tests, not the full set above.

Not verified: other GPUs and drivers, the full test set on Windows, and macOS.

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
  • Fixes: none
  • Unblocks: none
  • GPUs tested: AMD Radeon RX 6650 XT (RADV NAVI23), Mesa 26.2.6, Linux 7.2.14
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5253266288 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18288). Originally posted by [JJenkx](https://github.com/JJenkx) on 2026-11-11T03:29:27Z. --- ### What A resident native multisample target is checked on every use for CPU writes over its planes: `DepthSurface::CheckCurrent` walks each of its ranges, and `MultisampleTarget::checkDccCurrent` its DCC and FMASK ranges, with `CollectWritesUncached`. Each walk is a `PAGEMAP_SCAN` over the whole plane. A 4K 4x depth plane is about 106 MiB, so each walk is cheap, but these checks run on every draw that uses the target, and in a title that samples its depth target on most draws the walks are most of the draw thread's time. These three walks only decide whether to refuse the target because the guest wrote over it. This PR makes them use the memoized `CollectWrites`. Within one collect epoch, a range already walked is not walked again. A CPU write that lands between two collects of one epoch is seen at the next ordering point, which is the ordering `GuestMemory.hpp` states real hardware gives a CPU write made while a submission runs. So a write ordered before the draw is still refused at this check, and a later unordered one at the next use after an ordering point. The uncached walks that decide which bytes to keep stay as they are: those in `CheckCurrent`'s clear-proof paths, in publication and in stores. #18102 makes the same argument for the walk in `StorageTexture::markLayersPending`. Threads that never bump an epoch get a fresh epoch for every collect, so nothing changes there; the native multisample unit tests run on such threads, so they exercise the same walks as before. ### Tested Linux 7.2.14, Ryzen 9 7950X, RX 6650 XT (RADV NAVI23, Mesa 26.2.6), GCC 16.2.1, Release. `main` is `f0bb282eed`, this change is `d1b5779bcb` on it. **GPU tests.** The same focused tests on both, `ctest -V -R '^(agc_driver_graphics.*|agc_driver_.*(depth|stencil|multisample|msaa|sample|dcc|fmask|collect|memo).*)$'` with `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, `ANYPS5_NO_SHADER_CACHE=1` and `ANYPS5_REQUIRE_VULKAN=1`: `main` 192 of 192. This change: 192 of 192. No `VUID-` lines and no `was not found but was requested` in any log. The same set on the earlier base `fb26c5e4e0` (190 tests) also passed on both sides, twice for the change. **Snoopy & The Great Mystery Club (PPSA28795)**, the first backyard scene, where the native multisample depth target is sampled on most draws. Cross every 15 s from 30 s, `APS5_PLAYGO_UNLISTED_CHUNKS=installed`, 140 s runs in A, B, B, A order, a 20 s trace from 100 s (`APS5_TRACE_SECONDS=100:20`), a screenshot at 110 s. | run | build | FPS 60-100 s | frame p50 ms | p90 | p99 | GPU busy ms/present | |---|---|---|---|---|---|---| | A1 | `main` | 9.65 | 195.1 | 217.5 | 241.7 | 92.6 | | B2 | change | 12.36 | 93.6 | 112.7 | 123.6 | 68.8 | | B3 | change | 11.98 | 90.7 | 99.6 | 120.5 | 65.9 | | A4 | `main` | 6.78 | 195.1 | 237.0 | 259.6 | 92.9 | - In the traces of A1 and B2, the draw committer is busy 138.0 ms per frame on `main` (`Graphics.Draw` 129.9 ms) and 27.8 ms with the change (`Graphics.Draw` 20.7 ms). The graphics queue worker, which waits for the committer, goes from 91.6 to 21.3 ms. - The four screenshots at 110 s show the same frame: the mean absolute error between arms (0.00019 to 0.00042) is in the range of the error within an arm (0.00021 and 0.00037). No run aborted; all four exited at the scheduled close. - The same order on the earlier base `fb26c5e4e0` gave the same split (frame p50 199.3 and 196.7 ms against 89.0 and 92.5 ms). **Bugsnax (PPSA01503)**, a title whose log shows multisampled colour targets, as a check on another title. Same input and timing: | run | build | FPS 60-100 s | frame p50 ms | p90 | p99 | GPU busy ms/present | |---|---|---|---|---|---|---| | A1 | `main` | 19.38 | 48.4 | 54.5 | 62.1 | 42.4 | | B2 | change | 20.68 | 47.6 | 52.9 | 56.3 | 42.2 | | B3 | change | 21.93 | 47.6 | 53.0 | 58.7 | 42.1 | | A4 | `main` | 21.75 | 48.7 | 55.6 | 63.1 | 42.3 | No change beyond run-to-run spread; this title is GPU-bound. Traces, summaries and screenshots: [`evidence/msaa-memo-20261111`](https://github.com/JJenkx/AnyPS5/tree/faed6d2c38929b7dd3f09efc92f70722c6bee180). Summary lines: <details><summary>Snoopy (A1, B2, B3, A4)</summary> ``` {"commit":"f0bb282eed24","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_PLAYGO_UNLISTED_CHUNKS":"installed","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"100:20"},"gpu":"AMD Radeon RX 6650 XT (RADV NAVI23)","driver":"radv Mesa 26.2.6-arch1.1","os":"Linux 7.2.14-arch1-1","cpu":"AMD Ryzen 9 7950X 16-Core Processor","cpu_threads":32,"memory_mib":127901,"title_id":"PPSA28795","title":"Snoopy & The Great Mystery Club","content_version":"01.000.002","resolution":"3840x2160","window":{"spec":"seconds 100:20","first_present":1554,"ms":20007.781},"presents":101,"frame_ms":{"p50":195.131,"p90":217.523,"p99":241.704,"max":243.099},"gpu_busy_ms_per_present":92.606,"worker_busy_pct":{"queue worker 0x0":93.711},"top_phases_ms_per_frame":{"Driver.Packet":185.636,"Driver.Packet.draw":180.105,"Driver.Draw":179.572,"Graphics.Draw":143.039,"Graphics.Draw.draw_and_resource_release":132.545,"Driver.Draw.device_setup":125.705,"Driver.Draw.shader_compile_and_link":33.192,"Shader.DrawStage":21.388},"owned_draw_counts":{},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":10.857,"events_lost":221851,"totals_full":false}},"trace":"aps5-trace-f0bb282eed24-723611.json.gz"} {"commit":"d1b5779bcbcd","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_PLAYGO_UNLISTED_CHUNKS":"installed","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"100:20"},"gpu":"AMD Radeon RX 6650 XT (RADV NAVI23)","driver":"radv Mesa 26.2.6-arch1.1","os":"Linux 7.2.14-arch1-1","cpu":"AMD Ryzen 9 7950X 16-Core Processor","cpu_threads":32,"memory_mib":127901,"title_id":"PPSA28795","title":"Snoopy & The Great Mystery Club","content_version":"01.000.002","resolution":"3840x2160","window":{"spec":"seconds 100:20","first_present":1939,"ms":20079.008},"presents":208,"frame_ms":{"p50":93.601,"p90":112.728,"p99":123.589,"max":124.357},"gpu_busy_ms_per_present":68.834,"worker_busy_pct":{"queue worker 0x0":88.952},"top_phases_ms_per_frame":{"Driver.Packet":85.867,"Driver.Packet.draw":80.671,"Driver.Draw":80.209,"Graphics.Draw":39.578,"Driver.Draw.device_setup":31.322,"Graphics.Draw.draw_and_resource_release":30.312,"Driver.Draw.shader_compile_and_link":30.074,"Shader.DrawStage":19.113},"owned_draw_counts":{},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":6.291,"events_lost":603358,"totals_full":false}},"trace":"aps5-trace-d1b5779bcbcd-770969.json.gz"} {"commit":"d1b5779bcbcd","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_PLAYGO_UNLISTED_CHUNKS":"installed","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"100:20"},"gpu":"AMD Radeon RX 6650 XT (RADV NAVI23)","driver":"radv Mesa 26.2.6-arch1.1","os":"Linux 7.2.14-arch1-1","cpu":"AMD Ryzen 9 7950X 16-Core Processor","cpu_threads":32,"memory_mib":127901,"title_id":"PPSA28795","title":"Snoopy & The Great Mystery Club","content_version":"01.000.002","resolution":"3840x2160","window":{"spec":"seconds 100:20","first_present":1911,"ms":20072.737},"presents":219,"frame_ms":{"p50":90.715,"p90":99.634,"p99":120.489,"max":121.408},"gpu_busy_ms_per_present":65.925,"worker_busy_pct":{"queue worker 0x0":88.396},"top_phases_ms_per_frame":{"Driver.Packet":81.019,"Driver.Packet.draw":76.130,"Driver.Draw":75.699,"Graphics.Draw":36.827,"Driver.Draw.device_setup":29.852,"Graphics.Draw.draw_and_resource_release":28.152,"Driver.Draw.shader_compile_and_link":27.945,"Shader.DrawStage":17.782},"owned_draw_counts":{},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":6.149,"events_lost":591008,"totals_full":false}},"trace":"aps5-trace-d1b5779bcbcd-819171.json.gz"} {"commit":"f0bb282eed24","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_PLAYGO_UNLISTED_CHUNKS":"installed","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"100:20"},"gpu":"AMD Radeon RX 6650 XT (RADV NAVI23)","driver":"radv Mesa 26.2.6-arch1.1","os":"Linux 7.2.14-arch1-1","cpu":"AMD Ryzen 9 7950X 16-Core Processor","cpu_threads":32,"memory_mib":127901,"title_id":"PPSA28795","title":"Snoopy & The Great Mystery Club","content_version":"01.000.002","resolution":"3840x2160","window":{"spec":"seconds 100:20","first_present":1387,"ms":20108.597},"presents":99,"frame_ms":{"p50":195.070,"p90":236.978,"p99":259.562,"max":259.562},"gpu_busy_ms_per_present":92.853,"worker_busy_pct":{"queue worker 0x0":93.990},"top_phases_ms_per_frame":{"Driver.Packet":190.909,"Driver.Packet.draw":185.172,"Driver.Draw":184.559,"Graphics.Draw":146.522,"Graphics.Draw.draw_and_resource_release":135.615,"Driver.Draw.device_setup":128.822,"Driver.Draw.shader_compile_and_link":34.148,"Shader.DrawStage":21.948},"owned_draw_counts":{},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":10.810,"events_lost":222354,"totals_full":false}},"trace":"aps5-trace-f0bb282eed24-866443.json.gz"} ``` </details> <details><summary>Bugsnax (A1, B2, B3, A4)</summary> ``` {"commit":"f0bb282eed24","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_PLAYGO_UNLISTED_CHUNKS":"installed","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"100:20"},"gpu":"AMD Radeon RX 6650 XT (RADV NAVI23)","driver":"radv Mesa 26.2.6-arch1.1","os":"Linux 7.2.14-arch1-1","cpu":"AMD Ryzen 9 7950X 16-Core Processor","cpu_threads":32,"memory_mib":127901,"title_id":"PPSA01503","title":"Bugsnax","content_version":"02.000.000","resolution":"3840x2160","window":{"spec":"seconds 100:20","first_present":2141,"ms":20016.455},"presents":407,"frame_ms":{"p50":48.392,"p90":54.488,"p99":62.125,"max":71.656},"gpu_busy_ms_per_present":42.370,"worker_busy_pct":{"queue worker 0x0":54.812},"top_phases_ms_per_frame":{"Driver.Packet":26.955,"Driver.Packet.draw":23.504,"Driver.Draw":23.283,"VideoOut.Flip":21.746,"Driver.Present":21.734,"VideoOut.Flip.present":21.683,"Driver.Present.render_fence_wait":21.392,"Vulkan.Retire":21.392},"owned_draw_counts":{},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":12.744,"events_lost":169432,"totals_full":false}},"trace":"aps5-trace-f0bb282eed24-913572.json.gz"} {"commit":"d1b5779bcbcd","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_PLAYGO_UNLISTED_CHUNKS":"installed","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"100:20"},"gpu":"AMD Radeon RX 6650 XT (RADV NAVI23)","driver":"radv Mesa 26.2.6-arch1.1","os":"Linux 7.2.14-arch1-1","cpu":"AMD Ryzen 9 7950X 16-Core Processor","cpu_threads":32,"memory_mib":127901,"title_id":"PPSA01503","title":"Bugsnax","content_version":"02.000.000","resolution":"3840x2160","window":{"spec":"seconds 100:20","first_present":2048,"ms":20013.711},"presents":417,"frame_ms":{"p50":47.575,"p90":52.906,"p99":56.276,"max":58.772},"gpu_busy_ms_per_present":42.154,"worker_busy_pct":{"queue worker 0x0":53.309},"top_phases_ms_per_frame":{"Driver.Packet":25.583,"Driver.Packet.draw":22.242,"Driver.Draw":22.030,"VideoOut.Flip":21.945,"Driver.Present":21.932,"VideoOut.Flip.present":21.885,"Driver.Present.render_fence_wait":21.590,"Vulkan.Retire":21.589},"owned_draw_counts":{},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":13.016,"events_lost":145379,"totals_full":false}},"trace":"aps5-trace-d1b5779bcbcd-961073.json.gz"} {"commit":"d1b5779bcbcd","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_PLAYGO_UNLISTED_CHUNKS":"installed","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"100:20"},"gpu":"AMD Radeon RX 6650 XT (RADV NAVI23)","driver":"radv Mesa 26.2.6-arch1.1","os":"Linux 7.2.14-arch1-1","cpu":"AMD Ryzen 9 7950X 16-Core Processor","cpu_threads":32,"memory_mib":127901,"title_id":"PPSA01503","title":"Bugsnax","content_version":"02.000.000","resolution":"3840x2160","window":{"spec":"seconds 100:20","first_present":2231,"ms":20000.916},"presents":415,"frame_ms":{"p50":47.622,"p90":53.038,"p99":58.738,"max":68.293},"gpu_busy_ms_per_present":42.078,"worker_busy_pct":{"queue worker 0x0":53.053},"top_phases_ms_per_frame":{"Driver.Packet":25.567,"Driver.Packet.draw":22.258,"VideoOut.Flip":22.154,"Driver.Present":22.146,"VideoOut.Flip.present":22.095,"Driver.Draw":22.045,"Driver.Present.render_fence_wait":21.806,"Vulkan.Retire":21.805},"owned_draw_counts":{},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":13.253,"events_lost":131960,"totals_full":false}},"trace":"aps5-trace-d1b5779bcbcd-1007450.json.gz"} {"commit":"f0bb282eed24","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_PLAYGO_UNLISTED_CHUNKS":"installed","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"100:20"},"gpu":"AMD Radeon RX 6650 XT (RADV NAVI23)","driver":"radv Mesa 26.2.6-arch1.1","os":"Linux 7.2.14-arch1-1","cpu":"AMD Ryzen 9 7950X 16-Core Processor","cpu_threads":32,"memory_mib":127901,"title_id":"PPSA01503","title":"Bugsnax","content_version":"02.000.000","resolution":"3840x2160","window":{"spec":"seconds 100:20","first_present":2305,"ms":20041.207},"presents":406,"frame_ms":{"p50":48.681,"p90":55.607,"p99":63.080,"max":67.545},"gpu_busy_ms_per_present":42.310,"worker_busy_pct":{"queue worker 0x0":55.544},"top_phases_ms_per_frame":{"Driver.Packet":27.416,"Driver.Packet.draw":23.884,"Driver.Draw":23.652,"VideoOut.Flip":21.430,"Driver.Present":21.425,"VideoOut.Flip.present":21.371,"Driver.Present.render_fence_wait":21.051,"Vulkan.Retire":21.051},"owned_draw_counts":{},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":11.619,"events_lost":172139,"totals_full":false}},"trace":"aps5-trace-f0bb282eed24-1054457.json.gz"} ``` </details> **Windows, AMD (reviewer run):** [@Ethan-Hainline](https://github.com/boykopovar/AnyPS5/pull/18288#issuecomment-6788246753) ran this head merged onto `main` `22cc516f87` on Windows 11 with a Radeon Vega (GCN, AMD 23.19.24.04) and Khronos validation 1.4.363.1: `agc_driver_cached_image_multisample_guard`, `agc_driver_native_multisample_depth` and `agc_driver_native_depth_separate_stencil` passed 3 of 3 each, with no `VUID-` lines. That was those three tests, not the full set above. **Not verified:** other GPUs and drivers, the full test set on Windows, and macOS. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: AMD Radeon RX 6650 XT (RADV NAVI23), Mesa 26.2.6, Linux 7.2.14 - [x] AI-assisted: yes
MarcZX10 commented 2026-11-12 18:04:32 +00:00 (Migrated from github.com)

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

Review: COMMENTED


Reviewed — no blocking findings

Nothing blocks this; the points below are optional.

What I ran

  • Head: d1b5779bcbcdad5082933516caf2d6965e01cce1, base main.
  • Read the description, commit list, manifest and diff from the console run folder, then the house-rule sections of the reviewer prompt.
  • Read the changed hunks with surrounding context, and the callers and definitions they depend on, through the repository reader:
python3 repo_read.py search CollectWrites
python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp 58 80
python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp 128 156
python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp 2060 2085
python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp 770 800
python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp 870 900
python3 repo_read.py search BumpCollectEpoch
  • I did not build or run any test.

Results

Check Result Note
Diff read passed 2 files, 3 changed lines
Changed hunks read in context passed Not whole files
Build and tests not run Author-reported only
Performance captures not run Author-reported only
Reader output used for the review

The commands are listed under What I ran. Their output is the repository text at the head SHA; nothing was edited.

Findings

Blocking

  • None verified.

Non-blocking

  • core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp:785 and core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp:883 and :895: the three checks now use the epoch memo, so a second walk of the same range in one epoch is skipped. The diff adds no test for this changed call path. The existing CollectMemoGeneration.cpp tests cover the memo itself, and DepthSurfaceReuse.cpp bumps epochs, but I did not confirm that any test reaches these three call sites on a thread that bumps its epoch.

Sources

Not verified

  • The author's argument that a CPU write made during a running submission is refused at the next ordering point. I read the header's statement of the ordering rule; I did not check the hardware behaviour it relies on.
  • The author's GPU test results (192 of 192 on both sides) and the Snoopy and Bugsnax frame-rate numbers. These are author-reported. I did not run them or open the evidence branch.
  • The Windows run by another contributor (three tests, Radeon Vega). Author-reported; not reproduced.
  • Other GPUs, drivers, macOS, and the full test set on Windows.
  • Whether existing tests reach the memo-hit path at the three changed call sites.
  • Files: files.json lists DepthSurface.cpp and MultisampleTarget.cpp as reviewed. I read only the changed regions with context, not the whole files.

To get this to a good state

Nothing is required.

Optional:

  • Add a test that calls one of the changed checks twice in one epoch with a CPU write between the calls, on a thread that bumps its epoch.
  • Replace the evidence branch link with a commit-pinned link.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5879552204 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18288#pullrequestreview-5879552204). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-12T18:04:32Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing blocks this; the points below are optional. ## What I ran - Head: `d1b5779bcbcdad5082933516caf2d6965e01cce1`, base `main`. - Read the description, commit list, manifest and diff from the console run folder, then the house-rule sections of the reviewer prompt. - Read the changed hunks with surrounding context, and the callers and definitions they depend on, through the repository reader: ``` python3 repo_read.py search CollectWrites python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp 58 80 python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp 128 156 python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp 2060 2085 python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp 770 800 python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp 870 900 python3 repo_read.py search BumpCollectEpoch ``` - I did not build or run any test. ## Results | Check | Result | Note | |---|---|---| | Diff read | passed | 2 files, 3 changed lines | | Changed hunks read in context | passed | Not whole files | | Build and tests | not run | Author-reported only | | Performance captures | not run | Author-reported only | <details> <summary>Reader output used for the review</summary> The commands are listed under What I ran. Their output is the repository text at the head SHA; nothing was edited. </details> ## Findings **Blocking** - None verified. **Non-blocking** - `core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp:785` and `core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp:883` and `:895`: the three checks now use the epoch memo, so a second walk of the same range in one epoch is skipped. The diff adds no test for this changed call path. The existing `CollectMemoGeneration.cpp` tests cover the memo itself, and `DepthSurfaceReuse.cpp` bumps epochs, but I did not confirm that any test reaches these three call sites on a thread that bumps its epoch. ## Sources - Memo semantics and ordering points: [`GuestMemory.hpp` lines 131–145 at the head](https://github.com/boykopovar/AnyPS5/blob/d1b5779bcbcdad5082933516caf2d6965e01cce1/core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp#L131-L145). - `CollectWritesUncached` is documented for decisions about pending GPU results: [same header, lines 135–137](https://github.com/boykopovar/AnyPS5/blob/d1b5779bcbcdad5082933516caf2d6965e01cce1/core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp#L135-L137). - The changed refusal checks: [`DepthSurface.cpp` 785](https://github.com/boykopovar/AnyPS5/blob/d1b5779bcbcdad5082933516caf2d6965e01cce1/core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp#L785), [`MultisampleTarget.cpp` 883](https://github.com/boykopovar/AnyPS5/blob/d1b5779bcbcdad5082933516caf2d6965e01cce1/core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp#L883) and [895](https://github.com/boykopovar/AnyPS5/blob/d1b5779bcbcdad5082933516caf2d6965e01cce1/core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp#L895). - The description's evidence link points to a moving branch (`tree/evidence/msaa-memo-20261111`), not to a commit-pinned permalink. ## Not verified - The author's argument that a CPU write made during a running submission is refused at the next ordering point. I read the header's statement of the ordering rule; I did not check the hardware behaviour it relies on. - The author's GPU test results (192 of 192 on both sides) and the Snoopy and Bugsnax frame-rate numbers. These are author-reported. I did not run them or open the evidence branch. - The Windows run by another contributor (three tests, Radeon Vega). Author-reported; not reproduced. - Other GPUs, drivers, macOS, and the full test set on Windows. - Whether existing tests reach the memo-hit path at the three changed call sites. - Files: `files.json` lists `DepthSurface.cpp` and `MultisampleTarget.cpp` as reviewed. I read only the changed regions with context, not the whole files. ## To get this to a good state Nothing is required. Optional: - Add a test that calls one of the changed checks twice in one epoch with a CPU write between the calls, on a thread that bumps its epoch. - Replace the evidence branch link with a commit-pinned link.
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!18288
No description provided.