perf(agc): keep staged buffer copies inside a dispatch run #9287

Merged
Celegans12 merged 2 commits from upstream-pr/9287 into main 2026-11-02 07:57:25 +00:00
Celegans12 commented 2026-10-21 17:28:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Celegans12 on 2026-10-21T17:28:45Z.


What

Stacked on #9176; please review the last commit only.

Staged buffer copies no longer split otherwise independent dispatch runs. Record copy-ins inside the run, defer copy-backs until its barrier, and retain the existing range/owner conflicts. A reused build closes a run that still owes its copy-backs before refilling its shadow. Host-visible GPU copies stay outside runs.

Batching copy-ins ahead of the run remains the next PR.

Tested

Windows 11, MinGW-w64 GCC 15.2.0, Release, -DBUILD_TESTING=ON, SPIR-V Tools off; based on main a043b048db. 030c4bb2d00d: agc_driver_overlap_staged_copies, 1/1 NVIDIA and 1/1 Windows lavapipe, once each. Build/registration pass; Vulkan required, cache off, Khronos 1.4.363 loaded, no skips/VUIDs/sync diagnostics; 30 s local limit.

Historical Yōtei 1.008 title-menu counters (2026-10-24) omit CPU and other worker/phase fields: full baseline, full change. They do not establish an FPS gain.

Not tested in this carry: Linux, macOS, titles/FPS or console behavior. Earlier negative controls are historical.

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: #9176
  • Fixes: none
  • Unblocks: none
  • GPUs tested: NVIDIA RTX 3080 Laptop, 610.62, Windows 11; Mesa lavapipe, LLVM 22.1.8, Windows 11
  • AI-assisted: yes
Historical summary excerpts; all retained values unchanged
{"commit":"a147cc357739","dirty":false,"env":{"APS5_NO_CLEAR_HAND_OVER":"1","APS5_NO_DEFERRED_SETTLES":"1","APS5_NO_PAD_INPUT":"1","APS5_NO_PIPELINE_JOURNAL":"1","APS5_NO_RESIDENT_LINEAR":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_RESOURCE_CACHE_ENTRIES":"1024","APS5_TRACE_FRAMES":"150:60"},"gpu":"NVIDIA GeForce RTX 3080 Laptop GPU","driver":"NVIDIA 610.62","os":"Windows 10.0.26200","resolution":"3840x2160","window":{"spec":"frames 150:60","first_present":150,"ms":12217.213},"presents":60,"frame_ms":{"p50":132.067,"p90":416.048,"p99":2879.104,"max":2879.104},"gpu_busy_ms_per_present":81.511,"trace_dropped":false,"trace":"aps5-trace-a147cc357739-23988.json.gz","worker_busy_pct":{"queue worker 0x0":57.048},"top_phases_ms_per_frame":{"Driver.Packet":360.996}}
{"commit":"35c81bc26549","dirty":false,"env":{"APS5_NO_CLEAR_HAND_OVER":"1","APS5_NO_DEFERRED_SETTLES":"1","APS5_NO_PAD_INPUT":"1","APS5_NO_PIPELINE_JOURNAL":"1","APS5_NO_RESIDENT_LINEAR":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_RESOURCE_CACHE_ENTRIES":"1024","APS5_TRACE_FRAMES":"150:60"},"gpu":"NVIDIA GeForce RTX 3080 Laptop GPU","driver":"NVIDIA 610.62","os":"Windows 10.0.26200","resolution":"3840x2160","window":{"spec":"frames 150:60","first_present":150,"ms":11552.961},"presents":60,"frame_ms":{"p50":130.028,"p90":371.139,"p99":2398.352,"max":2398.352},"gpu_busy_ms_per_present":77.231,"trace_dropped":false,"trace":"aps5-trace-35c81bc26549-25072.json.gz","worker_busy_pct":{"queue worker 0x0":59.199},"top_phases_ms_per_frame":{"Driver.Packet":356.521}}
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4955669979 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9287). Originally posted by [Celegans12](https://github.com/Celegans12) on 2026-10-21T17:28:45Z. --- ### What Stacked on #9176; please review the last commit only. Staged buffer copies no longer split otherwise independent dispatch runs. Record copy-ins inside the run, defer copy-backs until its barrier, and retain the existing range/owner conflicts. A reused build closes a run that still owes its copy-backs before refilling its shadow. Host-visible GPU copies stay outside runs. Batching copy-ins ahead of the run remains the next PR. ### Tested Windows 11, MinGW-w64 GCC 15.2.0, Release, `-DBUILD_TESTING=ON`, SPIR-V Tools off; based on `main` a043b048db8b. `030c4bb2d00d`: `agc_driver_overlap_staged_copies`, 1/1 NVIDIA and 1/1 Windows lavapipe, once each. Build/registration pass; Vulkan required, cache off, Khronos 1.4.363 loaded, no skips/VUIDs/sync diagnostics; 30 s local limit. Historical Yōtei 1.008 title-menu counters (2026-10-24) omit CPU and other worker/phase fields: [full baseline](https://raw.githubusercontent.com/Celegans12/AnyPS5/bringup-media/traces/title-2026-10-24/pl-9176-1/aps5-summary.jsonl), [full change](https://raw.githubusercontent.com/Celegans12/AnyPS5/bringup-media/traces/title-2026-10-24/pl-9287-1/aps5-summary.jsonl). They do not establish an FPS gain. Not tested in this carry: Linux, macOS, titles/FPS or console behavior. Earlier negative controls are historical. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [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: #9176 - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: NVIDIA RTX 3080 Laptop, 610.62, Windows 11; Mesa lavapipe, LLVM 22.1.8, Windows 11 - [x] AI-assisted: yes <details><summary>Historical summary excerpts; all retained values unchanged</summary> ```json {"commit":"a147cc357739","dirty":false,"env":{"APS5_NO_CLEAR_HAND_OVER":"1","APS5_NO_DEFERRED_SETTLES":"1","APS5_NO_PAD_INPUT":"1","APS5_NO_PIPELINE_JOURNAL":"1","APS5_NO_RESIDENT_LINEAR":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_RESOURCE_CACHE_ENTRIES":"1024","APS5_TRACE_FRAMES":"150:60"},"gpu":"NVIDIA GeForce RTX 3080 Laptop GPU","driver":"NVIDIA 610.62","os":"Windows 10.0.26200","resolution":"3840x2160","window":{"spec":"frames 150:60","first_present":150,"ms":12217.213},"presents":60,"frame_ms":{"p50":132.067,"p90":416.048,"p99":2879.104,"max":2879.104},"gpu_busy_ms_per_present":81.511,"trace_dropped":false,"trace":"aps5-trace-a147cc357739-23988.json.gz","worker_busy_pct":{"queue worker 0x0":57.048},"top_phases_ms_per_frame":{"Driver.Packet":360.996}} {"commit":"35c81bc26549","dirty":false,"env":{"APS5_NO_CLEAR_HAND_OVER":"1","APS5_NO_DEFERRED_SETTLES":"1","APS5_NO_PAD_INPUT":"1","APS5_NO_PIPELINE_JOURNAL":"1","APS5_NO_RESIDENT_LINEAR":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_RESOURCE_CACHE_ENTRIES":"1024","APS5_TRACE_FRAMES":"150:60"},"gpu":"NVIDIA GeForce RTX 3080 Laptop GPU","driver":"NVIDIA 610.62","os":"Windows 10.0.26200","resolution":"3840x2160","window":{"spec":"frames 150:60","first_present":150,"ms":11552.961},"presents":60,"frame_ms":{"p50":130.028,"p90":371.139,"p99":2398.352,"max":2398.352},"gpu_busy_ms_per_present":77.231,"trace_dropped":false,"trace":"aps5-trace-35c81bc26549-25072.json.gz","worker_busy_pct":{"queue worker 0x0":59.199},"top_phases_ms_per_frame":{"Driver.Packet":356.521}} ``` </details>
github-actions[bot] commented 2026-10-21 17:29:01 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-21T17:29:01Z.


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.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6322297837 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9287#issuecomment-6322297837). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-21T17:29:01Z. --- <!-- pr-labels-perf --> 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`.
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!9287
No description provided.