perf(agc): stage the written elements of address-based compute builds in device memory #8104

Merged
Celegans12 merged 1 commit from upstream-pr/8104 into main 2026-10-23 11:28:30 +00:00
Celegans12 commented 2026-10-19 21:49:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Celegans12 on 2026-10-19T21:49:19Z.


What

An address-based (BDA) compute build binds its written V# elements in place in the host imports of the cached address space, and its BDA table points there too, so every access to them goes over PCIe. Descriptor builds already stage written elements in device memory (stagingEligible); address-based ones were left out because their pointers would still reach the import.

  • A written range inside one import region of the space becomes a region of its own (Region::overlay), staged like any written element (copy-in, device-local shadow, copy-back).
  • AddressRanges cuts the import's table entry around it, so pointers into the element reach the shadow as its descriptor does.
  • resolveOverlays keeps a cluster of overlapping overlays only inside one direct import region, when stagingEligible holds and no in-place range or own region crosses it; otherwise it stays in the import.
  • Dispatches under APS5_BDA_STAGING_MIN_THREADS (512) threads keep the imports (a 64-thread solver got 9 % slower on our bench). APS5_NO_BDA_STAGING=1 turns it off.

A CPU store into a staged element before its copy-back is rolled back, the trade-off main already accepts for staged elements; it is now listed in the libSceAgcDriver debt file, and the staging comments describe the overlay case.

Related: #7618 changes the window in stagingEligible, which the clusters reuse; #6185 would apply to these copy-backs too.

Tested

  • Windows 11, MinGW-w64 GCC 15.2.0, based on main bf2c63f85, -DBUILD_TESTING=ON: full ctest 1685/1690 (before a clean rebase from 252cbc29b); the same 5 fail on main here. The staging tests pass after the rebase (8/8, --repeat until-fail:3).
  • New agc_bda_staging (table cut, shadow binding, copy-back bytes, a crossing read keeps the import) fails with main's code: "the staged element's BDA range does not send its addresses to the shadow".
  • With the validation layer, ANYPS5_NO_SHADER_CACHE=1, ANYPS5_REQUIRE_VULKAN=1: seven staging tests show no VUID- errors on main or the branch.
  • Linux (WSL, gcc 13.3, lavapipe), CI's job on the merge: 1644/1662; the 18 failures are the same on main.
  • Speed, from our Ghost of Yōtei (PPSA26344) tree, not main: the cloth solver (0x80001c0d00) went from 5.6 to 1.8 ms GPU per dispatch on our bench (same output), and from 308 to 103 ms per present in the world. No main summary lines for that scene.
  • Not tested: AMD, Intel, console behaviour.

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: NVIDIA GeForce RTX 3080 Laptop GPU, driver 610.62, Windows 11; lavapipe (Mesa 25.2.8) on Ubuntu 24.04 (WSL)
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4927888498 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8104). Originally posted by [Celegans12](https://github.com/Celegans12) on 2026-10-19T21:49:19Z. --- ### What An address-based (BDA) compute build binds its written V# elements in place in the host imports of the cached address space, and its BDA table points there too, so every access to them goes over PCIe. Descriptor builds already stage written elements in device memory (`stagingEligible`); address-based ones were left out because their pointers would still reach the import. - A written range inside one import region of the space becomes a region of its own (`Region::overlay`), staged like any written element (copy-in, device-local shadow, copy-back). - `AddressRanges` cuts the import's table entry around it, so pointers into the element reach the shadow as its descriptor does. - `resolveOverlays` keeps a cluster of overlapping overlays only inside one direct import region, when `stagingEligible` holds and no in-place range or own region crosses it; otherwise it stays in the import. - Dispatches under `APS5_BDA_STAGING_MIN_THREADS` (512) threads keep the imports (a 64-thread solver got 9 % slower on our bench). `APS5_NO_BDA_STAGING=1` turns it off. A CPU store into a staged element before its copy-back is rolled back, the trade-off main already accepts for staged elements; it is now listed in the libSceAgcDriver debt file, and the staging comments describe the overlay case. Related: #7618 changes the window in `stagingEligible`, which the clusters reuse; #6185 would apply to these copy-backs too. ### Tested - Windows 11, MinGW-w64 GCC 15.2.0, based on `main` bf2c63f85, -DBUILD_TESTING=ON: full ctest 1685/1690 (before a clean rebase from 252cbc29b); the same 5 fail on `main` here. The staging tests pass after the rebase (8/8, `--repeat until-fail:3`). - New `agc_bda_staging` (table cut, shadow binding, copy-back bytes, a crossing read keeps the import) fails with `main`'s code: "the staged element's BDA range does not send its addresses to the shadow". - With the validation layer, `ANYPS5_NO_SHADER_CACHE=1`, `ANYPS5_REQUIRE_VULKAN=1`: seven staging tests show no `VUID-` errors on `main` or the branch. - Linux (WSL, gcc 13.3, lavapipe), CI's job on the merge: 1644/1662; the 18 failures are the same on `main`. - Speed, from our Ghost of Yōtei (PPSA26344) tree, not `main`: the cloth solver (0x80001c0d00) went from 5.6 to 1.8 ms GPU per dispatch on our bench (same output), and from 308 to 103 ms per present in the world. No `main` summary lines for that scene. - Not tested: AMD, Intel, console behaviour. ### 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: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: NVIDIA GeForce RTX 3080 Laptop GPU, driver 610.62, Windows 11; lavapipe (Mesa 25.2.8) on Ubuntu 24.04 (WSL) - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-19 21:49:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-19T21:49:31Z.


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:6278156624 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8104#issuecomment-6278156624). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-19T21:49:31Z. --- <!-- 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`.
Celegans12 commented 2026-10-19 23:49:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Celegans12 on 2026-10-19T23:49:30Z.


There are no main numbers on this one yet, I'm afraid. What I have are two summary lines from our Yōtei tree: the same build, scene, machine and environment, with this change switched off (APS5_NO_BDA_STAGING=1, run gl3-off) and on (run gl2). Over presents 880-891, frame p50 went from 2,828 to 2,536 ms and GPU busy from 1,166 to 884 ms per present. Most of that is the cloth solver (0x80001c0d00): 308 ms of GPU time per present in our baseline run, 103 ms with the change.

Some caveats. Our tree isn't main (it has bindless images, spanned waves and other local changes). The off run also had our local dispatch overlap switched off. That shouldn't matter, because the on run had per-range GPU timestamps on, and those serialize every dispatch anyway (they can only add time).

For main against this branch I need a Yōtei run on main, and the machine is busy with other game work right now. I'll do that pair when it's free and post both lines here. If the two traces behind the lines below would help in the meantime, I can attach them.

Summary lines (our tree, not main)

Off (gl3-off):

{"commit":"e4c3f92833c2","dirty":true,"env":{"APS5_BINDLESS_IMAGES":"1","APS5_BINDLESS_LAZY":"1","APS5_BINDLESS_STATS":"1","APS5_CACHE_SPIRV_BACKING":"1","APS5_COLD_SPIRV":"1","APS5_COLD_SPIRV_FILE":"1","APS5_DUMP_FRAMES":"300","APS5_DUMP_FRAMES_EVERY":"10","APS5_INLINE_SHADER_PREPARE":"1","APS5_MEM_STATS":"10","APS5_NO_ADDRESS_DRAW_REUSE":"1","APS5_NO_BDA_STAGING":"1","APS5_NO_DISPATCH_OVERLAP":"1","APS5_NO_RESULT_MEMO":"1","APS5_PAD_SCRIPT":"100:cross,106:cross,112:cross,118:cross,124:cross,130:cross,136:cross,142:cross,148:cross,154:cross,160:cross,166:cross,172:cross,178:cross,184:cross,190:cross,196:cross,202:cross,208:cross,214:cross,220:cross,226:cross,232:cross,238:cross,244:cross,250:cross,256:cross,262:cross,268:cross,274:cross,280:cross,286:cross,292:cross,298:cross,304:cross,310:cross,316:cross,322:cross,328:cross,334:cross,340:cross,346:cross,352:cross,358:cross,364:cross,370:cross,376:cross,382:cross,388:cross,394:cross,400:cross,406:cross,412:cross,418:cross,424:cross,430:cross,436:cross,442:cross,448:cross,454:cross,460:cross,466:cross,472:cross,478:cross,484:cross,490:cross,496:cross,502:cross,508:cross,514:cross,520:cross,526:cross,532:cross,538:cross,544:cross,550:cross,556:cross,562:cross,568:cross,574:cross,580:cross","APS5_PAD_SCRIPT_REPEAT":"","APS5_PIPELINE_INDIRECT":"1","APS5_PROFILE_DRAW":"1","APS5_PROFILE_GPU":"0","APS5_SPANNED_WAVE":"1","APS5_STAGING_DIFF":"1","APS5_TEXTURE_OVERFLOW_MIB":"1024","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"1048576","APS5_TRACE_FRAMES":"880:12","APS5_UNNORM_WRAP_GUARD":"1"},"gpu":"NVIDIA GeForce RTX 3080 Laptop GPU","driver":"NVIDIA 610.62","os":"Windows 10.0.26200","resolution":"3840x2160","window":{"spec":"frames 880:12","first_present":880,"ms":33783.045},"presents":12,"frame_ms":{"p50":2828.218,"p90":2852.442,"p99":2970.761,"max":2970.761},"gpu_busy_ms_per_present":1165.540,"worker_busy_pct":{"queue worker 0x0":94.455,"queue worker 0x52":46.627,"queue worker 0x20":53.321,"queue worker 0x53":44.933,"queue worker 0x30":81.537,"queue worker 0x48":4.039,"queue worker 0x38":81.989,"queue worker 0x51":9.991,"queue worker 0x50":47.958},"top_phases_ms_per_frame":{"Driver.Packet":13063.476,"Driver.Packet.memory_wait":8232.995,"Driver.Packet.dispatch":2105.551,"DrawPipeline.commit":1806.241,"Driver.Dispatch":1767.588,"Graphics.Draw":1660.976,"Driver.Packet.draw":1536.653,"Graphics.Draw.draw_and_resource_release":1533.915},"trace_dropped":false,"trace":"aps5-trace-e4c3f92833c2-9936.json.gz"}

On (gl2):

{"commit":"e4c3f92833c2","dirty":true,"env":{"APS5_BINDLESS_IMAGES":"1","APS5_BINDLESS_LAZY":"1","APS5_BINDLESS_STATS":"1","APS5_CACHE_SPIRV_BACKING":"1","APS5_COLD_SPIRV":"1","APS5_COLD_SPIRV_FILE":"1","APS5_DUMP_FRAMES":"300","APS5_DUMP_FRAMES_EVERY":"10","APS5_INLINE_SHADER_PREPARE":"1","APS5_MEM_STATS":"10","APS5_NO_ADDRESS_DRAW_REUSE":"1","APS5_NO_RESULT_MEMO":"1","APS5_PAD_SCRIPT":"100:cross,106:cross,112:cross,118:cross,124:cross,130:cross,136:cross,142:cross,148:cross,154:cross,160:cross,166:cross,172:cross,178:cross,184:cross,190:cross,196:cross,202:cross,208:cross,214:cross,220:cross,226:cross,232:cross,238:cross,244:cross,250:cross,256:cross,262:cross,268:cross,274:cross,280:cross,286:cross,292:cross,298:cross,304:cross,310:cross,316:cross,322:cross,328:cross,334:cross,340:cross,346:cross,352:cross,358:cross,364:cross,370:cross,376:cross,382:cross,388:cross,394:cross,400:cross,406:cross,412:cross,418:cross,424:cross,430:cross,436:cross,442:cross,448:cross,454:cross,460:cross,466:cross,472:cross,478:cross,484:cross,490:cross,496:cross,502:cross,508:cross,514:cross,520:cross,526:cross,532:cross,538:cross,544:cross,550:cross,556:cross,562:cross,568:cross,574:cross,580:cross","APS5_PAD_SCRIPT_REPEAT":"","APS5_PIPELINE_INDIRECT":"1","APS5_PROFILE_DRAW":"1","APS5_PROFILE_GPU":"1","APS5_SPANNED_WAVE":"1","APS5_STAGING_DIFF":"1","APS5_TEXTURE_OVERFLOW_MIB":"1024","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"1048576","APS5_TRACE_FRAMES":"880:12","APS5_UNNORM_WRAP_GUARD":"1"},"gpu":"NVIDIA GeForce RTX 3080 Laptop GPU","driver":"NVIDIA 610.62","os":"Windows 10.0.26200","resolution":"3840x2160","window":{"spec":"frames 880:12","first_present":880,"ms":30344.458},"presents":12,"frame_ms":{"p50":2536.358,"p90":2632.639,"p99":2675.436,"max":2675.436},"gpu_busy_ms_per_present":884.498,"worker_busy_pct":{"queue worker 0x0":93.600,"queue worker 0x52":49.218,"queue worker 0x20":60.463,"queue worker 0x53":48.143,"queue worker 0x30":80.275,"queue worker 0x38":80.842,"queue worker 0x48":4.213,"queue worker 0x51":9.324,"queue worker 0x50":44.870},"top_phases_ms_per_frame":{"Driver.Packet":11900.737,"Driver.Packet.memory_wait":7859.287,"Driver.Packet.dispatch":2231.698,"Driver.Dispatch":1896.469,"DrawPipeline.commit":1417.186,"Graphics.Draw":1290.300,"Graphics.Draw.draw_and_resource_release":1176.413,"Resources.Complete":1166.489},"trace_dropped":false,"trace":"aps5-trace-e4c3f92833c2-10944.json.gz"}
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6279896300 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8104#issuecomment-6279896300). Originally posted by [Celegans12](https://github.com/Celegans12) on 2026-10-19T23:49:30Z. --- There are no `main` numbers on this one yet, I'm afraid. What I have are two summary lines from our Yōtei tree: the same build, scene, machine and environment, with this change switched off (`APS5_NO_BDA_STAGING=1`, run gl3-off) and on (run gl2). Over presents 880-891, frame p50 went from 2,828 to 2,536 ms and GPU busy from 1,166 to 884 ms per present. Most of that is the cloth solver (0x80001c0d00): 308 ms of GPU time per present in our baseline run, 103 ms with the change. Some caveats. Our tree isn't `main` (it has bindless images, spanned waves and other local changes). The off run also had our local dispatch overlap switched off. That shouldn't matter, because the on run had per-range GPU timestamps on, and those serialize every dispatch anyway (they can only add time). For `main` against this branch I need a Yōtei run on `main`, and the machine is busy with other game work right now. I'll do that pair when it's free and post both lines here. If the two traces behind the lines below would help in the meantime, I can attach them. <details><summary>Summary lines (our tree, not main)</summary> Off (gl3-off): ``` {"commit":"e4c3f92833c2","dirty":true,"env":{"APS5_BINDLESS_IMAGES":"1","APS5_BINDLESS_LAZY":"1","APS5_BINDLESS_STATS":"1","APS5_CACHE_SPIRV_BACKING":"1","APS5_COLD_SPIRV":"1","APS5_COLD_SPIRV_FILE":"1","APS5_DUMP_FRAMES":"300","APS5_DUMP_FRAMES_EVERY":"10","APS5_INLINE_SHADER_PREPARE":"1","APS5_MEM_STATS":"10","APS5_NO_ADDRESS_DRAW_REUSE":"1","APS5_NO_BDA_STAGING":"1","APS5_NO_DISPATCH_OVERLAP":"1","APS5_NO_RESULT_MEMO":"1","APS5_PAD_SCRIPT":"100:cross,106:cross,112:cross,118:cross,124:cross,130:cross,136:cross,142:cross,148:cross,154:cross,160:cross,166:cross,172:cross,178:cross,184:cross,190:cross,196:cross,202:cross,208:cross,214:cross,220:cross,226:cross,232:cross,238:cross,244:cross,250:cross,256:cross,262:cross,268:cross,274:cross,280:cross,286:cross,292:cross,298:cross,304:cross,310:cross,316:cross,322:cross,328:cross,334:cross,340:cross,346:cross,352:cross,358:cross,364:cross,370:cross,376:cross,382:cross,388:cross,394:cross,400:cross,406:cross,412:cross,418:cross,424:cross,430:cross,436:cross,442:cross,448:cross,454:cross,460:cross,466:cross,472:cross,478:cross,484:cross,490:cross,496:cross,502:cross,508:cross,514:cross,520:cross,526:cross,532:cross,538:cross,544:cross,550:cross,556:cross,562:cross,568:cross,574:cross,580:cross","APS5_PAD_SCRIPT_REPEAT":"","APS5_PIPELINE_INDIRECT":"1","APS5_PROFILE_DRAW":"1","APS5_PROFILE_GPU":"0","APS5_SPANNED_WAVE":"1","APS5_STAGING_DIFF":"1","APS5_TEXTURE_OVERFLOW_MIB":"1024","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"1048576","APS5_TRACE_FRAMES":"880:12","APS5_UNNORM_WRAP_GUARD":"1"},"gpu":"NVIDIA GeForce RTX 3080 Laptop GPU","driver":"NVIDIA 610.62","os":"Windows 10.0.26200","resolution":"3840x2160","window":{"spec":"frames 880:12","first_present":880,"ms":33783.045},"presents":12,"frame_ms":{"p50":2828.218,"p90":2852.442,"p99":2970.761,"max":2970.761},"gpu_busy_ms_per_present":1165.540,"worker_busy_pct":{"queue worker 0x0":94.455,"queue worker 0x52":46.627,"queue worker 0x20":53.321,"queue worker 0x53":44.933,"queue worker 0x30":81.537,"queue worker 0x48":4.039,"queue worker 0x38":81.989,"queue worker 0x51":9.991,"queue worker 0x50":47.958},"top_phases_ms_per_frame":{"Driver.Packet":13063.476,"Driver.Packet.memory_wait":8232.995,"Driver.Packet.dispatch":2105.551,"DrawPipeline.commit":1806.241,"Driver.Dispatch":1767.588,"Graphics.Draw":1660.976,"Driver.Packet.draw":1536.653,"Graphics.Draw.draw_and_resource_release":1533.915},"trace_dropped":false,"trace":"aps5-trace-e4c3f92833c2-9936.json.gz"} ``` On (gl2): ``` {"commit":"e4c3f92833c2","dirty":true,"env":{"APS5_BINDLESS_IMAGES":"1","APS5_BINDLESS_LAZY":"1","APS5_BINDLESS_STATS":"1","APS5_CACHE_SPIRV_BACKING":"1","APS5_COLD_SPIRV":"1","APS5_COLD_SPIRV_FILE":"1","APS5_DUMP_FRAMES":"300","APS5_DUMP_FRAMES_EVERY":"10","APS5_INLINE_SHADER_PREPARE":"1","APS5_MEM_STATS":"10","APS5_NO_ADDRESS_DRAW_REUSE":"1","APS5_NO_RESULT_MEMO":"1","APS5_PAD_SCRIPT":"100:cross,106:cross,112:cross,118:cross,124:cross,130:cross,136:cross,142:cross,148:cross,154:cross,160:cross,166:cross,172:cross,178:cross,184:cross,190:cross,196:cross,202:cross,208:cross,214:cross,220:cross,226:cross,232:cross,238:cross,244:cross,250:cross,256:cross,262:cross,268:cross,274:cross,280:cross,286:cross,292:cross,298:cross,304:cross,310:cross,316:cross,322:cross,328:cross,334:cross,340:cross,346:cross,352:cross,358:cross,364:cross,370:cross,376:cross,382:cross,388:cross,394:cross,400:cross,406:cross,412:cross,418:cross,424:cross,430:cross,436:cross,442:cross,448:cross,454:cross,460:cross,466:cross,472:cross,478:cross,484:cross,490:cross,496:cross,502:cross,508:cross,514:cross,520:cross,526:cross,532:cross,538:cross,544:cross,550:cross,556:cross,562:cross,568:cross,574:cross,580:cross","APS5_PAD_SCRIPT_REPEAT":"","APS5_PIPELINE_INDIRECT":"1","APS5_PROFILE_DRAW":"1","APS5_PROFILE_GPU":"1","APS5_SPANNED_WAVE":"1","APS5_STAGING_DIFF":"1","APS5_TEXTURE_OVERFLOW_MIB":"1024","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"1048576","APS5_TRACE_FRAMES":"880:12","APS5_UNNORM_WRAP_GUARD":"1"},"gpu":"NVIDIA GeForce RTX 3080 Laptop GPU","driver":"NVIDIA 610.62","os":"Windows 10.0.26200","resolution":"3840x2160","window":{"spec":"frames 880:12","first_present":880,"ms":30344.458},"presents":12,"frame_ms":{"p50":2536.358,"p90":2632.639,"p99":2675.436,"max":2675.436},"gpu_busy_ms_per_present":884.498,"worker_busy_pct":{"queue worker 0x0":93.600,"queue worker 0x52":49.218,"queue worker 0x20":60.463,"queue worker 0x53":48.143,"queue worker 0x30":80.275,"queue worker 0x38":80.842,"queue worker 0x48":4.213,"queue worker 0x51":9.324,"queue worker 0x50":44.870},"top_phases_ms_per_frame":{"Driver.Packet":11900.737,"Driver.Packet.memory_wait":7859.287,"Driver.Packet.dispatch":2231.698,"Driver.Dispatch":1896.469,"DrawPipeline.commit":1417.186,"Graphics.Draw":1290.300,"Graphics.Draw.draw_and_resource_release":1176.413,"Resources.Complete":1166.489},"trace_dropped":false,"trace":"aps5-trace-e4c3f92833c2-10944.json.gz"} ``` </details>
TheSovietWaffle commented 2026-10-20 07:39:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by TheSovietWaffle on 2026-10-20T07:39:53Z.


Tested on RTX 3080 (NVIDIA 617.42) and AMD Radeon RDNA 2 iGPU (1002:164e, 32.0.21045.5002), Windows 10 Pro 22H2, WinLibs GCC 15.2.0, Release, head 69ac2e155: agc_bda_staging passes 3 of 3 on both GPUs.

AI-assisted: yes (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6285934916 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8104#issuecomment-6285934916). Originally posted by [TheSovietWaffle](https://github.com/TheSovietWaffle) on 2026-10-20T07:39:53Z. --- Tested on RTX 3080 (NVIDIA 617.42) and AMD Radeon RDNA 2 iGPU (`1002:164e`, 32.0.21045.5002), Windows 10 Pro 22H2, WinLibs GCC 15.2.0, Release, head `69ac2e155`: `agc_bda_staging` passes 3 of 3 on both GPUs. AI-assisted: yes (Claude Code).
CPritch commented 2026-10-20 12:37:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by CPritch on 2026-10-20T12:37:31Z.


Ran this on GTA V (PPSA04263 01.010.002), Linux 7.2.8-zen1-2-zen, NVIDIA GeForce RTX 5060 Laptop GPU, NVIDIA 615.71.09, Graphics Mode Performance, the Story prologue after Resume Story, with no input.
main d14a186f4 against main d14a186f4 + #8104 at 69ac2e155, same machine and session, two runs each in the order A B A B, window frames 3600:700, caches warm, APS5_TRACE_EVENTS=4194304 (BUILD.md's remedy for full trace buffers), no other APS5_TRACE_* or APS5_PROFILE_* switch, log not redirected. The harness navigates the menus from frame dumps in boot and load to present 3420 (APS5_DUMP_FRAMES=114, every 30 presents), which stop before the window.

Frame p50: main 80.8, 80.7 ms, with #8104 80.6, 80.3 ms (-0.3 ms, -0.3 %). GPU busy per present: 65.0 and 64.6 ms.
p90: main 89.8, 89.4 ms, with #8104 87.8, 89.0 ms; mean frame -1.292 and -0.139 ms (pair 1 and pair 2). p99 moved both ways.
The summary lines' Driver.EndSubmission (about 2,984 and 2,924 ms per frame) and worker_busy_pct for queue worker 0x0 (about 3,700 and 3,684 %) are not costs: on the pipelined path the Driver.EndSubmission timer stays open through the rewind tail, so nested tails are counted many times over (#8092; #8108 has the fix).
Not tested: other scenes, Fidelity mode, other GPUs.
Written with AI assistance (Claude Code); measured on the machine above.

Summary lines (main, then the PR):
{"commit":"d14a186f4615","dirty":false,"env":{"APS5_DUMP_FRAMES":"114","APS5_DUMP_FRAMES_EVERY":"30","APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"","APS5_TRACE_EVENTS":"4194304","APS5_TRACE_FRAMES":"3600:700"},"gpu":"NVIDIA GeForce RTX 5060 Laptop GPU","driver":"NVIDIA 615.71.09","os":"Linux 7.2.8-zen1-2-zen","cpu":"AMD Ryzen AI 9 465 w/ Radeon 880M","cpu_threads":20,"memory_mib":31391,"title_id":"PPSA04263","title":"Grand Theft Auto V","content_version":"01.010.002","resolution":"3840x2160","window":{"spec":"frames 3600:700","first_present":3600,"ms":57683.201},"presents":700,"frame_ms":{"p50":80.75,"p90":89.76,"p99":113.913,"max":123.846},"gpu_busy_ms_per_present":65.082,"worker_busy_pct":{"queue worker 0x0":3700.498},"top_phases_ms_per_frame":{"Driver.EndSubmission":2983.789,"Driver.Packet":63.297,"Graphics.Draw":59.802,"Graphics.Draw.draw_and_resource_release":56.201,"Driver.Packet.draw":49.923,"Driver.Draw":49.707,"VideoOut.Flip":25.612,"Driver.Present":25.6},"trace_dropped":false,"trace":"aps5-trace-d14a186f4615-2531021.json.gz"}
{"commit":"7900b6edae74","dirty":false,"env":{"APS5_DUMP_FRAMES":"114","APS5_DUMP_FRAMES_EVERY":"30","APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"","APS5_TRACE_EVENTS":"4194304","APS5_TRACE_FRAMES":"3600:700"},"gpu":"NVIDIA GeForce RTX 5060 Laptop GPU","driver":"NVIDIA 615.71.09","os":"Linux 7.2.8-zen1-2-zen","cpu":"AMD Ryzen AI 9 465 w/ Radeon 880M","cpu_threads":20,"memory_mib":31391,"title_id":"PPSA04263","title":"Grand Theft Auto V","content_version":"01.010.002","resolution":"3840x2160","window":{"spec":"frames 3600:700","first_present":3600,"ms":56778.478},"presents":700,"frame_ms":{"p50":80.589,"p90":87.781,"p99":99.906,"max":116.41},"gpu_busy_ms_per_present":64.595,"worker_busy_pct":{"queue worker 0x0":3683.717},"top_phases_ms_per_frame":{"Driver.EndSubmission":2923.746,"Driver.Packet":61.99,"Graphics.Draw":59.005,"Graphics.Draw.draw_and_resource_release":55.465,"Driver.Packet.draw":48.917,"Driver.Draw":48.7,"VideoOut.Flip":25.592,"Driver.Present":25.572},"trace_dropped":false,"trace":"aps5-trace-7900b6edae74-2539174.json.gz"}

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6291006683 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8104#issuecomment-6291006683). Originally posted by [CPritch](https://github.com/CPritch) on 2026-10-20T12:37:31Z. --- Ran this on GTA V (PPSA04263 01.010.002), Linux 7.2.8-zen1-2-zen, NVIDIA GeForce RTX 5060 Laptop GPU, NVIDIA 615.71.09, Graphics Mode Performance, the Story prologue after Resume Story, with no input. main d14a186f4 against main d14a186f4 + #8104 at 69ac2e155, same machine and session, two runs each in the order A B A B, window frames 3600:700, caches warm, APS5_TRACE_EVENTS=4194304 (BUILD.md's remedy for full trace buffers), no other APS5_TRACE_* or APS5_PROFILE_* switch, log not redirected. The harness navigates the menus from frame dumps in boot and load to present 3420 (APS5_DUMP_FRAMES=114, every 30 presents), which stop before the window. Frame p50: main 80.8, 80.7 ms, with #8104 80.6, 80.3 ms (-0.3 ms, -0.3 %). GPU busy per present: 65.0 and 64.6 ms. p90: main 89.8, 89.4 ms, with #8104 87.8, 89.0 ms; mean frame -1.292 and -0.139 ms (pair 1 and pair 2). p99 moved both ways. The summary lines' Driver.EndSubmission (about 2,984 and 2,924 ms per frame) and worker_busy_pct for queue worker 0x0 (about 3,700 and 3,684 %) are not costs: on the pipelined path the Driver.EndSubmission timer stays open through the rewind tail, so nested tails are counted many times over (#8092; #8108 has the fix). Not tested: other scenes, Fidelity mode, other GPUs. Written with AI assistance (Claude Code); measured on the machine above. Summary lines (main, then the PR): {"commit":"d14a186f4615","dirty":false,"env":{"APS5_DUMP_FRAMES":"114","APS5_DUMP_FRAMES_EVERY":"30","APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_EVENTS":"4194304","APS5_TRACE_FRAMES":"3600:700"},"gpu":"NVIDIA GeForce RTX 5060 Laptop GPU","driver":"NVIDIA 615.71.09","os":"Linux 7.2.8-zen1-2-zen","cpu":"AMD Ryzen AI 9 465 w/ Radeon 880M","cpu_threads":20,"memory_mib":31391,"title_id":"PPSA04263","title":"Grand Theft Auto V","content_version":"01.010.002","resolution":"3840x2160","window":{"spec":"frames 3600:700","first_present":3600,"ms":57683.201},"presents":700,"frame_ms":{"p50":80.75,"p90":89.76,"p99":113.913,"max":123.846},"gpu_busy_ms_per_present":65.082,"worker_busy_pct":{"queue worker 0x0":3700.498},"top_phases_ms_per_frame":{"Driver.EndSubmission":2983.789,"Driver.Packet":63.297,"Graphics.Draw":59.802,"Graphics.Draw.draw_and_resource_release":56.201,"Driver.Packet.draw":49.923,"Driver.Draw":49.707,"VideoOut.Flip":25.612,"Driver.Present":25.6},"trace_dropped":false,"trace":"aps5-trace-d14a186f4615-2531021.json.gz"} {"commit":"7900b6edae74","dirty":false,"env":{"APS5_DUMP_FRAMES":"114","APS5_DUMP_FRAMES_EVERY":"30","APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_EVENTS":"4194304","APS5_TRACE_FRAMES":"3600:700"},"gpu":"NVIDIA GeForce RTX 5060 Laptop GPU","driver":"NVIDIA 615.71.09","os":"Linux 7.2.8-zen1-2-zen","cpu":"AMD Ryzen AI 9 465 w/ Radeon 880M","cpu_threads":20,"memory_mib":31391,"title_id":"PPSA04263","title":"Grand Theft Auto V","content_version":"01.010.002","resolution":"3840x2160","window":{"spec":"frames 3600:700","first_present":3600,"ms":56778.478},"presents":700,"frame_ms":{"p50":80.589,"p90":87.781,"p99":99.906,"max":116.41},"gpu_busy_ms_per_present":64.595,"worker_busy_pct":{"queue worker 0x0":3683.717},"top_phases_ms_per_frame":{"Driver.EndSubmission":2923.746,"Driver.Packet":61.99,"Graphics.Draw":59.005,"Graphics.Draw.draw_and_resource_release":55.465,"Driver.Packet.draw":48.917,"Driver.Draw":48.7,"VideoOut.Flip":25.592,"Driver.Present":25.572},"trace_dropped":false,"trace":"aps5-trace-7900b6edae74-2539174.json.gz"}
oneandonlydean commented 2026-10-21 00:32:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-21T00:32:45Z.


@Celegans12, two small things before CI:

  1. Skip text. The two "not tested" exits of bdaStagingTests return 77 with host imports, device addresses or the address space cache unavailable: address-based staging not tested and host import of the test block refused: address-based staging not tested. tools/check_skips.py only accepts a skip whose line starts with skipped, and names a device limitation from DEVICE_LIMITATION on the same line, so either text fails the Linux job if the test ever skips there. Something like skipped, host imports are unavailable (no device addresses or address space cache) and skipped, host imports are unavailable: the test block's import was refused matches it.
  2. Staging comment. The PR deletes main's whole "Device-local staging" comment above SweptShadowMax in GuestBufferMemory.cpp (the measurements, the copy-back trade-off and the APS5_NO_WRITTEN_SHADOW / APS5_NO_ATOMIC_STAGING / *_KIB switches) and the header comment on stagingEligible. Only the "never address-based ones" sentence became wrong. Please keep both comments and change just that sentence to describe the overlay case.

Separately, the perf label still needs a main-against-this-branch pair from the same scene (the PPSA26344 numbers come from a tree with other local changes). PPSA04263's pair on main was neutral (-0.3 % p50).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6304982263 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8104#issuecomment-6304982263). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-21T00:32:45Z. --- @Celegans12, two small things before CI: 1. **Skip text.** The two "not tested" exits of `bdaStagingTests` return 77 with `host imports, device addresses or the address space cache unavailable: address-based staging not tested` and `host import of the test block refused: address-based staging not tested`. `tools/check_skips.py` only accepts a skip whose line starts with `skipped,` and names a device limitation from `DEVICE_LIMITATION` on the same line, so either text fails the Linux job if the test ever skips there. Something like `skipped, host imports are unavailable (no device addresses or address space cache)` and `skipped, host imports are unavailable: the test block's import was refused` matches it. 2. **Staging comment.** The PR deletes `main`'s whole "Device-local staging" comment above `SweptShadowMax` in `GuestBufferMemory.cpp` (the measurements, the copy-back trade-off and the `APS5_NO_WRITTEN_SHADOW` / `APS5_NO_ATOMIC_STAGING` / `*_KIB` switches) and the header comment on `stagingEligible`. Only the "never address-based ones" sentence became wrong. Please keep both comments and change just that sentence to describe the overlay case. Separately, the `perf` label still needs a `main`-against-this-branch pair from the same scene (the PPSA26344 numbers come from a tree with other local changes). PPSA04263's pair on `main` was neutral (-0.3 % p50).
Celegans12 commented 2026-10-21 02:21:45 +00:00 (Migrated from github.com)

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


Thanks, both are fixed in 5804207c5, which is also rebased onto current main.

The two skip lines now read skipped, host imports are unavailable (no device addresses or address space cache) and skipped, host imports are unavailable: the test block's import was refused. I checked both against DEVICE_LIMITATION in main's check_skips.py.

Both comments are back as they are on main. The only change is the address-based sentence: the big comment now says that in an address-based build, a written element inside one direct import region becomes an overlay region, and AddressRanges cuts the import's range around it so its pointers reach the shadow. The header comment now says "not address-based unless an overlay region". One thing to flag: check_conventions.py fails any added or changed comment line unless the PR also touches a debt file. That's why I had dropped the blocks. To keep them, I added one line to docs/dev/debt/libSceAgcDriver.md for the copy-back trade-off (a CPU store into a staged range between the copy-in and the copy-back is rolled back). The comment already calls it accepted, and this PR extends it to address-based builds. If you'd rather not have that entry, tell me and I'll find another way.

The main-against-branch pair from the same Yōtei scene is still owed; I can't produce it today.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6306412821 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8104#issuecomment-6306412821). Originally posted by [Celegans12](https://github.com/Celegans12) on 2026-10-21T02:21:45Z. --- Thanks, both are fixed in 5804207c5, which is also rebased onto current main. The two skip lines now read `skipped, host imports are unavailable (no device addresses or address space cache)` and `skipped, host imports are unavailable: the test block's import was refused`. I checked both against `DEVICE_LIMITATION` in main's `check_skips.py`. Both comments are back as they are on main. The only change is the address-based sentence: the big comment now says that in an address-based build, a written element inside one direct import region becomes an overlay region, and `AddressRanges` cuts the import's range around it so its pointers reach the shadow. The header comment now says "not address-based unless an overlay region". One thing to flag: `check_conventions.py` fails any added or changed comment line unless the PR also touches a debt file. That's why I had dropped the blocks. To keep them, I added one line to `docs/dev/debt/libSceAgcDriver.md` for the copy-back trade-off (a CPU store into a staged range between the copy-in and the copy-back is rolled back). The comment already calls it accepted, and this PR extends it to address-based builds. If you'd rather not have that entry, tell me and I'll find another way. The main-against-branch pair from the same Yōtei scene is still owed; I can't produce it today.
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!8104
No description provided.