perf(agc): memoize host import run bounds per lease snapshot #6951

Merged
alfalfa-star merged 2 commits from upstream-pr/6951 into main 2026-10-23 09:52:56 +00:00
alfalfa-star commented 2026-10-16 20:54:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by alfalfa-star on 2026-10-16T20:54:58Z.


What

Every host import lookup walks the lease to find the run of registry ranges around an address (importRun): from the containing range out to both ends of the run, which is linear in the run length. Kena: Bridge of Spirits (PPSA01802) and Record of Lodoss War (PPSA05347) look runs up thousands of times per frame (HostImportFor, sameRange in the import refresh, importAllocation).

That walk depends only on the lease snapshot, the containing range and the import window block, so its first and last index are now memoized per thread (continuedRun). The key is a weak reference to the lease's Ranges snapshot (Lease::Snapshot()), the index of the containing range, the import window and the window's low end. Everything that depends on other state still runs on every call, as on main: largest, the failed blocks, the remembered refusals under the caller's budget and liveBytes, and the halving block search. importRunBounds returns the chosen indices, so sameRange, runCovers and the whole-run lookup in importAllocation compare against the lease without copying the run's range pointers. APS5_NO_RUN_MEMO=1 turns the memo off.

Tested

AMD Radeon RX 9070 XT (RADV GFX1201), Mesa 26.2.4, Arch Linux (kernel 7.2.9), i7-13700KF.

  • importRunFailureShrinkTests: a failed 8 MiB block is recorded between two lookups on an unchanged registry, and the run must shrink to its 4 MiB block and not import the failed block again. It fails when the failed-block check is dropped from the block search. importRunGrowthTests and importRunReplacedTests check that a run grows and shrinks when its ranges are registered or replaced.
  • tools/select_tests.py on main 77e31219c: 1649 of 1652 selected tests pass; agc_driver_guest_memory_lifetime, agc_driver_image_array_window_past_layer_limit and agc_driver_tessellation fail the same way on plain main on this machine. agc_driver_graphics_tests passes with and without APS5_NO_RUN_MEMO=1.
  • Kena forest title scene from a fixed save, APS5_TRACE_SECONDS=100:30, eight alternating rounds, both builds with the same local stand-in for the import ceiling (see the review reply): main 339 presents per 30 s on average (8 runs), this PR 352 (7 runs), +4 %, within Kena's spread, so no measurable gain on Kena. One run with this PR crashed in the game's code; details in the review reply. Summary lines of the last round-1 pair (main 77e31219c, this PR c3ac6b47f; both dirty from the stand-in):
{"commit":"77e31219c835","dirty":true,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"100:30"},"gpu":"AMD Radeon RX 9070 XT (RADV GFX1201)","driver":"radv Mesa 26.2.4-arch1.1","os":"Linux 7.2.9-arch1-1","cpu":"13th Gen Intel(R) Core(TM) i7-13700KF","cpu_threads":24,"memory_mib":31870,"title_id":"PPSA01802","title":"Kena: Bridge of Spirits","content_version":"02.008.000","resolution":"3840x2160","window":{"spec":"seconds 100:30","first_present":945,"ms":30048.071},"presents":368,"frame_ms":{"p50":80.277,"p90":89.545,"p99":104.190,"max":124.124},"gpu_busy_ms_per_present":43.253,"worker_busy_pct":{"queue worker 0x0":98.454,"queue worker 0x20":67.091},"top_phases_ms_per_frame":{"Driver.Packet":134.285,"Driver.Packet.memory_wait":52.923,"Driver.Packet.draw":48.148,"Driver.Draw":47.955,"Graphics.Draw":47.505,"Graphics.Draw.draw_and_resource_release":31.319,"Driver.Draw.shader_compile_and_link":25.344,"Shader.DrawStage":22.762},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":5.974,"events_lost":1075410,"totals_full":false},"draw committer":{"events_full_after_s":17.870,"events_lost":183604,"totals_full":false}},"trace":"aps5-trace-77e31219c835-189863.json.gz"}
{"commit":"c3ac6b47ffb6","dirty":true,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"100:30"},"gpu":"AMD Radeon RX 9070 XT (RADV GFX1201)","driver":"radv Mesa 26.2.4-arch1.1","os":"Linux 7.2.9-arch1-1","cpu":"13th Gen Intel(R) Core(TM) i7-13700KF","cpu_threads":24,"memory_mib":31870,"title_id":"PPSA01802","title":"Kena: Bridge of Spirits","content_version":"02.008.000","resolution":"3840x2160","window":{"spec":"seconds 100:30","first_present":958,"ms":30052.232},"presents":348,"frame_ms":{"p50":84.097,"p90":99.220,"p99":107.013,"max":111.658},"gpu_busy_ms_per_present":45.642,"worker_busy_pct":{"queue worker 0x0":98.775,"queue worker 0x20":75.254},"top_phases_ms_per_frame":{"Driver.Packet":149.061,"Driver.Packet.memory_wait":62.792,"Graphics.Draw":43.609,"Driver.Packet.draw":42.676,"Driver.Draw":42.519,"Graphics.Draw.draw_and_resource_release":28.554,"Driver.Draw.shader_compile_and_link":19.797,"Driver.Packet.prepare_memory":17.974},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":7.800,"events_lost":777217,"totals_full":false},"draw committer":{"events_full_after_s":25.358,"events_lost":46559,"totals_full":false}},"trace":"aps5-trace-c3ac6b47ffb6-193694.json.gz"}
  • Lodoss War: JJenkx withdrew the +13.6 % and +14.7 % from an earlier head as speed claims, because that run redirected the log (comment of 2026-10-23).
  • The Kena runs above also redirected the log to a file, so they don't meet the Performance report form either. They are diagnostic only, and this PR makes no measured speed claim.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: none (performance of PPSA01802, PPSA05347)
  • GPUs tested: AMD Radeon RX 9070 XT (RADV GFX1201), Mesa 26.2.4, Arch Linux (kernel 7.2.9)
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4894165467 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6951). Originally posted by [alfalfa-star](https://github.com/alfalfa-star) on 2026-10-16T20:54:58Z. --- ### What Every host import lookup walks the lease to find the run of registry ranges around an address (`importRun`): from the containing range out to both ends of the run, which is linear in the run length. Kena: Bridge of Spirits (PPSA01802) and Record of Lodoss War (PPSA05347) look runs up thousands of times per frame (`HostImportFor`, `sameRange` in the import refresh, `importAllocation`). That walk depends only on the lease snapshot, the containing range and the import window block, so its first and last index are now memoized per thread (`continuedRun`). The key is a weak reference to the lease's `Ranges` snapshot (`Lease::Snapshot()`), the index of the containing range, the import window and the window's low end. Everything that depends on other state still runs on every call, as on `main`: `largest`, the failed blocks, the remembered refusals under the caller's budget and `liveBytes`, and the halving block search. `importRunBounds` returns the chosen indices, so `sameRange`, `runCovers` and the whole-run lookup in `importAllocation` compare against the lease without copying the run's range pointers. `APS5_NO_RUN_MEMO=1` turns the memo off. ### Tested AMD Radeon RX 9070 XT (RADV GFX1201), Mesa 26.2.4, Arch Linux (kernel 7.2.9), i7-13700KF. - `importRunFailureShrinkTests`: a failed 8 MiB block is recorded between two lookups on an unchanged registry, and the run must shrink to its 4 MiB block and not import the failed block again. It fails when the failed-block check is dropped from the block search. `importRunGrowthTests` and `importRunReplacedTests` check that a run grows and shrinks when its ranges are registered or replaced. - `tools/select_tests.py` on `main` 77e31219c: 1649 of 1652 selected tests pass; `agc_driver_guest_memory_lifetime`, `agc_driver_image_array_window_past_layer_limit` and `agc_driver_tessellation` fail the same way on plain `main` on this machine. `agc_driver_graphics_tests` passes with and without `APS5_NO_RUN_MEMO=1`. - Kena forest title scene from a fixed save, `APS5_TRACE_SECONDS=100:30`, eight alternating rounds, both builds with the same local stand-in for the import ceiling (see the review reply): `main` 339 presents per 30 s on average (8 runs), this PR 352 (7 runs), +4 %, within Kena's spread, so no measurable gain on Kena. One run with this PR crashed in the game's code; details in the review reply. Summary lines of the last round-1 pair (`main` 77e31219c, this PR c3ac6b47f; both dirty from the stand-in): ```json {"commit":"77e31219c835","dirty":true,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"100:30"},"gpu":"AMD Radeon RX 9070 XT (RADV GFX1201)","driver":"radv Mesa 26.2.4-arch1.1","os":"Linux 7.2.9-arch1-1","cpu":"13th Gen Intel(R) Core(TM) i7-13700KF","cpu_threads":24,"memory_mib":31870,"title_id":"PPSA01802","title":"Kena: Bridge of Spirits","content_version":"02.008.000","resolution":"3840x2160","window":{"spec":"seconds 100:30","first_present":945,"ms":30048.071},"presents":368,"frame_ms":{"p50":80.277,"p90":89.545,"p99":104.190,"max":124.124},"gpu_busy_ms_per_present":43.253,"worker_busy_pct":{"queue worker 0x0":98.454,"queue worker 0x20":67.091},"top_phases_ms_per_frame":{"Driver.Packet":134.285,"Driver.Packet.memory_wait":52.923,"Driver.Packet.draw":48.148,"Driver.Draw":47.955,"Graphics.Draw":47.505,"Graphics.Draw.draw_and_resource_release":31.319,"Driver.Draw.shader_compile_and_link":25.344,"Shader.DrawStage":22.762},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":5.974,"events_lost":1075410,"totals_full":false},"draw committer":{"events_full_after_s":17.870,"events_lost":183604,"totals_full":false}},"trace":"aps5-trace-77e31219c835-189863.json.gz"} ``` ```json {"commit":"c3ac6b47ffb6","dirty":true,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"100:30"},"gpu":"AMD Radeon RX 9070 XT (RADV GFX1201)","driver":"radv Mesa 26.2.4-arch1.1","os":"Linux 7.2.9-arch1-1","cpu":"13th Gen Intel(R) Core(TM) i7-13700KF","cpu_threads":24,"memory_mib":31870,"title_id":"PPSA01802","title":"Kena: Bridge of Spirits","content_version":"02.008.000","resolution":"3840x2160","window":{"spec":"seconds 100:30","first_present":958,"ms":30052.232},"presents":348,"frame_ms":{"p50":84.097,"p90":99.220,"p99":107.013,"max":111.658},"gpu_busy_ms_per_present":45.642,"worker_busy_pct":{"queue worker 0x0":98.775,"queue worker 0x20":75.254},"top_phases_ms_per_frame":{"Driver.Packet":149.061,"Driver.Packet.memory_wait":62.792,"Graphics.Draw":43.609,"Driver.Packet.draw":42.676,"Driver.Draw":42.519,"Graphics.Draw.draw_and_resource_release":28.554,"Driver.Draw.shader_compile_and_link":19.797,"Driver.Packet.prepare_memory":17.974},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":7.800,"events_lost":777217,"totals_full":false},"draw committer":{"events_full_after_s":25.358,"events_lost":46559,"totals_full":false}},"trace":"aps5-trace-c3ac6b47ffb6-193694.json.gz"} ``` - Lodoss War: JJenkx withdrew the +13.6 % and +14.7 % from an earlier head as speed claims, because that run redirected the log (comment of 2026-10-23). - The Kena runs above also redirected the log to a file, so they don't meet the Performance report form either. They are diagnostic only, and this PR makes no measured speed claim. ### 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] Unblocks: none (performance of PPSA01802, PPSA05347) - [x] GPUs tested: AMD Radeon RX 9070 XT (RADV GFX1201), Mesa 26.2.4, Arch Linux (kernel 7.2.9) - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
CnRJay commented 2026-10-16 21:58:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-10-16T21:58:34Z.

Review: COMMENTED


Default-off span mirror plus two changes that are on by default, and no measurement of any of them.

  • The incremental import refresh (APS5_NO_INCREMENTAL_IMPORT_REFRESH) and the run memo (APS5_NO_RUN_MEMO) change behaviour for every title on every host, and the registry change journal decides which imports get refreshed. A missed journal entry leaves an import pointing at a remapped range. Say what bounds the journal (what happens when it wraps, or when the registry changes during a refresh), and add a test where an allocation is unmapped and remapped between two refreshes and the next draw must see the new pages.
  • The udmabuf path is Linux-only and was tested on RADV only. Windows runs the same refresh and run-memo code; please run the agc_* suite there and say so.
  • APS5_SPAN_NO_FLUSH=1 skips flushing pending GPU writes over the span before it is served. Leave that out of this PR, or show a title that needs it. A switch whose only effect is to serve stale data is not a performance feature.
  • 640 lines across the import code, GuestAllocations and the mirror in one PR; the mirror (off by default) and the refresh changes (on by default) are two topics and should be two PRs, so the default-on part can be measured and merged on its own.
  • "About 24 fps in our local test build" and "a measurement will follow" do not meet the Performance report form. Please add the summary lines of main and this PR, same scene in PPSA01802, once with APS5_SPAN_MIRROR=1 and once without, no APS5_PROFILE_*.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5554156730 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6951#pullrequestreview-5554156730). Originally posted by [CnRJay](https://github.com/CnRJay) on 2026-10-16T21:58:34Z. **Review:** COMMENTED --- Default-off span mirror plus two changes that are on by default, and no measurement of any of them. - The incremental import refresh (`APS5_NO_INCREMENTAL_IMPORT_REFRESH`) and the run memo (`APS5_NO_RUN_MEMO`) change behaviour for every title on every host, and the registry change journal decides which imports get refreshed. A missed journal entry leaves an import pointing at a remapped range. Say what bounds the journal (what happens when it wraps, or when the registry changes during a refresh), and add a test where an allocation is unmapped and remapped between two refreshes and the next draw must see the new pages. - The udmabuf path is Linux-only and was tested on RADV only. Windows runs the same refresh and run-memo code; please run the `agc_*` suite there and say so. - `APS5_SPAN_NO_FLUSH=1` skips flushing pending GPU writes over the span before it is served. Leave that out of this PR, or show a title that needs it. A switch whose only effect is to serve stale data is not a performance feature. - 640 lines across the import code, `GuestAllocations` and the mirror in one PR; the mirror (off by default) and the refresh changes (on by default) are two topics and should be two PRs, so the default-on part can be measured and merged on its own. - "About 24 fps in our local test build" and "a measurement will follow" do not meet the Performance report form. Please add the summary lines of main and this PR, same scene in PPSA01802, once with `APS5_SPAN_MIRROR=1` and once without, no `APS5_PROFILE_*`.
parl0v commented 2026-10-17 00:05:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by parl0v on 2026-10-17T00:05:16Z.


Data point from a CPU-bound scene on Windows: RTX 3060 12 GB (NVIDIA 617.42), i5-12400F, Windows 10 19045, MinGW GCC Release. Minecraft Dungeons II (PPSA16064 01.100.100), title screen, no input, 200 s rows, APS5_PROFILE_DRAW=1 APS5_PROFILE_GPU=1; main af0fff762 vs main + this PR, interleaved with five other PRs in one batch, two rounds. FPS is the mean of the last 10 [present] windows, GPU busy and idle gaps per frame over the last 8. This scene is CPU-bound on this machine (44-47 ms of idle gaps per frame).

libs FPS GPU busy idle gaps
main 6.61 / 6.76 105 / 104 ms 46 / 44 ms
+ this PR (c7a43cc47) 6.58 / 6.62 (-1.3 %) 106 / 104 ms 46 / 46 ms

Within the run-to-run spread (main itself moved 6.61 -> 6.76 between rounds), no regression, 0 fatal.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6227057166 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6951#issuecomment-6227057166). Originally posted by [parl0v](https://github.com/parl0v) on 2026-10-17T00:05:16Z. --- Data point from a CPU-bound scene on Windows: RTX 3060 12 GB (NVIDIA 617.42), i5-12400F, Windows 10 19045, MinGW GCC Release. Minecraft Dungeons II (PPSA16064 01.100.100), title screen, no input, 200 s rows, `APS5_PROFILE_DRAW=1 APS5_PROFILE_GPU=1`; `main` af0fff762 vs `main` + this PR, interleaved with five other PRs in one batch, two rounds. FPS is the mean of the last 10 `[present]` windows, GPU busy and idle gaps per frame over the last 8. This scene is CPU-bound on this machine (44-47 ms of idle gaps per frame). | libs | FPS | GPU busy | idle gaps | |---|---|---|---| | `main` | 6.61 / 6.76 | 105 / 104 ms | 46 / 44 ms | | + this PR (c7a43cc47) | 6.58 / 6.62 (-1.3 %) | 106 / 104 ms | 46 / 46 ms | Within the run-to-run spread (`main` itself moved 6.61 -> 6.76 between rounds), no regression, 0 fatal. AI-assisted: yes (Claude Code)
milescoviello commented 2026-10-17 06:48:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-17T06:48:17Z.


A profile from another title where this path is the largest committer cost; it doesn't measure this PR. Metal Gear Solid 4 (PPSA18194), Ubuntu 24.04, i7-13700K, RTX 4070 Ti (595.99.02), Release, pad input. main 0dc15620d2 plus what MGS4 needs here (#6814, #6842, #6237) and #6917. In this scene the queue-0 committer holds the GPU mutex for about 7.9 s of every 10 s (APS5_PROFILE_DRAW, 124k commits per 10 s), so its per-draw CPU time sets the frame rate.

perf record -F 199 --call-graph dwarf for 6 s at 225 s; of the 555 samples with DrawPipeline::run on the stack (inclusive):

Frame Share of committer samples
HostImportFor 20.4%
refreshImports 19.8%
InPlaceDrawInput (from prepareDrawInputs) 19.6%
sameRange(HostImport, Lease) 18.4%
importRun(Lease, ...) 16.0% (7.2% self)
GuestAllocations::Lease::held 5.6% self

So most of it is the import refresh re-walking runs on each draw's input lookup, which your incremental refresh and per-lease run memo target. I haven't run this PR on MGS4 yet. I can if that's useful, but MGS4 needs those three PRs on top.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6230858982 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6951#issuecomment-6230858982). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-10-17T06:48:17Z. --- A profile from another title where this path is the largest committer cost; it doesn't measure this PR. Metal Gear Solid 4 (PPSA18194), Ubuntu 24.04, i7-13700K, RTX 4070 Ti (595.99.02), Release, pad input. `main` 0dc15620d2 plus what MGS4 needs here (#6814, #6842, #6237) and #6917. In this scene the queue-0 committer holds the GPU mutex for about 7.9 s of every 10 s (`APS5_PROFILE_DRAW`, 124k commits per 10 s), so its per-draw CPU time sets the frame rate. `perf record -F 199 --call-graph dwarf` for 6 s at 225 s; of the 555 samples with `DrawPipeline::run` on the stack (inclusive): | Frame | Share of committer samples | |---|---| | `HostImportFor` | 20.4% | | `refreshImports` | 19.8% | | `InPlaceDrawInput` (from `prepareDrawInputs`) | 19.6% | | `sameRange(HostImport, Lease)` | 18.4% | | `importRun(Lease, ...)` | 16.0% (7.2% self) | | `GuestAllocations::Lease::held` | 5.6% self | So most of it is the import refresh re-walking runs on each draw's input lookup, which your incremental refresh and per-lease run memo target. I haven't run this PR on MGS4 yet. I can if that's useful, but MGS4 needs those three PRs on top. AI-assisted: yes (Claude Code)
alfalfa-star commented 2026-10-17 10:37:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by alfalfa-star on 2026-10-17T10:37:42Z.


Thanks. I measured each part on its own, and the PR is now one topic. I force-pushed it down to the part that is on by default and measurably faster: the run memo (ae409e197, on current main). The title and description changed accordingly. What happened to the rest:

Kena (PPSA01802), forest title scene, no input. main f8b22edfb + each part, warm cache, APS5_TRACE_SECONDS=100:30, three rotated rounds per batch. Linux 7.2.9, RX 9070 XT, RADV Mesa 26.2.4.

build (one batch) presents in 30 s
main 191 / 227 / 208
run memo + incremental refresh 234 / 243 / 244
the same with APS5_NO_INCREMENTAL_IMPORT_REFRESH=1 239 / 235 / 248
the whole previous PR, mirror off 344 / 323 / 314
the whole previous PR, APS5_SPAN_MIRROR=1 (another batch) the same as mirror off
  • Incremental refresh and journal: they added nothing on top of the memo, so I removed them. That also answers the journal questions by deletion. For the record: the journal was bounded at 8192 entries and fell back to the full walk once a refresh's starting generation was older than the oldest entry. It also flaked spaceReadList twice in six parallel ctest runs, which neither main nor this version does. On the remap test you asked for: an unmap or remap of an imported range can't leave a stale import, journal or not, because the pin waiter retires imports over a range before a mutation changes it. What the refresh does need to see is a run that grows next to an unchanged import. The new test covers that case and failed when the incremental refresh skipped its walk.
  • Span mirror: no measurable gain, so it's out, with APS5_SPAN_NO_FLUSH.
  • Fragmented-backing import: most of the difference between the memo and the whole previous PR (+36 %) came from this part. It imported a window whose direct-memory backing is scattered as one UDMABUF_CREATE_LIST, and it was on by default, which the old description didn't make clear. It's out of this PR too. #4449 already implements the same idea (a dma-buf run list for scattered direct memory), so I won't open a competing PR. I'll post the Kena numbers there instead.

Windows: this version touches no Linux-only code. I can't run the agc_* suite on Windows here; the memo is plain C++ on the lease, the same on both.

Measurement of this version (rotated with another build; one run of each reached a lighter stretch with 48 ms GPU busy instead of about 80 and isn't comparable):

build presents in 30 s p50 frame ms GPU busy ms per present
main 216 / 325* / 254 130.2 / 87.8 / 117.3 78.2 / 48.4 / 82.2
this PR 321* / 236 / 295 84.5 / 126.4 / 99.9 48.7 / 79.6 / 80.4
Summary lines
{"commit":"f8b22edfb7f5","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"100:30"},"gpu":"AMD Radeon RX 9070 XT (RADV GFX1201)","driver":"radv Mesa 26.2.4-arch1.1","os":"Linux 7.2.9-arch1-1","resolution":"3840x2160","window":{"spec":"seconds 100:30","first_present":771,"ms":30041.458},"presents":216,"frame_ms":{"p50":130.2,"p90":161.713,"p99":275.775,"max":455.902},"gpu_busy_ms_per_present":78.23,"trace":"aps5-trace-f8b22edfb7f5-370363.json.gz"}
{"commit":"f8b22edfb7f5","dirty":true,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"100:30"},"gpu":"AMD Radeon RX 9070 XT (RADV GFX1201)","driver":"radv Mesa 26.2.4-arch1.1","os":"Linux 7.2.9-arch1-1","resolution":"3840x2160","window":{"spec":"seconds 100:30","first_present":1187,"ms":30077.514},"presents":321,"frame_ms":{"p50":84.548,"p90":115.084,"p99":123.446,"max":210.047},"gpu_busy_ms_per_present":48.711,"trace":"aps5-trace-f8b22edfb7f5-377486.json.gz"}
{"commit":"f8b22edfb7f5","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"100:30"},"gpu":"AMD Radeon RX 9070 XT (RADV GFX1201)","driver":"radv Mesa 26.2.4-arch1.1","os":"Linux 7.2.9-arch1-1","resolution":"3840x2160","window":{"spec":"seconds 100:30","first_present":1182,"ms":30102.816},"presents":325,"frame_ms":{"p50":87.85,"p90":113.641,"p99":120.253,"max":122.562},"gpu_busy_ms_per_present":48.443,"trace":"aps5-trace-f8b22edfb7f5-388013.json.gz"}
{"commit":"f8b22edfb7f5","dirty":true,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"100:30"},"gpu":"AMD Radeon RX 9070 XT (RADV GFX1201)","driver":"radv Mesa 26.2.4-arch1.1","os":"Linux 7.2.9-arch1-1","resolution":"3840x2160","window":{"spec":"seconds 100:30","first_present":934,"ms":30053.807},"presents":236,"frame_ms":{"p50":126.393,"p90":129.001,"p99":153.913,"max":155.756},"gpu_busy_ms_per_present":79.603,"trace":"aps5-trace-f8b22edfb7f5-384471.json.gz"}
{"commit":"f8b22edfb7f5","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"100:30"},"gpu":"AMD Radeon RX 9070 XT (RADV GFX1201)","driver":"radv Mesa 26.2.4-arch1.1","os":"Linux 7.2.9-arch1-1","resolution":"3840x2160","window":{"spec":"seconds 100:30","first_present":1032,"ms":30016.046},"presents":254,"frame_ms":{"p50":117.267,"p90":121.144,"p99":147.852,"max":152.264},"gpu_busy_ms_per_present":82.231,"trace":"aps5-trace-f8b22edfb7f5-395030.json.gz"}
{"commit":"f8b22edfb7f5","dirty":true,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"100:30"},"gpu":"AMD Radeon RX 9070 XT (RADV GFX1201)","driver":"radv Mesa 26.2.4-arch1.1","os":"Linux 7.2.9-arch1-1","resolution":"3840x2160","window":{"spec":"seconds 100:30","first_present":1115,"ms":30058.106},"presents":295,"frame_ms":{"p50":99.901,"p90":108.835,"p99":124.458,"max":136.9},"gpu_busy_ms_per_present":80.439,"trace":"aps5-trace-f8b22edfb7f5-391491.json.gz"}

The traces are kept locally; I can attach any of them. ctest -R '^agc_' six times with -j16: 629 of 630 pass each time (agc_driver_tessellation segfaults on main too).

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6232900082 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6951#issuecomment-6232900082). Originally posted by [alfalfa-star](https://github.com/alfalfa-star) on 2026-10-17T10:37:42Z. --- Thanks. I measured each part on its own, and the PR is now one topic. I force-pushed it down to the part that is on by default and measurably faster: the run memo (`ae409e197`, on current `main`). The title and description changed accordingly. What happened to the rest: Kena (PPSA01802), forest title scene, no input. `main` f8b22edfb + each part, warm cache, `APS5_TRACE_SECONDS=100:30`, three rotated rounds per batch. Linux 7.2.9, RX 9070 XT, RADV Mesa 26.2.4. | build (one batch) | presents in 30 s | |---|---| | `main` | 191 / 227 / 208 | | run memo + incremental refresh | 234 / 243 / 244 | | the same with `APS5_NO_INCREMENTAL_IMPORT_REFRESH=1` | 239 / 235 / 248 | | the whole previous PR, mirror off | 344 / 323 / 314 | | the whole previous PR, `APS5_SPAN_MIRROR=1` (another batch) | the same as mirror off | - **Incremental refresh and journal:** they added nothing on top of the memo, so I removed them. That also answers the journal questions by deletion. For the record: the journal was bounded at 8192 entries and fell back to the full walk once a refresh's starting generation was older than the oldest entry. It also flaked `spaceReadList` twice in six parallel ctest runs, which neither `main` nor this version does. On the remap test you asked for: an unmap or remap of an imported range can't leave a stale import, journal or not, because the pin waiter retires imports over a range before a mutation changes it. What the refresh does need to see is a run that grows next to an unchanged import. The new test covers that case and failed when the incremental refresh skipped its walk. - **Span mirror:** no measurable gain, so it's out, with `APS5_SPAN_NO_FLUSH`. - **Fragmented-backing import:** most of the difference between the memo and the whole previous PR (+36 %) came from this part. It imported a window whose direct-memory backing is scattered as one `UDMABUF_CREATE_LIST`, and it was on by default, which the old description didn't make clear. It's out of this PR too. #4449 already implements the same idea (a dma-buf run list for scattered direct memory), so I won't open a competing PR. I'll post the Kena numbers there instead. Windows: this version touches no Linux-only code. I can't run the `agc_*` suite on Windows here; the memo is plain C++ on the lease, the same on both. Measurement of this version (rotated with another build; one run of each reached a lighter stretch with 48 ms GPU busy instead of about 80 and isn't comparable): | build | presents in 30 s | p50 frame ms | GPU busy ms per present | |---|---|---|---| | `main` | 216 / 325* / 254 | 130.2 / 87.8 / 117.3 | 78.2 / 48.4 / 82.2 | | this PR | 321* / 236 / 295 | 84.5 / 126.4 / 99.9 | 48.7 / 79.6 / 80.4 | <details><summary>Summary lines</summary> ```json {"commit":"f8b22edfb7f5","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"100:30"},"gpu":"AMD Radeon RX 9070 XT (RADV GFX1201)","driver":"radv Mesa 26.2.4-arch1.1","os":"Linux 7.2.9-arch1-1","resolution":"3840x2160","window":{"spec":"seconds 100:30","first_present":771,"ms":30041.458},"presents":216,"frame_ms":{"p50":130.2,"p90":161.713,"p99":275.775,"max":455.902},"gpu_busy_ms_per_present":78.23,"trace":"aps5-trace-f8b22edfb7f5-370363.json.gz"} {"commit":"f8b22edfb7f5","dirty":true,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"100:30"},"gpu":"AMD Radeon RX 9070 XT (RADV GFX1201)","driver":"radv Mesa 26.2.4-arch1.1","os":"Linux 7.2.9-arch1-1","resolution":"3840x2160","window":{"spec":"seconds 100:30","first_present":1187,"ms":30077.514},"presents":321,"frame_ms":{"p50":84.548,"p90":115.084,"p99":123.446,"max":210.047},"gpu_busy_ms_per_present":48.711,"trace":"aps5-trace-f8b22edfb7f5-377486.json.gz"} {"commit":"f8b22edfb7f5","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"100:30"},"gpu":"AMD Radeon RX 9070 XT (RADV GFX1201)","driver":"radv Mesa 26.2.4-arch1.1","os":"Linux 7.2.9-arch1-1","resolution":"3840x2160","window":{"spec":"seconds 100:30","first_present":1182,"ms":30102.816},"presents":325,"frame_ms":{"p50":87.85,"p90":113.641,"p99":120.253,"max":122.562},"gpu_busy_ms_per_present":48.443,"trace":"aps5-trace-f8b22edfb7f5-388013.json.gz"} {"commit":"f8b22edfb7f5","dirty":true,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"100:30"},"gpu":"AMD Radeon RX 9070 XT (RADV GFX1201)","driver":"radv Mesa 26.2.4-arch1.1","os":"Linux 7.2.9-arch1-1","resolution":"3840x2160","window":{"spec":"seconds 100:30","first_present":934,"ms":30053.807},"presents":236,"frame_ms":{"p50":126.393,"p90":129.001,"p99":153.913,"max":155.756},"gpu_busy_ms_per_present":79.603,"trace":"aps5-trace-f8b22edfb7f5-384471.json.gz"} {"commit":"f8b22edfb7f5","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"100:30"},"gpu":"AMD Radeon RX 9070 XT (RADV GFX1201)","driver":"radv Mesa 26.2.4-arch1.1","os":"Linux 7.2.9-arch1-1","resolution":"3840x2160","window":{"spec":"seconds 100:30","first_present":1032,"ms":30016.046},"presents":254,"frame_ms":{"p50":117.267,"p90":121.144,"p99":147.852,"max":152.264},"gpu_busy_ms_per_present":82.231,"trace":"aps5-trace-f8b22edfb7f5-395030.json.gz"} {"commit":"f8b22edfb7f5","dirty":true,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"100:30"},"gpu":"AMD Radeon RX 9070 XT (RADV GFX1201)","driver":"radv Mesa 26.2.4-arch1.1","os":"Linux 7.2.9-arch1-1","resolution":"3840x2160","window":{"spec":"seconds 100:30","first_present":1115,"ms":30058.106},"presents":295,"frame_ms":{"p50":99.901,"p90":108.835,"p99":124.458,"max":136.9},"gpu_busy_ms_per_present":80.439,"trace":"aps5-trace-f8b22edfb7f5-391491.json.gz"} ``` </details> The traces are kept locally; I can attach any of them. `ctest -R '^agc_'` six times with `-j16`: 629 of 630 pass each time (`agc_driver_tessellation` segfaults on `main` too). AI-assisted: yes (Claude Code)
adriadam10 commented 2026-10-19 11:54:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-19T11:54:05Z.

Review: CHANGES_REQUESTED


Thanks for narrowing this to the memo. One correctness problem before it can merge:

  • GuestBufferMemory.cpp:1301-1309: the memo is keyed on &lease[0] + size + index + window and validated only against the first and last range of the run. Each registry invalidation builds a new Lease::Ranges vector (GuestAllocations.cpp:636-642) and the old one is freed when its last lease is released, so a later snapshot can be allocated at the same address with the same size (unmap one range, map another). If a middle range of the run, or the neighbour just outside it (first - 1 / last + 1, which decides whether the run extends), is a different range in the new snapshot, the stale bounds still pass the check and the import covers the wrong memory.
  • Fix direction: key the memo on a snapshot identity that cannot be recycled, e.g. GuestAllocationsGeneration() read when the lease was acquired (or hold a shared_ptr to the Ranges vector in the entry so its address cannot be reused while the memo refers to it).
  • BdaResources.cpp importRunGrowthTests only covers a size change. Add a case where a range is unmapped and a different one mapped so the vector keeps its size, and the run must change.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5571129753 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6951#pullrequestreview-5571129753). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-19T11:54:05Z. **Review:** CHANGES_REQUESTED --- Thanks for narrowing this to the memo. One correctness problem before it can merge: - `GuestBufferMemory.cpp:1301-1309`: the memo is keyed on `&lease[0]` + size + index + window and validated only against the first and last range of the run. Each registry invalidation builds a new `Lease::Ranges` vector (`GuestAllocations.cpp:636-642`) and the old one is freed when its last lease is released, so a later snapshot can be allocated at the same address with the same size (unmap one range, map another). If a middle range of the run, or the neighbour just outside it (`first - 1` / `last + 1`, which decides whether the run extends), is a different range in the new snapshot, the stale bounds still pass the check and the import covers the wrong memory. - Fix direction: key the memo on a snapshot identity that cannot be recycled, e.g. `GuestAllocationsGeneration()` read when the lease was acquired (or hold a `shared_ptr` to the `Ranges` vector in the entry so its address cannot be reused while the memo refers to it). - `BdaResources.cpp` `importRunGrowthTests` only covers a size change. Add a case where a range is unmapped and a different one mapped so the vector keeps its size, and the run must change.
JJenkx commented 2026-10-19 13:47:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-19T13:47:27Z.


Isolated author-fix benchmark, 2026-10-19: main 8444508241a9e4a6f5d5604d007451ce62d39cc0 versus main plus only this PR at author head a69514fe75bf0baa30c1e19a144ea10b3ec43606 (local candidate 71b4f9bcedd4c67d5c397e4a586991ff3fdf1d36). Original authorship preserved; no #7938, #6321, #6617 or separate local correctness amendment included. Exact candidate branch.

PPSA05347, Record of Lodoss War: Deedlit in Wonder Labyrinth, stationary initial forest tutorial, HP100/100. Same Ryzen 9 7950X / RX 6650 XT / RADV Mesa 26.2.4-arch1.1 / Linux 7.2.9-arch1-1.

Measurement Main Main + #6951
Presents / capture 728 / 30.019 s 898 / 30.016 s
Average FPS 24.251 29.918
p50 frame 39.591 ms 32.452 ms
p90 frame 52.725 ms 38.882 ms
p99 frame 63.794 ms 46.836 ms

+23.37% FPS in this single ordered main/candidate pair. Independent initially empty per-source shader/Mesa caches, owned by the game user before launch; 195-second warm-up, then fresh 250-second measured process. Identical scripted inputs, no movement at checkpoint, only APS5_TRACE_SECONDS=200:30 among tracing/profiling switches, measured stdout on a real PTY. Same 1536×864 logical window on DP-2, 3072×1728 swapchain; official trace reports 3840×2160. The 190/240-second screenshots show matching scenes and readable tutorial text, with no obvious rendering difference.

All four processes exited 0 and are gone; temporary kernel limit restored to 64 MiB. Both measured runs retain four existing storage-image GPU-results-pending shutdown warnings. No VUID, assertion failure, abort or segfault in measured terminal output. The same four focused tests pass on main with regression tests and on the candidate, Vulkan required, shader cache disabled, Khronos validation enabled, with no skips or missing-layer/VUID messages; conventions pass. One scene and one ordered pair do not establish statistical significance, long-session stability, console-equivalent behavior or gains in other titles.

Official summary lines from both complete traces:

{"commit":"8444508241a9","dirty":false,"env":{"APS5_DRAW_CACHE_ENTRIES":"4096","APS5_HOST_IMPORT_MIB":"16384","APS5_PAD_INPUT_FILE":"<path>","APS5_PIPELINED_DRAWS":"1","APS5_SPIRV_OPT":"full","APS5_TRACE_SECONDS":"200:30"},"gpu":"AMD Radeon RX 6650 XT (RADV NAVI23)","driver":"radv Mesa 26.2.4-arch1.1","os":"Linux 7.2.9-arch1-1","resolution":"3840x2160","window":{"spec":"seconds 200:30","first_present":9429,"ms":30019.156},"presents":728,"frame_ms":{"p50":39.591,"p90":52.725,"p99":63.794,"max":69.436},"gpu_busy_ms_per_present":2.266,"worker_busy_pct":{"queue worker 0x0":41.356},"top_phases_ms_per_frame":{"Driver.Packet":17.05,"Driver.Packet.device_lock":11.767,"Graphics.Draw":8.796,"Graphics.Draw.validate":6.999,"Driver.Packet.prepare_memory":4.472,"Recorder.Sync":2.826,"GpuMutex.wait.label":2.786,"GpuMutex.wait.other":2.631},"trace_dropped":false,"trace":"aps5-trace-8444508241a9-1957981.json.gz"}
{"commit":"71b4f9bcedd4","dirty":false,"env":{"APS5_DRAW_CACHE_ENTRIES":"4096","APS5_HOST_IMPORT_MIB":"16384","APS5_PAD_INPUT_FILE":"<path>","APS5_PIPELINED_DRAWS":"1","APS5_SPIRV_OPT":"full","APS5_TRACE_SECONDS":"200:30"},"gpu":"AMD Radeon RX 6650 XT (RADV NAVI23)","driver":"radv Mesa 26.2.4-arch1.1","os":"Linux 7.2.9-arch1-1","resolution":"3840x2160","window":{"spec":"seconds 200:30","first_present":10103,"ms":30015.865},"presents":898,"frame_ms":{"p50":32.452,"p90":38.882,"p99":46.836,"max":51.553},"gpu_busy_ms_per_present":2.205,"worker_busy_pct":{"queue worker 0x0":23.479},"top_phases_ms_per_frame":{"Driver.Packet":7.841,"Driver.Packet.device_lock":4.998,"Graphics.Draw":3.112,"Driver.Packet.prepare_memory":2.003,"Recorder.Sync":1.957,"Graphics.Draw.validate":1.911,"VideoOut.Flip":1.416,"VideoOut.Flip.present":1.384},"trace_dropped":false,"trace":"aps5-trace-71b4f9bcedd4-2117957.json.gz"}

Main trace · Candidate trace · Main digest · Candidate digest · Evidence: exact patch, commands, logs, reports, screenshots and checksums

AI-assisted: yes. Earlier pinned evidence follows.


Refresh with author fix a69514fe75 (2026-10-19): switched the local integration to your current snapshot-identity implementation; my earlier amendment below is historical and is no longer needed in this integration. Refreshed branch, head 225a1f9fe075439adfc7b1ab50188eee195a9c1b, is main 48790e0233fd2237aac77f25683339d3bc0d4c8f + #7938 + your two current commits + #6321. Original authorship is preserved.

The same four focused tests (agc_driver_graphics, guest_memory, guest_mmap_fixed_anonymous, MemoryPoolTest) pass on main with the allocator/snapshot regressions added, on the refreshed composition, and with APS5_NO_RUN_MEMO=1. RX 6650 XT, RADV Mesa 26.2.4-arch1.1, Linux 7.2.9-arch1-1; Vulkan required, shader cache disabled, Khronos validation enabled. No skips, missing-layer messages, or VUID- errors. Conventions pass. Exact commands, verbose logs and source patch.

This is refreshed composition/correctness evidence, not a new performance measurement or an isolated measurement of this PR. The earlier benchmark remains pinned to its earlier sources. AI-assisted: yes.


Update 2026-10-19: snapshot-identity correctness amendment and an incremental composition test.

I reproduced the same-count snapshot replacement problem raised in review. An extracted-helper repro reuses the lease vector address, count and endpoint pointers after replacing a middle range with a writable range: cached bounds remain 0:2, while fresh bounds are 0:0.

The attached amendment adds an immutable snapshot owner-identity check using a weak_ptr and owner_before. It keeps the existing memo algorithm, reserves control-block identity without pinning the snapshot or mapped ranges, and invalidates hits when the registry publishes a different snapshot. It also adds a lease-identity test, a graphics regression alternating the middle range's protections, and the missing environment-variable documentation.

The actual agc_driver_graphics regression fails when only the snapshot-identity hit condition is removed and passes when it is restored. The isolated repro likewise fails before and passes after. These are correctness tests; the earlier performance result below does not establish correctness.

Amendment patch · Evidence bundle: reproduction sources, red/green logs, focused test logs, protocol, six screenshots, reports, digests and hashes

Current composition experiment on PPSA05347, Record of Lodoss War – Deedlit in Wonder Labyrinth, stationary initial forest tutorial, HP100/100:

  • Base 6e3f0020b16d0890226118645042fec3d5e9ea65 = upstream main 43a2abaf775337665afb5d32ba0c39cbd4469d2c + allocator PR #7938.
  • Candidate effb226e3ee903a0ad15131e8d9e90613f9d7cf6 = base + this PR's unchanged ae409e197880b67df18090076e7206b9a256d491 (local cherry-pick 7b6edf19ffda1ff98aa8d73ed6bf37fa1c5890f5) + the snapshot-identity amendment.
Measurement Base: main + #7938 Base + #6951 + identity amendment
Presents / capture 778 / 30.033 s 893 / 30.012 s
Average FPS 25.905 29.755
p50 frame 36.707 ms 32.457 ms
p90 frame 51.156 ms 39.882 ms
p99 frame 62.171 ms 49.794 ms
Maximum frame 69.747 ms 55.728 ms

+14.86% average FPS in this single matched pair. This is the incremental contribution above #7938, not a main-versus-combined result or a general gameplay claim.

Same Ryzen 9 7950X / RX6650XT / RADV Mesa26.2.4-arch1.1 / Linux7.2.9-arch1-1. Each arm used separate initially empty shader/Mesa caches, a 195-second warm-up, then a fresh 250-second measured process. Identical scripted inputs, no movement at checkpoint, APS5_TRACE_SECONDS=200:30, no other profiling flags. Measured stdout inherited a real PTY without redirection. Same 1536×864 logical window on DP-2; the protocol records the 3072×1728 swapchain and trace-reported 3840×2160 separately. Pipeline1, SPIR-V full, draw cache4096 and host import16384MiB matched. All four processes exited0 at scheduled close, no surviving game PID, temporary udmabuf8192MiB restored to64MiB.

Six screenshots show the same scene, readable tutorial and HP100/100 without an obvious rendering difference. Both measured runs printed a vkAllocateMemory (-1000072003) host-import failure with fallback to copies. This does not establish long-session stability or Windows/macOS correctness.

On the same Linux/GPU, the base and corrected candidate passed agc_driver_graphics, guest_memory, guest_mmap_fixed_anonymous and MemoryPoolTest, with ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation and verbose ctest logs. No missing-layer warning or VUID- was found in either log. Conventions check passed. The peer implementation remains credited to its author; this is a supporting amendment and test report, not a duplicate implementation PR.

Summary lines from the two traces:

{"commit":"6e3f0020b16d","dirty":false,"env":{"APS5_DRAW_CACHE_ENTRIES":"4096","APS5_HOST_IMPORT_MIB":"16384","APS5_PAD_INPUT_FILE":"<path>","APS5_PIPELINED_DRAWS":"1","APS5_SPIRV_OPT":"full","APS5_TRACE_SECONDS":"200:30"},"gpu":"AMD Radeon RX 6650 XT (RADV NAVI23)","driver":"radv Mesa 26.2.4-arch1.1","os":"Linux 7.2.9-arch1-1","resolution":"3840x2160","window":{"spec":"seconds 200:30","first_present":9694,"ms":30032.904},"presents":778,"frame_ms":{"p50":36.707,"p90":51.156,"p99":62.171,"max":69.747},"gpu_busy_ms_per_present":2.276,"worker_busy_pct":{"queue worker 0x0":44.512},"top_phases_ms_per_frame":{"Driver.Packet":17.179,"Driver.Packet.device_lock":11.857,"Graphics.Draw":9.008,"Graphics.Draw.validate":7.213,"Driver.Packet.prepare_memory":4.495,"GpuMutex.wait.other":2.897,"Recorder.Sync":2.803,"GpuMutex.wait.label":2.751},"trace_dropped":false,"trace":"aps5-trace-6e3f0020b16d-3138974.json.gz"}
{"commit":"effb226e3ee9","dirty":false,"env":{"APS5_DRAW_CACHE_ENTRIES":"4096","APS5_HOST_IMPORT_MIB":"16384","APS5_PAD_INPUT_FILE":"<path>","APS5_PIPELINED_DRAWS":"1","APS5_SPIRV_OPT":"full","APS5_TRACE_SECONDS":"200:30"},"gpu":"AMD Radeon RX 6650 XT (RADV NAVI23)","driver":"radv Mesa 26.2.4-arch1.1","os":"Linux 7.2.9-arch1-1","resolution":"3840x2160","window":{"spec":"seconds 200:30","first_present":10111,"ms":30012.157},"presents":893,"frame_ms":{"p50":32.457,"p90":39.882,"p99":49.794,"max":55.728},"gpu_busy_ms_per_present":2.127,"worker_busy_pct":{"queue worker 0x0":22.541},"top_phases_ms_per_frame":{"Driver.Packet":7.566,"Driver.Packet.device_lock":4.745,"Graphics.Draw":3.051,"Driver.Packet.prepare_memory":2.034,"Recorder.Sync":1.999,"Graphics.Draw.validate":1.924,"VideoOut.Flip":1.698,"Driver.Present":1.671},"trace_dropped":false,"trace":"aps5-trace-effb226e3ee9-3302613.json.gz"}

Base trace · Candidate trace · Base digest · Candidate digest


Historical pure-main comparison (unchanged; prior source pin and shorter capture):

Supporting performance test on PPSA05347, Record of Lodoss War – Deedlit in Wonder Labyrinth, stationary initial forest/tutorial checkpoint.

Tested pure main 5eba12d6bd3f4f2a2b1beee872f66cbd2b09d894 against that main plus only this PR's commit ae409e197880b67df18090076e7206b9a256d491 (local cherry-pick 5dd45a70f40b5df972e45e762b26fad61586025b). No diagnostic instrumentation or other peer changes.

Measurement Main Main + #6951
Presents / capture 258 / 10.028 s 303 / 10.020 s
Average FPS 25.73 30.24
Median frame 37.255 ms 32.232 ms
p90 frame 46.897 ms 38.765 ms
p99 frame 68.352 ms 45.702 ms

This single pair measured +17.5% average FPS in this scene. Graphics.Draw fell from 6.883 to 2.735 ms/present and Driver.Packet.device_lock from 9.515 to 4.287 ms/present. This is supporting evidence for this title/scene, not a claim about all gameplay or other titles.

Same machine/session: Ryzen 9 7950X, RX 6650 XT / RADV NAVI23, Mesa 26.2.4-arch1.1, Linux 7.2.9-arch1-1. Both used independent initially empty shader/Mesa cache directories, ran the scene once, then restarted for the measured warm-cache capture. Identical scripted inputs; no movement at the captured checkpoint. Screenshots at 190 and 210 seconds confirm matching camera, tutorial and HP 100/100. Same 1536×864 logical window on DP-2, 3072×1728 swapchain; the trace summary reports 3840×2160.

Only APS5_TRACE_SECONDS=200:10 was set among trace/profile switches. Measured game output stayed on a real PTY with no log redirection. Both traces are complete (trace_dropped=false). Both versions passed the same 12 focused tests with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, and VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, using the same RADV device: zero VUID- messages and no missing validation layer. Warm-up and measured runs all exited 0 and restored the prior kernel setting. Existing GPU-results-pending storage-image teardown warnings remain; these short runs do not establish long-session stability.

Summary lines from aps5-summary.jsonl:

{"commit":"5eba12d6bd3f","dirty":false,"env":{"APS5_DRAW_CACHE_ENTRIES":"4096","APS5_HOST_IMPORT_MIB":"16384","APS5_PAD_INPUT_FILE":"<path>","APS5_PIPELINED_DRAWS":"1","APS5_SPIRV_OPT":"full","APS5_TRACE_SECONDS":"200:10"},"gpu":"AMD Radeon RX 6650 XT (RADV NAVI23)","driver":"radv Mesa 26.2.4-arch1.1","os":"Linux 7.2.9-arch1-1","resolution":"3840x2160","window":{"spec":"seconds 200:10","first_present":9617,"ms":10028.421},"presents":258,"frame_ms":{"p50":37.255,"p90":46.897,"p99":68.352,"max":72.859},"gpu_busy_ms_per_present":2.233,"worker_busy_pct":{"queue worker 0x0":35.706},"top_phases_ms_per_frame":{"Driver.Packet":13.875,"Driver.Packet.device_lock":9.515,"Graphics.Draw":6.883,"Graphics.Draw.validate":5.174,"Driver.Packet.prepare_memory":3.607,"Recorder.Sync":2.373,"GpuMutex.wait.label":1.952,"GpuMutex.wait.other":1.889},"trace_dropped":false,"trace":"aps5-trace-5eba12d6bd3f-626333.json.gz"}
{"commit":"5dd45a70f40b","dirty":false,"env":{"APS5_DRAW_CACHE_ENTRIES":"4096","APS5_HOST_IMPORT_MIB":"16384","APS5_PAD_INPUT_FILE":"<path>","APS5_PIPELINED_DRAWS":"1","APS5_SPIRV_OPT":"full","APS5_TRACE_SECONDS":"200:10"},"gpu":"AMD Radeon RX 6650 XT (RADV NAVI23)","driver":"radv Mesa 26.2.4-arch1.1","os":"Linux 7.2.9-arch1-1","resolution":"3840x2160","window":{"spec":"seconds 200:10","first_present":10121,"ms":10020.485},"presents":303,"frame_ms":{"p50":32.232,"p90":38.765,"p99":45.702,"max":48.857},"gpu_busy_ms_per_present":2.212,"worker_busy_pct":{"queue worker 0x0":20.746},"top_phases_ms_per_frame":{"Driver.Packet":6.851,"Driver.Packet.device_lock":4.287,"Graphics.Draw":2.735,"Recorder.Sync":1.847,"Driver.Packet.prepare_memory":1.825,"VideoOut.Flip":1.777,"Driver.Present":1.75,"VideoOut.Flip.present":1.747},"trace_dropped":false,"trace":"aps5-trace-5dd45a70f40b-795876.json.gz"}

Main trace · Candidate trace · Report · Evidence bundle: both trace digests, test logs, protocol, summaries and hashes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6268760410 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6951#issuecomment-6268760410). Originally posted by [JJenkx](https://github.com/JJenkx) on 2026-10-19T13:47:27Z. --- **Isolated author-fix benchmark, 2026-10-19:** main `8444508241a9e4a6f5d5604d007451ce62d39cc0` versus main plus only this PR at author head `a69514fe75bf0baa30c1e19a144ea10b3ec43606` (local candidate `71b4f9bcedd4c67d5c397e4a586991ff3fdf1d36`). Original authorship preserved; no #7938, #6321, #6617 or separate local correctness amendment included. [Exact candidate branch](https://github.com/JJenkx/AnyPS5/tree/perf/import-run-isolated-sync160). PPSA05347, Record of Lodoss War: Deedlit in Wonder Labyrinth, stationary initial forest tutorial, HP100/100. Same Ryzen 9 7950X / RX 6650 XT / RADV Mesa 26.2.4-arch1.1 / Linux 7.2.9-arch1-1. | Measurement | Main | Main + #6951 | |---|---:|---:| | Presents / capture | 728 / 30.019 s | 898 / 30.016 s | | Average FPS | 24.251 | 29.918 | | p50 frame | 39.591 ms | 32.452 ms | | p90 frame | 52.725 ms | 38.882 ms | | p99 frame | 63.794 ms | 46.836 ms | **+23.37% FPS in this single ordered main/candidate pair.** Independent initially empty per-source shader/Mesa caches, owned by the game user before launch; 195-second warm-up, then fresh 250-second measured process. Identical scripted inputs, no movement at checkpoint, only `APS5_TRACE_SECONDS=200:30` among tracing/profiling switches, measured stdout on a real PTY. Same 1536×864 logical window on DP-2, 3072×1728 swapchain; official trace reports 3840×2160. The 190/240-second screenshots show matching scenes and readable tutorial text, with no obvious rendering difference. All four processes exited 0 and are gone; temporary kernel limit restored to 64 MiB. Both measured runs retain four existing storage-image GPU-results-pending shutdown warnings. No VUID, assertion failure, abort or segfault in measured terminal output. The same four focused tests pass on main with regression tests and on the candidate, Vulkan required, shader cache disabled, Khronos validation enabled, with no skips or missing-layer/VUID messages; conventions pass. One scene and one ordered pair do not establish statistical significance, long-session stability, console-equivalent behavior or gains in other titles. Official summary lines from both complete traces: ```json {"commit":"8444508241a9","dirty":false,"env":{"APS5_DRAW_CACHE_ENTRIES":"4096","APS5_HOST_IMPORT_MIB":"16384","APS5_PAD_INPUT_FILE":"<path>","APS5_PIPELINED_DRAWS":"1","APS5_SPIRV_OPT":"full","APS5_TRACE_SECONDS":"200:30"},"gpu":"AMD Radeon RX 6650 XT (RADV NAVI23)","driver":"radv Mesa 26.2.4-arch1.1","os":"Linux 7.2.9-arch1-1","resolution":"3840x2160","window":{"spec":"seconds 200:30","first_present":9429,"ms":30019.156},"presents":728,"frame_ms":{"p50":39.591,"p90":52.725,"p99":63.794,"max":69.436},"gpu_busy_ms_per_present":2.266,"worker_busy_pct":{"queue worker 0x0":41.356},"top_phases_ms_per_frame":{"Driver.Packet":17.05,"Driver.Packet.device_lock":11.767,"Graphics.Draw":8.796,"Graphics.Draw.validate":6.999,"Driver.Packet.prepare_memory":4.472,"Recorder.Sync":2.826,"GpuMutex.wait.label":2.786,"GpuMutex.wait.other":2.631},"trace_dropped":false,"trace":"aps5-trace-8444508241a9-1957981.json.gz"} {"commit":"71b4f9bcedd4","dirty":false,"env":{"APS5_DRAW_CACHE_ENTRIES":"4096","APS5_HOST_IMPORT_MIB":"16384","APS5_PAD_INPUT_FILE":"<path>","APS5_PIPELINED_DRAWS":"1","APS5_SPIRV_OPT":"full","APS5_TRACE_SECONDS":"200:30"},"gpu":"AMD Radeon RX 6650 XT (RADV NAVI23)","driver":"radv Mesa 26.2.4-arch1.1","os":"Linux 7.2.9-arch1-1","resolution":"3840x2160","window":{"spec":"seconds 200:30","first_present":10103,"ms":30015.865},"presents":898,"frame_ms":{"p50":32.452,"p90":38.882,"p99":46.836,"max":51.553},"gpu_busy_ms_per_present":2.205,"worker_busy_pct":{"queue worker 0x0":23.479},"top_phases_ms_per_frame":{"Driver.Packet":7.841,"Driver.Packet.device_lock":4.998,"Graphics.Draw":3.112,"Driver.Packet.prepare_memory":2.003,"Recorder.Sync":1.957,"Graphics.Draw.validate":1.911,"VideoOut.Flip":1.416,"VideoOut.Flip.present":1.384},"trace_dropped":false,"trace":"aps5-trace-71b4f9bcedd4-2117957.json.gz"} ``` [Main trace](https://github.com/JJenkx/AnyPS5/releases/download/game-library-checks-20261016/aps5-trace-8444508241a9-1957981.json.gz) · [Candidate trace](https://github.com/JJenkx/AnyPS5/releases/download/game-library-checks-20261016/aps5-trace-71b4f9bcedd4-2117957.json.gz) · [Main digest](https://github.com/JJenkx/AnyPS5/releases/download/game-library-checks-20261016/sync160-main-digest.txt) · [Candidate digest](https://github.com/JJenkx/AnyPS5/releases/download/game-library-checks-20261016/sync160-candidate-digest.txt) · [Evidence: exact patch, commands, logs, reports, screenshots and checksums](https://github.com/JJenkx/AnyPS5/releases/download/game-library-checks-20261016/sync160-import-run-isolated-evidence.tar.gz) AI-assisted: yes. Earlier pinned evidence follows. --- **Refresh with author fix `a69514fe75` (2026-10-19):** switched the local integration to your current snapshot-identity implementation; my earlier amendment below is historical and is no longer needed in this integration. [Refreshed branch](https://github.com/JJenkx/AnyPS5/tree/perf/import-run-overlap-sync159), head `225a1f9fe075439adfc7b1ab50188eee195a9c1b`, is main `48790e0233fd2237aac77f25683339d3bc0d4c8f` + #7938 + your two current commits + #6321. Original authorship is preserved. The same four focused tests (`agc_driver_graphics`, `guest_memory`, `guest_mmap_fixed_anonymous`, `MemoryPoolTest`) pass on main with the allocator/snapshot regressions added, on the refreshed composition, and with `APS5_NO_RUN_MEMO=1`. RX 6650 XT, RADV Mesa 26.2.4-arch1.1, Linux 7.2.9-arch1-1; Vulkan required, shader cache disabled, Khronos validation enabled. No skips, missing-layer messages, or `VUID-` errors. Conventions pass. [Exact commands, verbose logs and source patch](https://github.com/JJenkx/AnyPS5/releases/download/game-library-checks-20261016/sync159-composed-peer-refresh-validation.tar.gz). This is refreshed composition/correctness evidence, not a new performance measurement or an isolated measurement of this PR. The earlier benchmark remains pinned to its earlier sources. AI-assisted: yes. --- Update 2026-10-19: **snapshot-identity correctness amendment and an incremental composition test**. I reproduced the same-count snapshot replacement problem raised in review. An extracted-helper repro reuses the lease vector address, count and endpoint pointers after replacing a middle range with a writable range: cached bounds remain `0:2`, while fresh bounds are `0:0`. The attached amendment adds an immutable snapshot owner-identity check using a `weak_ptr` and `owner_before`. It keeps the existing memo algorithm, reserves control-block identity without pinning the snapshot or mapped ranges, and invalidates hits when the registry publishes a different snapshot. It also adds a lease-identity test, a graphics regression alternating the middle range's protections, and the missing environment-variable documentation. The actual `agc_driver_graphics` regression **fails when only the snapshot-identity hit condition is removed and passes when it is restored**. The isolated repro likewise fails before and passes after. These are correctness tests; the earlier performance result below does not establish correctness. [Amendment patch](https://github.com/JJenkx/AnyPS5/releases/download/game-library-checks-20261016/sync148-snapshot-identity-amendment.patch) · [Evidence bundle: reproduction sources, red/green logs, focused test logs, protocol, six screenshots, reports, digests and hashes](https://github.com/JJenkx/AnyPS5/releases/download/game-library-checks-20261016/sync148-composed-import-evidence.tar.gz) Current composition experiment on **PPSA05347, Record of Lodoss War – Deedlit in Wonder Labyrinth**, stationary initial forest tutorial, HP100/100: - Base `6e3f0020b16d0890226118645042fec3d5e9ea65` = upstream main `43a2abaf775337665afb5d32ba0c39cbd4469d2c` + allocator PR #7938. - Candidate `effb226e3ee903a0ad15131e8d9e90613f9d7cf6` = base + this PR's unchanged `ae409e197880b67df18090076e7206b9a256d491` (local cherry-pick `7b6edf19ffda1ff98aa8d73ed6bf37fa1c5890f5`) + the snapshot-identity amendment. | Measurement | Base: main + #7938 | Base + #6951 + identity amendment | |---|---:|---:| | Presents / capture | 778 / 30.033 s | 893 / 30.012 s | | Average FPS | 25.905 | 29.755 | | p50 frame | 36.707 ms | 32.457 ms | | p90 frame | 51.156 ms | 39.882 ms | | p99 frame | 62.171 ms | 49.794 ms | | Maximum frame | 69.747 ms | 55.728 ms | **+14.86% average FPS in this single matched pair. This is the incremental contribution above #7938, not a main-versus-combined result or a general gameplay claim.** Same Ryzen 9 7950X / RX6650XT / RADV Mesa26.2.4-arch1.1 / Linux7.2.9-arch1-1. Each arm used separate initially empty shader/Mesa caches, a 195-second warm-up, then a fresh 250-second measured process. Identical scripted inputs, no movement at checkpoint, `APS5_TRACE_SECONDS=200:30`, no other profiling flags. Measured stdout inherited a real PTY without redirection. Same 1536×864 logical window on DP-2; the protocol records the 3072×1728 swapchain and trace-reported 3840×2160 separately. Pipeline1, SPIR-V full, draw cache4096 and host import16384MiB matched. All four processes exited0 at scheduled close, no surviving game PID, temporary udmabuf8192MiB restored to64MiB. Six screenshots show the same scene, readable tutorial and HP100/100 without an obvious rendering difference. Both measured runs printed a `vkAllocateMemory (-1000072003)` host-import failure with fallback to copies. This does not establish long-session stability or Windows/macOS correctness. On the same Linux/GPU, the base and corrected candidate passed `agc_driver_graphics`, `guest_memory`, `guest_mmap_fixed_anonymous` and `MemoryPoolTest`, with `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation` and verbose ctest logs. No missing-layer warning or `VUID-` was found in either log. Conventions check passed. The peer implementation remains credited to its author; this is a supporting amendment and test report, not a duplicate implementation PR. Summary lines from the two traces: ```json {"commit":"6e3f0020b16d","dirty":false,"env":{"APS5_DRAW_CACHE_ENTRIES":"4096","APS5_HOST_IMPORT_MIB":"16384","APS5_PAD_INPUT_FILE":"<path>","APS5_PIPELINED_DRAWS":"1","APS5_SPIRV_OPT":"full","APS5_TRACE_SECONDS":"200:30"},"gpu":"AMD Radeon RX 6650 XT (RADV NAVI23)","driver":"radv Mesa 26.2.4-arch1.1","os":"Linux 7.2.9-arch1-1","resolution":"3840x2160","window":{"spec":"seconds 200:30","first_present":9694,"ms":30032.904},"presents":778,"frame_ms":{"p50":36.707,"p90":51.156,"p99":62.171,"max":69.747},"gpu_busy_ms_per_present":2.276,"worker_busy_pct":{"queue worker 0x0":44.512},"top_phases_ms_per_frame":{"Driver.Packet":17.179,"Driver.Packet.device_lock":11.857,"Graphics.Draw":9.008,"Graphics.Draw.validate":7.213,"Driver.Packet.prepare_memory":4.495,"GpuMutex.wait.other":2.897,"Recorder.Sync":2.803,"GpuMutex.wait.label":2.751},"trace_dropped":false,"trace":"aps5-trace-6e3f0020b16d-3138974.json.gz"} {"commit":"effb226e3ee9","dirty":false,"env":{"APS5_DRAW_CACHE_ENTRIES":"4096","APS5_HOST_IMPORT_MIB":"16384","APS5_PAD_INPUT_FILE":"<path>","APS5_PIPELINED_DRAWS":"1","APS5_SPIRV_OPT":"full","APS5_TRACE_SECONDS":"200:30"},"gpu":"AMD Radeon RX 6650 XT (RADV NAVI23)","driver":"radv Mesa 26.2.4-arch1.1","os":"Linux 7.2.9-arch1-1","resolution":"3840x2160","window":{"spec":"seconds 200:30","first_present":10111,"ms":30012.157},"presents":893,"frame_ms":{"p50":32.457,"p90":39.882,"p99":49.794,"max":55.728},"gpu_busy_ms_per_present":2.127,"worker_busy_pct":{"queue worker 0x0":22.541},"top_phases_ms_per_frame":{"Driver.Packet":7.566,"Driver.Packet.device_lock":4.745,"Graphics.Draw":3.051,"Driver.Packet.prepare_memory":2.034,"Recorder.Sync":1.999,"Graphics.Draw.validate":1.924,"VideoOut.Flip":1.698,"Driver.Present":1.671},"trace_dropped":false,"trace":"aps5-trace-effb226e3ee9-3302613.json.gz"} ``` [Base trace](https://github.com/JJenkx/AnyPS5/releases/download/game-library-checks-20261016/aps5-trace-6e3f0020b16d-3138974.json.gz) · [Candidate trace](https://github.com/JJenkx/AnyPS5/releases/download/game-library-checks-20261016/aps5-trace-effb226e3ee9-3302613.json.gz) · [Base digest](https://github.com/JJenkx/AnyPS5/releases/download/game-library-checks-20261016/sync148-main-digest.txt) · [Candidate digest](https://github.com/JJenkx/AnyPS5/releases/download/game-library-checks-20261016/sync148-candidate-digest.txt) --- Historical pure-main comparison (unchanged; prior source pin and shorter capture): Supporting performance test on **PPSA05347, Record of Lodoss War – Deedlit in Wonder Labyrinth**, stationary initial forest/tutorial checkpoint. Tested pure main `5eba12d6bd3f4f2a2b1beee872f66cbd2b09d894` against that main plus only this PR's commit `ae409e197880b67df18090076e7206b9a256d491` (local cherry-pick `5dd45a70f40b5df972e45e762b26fad61586025b`). No diagnostic instrumentation or other peer changes. | Measurement | Main | Main + #6951 | |---|---:|---:| | Presents / capture | 258 / 10.028 s | 303 / 10.020 s | | Average FPS | 25.73 | 30.24 | | Median frame | 37.255 ms | 32.232 ms | | p90 frame | 46.897 ms | 38.765 ms | | p99 frame | 68.352 ms | 45.702 ms | This single pair measured **+17.5% average FPS** in this scene. `Graphics.Draw` fell from 6.883 to 2.735 ms/present and `Driver.Packet.device_lock` from 9.515 to 4.287 ms/present. This is supporting evidence for this title/scene, not a claim about all gameplay or other titles. Same machine/session: Ryzen 9 7950X, RX 6650 XT / RADV NAVI23, Mesa 26.2.4-arch1.1, Linux 7.2.9-arch1-1. Both used independent initially empty shader/Mesa cache directories, ran the scene once, then restarted for the measured warm-cache capture. Identical scripted inputs; no movement at the captured checkpoint. Screenshots at 190 and 210 seconds confirm matching camera, tutorial and HP 100/100. Same 1536×864 logical window on DP-2, 3072×1728 swapchain; the trace summary reports 3840×2160. Only `APS5_TRACE_SECONDS=200:10` was set among trace/profile switches. Measured game output stayed on a real PTY with no log redirection. Both traces are complete (`trace_dropped=false`). Both versions passed the same 12 focused tests with `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1`, and `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, using the same RADV device: zero `VUID-` messages and no missing validation layer. Warm-up and measured runs all exited 0 and restored the prior kernel setting. Existing GPU-results-pending storage-image teardown warnings remain; these short runs do not establish long-session stability. Summary lines from `aps5-summary.jsonl`: ```json {"commit":"5eba12d6bd3f","dirty":false,"env":{"APS5_DRAW_CACHE_ENTRIES":"4096","APS5_HOST_IMPORT_MIB":"16384","APS5_PAD_INPUT_FILE":"<path>","APS5_PIPELINED_DRAWS":"1","APS5_SPIRV_OPT":"full","APS5_TRACE_SECONDS":"200:10"},"gpu":"AMD Radeon RX 6650 XT (RADV NAVI23)","driver":"radv Mesa 26.2.4-arch1.1","os":"Linux 7.2.9-arch1-1","resolution":"3840x2160","window":{"spec":"seconds 200:10","first_present":9617,"ms":10028.421},"presents":258,"frame_ms":{"p50":37.255,"p90":46.897,"p99":68.352,"max":72.859},"gpu_busy_ms_per_present":2.233,"worker_busy_pct":{"queue worker 0x0":35.706},"top_phases_ms_per_frame":{"Driver.Packet":13.875,"Driver.Packet.device_lock":9.515,"Graphics.Draw":6.883,"Graphics.Draw.validate":5.174,"Driver.Packet.prepare_memory":3.607,"Recorder.Sync":2.373,"GpuMutex.wait.label":1.952,"GpuMutex.wait.other":1.889},"trace_dropped":false,"trace":"aps5-trace-5eba12d6bd3f-626333.json.gz"} {"commit":"5dd45a70f40b","dirty":false,"env":{"APS5_DRAW_CACHE_ENTRIES":"4096","APS5_HOST_IMPORT_MIB":"16384","APS5_PAD_INPUT_FILE":"<path>","APS5_PIPELINED_DRAWS":"1","APS5_SPIRV_OPT":"full","APS5_TRACE_SECONDS":"200:10"},"gpu":"AMD Radeon RX 6650 XT (RADV NAVI23)","driver":"radv Mesa 26.2.4-arch1.1","os":"Linux 7.2.9-arch1-1","resolution":"3840x2160","window":{"spec":"seconds 200:10","first_present":10121,"ms":10020.485},"presents":303,"frame_ms":{"p50":32.232,"p90":38.765,"p99":45.702,"max":48.857},"gpu_busy_ms_per_present":2.212,"worker_busy_pct":{"queue worker 0x0":20.746},"top_phases_ms_per_frame":{"Driver.Packet":6.851,"Driver.Packet.device_lock":4.287,"Graphics.Draw":2.735,"Recorder.Sync":1.847,"Driver.Packet.prepare_memory":1.825,"VideoOut.Flip":1.777,"Driver.Present":1.75,"VideoOut.Flip.present":1.747},"trace_dropped":false,"trace":"aps5-trace-5dd45a70f40b-795876.json.gz"} ``` [Main trace](https://github.com/JJenkx/AnyPS5/releases/download/game-library-checks-20261016/aps5-trace-5eba12d6bd3f-626333.json.gz) · [Candidate trace](https://github.com/JJenkx/AnyPS5/releases/download/game-library-checks-20261016/aps5-trace-5dd45a70f40b-795876.json.gz) · [Report](https://github.com/JJenkx/AnyPS5/releases/download/game-library-checks-20261016/sync141-pr6951-lodoss-report.json) · [Evidence bundle: both trace digests, test logs, protocol, summaries and hashes](https://github.com/JJenkx/AnyPS5/releases/download/game-library-checks-20261016/sync141-pr6951-lodoss-evidence.tar.gz)
github-actions[bot] commented 2026-10-19 16:59:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-19T16:59:05Z.


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:6272607107 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6951#issuecomment-6272607107). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-19T16:59:05Z. --- <!-- 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`.
alfalfa-star commented 2026-10-19 16:59:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by alfalfa-star on 2026-10-19T16:59:29Z.


@adriadam10 Fixed in a69514fe7, rebased on main dbac9fa15 (force-pushed).

  • The memo entry now holds a std::weak_ptr to the lease's Ranges snapshot (Lease::Snapshot(), a new accessor in GuestAllocations.hpp). A hit requires the same owner (owner_before both ways), index, window and window block. While the entry exists, its weak reference keeps the snapshot's control block allocated, so a later snapshot can't take over its identity. It doesn't pin the ranges or the vector's contents. A snapshot is immutable, so the size and first/last range checks are gone.
  • New test importRunReplacedTests (BdaResources.cpp, in agc_driver_graphics): three adjacent pieces, the middle one read-only, so the run at the first piece is one piece long. The test then replaces the middle piece four times, alternating writable and read-only, so the registry keeps three ranges. After each replacement the import must cover 3 pieces, then 1.
    • Before the fix it fails on the first replacement: "the import of a run does not cover its 3 registered pieces after the middle piece was replaced by one that continues the run, with as many ranges registered as before". That is your case of the range just outside the run, with a recycled snapshot address.
    • It passes with the fix, and with APS5_NO_RUN_MEMO=1 on the old code.
  • APS5_NO_RUN_MEMO has its row in docs/dev/ENVIRONMENT.md.

agc_driver_*, guest_memory* and guest_mmap* pass on Linux 7.2.9, RX 9070 XT, RADV Mesa 26.2.4, Release, except four that fail the same way on plain main here (image_table_vouched_lookups, bda_device, guest_memory_lifetime, tessellation). The conventions check passes.

@JJenkx thanks for reproducing it and for the Lodoss numbers. Your amendment uses the same weak-owner idea. I wrote the change on the rebased branch rather than applying the patch.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6272614742 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6951#issuecomment-6272614742). Originally posted by [alfalfa-star](https://github.com/alfalfa-star) on 2026-10-19T16:59:29Z. --- @adriadam10 Fixed in a69514fe7, rebased on `main` dbac9fa15 (force-pushed). - The memo entry now holds a `std::weak_ptr` to the lease's `Ranges` snapshot (`Lease::Snapshot()`, a new accessor in `GuestAllocations.hpp`). A hit requires the same owner (`owner_before` both ways), index, window and window block. While the entry exists, its weak reference keeps the snapshot's control block allocated, so a later snapshot can't take over its identity. It doesn't pin the ranges or the vector's contents. A snapshot is immutable, so the size and first/last range checks are gone. - New test `importRunReplacedTests` (`BdaResources.cpp`, in `agc_driver_graphics`): three adjacent pieces, the middle one read-only, so the run at the first piece is one piece long. The test then replaces the middle piece four times, alternating writable and read-only, so the registry keeps three ranges. After each replacement the import must cover 3 pieces, then 1. - Before the fix it fails on the first replacement: "the import of a run does not cover its 3 registered pieces after the middle piece was replaced by one that continues the run, with as many ranges registered as before". That is your case of the range just outside the run, with a recycled snapshot address. - It passes with the fix, and with `APS5_NO_RUN_MEMO=1` on the old code. - `APS5_NO_RUN_MEMO` has its row in `docs/dev/ENVIRONMENT.md`. `agc_driver_*`, `guest_memory*` and `guest_mmap*` pass on Linux 7.2.9, RX 9070 XT, RADV Mesa 26.2.4, Release, except four that fail the same way on plain `main` here (`image_table_vouched_lookups`, `bda_device`, `guest_memory_lifetime`, `tessellation`). The conventions check passes. @JJenkx thanks for reproducing it and for the Lodoss numbers. Your amendment uses the same weak-owner idea. I wrote the change on the rebased branch rather than applying the patch. AI-assisted: yes (Claude Code)
JJenkx commented 2026-10-19 19:40:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-19T19:40:57Z.


Current-main follow-up with DMA enabled in both builds, 2026-10-19: main da3ea52b53d9d0fb0b4938035798de7c765a2341 versus main plus only the two commits from author head a69514fe75bf0baa30c1e19a144ea10b3ec43606 (local candidate a63eab2f850d686fe931e93c169ee681b0fe821f). Exact candidate branch.

PPSA05347, Record of Lodoss War: Deedlit in Wonder Labyrinth, stationary initial forest tutorial, HP 100/100. Same Ryzen 9 7950X, AMD RX 6650 XT, RADV Mesa 26.2.4-arch1.1, Linux 7.2.9-arch1-1.

Measurement Main Main + #6951
Presents / capture 802 / 30.028 s 911 / 30.017 s
Average FPS 26.708 30.349
p50 frame 35.923 ms 32.282 ms
p90 frame 44.666 ms 36.343 ms
p99 frame 56.101 ms 43.104 ms

+13.63% FPS in one candidate/main ordered pair. This supports a gain on top of DMA in this scene; it is not a replicated or cross-title result.

Initially identical private warm shader/Mesa cache clones (file hashes included), identical scripted input, APS5_TRACE_SECONDS=200:30, no profiling switches beyond the official trace, stdout on a real PTY. The window was 1536×864 on DP-2; the official trace reports 3840×2160. Both 190/240-second screenshot pairs show the same forest tutorial checkpoint, readable text and no obvious rendering difference. Both native processes and supervisors exited 0, the PIDs are gone, and the temporary kernel limit was restored to 64 MiB. Neither terminal log contains a VUID, assertion, segmentation fault or device-loss message.

Focused correctness checks used required Vulkan, disabled shader cache and Khronos validation on both builds. All 18 selected cases executed with no skips or missing-layer messages. 17/18 pass on each build; agc_driver_guest_memory_lifetime fails identically at guest prefix unmap failed, after a rejected GPU submission, and both logs contain VUID-vkResetFences-pFences-01123. No additional failing case or new VUID appears with this PR. The partial-unmap issue is being checked separately against #7849. The enabled execution-source list and complete logs are included; this is not an all-green test claim.

Official summary lines:

{"commit":"da3ea52b53d9","dirty":false,"env":{"APS5_DRAW_CACHE_ENTRIES":"4096","APS5_HOST_IMPORT_MIB":"16384","APS5_PAD_INPUT_FILE":"<path>","APS5_PIPELINED_DRAWS":"1","APS5_PIPELINE_DMA":"1","APS5_SPIRV_OPT":"full","APS5_TRACE_SECONDS":"200:30"},"gpu":"AMD Radeon RX 6650 XT (RADV NAVI23)","driver":"radv Mesa 26.2.4-arch1.1","os":"Linux 7.2.9-arch1-1","resolution":"3840x2160","window":{"spec":"seconds 200:30","first_present":9644,"ms":30028.223},"presents":802,"frame_ms":{"p50":35.923,"p90":44.666,"p99":56.101,"max":63.783},"gpu_busy_ms_per_present":2.168,"worker_busy_pct":{"queue worker 0x0":27.877},"top_phases_ms_per_frame":{"Driver.Packet":10.427,"Graphics.Draw":5.048,"Graphics.Draw.validate":3.376,"Recorder.Sync":1.701,"Graphics.Draw.draw_and_resource_release":1.66,"VideoOut.Flip":1.654,"VideoOut.Flip.present":1.618,"Driver.Present":1.618},"trace_dropped":false,"trace":"aps5-trace-da3ea52b53d9-4175613.json.gz"}
{"commit":"a63eab2f850d","dirty":false,"env":{"APS5_DRAW_CACHE_ENTRIES":"4096","APS5_HOST_IMPORT_MIB":"16384","APS5_PAD_INPUT_FILE":"<path>","APS5_PIPELINED_DRAWS":"1","APS5_PIPELINE_DMA":"1","APS5_SPIRV_OPT":"full","APS5_TRACE_SECONDS":"200:30"},"gpu":"AMD Radeon RX 6650 XT (RADV NAVI23)","driver":"radv Mesa 26.2.4-arch1.1","os":"Linux 7.2.9-arch1-1","resolution":"3840x2160","window":{"spec":"seconds 200:30","first_present":10081,"ms":30017.221},"presents":911,"frame_ms":{"p50":32.282,"p90":36.343,"p99":43.104,"max":54.728},"gpu_busy_ms_per_present":2.165,"worker_busy_pct":{"queue worker 0x0":19.371},"top_phases_ms_per_frame":{"Driver.Packet":6.371,"Graphics.Draw":2.736,"VideoOut.Flip":1.803,"VideoOut.Flip.present":1.768,"Driver.Present":1.766,"Driver.Present.render_fence_wait":1.608,"Vulkan.Retire":1.608,"Vulkan.Retire.wait":1.604},"trace_dropped":false,"trace":"aps5-trace-a63eab2f850d-4077559.json.gz"}

Complete traces, trace_digest outputs, summaries, scripts, manifests, focused/native logs and four screenshots. SHA-256: 3b0754b2f279a2442ff576b837089b2710792ceebde6b6f9c16f5f5e31588280.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6275722572 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6951#issuecomment-6275722572). Originally posted by [JJenkx](https://github.com/JJenkx) on 2026-10-19T19:40:57Z. --- Current-main follow-up with DMA enabled in both builds, 2026-10-19: main `da3ea52b53d9d0fb0b4938035798de7c765a2341` versus main plus only the two commits from author head `a69514fe75bf0baa30c1e19a144ea10b3ec43606` (local candidate `a63eab2f850d686fe931e93c169ee681b0fe821f`). [Exact candidate branch](https://github.com/JJenkx/AnyPS5/tree/perf/import-run-dma-sync169). PPSA05347, Record of Lodoss War: Deedlit in Wonder Labyrinth, stationary initial forest tutorial, HP 100/100. Same Ryzen 9 7950X, AMD RX 6650 XT, RADV Mesa 26.2.4-arch1.1, Linux 7.2.9-arch1-1. | Measurement | Main | Main + #6951 | |---|---:|---:| | Presents / capture | 802 / 30.028 s | 911 / 30.017 s | | Average FPS | 26.708 | 30.349 | | p50 frame | 35.923 ms | 32.282 ms | | p90 frame | 44.666 ms | 36.343 ms | | p99 frame | 56.101 ms | 43.104 ms | **+13.63% FPS in one candidate/main ordered pair.** This supports a gain on top of DMA in this scene; it is not a replicated or cross-title result. Initially identical private warm shader/Mesa cache clones (file hashes included), identical scripted input, `APS5_TRACE_SECONDS=200:30`, no profiling switches beyond the official trace, stdout on a real PTY. The window was 1536×864 on DP-2; the official trace reports 3840×2160. Both 190/240-second screenshot pairs show the same forest tutorial checkpoint, readable text and no obvious rendering difference. Both native processes and supervisors exited 0, the PIDs are gone, and the temporary kernel limit was restored to 64 MiB. Neither terminal log contains a VUID, assertion, segmentation fault or device-loss message. Focused correctness checks used required Vulkan, disabled shader cache and Khronos validation on both builds. All 18 selected cases executed with no skips or missing-layer messages. **17/18 pass on each build**; `agc_driver_guest_memory_lifetime` fails identically at `guest prefix unmap failed`, after a rejected GPU submission, and both logs contain `VUID-vkResetFences-pFences-01123`. No additional failing case or new VUID appears with this PR. The partial-unmap issue is being checked separately against #7849. The enabled execution-source list and complete logs are included; this is not an all-green test claim. Official summary lines: ```json {"commit":"da3ea52b53d9","dirty":false,"env":{"APS5_DRAW_CACHE_ENTRIES":"4096","APS5_HOST_IMPORT_MIB":"16384","APS5_PAD_INPUT_FILE":"<path>","APS5_PIPELINED_DRAWS":"1","APS5_PIPELINE_DMA":"1","APS5_SPIRV_OPT":"full","APS5_TRACE_SECONDS":"200:30"},"gpu":"AMD Radeon RX 6650 XT (RADV NAVI23)","driver":"radv Mesa 26.2.4-arch1.1","os":"Linux 7.2.9-arch1-1","resolution":"3840x2160","window":{"spec":"seconds 200:30","first_present":9644,"ms":30028.223},"presents":802,"frame_ms":{"p50":35.923,"p90":44.666,"p99":56.101,"max":63.783},"gpu_busy_ms_per_present":2.168,"worker_busy_pct":{"queue worker 0x0":27.877},"top_phases_ms_per_frame":{"Driver.Packet":10.427,"Graphics.Draw":5.048,"Graphics.Draw.validate":3.376,"Recorder.Sync":1.701,"Graphics.Draw.draw_and_resource_release":1.66,"VideoOut.Flip":1.654,"VideoOut.Flip.present":1.618,"Driver.Present":1.618},"trace_dropped":false,"trace":"aps5-trace-da3ea52b53d9-4175613.json.gz"} {"commit":"a63eab2f850d","dirty":false,"env":{"APS5_DRAW_CACHE_ENTRIES":"4096","APS5_HOST_IMPORT_MIB":"16384","APS5_PAD_INPUT_FILE":"<path>","APS5_PIPELINED_DRAWS":"1","APS5_PIPELINE_DMA":"1","APS5_SPIRV_OPT":"full","APS5_TRACE_SECONDS":"200:30"},"gpu":"AMD Radeon RX 6650 XT (RADV NAVI23)","driver":"radv Mesa 26.2.4-arch1.1","os":"Linux 7.2.9-arch1-1","resolution":"3840x2160","window":{"spec":"seconds 200:30","first_present":10081,"ms":30017.221},"presents":911,"frame_ms":{"p50":32.282,"p90":36.343,"p99":43.104,"max":54.728},"gpu_busy_ms_per_present":2.165,"worker_busy_pct":{"queue worker 0x0":19.371},"top_phases_ms_per_frame":{"Driver.Packet":6.371,"Graphics.Draw":2.736,"VideoOut.Flip":1.803,"VideoOut.Flip.present":1.768,"Driver.Present":1.766,"Driver.Present.render_fence_wait":1.608,"Vulkan.Retire":1.608,"Vulkan.Retire.wait":1.604},"trace_dropped":false,"trace":"aps5-trace-a63eab2f850d-4077559.json.gz"} ``` [Complete traces, trace_digest outputs, summaries, scripts, manifests, focused/native logs and four screenshots](https://github.com/JJenkx/AnyPS5/releases/download/game-library-checks-20261016/sync169-import-memo-dma-evidence.tar.gz). SHA-256: `3b0754b2f279a2442ff576b837089b2710792ceebde6b6f9c16f5f5e31588280`. AI-assisted: yes.
JJenkx commented 2026-10-19 19:57:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-19T19:57:45Z.


Compatibility follow-up: #6951 retains its Lodoss benefit when combined with the partial-unmap lifetime correction in #7849. This is a comparison against main + #7849, not bare main.

Pinned upstream main: 8075b6af190ff8f83c1bff9a7f74cd71e5902140. Baseline 68a90e7d8ccf8bb9f3bca3b1da1b99e530f60ab4 contains only the three commits from #7849 author head 1ead0f921b72b97d0acf9140a55179063a79090e; candidate 5dab1820843d70b4323cf39de80d9452553eca00 adds only the two commits from this PR at a69514fe75bf0baa30c1e19a144ea10b3ec43606. Exact patches and commit author log are attached.

Same Ryzen 9 7950X / RX 6650 XT, RADV Mesa 26.2.4-arch1.1, Linux 7.2.9-arch1-1; PPSA05347 stationary initial forest tutorial, HP 100/100. DMA enabled in both, initially identical independent warm shader/Mesa cache clones, same scripted input and official APS5_TRACE_SECONDS=200:30 capture. Baseline ran first. Window 1536×864 on DP-2; official trace reports 3840×2160.

Measurement Main + #7849 Main + #7849 + #6951
Average FPS 26.533 30.429
p50 frame 36.095 ms 32.138 ms
p90 frame 44.755 ms 36.3 ms
p99 frame 57.16 ms 43.683 ms

+14.68% FPS in this single matched pair. This supports compatibility and a scene-specific benefit; it is not a replicated or cross-title claim.

Both builds: 18/18 focused tests pass with required Vulkan, disabled shader cache and Khronos validation, no skips, missing-layer messages or VUIDs. Both native runs exited 0 and closed, their PIDs are gone, and the temporary kernel limit was restored to 64 MiB. No VUID, assertion, segmentation fault or device-loss message in either native terminal log. The four 190/240-second captures show the same tutorial checkpoint with readable text and no obvious rendering difference; they cannot establish full gameplay correctness.

Official summary lines:

{"commit":"68a90e7d8ccf","dirty":false,"env":{"APS5_DRAW_CACHE_ENTRIES":"4096","APS5_HOST_IMPORT_MIB":"16384","APS5_PAD_INPUT_FILE":"<path>","APS5_PIPELINED_DRAWS":"1","APS5_PIPELINE_DMA":"1","APS5_SPIRV_OPT":"full","APS5_TRACE_SECONDS":"200:30"},"gpu":"AMD Radeon RX 6650 XT (RADV NAVI23)","driver":"radv Mesa 26.2.4-arch1.1","os":"Linux 7.2.9-arch1-1","resolution":"3840x2160","window":{"spec":"seconds 200:30","first_present":9714,"ms":30000.253},"presents":796,"frame_ms":{"p50":36.095,"p90":44.755,"p99":57.16,"max":69.305},"gpu_busy_ms_per_present":2.163,"worker_busy_pct":{"queue worker 0x0":28.279},"top_phases_ms_per_frame":{"Driver.Packet":10.648,"Graphics.Draw":5.253,"Graphics.Draw.validate":3.572,"Recorder.Sync":1.681,"Graphics.Draw.draw_and_resource_release":1.67,"VideoOut.Flip":1.6,"VideoOut.Flip.present":1.565,"Driver.Present":1.565},"trace_dropped":false,"trace":"aps5-trace-68a90e7d8ccf-261997.json.gz"}
{"commit":"5dab1820843d","dirty":false,"env":{"APS5_DRAW_CACHE_ENTRIES":"4096","APS5_HOST_IMPORT_MIB":"16384","APS5_PAD_INPUT_FILE":"<path>","APS5_PIPELINED_DRAWS":"1","APS5_PIPELINE_DMA":"1","APS5_SPIRV_OPT":"full","APS5_TRACE_SECONDS":"200:30"},"gpu":"AMD Radeon RX 6650 XT (RADV NAVI23)","driver":"radv Mesa 26.2.4-arch1.1","os":"Linux 7.2.9-arch1-1","resolution":"3840x2160","window":{"spec":"seconds 200:30","first_present":10095,"ms":30004.167},"presents":913,"frame_ms":{"p50":32.138,"p90":36.3,"p99":43.683,"max":60.632},"gpu_busy_ms_per_present":2.175,"worker_busy_pct":{"queue worker 0x0":19.387},"top_phases_ms_per_frame":{"Driver.Packet":6.359,"Graphics.Draw":2.688,"VideoOut.Flip":1.821,"VideoOut.Flip.present":1.787,"Driver.Present":1.787,"Driver.Present.render_fence_wait":1.615,"Vulkan.Retire":1.615,"Vulkan.Retire.wait":1.61},"trace_dropped":false,"trace":"aps5-trace-5dab1820843d-408230.json.gz"}

Traces, source patches, scripts, manifests, full test/native logs, reports and screenshots. SHA-256: 7c6289d68bb8a714ed55e5299d86ec27a1155ff4e9765847b097ac60fe3dff89.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6276035044 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6951#issuecomment-6276035044). Originally posted by [JJenkx](https://github.com/JJenkx) on 2026-10-19T19:57:45Z. --- Compatibility follow-up: #6951 retains its Lodoss benefit when combined with the partial-unmap lifetime correction in #7849. This is a comparison against **main + #7849**, not bare main. Pinned upstream main: `8075b6af190ff8f83c1bff9a7f74cd71e5902140`. Baseline `68a90e7d8ccf8bb9f3bca3b1da1b99e530f60ab4` contains only the three commits from #7849 author head `1ead0f921b72b97d0acf9140a55179063a79090e`; candidate `5dab1820843d70b4323cf39de80d9452553eca00` adds only the two commits from this PR at `a69514fe75bf0baa30c1e19a144ea10b3ec43606`. Exact patches and commit author log are attached. Same Ryzen 9 7950X / RX 6650 XT, RADV Mesa 26.2.4-arch1.1, Linux 7.2.9-arch1-1; PPSA05347 stationary initial forest tutorial, HP 100/100. DMA enabled in both, initially identical independent warm shader/Mesa cache clones, same scripted input and official `APS5_TRACE_SECONDS=200:30` capture. Baseline ran first. Window 1536×864 on DP-2; official trace reports 3840×2160. | Measurement | Main + #7849 | Main + #7849 + #6951 | |---|---:|---:| | Average FPS | 26.533 | 30.429 | | p50 frame | 36.095 ms | 32.138 ms | | p90 frame | 44.755 ms | 36.3 ms | | p99 frame | 57.16 ms | 43.683 ms | **+14.68% FPS in this single matched pair.** This supports compatibility and a scene-specific benefit; it is not a replicated or cross-title claim. Both builds: **18/18 focused tests pass** with required Vulkan, disabled shader cache and Khronos validation, no skips, missing-layer messages or VUIDs. Both native runs exited 0 and closed, their PIDs are gone, and the temporary kernel limit was restored to 64 MiB. No VUID, assertion, segmentation fault or device-loss message in either native terminal log. The four 190/240-second captures show the same tutorial checkpoint with readable text and no obvious rendering difference; they cannot establish full gameplay correctness. Official summary lines: ```json {"commit":"68a90e7d8ccf","dirty":false,"env":{"APS5_DRAW_CACHE_ENTRIES":"4096","APS5_HOST_IMPORT_MIB":"16384","APS5_PAD_INPUT_FILE":"<path>","APS5_PIPELINED_DRAWS":"1","APS5_PIPELINE_DMA":"1","APS5_SPIRV_OPT":"full","APS5_TRACE_SECONDS":"200:30"},"gpu":"AMD Radeon RX 6650 XT (RADV NAVI23)","driver":"radv Mesa 26.2.4-arch1.1","os":"Linux 7.2.9-arch1-1","resolution":"3840x2160","window":{"spec":"seconds 200:30","first_present":9714,"ms":30000.253},"presents":796,"frame_ms":{"p50":36.095,"p90":44.755,"p99":57.16,"max":69.305},"gpu_busy_ms_per_present":2.163,"worker_busy_pct":{"queue worker 0x0":28.279},"top_phases_ms_per_frame":{"Driver.Packet":10.648,"Graphics.Draw":5.253,"Graphics.Draw.validate":3.572,"Recorder.Sync":1.681,"Graphics.Draw.draw_and_resource_release":1.67,"VideoOut.Flip":1.6,"VideoOut.Flip.present":1.565,"Driver.Present":1.565},"trace_dropped":false,"trace":"aps5-trace-68a90e7d8ccf-261997.json.gz"} {"commit":"5dab1820843d","dirty":false,"env":{"APS5_DRAW_CACHE_ENTRIES":"4096","APS5_HOST_IMPORT_MIB":"16384","APS5_PAD_INPUT_FILE":"<path>","APS5_PIPELINED_DRAWS":"1","APS5_PIPELINE_DMA":"1","APS5_SPIRV_OPT":"full","APS5_TRACE_SECONDS":"200:30"},"gpu":"AMD Radeon RX 6650 XT (RADV NAVI23)","driver":"radv Mesa 26.2.4-arch1.1","os":"Linux 7.2.9-arch1-1","resolution":"3840x2160","window":{"spec":"seconds 200:30","first_present":10095,"ms":30004.167},"presents":913,"frame_ms":{"p50":32.138,"p90":36.3,"p99":43.683,"max":60.632},"gpu_busy_ms_per_present":2.175,"worker_busy_pct":{"queue worker 0x0":19.387},"top_phases_ms_per_frame":{"Driver.Packet":6.359,"Graphics.Draw":2.688,"VideoOut.Flip":1.821,"VideoOut.Flip.present":1.787,"Driver.Present":1.787,"Driver.Present.render_fence_wait":1.615,"Vulkan.Retire":1.615,"Vulkan.Retire.wait":1.61},"trace_dropped":false,"trace":"aps5-trace-5dab1820843d-408230.json.gz"} ``` [Traces, source patches, scripts, manifests, full test/native logs, reports and screenshots](https://github.com/JJenkx/AnyPS5/releases/download/game-library-checks-20261016/sync170-host-cut-memo-evidence.tar.gz). SHA-256: `7c6289d68bb8a714ed55e5299d86ec27a1155ff4e9765847b097ac60fe3dff89`. AI-assisted: yes.
MarcZX10 commented 2026-10-20 00:33:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T00:33:37Z.


Issue #8103 has a Windows repro where aligned import coalescing chooses a block that crosses ranges already outside write-watch, causing the resident 4x DCC color source to lose watch coverage. I have a local test-first candidate that filters coalesced runs by GuestMemory::Watched; it touches importRun, which this PR is restructuring, plus a regression in BdaResources.cpp.

I have not pushed or opened a competing PR. Would you prefer to consider this as a follow-up on your run-bounds change once that lands, or do you see a way to integrate the watch-coverage check cleanly here? I’ll keep the candidate local until we agree on the overlap and a Windows run can check the exact DCC case.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6280481183 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6951#issuecomment-6280481183). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-20T00:33:37Z. --- Issue #8103 has a Windows repro where aligned import coalescing chooses a block that crosses ranges already outside write-watch, causing the resident 4x DCC color source to lose watch coverage. I have a local test-first candidate that filters coalesced runs by `GuestMemory::Watched`; it touches `importRun`, which this PR is restructuring, plus a regression in `BdaResources.cpp`. I have not pushed or opened a competing PR. Would you prefer to consider this as a follow-up on your run-bounds change once that lands, or do you see a way to integrate the watch-coverage check cleanly here? I’ll keep the candidate local until we agree on the overlap and a Windows run can check the exact DCC case.
adriadam10 commented 2026-10-20 11:35:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-20T11:35:19Z.

Review: CHANGES_REQUESTED


The snapshot-identity fix and importRunReplacedTests address the earlier point. What is left is a conflict with main that needs a design decision, so we can't rebase it for you:

  • GuestBufferMemory.cpp conflicts: main rewrote importRun (largest and budget parameters, the halving window sizes, leasedRun, and the failedBlocks / refusals checks inside skipped/stillRefused).
  • Rebasing the memo onto it is not mechanical. The run importRun returns now depends on state outside the lease snapshot: largest, budget, state.failedBlocks, state.refusals and state.liveBytes. The current key (snapshot, index, window, window block) would return a stale run after a refusal is recorded or cleared, or when largest/budget differ between callers (sameRange, importAllocation, the import refresh).
  • Please rebase on current main and either memoize only the part that depends on the snapshot (the first/last walk before skipped/largest), applying those checks to the memoized bounds on every call, or key on the extra inputs. Add a test where a refusal or a failed block is recorded for a run between two lookups on the same snapshot, and the run must shrink.
  • #8103 (MarcZX10) also touches importRun to filter by GuestMemory::Watched; rebase on whichever lands first.
  • The perf label bot still asks for the two summary lines and tools/trace_digest.py output in the PR; the comment above has the lines, please add the digest after the rebase.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5584438752 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6951#pullrequestreview-5584438752). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-20T11:35:19Z. **Review:** CHANGES_REQUESTED --- The snapshot-identity fix and `importRunReplacedTests` address the earlier point. What is left is a conflict with `main` that needs a design decision, so we can't rebase it for you: - `GuestBufferMemory.cpp` conflicts: `main` rewrote `importRun` (`largest` and `budget` parameters, the halving window sizes, `leasedRun`, and the `failedBlocks` / `refusals` checks inside `skipped`/`stillRefused`). - Rebasing the memo onto it is not mechanical. The run `importRun` returns now depends on state outside the lease snapshot: `largest`, `budget`, `state.failedBlocks`, `state.refusals` and `state.liveBytes`. The current key (snapshot, index, window, window block) would return a stale run after a refusal is recorded or cleared, or when `largest`/`budget` differ between callers (`sameRange`, `importAllocation`, the import refresh). - Please rebase on current `main` and either memoize only the part that depends on the snapshot (the first/last walk before `skipped`/`largest`), applying those checks to the memoized bounds on every call, or key on the extra inputs. Add a test where a refusal or a failed block is recorded for a run between two lookups on the same snapshot, and the run must shrink. - #8103 (MarcZX10) also touches `importRun` to filter by `GuestMemory::Watched`; rebase on whichever lands first. - The `perf` label bot still asks for the two summary lines and `tools/trace_digest.py` output in the PR; the comment above has the lines, please add the digest after the rebase.
alfalfa-star commented 2026-10-20 17:10:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by alfalfa-star on 2026-10-20T17:10:44Z.


@adriadam10 Rebased on main 77e31219c as c3ac6b47f, one commit (force-pushed).

  • The memo now covers only the walk that depends on the snapshot. continuedRun memoizes the first and last index of the continuing ranges, keyed on a weak reference to the lease's Ranges snapshot, the containing index, the import window and the window's low end. importRunBounds then applies largest, skipped (failedBlocks, and stillRefused with the caller's budget and liveBytes) and the halving block search on every call, as importRun on main does. importRun is leasedRun over those bounds.
  • sameRange (both overloads), runCovers and the whole-run findImport in importAllocation compare against the bounds without copying the run's range pointers.
  • New importRunFailureShrinkTests: an 8 MiB window of 64 KiB pieces is imported, the imports are cleared and allocations limited to 4 MiB. A lookup of the same address on the unchanged registry then fails the 8 MiB block, and the retry must shrink to the 4 MiB block; a later lookup must not import the failed block again. With the skipped check dropped from the block search it fails (checked with importBlockFailureTests disabled, which otherwise fails first). importRunGrowthTests and importRunReplacedTests are kept.
  • Tests: tools/select_tests.py picked 1652; 1649 pass. agc_driver_guest_memory_lifetime, agc_driver_image_array_window_past_layer_limit and agc_driver_tessellation fail the same way on plain main 77e31219c here. agc_driver_graphics_tests passes with and without APS5_NO_RUN_MEMO=1.

Performance, Kena: Bridge of Spirits (PPSA01802) 02.008.000, forest title scene from a fixed save, no input, APS5_TRACE_SECONDS=100:30, RX 9070 XT / i7-13700KF, RADV Mesa 26.2.4, shared warm shader cache.

  • On plain main 77e31219c, and with this PR alike, three map-time host imports fail at vkAllocateMemory with -1000072003 (VK_ERROR_INVALID_EXTERNAL_HANDLE) early in the boot, and the "failed 3 times in a row" rule lowers the budget to the 3 MiB then live for the rest of the session: host import budget: 0 MiB live of 0 MiB (lowered after vkAllocateMemory failed ...), about 2.3 M imports refused, 12 to 21 presents per 30 s with either build. So both builds below carry the same one-line local stand-in (not in this PR) that leaves the ceiling alone for that result.
  • With it, alternating, presents per 30 s:
round 1 2 3 4 5 6 mean
main 334 331 363 295 356 333 335
this PR 363 349 crash 365 383 311 354

About +6 %, inside Kena's run-to-run spread; Kena is bound by Driver.Packet here, not by the run walk. JJenkx's Lodoss pairs above are the case where it shows.

  • Round 3 with this PR exited on SIGSEGV after the trace window started, so it has no summary: a memcpy in the game's own code read 0x8f83fb8c0, which was not mapped (nothing within 64 MiB of it; destination 0x2040), on the thread in sceKernelBatchMap2. It didn't happen in the other five runs with this PR or in the six on main. I can't tie it to this change, but I'm reporting it.

Round 1 pair below. The main build was made in the same worktree with main's GuestBufferMemory.cpp swapped in, so its line says c3ac6b47ffb6, dirty. Both traces dropped worker events after about 6 s, so the per-thread times are partial.

main 77e31219c (+ ceiling stand-in): summary line and tools/trace_digest.py

seconds 100:30 from present 856: 334 presents, frame p50 89.7 / p90 95.5 / p99 109.3 / max 120.5 ms, GPU busy 47.2 ms per present
AMD Radeon RX 9070 XT (RADV GFX1201), radv Mesa 26.2.4-arch1.1, Linux 7.2.9-arch1-1, 3840x2160, commit c3ac6b47ffb6 (dirty), dropped: yes

{"commit":"c3ac6b47ffb6","dirty":true,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"100:30"},"gpu":"AMD Radeon RX 9070 XT (RADV GFX1201)","driver":"radv Mesa 26.2.4-arch1.1","os":"Linux 7.2.9-arch1-1","cpu":"13th Gen Intel(R) Core(TM) i7-13700KF","cpu_threads":24,"memory_mib":31870,"title_id":"PPSA01802","title":"Kena: Bridge of Spirits","content_version":"02.008.000","resolution":"3840x2160","window":{"spec":"seconds 100:30","first_present":856,"ms":30047.57},"presents":334,"frame_ms":{"p50":89.741,"p90":95.536,"p99":109.318,"max":120.51},"gpu_busy_ms_per_present":47.168,"worker_busy_pct":{"queue worker 0x0":98.49,"queue worker 0x20":64.766},"top_phases_ms_per_frame":{"Driver.Packet":146.001,"Graphics.Draw":58.682,"Driver.Packet.memory_wait":57.259,"Driver.Packet.draw":56.515,"Driver.Draw":56.306,"Graphics.Draw.draw_and_resource_release":42.477,"Driver.Draw.shader_compile_and_link":27.804,"Shader.DrawStage":25.038},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":5.933,"events_lost":1082191,"totals_full":false},"draw committer":{"events_full_after_s":17.628,"events_lost":186641,"totals_full":false}},"trace":"aps5-trace-c3ac6b47ffb6-134679.json.gz"}

Slowest frames (largest slices inside each, inclusive)

  • present 1092: 120.5 ms at 21595 ms: Driver.Packet (queue worker 0x20) 77.9, Driver.Packet.memory_wait (queue worker 0x20) 77.2, batch (gpu) 49.9, Driver.WorkerWait (queue worker 0x20) 42.5
  • present 882: 118.0 ms at 2382 ms: Driver.Packet (queue worker 0x0) 102.4, Driver.Packet (queue worker 0x20) 80.5, Driver.Packet.memory_wait (queue worker 0x20) 79.7, Driver.Packet.draw (queue worker 0x0) 75.8
  • present 1089: 112.8 ms at 21285 ms: Driver.Packet (queue worker 0x20) 72.8, Driver.Packet.memory_wait (queue worker 0x20) 71.6, batch (gpu) 49.3, Driver.WorkerWait (queue worker 0x20) 39.8

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
queue worker 0x0 14.9 (17 %) 0.0 (0 %) 75.1 18.1 Driver.Packet 14.8, Driver.EndSubmission 0.1
draw committer 29.4 (33 %) 0.3 (0 %) 60.2 15.3 Graphics.Draw 27.2, Recorder.Submit 2.0
presenter 0.2 (0 %) 0.9 (1 %) 88.8 0.1 VideoOut.Flip 1.2, Driver.Present 0.0
queue worker 0x20 0.7 (1 %) 89.1 (99 %) 0.2 0.1 Driver.Packet 58.1, Driver.EndSubmission 0.1
gpu 47.2 (52 %) 0.0 (0 %) 42.8 0.0 batch 47.2

Largest slices (ms per frame, inclusive, all threads): Driver.Packet 72.9, Driver.Packet.memory_wait 57.2, batch 47.2, Driver.WorkerWait 31.5, Driver.WorkerWait.idle_and_completion_poll 31.5, Graphics.Draw 27.6

Longest waits

  • Driver.Packet.memory_wait (queue worker 0x20) 76.3 ms at 2438 ms, present 882
  • Driver.Packet.memory_wait (queue worker 0x20) 76.3 ms at 21653 ms, present 1092
  • Driver.Packet.memory_wait (queue worker 0x20) 70.6 ms at 21349 ms, present 1089
  • Driver.Packet.memory_wait (queue worker 0x20) 69.6 ms at 21238 ms, present 1088
  • Driver.Packet.memory_wait (queue worker 0x20) 67.3 ms at 25682 ms, present 1139
  • Driver.Packet.memory_wait (queue worker 0x20) 67.1 ms at 21132 ms, present 1087

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

  • batch 15113: 7.9 ms at 21006 ms, present 1086: GPU no ranges; recorded by no CPU slices
  • batch 10126: 7.9 ms at 14083 ms, present 1010: GPU no ranges; recorded by Graphics.Draw (draw committer) 3.5, Graphics.Draw.validate (draw committer) 2.1, Graphics.Draw.draw_and_resource_release (draw committer) 1.1, Recorder.Submit (draw committer) 0.1
  • batch 357: 7.8 ms at 479 ms, present 861: GPU no ranges; recorded by Graphics.Draw (draw committer) 3.4, Graphics.Draw.validate (draw committer) 1.7, Graphics.Draw.draw_and_resource_release (draw committer) 1.4, Recorder.Submit (draw committer) 0.1
this PR c3ac6b47f (+ ceiling stand-in): summary line and tools/trace_digest.py

seconds 100:30 from present 1016: 363 presents, frame p50 82.7 / p90 86.8 / p99 93.1 / max 93.9 ms, GPU busy 44.0 ms per present
AMD Radeon RX 9070 XT (RADV GFX1201), radv Mesa 26.2.4-arch1.1, Linux 7.2.9-arch1-1, 3840x2160, commit c3ac6b47ffb6 (dirty), dropped: yes

{"commit":"c3ac6b47ffb6","dirty":true,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"100:30"},"gpu":"AMD Radeon RX 9070 XT (RADV GFX1201)","driver":"radv Mesa 26.2.4-arch1.1","os":"Linux 7.2.9-arch1-1","cpu":"13th Gen Intel(R) Core(TM) i7-13700KF","cpu_threads":24,"memory_mib":31870,"title_id":"PPSA01802","title":"Kena: Bridge of Spirits","content_version":"02.008.000","resolution":"3840x2160","window":{"spec":"seconds 100:30","first_present":1016,"ms":30063.929},"presents":363,"frame_ms":{"p50":82.656,"p90":86.849,"p99":93.066,"max":93.865},"gpu_busy_ms_per_present":43.989,"worker_busy_pct":{"queue worker 0x0":98.648,"queue worker 0x20":67.923},"top_phases_ms_per_frame":{"Driver.Packet":137.296,"Driver.Packet.memory_wait":55.43,"Driver.Packet.draw":45.981,"Driver.Draw":45.812,"Graphics.Draw":42.65,"Graphics.Draw.draw_and_resource_release":27.714,"Driver.Draw.shader_compile_and_link":22.585,"Shader.DrawStage":20.295},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":6.438,"events_lost":965751,"totals_full":false},"draw committer":{"events_full_after_s":20.956,"events_lost":114825,"totals_full":false}},"trace":"aps5-trace-c3ac6b47ffb6-138357.json.gz"}

Slowest frames (largest slices inside each, inclusive)

  • present 1191: 93.9 ms at 14458 ms: Driver.Packet (queue worker 0x20) 65.5, Driver.Packet.memory_wait (queue worker 0x20) 62.5, batch (gpu) 45.8, Graphics.Draw (draw committer) 36.6
  • present 1315: 93.7 ms at 24788 ms: Driver.Packet (queue worker 0x20) 62.1, Driver.Packet.memory_wait (queue worker 0x20) 61.0, batch (gpu) 46.4, Driver.WorkerWait (queue worker 0x20) 31.5
  • present 1171: 93.7 ms at 12744 ms: Driver.Packet (queue worker 0x20) 63.5, Driver.Packet.memory_wait (queue worker 0x20) 63.2, batch (gpu) 45.1, Graphics.Draw (draw committer) 38.5

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
queue worker 0x0 15.1 (18 %) 0.0 (0 %) 67.7 16.5 Driver.Packet 15.0, Driver.EndSubmission 0.1
draw committer 25.8 (31 %) 0.2 (0 %) 56.8 15.3 Graphics.Draw 23.7, Recorder.Submit 1.9
presenter 0.2 (0 %) 0.7 (1 %) 81.9 0.1 VideoOut.Flip 1.0, Driver.Present 0.0
queue worker 0x20 0.4 (0 %) 82.3 (99 %) 0.2 0.1 Driver.Packet 56.0, Driver.EndSubmission 0.2
gpu 44.0 (53 %) 0.0 (0 %) 38.8 0.0 batch 44.0

Largest slices (ms per frame, inclusive, all threads): Driver.Packet 71.0, Driver.Packet.memory_wait 55.4, batch 44.0, Driver.WorkerWait 26.4, Driver.WorkerWait.idle_and_completion_poll 26.4, Graphics.Draw 23.7

Longest waits

  • Driver.Packet.memory_wait (queue worker 0x20) 65.5 ms at 24654 ms, present 1313
  • Driver.Packet.memory_wait (queue worker 0x20) 63.4 ms at 14324 ms, present 1189
  • Driver.Packet.memory_wait (queue worker 0x20) 63.2 ms at 14420 ms, present 1190
  • Driver.Packet.memory_wait (queue worker 0x20) 62.6 ms at 24228 ms, present 1308
  • Driver.Packet.memory_wait (queue worker 0x20) 62.3 ms at 14231 ms, present 1188
  • Driver.Packet.memory_wait (queue worker 0x20) 62.0 ms at 28112 ms, present 1355

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

  • batch 18964: 5.3 ms at 28011 ms, present 1354: GPU no ranges; recorded by no CPU slices
  • batch 14130: 5.3 ms at 20880 ms, present 1268: GPU no ranges; recorded by Graphics.Draw (draw committer) 4.2, Graphics.Draw.validate (draw committer) 2.9, Graphics.Draw.draw_and_resource_release (draw committer) 1.0, Recorder.Submit (draw committer) 0.1
  • batch 19300: 5.3 ms at 28518 ms, present 1360: GPU no ranges; recorded by no CPU slices

@MarcZX10 Go ahead with your GuestMemory::Watched filter on its own; there's no need to fold it in here. The filter checks state outside the snapshot, so with this PR it belongs in importRunBounds beside skipped (run on every call), not in the memoized walk. Whichever lands first, the other rebases onto it.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6296641265 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6951#issuecomment-6296641265). Originally posted by [alfalfa-star](https://github.com/alfalfa-star) on 2026-10-20T17:10:44Z. --- @adriadam10 Rebased on `main` 77e31219c as c3ac6b47f, one commit (force-pushed). - The memo now covers only the walk that depends on the snapshot. `continuedRun` memoizes the first and last index of the continuing ranges, keyed on a weak reference to the lease's `Ranges` snapshot, the containing index, the import window and the window's low end. `importRunBounds` then applies `largest`, `skipped` (`failedBlocks`, and `stillRefused` with the caller's budget and `liveBytes`) and the halving block search on every call, as `importRun` on `main` does. `importRun` is `leasedRun` over those bounds. - `sameRange` (both overloads), `runCovers` and the whole-run `findImport` in `importAllocation` compare against the bounds without copying the run's range pointers. - New `importRunFailureShrinkTests`: an 8 MiB window of 64 KiB pieces is imported, the imports are cleared and allocations limited to 4 MiB. A lookup of the same address on the unchanged registry then fails the 8 MiB block, and the retry must shrink to the 4 MiB block; a later lookup must not import the failed block again. With the `skipped` check dropped from the block search it fails (checked with `importBlockFailureTests` disabled, which otherwise fails first). `importRunGrowthTests` and `importRunReplacedTests` are kept. - Tests: `tools/select_tests.py` picked 1652; 1649 pass. `agc_driver_guest_memory_lifetime`, `agc_driver_image_array_window_past_layer_limit` and `agc_driver_tessellation` fail the same way on plain `main` 77e31219c here. `agc_driver_graphics_tests` passes with and without `APS5_NO_RUN_MEMO=1`. Performance, Kena: Bridge of Spirits (PPSA01802) 02.008.000, forest title scene from a fixed save, no input, `APS5_TRACE_SECONDS=100:30`, RX 9070 XT / i7-13700KF, RADV Mesa 26.2.4, shared warm shader cache. - On plain `main` 77e31219c, and with this PR alike, three map-time host imports fail at `vkAllocateMemory` with `-1000072003` (`VK_ERROR_INVALID_EXTERNAL_HANDLE`) early in the boot, and the "failed 3 times in a row" rule lowers the budget to the 3 MiB then live for the rest of the session: `host import budget: 0 MiB live of 0 MiB (lowered after vkAllocateMemory failed ...)`, about 2.3 M imports refused, 12 to 21 presents per 30 s with either build. So both builds below carry the same one-line local stand-in (not in this PR) that leaves the ceiling alone for that result. - With it, alternating, presents per 30 s: | round | 1 | 2 | 3 | 4 | 5 | 6 | mean | |---|---|---|---|---|---|---|---| | `main` | 334 | 331 | 363 | 295 | 356 | 333 | 335 | | this PR | 363 | 349 | crash | 365 | 383 | 311 | 354 | About +6 %, inside Kena's run-to-run spread; Kena is bound by `Driver.Packet` here, not by the run walk. JJenkx's Lodoss pairs above are the case where it shows. - Round 3 with this PR exited on SIGSEGV after the trace window started, so it has no summary: a `memcpy` in the game's own code read `0x8f83fb8c0`, which was not mapped (nothing within 64 MiB of it; destination `0x2040`), on the thread in `sceKernelBatchMap2`. It didn't happen in the other five runs with this PR or in the six on `main`. I can't tie it to this change, but I'm reporting it. Round 1 pair below. The `main` build was made in the same worktree with `main`'s `GuestBufferMemory.cpp` swapped in, so its line says `c3ac6b47ffb6`, `dirty`. Both traces dropped worker events after about 6 s, so the per-thread times are partial. <details><summary><code>main</code> 77e31219c (+ ceiling stand-in): summary line and <code>tools/trace_digest.py</code></summary> **seconds 100:30** from present 856: 334 presents, frame p50 89.7 / p90 95.5 / p99 109.3 / max 120.5 ms, GPU busy 47.2 ms per present AMD Radeon RX 9070 XT (RADV GFX1201), radv Mesa 26.2.4-arch1.1, Linux 7.2.9-arch1-1, 3840x2160, commit c3ac6b47ffb6 (dirty), dropped: yes ```json {"commit":"c3ac6b47ffb6","dirty":true,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"100:30"},"gpu":"AMD Radeon RX 9070 XT (RADV GFX1201)","driver":"radv Mesa 26.2.4-arch1.1","os":"Linux 7.2.9-arch1-1","cpu":"13th Gen Intel(R) Core(TM) i7-13700KF","cpu_threads":24,"memory_mib":31870,"title_id":"PPSA01802","title":"Kena: Bridge of Spirits","content_version":"02.008.000","resolution":"3840x2160","window":{"spec":"seconds 100:30","first_present":856,"ms":30047.57},"presents":334,"frame_ms":{"p50":89.741,"p90":95.536,"p99":109.318,"max":120.51},"gpu_busy_ms_per_present":47.168,"worker_busy_pct":{"queue worker 0x0":98.49,"queue worker 0x20":64.766},"top_phases_ms_per_frame":{"Driver.Packet":146.001,"Graphics.Draw":58.682,"Driver.Packet.memory_wait":57.259,"Driver.Packet.draw":56.515,"Driver.Draw":56.306,"Graphics.Draw.draw_and_resource_release":42.477,"Driver.Draw.shader_compile_and_link":27.804,"Shader.DrawStage":25.038},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":5.933,"events_lost":1082191,"totals_full":false},"draw committer":{"events_full_after_s":17.628,"events_lost":186641,"totals_full":false}},"trace":"aps5-trace-c3ac6b47ffb6-134679.json.gz"} ``` **Slowest frames** (largest slices inside each, inclusive) - present 1092: 120.5 ms at 21595 ms: Driver.Packet (queue worker 0x20) 77.9, Driver.Packet.memory_wait (queue worker 0x20) 77.2, batch (gpu) 49.9, Driver.WorkerWait (queue worker 0x20) 42.5 - present 882: 118.0 ms at 2382 ms: Driver.Packet (queue worker 0x0) 102.4, Driver.Packet (queue worker 0x20) 80.5, Driver.Packet.memory_wait (queue worker 0x20) 79.7, Driver.Packet.draw (queue worker 0x0) 75.8 - present 1089: 112.8 ms at 21285 ms: Driver.Packet (queue worker 0x20) 72.8, Driver.Packet.memory_wait (queue worker 0x20) 71.6, batch (gpu) 49.3, Driver.WorkerWait (queue worker 0x20) 39.8 **Threads** (ms per frame) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | queue worker 0x0 | 14.9 (17 %) | 0.0 (0 %) | 75.1 | 18.1 | Driver.Packet 14.8, Driver.EndSubmission 0.1 | | draw committer | 29.4 (33 %) | 0.3 (0 %) | 60.2 | 15.3 | Graphics.Draw 27.2, Recorder.Submit 2.0 | | presenter | 0.2 (0 %) | 0.9 (1 %) | 88.8 | 0.1 | VideoOut.Flip 1.2, Driver.Present 0.0 | | queue worker 0x20 | 0.7 (1 %) | 89.1 (99 %) | 0.2 | 0.1 | Driver.Packet 58.1, Driver.EndSubmission 0.1 | | gpu | 47.2 (52 %) | 0.0 (0 %) | 42.8 | 0.0 | batch 47.2 | **Largest slices** (ms per frame, inclusive, all threads): Driver.Packet 72.9, Driver.Packet.memory_wait 57.2, batch 47.2, Driver.WorkerWait 31.5, Driver.WorkerWait.idle_and_completion_poll 31.5, Graphics.Draw 27.6 **Longest waits** - Driver.Packet.memory_wait (queue worker 0x20) 76.3 ms at 2438 ms, present 882 - Driver.Packet.memory_wait (queue worker 0x20) 76.3 ms at 21653 ms, present 1092 - Driver.Packet.memory_wait (queue worker 0x20) 70.6 ms at 21349 ms, present 1089 - Driver.Packet.memory_wait (queue worker 0x20) 69.6 ms at 21238 ms, present 1088 - Driver.Packet.memory_wait (queue worker 0x20) 67.3 ms at 25682 ms, present 1139 - Driver.Packet.memory_wait (queue worker 0x20) 67.1 ms at 21132 ms, present 1087 **Largest GPU batches** (GPU ranges inside, and the CPU slices that recorded each, inclusive) - batch 15113: 7.9 ms at 21006 ms, present 1086: GPU no ranges; recorded by no CPU slices - batch 10126: 7.9 ms at 14083 ms, present 1010: GPU no ranges; recorded by Graphics.Draw (draw committer) 3.5, Graphics.Draw.validate (draw committer) 2.1, Graphics.Draw.draw_and_resource_release (draw committer) 1.1, Recorder.Submit (draw committer) 0.1 - batch 357: 7.8 ms at 479 ms, present 861: GPU no ranges; recorded by Graphics.Draw (draw committer) 3.4, Graphics.Draw.validate (draw committer) 1.7, Graphics.Draw.draw_and_resource_release (draw committer) 1.4, Recorder.Submit (draw committer) 0.1 </details> <details><summary>this PR c3ac6b47f (+ ceiling stand-in): summary line and <code>tools/trace_digest.py</code></summary> **seconds 100:30** from present 1016: 363 presents, frame p50 82.7 / p90 86.8 / p99 93.1 / max 93.9 ms, GPU busy 44.0 ms per present AMD Radeon RX 9070 XT (RADV GFX1201), radv Mesa 26.2.4-arch1.1, Linux 7.2.9-arch1-1, 3840x2160, commit c3ac6b47ffb6 (dirty), dropped: yes ```json {"commit":"c3ac6b47ffb6","dirty":true,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"100:30"},"gpu":"AMD Radeon RX 9070 XT (RADV GFX1201)","driver":"radv Mesa 26.2.4-arch1.1","os":"Linux 7.2.9-arch1-1","cpu":"13th Gen Intel(R) Core(TM) i7-13700KF","cpu_threads":24,"memory_mib":31870,"title_id":"PPSA01802","title":"Kena: Bridge of Spirits","content_version":"02.008.000","resolution":"3840x2160","window":{"spec":"seconds 100:30","first_present":1016,"ms":30063.929},"presents":363,"frame_ms":{"p50":82.656,"p90":86.849,"p99":93.066,"max":93.865},"gpu_busy_ms_per_present":43.989,"worker_busy_pct":{"queue worker 0x0":98.648,"queue worker 0x20":67.923},"top_phases_ms_per_frame":{"Driver.Packet":137.296,"Driver.Packet.memory_wait":55.43,"Driver.Packet.draw":45.981,"Driver.Draw":45.812,"Graphics.Draw":42.65,"Graphics.Draw.draw_and_resource_release":27.714,"Driver.Draw.shader_compile_and_link":22.585,"Shader.DrawStage":20.295},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":6.438,"events_lost":965751,"totals_full":false},"draw committer":{"events_full_after_s":20.956,"events_lost":114825,"totals_full":false}},"trace":"aps5-trace-c3ac6b47ffb6-138357.json.gz"} ``` **Slowest frames** (largest slices inside each, inclusive) - present 1191: 93.9 ms at 14458 ms: Driver.Packet (queue worker 0x20) 65.5, Driver.Packet.memory_wait (queue worker 0x20) 62.5, batch (gpu) 45.8, Graphics.Draw (draw committer) 36.6 - present 1315: 93.7 ms at 24788 ms: Driver.Packet (queue worker 0x20) 62.1, Driver.Packet.memory_wait (queue worker 0x20) 61.0, batch (gpu) 46.4, Driver.WorkerWait (queue worker 0x20) 31.5 - present 1171: 93.7 ms at 12744 ms: Driver.Packet (queue worker 0x20) 63.5, Driver.Packet.memory_wait (queue worker 0x20) 63.2, batch (gpu) 45.1, Graphics.Draw (draw committer) 38.5 **Threads** (ms per frame) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | queue worker 0x0 | 15.1 (18 %) | 0.0 (0 %) | 67.7 | 16.5 | Driver.Packet 15.0, Driver.EndSubmission 0.1 | | draw committer | 25.8 (31 %) | 0.2 (0 %) | 56.8 | 15.3 | Graphics.Draw 23.7, Recorder.Submit 1.9 | | presenter | 0.2 (0 %) | 0.7 (1 %) | 81.9 | 0.1 | VideoOut.Flip 1.0, Driver.Present 0.0 | | queue worker 0x20 | 0.4 (0 %) | 82.3 (99 %) | 0.2 | 0.1 | Driver.Packet 56.0, Driver.EndSubmission 0.2 | | gpu | 44.0 (53 %) | 0.0 (0 %) | 38.8 | 0.0 | batch 44.0 | **Largest slices** (ms per frame, inclusive, all threads): Driver.Packet 71.0, Driver.Packet.memory_wait 55.4, batch 44.0, Driver.WorkerWait 26.4, Driver.WorkerWait.idle_and_completion_poll 26.4, Graphics.Draw 23.7 **Longest waits** - Driver.Packet.memory_wait (queue worker 0x20) 65.5 ms at 24654 ms, present 1313 - Driver.Packet.memory_wait (queue worker 0x20) 63.4 ms at 14324 ms, present 1189 - Driver.Packet.memory_wait (queue worker 0x20) 63.2 ms at 14420 ms, present 1190 - Driver.Packet.memory_wait (queue worker 0x20) 62.6 ms at 24228 ms, present 1308 - Driver.Packet.memory_wait (queue worker 0x20) 62.3 ms at 14231 ms, present 1188 - Driver.Packet.memory_wait (queue worker 0x20) 62.0 ms at 28112 ms, present 1355 **Largest GPU batches** (GPU ranges inside, and the CPU slices that recorded each, inclusive) - batch 18964: 5.3 ms at 28011 ms, present 1354: GPU no ranges; recorded by no CPU slices - batch 14130: 5.3 ms at 20880 ms, present 1268: GPU no ranges; recorded by Graphics.Draw (draw committer) 4.2, Graphics.Draw.validate (draw committer) 2.9, Graphics.Draw.draw_and_resource_release (draw committer) 1.0, Recorder.Submit (draw committer) 0.1 - batch 19300: 5.3 ms at 28518 ms, present 1360: GPU no ranges; recorded by no CPU slices </details> @MarcZX10 Go ahead with your `GuestMemory::Watched` filter on its own; there's no need to fold it in here. The filter checks state outside the snapshot, so with this PR it belongs in `importRunBounds` beside `skipped` (run on every call), not in the memoized walk. Whichever lands first, the other rebases onto it. AI-assisted: yes (Claude Code)
alfalfa-star commented 2026-10-20 17:23:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by alfalfa-star on 2026-10-20T17:23:14Z.


Follow-up with a main build checked out at its own commit, so the summary lines carry 77e31219c835 and c3ac6b47ffb6 (both dirty only from the same ceiling stand-in). Two more alternating rounds: main 368, 336; this PR 348, 347 presents per 30 s. Over all rounds: main 339 (8 runs), this PR 352 (7 runs), +4 %, so no measurable gain on Kena; the gain shows where the run walk is hot (Lodoss above). No crash in these four. The round-1 pair's summary lines are now in the PR description.

main 77e31219c: tools/trace_digest.py

seconds 100:30 from present 945: 368 presents, frame p50 80.3 / p90 89.5 / p99 104.2 / max 124.1 ms, GPU busy 43.3 ms per present
AMD Radeon RX 9070 XT (RADV GFX1201), radv Mesa 26.2.4-arch1.1, Linux 7.2.9-arch1-1, 3840x2160, commit 77e31219c8 (dirty), dropped: yes

{"commit":"77e31219c835","dirty":true,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"100:30"},"gpu":"AMD Radeon RX 9070 XT (RADV GFX1201)","driver":"radv Mesa 26.2.4-arch1.1","os":"Linux 7.2.9-arch1-1","cpu":"13th Gen Intel(R) Core(TM) i7-13700KF","cpu_threads":24,"memory_mib":31870,"title_id":"PPSA01802","title":"Kena: Bridge of Spirits","content_version":"02.008.000","resolution":"3840x2160","window":{"spec":"seconds 100:30","first_present":945,"ms":30048.071},"presents":368,"frame_ms":{"p50":80.277,"p90":89.545,"p99":104.19,"max":124.124},"gpu_busy_ms_per_present":43.253,"worker_busy_pct":{"queue worker 0x0":98.454,"queue worker 0x20":67.091},"top_phases_ms_per_frame":{"Driver.Packet":134.285,"Driver.Packet.memory_wait":52.923,"Driver.Packet.draw":48.148,"Driver.Draw":47.955,"Graphics.Draw":47.505,"Graphics.Draw.draw_and_resource_release":31.319,"Driver.Draw.shader_compile_and_link":25.344,"Shader.DrawStage":22.762},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":5.974,"events_lost":1075410,"totals_full":false},"draw committer":{"events_full_after_s":17.87,"events_lost":183604,"totals_full":false}},"trace":"aps5-trace-77e31219c835-189863.json.gz"}

Slowest frames (largest slices inside each, inclusive)

  • present 989: 124.1 ms at 3571 ms: Driver.Packet (queue worker 0x0) 97.5, Driver.Packet (queue worker 0x20) 97.0, Driver.Packet.memory_wait (queue worker 0x20) 95.1, Graphics.Draw (draw committer) 74.8
  • present 1189: 112.4 ms at 19789 ms: Driver.Packet (queue worker 0x20) 71.7, Driver.Packet.memory_wait (queue worker 0x20) 70.4, batch (gpu) 43.3, Driver.WorkerWait (queue worker 0x20) 40.3
  • present 1259: 111.8 ms at 25749 ms: Driver.Packet (queue worker 0x20) 85.0, Driver.Packet.memory_wait (queue worker 0x20) 83.5, batch (gpu) 44.2, Driver.WorkerWait (queue worker 0x20) 26.6

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
queue worker 0x0 13.7 (17 %) 0.0 (0 %) 67.9 15.6 Driver.Packet 13.6, Driver.EndSubmission 0.1
draw committer 25.2 (31 %) 0.2 (0 %) 56.3 13.1 Graphics.Draw 23.1, Recorder.Submit 2.0
presenter 0.2 (0 %) 0.6 (1 %) 80.8 0.1 VideoOut.Flip 0.8, Driver.Present 0.0
title 0.0 (0 %) 0.0 (0 %) 81.6 0.0
queue worker 0x20 0.5 (1 %) 81.0 (99 %) 0.2 0.1 Driver.Packet 54.6, Driver.EndSubmission 0.2
gpu 43.3 (53 %) 0.0 (0 %) 38.4 0.0 batch 43.3

Largest slices (ms per frame, inclusive, all threads): Driver.Packet 68.2, Driver.Packet.memory_wait 52.9, batch 43.3, Driver.WorkerWait 26.7, Driver.WorkerWait.idle_and_completion_poll 26.7, Graphics.Draw 23.1

Longest waits

  • Driver.Packet.memory_wait (queue worker 0x20) 86.9 ms at 3621 ms, present 989
  • Driver.Packet.memory_wait (queue worker 0x20) 79.7 ms at 11565 ms, present 1087
  • Driver.Packet.memory_wait (queue worker 0x20) 79.5 ms at 25793 ms, present 1259
  • Driver.Packet.memory_wait (queue worker 0x20) 73.4 ms at 19844 ms, present 1189
  • Driver.Packet.memory_wait (queue worker 0x20) 66.9 ms at 22848 ms, present 1226
  • Driver.Packet.memory_wait (queue worker 0x20) 65.0 ms at 24933 ms, present 1249

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

  • batch 2817: 5.1 ms at 3975 ms, present 993: GPU no ranges; recorded by Graphics.Draw (draw committer) 1.9, Graphics.Draw.draw_and_resource_release (draw committer) 1.8, Recorder.Submit (draw committer) 0.1
  • batch 6685: 5.1 ms at 9349 ms, present 1060: GPU no ranges; recorded by Graphics.Draw (draw committer) 1.7, Graphics.Draw.draw_and_resource_release (draw committer) 1.5, Recorder.Submit (draw committer) 0.1
  • batch 829: 5.1 ms at 1159 ms, present 959: GPU no ranges; recorded by Graphics.Draw (draw committer) 1.6, Graphics.Draw.draw_and_resource_release (draw committer) 1.4, Recorder.Submit (draw committer) 0.1
this PR c3ac6b47f: tools/trace_digest.py

seconds 100:30 from present 958: 348 presents, frame p50 84.1 / p90 99.2 / p99 107.0 / max 111.7 ms, GPU busy 45.6 ms per present
AMD Radeon RX 9070 XT (RADV GFX1201), radv Mesa 26.2.4-arch1.1, Linux 7.2.9-arch1-1, 3840x2160, commit c3ac6b47ffb6 (dirty), dropped: yes

{"commit":"c3ac6b47ffb6","dirty":true,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"100:30"},"gpu":"AMD Radeon RX 9070 XT (RADV GFX1201)","driver":"radv Mesa 26.2.4-arch1.1","os":"Linux 7.2.9-arch1-1","cpu":"13th Gen Intel(R) Core(TM) i7-13700KF","cpu_threads":24,"memory_mib":31870,"title_id":"PPSA01802","title":"Kena: Bridge of Spirits","content_version":"02.008.000","resolution":"3840x2160","window":{"spec":"seconds 100:30","first_present":958,"ms":30052.232},"presents":348,"frame_ms":{"p50":84.097,"p90":99.22,"p99":107.013,"max":111.658},"gpu_busy_ms_per_present":45.642,"worker_busy_pct":{"queue worker 0x0":98.775,"queue worker 0x20":75.254},"top_phases_ms_per_frame":{"Driver.Packet":149.061,"Driver.Packet.memory_wait":62.792,"Graphics.Draw":43.609,"Driver.Packet.draw":42.676,"Driver.Draw":42.519,"Graphics.Draw.draw_and_resource_release":28.554,"Driver.Draw.shader_compile_and_link":19.797,"Driver.Packet.prepare_memory":17.974},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":7.8,"events_lost":777217,"totals_full":false},"draw committer":{"events_full_after_s":25.358,"events_lost":46559,"totals_full":false}},"trace":"aps5-trace-c3ac6b47ffb6-193694.json.gz"}

Slowest frames (largest slices inside each, inclusive)

  • present 1005: 111.7 ms at 3973 ms: Driver.Packet (queue worker 0x0) 99.7, Driver.Packet (queue worker 0x20) 89.3, Driver.Packet.memory_wait (queue worker 0x20) 87.7, Graphics.Draw (draw committer) 57.2
  • present 1062: 110.4 ms at 8852 ms: Driver.Packet (queue worker 0x20) 83.0, Driver.Packet.memory_wait (queue worker 0x20) 81.1, Graphics.Draw (draw committer) 52.5, batch (gpu) 44.8
  • present 1109: 109.0 ms at 13309 ms: Driver.Packet (queue worker 0x20) 81.4, Driver.Packet.memory_wait (queue worker 0x20) 79.4, Graphics.Draw (draw committer) 46.0, batch (gpu) 45.8

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
queue worker 0x0 19.6 (23 %) 0.0 (0 %) 66.8 17.4 Driver.Packet 19.4, Driver.EndSubmission 0.2
draw committer 31.1 (36 %) 0.5 (1 %) 54.8 15.9 Graphics.Draw 27.0, Recorder.Submit 2.3
presenter 0.3 (0 %) 0.3 (0 %) 85.8 0.1 VideoOut.Flip 0.6, Driver.Present 0.0
queue worker 0x20 0.7 (1 %) 85.4 (99 %) 0.2 0.1 Driver.Packet 64.7, Driver.EndSubmission 0.3
gpu 45.8 (53 %) 0.0 (0 %) 40.6 0.0 batch 45.8

Largest slices (ms per frame, inclusive, all threads): Driver.Packet 84.0, Driver.Packet.memory_wait 62.8, batch 45.8, Graphics.Draw 28.2, Driver.WorkerWait 21.2, Driver.WorkerWait.idle_and_completion_poll 21.2

Longest waits

  • Driver.Packet.memory_wait (queue worker 0x20) 89.8 ms at 4008 ms, present 1005
  • Driver.Packet.memory_wait (queue worker 0x20) 84.2 ms at 957 ms, present 969
  • Driver.Packet.memory_wait (queue worker 0x20) 81.9 ms at 8899 ms, present 1062
  • Driver.Packet.memory_wait (queue worker 0x20) 79.7 ms at 13254 ms, present 1108
  • Driver.Packet.memory_wait (queue worker 0x20) 76.2 ms at 10588 ms, present 1080
  • Driver.Packet.memory_wait (queue worker 0x20) 75.9 ms at 10087 ms, present 1075

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

  • batch 13223: 12.7 ms at 21314 ms, present 1201: GPU no ranges; recorded by Graphics.Draw (draw committer) 0.8, Graphics.Draw.draw_and_resource_release (draw committer) 0.7, GpuMutex.wait.end (draw committer) 0.2, Recorder.Submit (draw committer) 0.1
  • batch 9893: 12.7 ms at 16055 ms, present 1138: GPU no ranges; recorded by no CPU slices
  • batch 10786: 12.6 ms at 17477 ms, present 1155: GPU no ranges; recorded by no CPU slices

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6296887737 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6951#issuecomment-6296887737). Originally posted by [alfalfa-star](https://github.com/alfalfa-star) on 2026-10-20T17:23:14Z. --- Follow-up with a `main` build checked out at its own commit, so the summary lines carry `77e31219c835` and `c3ac6b47ffb6` (both dirty only from the same ceiling stand-in). Two more alternating rounds: `main` 368, 336; this PR 348, 347 presents per 30 s. Over all rounds: `main` 339 (8 runs), this PR 352 (7 runs), +4 %, so no measurable gain on Kena; the gain shows where the run walk is hot (Lodoss above). No crash in these four. The round-1 pair's summary lines are now in the PR description. <details><summary><code>main</code> 77e31219c: <code>tools/trace_digest.py</code></summary> **seconds 100:30** from present 945: 368 presents, frame p50 80.3 / p90 89.5 / p99 104.2 / max 124.1 ms, GPU busy 43.3 ms per present AMD Radeon RX 9070 XT (RADV GFX1201), radv Mesa 26.2.4-arch1.1, Linux 7.2.9-arch1-1, 3840x2160, commit 77e31219c835 (dirty), dropped: yes ```json {"commit":"77e31219c835","dirty":true,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"100:30"},"gpu":"AMD Radeon RX 9070 XT (RADV GFX1201)","driver":"radv Mesa 26.2.4-arch1.1","os":"Linux 7.2.9-arch1-1","cpu":"13th Gen Intel(R) Core(TM) i7-13700KF","cpu_threads":24,"memory_mib":31870,"title_id":"PPSA01802","title":"Kena: Bridge of Spirits","content_version":"02.008.000","resolution":"3840x2160","window":{"spec":"seconds 100:30","first_present":945,"ms":30048.071},"presents":368,"frame_ms":{"p50":80.277,"p90":89.545,"p99":104.19,"max":124.124},"gpu_busy_ms_per_present":43.253,"worker_busy_pct":{"queue worker 0x0":98.454,"queue worker 0x20":67.091},"top_phases_ms_per_frame":{"Driver.Packet":134.285,"Driver.Packet.memory_wait":52.923,"Driver.Packet.draw":48.148,"Driver.Draw":47.955,"Graphics.Draw":47.505,"Graphics.Draw.draw_and_resource_release":31.319,"Driver.Draw.shader_compile_and_link":25.344,"Shader.DrawStage":22.762},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":5.974,"events_lost":1075410,"totals_full":false},"draw committer":{"events_full_after_s":17.87,"events_lost":183604,"totals_full":false}},"trace":"aps5-trace-77e31219c835-189863.json.gz"} ``` **Slowest frames** (largest slices inside each, inclusive) - present 989: 124.1 ms at 3571 ms: Driver.Packet (queue worker 0x0) 97.5, Driver.Packet (queue worker 0x20) 97.0, Driver.Packet.memory_wait (queue worker 0x20) 95.1, Graphics.Draw (draw committer) 74.8 - present 1189: 112.4 ms at 19789 ms: Driver.Packet (queue worker 0x20) 71.7, Driver.Packet.memory_wait (queue worker 0x20) 70.4, batch (gpu) 43.3, Driver.WorkerWait (queue worker 0x20) 40.3 - present 1259: 111.8 ms at 25749 ms: Driver.Packet (queue worker 0x20) 85.0, Driver.Packet.memory_wait (queue worker 0x20) 83.5, batch (gpu) 44.2, Driver.WorkerWait (queue worker 0x20) 26.6 **Threads** (ms per frame) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | queue worker 0x0 | 13.7 (17 %) | 0.0 (0 %) | 67.9 | 15.6 | Driver.Packet 13.6, Driver.EndSubmission 0.1 | | draw committer | 25.2 (31 %) | 0.2 (0 %) | 56.3 | 13.1 | Graphics.Draw 23.1, Recorder.Submit 2.0 | | presenter | 0.2 (0 %) | 0.6 (1 %) | 80.8 | 0.1 | VideoOut.Flip 0.8, Driver.Present 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 81.6 | 0.0 | | | queue worker 0x20 | 0.5 (1 %) | 81.0 (99 %) | 0.2 | 0.1 | Driver.Packet 54.6, Driver.EndSubmission 0.2 | | gpu | 43.3 (53 %) | 0.0 (0 %) | 38.4 | 0.0 | batch 43.3 | **Largest slices** (ms per frame, inclusive, all threads): Driver.Packet 68.2, Driver.Packet.memory_wait 52.9, batch 43.3, Driver.WorkerWait 26.7, Driver.WorkerWait.idle_and_completion_poll 26.7, Graphics.Draw 23.1 **Longest waits** - Driver.Packet.memory_wait (queue worker 0x20) 86.9 ms at 3621 ms, present 989 - Driver.Packet.memory_wait (queue worker 0x20) 79.7 ms at 11565 ms, present 1087 - Driver.Packet.memory_wait (queue worker 0x20) 79.5 ms at 25793 ms, present 1259 - Driver.Packet.memory_wait (queue worker 0x20) 73.4 ms at 19844 ms, present 1189 - Driver.Packet.memory_wait (queue worker 0x20) 66.9 ms at 22848 ms, present 1226 - Driver.Packet.memory_wait (queue worker 0x20) 65.0 ms at 24933 ms, present 1249 **Largest GPU batches** (GPU ranges inside, and the CPU slices that recorded each, inclusive) - batch 2817: 5.1 ms at 3975 ms, present 993: GPU no ranges; recorded by Graphics.Draw (draw committer) 1.9, Graphics.Draw.draw_and_resource_release (draw committer) 1.8, Recorder.Submit (draw committer) 0.1 - batch 6685: 5.1 ms at 9349 ms, present 1060: GPU no ranges; recorded by Graphics.Draw (draw committer) 1.7, Graphics.Draw.draw_and_resource_release (draw committer) 1.5, Recorder.Submit (draw committer) 0.1 - batch 829: 5.1 ms at 1159 ms, present 959: GPU no ranges; recorded by Graphics.Draw (draw committer) 1.6, Graphics.Draw.draw_and_resource_release (draw committer) 1.4, Recorder.Submit (draw committer) 0.1 </details> <details><summary>this PR c3ac6b47f: <code>tools/trace_digest.py</code></summary> **seconds 100:30** from present 958: 348 presents, frame p50 84.1 / p90 99.2 / p99 107.0 / max 111.7 ms, GPU busy 45.6 ms per present AMD Radeon RX 9070 XT (RADV GFX1201), radv Mesa 26.2.4-arch1.1, Linux 7.2.9-arch1-1, 3840x2160, commit c3ac6b47ffb6 (dirty), dropped: yes ```json {"commit":"c3ac6b47ffb6","dirty":true,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"100:30"},"gpu":"AMD Radeon RX 9070 XT (RADV GFX1201)","driver":"radv Mesa 26.2.4-arch1.1","os":"Linux 7.2.9-arch1-1","cpu":"13th Gen Intel(R) Core(TM) i7-13700KF","cpu_threads":24,"memory_mib":31870,"title_id":"PPSA01802","title":"Kena: Bridge of Spirits","content_version":"02.008.000","resolution":"3840x2160","window":{"spec":"seconds 100:30","first_present":958,"ms":30052.232},"presents":348,"frame_ms":{"p50":84.097,"p90":99.22,"p99":107.013,"max":111.658},"gpu_busy_ms_per_present":45.642,"worker_busy_pct":{"queue worker 0x0":98.775,"queue worker 0x20":75.254},"top_phases_ms_per_frame":{"Driver.Packet":149.061,"Driver.Packet.memory_wait":62.792,"Graphics.Draw":43.609,"Driver.Packet.draw":42.676,"Driver.Draw":42.519,"Graphics.Draw.draw_and_resource_release":28.554,"Driver.Draw.shader_compile_and_link":19.797,"Driver.Packet.prepare_memory":17.974},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":7.8,"events_lost":777217,"totals_full":false},"draw committer":{"events_full_after_s":25.358,"events_lost":46559,"totals_full":false}},"trace":"aps5-trace-c3ac6b47ffb6-193694.json.gz"} ``` **Slowest frames** (largest slices inside each, inclusive) - present 1005: 111.7 ms at 3973 ms: Driver.Packet (queue worker 0x0) 99.7, Driver.Packet (queue worker 0x20) 89.3, Driver.Packet.memory_wait (queue worker 0x20) 87.7, Graphics.Draw (draw committer) 57.2 - present 1062: 110.4 ms at 8852 ms: Driver.Packet (queue worker 0x20) 83.0, Driver.Packet.memory_wait (queue worker 0x20) 81.1, Graphics.Draw (draw committer) 52.5, batch (gpu) 44.8 - present 1109: 109.0 ms at 13309 ms: Driver.Packet (queue worker 0x20) 81.4, Driver.Packet.memory_wait (queue worker 0x20) 79.4, Graphics.Draw (draw committer) 46.0, batch (gpu) 45.8 **Threads** (ms per frame) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | queue worker 0x0 | 19.6 (23 %) | 0.0 (0 %) | 66.8 | 17.4 | Driver.Packet 19.4, Driver.EndSubmission 0.2 | | draw committer | 31.1 (36 %) | 0.5 (1 %) | 54.8 | 15.9 | Graphics.Draw 27.0, Recorder.Submit 2.3 | | presenter | 0.3 (0 %) | 0.3 (0 %) | 85.8 | 0.1 | VideoOut.Flip 0.6, Driver.Present 0.0 | | queue worker 0x20 | 0.7 (1 %) | 85.4 (99 %) | 0.2 | 0.1 | Driver.Packet 64.7, Driver.EndSubmission 0.3 | | gpu | 45.8 (53 %) | 0.0 (0 %) | 40.6 | 0.0 | batch 45.8 | **Largest slices** (ms per frame, inclusive, all threads): Driver.Packet 84.0, Driver.Packet.memory_wait 62.8, batch 45.8, Graphics.Draw 28.2, Driver.WorkerWait 21.2, Driver.WorkerWait.idle_and_completion_poll 21.2 **Longest waits** - Driver.Packet.memory_wait (queue worker 0x20) 89.8 ms at 4008 ms, present 1005 - Driver.Packet.memory_wait (queue worker 0x20) 84.2 ms at 957 ms, present 969 - Driver.Packet.memory_wait (queue worker 0x20) 81.9 ms at 8899 ms, present 1062 - Driver.Packet.memory_wait (queue worker 0x20) 79.7 ms at 13254 ms, present 1108 - Driver.Packet.memory_wait (queue worker 0x20) 76.2 ms at 10588 ms, present 1080 - Driver.Packet.memory_wait (queue worker 0x20) 75.9 ms at 10087 ms, present 1075 **Largest GPU batches** (GPU ranges inside, and the CPU slices that recorded each, inclusive) - batch 13223: 12.7 ms at 21314 ms, present 1201: GPU no ranges; recorded by Graphics.Draw (draw committer) 0.8, Graphics.Draw.draw_and_resource_release (draw committer) 0.7, GpuMutex.wait.end (draw committer) 0.2, Recorder.Submit (draw committer) 0.1 - batch 9893: 12.7 ms at 16055 ms, present 1138: GPU no ranges; recorded by no CPU slices - batch 10786: 12.6 ms at 17477 ms, present 1155: GPU no ranges; recorded by no CPU slices </details> AI-assisted: yes (Claude Code)
oneandonlydean commented 2026-10-20 19:25:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-20T19:25:10Z.


@adriadam10 could you take another look at your change request when you have a moment? On the current head (c3ac6b47ff) your points look addressed to us: only the snapshot walk is memoized, refusals are rechecked on every call, and a refusal test was added. We also checked that a variant of the change that drops the snapshot identity from the memo key fails importCrossingTests, so the key is covered by the tests. If anything is still open on your side, we'll follow up.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6299384482 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6951#issuecomment-6299384482). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-20T19:25:10Z. --- @adriadam10 could you take another look at your change request when you have a moment? On the current head (c3ac6b47ff) your points look addressed to us: only the snapshot walk is memoized, refusals are rechecked on every call, and a refusal test was added. We also checked that a variant of the change that drops the snapshot identity from the memo key fails `importCrossingTests`, so the key is covered by the tests. If anything is still open on your side, we'll follow up.
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!6951
No description provided.