Repository navigation
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Change: Refactor Merge Risk:
|
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
The change at head 4f8114c4e597c916fcb852efea61f623f4ce2c5e bounds the copied write-back reference to the span covering declared writes, and the reviewed code and test support the change.
What I ran
Read-only source inspection at the exact head using repo_read.py. No test or build was run. The author reports Windows 11 Vulkan measurements and validation-layer runs; those were not run by me.
repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp 5700 5720
repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp 7290 7350
repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp 7574 7688
repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp 8750 8840
repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp 8990 9165
repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp 540 590
repo_read.py cat core/libs/prx/libSceAgcDriver/tests/Recorder.cpp 1120 1255
Results
| Check | Result | Note |
|---|---|---|
| Changed code review | passed | Relevant changed functions and test read |
| Tests and build | not run | No runtime verification |
| Author performance report | not run | Reported results inspected in description |
Negative control
Not run; no test was executed.
Findings
Blocking
None.
Non-blocking
None.
Sources
copyRegionrecords the original bytes covering intersecting writes and stores that span's base.WriteBackoffsets comparisons from the recorded base.- The recorder test checks writes outside the writable view remain intact.
Not verified
The reported Windows performance and Vulkan validation runs were not reproduced; the referenced evidence archive was not available in the prepared review files. Unrelated portions of the large GuestBufferMemory.cpp file were not read. files.json lists three reviewed files and no excluded files; the changed hunks and relevant context were read for all three.
To get this to a good state
Nothing is required.
There was a problem hiding this comment.
I tried merging the current #28193 and this head and confirmed the conflict in GuestBufferMemory::WriteBack. When rebasing after #28193, please retain both the reference offset based on uploadedBegin and PerformanceTrace::Transferred(BufferWriteBack, length). Keeping the old offset would compare the wrong original bytes whenever the writable view starts inside the buffer.
Ran the same copied write-back, writer-label drain, and GCN scalar-buffer CTests on main and this head integrated using lavapipe. All three passed on both runs. The logs show the requested Khronos validation 1.4.369 being inserted, with no missing-layer diagnostic or VUID- messages. The tests verify correctness on Linux with the shader cache disabled.
AI-assisted: yes.
|
Linux check at head
Setup: Linux 7.3.6, RX 6650 XT (RADV, Mesa 26.3.1), Release build of the PR merged onto current AI-assisted: yes |
|
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.
|
|
Tested
GPU (software Vulkan): 17 GPU tests (AGC) passed twice on Mesa lavapipe (Mesa 25.2.8-0ubuntu0.24.04.5 (LLVM 20.1.2)) on a GitHub-hosted Ubuntu 24.04 runner, with the Khronos validation layer on and the shader cache off, alongside main Not covered: GPU hardware. lavapipe runs Vulkan on the CPU, so this says nothing about how real GPU drivers handle the changed paths. AI-assisted: yes (Claude Code); the runs are automated, this summary was written from their reports. |
What
While PPSA38500 was loading a save on Windows, a 2,718 MiB copied buffer also retained 2,718 MiB of original CPU bytes for write-back whenever any declared shader write overlapped it. One frequently used writable view covered 174 MiB.
For a dense copied buffer, save the original bytes from the first intersecting writable address through the last and record that span's base. Write-back compares each declared write against the matching offset and preserves newer CPU writes. Disjoint writable spans retain the bytes between them. The full dense buffer still uploads to the GPU.
The proposed merge order is #28193 first. It adds a transfer counter immediately after the same write-back call. #23596 stages the GPU result before comparison and can use the same bounded reference when it is rebased.
Tested
On Windows 11, NVIDIA RTX 3080 Laptop, driver 621.14, a synthetic Vulkan test used a 128 MiB readable buffer with an 8 MiB writable view starting 2 MiB inside it. Each displayed frame ran four compute dispatches and checked the result, a newer CPU write inside the view and CPU bytes at both ends of the buffer. Each arm verified 264 dispatches, including 192 in the same 48-frame capture after 16 warm-up frames.
Resources.Complete, mean per frame from the native traceThe traces and fixture patches are in dense-writeback-vulkan-evidence.zip. Production revisions were
d3132e1c907banda70eef404212. The two clean trace revisions below include the test-only workload. Both used the same finished-batch release policy because the test holds the GPU mutex for its entire run.Both production revisions passed
agc_copied_write_backandagc_driver_copied_writer_label_order_drainon this GPU with the Vulkan instance and device validation layers active. All four executions passed with zero skips and zero Vulkan validation errors.At 1920×1080 with the same PPSA38500 save, the integrated change kept 174 MiB for 14 of 17 logged uploads of the 2,718 MiB buffer. Other writes in the same load needed roughly 66 or 1,673 MiB. The median for all work in the six earlier upload batches was 4,632.5 ms, compared with 1,315 ms for the 17 later batches. The earlier run also replayed 64 graphics pipelines at startup and the later run replayed zero. These observations measure save loading. A separate world-load timeout still occurred.
Native performance summaries, 2026-12-03, Windows and RTX 3080 Laptop
{"commit":"f5dfe24dfb1c","dirty":false,"env":{"APS5_RELEASE_UNDER_LOCK":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_FRAMES":"17:48"},"gpu":"NVIDIA GeForce RTX 3080 Laptop GPU","driver":"NVIDIA 621.14","os":"Windows 10.0.26300","cpu":"12th Gen Intel(R) Core(TM) i7-12700H","cpu_threads":20,"memory_mib":32472,"resolution":"320x180","window":{"spec":"frames 17:48","first_present":17,"ms":8839.842},"presents":48,"frame_ms":{"p50":183.375,"p90":190.554,"p99":211.074,"max":211.074},"gpu_busy_ms_per_present":0.000,"worker_busy_pct":{},"phase_totals_ms":{"DisplayBuffer.Decode":118.960,"DisplayBuffer.Decode.detile_convert":118.160,"DisplayBuffer.Decode.validate_allocate":0.785,"Driver.Present":190.831,"Driver.Present.acquire_image":0.828,"Driver.Present.device_setup":0.021,"Driver.Present.gpu_mutex_wait":0.054,"Driver.Present.inflight_wait":0.137,"Driver.Present.present_display_buffer":125.352,"Driver.Present.queue_present":6.548,"Driver.Present.release_and_callback":0.026,"Driver.Present.render_fence_wait":57.564,"Driver.Present.resize":0.219,"Driver.Present.validate":0.042,"Recorder.Submit":11.792,"Recorder.Sync":219.576,"Resources.Complete":7005.081,"Resources.Prepare":6.191,"Vulkan.Acquire":0.808,"Vulkan.Acquire.acquire_fence_wait":0.173,"Vulkan.Acquire.acquire_image":0.498,"Vulkan.Acquire.fence_reset":0.118,"Vulkan.Acquire.retired_swapchains":0.013,"Vulkan.Present":5.170,"Vulkan.Present.command_record_scale":2.223,"Vulkan.Present.pixel_upload":0.673,"Vulkan.Present.queue_submit":2.259,"Vulkan.QueuePresent":6.513,"Vulkan.QueuePresent.queue_present":6.496,"Vulkan.Retire":57.631,"Vulkan.Retire.wait":57.220},"top_phases_ms_per_frame":{"Resources.Complete":145.939,"Recorder.Sync":4.575,"Driver.Present":3.976,"Driver.Present.present_display_buffer":2.611,"DisplayBuffer.Decode":2.478,"DisplayBuffer.Decode.detile_convert":2.462,"Vulkan.Retire":1.201,"Driver.Present.render_fence_wait":1.199},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.present-blit":96},"trace_dropped":false,"trace":"aps5-trace-f5dfe24dfb1c-2712.json.gz"}{"commit":"ff9d71633d35","dirty":false,"env":{"APS5_RELEASE_UNDER_LOCK":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_FRAMES":"17:48"},"gpu":"NVIDIA GeForce RTX 3080 Laptop GPU","driver":"NVIDIA 621.14","os":"Windows 10.0.26300","cpu":"12th Gen Intel(R) Core(TM) i7-12700H","cpu_threads":20,"memory_mib":32472,"resolution":"320x180","window":{"spec":"frames 17:48","first_present":17,"ms":3727.726},"presents":48,"frame_ms":{"p50":75.489,"p90":87.848,"p99":97.634,"max":97.634},"gpu_busy_ms_per_present":0.000,"worker_busy_pct":{},"phase_totals_ms":{"DisplayBuffer.Decode":121.209,"DisplayBuffer.Decode.detile_convert":120.437,"DisplayBuffer.Decode.validate_allocate":0.760,"Driver.Present":163.432,"Driver.Present.acquire_image":0.751,"Driver.Present.device_setup":0.017,"Driver.Present.gpu_mutex_wait":0.050,"Driver.Present.inflight_wait":0.138,"Driver.Present.present_display_buffer":127.519,"Driver.Present.queue_present":6.488,"Driver.Present.release_and_callback":0.033,"Driver.Present.render_fence_wait":28.154,"Driver.Present.resize":0.197,"Driver.Present.validate":0.036,"Recorder.Submit":10.987,"Recorder.Sync":129.602,"Resources.Complete":2861.756,"Resources.Prepare":5.826,"Vulkan.Acquire":0.734,"Vulkan.Acquire.acquire_fence_wait":0.107,"Vulkan.Acquire.acquire_image":0.489,"Vulkan.Acquire.fence_reset":0.124,"Vulkan.Acquire.retired_swapchains":0.008,"Vulkan.Present":5.119,"Vulkan.Present.command_record_scale":2.247,"Vulkan.Present.pixel_upload":0.624,"Vulkan.Present.queue_submit":2.235,"Vulkan.QueuePresent":6.457,"Vulkan.QueuePresent.queue_present":6.440,"Vulkan.Retire":28.219,"Vulkan.Retire.wait":27.864},"top_phases_ms_per_frame":{"Resources.Complete":59.620,"Driver.Present":3.405,"Recorder.Sync":2.700,"Driver.Present.present_display_buffer":2.657,"DisplayBuffer.Decode":2.525,"DisplayBuffer.Decode.detile_convert":2.509,"Vulkan.Retire":0.588,"Driver.Present.render_fence_wait":0.587},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.present-blit":96},"trace_dropped":false,"trace":"aps5-trace-ff9d71633d35-26780.json.gz"}Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Summary by CodeRabbit