perf(agc): keep Windows host imports of write-watched private memory watched #6060

Merged
parl0v merged 8 commits from upstream-pr/6060 into main 2026-10-15 08:54:44 +00:00
parl0v commented 2026-10-14 21:02:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by parl0v on 2026-10-14T21:02:52Z.


What

On Windows, a host import without a section alias leaves guest write tracking, and its changes are found by comparison (unwatchImports is always set there). Since #5596, singly mapped direct memory is private MEM_WRITE_WATCH memory, so its imports take that path. On PPSA25344 (Sword of the Sea) every storage-texture refresh then compares its whole snapshot: about 579,000 compares of 2.2 TB per 10 s at the title, and the title drops from 8.13 to 2.09 FPS at the #5596 merge.

#5851 moves these runs into a section so they import through an alias. That brings back write faults, and with them #361's red-zone crash on this title. This PR keeps the memory private and keeps its imports on GetWriteWatch:

  • Probe. ProbeImportWriteProtection gets a Windows body: it imports a MEM_WRITE_WATCH scratch range, reads it twice on the GPU, writes it once, stores to it once, and collects GetWriteWatch with reset after each step. runImportProbe now takes the collect function, and Linux passes its own. It also reads a second time, for writtenAfterSecondSubmit.
  • Decision. decideImportWatch keeps direct imports of private read-write memory watched (watchPrivateImports) when the probe shows nothing written after the second read and the GPU write, and the CPU store collected. Imports through views keep their alias path. The [write-watch] startup line reports the probe counts and the decision.
  • Settling. An import marks every page written once, asynchronously, until its first GPU use completes (the probe sees all pages after the import and after the first read, none after that). Marks after ImportWatched's window would be taken as CPU stores newer than GPU results, which loses those results (agc_driver_layered_volume_submit fails that way). So each such import is settled inside the window: settleImport copies 4 bytes out of the new import on a settle queue and waits, and the window's comparison drops the marks. importAllocation holds the imports lock, and GpuMutex comes before it in the lock order, so the main queue can't be used there. On Windows the device gets a second queue of the graphics family, with its own pool and lock, for this read.
  • No switch. A device without a second queue keeps the comparisons, as before. The measurements below used an APS5_NO_WATCHED_PRIVATE_IMPORTS switch for the off side; it was removed in review (6c6a6c85a), and the other-family settle is tested by agc_import_watch_other_family instead of an environment switch.

Tested

Windows 10 19045, MinGW-w64 GCC 15.2, NVIDIA 617.42. Measured on main a050f856f; rebased onto 0ae1deb85 (the debt entry's neighbours changed), where agc_import_watch and agc_driver_layered_volume_submit pass with the change and with APS5_NO_WATCHED_PRIVATE_IMPORTS=1. Box 1: i5-14400F, 16 GB, RTX 4060. Box 2: i5-12400F, 32 GB, RTX 3060.

  • libSceAgcDriver ctest (box 1): 545 of 546 with the change, 545 of 546 with APS5_NO_WATCHED_PRIVATE_IMPORTS=1. Both times agc_shader_disk_cache fails because Windows denies removing its cache directory on this machine.

  • agc_driver_layered_volume_submit guards the settle. Watched imports without it fail 3 of 3 (slice 1 texel (0, 0) channel 0 is 64, expected 255: the draw's band reads back as the CPU pre-fill). With it, the test passes.

  • New ctest agc_import_watch (agc_driver_recorder_tests --import-watch-only, like the other -only entries; on current main the full recorder run isn't registered). The Windows branch of importWatchTests now runs ProbeImportWriteProtection and requires it to succeed and to collect the CPU store. That fails on main, where the Windows probe returns "the Linux write watch", and the test doesn't build without the new field. On both GPUs the probe reports: 4 of 4 scratch pages at the import, 4 after the first GPU read, 0 after the second, 0 after a GPU write, 1 after a CPU store.

  • Standalone probe: importing MEM_WRITE_WATCH memory of 16 and 4,096 pages on both GPUs gives the same pattern. The marks after the import are asynchronous: 1,632 to 3,033 of 4,096 pages before any submit, the rest by the first GPU use completing. A 4-byte read completes them.

  • tools/check_conventions.py --base origin/main: passes.

  • PPSA25344 title screen, same relinked executable and libraries, the change on vs APS5_NO_WATCHED_PRIVATE_IMPORTS=1, alternating, APS5_PROFILE_DRAW=1, mean of the last twelve 10 s windows. The startup line reads keep the write watch: yes (... 0 after the second ...).

    comparisons (off) this PR
    Box 2, 3 × 300 s 3.02 / 3.00 / 3.01 FPS, GPU 117 ms/present 9.54 / 9.50 / 9.50 FPS, GPU 80 ms/present
    Box 1, 2 × 200 s 1.77 / 2.20 FPS 7.71 / 7.67 FPS
    [guestmem] compare per 10 s 1.5–6.2 M calls, 0.5–1.9 TB 1 call
    readTarget per 10 s (box 2) ~1,650 ms ~204 ms
    stops at app.exe+0x37f77b3 (#361) 0 / 5 0 / 5

    Frame dumps (box 2, frame 2 of the title): mean difference 0.13 of 255 between off and on, 0.13 between two off runs. - Stops at +0x37f77b3 vs #5851, 120 s boots of the title, alternating, the same executable, both GPUs:

    this PR #5851 (f0854887d + 22091410a)
    Box 2 0 of 10 2 of 10
    Box 1 0 of 10 3 of 10

    With #5851, imported direct memory is tracked through views and write faults again, and SotS's leaf at +0x37f77b3 reads its red zone back after one of them. This PR imports it as private memory, so it takes no faults.

  • Fork CI (the build.yml steps on GitHub runners): Windows passes, 1,217 of 1,217. Linux: 1,194 of 1,195. The one failure is agc_driver_recorder at (u) the dma-buf import probe failed at open /dev/udmabuf (the runner denies /dev/udmabuf), and plain main fails the same way on the same runner. Linux's import probe prints the same counts on both (0 of 4 scratch pages written after a GPU read, 4 after a GPU write, 0 after the import), so the runImportProbe change leaves Linux as it was.

Checklist

  • Based on current main; no other open PR implements the same functions (#5851 addresses the same #5596 effect by moving runs into sections instead; the two change different paths)
  • 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: PPSA25344 (Sword of the Sea): title frame rate lost with #5596
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4864483455 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6060). Originally posted by [parl0v](https://github.com/parl0v) on 2026-10-14T21:02:52Z. --- ### What On Windows, a host import without a section alias leaves guest write tracking, and its changes are found by comparison (`unwatchImports` is always set there). Since #5596, singly mapped direct memory is private `MEM_WRITE_WATCH` memory, so its imports take that path. On PPSA25344 (Sword of the Sea) every storage-texture refresh then compares its whole snapshot: about 579,000 compares of 2.2 TB per 10 s at the title, and the title drops from 8.13 to 2.09 FPS at the #5596 merge. #5851 moves these runs into a section so they import through an alias. That brings back write faults, and with them #361's red-zone crash on this title. This PR keeps the memory private and keeps its imports on `GetWriteWatch`: - **Probe.** `ProbeImportWriteProtection` gets a Windows body: it imports a `MEM_WRITE_WATCH` scratch range, reads it twice on the GPU, writes it once, stores to it once, and collects `GetWriteWatch` with reset after each step. `runImportProbe` now takes the collect function, and Linux passes its own. It also reads a second time, for `writtenAfterSecondSubmit`. - **Decision.** `decideImportWatch` keeps direct imports of private read-write memory watched (`watchPrivateImports`) when the probe shows nothing written after the second read and the GPU write, and the CPU store collected. Imports through views keep their alias path. The `[write-watch]` startup line reports the probe counts and the decision. - **Settling.** An import marks every page written once, asynchronously, until its first GPU use completes (the probe sees all pages after the import and after the first read, none after that). Marks after `ImportWatched`'s window would be taken as CPU stores newer than GPU results, which loses those results (`agc_driver_layered_volume_submit` fails that way). So each such import is settled inside the window: `settleImport` copies 4 bytes out of the new import on a settle queue and waits, and the window's comparison drops the marks. `importAllocation` holds the imports lock, and `GpuMutex` comes before it in the lock order, so the main queue can't be used there. On Windows the device gets a second queue of the graphics family, with its own pool and lock, for this read. - **No switch.** A device without a second queue keeps the comparisons, as before. The measurements below used an `APS5_NO_WATCHED_PRIVATE_IMPORTS` switch for the off side; it was removed in review (6c6a6c85a), and the other-family settle is tested by `agc_import_watch_other_family` instead of an environment switch. ### Tested Windows 10 19045, MinGW-w64 GCC 15.2, NVIDIA 617.42. Measured on `main` `a050f856f`; rebased onto `0ae1deb85` (the debt entry's neighbours changed), where `agc_import_watch` and `agc_driver_layered_volume_submit` pass with the change and with `APS5_NO_WATCHED_PRIVATE_IMPORTS=1`. Box 1: i5-14400F, 16 GB, RTX 4060. Box 2: i5-12400F, 32 GB, RTX 3060. - **`libSceAgcDriver` ctest (box 1):** 545 of 546 with the change, 545 of 546 with `APS5_NO_WATCHED_PRIVATE_IMPORTS=1`. Both times `agc_shader_disk_cache` fails because Windows denies removing its cache directory on this machine. - **`agc_driver_layered_volume_submit`** guards the settle. Watched imports without it fail 3 of 3 (`slice 1 texel (0, 0) channel 0 is 64, expected 255`: the draw's band reads back as the CPU pre-fill). With it, the test passes. - **New ctest `agc_import_watch`** (`agc_driver_recorder_tests --import-watch-only`, like the other `-only` entries; on current `main` the full recorder run isn't registered). The Windows branch of `importWatchTests` now runs `ProbeImportWriteProtection` and requires it to succeed and to collect the CPU store. That fails on `main`, where the Windows probe returns "the Linux write watch", and the test doesn't build without the new field. On both GPUs the probe reports: 4 of 4 scratch pages at the import, 4 after the first GPU read, 0 after the second, 0 after a GPU write, 1 after a CPU store. - **Standalone probe:** importing `MEM_WRITE_WATCH` memory of 16 and 4,096 pages on both GPUs gives the same pattern. The marks after the import are asynchronous: 1,632 to 3,033 of 4,096 pages before any submit, the rest by the first GPU use completing. A 4-byte read completes them. - **`tools/check_conventions.py --base origin/main`:** passes. - **PPSA25344 title screen**, same relinked executable and libraries, the change on vs `APS5_NO_WATCHED_PRIVATE_IMPORTS=1`, alternating, `APS5_PROFILE_DRAW=1`, mean of the last twelve 10 s windows. The startup line reads `keep the write watch: yes (... 0 after the second ...)`. | | comparisons (off) | this PR | |---|---|---| | Box 2, 3 × 300 s | 3.02 / 3.00 / 3.01 FPS, GPU 117 ms/present | **9.54 / 9.50 / 9.50 FPS**, GPU 80 ms/present | | Box 1, 2 × 200 s | 1.77 / 2.20 FPS | **7.71 / 7.67 FPS** | | `[guestmem]` compare per 10 s | 1.5–6.2 M calls, 0.5–1.9 TB | 1 call | | `readTarget` per 10 s (box 2) | ~1,650 ms | ~204 ms | | stops at `app.exe+0x37f77b3` (#361) | 0 / 5 | 0 / 5 | Frame dumps (box 2, frame 2 of the title): mean difference 0.13 of 255 between off and on, 0.13 between two off runs. - **Stops at `+0x37f77b3` vs #5851**, 120 s boots of the title, alternating, the same executable, both GPUs: | | this PR | #5851 (`f0854887d` + `22091410a`) | |---|---|---| | Box 2 | 0 of 10 | 2 of 10 | | Box 1 | 0 of 10 | 3 of 10 | With #5851, imported direct memory is tracked through views and write faults again, and SotS's leaf at `+0x37f77b3` reads its red zone back after one of them. This PR imports it as private memory, so it takes no faults. - **Fork CI** (the `build.yml` steps on GitHub runners): Windows passes, 1,217 of 1,217. Linux: 1,194 of 1,195. The one failure is `agc_driver_recorder` at `(u) the dma-buf import probe failed at open /dev/udmabuf` (the runner denies `/dev/udmabuf`), and plain `main` fails the same way on the same runner. Linux's import probe prints the same counts on both (`0 of 4 scratch pages written after a GPU read, 4 after a GPU write, 0 after the import`), so the `runImportProbe` change leaves Linux as it was. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions (#5851 addresses the same #5596 effect by moving runs into sections instead; the two change different paths) - [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: PPSA25344 (Sword of the Sea): title frame rate lost with #5596 - [x] AI-assisted: yes
EagleBearerYS commented 2026-10-14 21:11:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-14T21:11:47Z.


Will do on Resident Evil Village (PPSA01556): resumed write faults, [guestmem] compares, title presents per 10 s against the #5851 tree, and the Wwise thread's stop rate over unframed scene loads, plus the probe's decision on an RTX 3070 Laptop. Our PC is booked for the rest of today, so most likely tomorrow; results here.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6178604506 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6060#issuecomment-6178604506). Originally posted by [EagleBearerYS](https://github.com/EagleBearerYS) on 2026-10-14T21:11:47Z. --- Will do on Resident Evil Village (PPSA01556): resumed write faults, `[guestmem]` compares, title presents per 10 s against the #5851 tree, and the Wwise thread's stop rate over unframed scene loads, plus the probe's decision on an RTX 3070 Laptop. Our PC is booked for the rest of today, so most likely tomorrow; results here.
parl0v commented 2026-10-14 21:24:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by parl0v on 2026-10-14T21:24:33Z.


Rebased onto 0ae1deb85 (conflict was only the neighbouring lines of the debt entry). Current main no longer registers the full agc_driver_recorder run, so the import-watch check now has its own entry, agc_import_watch (--import-watch-only). It passes with the change and with APS5_NO_WATCHED_PRIVATE_IMPORTS=1; agc_driver_layered_volume_submit passes too.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6178831853 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6060#issuecomment-6178831853). Originally posted by [parl0v](https://github.com/parl0v) on 2026-10-14T21:24:33Z. --- Rebased onto `0ae1deb85` (conflict was only the neighbouring lines of the debt entry). Current `main` no longer registers the full `agc_driver_recorder` run, so the import-watch check now has its own entry, `agc_import_watch` (`--import-watch-only`). It passes with the change and with `APS5_NO_WATCHED_PRIVATE_IMPORTS=1`; `agc_driver_layered_volume_submit` passes too.
parl0v commented 2026-10-14 21:31:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by parl0v on 2026-10-14T21:31:33Z.


Full libSceAgcDriver ctest on the rebased head (919f39109, box 1, RTX 4060): 556 of 557 with the change, 556 of 557 with APS5_NO_WATCHED_PRIVATE_IMPORTS=1. The only failure both times is agc_shader_disk_cache (Windows denies removing its cache directory on this machine).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6178952884 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6060#issuecomment-6178952884). Originally posted by [parl0v](https://github.com/parl0v) on 2026-10-14T21:31:33Z. --- Full `libSceAgcDriver` ctest on the rebased head (`919f39109`, box 1, RTX 4060): 556 of 557 with the change, 556 of 557 with `APS5_NO_WATCHED_PRIVATE_IMPORTS=1`. The only failure both times is `agc_shader_disk_cache` (Windows denies removing its cache directory on this machine).
adriadam10 commented 2026-10-14 21:54:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-14T21:54:35Z.


Checked the diff against the repo rules and ran the libSceAgcDriver build and ctest on this head merged onto current main: agc_import_watch and agc_driver_layered_volume_* pass; the only failure is agc_driver_tessellation, which segfaults on main too. Windows/NVIDIA behaviour (driver marks, FPS, #361) rests on your measurements; the full Windows Build will run before merge.

Added one commit on your branch: docs/dev/ARCHITECTURE.md now describes the settled watched imports (second graphics-family queue, probe decision, lock-order reason, off switch), since the PR changes how host imports and queues work.

Merging once the Windows Build is green.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6179340097 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6060#issuecomment-6179340097). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-14T21:54:35Z. --- Checked the diff against the repo rules and ran the libSceAgcDriver build and ctest on this head merged onto current `main`: `agc_import_watch` and `agc_driver_layered_volume_*` pass; the only failure is `agc_driver_tessellation`, which segfaults on `main` too. Windows/NVIDIA behaviour (driver marks, FPS, #361) rests on your measurements; the full Windows Build will run before merge. Added one commit on your branch: `docs/dev/ARCHITECTURE.md` now describes the settled watched imports (second graphics-family queue, probe decision, lock-order reason, off switch), since the PR changes how host imports and queues work. Merging once the Windows Build is green.
parl0v commented 2026-10-14 21:55:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by parl0v on 2026-10-14T21:55:15Z.


@adriadam10 thanks, and for the ARCHITECTURE.md commit. Before merging: a 40-min title run with this PR (box 2, RTX 3060) stopped after ~12 min with vkAllocateDescriptorSets texture detiler: Vulkan result -2 (out of device memory), on the presentation thread. I'm running the same 40 min with APS5_NO_WATCHED_PRIVATE_IMPORTS=1 now, to see whether main reaches it too at the same frame count (it runs ~3× slower there), then the PR again. Results in about an hour; I'll post them here.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6179351856 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6060#issuecomment-6179351856). Originally posted by [parl0v](https://github.com/parl0v) on 2026-10-14T21:55:15Z. --- @adriadam10 thanks, and for the `ARCHITECTURE.md` commit. Before merging: a 40-min title run with this PR (box 2, RTX 3060) stopped after ~12 min with `vkAllocateDescriptorSets texture detiler: Vulkan result -2` (out of device memory), on the presentation thread. I'm running the same 40 min with `APS5_NO_WATCHED_PRIVATE_IMPORTS=1` now, to see whether `main` reaches it too at the same frame count (it runs ~3× slower there), then the PR again. Results in about an hour; I'll post them here.
frankea commented 2026-10-14 22:16:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by frankea on 2026-10-14T22:16:42Z.


Windows run of this PR on a third NVIDIA box, with a different driver branch from the two above. Head 919f39109 merged onto main 4808d9c20 (clean merge); Windows 11 10.0.26200, Ryzen 7 5800X (Zen 3), RTX 4090, NVIDIA 616.92 (Vulkan 1.4.351), MinGW-w64 GCC 15.2.0 r7, Release, BUILD_TESTING=ON, default environment.

  • Full ctest: 1235 of 1235 passed, 14 environment skips (the same skips as main fa539dd9b on this machine, 1233 of 1233).

  • The decision through the real VulkanDevice (printed by agc_driver, agc_driver_layered_volume_submit, agc_driver_multisample_fill_host_only):

    [write-watch] host imports of write-watched memory keep the write watch: yes (4 of 4 scratch pages reported written at the import, 0 after the first GPU read, 0 after the second, 0 after a GPU write, 1 after a CPU store); direct host imports of private memory are settled and stay watched, separate shared aliases retain guest write tracking
    

    The only difference from your 617.42 boxes is the first-read count: 0 here against 4 there. On this driver the one-time marks have all landed by the time the first GPU read completes, which fits them being asynchronous. The decision is the same.

  • libSceAgcDriver scope (ctest -R ^agc_), the watched path active: 557 of 557. agc_driver_layered_volume_submit 5 of 5.

  • The same scope with APS5_NO_WATCHED_PRIVATE_IMPORTS=1: 556 of 557, agc_driver_multisample_fill_host_only failed once. Rerun 10 of 10 with the switch, 10 of 10 without it, and 10 of 10 on main, so I can't attribute it to this PR. agc_driver_layered_volume_submit 5 of 5 with the switch too.

  • One nit: agc_import_watch runs on the recorder tests' own device, which has no settle queue, so its [write-watch] line reads Windows direct host imports use comparisons (no second queue to settle imports on) even where the real device decides yes. The probe counts it prints are the same as above. If the test is meant to pin the decision, the test device would need the second queue as well.

For the record, vkGetPhysicalDeviceQueueFamilyProperties here: family 0 graphics+compute+transfer, 16 queues.

No title on this machine, so no frame rate or [guestmem] compare figures. Tested with AI assistance (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6179713523 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6060#issuecomment-6179713523). Originally posted by [frankea](https://github.com/frankea) on 2026-10-14T22:16:42Z. --- Windows run of this PR on a third NVIDIA box, with a different driver branch from the two above. Head `919f39109` merged onto `main` `4808d9c20` (clean merge); Windows 11 10.0.26200, Ryzen 7 5800X (Zen 3), RTX 4090, NVIDIA 616.92 (Vulkan 1.4.351), MinGW-w64 GCC 15.2.0 r7, Release, `BUILD_TESTING=ON`, default environment. - Full ctest: 1235 of 1235 passed, 14 environment skips (the same skips as `main` `fa539dd9b` on this machine, 1233 of 1233). - The decision through the real `VulkanDevice` (printed by `agc_driver`, `agc_driver_layered_volume_submit`, `agc_driver_multisample_fill_host_only`): ``` [write-watch] host imports of write-watched memory keep the write watch: yes (4 of 4 scratch pages reported written at the import, 0 after the first GPU read, 0 after the second, 0 after a GPU write, 1 after a CPU store); direct host imports of private memory are settled and stay watched, separate shared aliases retain guest write tracking ``` The only difference from your 617.42 boxes is the first-read count: 0 here against 4 there. On this driver the one-time marks have all landed by the time the first GPU read completes, which fits them being asynchronous. The decision is the same. - `libSceAgcDriver` scope (`ctest -R ^agc_`), the watched path active: 557 of 557. `agc_driver_layered_volume_submit` 5 of 5. - The same scope with `APS5_NO_WATCHED_PRIVATE_IMPORTS=1`: 556 of 557, `agc_driver_multisample_fill_host_only` failed once. Rerun 10 of 10 with the switch, 10 of 10 without it, and 10 of 10 on `main`, so I can't attribute it to this PR. `agc_driver_layered_volume_submit` 5 of 5 with the switch too. - One nit: `agc_import_watch` runs on the recorder tests' own device, which has no settle queue, so its `[write-watch]` line reads `Windows direct host imports use comparisons (no second queue to settle imports on)` even where the real device decides `yes`. The probe counts it prints are the same as above. If the test is meant to pin the decision, the test device would need the second queue as well. For the record, `vkGetPhysicalDeviceQueueFamilyProperties` here: family 0 graphics+compute+transfer, 16 queues. No title on this machine, so no frame rate or `[guestmem]` compare figures. Tested with AI assistance (Claude Code).
parl0v commented 2026-10-14 22:17:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by parl0v on 2026-10-14T22:17:29Z.


@frankea thanks, a third box and an older driver branch is exactly what this needed. The 0 after the first read on 616.92 fits: the marks are asynchronous, and on your machine they finish before that read does.

On the nit: agc_import_watch is meant to pin the probe, which is what fails on main ("the Linux write watch"). The decision with the settle queue is exercised through the real VulkanDevice in agc_driver_layered_volume_submit, which prints the yes line you quote and fails if imports stay watched without the settle. If a reviewer wants the decision pinned in agc_import_watch too, I'll give the recorder tests' device the second queue.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6179728332 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6060#issuecomment-6179728332). Originally posted by [parl0v](https://github.com/parl0v) on 2026-10-14T22:17:29Z. --- @frankea thanks, a third box and an older driver branch is exactly what this needed. The 0 after the first read on 616.92 fits: the marks are asynchronous, and on your machine they finish before that read does. On the nit: `agc_import_watch` is meant to pin the probe, which is what fails on `main` ("the Linux write watch"). The decision with the settle queue is exercised through the real `VulkanDevice` in `agc_driver_layered_volume_submit`, which prints the `yes` line you quote and fails if imports stay watched without the settle. If a reviewer wants the decision pinned in `agc_import_watch` too, I'll give the recorder tests' device the second queue.
LeandroLP23 commented 2026-10-14 22:22:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-14T22:22:49Z.


On AMD's Windows driver this PR falls back to comparisons, because the graphics family has a single queue.

Radeon 860M (RDNA 3.5), Windows 11 (26300), driver 32.0.13058.8001. vulkaninfo lists every family with queueCount = 1: graphics+compute+transfer, compute+transfer, transfer, video decode. So the queues[family].queueCount >= 2 check in VulkanDevice.cpp fails, and the startup line reads:

[write-watch] Windows direct host imports use comparisons (no second queue to settle imports on); separate shared aliases retain guest write tracking

SuperTuxKart (PPSA69421), title screen, main 9bec20233 with and without this PR's head 919f39109, 60 s per run, runs alternating with #5851 on the same relinked executable:

Run main + this PR + #5851
1 5.08 FPS 5.06 FPS 7.30 FPS
2 5.03 FPS 5.17 FPS 7.26 FPS
3 5.11 FPS 5.15 FPS 7.26 FPS

With APS5_PROFILE_DRAW=1 this PR still compares 4997 calls, 41.2 GiB and 1.9 s per 10 s (main: 5333 calls, 44.4 GiB, 2.0 s), and readTarget stays at 2973 ms per 10 s. Numbers for #5851 are in https://github.com/boykopovar/AnyPS5/pull/5851#issuecomment-6179812577.

Other AMD parts on Windows likely expose the same single graphics queue. A settle queue from another family that can copy might cover them. Here the compute+transfer family already gives its one queue to sparse binding (the first non-graphics family with SPARSE_BINDING), but the transfer-only family (TRANSFER | SPARSE_BINDING, one queue) is unused, if I read the queue setup right. I haven't checked whether the settle copy needs the graphics family specifically.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6179822443 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6060#issuecomment-6179822443). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-10-14T22:22:49Z. --- On AMD's Windows driver this PR falls back to comparisons, because the graphics family has a single queue. Radeon 860M (RDNA 3.5), Windows 11 (26300), driver 32.0.13058.8001. `vulkaninfo` lists every family with `queueCount = 1`: graphics+compute+transfer, compute+transfer, transfer, video decode. So the `queues[family].queueCount >= 2` check in `VulkanDevice.cpp` fails, and the startup line reads: ``` [write-watch] Windows direct host imports use comparisons (no second queue to settle imports on); separate shared aliases retain guest write tracking ``` SuperTuxKart (PPSA69421), title screen, `main` 9bec20233 with and without this PR's head 919f39109, 60 s per run, runs alternating with #5851 on the same relinked executable: | Run | `main` | + this PR | + #5851 | |---|---|---|---| | 1 | 5.08 FPS | 5.06 FPS | 7.30 FPS | | 2 | 5.03 FPS | 5.17 FPS | 7.26 FPS | | 3 | 5.11 FPS | 5.15 FPS | 7.26 FPS | With `APS5_PROFILE_DRAW=1` this PR still compares 4997 calls, 41.2 GiB and 1.9 s per 10 s (`main`: 5333 calls, 44.4 GiB, 2.0 s), and `readTarget` stays at 2973 ms per 10 s. Numbers for #5851 are in https://github.com/boykopovar/AnyPS5/pull/5851#issuecomment-6179812577. Other AMD parts on Windows likely expose the same single graphics queue. A settle queue from another family that can copy might cover them. Here the compute+transfer family already gives its one queue to sparse binding (the first non-graphics family with `SPARSE_BINDING`), but the transfer-only family (`TRANSFER | SPARSE_BINDING`, one queue) is unused, if I read the queue setup right. I haven't checked whether the settle copy needs the graphics family specifically. AI-assisted: yes (Claude Code)
parl0v commented 2026-10-14 22:23:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by parl0v on 2026-10-14T22:23:57Z.


@LeandroLP23 thanks, that's a real gap. With one queue per family, AMD falls back to comparisons, so it loses nothing but gains nothing either (your 5.07 vs 5.13 FPS).

The settle read only has to make the import's allocation resident, and that happens per allocation, not per queue. So it doesn't need the graphics family. Plan: when the graphics family has a single queue, take the settle queue from another family with TRANSFER. On Windows that's free: the sparse queue is only created with dma-buf imports, so it never exists there. The 4-byte read then goes through a small alias buffer bound to the import's VkDeviceMemory and created for that family, which avoids a queue-family ownership transfer on the import's own buffer. I'll push it here; would you rerun SuperTuxKart on the 860M when it's up? NVIDIA keeps its second graphics queue as now.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6179842129 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6060#issuecomment-6179842129). Originally posted by [parl0v](https://github.com/parl0v) on 2026-10-14T22:23:57Z. --- @LeandroLP23 thanks, that's a real gap. With one queue per family, AMD falls back to comparisons, so it loses nothing but gains nothing either (your 5.07 vs 5.13 FPS). The settle read only has to make the import's allocation resident, and that happens per allocation, not per queue. So it doesn't need the graphics family. Plan: when the graphics family has a single queue, take the settle queue from another family with `TRANSFER`. On Windows that's free: the sparse queue is only created with dma-buf imports, so it never exists there. The 4-byte read then goes through a small alias buffer bound to the import's `VkDeviceMemory` and created for that family, which avoids a queue-family ownership transfer on the import's own buffer. I'll push it here; would you rerun SuperTuxKart on the 860M when it's up? NVIDIA keeps its second graphics queue as now.
Pipodi commented 2026-10-14 22:27:51 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Pipodi on 2026-10-14T22:27:51Z.


Read #6060 at 919f39109 (base 0ae1deb85). The approach is sound and keeps #5596's private memory private, which #5851 can't. Notes, most important first:

  1. #5851 shadows this PR when both are merged. #5851 sets writable = !GuestArenaResidentSpan(...) in importRunAt, so resident direct memory goes to the MapAlias path, and settled requires writable. The two merge without conflicts, but with both merged #6060 never applies to resident runs, which is the memory it targets. They don't coexist in practice: whichever lands second has to decide. I'll take that on #5851's side once a Yōtei A/B of the two is done.

  2. The probe doesn't test the settle that production relies on. runImportProbe reads the whole scratch range (VkBufferCopy{0, 0, bytes}) on the main queue. settleImport reads 4 bytes at offset 0 on the settle queue. So the startup decision proves that a full read settles 4 pages, while production assumes a 4-byte read settles every page of imports that run to many MiB. Could the Windows probe settle with settleImport itself (or the same 4-byte copy on the settle queue), on a larger scratch range (e.g. 4,096 pages, as in your standalone probe), and require 0 marks after it?

  3. A failed settle leaks the import. If createImport succeeds and settleImport fails (vkAllocateMemory, or the 10 s fence wait), step != nullptr takes the copy fallback but never destroys entry.buffer/entry.memory. The host pages stay pinned. destroyImport(context, entry) on that path would fix it.

  4. Each import now waits for a GPU round trip under the tracker lock. ImportWatched holds the write tracker lock (and importAllocation the imports lock) across import(), which now includes a buffer create, vkAllocateMemory, a command buffer, a fence and a wait. A persistent 256-byte destination plus a reusable command buffer and fence would leave only the submit and wait. Do you have a count of imports per 10 s on Sword of the Sea? On Yōtei we saw ~11k resident-run imports in the first 300 s.

  5. Only devices with two graphics queues get it. The settle queue needs queueCount >= 2 in the graphics family. NVIDIA has 16, but AMD's Windows driver exposes one graphics queue, so AMD stays on comparisons. That's worth a line in the debt entry. A transfer-family queue would work for a 4-byte copy, but it needs concurrent sharing or an ownership transfer on the import.

Checked and fine: the probe runs from PrepareImportWatch in the device constructor, after the settle pool exists, so using the main queue there is safe. Linux's decision is unchanged (the extra read only fills writtenAfterSecondSubmit). APS5_NO_WATCHED_PRIVATE_IMPORTS disables both the queue and the decision.

Yōtei (PPSA26344) A/B. RTX 4090, NVIDIA 617.42, i9-13900K, Windows 11 26200. All three builds share the same tree: our Yōtei branch, main at 9a3e2ac4d plus the PRs the title needs. A is that tree, B adds #5851 (ff303dac6 + the host-write guard), C adds #6060 (cherry-picked; the only conflicts were with our local timing counters). Same executable and warm shader cache. 300 s cold boots, order A B C C B A, no environment variables. The window is the first 240 s, because B and C both stop at about 255 s; more on that below. Here the startup line reads keep the write watch: yes (4 of 4 ... at the import, 0 after the first GPU read, 0 after the second, 0 after a GPU write, 1 after a CPU store). Unlike your boxes, all the marks land inside the import on this GPU.

A (main) B (#5851) C (#6060)
first lit frame 80 / 80 s 40 / 40 s 40 / 40 s
frames at 240 s 645 / 643 663 / 678 684 / 687
private memory peak 33.2 / 31.3 GB 24.5 / 24.3 GB 29.0 / 28.7 GB
[guestmem] compares 105.6k / 104.5k calls, 782 / 776 GiB, 44.7 / 42.7 s 1,361 / 1,365, 25 GiB, 0.4 / 0.3 s 1,370 / 1,381, 25 GiB, 0.3 / 0.3 s
imports created 4,198 / 4,391 5,166 / 5,296 (all aliased) 11,738 / 6,782
time in imports 1.7 / 1.8 s 16.1 / 13.5 s (aliases 6.9 / 6.4) 17.8 / 10.0 s
of which ImportWatched 0.1 s 6.5 / 4.4 s 11.1 / 5.7 s
of which Vulkan (+ settle in C) 1.6 / 1.7 s 2.6 / 2.6 s 6.6 / 4.3 s
  • Both PRs remove the comparisons: about 100k calls and 780 GiB in 240 s down to about 1.4k. Both halve the time to the first lit frame. #6060 presents 1–3 % more frames than #5851 by 240 s.
  • #5851 has the lower private peak (about 4.5 GB below #6060). #6060 is still 3–4 GB below main.
  • Vulkan time per import: about 0.38 ms on main, about 0.57–0.63 ms with #6060, so the settle adds roughly 0.2–0.25 ms per import (point 4). The larger cost is the window's saved copy, now made for every private import: 5.7–11.1 s in 240 s. #6060 also created more imports than #5851 in both runs (6.8k and 11.7k against 5.2k and 5.3k). I haven't looked at why yet.
  • The stop at ~255 s happens with both PRs, so it isn't from yours. Run 2 of C and run 2 of B both threw compute shader 0x8000316900: guest snapshot differs from registered memory at 255–258 s. We have seen that check fail on this shader before (pre-#5596 builds, after 9–29 min), and we normally run with APS5_NO_SNAPSHOT_CHECK=1. It looks like both PRs simply reach that scene sooner, while main hasn't reached it by 300 s. I'll look into it separately.

On Yōtei, #6060 is at least as fast as #5851, takes no write faults and leaves memory private. If points 2 and 3 are addressed, I'd be glad to see #6060 merged and to close #5851 in its favour. Only the private peak favours #5851.

Written by Claude (AI assistant) on a contributor's machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6179909320 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6060#issuecomment-6179909320). Originally posted by [Pipodi](https://github.com/Pipodi) on 2026-10-14T22:27:51Z. --- Read #6060 at `919f39109` (base `0ae1deb85`). The approach is sound and keeps #5596's private memory private, which #5851 can't. Notes, most important first: 1. **#5851 shadows this PR when both are merged.** #5851 sets `writable = !GuestArenaResidentSpan(...)` in `importRunAt`, so resident direct memory goes to the `MapAlias` path, and `settled` requires `writable`. The two merge without conflicts, but with both merged #6060 never applies to resident runs, which is the memory it targets. They don't coexist in practice: whichever lands second has to decide. I'll take that on #5851's side once a Yōtei A/B of the two is done. 2. **The probe doesn't test the settle that production relies on.** `runImportProbe` reads the whole scratch range (`VkBufferCopy{0, 0, bytes}`) on the main queue. `settleImport` reads 4 bytes at offset 0 on the settle queue. So the startup decision proves that a full read settles 4 pages, while production assumes a 4-byte read settles every page of imports that run to many MiB. Could the Windows probe settle with `settleImport` itself (or the same 4-byte copy on the settle queue), on a larger scratch range (e.g. 4,096 pages, as in your standalone probe), and require 0 marks after it? 3. **A failed settle leaks the import.** If `createImport` succeeds and `settleImport` fails (`vkAllocateMemory`, or the 10 s fence wait), `step != nullptr` takes the copy fallback but never destroys `entry.buffer`/`entry.memory`. The host pages stay pinned. `destroyImport(context, entry)` on that path would fix it. 4. **Each import now waits for a GPU round trip under the tracker lock.** `ImportWatched` holds the write tracker lock (and `importAllocation` the imports lock) across `import()`, which now includes a buffer create, `vkAllocateMemory`, a command buffer, a fence and a wait. A persistent 256-byte destination plus a reusable command buffer and fence would leave only the submit and wait. Do you have a count of imports per 10 s on Sword of the Sea? On Yōtei we saw ~11k resident-run imports in the first 300 s. 5. **Only devices with two graphics queues get it.** The settle queue needs `queueCount >= 2` in the graphics family. NVIDIA has 16, but AMD's Windows driver exposes one graphics queue, so AMD stays on comparisons. That's worth a line in the debt entry. A transfer-family queue would work for a 4-byte copy, but it needs concurrent sharing or an ownership transfer on the import. Checked and fine: the probe runs from `PrepareImportWatch` in the device constructor, after the settle pool exists, so using the main queue there is safe. Linux's decision is unchanged (the extra read only fills `writtenAfterSecondSubmit`). `APS5_NO_WATCHED_PRIVATE_IMPORTS` disables both the queue and the decision. **Yōtei (PPSA26344) A/B.** RTX 4090, NVIDIA 617.42, i9-13900K, Windows 11 26200. All three builds share the same tree: our Yōtei branch, main at `9a3e2ac4d` plus the PRs the title needs. A is that tree, B adds #5851 (`ff303dac6` + the host-write guard), C adds #6060 (cherry-picked; the only conflicts were with our local timing counters). Same executable and warm shader cache. 300 s cold boots, order A B C C B A, no environment variables. The window is the first 240 s, because B and C both stop at about 255 s; more on that below. Here the startup line reads `keep the write watch: yes (4 of 4 ... at the import, 0 after the first GPU read, 0 after the second, 0 after a GPU write, 1 after a CPU store)`. Unlike your boxes, all the marks land inside the import on this GPU. | | A (main) | B (#5851) | C (#6060) | |---|---|---|---| | first lit frame | 80 / 80 s | 40 / 40 s | 40 / 40 s | | frames at 240 s | 645 / 643 | 663 / 678 | **684 / 687** | | private memory peak | 33.2 / 31.3 GB | **24.5 / 24.3 GB** | 29.0 / 28.7 GB | | `[guestmem]` compares | 105.6k / 104.5k calls, 782 / 776 GiB, 44.7 / 42.7 s | 1,361 / 1,365, 25 GiB, 0.4 / 0.3 s | 1,370 / 1,381, 25 GiB, 0.3 / 0.3 s | | imports created | 4,198 / 4,391 | 5,166 / 5,296 (all aliased) | 11,738 / 6,782 | | time in imports | 1.7 / 1.8 s | 16.1 / 13.5 s (aliases 6.9 / 6.4) | 17.8 / 10.0 s | | of which `ImportWatched` | 0.1 s | 6.5 / 4.4 s | 11.1 / 5.7 s | | of which Vulkan (+ settle in C) | 1.6 / 1.7 s | 2.6 / 2.6 s | 6.6 / 4.3 s | - Both PRs remove the comparisons: about 100k calls and 780 GiB in 240 s down to about 1.4k. Both halve the time to the first lit frame. #6060 presents 1–3 % more frames than #5851 by 240 s. - #5851 has the lower private peak (about 4.5 GB below #6060). #6060 is still 3–4 GB below main. - Vulkan time per import: about 0.38 ms on main, about 0.57–0.63 ms with #6060, so the settle adds roughly 0.2–0.25 ms per import (point 4). The larger cost is the window's saved copy, now made for every private import: 5.7–11.1 s in 240 s. #6060 also created more imports than #5851 in both runs (6.8k and 11.7k against 5.2k and 5.3k). I haven't looked at why yet. - **The stop at ~255 s happens with both PRs, so it isn't from yours.** Run 2 of C and run 2 of B both threw `compute shader 0x8000316900: guest snapshot differs from registered memory` at 255–258 s. We have seen that check fail on this shader before (pre-#5596 builds, after 9–29 min), and we normally run with `APS5_NO_SNAPSHOT_CHECK=1`. It looks like both PRs simply reach that scene sooner, while main hasn't reached it by 300 s. I'll look into it separately. On Yōtei, #6060 is at least as fast as #5851, takes no write faults and leaves memory private. If points 2 and 3 are addressed, I'd be glad to see #6060 merged and to close #5851 in its favour. Only the private peak favours #5851. *Written by Claude (AI assistant) on a contributor's machine.*
LeandroLP23 commented 2026-10-14 22:28:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-14T22:28:21Z.


@parl0v yes, I'll rerun SuperTuxKart on the 860M (same alternating A/B against main and #5851, plus the [write-watch] decision line) once the transfer-family settle queue is pushed.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6179918120 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6060#issuecomment-6179918120). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-10-14T22:28:21Z. --- @parl0v yes, I'll rerun SuperTuxKart on the 860M (same alternating A/B against `main` and #5851, plus the `[write-watch]` decision line) once the transfer-family settle queue is pushed.
parl0v commented 2026-10-14 22:48:09 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by parl0v on 2026-10-14T22:48:09Z.


@Pipodi thank you, that's a thorough review, and the Yōtei A/B is great. Pushed 2406c85f6:

  1. The probe settles the way production does. runImportProbe takes an optional settle step: the Windows probe imports 4,096 scratch pages, settles them with settleImport itself (the 4-byte read on the settle queue), and the decision requires 0 marks after the settle, after both full reads and after the GPU write. RTX 4060, 617.42: 4096 of 4096 scratch pages reported written at the import, 4096 by its 4-byte settle read, 0 after it, 0 after a full GPU read, 0 after a second, 0 after a GPU write, 1 after a CPU store.
  2. A failed settle destroys the import (destroyImport, handles cleared) before the copy fallback.
  3. The settle's destination, command buffer and fence are created once per device (in HostImports, freed in ClearHostImports), so an import pays only the reset, submit and wait. I'll post imports per 10 s on SotS with the stability numbers below.
  4. AMD: where the graphics family has one queue, the settle queue comes from another family that copies (transfer-only first), and the read goes through a buffer aliasing the import's VkDeviceMemory, so no ownership transfer touches the import's own buffer. APS5_SETTLE_OTHER_FAMILY=1 forces that path on NVIDIA, and agc_driver_layered_volume_submit_other_family runs it in ctest. frankea's point is covered too: the recorder tests' device now has the settle queue, so agc_import_watch sees the real decision.

libSceAgcDriver ctest (RTX 4060): 562/563 with the change, with APS5_SETTLE_OTHER_FAMILY=1, and with APS5_NO_WATCHED_PRIVATE_IMPORTS=1 (only agc_shader_disk_cache, a Windows directory lock here).

Still open, please don't merge yet: the 40-min run. With the change off, SotS ran the full 40 min (7,132 frames). With it on, run 1 stopped at ~6,400 frames with vkAllocateDescriptorSets ... -2, and run 2 is at 31.6 GB private bytes after 13 min on a 32 GB box. I'm measuring private bytes over time on and off next, to tell a leak from the title's normal footprint. That ties in with your higher import count and private peak on Yōtei. Back with numbers.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6180210603 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6060#issuecomment-6180210603). Originally posted by [parl0v](https://github.com/parl0v) on 2026-10-14T22:48:09Z. --- @Pipodi thank you, that's a thorough review, and the Yōtei A/B is great. Pushed `2406c85f6`: 2. **The probe settles the way production does.** `runImportProbe` takes an optional settle step: the Windows probe imports 4,096 scratch pages, settles them with `settleImport` itself (the 4-byte read on the settle queue), and the decision requires 0 marks after the settle, after both full reads and after the GPU write. RTX 4060, 617.42: `4096 of 4096 scratch pages reported written at the import, 4096 by its 4-byte settle read, 0 after it, 0 after a full GPU read, 0 after a second, 0 after a GPU write, 1 after a CPU store`. 3. **A failed settle destroys the import** (`destroyImport`, handles cleared) before the copy fallback. 4. **The settle's destination, command buffer and fence are created once per device** (in `HostImports`, freed in `ClearHostImports`), so an import pays only the reset, submit and wait. I'll post imports per 10 s on SotS with the stability numbers below. 5. **AMD:** where the graphics family has one queue, the settle queue comes from another family that copies (transfer-only first), and the read goes through a buffer aliasing the import's `VkDeviceMemory`, so no ownership transfer touches the import's own buffer. `APS5_SETTLE_OTHER_FAMILY=1` forces that path on NVIDIA, and `agc_driver_layered_volume_submit_other_family` runs it in ctest. frankea's point is covered too: the recorder tests' device now has the settle queue, so `agc_import_watch` sees the real decision. `libSceAgcDriver` ctest (RTX 4060): 562/563 with the change, with `APS5_SETTLE_OTHER_FAMILY=1`, and with `APS5_NO_WATCHED_PRIVATE_IMPORTS=1` (only `agc_shader_disk_cache`, a Windows directory lock here). **Still open, please don't merge yet:** the 40-min run. With the change off, SotS ran the full 40 min (7,132 frames). With it on, run 1 stopped at ~6,400 frames with `vkAllocateDescriptorSets ... -2`, and run 2 is at 31.6 GB private bytes after 13 min on a 32 GB box. I'm measuring private bytes over time on and off next, to tell a leak from the title's normal footprint. That ties in with your higher import count and private peak on Yōtei. Back with numbers.
parl0v commented 2026-10-14 22:50:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by parl0v on 2026-10-14T22:50:55Z.


@LeandroLP23 the transfer-family settle queue is in 2406c85f6. On your 860M the startup line should now read keep the write watch: yes (the probe settles through the non-graphics queue). If it says otherwise, the line's counts will show which step failed.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6180246767 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6060#issuecomment-6180246767). Originally posted by [parl0v](https://github.com/parl0v) on 2026-10-14T22:50:55Z. --- @LeandroLP23 the transfer-family settle queue is in `2406c85f6`. On your 860M the startup line should now read `keep the write watch: yes` (the probe settles through the non-graphics queue). If it says otherwise, the line's counts will show which step failed.
Amoenus commented 2026-10-14 22:53:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-14T22:53:04Z.


Windows validation: merged head and retained integration

#6060 is merged in main 0afa6a607. Experimental fork checkpoint b5682c8f3 includes that main, merged native-depth #5496, and our retained MSAA/depth follow-ups. It removes the superseded #5851 automatic alias migration; Pipodi's separate host-write safety guard remains tracked in #6260.

Current composition: full Windows app/libs and conventions pass. The selected 70-group matrix runs once per NVIDIA/AMD selector: 69 pass, one fails on each, no CTest skips; maximum 2.15s/2.13s. Forty-nine passing groups per vendor have physical-device output; the other20 are not GPU coverage.

  • The adapted neighboring-import regression passes 5/5 per GPU, preserving all1024 drawn samples and the native target's watch before/after a private compared neighbor import. Its former requirement that the neighbor itself remain watched was too strict after the1MiB settle floor.
  • agc_driver_multisample_fill_host_only fails 5/5 per GPU, before its first native clear after independent plain-buffer preflight:
    multisample target reuse requires watched guest memory; untracked writes are not implemented (color: range excluded by host import).
  • One-variable control on the prior bade5ae0c composition: temporarily setting only settleFloorBytes to zero makes both original fixtures pass5/5 per GPU; restoring the production1MiB value byte-for-byte makes both fail5/5 again. Zero is neither committed nor proposed as a fix. The exact offending import window is not isolated yet.

This remaining failure belongs to our retained native-MSAA composition; it is not an unchanged-main/isolated-PR regression or a reproduced Sonic cause. The watch/refusal guard is retained. No title replay, gameplay/FPS, performance, Linux, console or full-suite claim.

Historical 02da644cd remains preserved:70 groups x5 per selector passed with the older6c6a6c85a head, before the floor. Those green results do not describe current main. Earlier focused probe evidence remains pinned to d027f8dda.

Windows11 Enterprise26200, WinLibs GCC15.2.0 Release; RTX5080 driver610.62/32.0.16.1062 and Ryzen9950X3D Radeon Graphics driver32.0.21036.18. Required Vulkan, shader caches disabled, serial tests,30s timeout. No local Khronos validation layer. The same-value CPU-store-during-settling question below remains open; no concurrent-store injection is claimed. AI-assisted: Codex.

Earlier CPU-window control and remaining question

A scoped Windows CPU control before I try this PR's Vulkan path: test-only fork 2fc4aba8e, based on unchanged main eea428ca855fb59a3edd394bab9abf99165590f1, adds only30 lines to tests/WriteTracking.cpp.

A volatile CPU store of the existing byte is detected outside the import window after CollectWritesUncached. The same store inside an ImportWatched(..., true) callback reproduces this 5/5 times:

watched=1 unchanged=1 unchangedCollected=0 written=0 storedOver=0 changed=0 cpu=1

The added conservative !UnchangedSince assertion fails. This is deliberately a fault-control assertion, not a claim that UnchangedSince has the same contract as UnchangedSinceCollected: main's existing window tests already expect equal bytes to remain BlockUnchanged while retaining possible CPU-touch information. The event information is not lost altogether.

Since this PR settles the import inside that existing comparison window, could its regression coverage also exercise a same-value CPU store during settling, including the consumer's invalidation predicate? In our retained native-color composition, a GPU image can differ from its old guest bytes, so a CPU store restoring those old bytes must not be treated as proof of no CPU store merely because the window's byte comparison is equal. This control shows which generic predicates retain that distinction; it does not reproduce a Vulkan import, concurrent settle-queue behavior, this exact PR head, or a game's producer.

Built the main-pin runtime libraries and fixture; used its configured CTest environment. Windows11 Enterprise26200, WinLibs15.2.0r7 Release/SPIRV-Tools ON, five serial runs, each below1s. CPU-only; no GPU coverage or approval claimed. AI-assisted: Codex.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6180274490 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6060#issuecomment-6180274490). Originally posted by [Amoenus](https://github.com/Amoenus) on 2026-10-14T22:53:04Z. --- <!-- codex-private-import-gpu-validation-v1 --> ### Windows validation: merged head and retained integration #6060 is merged in main `0afa6a607`. [Experimental fork checkpoint `b5682c8f3`](https://github.com/Amoenus/AnyPS5/commit/b5682c8f3a2e4f9d37145c1086b17fbd3ee1c27e) includes that main, merged native-depth #5496, and our retained MSAA/depth follow-ups. It removes the superseded #5851 automatic alias migration; Pipodi's separate host-write safety guard remains tracked in [#6260](https://github.com/boykopovar/AnyPS5/issues/6260). **Current composition:** full Windows app/libs and conventions pass. The selected 70-group matrix runs once per NVIDIA/AMD selector: **69 pass, one fails on each**, no CTest skips; maximum 2.15s/2.13s. Forty-nine passing groups per vendor have physical-device output; the other20 are not GPU coverage. - The adapted neighboring-import regression passes **5/5 per GPU**, preserving all1024 drawn samples and the native target's watch before/after a private **compared** neighbor import. Its former requirement that the neighbor itself remain watched was too strict after the1MiB settle floor. - `agc_driver_multisample_fill_host_only` fails **5/5 per GPU**, before its first native clear after independent plain-buffer preflight: `multisample target reuse requires watched guest memory; untracked writes are not implemented (color: range excluded by host import)`. - One-variable control on the prior `bade5ae0c` composition: temporarily setting only `settleFloorBytes` to zero makes both original fixtures pass5/5 per GPU; restoring the production1MiB value byte-for-byte makes both fail5/5 again. **Zero is neither committed nor proposed as a fix.** The exact offending import window is not isolated yet. This remaining failure belongs to our retained native-MSAA composition; it is **not an unchanged-main/isolated-PR regression or a reproduced Sonic cause**. The watch/refusal guard is retained. No title replay, gameplay/FPS, performance, Linux, console or full-suite claim. Historical [02da644cd](https://github.com/Amoenus/AnyPS5/commit/02da644cd47a2d36f0645e124ff6a1c6c13b5c07) remains preserved:70 groups x5 per selector passed with the older6c6a6c85a head, before the floor. Those green results do not describe current main. Earlier focused probe evidence remains pinned to [d027f8dda](https://github.com/Amoenus/AnyPS5/commit/d027f8ddab01089bf22e2ae362ba28d2be440749). Windows11 Enterprise26200, WinLibs GCC15.2.0 Release; RTX5080 driver610.62/32.0.16.1062 and Ryzen9950X3D Radeon Graphics driver32.0.21036.18. Required Vulkan, shader caches disabled, serial tests,30s timeout. No local Khronos validation layer. The same-value CPU-store-during-settling question below remains open; no concurrent-store injection is claimed. AI-assisted: Codex. <details> <summary>Earlier CPU-window control and remaining question</summary> <!-- codex-cpu-window-preserved-v1 --> A scoped Windows CPU control before I try this PR's Vulkan path: [test-only fork `2fc4aba8e`](https://github.com/Amoenus/AnyPS5/commit/2fc4aba8e03e8836a977b77ec13766c13c501e42), based on unchanged main `eea428ca855fb59a3edd394bab9abf99165590f1`, adds only30 lines to `tests/WriteTracking.cpp`. A volatile CPU store of the existing byte is detected outside the import window after `CollectWritesUncached`. The same store inside an `ImportWatched(..., true)` callback reproduces this **5/5 times**: ```text watched=1 unchanged=1 unchangedCollected=0 written=0 storedOver=0 changed=0 cpu=1 ``` The added conservative `!UnchangedSince` assertion fails. This is deliberately a fault-control assertion, not a claim that `UnchangedSince` has the same contract as `UnchangedSinceCollected`: main's existing window tests already expect equal bytes to remain `BlockUnchanged` while retaining possible CPU-touch information. The event information is **not lost altogether**. Since this PR settles the import inside that existing comparison window, could its regression coverage also exercise a same-value CPU store during settling, including the consumer's invalidation predicate? In our retained native-color composition, a GPU image can differ from its old guest bytes, so a CPU store restoring those old bytes must not be treated as proof of no CPU store merely because the window's byte comparison is equal. This control shows which generic predicates retain that distinction; it does **not** reproduce a Vulkan import, concurrent settle-queue behavior, this exact PR head, or a game's producer. Built the main-pin runtime libraries and fixture; used its configured CTest environment. Windows11 Enterprise26200, WinLibs15.2.0r7 Release/SPIRV-Tools ON, five serial runs, each below1s. CPU-only; no GPU coverage or approval claimed. AI-assisted: Codex. <!-- /codex-cpu-window-preserved-v1 --> </details>
parl0v commented 2026-10-14 22:54:08 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by parl0v on 2026-10-14T22:54:08Z.


@Amoenus thanks, that's a fair control. A same-value CPU store inside an ImportWatched window is the limitation the Pages under an import window debt entry already names ("A CPU store of the bytes already there within the window cannot be told apart from an import that resolves the write protection without storing"). main has it for every watched import today.

What this PR changes is the window's length. The settle read keeps it open for one round trip on the settle queue, about 0.2–0.25 ms per import by Pipodi's Yōtei timing. Same-value stores in that span stay indistinguishable by design, so a test pinning them would only pin the limitation. The guarantee worth covering is the other one: a CPU store of different bytes during the settle must still count as stored over. I'll add that case, a store from another thread while settleImport waits, and add a sentence to the debt entry that the settle lengthens the window.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6180288658 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6060#issuecomment-6180288658). Originally posted by [parl0v](https://github.com/parl0v) on 2026-10-14T22:54:08Z. --- @Amoenus thanks, that's a fair control. A same-value CPU store inside an `ImportWatched` window is the limitation the `Pages under an import window` debt entry already names ("A CPU store of the bytes already there within the window cannot be told apart from an import that resolves the write protection without storing"). `main` has it for every watched import today. What this PR changes is the window's length. The settle read keeps it open for one round trip on the settle queue, about 0.2–0.25 ms per import by Pipodi's Yōtei timing. Same-value stores in that span stay indistinguishable by design, so a test pinning them would only pin the limitation. The guarantee worth covering is the other one: a CPU store of *different* bytes during the settle must still count as stored over. I'll add that case, a store from another thread while `settleImport` waits, and add a sentence to the debt entry that the settle lengthens the window.
parl0v commented 2026-10-14 23:00:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by parl0v on 2026-10-14T23:00:23Z.


@Amoenus added in f97762019 (rebased onto 6239ceffc): CheckImportWindowOtherThread in agc_write_tracking. Another thread stores into the range inside ImportWatched's window: new bytes must read as BlockWritten with the CPU-touch bit, and the same-value store must keep its CPU-touch bit. The debt entry now says the settle keeps the window open one round trip longer. agc_write_tracking, agc_import_watch, agc_driver_layered_volume_submit (+ _other_family), agc_driver_store_over_untracked and agc_driver_dcc_keys_first_write pass on the rebased head (RTX 4060).

Stability update: a second 40-min run with this PR also stopped on vkAllocateDescriptorSets ... -2 (~22 min, 12,025 frames; the first at ~12 min, 6,474 frames). The run with APS5_NO_WATCHED_PRIVATE_IMPORTS=1 went the full 40 min (7,132 frames). Private bytes over time, on vs off, are running now. Still not ready to merge.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6180370831 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6060#issuecomment-6180370831). Originally posted by [parl0v](https://github.com/parl0v) on 2026-10-14T23:00:23Z. --- @Amoenus added in `f97762019` (rebased onto `6239ceffc`): `CheckImportWindowOtherThread` in `agc_write_tracking`. Another thread stores into the range inside `ImportWatched`'s window: new bytes must read as `BlockWritten` with the CPU-touch bit, and the same-value store must keep its CPU-touch bit. The debt entry now says the settle keeps the window open one round trip longer. `agc_write_tracking`, `agc_import_watch`, `agc_driver_layered_volume_submit` (+ `_other_family`), `agc_driver_store_over_untracked` and `agc_driver_dcc_keys_first_write` pass on the rebased head (RTX 4060). Stability update: a second 40-min run with this PR also stopped on `vkAllocateDescriptorSets ... -2` (~22 min, 12,025 frames; the first at ~12 min, 6,474 frames). The run with `APS5_NO_WATCHED_PRIVATE_IMPORTS=1` went the full 40 min (7,132 frames). Private bytes over time, on vs off, are running now. Still not ready to merge.
SoRadGaming commented 2026-10-14 23:20:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SoRadGaming on 2026-10-14T23:20:45Z.


Results on an AMD GPU: Windows 11 Pro 26200, Ryzen 7 5800X3D, Radeon RX 9070 XT (driver 32.0.23033.1002), 32 GB, WinLibs GCC 15.2.0, Release. The build is this head (919f39109) as it is, relinked with main's relinker.

Probe. The graphics family has 8 queues here, so the settle queue exists. The startup line reads:

[write-watch] host imports of write-watched memory keep the write watch: yes (4 of 4 scratch pages reported written at the import, 0 after the first GPU read, 0 after the second, 0 after a GPU write, 1 after a CPU store); direct host imports of private memory are settled and stay watched, separate shared aliases retain guest write tracking

So this driver marks the pages only inside vkAllocateMemory, and the first GPU read finds nothing, unlike the 4 of 4 on your NVIDIA boxes. A standalone probe agrees. It imports 512 pages of MEM_WRITE_WATCH memory, collects with reset at +0, 10, 50, 100, 250, 500 and 1000 ms, after a GPU copy, after a GPU fill and after one CPU store, for 5 rounds. All 512 pages are marked at +0 ms and none after that. The CPU store shows as 1 page.

Tests.

  • agc_import_watch and agc_driver_layered_volume_submit pass, with the change and with APS5_NO_WATCHED_PRIVATE_IMPORTS=1.
  • ctest -R "agc_|guest_memory|write_watch" -j 6 passes 561 of 562 with the change. The one failure, agc_driver_layered_volume_vertex_no_gpl (vertex draw: slice 1 texel (0, 0) channel 0 is 64, expected 255 (the band of layer 0)), also fails with APS5_NO_WATCHED_PRIVATE_IMPORTS=1, and it failed on main e34c47921 before this PR. So it's an existing AMD failure, not this change, despite the similar message.
  • In the run with the switch, guest_memory stopped once with 0xc0000409 under -j 6. It then passed 10 of 10 runs on its own, 5 with the switch and 5 without.

ASTRO BOT (PPSA21564 01.007.000), -lvl hub_crashsite (the full Crash Site hub), no input, no profiler, warm shader cache (1,904 hits, 0 misses). FPS comes from the window's present counter over 120 s, after a 120 s settle once the level has started. APS5_NO_SNAPSHOT_CHECK=1 APS5_RESOURCE_CACHE_ENTRIES=4096. Runs alternate on one executable and one set of libraries:

hub FPS 10 s samples
APS5_NO_WATCHED_PRIVATE_IMPORTS=1 (comparisons, as main) 0.42 / 0.42 0.3-0.5
this PR 2.88 / 2.90 2.7-3.1

That is 6.9× on this title. For scale, I also built the same tree with a local switch in GuestArenaMapDirect_nid_postfix that maps singly mapped direct memory through the section, as before #5596 (a diagnostic; it brings back the write faults). On that build, this PR gives 2.88 FPS and the section path 3.31 / 3.29. So this PR wins back about 85 % of what #5596 cost here, with no write faults.

What's left is not in this PR's code. APS5_SAMPLE_WORKER sampled queue worker 0 on that build over the same 80 s window of the hub in each mode, 5,124 samples each:

  • With this PR, 12.4 % of the samples are in GuestArenaCollectWrites → WindowsMappings::Collect → collectResident, that is, GetWriteWatch over resident runs. About 8 % is in the syscall itself.
  • It comes mostly from ShaderResources::fastRevalidate on every draw (6.5 %), StorageTexture::Refresh (2.5 %) and PrepareDrawBindings (1.4 %).
  • On the section path the same collects stop at cleanRanges and don't show up.

So the rest is the cost of collecting #5596's resident write watch. It isn't the settle, which doesn't appear in the samples.

With #1201's pipelining on top (its head plus @Raghav314's and @eliyarson's ordering fixes, APS5_PIPELINED_DRAWS=1), this PR's tree runs the hub at 4.81 / 4.92 FPS.

There were no stops or errors in any of these runs: 7 launches with this PR active, 3 with the section switch and 2 with APS5_NO_WATCHED_PRIVATE_IMPORTS=1.

AI-assisted (Claude Code); the builds and runs are on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6180655593 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6060#issuecomment-6180655593). Originally posted by [SoRadGaming](https://github.com/SoRadGaming) on 2026-10-14T23:20:45Z. --- Results on an AMD GPU: Windows 11 Pro 26200, Ryzen 7 5800X3D, Radeon RX 9070 XT (driver 32.0.23033.1002), 32 GB, WinLibs GCC 15.2.0, Release. The build is this head (`919f39109`) as it is, relinked with `main`'s relinker. **Probe.** The graphics family has 8 queues here, so the settle queue exists. The startup line reads: ``` [write-watch] host imports of write-watched memory keep the write watch: yes (4 of 4 scratch pages reported written at the import, 0 after the first GPU read, 0 after the second, 0 after a GPU write, 1 after a CPU store); direct host imports of private memory are settled and stay watched, separate shared aliases retain guest write tracking ``` So this driver marks the pages only inside `vkAllocateMemory`, and the first GPU read finds nothing, unlike the 4 of 4 on your NVIDIA boxes. A standalone probe agrees. It imports 512 pages of `MEM_WRITE_WATCH` memory, collects with reset at +0, 10, 50, 100, 250, 500 and 1000 ms, after a GPU copy, after a GPU fill and after one CPU store, for 5 rounds. All 512 pages are marked at +0 ms and none after that. The CPU store shows as 1 page. **Tests.** - `agc_import_watch` and `agc_driver_layered_volume_submit` pass, with the change and with `APS5_NO_WATCHED_PRIVATE_IMPORTS=1`. - `ctest -R "agc_|guest_memory|write_watch" -j 6` passes 561 of 562 with the change. The one failure, `agc_driver_layered_volume_vertex_no_gpl` (`vertex draw: slice 1 texel (0, 0) channel 0 is 64, expected 255 (the band of layer 0)`), also fails with `APS5_NO_WATCHED_PRIVATE_IMPORTS=1`, and it failed on `main` e34c47921 before this PR. So it's an existing AMD failure, not this change, despite the similar message. - In the run with the switch, `guest_memory` stopped once with 0xc0000409 under `-j 6`. It then passed 10 of 10 runs on its own, 5 with the switch and 5 without. **ASTRO BOT (PPSA21564 01.007.000)**, `-lvl hub_crashsite` (the full Crash Site hub), no input, no profiler, warm shader cache (1,904 hits, 0 misses). FPS comes from the window's present counter over 120 s, after a 120 s settle once the level has started. `APS5_NO_SNAPSHOT_CHECK=1 APS5_RESOURCE_CACHE_ENTRIES=4096`. Runs alternate on one executable and one set of libraries: | | hub FPS | 10 s samples | |---|---|---| | `APS5_NO_WATCHED_PRIVATE_IMPORTS=1` (comparisons, as `main`) | 0.42 / 0.42 | 0.3-0.5 | | this PR | **2.88 / 2.90** | 2.7-3.1 | That is 6.9× on this title. For scale, I also built the same tree with a local switch in `GuestArenaMapDirect_nid_postfix` that maps singly mapped direct memory through the section, as before #5596 (a diagnostic; it brings back the write faults). On that build, this PR gives 2.88 FPS and the section path 3.31 / 3.29. So this PR wins back about 85 % of what #5596 cost here, with no write faults. What's left is not in this PR's code. `APS5_SAMPLE_WORKER` sampled queue worker 0 on that build over the same 80 s window of the hub in each mode, 5,124 samples each: - With this PR, 12.4 % of the samples are in `GuestArenaCollectWrites` → `WindowsMappings::Collect` → `collectResident`, that is, `GetWriteWatch` over resident runs. About 8 % is in the syscall itself. - It comes mostly from `ShaderResources::fastRevalidate` on every draw (6.5 %), `StorageTexture::Refresh` (2.5 %) and `PrepareDrawBindings` (1.4 %). - On the section path the same collects stop at `cleanRanges` and don't show up. So the rest is the cost of collecting #5596's resident write watch. It isn't the settle, which doesn't appear in the samples. With #1201's pipelining on top (its head plus @Raghav314's and @eliyarson's ordering fixes, `APS5_PIPELINED_DRAWS=1`), this PR's tree runs the hub at 4.81 / 4.92 FPS. There were no stops or errors in any of these runs: 7 launches with this PR active, 3 with the section switch and 2 with `APS5_NO_WATCHED_PRIVATE_IMPORTS=1`. AI-assisted (Claude Code); the builds and runs are on my machine.
parl0v commented 2026-10-14 23:24:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by parl0v on 2026-10-14T23:24:04Z.


@SoRadGaming thank you, that's the first non-NVIDIA confirmation, and a third title. 0.42 → 2.89 FPS on the Astro Bot hub, 85 % of what #5596 cost, with no faults. The marks landing only inside vkAllocateMemory on RDNA 4 fit the settle being a no-op there and the decision coming out the same. Your sampling also points at the next cost, collectResident under fastRevalidate, which belongs in its own PR.

Status of the 40-min stop: it isn't this PR's code. TextureDetiler::BeginBatch recycles its descriptor pools only when the recorder is idle. With the title fast enough that the recorder never idles, it adds a 64-set pool for every 64 detiles until vkAllocateDescriptorSets fails (-2). On SotS that's about 31.6 GB private after 13 min. A separate fix recycles each pool once the batches that used it complete. With it on top of this PR, SotS is at 10.4 GB and flat after 10 min of a 40-min run, which is still going. I'll open it as its own PR when the run is done, and test #5851 on the same 40 min to confirm the stop isn't specific to either.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6180698555 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6060#issuecomment-6180698555). Originally posted by [parl0v](https://github.com/parl0v) on 2026-10-14T23:24:04Z. --- @SoRadGaming thank you, that's the first non-NVIDIA confirmation, and a third title. 0.42 → 2.89 FPS on the Astro Bot hub, 85 % of what #5596 cost, with no faults. The marks landing only inside `vkAllocateMemory` on RDNA 4 fit the settle being a no-op there and the decision coming out the same. Your sampling also points at the next cost, `collectResident` under `fastRevalidate`, which belongs in its own PR. Status of the 40-min stop: it isn't this PR's code. `TextureDetiler::BeginBatch` recycles its descriptor pools only when the recorder is idle. With the title fast enough that the recorder never idles, it adds a 64-set pool for every 64 detiles until `vkAllocateDescriptorSets` fails (-2). On SotS that's about 31.6 GB private after 13 min. A separate fix recycles each pool once the batches that used it complete. With it on top of this PR, SotS is at 10.4 GB and flat after 10 min of a 40-min run, which is still going. I'll open it as its own PR when the run is done, and test #5851 on the same 40 min to confirm the stop isn't specific to either.
ivica00 commented 2026-10-14 23:38:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ivica00 on 2026-10-14T23:38:18Z.


Tested and verified on AMD Radeon RX 9070 XT (Windows 10 / Vulkan 1.3):

  1. Vendor compatibility confirmation:
    The PR notes testing exclusively on NVIDIA (RTX 4060 and RTX 3060). On AMD Radeon RX 9070 XT, the probe succeeds with identical semantics:
    [write-watch] host imports of write-watched memory keep the write watch: yes (4096 of 4096 scratch pages reported written at the import, 0 by its 4-byte settle read, 0 after it, 0 after a full GPU read, 0 after a second, 0 after a GPU write, 1 after a CPU store); direct host imports of private memory are settled and stay watched, separate shared aliases retain guest write tracking
    All 4,096 scratch pages marked at import are completely settled by the 4-byte read on the secondary settle queue, with 0 false writes recorded during subsequent GPU reads and passes.
    
    

Test suite results:

agc_import_watch: PASSED (0.21s)
agc_write_tracking: PASSED (0.10s)
agc_driver_layered_volume_submit: PASSED (0.33s)

Title verification outside PPSA25344: Tested with Hello Neighbor 2 (APS5_PIPELINED_DRAWS=32, APS5_IMPORT_GPU_ONLY=1). Renders cleanly with zero visual regressions, no red-zone or memory corruption crashes, and clean frame capture.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6180885102 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6060#issuecomment-6180885102). Originally posted by [ivica00](https://github.com/ivica00) on 2026-10-14T23:38:18Z. --- Tested and verified on **AMD Radeon RX 9070 XT** (Windows 10 / Vulkan 1.3): 1. **Vendor compatibility confirmation:** The PR notes testing exclusively on NVIDIA (RTX 4060 and RTX 3060). On AMD Radeon RX 9070 XT, the probe succeeds with identical semantics: ```text [write-watch] host imports of write-watched memory keep the write watch: yes (4096 of 4096 scratch pages reported written at the import, 0 by its 4-byte settle read, 0 after it, 0 after a full GPU read, 0 after a second, 0 after a GPU write, 1 after a CPU store); direct host imports of private memory are settled and stay watched, separate shared aliases retain guest write tracking All 4,096 scratch pages marked at import are completely settled by the 4-byte read on the secondary settle queue, with 0 false writes recorded during subsequent GPU reads and passes. Test suite results: agc_import_watch: PASSED (0.21s) agc_write_tracking: PASSED (0.10s) agc_driver_layered_volume_submit: PASSED (0.33s) Title verification outside PPSA25344: Tested with Hello Neighbor 2 (APS5_PIPELINED_DRAWS=32, APS5_IMPORT_GPU_ONLY=1). Renders cleanly with zero visual regressions, no red-zone or memory corruption crashes, and clean frame capture.
TideOPL commented 2026-10-15 00:08:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by TideOPL on 2026-10-15T00:08:25Z.


Tested on Minecraft Dungeons II (PPSA16064), Windows 11, RTX 5070 (driver 610.88), WinLibs GCC 15.2, Release.

Without this PR. main 2559e9623 plus our MCD2 test patches runs the title screen at about 2.5 FPS with a warm shader cache, so the Enter press doesn't register before our 200 s boot timeout. That's the #5596 cost.

With this PR. Head f97762019 merged onto the same base: the title and the level load normally (title at 42 s, gameplay at 86 s on a cold cache) and gameplay renders correctly.

Gameplay frame times. Upstream trace (APS5_TRACE_SECONDS=25:15, opened 25 s after the gameplay HUD), interleaved with our older play build on main feddf7f4c, which predates #5596:

Run older build (pre-#5596) p50 / p99 ms this PR on current main p50 / p99 ms
1 85.3 / 109.2 84.6 / 141.6
2 81.0 / 94.4 86.5 / 113.0
3 84.6 / 111.7 84.9 / 106.3

The p50 is within about 2% of the pre-#5596 build. The two builds also differ in other ways (current main lacks #1201's draw-cache commits, which our older build carries), so this compares builds, not this PR alone.

Not tested. #5851 side by side with this PR on the same base, AMD, and Linux.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6181274969 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6060#issuecomment-6181274969). Originally posted by [TideOPL](https://github.com/TideOPL) on 2026-10-15T00:08:25Z. --- Tested on Minecraft Dungeons II (PPSA16064), Windows 11, RTX 5070 (driver 610.88), WinLibs GCC 15.2, Release. **Without this PR.** `main` 2559e9623 plus our MCD2 test patches runs the title screen at about 2.5 FPS with a warm shader cache, so the Enter press doesn't register before our 200 s boot timeout. That's the #5596 cost. **With this PR.** Head f97762019 merged onto the same base: the title and the level load normally (title at 42 s, gameplay at 86 s on a cold cache) and gameplay renders correctly. **Gameplay frame times.** Upstream trace (`APS5_TRACE_SECONDS=25:15`, opened 25 s after the gameplay HUD), interleaved with our older play build on `main` feddf7f4c, which predates #5596: | Run | older build (pre-#5596) p50 / p99 ms | this PR on current `main` p50 / p99 ms | |---|---|---| | 1 | 85.3 / 109.2 | 84.6 / 141.6 | | 2 | 81.0 / 94.4 | 86.5 / 113.0 | | 3 | 84.6 / 111.7 | 84.9 / 106.3 | The p50 is within about 2% of the pre-#5596 build. The two builds also differ in other ways (current `main` lacks #1201's draw-cache commits, which our older build carries), so this compares builds, not this PR alone. **Not tested.** #5851 side by side with this PR on the same base, AMD, and Linux.
parl0v commented 2026-10-15 00:11:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by parl0v on 2026-10-15T00:11:53Z.


@ivica00 @TideOPL thank you both. That's a second RX 9070 XT and a fifth title, and Minecraft Dungeons II's p50 within about 2 % of the pre-#5596 build is the closest to a clean before/after so far. @ivica00, one detail: your line says 0 pages were marked by the settle read, so on RDNA 4 every mark lands at the import and the settle read has nothing to clear. Same as SoRadGaming's.

The 40-min stop is fixed by #6168. SotS with this PR plus #6168 ran the full 40 min at the title: 23,678 frames, no stop, private bytes 10.0 → 10.4 GB. This PR alone stopped with -2 at 12 and 22 min (about 31.6 GB). The bug is on main; this PR only exposes it because the title no longer lets the recorder go idle, so #6168 is its own PR and can land first. With it in, this PR has no known stop left.

Correction to my last update: the run I called "still going" was killed at 15 min by a stray script of mine, not by the build. The numbers above are from the rerun. #5851 is on the same 40 min now.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6181319834 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6060#issuecomment-6181319834). Originally posted by [parl0v](https://github.com/parl0v) on 2026-10-15T00:11:53Z. --- @ivica00 @TideOPL thank you both. That's a second RX 9070 XT and a fifth title, and Minecraft Dungeons II's p50 within about 2 % of the pre-#5596 build is the closest to a clean before/after so far. @ivica00, one detail: your line says 0 pages were marked by the settle read, so on RDNA 4 every mark lands at the import and the settle read has nothing to clear. Same as SoRadGaming's. The 40-min stop is fixed by #6168. SotS with this PR plus #6168 ran the full 40 min at the title: 23,678 frames, no stop, private bytes 10.0 → 10.4 GB. This PR alone stopped with -2 at 12 and 22 min (about 31.6 GB). The bug is on `main`; this PR only exposes it because the title no longer lets the recorder go idle, so #6168 is its own PR and can land first. With it in, this PR has no known stop left. Correction to my last update: the run I called "still going" was killed at 15 min by a stray script of mine, not by the build. The numbers above are from the rerun. #5851 is on the same 40 min now.
parl0v commented 2026-10-15 00:33:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by parl0v on 2026-10-15T00:33:57Z.


@Pipodi the import count you asked for in point 4, SotS on box 2 (RTX 3060), this PR + #6168, APS5_TRACE_HOST_IMPORT=1, 300 s from boot to the title, counted per 10 s present window:

  • 3,905 imports in the first window (boot, 22 presents), 26 in the second
  • then 0–12 per window, 0.7 per 10 s over the last twelve
  • 3,967 in 300 s, 0 failed

So on SotS the settle cost is a boot cost: about 98 % of the imports (and their settle round trips) land before the title's first full window, and the title itself imports about once every 14 s. Since the review commit the settle reuses one persistent target, command buffer and fence per device, so each of those is a 4-byte copy, a submit and a wait. Yōtei's ~11k in 300 s would be the heavier case; if its import window shows up in your timings I can look at batching the settles.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6181599040 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6060#issuecomment-6181599040). Originally posted by [parl0v](https://github.com/parl0v) on 2026-10-15T00:33:57Z. --- @Pipodi the import count you asked for in point 4, SotS on box 2 (RTX 3060), this PR + #6168, `APS5_TRACE_HOST_IMPORT=1`, 300 s from boot to the title, counted per 10 s present window: - 3,905 imports in the first window (boot, 22 presents), 26 in the second - then 0–12 per window, 0.7 per 10 s over the last twelve - 3,967 in 300 s, 0 failed So on SotS the settle cost is a boot cost: about 98 % of the imports (and their settle round trips) land before the title's first full window, and the title itself imports about once every 14 s. Since the review commit the settle reuses one persistent target, command buffer and fence per device, so each of those is a 4-byte copy, a submit and a wait. Yōtei's ~11k in 300 s would be the heavier case; if its import window shows up in your timings I can look at batching the settles.
JAB-dev commented 2026-10-15 00:39:20 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JAB-dev on 2026-10-15T00:39:20Z.


Besiege (PPSA20313), main at 7003eda5d vs the same with this PR (f97762019) merged, Windows 11, RTX 4070 SUPER (610.88), 1080p: title screen 14.0 / 14.2 -> 20.5 / 21.8 FPS (+50%). The startup probe chose to keep the write watch ([write-watch] ... keep the write watch: yes).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6181668886 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6060#issuecomment-6181668886). Originally posted by [JAB-dev](https://github.com/JAB-dev) on 2026-10-15T00:39:20Z. --- Besiege (PPSA20313), `main` at `7003eda5d` vs the same with this PR (`f97762019`) merged, Windows 11, RTX 4070 SUPER (610.88), 1080p: title screen 14.0 / 14.2 -> 20.5 / 21.8 FPS (+50%). The startup probe chose to keep the write watch (`[write-watch] ... keep the write watch: yes`).
screamm commented 2026-10-15 00:53:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by screamm on 2026-10-15T00:53:52Z.


Validation on Windows 11 Pro 26220, WinLibs MinGW-w64 GCC 15.2.0 r7, NVIDIA RTX 4070 (driver 596.21), Release, BUILD_TESTING=ON, head f97762019 against its base 6239ceffc. Full build and libs build without new warnings.

  • Startup line: keep the write watch: yes (4096 of 4096 scratch pages reported written at the import, 0 by its 4-byte settle read, 0 after it, 0 after a full GPU read, 0 after a second, 0 after a GPU write, 1 after a CPU store)

  • Named tests, 3/3 each: agc_write_tracking, agc_import_watch, agc_driver_layered_volume_submit, agc_driver_layered_volume_submit_other_family, agc_driver_store_over_untracked, agc_driver_dcc_keys_first_write.

  • Non-GPU suite (ctest -j8 --timeout 120 -E '^agc_driver_|^video_out_flip'): 807 of 809 pass. conventions_function_bodies and hardware_oracle_compare time out under -j8 but pass alone (55 s and 16 s); both are tool tests this PR doesn't touch. Two tests are skipped for the environment.

  • Checks: tools/check_conventions.py --base 6239ceffc passes, git diff --check is clean.

  • ccleste (PPSA59322), 60 s runs alternated on the same relinked executable, FPS over the last 30 s:

    Build FPS per run Frames presented in 60 s
    main 6239ceffc 80.2 / 82.9 / 72.7 / 63.7 3,674 / 5,283 / 4,227 / 2,997
    this PR 119.9 / 112.5 / 108.9 / 110.1 6,620 / 6,608 / 5,922 / 4,833
    #5851 cherry-picked onto 6239ceffc 106.1 / 106.4 4,171 / 5,749

    For reference, a pre-#5596 build (c2565f014) runs 107.6.

  • [guestmem] compares per 10 s (APS5_PROFILE_DRAW=1): main 1,032 calls, 30.2 GiB, 5.7 s, AGC submit 2.8–4.2 ms per submission. This PR and #5851: 0 compares, submit 0.10–0.20 ms. Switching the singly mapped direct memory back to the old shared-section path on main locally also gives 0 compares and ~102 FPS, so the cost is the private write-watch import from #5596 (d9852df2a, 71da166a1), the same mechanism @nikowolf123 named on #5842.

  • 10-minute run: main 39,196 frames, private memory 1,541–1,548 MiB after warm-up. This PR 67,924 frames, 1,431–1,438 MiB, flat, no stop. I can't reproduce the out-of-device-memory stop from the Sword of the Sea runs on this title.

  • Control: Capy Mobile (PPSA92280) takes 0 compares on main and shows no difference I can attribute to this PR (2,094–3,033 frames per 60 s on both, noisy).

  • Not covered: no AMD GPU here, so the single-graphics-queue path (settling on another queue family) is untested; #5842's reporter is on an RX 6700 XT, so that path is the one that matters there.

Two review notes: the PR adds the env switches APS5_NO_WATCHED_PRIVATE_IMPORTS and APS5_SETTLE_OTHER_FAMILY (the second used by a test), which the maintainers have been declining for new paths; and in tests/WriteTracking.cpp the CheckImportWindowOtherThread(); call in main() is indented 4 spaces instead of 8.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6181849013 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6060#issuecomment-6181849013). Originally posted by [screamm](https://github.com/screamm) on 2026-10-15T00:53:52Z. --- Validation on Windows 11 Pro 26220, WinLibs MinGW-w64 GCC 15.2.0 r7, NVIDIA RTX 4070 (driver 596.21), Release, `BUILD_TESTING=ON`, head `f97762019` against its base `6239ceffc`. Full build and `libs` build without new warnings. - **Startup line:** `keep the write watch: yes (4096 of 4096 scratch pages reported written at the import, 0 by its 4-byte settle read, 0 after it, 0 after a full GPU read, 0 after a second, 0 after a GPU write, 1 after a CPU store)` - **Named tests, 3/3 each:** `agc_write_tracking`, `agc_import_watch`, `agc_driver_layered_volume_submit`, `agc_driver_layered_volume_submit_other_family`, `agc_driver_store_over_untracked`, `agc_driver_dcc_keys_first_write`. - **Non-GPU suite** (`ctest -j8 --timeout 120 -E '^agc_driver_|^video_out_flip'`): 807 of 809 pass. `conventions_function_bodies` and `hardware_oracle_compare` time out under `-j8` but pass alone (55 s and 16 s); both are tool tests this PR doesn't touch. Two tests are skipped for the environment. - **Checks:** `tools/check_conventions.py --base 6239ceffc` passes, `git diff --check` is clean. - **ccleste (PPSA59322), 60 s runs alternated on the same relinked executable**, FPS over the last 30 s: | Build | FPS per run | Frames presented in 60 s | |---|---|---| | `main` `6239ceffc` | 80.2 / 82.9 / 72.7 / 63.7 | 3,674 / 5,283 / 4,227 / 2,997 | | this PR | 119.9 / 112.5 / 108.9 / 110.1 | 6,620 / 6,608 / 5,922 / 4,833 | | #5851 cherry-picked onto `6239ceffc` | 106.1 / 106.4 | 4,171 / 5,749 | For reference, a pre-#5596 build (`c2565f014`) runs 107.6. - **`[guestmem]` compares per 10 s** (`APS5_PROFILE_DRAW=1`): `main` 1,032 calls, 30.2 GiB, 5.7 s, AGC submit 2.8–4.2 ms per submission. This PR and #5851: 0 compares, submit 0.10–0.20 ms. Switching the singly mapped direct memory back to the old shared-section path on `main` locally also gives 0 compares and ~102 FPS, so the cost is the private write-watch import from #5596 (`d9852df2a`, `71da166a1`), the same mechanism @nikowolf123 named on #5842. - **10-minute run:** `main` 39,196 frames, private memory 1,541–1,548 MiB after warm-up. This PR 67,924 frames, 1,431–1,438 MiB, flat, no stop. I can't reproduce the out-of-device-memory stop from the Sword of the Sea runs on this title. - **Control:** Capy Mobile (PPSA92280) takes 0 compares on `main` and shows no difference I can attribute to this PR (2,094–3,033 frames per 60 s on both, noisy). - **Not covered:** no AMD GPU here, so the single-graphics-queue path (settling on another queue family) is untested; #5842's reporter is on an RX 6700 XT, so that path is the one that matters there. Two review notes: the PR adds the env switches `APS5_NO_WATCHED_PRIVATE_IMPORTS` and `APS5_SETTLE_OTHER_FAMILY` (the second used by a test), which the maintainers have been declining for new paths; and in `tests/WriteTracking.cpp` the `CheckImportWindowOtherThread();` call in `main()` is indented 4 spaces instead of 8. AI-assisted: yes (Claude Code)
parl0v commented 2026-10-15 01:12:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by parl0v on 2026-10-15T01:12:36Z.


@screamm thank you, that's the most complete run this PR has had, and ccleste at 113 FPS against 107.6 on a pre-#5596 build is a useful number for anyone asking whether this costs anything. Both review notes are in 6c6a6c85a:

  • Env switches removed. The second queue is always created on Windows, and a device without one keeps the comparisons. The other-family settle (the single-graphics-queue AMD path) is now covered by agc_import_watch_other_family, which builds the recorder test device with its settle queue on another family, instead of APS5_SETTLE_OTHER_FAMILY. On the RTX 4060 its probe line reads 4096 ... at the import, 4096 by its 4-byte settle read, 0 after it, so the settle does go through the other family. 3/3 for the six named tests, ctest -R '^agc_' 563/564 (only agc_shader_disk_cache), conventions check and git diff --check clean.
  • Indent in tests/WriteTracking.cpp fixed.

@JAB-dev thanks, Besiege at +50 % on an RTX 4070 SUPER makes six titles.

Longer run with #6168 at its reviewed head (0e15b9be9): SotS title, 40 min, 23,605 frames, 9.96 FPS over the last twelve windows, no stop, private bytes 10.01 → 10.34 GB (+18 MB over the last 15 min).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6182078982 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6060#issuecomment-6182078982). Originally posted by [parl0v](https://github.com/parl0v) on 2026-10-15T01:12:36Z. --- @screamm thank you, that's the most complete run this PR has had, and ccleste at 113 FPS against 107.6 on a pre-#5596 build is a useful number for anyone asking whether this costs anything. Both review notes are in 6c6a6c85a: - **Env switches removed.** The second queue is always created on Windows, and a device without one keeps the comparisons. The other-family settle (the single-graphics-queue AMD path) is now covered by `agc_import_watch_other_family`, which builds the recorder test device with its settle queue on another family, instead of `APS5_SETTLE_OTHER_FAMILY`. On the RTX 4060 its probe line reads `4096 ... at the import, 4096 by its 4-byte settle read, 0 after it`, so the settle does go through the other family. 3/3 for the six named tests, `ctest -R '^agc_'` 563/564 (only `agc_shader_disk_cache`), conventions check and `git diff --check` clean. - **Indent** in `tests/WriteTracking.cpp` fixed. @JAB-dev thanks, Besiege at +50 % on an RTX 4070 SUPER makes six titles. Longer run with #6168 at its reviewed head (0e15b9be9): SotS title, 40 min, 23,605 frames, 9.96 FPS over the last twelve windows, no stop, private bytes 10.01 → 10.34 GB (+18 MB over the last 15 min).
fma-rc commented 2026-10-15 03:52:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fma-rc on 2026-10-15T03:52:00Z.

Review: CHANGES_REQUESTED


The new probe submits a one-time-submit command buffer twice. In runImportProbe (GuestBufferMemory.cpp line 2362) both command buffers are begun with VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT, and commands[0] is then submitted twice (lines 2383 and 2385).

Current main a077a88df with head 6c6a6c85a merged, agc_driver_recorder_tests --import-watch-only under VK_LAYER_KHRONOS_validation, on an RTX 5080 (NVIDIA 615.78.08) and the Ryzen 7800X3D's integrated Radeon (RADV):

vkQueueSubmit(): pSubmits[0].pCommandBuffers[0] VkCommandBuffer ... recorded with VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT has been submitted 2 times.

The recorder suite on main under the same layer reports no such submit. The test still passes, because both drivers run the buffer again anyway. Beginning commands[0] without the flag would fix it.

The PR's 18 import and write-tracking tests pass on NVIDIA, RADV and lavapipe on this machine, and on a Radeon 680M with RADV and llvmpipe; agc_import_watch_other_family skips (rc 77) on all of them.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5527816082 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6060#pullrequestreview-5527816082). Originally posted by [fma-rc](https://github.com/fma-rc) on 2026-10-15T03:52:00Z. **Review:** CHANGES_REQUESTED --- The new probe submits a one-time-submit command buffer twice. In `runImportProbe` (`GuestBufferMemory.cpp` line 2362) both command buffers are begun with `VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT`, and `commands[0]` is then submitted twice (lines 2383 and 2385). Current main a077a88df with head 6c6a6c85a merged, `agc_driver_recorder_tests --import-watch-only` under `VK_LAYER_KHRONOS_validation`, on an RTX 5080 (NVIDIA 615.78.08) and the Ryzen 7800X3D's integrated Radeon (RADV): `vkQueueSubmit(): pSubmits[0].pCommandBuffers[0] VkCommandBuffer ... recorded with VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT has been submitted 2 times.` The recorder suite on main under the same layer reports no such submit. The test still passes, because both drivers run the buffer again anyway. Beginning `commands[0]` without the flag would fix it. The PR's 18 import and write-tracking tests pass on NVIDIA, RADV and lavapipe on this machine, and on a Radeon 680M with RADV and llvmpipe; `agc_import_watch_other_family` skips (rc 77) on all of them.
frankea commented 2026-10-15 04:04:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by frankea on 2026-10-15T04:04:00Z.


Rerun on the new head on this box. 6c6a6c85a merged onto main a077a88df (clean); Windows 11 10.0.26200, Ryzen 7 5800X, RTX 4090 (NVIDIA 616.92), MinGW-w64 GCC 15.2.0 r7, Release, default environment.

  • Full ctest: 1252 of 1254, 14 environment skips. The two failures are main's, not this PR's: agc_driver_image_plane_address_on_line fails the same way with #6168 merged onto the same main and on main at e52e140f5 (reported on #5583), and guest_kqueue aborts in #5493's new DeniedParentWatch case because this session runs elevated (reported there). Both passed on main fa539dd9b.

  • Probe through the real device, the full new sequence:

    keep the write watch: yes (4096 of 4096 scratch pages reported written at the import, 0 by its 4-byte settle read, 0 after it, 0 after a full GPU read, 0 after a second, 0 after a GPU write, 1 after a CPU store); direct host imports of private memory are settled and stay watched
    

    So on 616.92 every mark lands at the import and the settle read has nothing left to clear, as on the RX 9070 XT reports; your 617.42 boxes see the 4096 by the settle read instead. The decision is the same.

  • agc_import_watch, agc_import_watch_other_family (same probe line, through the other family), agc_driver_layered_volume_submit, agc_write_tracking, agc_driver_store_over_untracked, agc_driver_dcc_keys_first_write: 3 of 3 each. agc_driver_layered_volume_submit_other_family is not registered in this build.

  • ctest -R ^agc_: 570 of 571, the one failure being the main sampling test above.

No title here. Tested with AI assistance (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6184129189 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6060#issuecomment-6184129189). Originally posted by [frankea](https://github.com/frankea) on 2026-10-15T04:04:00Z. --- Rerun on the new head on this box. `6c6a6c85a` merged onto `main` `a077a88df` (clean); Windows 11 10.0.26200, Ryzen 7 5800X, RTX 4090 (NVIDIA 616.92), MinGW-w64 GCC 15.2.0 r7, Release, default environment. - Full ctest: 1252 of 1254, 14 environment skips. The two failures are `main`'s, not this PR's: `agc_driver_image_plane_address_on_line` fails the same way with #6168 merged onto the same `main` and on `main` at `e52e140f5` (reported on #5583), and `guest_kqueue` aborts in #5493's new `DeniedParentWatch` case because this session runs elevated (reported there). Both passed on `main` `fa539dd9b`. - Probe through the real device, the full new sequence: ``` keep the write watch: yes (4096 of 4096 scratch pages reported written at the import, 0 by its 4-byte settle read, 0 after it, 0 after a full GPU read, 0 after a second, 0 after a GPU write, 1 after a CPU store); direct host imports of private memory are settled and stay watched ``` So on 616.92 every mark lands at the import and the settle read has nothing left to clear, as on the RX 9070 XT reports; your 617.42 boxes see the 4096 by the settle read instead. The decision is the same. - `agc_import_watch`, `agc_import_watch_other_family` (same probe line, through the other family), `agc_driver_layered_volume_submit`, `agc_write_tracking`, `agc_driver_store_over_untracked`, `agc_driver_dcc_keys_first_write`: 3 of 3 each. `agc_driver_layered_volume_submit_other_family` is not registered in this build. - `ctest -R ^agc_`: 570 of 571, the one failure being the `main` sampling test above. No title here. Tested with AI assistance (Claude Code).
Dripl1x commented 2026-10-15 04:43:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Dripl1x on 2026-10-15T04:43:40Z.


SuperTuxKart (PPSA69421) on NVIDIA: this PR takes it from about 4.5 to 7.5 FPS. A second finding is about the settle: in this title it runs about 320 times a second, and its wait costs a further ~19 %.

Windows 11 Pro 26300, Ryzen 7 5800H, RTX 3070 Laptop (NVIDIA 617.42), WinLibs GCC 15.2.0 r7, Release. main a077a88df, alone and with this PR's head 6c6a6c85a merged. Same relinked executable, the tutorial prompt on the title screen, 60–75 s runs, the title's own 5 s FPS lines. The startup line reads keep the write watch: yes (4096 of 4096 scratch pages reported written at the import, 0 by its 4-byte settle read, 0 after it, ...).

This PR against main (APS5_PROFILE_DRAW=1, per 10 s):

main + this PR
FPS 4.5 / 4.3 / 4.5 / 4.3 7.5 / 7.4 / 7.5 / 7.5
recorded draw, avg 1,939 us 348 us
readTarget 4,337 ms 396 ms
[guestmem] compare 21,772 calls, 149,036 MiB, 12.5 s 0
GPU busy per frame 5.4 ms 5.4 ms

Runs without the profiler agree: 4.4–4.6 FPS on main (2 runs), 7.1–7.6 with this PR (4 runs).

The settle is not only a boot cost here. The title's Mesa winsys allocates, maps, unmaps and releases a 64 KiB buffer object around every submission, at the same address each time (APS5_TRACE_MEMORY: allocate physical, map direct 0x255200000+0x10000, unmap, release physical, repeated). With APS5_TRACE_HOST_IMPORT=1 that is 1,584–1,632 imports per 5 s window, all +0x10000. That is about 48 per frame, against the 0.7 per 10 s you counted on SotS after boot.

Each import waits for its settle on the game's thread. A timeline of that thread, sampled every 100 µs for 3 s (30,000 samples, stacks walked by return address), puts 9.9 % of its time in ZwWaitForMultipleObjects under ImportWatched, which is ~0.3 ms per import. The submission loop is: submit, wait for the label, unmap, map, import + settle, write commands, submit.

To check that the wait is the cost, I settled only imports of 1 MiB or more and left smaller ones on comparisons, as main does. This was a local test patch in importRunAt:

-    const bool settled = entry.alias == nullptr && state.watchPrivateImports && writable;
+    const bool settled = entry.alias == nullptr && state.watchPrivateImports && writable && bytes >= 0x100000;

Alternating runs, last six 5 s windows each, APS5_PROFILE_DRAW=1:

run this PR + settle only >= 1 MiB
1 7.4 6.4 7.4 7.5 7.4 7.5 8.8 8.8 8.8 8.8 8.8 8.8
2 7.3 7.3 7.3 6.9 7.3 7.3 8.7 8.8 8.8 8.5 8.7 8.7
[guestmem] compare per 10 s 0 21.8k / 20.6k calls, ~5 GB, 0.5 s
recorded draw, avg 338 / 362 us 382 / 410 us

So the comparisons come back, about 0.5 s per 10 s on the queue worker, but the game's thread stops waiting, and the net is +19 %. The 17 MB target is still settled, so readTarget stays low (407–412 ms per 10 s without the floor, 440–467 ms with it).

A size floor is only one way to get this. The underlying issue is that the settle blocks the mapping thread. Not waiting would also cover large imports that come and go: submit the 4-byte read without the wait, keep the new import on comparisons until its fence has signalled, then drop the marks and switch it to the write watch. I have not measured either variant on SotS.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6184597926 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6060#issuecomment-6184597926). Originally posted by [Dripl1x](https://github.com/Dripl1x) on 2026-10-15T04:43:40Z. --- SuperTuxKart (PPSA69421) on NVIDIA: this PR takes it from about 4.5 to 7.5 FPS. A second finding is about the settle: in this title it runs about 320 times a second, and its wait costs a further ~19 %. Windows 11 Pro 26300, Ryzen 7 5800H, RTX 3070 Laptop (NVIDIA 617.42), WinLibs GCC 15.2.0 r7, Release. `main` `a077a88df`, alone and with this PR's head `6c6a6c85a` merged. Same relinked executable, the tutorial prompt on the title screen, 60–75 s runs, the title's own 5 s FPS lines. The startup line reads `keep the write watch: yes (4096 of 4096 scratch pages reported written at the import, 0 by its 4-byte settle read, 0 after it, ...)`. **This PR against `main`** (`APS5_PROFILE_DRAW=1`, per 10 s): | | `main` | + this PR | |---|---|---| | FPS | 4.5 / 4.3 / 4.5 / 4.3 | **7.5 / 7.4 / 7.5 / 7.5** | | recorded draw, avg | 1,939 us | 348 us | | `readTarget` | 4,337 ms | 396 ms | | `[guestmem]` compare | 21,772 calls, 149,036 MiB, 12.5 s | 0 | | GPU busy per frame | 5.4 ms | 5.4 ms | Runs without the profiler agree: 4.4–4.6 FPS on `main` (2 runs), 7.1–7.6 with this PR (4 runs). **The settle is not only a boot cost here.** The title's Mesa winsys allocates, maps, unmaps and releases a 64 KiB buffer object around every submission, at the same address each time (`APS5_TRACE_MEMORY`: `allocate physical`, `map direct 0x255200000+0x10000`, `unmap`, `release physical`, repeated). With `APS5_TRACE_HOST_IMPORT=1` that is 1,584–1,632 imports per 5 s window, all `+0x10000`. That is about 48 per frame, against the 0.7 per 10 s you counted on SotS after boot. Each import waits for its settle on the game's thread. A timeline of that thread, sampled every 100 µs for 3 s (30,000 samples, stacks walked by return address), puts 9.9 % of its time in `ZwWaitForMultipleObjects` under `ImportWatched`, which is ~0.3 ms per import. The submission loop is: submit, wait for the label, unmap, map, import + settle, write commands, submit. To check that the wait is the cost, I settled only imports of 1 MiB or more and left smaller ones on comparisons, as `main` does. This was a local test patch in `importRunAt`: ```diff - const bool settled = entry.alias == nullptr && state.watchPrivateImports && writable; + const bool settled = entry.alias == nullptr && state.watchPrivateImports && writable && bytes >= 0x100000; ``` Alternating runs, last six 5 s windows each, `APS5_PROFILE_DRAW=1`: | run | this PR | + settle only >= 1 MiB | |---|---|---| | 1 | 7.4 6.4 7.4 7.5 7.4 7.5 | **8.8 8.8 8.8 8.8 8.8 8.8** | | 2 | 7.3 7.3 7.3 6.9 7.3 7.3 | **8.7 8.8 8.8 8.5 8.7 8.7** | | `[guestmem]` compare per 10 s | 0 | 21.8k / 20.6k calls, ~5 GB, 0.5 s | | recorded draw, avg | 338 / 362 us | 382 / 410 us | So the comparisons come back, about 0.5 s per 10 s on the queue worker, but the game's thread stops waiting, and the net is +19 %. The 17 MB target is still settled, so `readTarget` stays low (407–412 ms per 10 s without the floor, 440–467 ms with it). A size floor is only one way to get this. The underlying issue is that the settle blocks the mapping thread. Not waiting would also cover large imports that come and go: submit the 4-byte read without the wait, keep the new import on comparisons until its fence has signalled, then drop the marks and switch it to the write watch. I have not measured either variant on SotS. AI-assisted: yes (Claude Code)
LeandroLP23 commented 2026-10-15 07:38:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-15T07:38:17Z.


Rerun on AMD with the new head, as promised: with 6c6a6c85a the single-graphics-queue Radeon no longer falls back to comparisons, and SuperTuxKart goes from about 5.2 to 7.3 FPS.

Windows 11 (26300), Radeon 860M (RDNA 3.5, 1002:1114, driver 32.0.13058.8001; every queue family has one queue), WinLibs GCC 15.2.0, Release. main d92a8dad3, alone and with 6c6a6c85a merged (clean, f63402151). SuperTuxKart (PPSA69421) catalog release relinked with --trap-sdk-syscall-stubs, warm run folder, title screen, 60 s per run, FPS from the window title. Order: main, this PR, main again; the third run of each set has APS5_PROFILE_DRAW=1.

main (first set) this PR main (second set)
FPS 6.07, 5.07 7.41, 7.02 5.01, 5.36
FPS, profiled run 4.47 7.53 5.20
[guestmem] compare in the last window 6,210 calls, 52,431 MiB, 2.1 s 0 5,325 calls, 45,428 MiB, 1.9 s
readTarget 2,780 ms (3,463 lookups) 279 ms (4,076 lookups) 2,982 ms (2,990 lookups)
GPU busy per frame 6.6 ms 5.8 ms 6.1 ms
  • Probe line on this device: keep the write watch: yes (4096 of 4096 scratch pages reported written at the import, 0 by its 4-byte settle read, 0 after it, 0 after a full GPU read, 0 after a second, 0 after a GPU write, 1 after a CPU store); direct host imports of private memory are settled and stay watched. So on this AMD driver, as on the RTX 4090 and the RX 9070 XT reports, every mark lands at the import.
  • Fallback gone: the direct host imports use comparisons line that main prints (2 per run) doesn't appear with this PR.
  • No stops: 6 of 6 runs with this PR stayed up for the full 60 s and closed with exit 0.

On the previous head this GPU kept the comparisons ("no second queue to settle imports on") and stayed at main's rate. This device has one queue per family, so the settle queue here can only come from another family: the path agc_import_watch_other_family covers.

Not tested: the full CTest suite on this head, runs longer than 60 s, other titles.

AI-assisted: yes (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6187032470 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6060#issuecomment-6187032470). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-10-15T07:38:17Z. --- Rerun on AMD with the new head, as promised: with `6c6a6c85a` the single-graphics-queue Radeon no longer falls back to comparisons, and SuperTuxKart goes from about 5.2 to 7.3 FPS. Windows 11 (26300), Radeon 860M (RDNA 3.5, `1002:1114`, driver 32.0.13058.8001; every queue family has one queue), WinLibs GCC 15.2.0, Release. `main` `d92a8dad3`, alone and with `6c6a6c85a` merged (clean, `f63402151`). SuperTuxKart (PPSA69421) catalog release relinked with `--trap-sdk-syscall-stubs`, warm run folder, title screen, 60 s per run, FPS from the window title. Order: `main`, this PR, `main` again; the third run of each set has `APS5_PROFILE_DRAW=1`. | | `main` (first set) | this PR | `main` (second set) | |---|---|---|---| | FPS | 6.07, 5.07 | **7.41, 7.02** | 5.01, 5.36 | | FPS, profiled run | 4.47 | **7.53** | 5.20 | | `[guestmem]` compare in the last window | 6,210 calls, 52,431 MiB, 2.1 s | 0 | 5,325 calls, 45,428 MiB, 1.9 s | | `readTarget` | 2,780 ms (3,463 lookups) | 279 ms (4,076 lookups) | 2,982 ms (2,990 lookups) | | GPU busy per frame | 6.6 ms | 5.8 ms | 6.1 ms | - **Probe line on this device:** `keep the write watch: yes (4096 of 4096 scratch pages reported written at the import, 0 by its 4-byte settle read, 0 after it, 0 after a full GPU read, 0 after a second, 0 after a GPU write, 1 after a CPU store); direct host imports of private memory are settled and stay watched`. So on this AMD driver, as on the RTX 4090 and the RX 9070 XT reports, every mark lands at the import. - **Fallback gone:** the `direct host imports use comparisons` line that `main` prints (2 per run) doesn't appear with this PR. - **No stops:** 6 of 6 runs with this PR stayed up for the full 60 s and closed with exit 0. On the previous head this GPU kept the comparisons ("no second queue to settle imports on") and stayed at `main`'s rate. This device has one queue per family, so the settle queue here can only come from another family: the path `agc_import_watch_other_family` covers. Not tested: the full CTest suite on this head, runs longer than 60 s, other titles. AI-assisted: yes (Claude Code).
adriadam10 commented 2026-10-15 07:49:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-15T07:49:34Z.

Review: APPROVED


Re-checked the new head 6c6a6c85a merged onto current main: agc_import_watch and agc_write_tracking pass, and the only failing test in libSceAgcDriver is agc_driver_tessellation, which segfaults on main too. Windows/NVIDIA/AMD behaviour rests on the runs reported in this thread; the full Windows Build runs before merge.

Added one commit on your branch, for @fma-rc's finding: runImportProbe begins commands[0] with VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT and submits it twice, so the flag is now only set on commands[1].

Merging once the Windows Build is green. The 40-minute stop you described is #6168's, not this diff's.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5529817027 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6060#pullrequestreview-5529817027). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-15T07:49:34Z. **Review:** APPROVED --- Re-checked the new head `6c6a6c85a` merged onto current `main`: `agc_import_watch` and `agc_write_tracking` pass, and the only failing test in libSceAgcDriver is `agc_driver_tessellation`, which segfaults on `main` too. Windows/NVIDIA/AMD behaviour rests on the runs reported in this thread; the full Windows Build runs before merge. Added one commit on your branch, for @fma-rc's finding: `runImportProbe` begins `commands[0]` with `VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT` and submits it twice, so the flag is now only set on `commands[1]`. Merging once the Windows Build is green. The 40-minute stop you described is #6168's, not this diff's.
adriadam10 commented 2026-10-15 07:59:01 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-15T07:59:01Z.


Added a second commit (fix(agc): settle only imports of 1 MiB or more) for @Dripl1x's measurement on SuperTuxKart: importRunAt now settles only imports of 1 MiB or more (settleFloorBytes); smaller ones stay on comparisons, as on main. This is the same change as the test patch above (7.4 → 8.8 FPS, the settle blocked the mapping thread on ~320 imports of 64 KiB a second); the 17 MB target on SotS is still settled. docs/dev/ARCHITECTURE.md and the debt entry say so, and the debt entry records the non-blocking settle (submit the read, compare until its fence signals, then switch to the write watch) as not implemented. The code is Windows-only, so the full Build's windows job is its check here; a rerun on SotS/STK with this head is welcome.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6187370436 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6060#issuecomment-6187370436). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-15T07:59:01Z. --- Added a second commit (`fix(agc): settle only imports of 1 MiB or more`) for @Dripl1x's measurement on SuperTuxKart: `importRunAt` now settles only imports of 1 MiB or more (`settleFloorBytes`); smaller ones stay on comparisons, as on `main`. This is the same change as the test patch above (7.4 → 8.8 FPS, the settle blocked the mapping thread on ~320 imports of 64 KiB a second); the 17 MB target on SotS is still settled. `docs/dev/ARCHITECTURE.md` and the debt entry say so, and the debt entry records the non-blocking settle (submit the read, compare until its fence signals, then switch to the write watch) as not implemented. The code is Windows-only, so the full Build's `windows` job is its check here; a rerun on SotS/STK with this head is welcome.
EagleBearerYS commented 2026-10-15 08:00:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-15T08:00:47Z.


Two small notes before this merges. Both were seen with 6c6a6c85a, and both lines are unchanged at 23fccd7632.

  1. On a Linux machine without /dev/udmabuf (Ubuntu 24.04, lavapipe), agc_import_watch fails:
import probe: 0 of 4 scratch pages written after a GPU read, 4 after a GPU write, 0 after the import
AGC graphics: (u) the dma-buf import probe failed at open /dev/udmabuf (-1000072003)

The check at tests/Recorder.cpp:3818 requires the probe to succeed whenever the device offers dma-buf import. The driver itself handles the missing device: [write-watch] dma-buf imports keep write protection: unknown (probe failed at open /dev/udmabuf, -1000072003); imported ranges are compared. Skipping that check when /dev/udmabuf can't be opened, as agc_host_import_sparse does, made it pass 5 of 5 there. That code ran in no ctest before this PR registered it as agc_import_watch.

  1. docs/dev/debt/libSceAgcDriver.md:61 still opens "Windows host-pointer imports of the guest mapping itself are compared instead of write-watched". With this PR, writable private imports of 1 MiB or more stay watched when the probe passes and a settle queue exists, so that entry could narrow to the imports that are still compared.
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6187398374 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6060#issuecomment-6187398374). Originally posted by [EagleBearerYS](https://github.com/EagleBearerYS) on 2026-10-15T08:00:47Z. --- Two small notes before this merges. Both were seen with 6c6a6c85a, and both lines are unchanged at 23fccd7632. 1. On a Linux machine without `/dev/udmabuf` (Ubuntu 24.04, lavapipe), `agc_import_watch` fails: ``` import probe: 0 of 4 scratch pages written after a GPU read, 4 after a GPU write, 0 after the import AGC graphics: (u) the dma-buf import probe failed at open /dev/udmabuf (-1000072003) ``` The check at `tests/Recorder.cpp:3818` requires the probe to succeed whenever the device offers dma-buf import. The driver itself handles the missing device: `[write-watch] dma-buf imports keep write protection: unknown (probe failed at open /dev/udmabuf, -1000072003); imported ranges are compared`. Skipping that check when `/dev/udmabuf` can't be opened, as `agc_host_import_sparse` does, made it pass 5 of 5 there. That code ran in no ctest before this PR registered it as `agc_import_watch`. 2. `docs/dev/debt/libSceAgcDriver.md:61` still opens "Windows host-pointer imports of the guest mapping itself are compared instead of write-watched". With this PR, writable private imports of 1 MiB or more stay watched when the probe passes and a settle queue exists, so that entry could narrow to the imports that are still compared.
adriadam10 commented 2026-10-15 08:05:20 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-15T08:05:20Z.


@EagleBearerYS thanks, both done in test(agc): skip the dma-buf import probe when /dev/udmabuf can't be opened:

  1. importWatchTests now opens /dev/udmabuf first, as agc_host_import_sparse does, and skips the dma-buf probe (printing why) when it can't. Checked on RADV both ways: with the device the probe runs (0 of 4 ... 1 after a CPU store); with /dev/udmabuf hidden in a mount namespace the driver logs the same probe failed at open /dev/udmabuf, -1000072003 you saw and agc_import_watch passes with /dev/udmabuf is not accessible: the dma-buf import probe not tested.
  2. The debt entry at docs/dev/debt/libSceAgcDriver.md:61 now names the exception: writable imports of private MEM_WRITE_WATCH memory of 1 MiB or more stay watched when the probe keeps the write watch and a settle queue exists.
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6187472232 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6060#issuecomment-6187472232). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-15T08:05:20Z. --- @EagleBearerYS thanks, both done in `test(agc): skip the dma-buf import probe when /dev/udmabuf can't be opened`: 1. `importWatchTests` now opens `/dev/udmabuf` first, as `agc_host_import_sparse` does, and skips the dma-buf probe (printing why) when it can't. Checked on RADV both ways: with the device the probe runs (`0 of 4 ... 1 after a CPU store`); with `/dev/udmabuf` hidden in a mount namespace the driver logs the same `probe failed at open /dev/udmabuf, -1000072003` you saw and `agc_import_watch` passes with `/dev/udmabuf is not accessible: the dma-buf import probe not tested`. 2. The debt entry at `docs/dev/debt/libSceAgcDriver.md:61` now names the exception: writable imports of private `MEM_WRITE_WATCH` memory of 1 MiB or more stay watched when the probe keeps the write watch and a settle queue exists.
LeandroLP23 commented 2026-10-15 08:30:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-15T08:30:00Z.


SuperTuxKart on AMD with the new head, as @adriadam10 asked. The 1 MiB floor adds a little here: 7.2 FPS against 7.0 at the previous head, and both stay well above main's 5.1.

Same machine and setup as my earlier run: Radeon 860M, driver 32.0.13058.8001, Windows 11 26300, where the settle goes through another queue family. main db81992c5, alone and with each head merged. Warm run folder, title screen, 60 s per run, FPS from the window title. Order: main, previous head (5b91ba2bb, before the floor), current head (290be5626), main again. The third run of each set has APS5_PROFILE_DRAW=1.

main previous head 5b91ba2bb head 290be5626 main again
FPS 5.20, 6.07 6.67, 7.28 6.99, 7.46 4.89, 5.34
FPS, profiled run 3.91 6.71 7.56 4.20
[guestmem] compare, last 10 s window 5,095 calls, 42,649 MiB, 1.9 s 0 3,105 calls, 742 MiB, 0.0 s 5,488 calls, 46,334 MiB, 1.9 s
readTarget (profiled run) 2,936 ms 334 ms 353 ms 2,969 ms
GPU busy per frame 8.8 ms 5.8 ms 5.9 ms 6.1 ms
  • What the floor changes: the small imports are back on comparisons, about 3,100 compares per 10 s. They are small (0.24 MiB each on average) and cost under 0.1 s per window, against main's 1.9 s over 42–46 GiB.
  • Gain is smaller than on NVIDIA: about +5 % from the floor here, against the 7.4 → 8.8 on @Dripl1x's RTX 3070 Laptop. That fits a settle that blocks for less time on this device, though I didn't time the settle itself.
  • No stops: all 12 runs reached 60 s. Three exits show killed, two on main and one on this head: my script killed a window that didn't close within its timeout. It isn't a crash.

AI-assisted: yes (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6187881678 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6060#issuecomment-6187881678). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-10-15T08:30:00Z. --- SuperTuxKart on AMD with the new head, as @adriadam10 asked. The 1 MiB floor adds a little here: 7.2 FPS against 7.0 at the previous head, and both stay well above `main`'s 5.1. Same machine and setup as [my earlier run](https://github.com/boykopovar/AnyPS5/pull/6060#issuecomment-6187032470): Radeon 860M, driver 32.0.13058.8001, Windows 11 26300, where the settle goes through another queue family. `main` `db81992c5`, alone and with each head merged. Warm run folder, title screen, 60 s per run, FPS from the window title. Order: `main`, previous head (`5b91ba2bb`, before the floor), current head (`290be5626`), `main` again. The third run of each set has `APS5_PROFILE_DRAW=1`. | | `main` | previous head `5b91ba2bb` | head `290be5626` | `main` again | |---|---|---|---|---| | FPS | 5.20, 6.07 | 6.67, 7.28 | **6.99, 7.46** | 4.89, 5.34 | | FPS, profiled run | 3.91 | 6.71 | **7.56** | 4.20 | | `[guestmem]` compare, last 10 s window | 5,095 calls, 42,649 MiB, 1.9 s | 0 | 3,105 calls, 742 MiB, 0.0 s | 5,488 calls, 46,334 MiB, 1.9 s | | `readTarget` (profiled run) | 2,936 ms | 334 ms | 353 ms | 2,969 ms | | GPU busy per frame | 8.8 ms | 5.8 ms | 5.9 ms | 6.1 ms | - **What the floor changes:** the small imports are back on comparisons, about 3,100 compares per 10 s. They are small (0.24 MiB each on average) and cost under 0.1 s per window, against `main`'s 1.9 s over 42–46 GiB. - **Gain is smaller than on NVIDIA:** about +5 % from the floor here, against the 7.4 → 8.8 on @Dripl1x's RTX 3070 Laptop. That fits a settle that blocks for less time on this device, though I didn't time the settle itself. - **No stops:** all 12 runs reached 60 s. Three exits show `killed`, two on `main` and one on this head: my script killed a window that didn't close within its timeout. It isn't a crash. AI-assisted: yes (Claude Code).
screamm commented 2026-10-15 09:12:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by screamm on 2026-10-15T09:12:36Z.


Rerun of the merged head 290be5626 (the 1 MiB settle floor and the /dev/udmabuf skip) on the same Windows/NVIDIA box as my earlier run: Windows 11 Pro 26220, Ryzen 7 5700X, RTX 4070 (driver 596.21), WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release, BUILD_TESTING=ON. The head was merged onto main db81992c5 (clean). The main side is d92a8dad3, this PR's base.

  • Build: all targets and libs built without new warnings, except agc_driver_draw_program_trace_tests, which fails to link on db81992c5 (undefined reference to __gxx_personality_v0). That's #5238's new test; main's own Windows job failed the same way, and 87ee02882 fixes it.

  • Startup line, unchanged from 6c6a6c85a and the same through agc_import_watch_other_family: keep the write watch: yes (4096 of 4096 scratch pages reported written at the import, 0 by its 4-byte settle read, 0 after it, 0 after a full GPU read, 0 after a second, 0 after a GPU write, 1 after a CPU store); direct host imports of private memory are settled and stay watched. No other line in the title logs mentions the settle, and no import fell back to copies.

  • Tests:

    • agc_import_watch, agc_import_watch_other_family, agc_write_tracking, agc_driver_layered_volume_submit, agc_driver_store_over_untracked and agc_driver_dcc_keys_first_write: 3 of 3 each.
    • ctest -R ^agc_ -j6, three passes: 569 of 573 pass each time. The rest are 3 environment skips (agc_host_import_sparse, agc_driver_sparse_dma_buf_import, agc_driver_stencil_ref_export) and the unbuilt trace test above.
    • tools/check_conventions.py --base origin/main passes, and git diff --check is clean.
    • The debt entry names the 1 MiB exception.
  • ccleste (PPSA59322), method:

    • relinked with --trap-sdk-syscall-stubs, one executable for both sides, warm run folders;
    • 70 s runs alternating main and this PR;
    • FPS over the last 30 s from the window title;
    • APS5_PROFILE_DRAW=1 on the third run of each set, with figures per 10 s.
    main d92a8dad3 + this PR 290be5626
    FPS 99.8 / 89.8 117.2 / 119.7
    FPS, profiled run 95.3 118.8
    Frames by 60 s 5,713 / 5,400 / 5,680 6,922 / 7,056 / 6,827
    recorded draw, avg 787–1,047 us 276–331 us
    readTarget 1,338–1,516 ms 161–230 ms
    [guestmem] compare 1,441–1,768 calls, 45–55 GiB, 5.7–7.0 s 15 calls, 5 MiB in the first window, then 0
    GPU busy per frame 1.8–3.7 ms 1.6–3.2 ms

    The PR side presents 1,192–1,197 frames per 10 s, which is the title's 119.88 Hz output mode. So ccleste is at its cap on this side and can't show the floor's effect on frame rate. main runs faster than in my earlier run (73–83 FPS), while this PR stays at the cap.

  • Imports (APS5_TRACE_HOST_IMPORT=1, one run per side): 34 per run on both sides, all made before the first present window.

    • 27 are under 1 MiB (16–768 KiB) and stay on comparisons with the floor.
    • 7 are 1 MiB or more (16–160 MiB).
    • Compares stay at 0 after the first window, so on this title the floor costs nothing. ccleste has no per-submission import like SuperTuxKart's 64 KiB one.
  • 10-minute run with this PR: 72,238 frames in 610 s, no stop. Working set 657.7 / 659.1 / 663.3 MiB and private bytes 1,115 / 1,116 / 1,120 MiB at 1 / 5 / 10 min.

  • Not covered: SuperTuxKart isn't on this machine, so no STK figures from here. @Dripl1x's and @LeandroLP23's runs cover it.

One note on the floor's test coverage:

  • agc_driver_layered_volume_submit was named above as the test that exercises the settled decision through the real VulkanDevice. It imports only 256 KiB and 64 KiB ranges (0x40000 three times, 0x10000 once), so since 23fccd763 its imports take the comparison path.
  • With APS5_TRACE_HOST_IMPORT=1 across ^agc_, 18 tests import a range of 1 MiB or more, e.g. agc_driver_host_import_windows, agc_host_import_retire and agc_storage_cpu_snapshot. The trace line doesn't say whether an import was settled, though, so I can't tell which of them reach settleImport through importRunAt.
  • A test that imports a writable private range just under and just over settleFloorBytes, and checks which one stays watched, would pin the floor.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6188624855 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6060#issuecomment-6188624855). Originally posted by [screamm](https://github.com/screamm) on 2026-10-15T09:12:36Z. --- Rerun of the merged head `290be5626` (the 1 MiB settle floor and the `/dev/udmabuf` skip) on the same Windows/NVIDIA box as my earlier run: Windows 11 Pro 26220, Ryzen 7 5700X, RTX 4070 (driver 596.21), WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release, `BUILD_TESTING=ON`. The head was merged onto `main` `db81992c5` (clean). The `main` side is `d92a8dad3`, this PR's base. - **Build:** all targets and `libs` built without new warnings, except `agc_driver_draw_program_trace_tests`, which fails to link on `db81992c5` (`undefined reference to __gxx_personality_v0`). That's #5238's new test; `main`'s own Windows job failed the same way, and `87ee02882` fixes it. - **Startup line**, unchanged from `6c6a6c85a` and the same through `agc_import_watch_other_family`: `keep the write watch: yes (4096 of 4096 scratch pages reported written at the import, 0 by its 4-byte settle read, 0 after it, 0 after a full GPU read, 0 after a second, 0 after a GPU write, 1 after a CPU store); direct host imports of private memory are settled and stay watched`. No other line in the title logs mentions the settle, and no import fell back to copies. - **Tests:** - `agc_import_watch`, `agc_import_watch_other_family`, `agc_write_tracking`, `agc_driver_layered_volume_submit`, `agc_driver_store_over_untracked` and `agc_driver_dcc_keys_first_write`: 3 of 3 each. - `ctest -R ^agc_ -j6`, three passes: 569 of 573 pass each time. The rest are 3 environment skips (`agc_host_import_sparse`, `agc_driver_sparse_dma_buf_import`, `agc_driver_stencil_ref_export`) and the unbuilt trace test above. - `tools/check_conventions.py --base origin/main` passes, and `git diff --check` is clean. - The debt entry names the 1 MiB exception. - **ccleste (PPSA59322)**, method: - relinked with `--trap-sdk-syscall-stubs`, one executable for both sides, warm run folders; - 70 s runs alternating `main` and this PR; - FPS over the last 30 s from the window title; - `APS5_PROFILE_DRAW=1` on the third run of each set, with figures per 10 s. | | `main` `d92a8dad3` | + this PR `290be5626` | |---|---|---| | FPS | 99.8 / 89.8 | **117.2 / 119.7** | | FPS, profiled run | 95.3 | **118.8** | | Frames by 60 s | 5,713 / 5,400 / 5,680 | 6,922 / 7,056 / 6,827 | | recorded draw, avg | 787–1,047 us | 276–331 us | | `readTarget` | 1,338–1,516 ms | 161–230 ms | | `[guestmem]` compare | 1,441–1,768 calls, 45–55 GiB, 5.7–7.0 s | 15 calls, 5 MiB in the first window, then 0 | | GPU busy per frame | 1.8–3.7 ms | 1.6–3.2 ms | The PR side presents 1,192–1,197 frames per 10 s, which is the title's 119.88 Hz output mode. So ccleste is at its cap on this side and can't show the floor's effect on frame rate. `main` runs faster than in my earlier run (73–83 FPS), while this PR stays at the cap. - **Imports** (`APS5_TRACE_HOST_IMPORT=1`, one run per side): 34 per run on both sides, all made before the first present window. - 27 are under 1 MiB (16–768 KiB) and stay on comparisons with the floor. - 7 are 1 MiB or more (16–160 MiB). - Compares stay at 0 after the first window, so on this title the floor costs nothing. ccleste has no per-submission import like SuperTuxKart's 64 KiB one. - **10-minute run with this PR:** 72,238 frames in 610 s, no stop. Working set 657.7 / 659.1 / 663.3 MiB and private bytes 1,115 / 1,116 / 1,120 MiB at 1 / 5 / 10 min. - **Not covered:** SuperTuxKart isn't on this machine, so no STK figures from here. @Dripl1x's and @LeandroLP23's runs cover it. One note on the floor's test coverage: - `agc_driver_layered_volume_submit` was named above as the test that exercises the settled decision through the real `VulkanDevice`. It imports only 256 KiB and 64 KiB ranges (`0x40000` three times, `0x10000` once), so since `23fccd763` its imports take the comparison path. - With `APS5_TRACE_HOST_IMPORT=1` across `^agc_`, 18 tests import a range of 1 MiB or more, e.g. `agc_driver_host_import_windows`, `agc_host_import_retire` and `agc_storage_cpu_snapshot`. The trace line doesn't say whether an import was settled, though, so I can't tell which of them reach `settleImport` through `importRunAt`. - A test that imports a writable private range just under and just over `settleFloorBytes`, and checks which one stays watched, would pin the floor. AI-assisted (Claude Code).
fma-rc commented 2026-10-15 09:44:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fma-rc on 2026-10-15T09:44:12Z.


Rechecked on main 0afa6a607 after the merge: agc_driver_recorder_tests --import-watch-only under the validation layer prints no ONE_TIME_SUBMIT message and no VUID on NVIDIA (RTX 5080) or RADV (Raphael iGPU), so 5b91ba2bb resolves what my review was about.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6189179489 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6060#issuecomment-6189179489). Originally posted by [fma-rc](https://github.com/fma-rc) on 2026-10-15T09:44:12Z. --- Rechecked on `main` 0afa6a607 after the merge: `agc_driver_recorder_tests --import-watch-only` under the validation layer prints no `ONE_TIME_SUBMIT` message and no VUID on NVIDIA (RTX 5080) or RADV (Raphael iGPU), so 5b91ba2bb resolves what my review was about.
TheAggie commented 2026-10-15 13:59:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by TheAggie on 2026-10-15T13:59:32Z.


Tested on Windows 11, NVIDIA GeForce RTX 5070 Ti (driver 610.88), MinGW-w64 GCC 15.2.0, with RetroArch's Flycast core (PPSA99169) running the Crazy Taxi attract demo, unprofiled, ANYPS5_PRESENT_MODE=immediate.

I cherry-picked this PR's five commits onto a local stack (main a453108cf plus local frontend support, #4943, #5906, #5609, a port of #1201's pipelined draw committer, and #6187, #6192, #6209, #6210). Same machine, the stack with and without this PR, runs alternated, two each: audio produced at 88.8% and 89.5% of real time with it, against 78.4% and 74.7% without. Frames dumped with it render correctly.

The start-up line here reads host imports of write-watched memory keep the write watch: yes (4096 of 4096 scratch pages reported written at the import, 0 by its 4-byte settle read, 0 after it, 0 after a full GPU read, 0 after a second, 0 after a GPU write, ...).

For context: on this workload, #5596 is what made most surfaces untracked on Windows. Before it, our local build on an older main (with a local two-stage draw worker) reached about 98% here. #6187, #6192, #6209 and #6210 make the untracked path cheaper (comparison memo, fast revalidation, DCC key proofs, presenter epoch), but they don't make the memory watched again; this PR does, and it removes most of that cost at the source. They complement each other: what this PR keeps watched never reaches those paths.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6193882807 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6060#issuecomment-6193882807). Originally posted by [TheAggie](https://github.com/TheAggie) on 2026-10-15T13:59:32Z. --- Tested on Windows 11, NVIDIA GeForce RTX 5070 Ti (driver 610.88), MinGW-w64 GCC 15.2.0, with RetroArch's Flycast core (PPSA99169) running the Crazy Taxi attract demo, unprofiled, `ANYPS5_PRESENT_MODE=immediate`. I cherry-picked this PR's five commits onto a local stack (`main` `a453108cf` plus local frontend support, #4943, #5906, #5609, a port of #1201's pipelined draw committer, and #6187, #6192, #6209, #6210). Same machine, the stack with and without this PR, runs alternated, two each: audio produced at 88.8% and 89.5% of real time with it, against 78.4% and 74.7% without. Frames dumped with it render correctly. The start-up line here reads `host imports of write-watched memory keep the write watch: yes (4096 of 4096 scratch pages reported written at the import, 0 by its 4-byte settle read, 0 after it, 0 after a full GPU read, 0 after a second, 0 after a GPU write, ...)`. For context: on this workload, #5596 is what made most surfaces untracked on Windows. Before it, our local build on an older `main` (with a local two-stage draw worker) reached about 98% here. #6187, #6192, #6209 and #6210 make the untracked path cheaper (comparison memo, fast revalidation, DCC key proofs, presenter epoch), but they don't make the memory watched again; this PR does, and it removes most of that cost at the source. They complement each other: what this PR keeps watched never reaches those paths. AI-assisted (Claude Code).
Sevthered commented 2026-10-15 14:50:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Sevthered on 2026-10-15T14:50:29Z.


@parl0v Astro Bot on NVIDIA, after the merge. ASTRO BOT PPSA21567 v01.019.000 (my own copy, from a repack folder), Windows 11 build 26300, RTX 3080 Ti 12 GB on driver 616.56, Ryzen 7 5800X, 32 GB, WinLibs GCC 15.2.0, window 1152x648. I compared main a5e2a80c6 against the same main with this PR's merge reverted locally (the only conflict was its test registrations in CMakeLists.txt). Both use the same relinked executable, run folder, save and warm shader cache; runs alternate between the builds, each started after the previous process had exited. The startup line reads keep the write watch: yes (4096 of 4096 scratch pages reported written at the import, 0 by its 4-byte settle read, 0 after it, ...), so 616.56 also marks everything at the import.

reverted main
logo frames 300:300, two traces each 28.7 / 28.8 s, p50 96.0 / 96.5 ms 8.2 / 8.2 s, p50 21.3 / 21.3 ms
same window, p99 / max 105 / 116 and 105 / 115 ms 352 / 680 and 345 / 674 ms
Crash Site (-lvl hub_crashsite), 60 s trace from 360 s, two runs each 63 and 84 presents, p50 759 / 710 ms 212 and 211 presents, p50 284 / 283 ms
private bytes at 450 s in Crash Site 32.6 / 30.3 GiB 29.2 / 29.1 GiB
first frame, three runs each 10, 10, 10 s 15, 15, 15 s

The logos run about 3.5x faster. Crash Site goes from 1.4 to 3.5 fps (2.5x) against the reverted run whose window was in front; the other reverted run (63 presents) had its window in the background for the whole trace, so I wouldn't count it. The level start is logged at 84 to 118 s in every run, so the trace windows are inside the level, and the screenshots show the same idle scene in both builds. The "Crash Site" title card stays up for about 500 frames after the level starts in both, so at 390 s the reverted build, at frame ~1300, still has it on screen.

Two costs show up in every run: the first frame comes 5 s later (9 to 10 s against 15 to 16 s in the Crash Site runs too), and each logo trace has five long frames that the reverted build doesn't have, each with one dispatch spending 225 to 330 ms in Vulkan.Dispatch.shader_resources. To see whether that's the settle, I put timing around the ImportWatched call in importRunAt in a local build (not for merging) and logged every import that took 10 ms or more:

  • Astro Bot makes few imports, but large ones: 49 by the end of the logo trace, 34 of them settled. The largest are 4.5, 3.2, 2.1 and 1.4 GiB.
  • The 17 imports that took 10 ms or more add up to 10.3 s: 2.8 s creating the import, 0.8 s settling, and 6.7 s in ImportWatched around the callback (waiting for the tracker lock, the zero scan of every page and the copy of the nonzero ones, the write walks before and after). The probe doesn't split those 6.7 s further. The 4.5 GiB import alone takes 3.2 s, with 0.6 s create and 0.23 s settle.
  • The five long frames are five re-imports of a ~1.1 GiB range that always ends at 0x37e000000 while its start moves up by 1.3 to 1.5 MiB or 320 to 400 KiB each time (0x3360e0000, 0x336254000, 0x3363a0000, 0x3363f0000, 0x336454000). Each takes 295 to 348 ms: 165 to 185 ms create, 34 to 51 ms settle and 89 to 128 ms around the callback. In the probe run's own trace, the five long shader_resources spans (350, 345, 389, 399, 350 ms) follow those five imports (302, 295, 348, 344, 296 ms) in order, each about 50 ms longer.

So on this title, batching the settles would have saved at most about 0.8 s up to the end of the logo trace; most of the time is the work around the callback, where Pipodi named the saved copy as the larger cost in review. I haven't run the probe on the reverted build, so I can't say what those imports cost without this PR, or whether that build re-imports the range ending at 0x37e000000 the same way. A second probe run started with -lvl hub_crashsite (200 s) shows at least 47 imports; most of its time is the same boot imports. The traces have trace_dropped set, so phase totals may be incomplete; frame counts and times come from the presents. Traces and the probe patch are available if useful.

AI-assisted: yes (Claude Code); the runs are from my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6194965890 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6060#issuecomment-6194965890). Originally posted by [Sevthered](https://github.com/Sevthered) on 2026-10-15T14:50:29Z. --- @parl0v Astro Bot on NVIDIA, after the merge. ASTRO BOT PPSA21567 v01.019.000 (my own copy, from a repack folder), Windows 11 build 26300, RTX 3080 Ti 12 GB on driver 616.56, Ryzen 7 5800X, 32 GB, WinLibs GCC 15.2.0, window 1152x648. I compared `main` `a5e2a80c6` against the same `main` with this PR's merge reverted locally (the only conflict was its test registrations in `CMakeLists.txt`). Both use the same relinked executable, run folder, save and warm shader cache; runs alternate between the builds, each started after the previous process had exited. The startup line reads `keep the write watch: yes (4096 of 4096 scratch pages reported written at the import, 0 by its 4-byte settle read, 0 after it, ...)`, so 616.56 also marks everything at the import. | | reverted | `main` | |---|---|---| | logo frames 300:300, two traces each | 28.7 / 28.8 s, p50 96.0 / 96.5 ms | 8.2 / 8.2 s, p50 21.3 / 21.3 ms | | same window, p99 / max | 105 / 116 and 105 / 115 ms | 352 / 680 and 345 / 674 ms | | Crash Site (`-lvl hub_crashsite`), 60 s trace from 360 s, two runs each | 63 and 84 presents, p50 759 / 710 ms | 212 and 211 presents, p50 284 / 283 ms | | private bytes at 450 s in Crash Site | 32.6 / 30.3 GiB | 29.2 / 29.1 GiB | | first frame, three runs each | 10, 10, 10 s | 15, 15, 15 s | The logos run about 3.5x faster. Crash Site goes from 1.4 to 3.5 fps (2.5x) against the reverted run whose window was in front; the other reverted run (63 presents) had its window in the background for the whole trace, so I wouldn't count it. The level start is logged at 84 to 118 s in every run, so the trace windows are inside the level, and the screenshots show the same idle scene in both builds. The "Crash Site" title card stays up for about 500 frames after the level starts in both, so at 390 s the reverted build, at frame ~1300, still has it on screen. Two costs show up in every run: the first frame comes 5 s later (9 to 10 s against 15 to 16 s in the Crash Site runs too), and each logo trace has five long frames that the reverted build doesn't have, each with one dispatch spending 225 to 330 ms in `Vulkan.Dispatch.shader_resources`. To see whether that's the settle, I put timing around the `ImportWatched` call in `importRunAt` in a local build (not for merging) and logged every import that took 10 ms or more: - Astro Bot makes few imports, but large ones: 49 by the end of the logo trace, 34 of them settled. The largest are 4.5, 3.2, 2.1 and 1.4 GiB. - The 17 imports that took 10 ms or more add up to 10.3 s: 2.8 s creating the import, 0.8 s settling, and 6.7 s in `ImportWatched` around the callback (waiting for the tracker lock, the zero scan of every page and the copy of the nonzero ones, the write walks before and after). The probe doesn't split those 6.7 s further. The 4.5 GiB import alone takes 3.2 s, with 0.6 s create and 0.23 s settle. - The five long frames are five re-imports of a ~1.1 GiB range that always ends at `0x37e000000` while its start moves up by 1.3 to 1.5 MiB or 320 to 400 KiB each time (`0x3360e0000`, `0x336254000`, `0x3363a0000`, `0x3363f0000`, `0x336454000`). Each takes 295 to 348 ms: 165 to 185 ms create, 34 to 51 ms settle and 89 to 128 ms around the callback. In the probe run's own trace, the five long `shader_resources` spans (350, 345, 389, 399, 350 ms) follow those five imports (302, 295, 348, 344, 296 ms) in order, each about 50 ms longer. So on this title, batching the settles would have saved at most about 0.8 s up to the end of the logo trace; most of the time is the work around the callback, where Pipodi named the saved copy as the larger cost in review. I haven't run the probe on the reverted build, so I can't say what those imports cost without this PR, or whether that build re-imports the range ending at `0x37e000000` the same way. A second probe run started with `-lvl hub_crashsite` (200 s) shows at least 47 imports; most of its time is the same boot imports. The traces have `trace_dropped` set, so phase totals may be incomplete; frame counts and times come from the presents. Traces and the probe patch are available if useful. AI-assisted: yes (Claude Code); the runs are from my machine.
parl0v commented 2026-10-15 14:52:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by parl0v on 2026-10-15T14:52:22Z.


@Sevthered thank you, that's exactly the measurement this needed: a clean revert A/B, plus a probe that splits the cost. 3.5x on the logos and 1.4 → 3.5 FPS in Crash Site on a 3080 Ti, and the two costs are real and ours. @TheAggie thanks too, 75–78 % → 89–90 % of real time on Flycast is a nice non-UE data point.

On the costs, my reading of your probe:

  • The five long frames are re-imports of one ~1.1 GiB range whose end stays at 0x37e000000 while its start moves up. Each one rebuilds the whole import, so the zero scan, the copy of the nonzero pages, the write walks and the settle all pay again for pages the previous import already tracked. The settle is the smallest part (34–51 ms of ~300), which matches your conclusion that batching settles wouldn't fix it.
  • The +5 s to first frame is the same per-import work on the large boot imports (4.5, 3.2, 2.1 and 1.4 GiB), where ImportWatched now has to do the full window instead of leaving them compared.

The follow-up I'll do: when a host import replaces one that covers part of the same range, only the part that is new goes through the zero scan, the copy and the settle; the overlap carries over the old import's watch state. That should remove most of the five frames and a share of the boot cost. I'll measure it on Minecraft Dungeons II (7,500 imports at load) and Sword of the Sea, and I'll ask you for a run on Astro Bot when there is a branch. If your probe patch is easy to share as a diff, it would save me re-instrumenting the same spot.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6195006200 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6060#issuecomment-6195006200). Originally posted by [parl0v](https://github.com/parl0v) on 2026-10-15T14:52:22Z. --- @Sevthered thank you, that's exactly the measurement this needed: a clean revert A/B, plus a probe that splits the cost. 3.5x on the logos and 1.4 → 3.5 FPS in Crash Site on a 3080 Ti, and the two costs are real and ours. @TheAggie thanks too, 75–78 % → 89–90 % of real time on Flycast is a nice non-UE data point. On the costs, my reading of your probe: - **The five long frames are re-imports of one ~1.1 GiB range whose end stays at `0x37e000000` while its start moves up.** Each one rebuilds the whole import, so the zero scan, the copy of the nonzero pages, the write walks and the settle all pay again for pages the previous import already tracked. The settle is the smallest part (34–51 ms of ~300), which matches your conclusion that batching settles wouldn't fix it. - **The +5 s to first frame** is the same per-import work on the large boot imports (4.5, 3.2, 2.1 and 1.4 GiB), where `ImportWatched` now has to do the full window instead of leaving them compared. The follow-up I'll do: when a host import replaces one that covers part of the same range, only the part that is new goes through the zero scan, the copy and the settle; the overlap carries over the old import's watch state. That should remove most of the five frames and a share of the boot cost. I'll measure it on Minecraft Dungeons II (7,500 imports at load) and Sword of the Sea, and I'll ask you for a run on Astro Bot when there is a branch. If your probe patch is easy to share as a diff, it would save me re-instrumenting the same spot. AI-assisted: yes (Claude Code)
Sevthered commented 2026-10-15 14:54:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Sevthered on 2026-10-15T14:54:37Z.


@parl0v sure, here it is, against main a5e2a80c6. It only builds on Windows as it is, because the print uses settled, which only exists under _WIN32. total is the whole ImportWatched call, create and settle are timed inside the callback, so the rest is what ImportWatched does around it. It prints every import that takes 10 ms or more plus every 500th, and the counters are cumulative, so the import count is the value on the last line printed.

probe-import-timing.patch
diff --git a/core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp b/core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
index 16604afe9..7294a51f9 100644
--- a/core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
+++ b/core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
@@ -23,6 +23,7 @@
 #include <unistd.h>
 #endif
 #include <array>
+#include <chrono>
 #include <atomic>
 #include <tuple>
 #include <utility>
@@ -1149,17 +1150,40 @@ const HostImport* importRunAt(const Context& context, HostImports& state, Import
     const bool watchedHostPointer = !state.unwatchImports;
     const bool watchedDmaBuf = !state.unwatchDmaBufImports;
 #endif
+    const auto probeOuter = std::chrono::steady_clock::now();
+    double probeCreateMs = 0.0;
+    double probeSettleMs = 0.0;
     GuestMemory::ImportWatched(base, bytes, [&] {
+        const auto probeCreate = std::chrono::steady_clock::now();
         step = watchedDmaBuf == watchedHostPointer ? createImport(context, entry, result) : createHostPointerImport(context, entry, result);
+        probeCreateMs = std::chrono::duration<double, std::milli>(std::chrono::steady_clock::now() - probeCreate).count();
 #ifdef _WIN32
+        const auto probeSettle = std::chrono::steady_clock::now();
         if (step == nullptr && settled && (step = settleImport(context, state, entry, result)) != nullptr) {
             destroyImport(context, entry);
             entry.buffer = VK_NULL_HANDLE;
             entry.memory = VK_NULL_HANDLE;
         }
+        if (settled) probeSettleMs = std::chrono::duration<double, std::milli>(std::chrono::steady_clock::now() - probeSettle).count();
 #endif
         return step == nullptr;
     }, watchedHostPointer);
+    {
+        static std::atomic<unsigned long long> probeImports{0};
+        static std::atomic<unsigned long long> probeSettles{0};
+        static std::atomic<unsigned long long> probeSettleUs{0};
+        static std::atomic<unsigned long long> probeTotalUs{0};
+        const double probeTotalMs = std::chrono::duration<double, std::milli>(std::chrono::steady_clock::now() - probeOuter).count();
+        const auto imports = ++probeImports;
+        probeTotalUs += static_cast<unsigned long long>(probeTotalMs * 1000.0);
+#ifdef _WIN32
+        if (settled) {
+            ++probeSettles;
+            probeSettleUs += static_cast<unsigned long long>(probeSettleMs * 1000.0);
+        }
+#endif
+        if (probeTotalMs >= 10.0 || imports % 500 == 0) std::fprintf(stderr, "[probe-import] 0x%llx+0x%llx settled %d total %.1f ms create %.1f ms settle %.1f ms | imports %llu settles %llu settle sum %.1f ms import sum %.1f ms\n", static_cast<unsigned long long>(base), static_cast<unsigned long long>(bytes), static_cast<int>(settled), probeTotalMs, probeCreateMs, probeSettleMs, imports, probeSettles.load(), probeSettleUs.load() / 1000.0, probeTotalUs.load() / 1000.0);
+    }
 #ifndef _WIN32
     if (BackingFile backing; step != nullptr && watchedDmaBuf != watchedHostPointer && sharedBacking(context, entry, backing)) {
         GuestMemory::ImportWatched(base, bytes, [&] {

Ping me when the branch is up and I'll run the same A/B on Astro Bot, logos and Crash Site, with the probe on top.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6195052643 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6060#issuecomment-6195052643). Originally posted by [Sevthered](https://github.com/Sevthered) on 2026-10-15T14:54:37Z. --- @parl0v sure, here it is, against `main` `a5e2a80c6`. It only builds on Windows as it is, because the print uses `settled`, which only exists under `_WIN32`. `total` is the whole `ImportWatched` call, `create` and `settle` are timed inside the callback, so the rest is what `ImportWatched` does around it. It prints every import that takes 10 ms or more plus every 500th, and the counters are cumulative, so the import count is the value on the last line printed. <details> <summary>probe-import-timing.patch</summary> ```diff diff --git a/core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp b/core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp index 16604afe9..7294a51f9 100644 --- a/core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp +++ b/core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp @@ -23,6 +23,7 @@ #include <unistd.h> #endif #include <array> +#include <chrono> #include <atomic> #include <tuple> #include <utility> @@ -1149,17 +1150,40 @@ const HostImport* importRunAt(const Context& context, HostImports& state, Import const bool watchedHostPointer = !state.unwatchImports; const bool watchedDmaBuf = !state.unwatchDmaBufImports; #endif + const auto probeOuter = std::chrono::steady_clock::now(); + double probeCreateMs = 0.0; + double probeSettleMs = 0.0; GuestMemory::ImportWatched(base, bytes, [&] { + const auto probeCreate = std::chrono::steady_clock::now(); step = watchedDmaBuf == watchedHostPointer ? createImport(context, entry, result) : createHostPointerImport(context, entry, result); + probeCreateMs = std::chrono::duration<double, std::milli>(std::chrono::steady_clock::now() - probeCreate).count(); #ifdef _WIN32 + const auto probeSettle = std::chrono::steady_clock::now(); if (step == nullptr && settled && (step = settleImport(context, state, entry, result)) != nullptr) { destroyImport(context, entry); entry.buffer = VK_NULL_HANDLE; entry.memory = VK_NULL_HANDLE; } + if (settled) probeSettleMs = std::chrono::duration<double, std::milli>(std::chrono::steady_clock::now() - probeSettle).count(); #endif return step == nullptr; }, watchedHostPointer); + { + static std::atomic<unsigned long long> probeImports{0}; + static std::atomic<unsigned long long> probeSettles{0}; + static std::atomic<unsigned long long> probeSettleUs{0}; + static std::atomic<unsigned long long> probeTotalUs{0}; + const double probeTotalMs = std::chrono::duration<double, std::milli>(std::chrono::steady_clock::now() - probeOuter).count(); + const auto imports = ++probeImports; + probeTotalUs += static_cast<unsigned long long>(probeTotalMs * 1000.0); +#ifdef _WIN32 + if (settled) { + ++probeSettles; + probeSettleUs += static_cast<unsigned long long>(probeSettleMs * 1000.0); + } +#endif + if (probeTotalMs >= 10.0 || imports % 500 == 0) std::fprintf(stderr, "[probe-import] 0x%llx+0x%llx settled %d total %.1f ms create %.1f ms settle %.1f ms | imports %llu settles %llu settle sum %.1f ms import sum %.1f ms\n", static_cast<unsigned long long>(base), static_cast<unsigned long long>(bytes), static_cast<int>(settled), probeTotalMs, probeCreateMs, probeSettleMs, imports, probeSettles.load(), probeSettleUs.load() / 1000.0, probeTotalUs.load() / 1000.0); + } #ifndef _WIN32 if (BackingFile backing; step != nullptr && watchedDmaBuf != watchedHostPointer && sharedBacking(context, entry, backing)) { GuestMemory::ImportWatched(base, bytes, [&] { ``` </details> Ping me when the branch is up and I'll run the same A/B on Astro Bot, logos and Crash Site, with the probe on top. AI-assisted: yes (Claude Code)
parl0v commented 2026-10-15 15:45:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by parl0v on 2026-10-15T15:45:40Z.


@Sevthered reproduced without the game, and the cause is upstream of the settle. A test maps 1126 MiB of singly mapped direct memory (1 page in 4 nonzero), imports it with HostImportFor, then 5 times protects the next 1440 KiB of the head and re-imports [start + k·1440 KiB, end) (RTX 4060; medians of 3 runs, ms):

total create settle ImportWatched zero scan copy walks
first import, 1126 MiB 726 182 27 683 312 93 62
re-imports k = 1..5 465–545 164–226 28–36 403–505 76–153 73–122 30–47

Same shape as your probe (create ~170, settle 30–40, the rest around the callback). What happens: any protect or unmap inside a registered range rebuilds every piece of it as a new Range (replaceRange), including the untouched tail; the next lookup's refreshImports sees a different range identity and retires the import, and importRunAt pins the whole tail again, which with #6060 means a new watched window, zero scan, copy and settle. The new range is always a sub-range of pages that are still imported.

The fix being built: keep the import when its range was split and the new range is an untouched piece inside it, and bind a new VkBuffer to the same imported memory at the new offset, so there is no new pinning, scan, copy or settle. To keep it exact, ranges carry a page-lineage serial that only the untouched pieces of a split inherit. I'll post the before/after from the same test, then ask you for an Astro Bot run on the branch.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6196138393 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6060#issuecomment-6196138393). Originally posted by [parl0v](https://github.com/parl0v) on 2026-10-15T15:45:40Z. --- @Sevthered reproduced without the game, and the cause is upstream of the settle. A test maps 1126 MiB of singly mapped direct memory (1 page in 4 nonzero), imports it with `HostImportFor`, then 5 times protects the next 1440 KiB of the head and re-imports `[start + k·1440 KiB, end)` (RTX 4060; medians of 3 runs, ms): | | total | create | settle | `ImportWatched` | zero scan | copy | walks | |---|---|---|---|---|---|---|---| | first import, 1126 MiB | 726 | 182 | 27 | 683 | 312 | 93 | 62 | | re-imports k = 1..5 | 465–545 | 164–226 | 28–36 | 403–505 | 76–153 | 73–122 | 30–47 | Same shape as your probe (create ~170, settle 30–40, the rest around the callback). What happens: any protect or unmap inside a registered range rebuilds every piece of it as a new `Range` (`replaceRange`), including the untouched tail; the next lookup's `refreshImports` sees a different range identity and retires the import, and `importRunAt` pins the whole tail again, which with #6060 means a new watched window, zero scan, copy and settle. The new range is always a sub-range of pages that are still imported. The fix being built: keep the import when its range was split and the new range is an untouched piece inside it, and bind a new `VkBuffer` to the same imported memory at the new offset, so there is no new pinning, scan, copy or settle. To keep it exact, ranges carry a page-lineage serial that only the untouched pieces of a split inherit. I'll post the before/after from the same test, then ask you for an Astro Bot run on the branch. AI-assisted: yes (Claude Code)
parl0v commented 2026-10-15 17:38:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by parl0v on 2026-10-15T17:38:44Z.


@Sevthered the fix for your five long frames is up as #6499: an import whose head or tail is cut off by a guest protect/unmap is kept and re-attached to the surviving range with a new VkBuffer on the same imported memory, so the tail isn't pinned, scanned, copied or settled again. In the synthetic version of your pattern (1126 MiB, start moving up 1440 KiB five times) each re-import goes from 472–560 ms to under 0.02 ms, and the test checks the trimmed import still collects CPU stores and that the GPU sees the guest bytes.

If you can, the same A/B you ran on Astro Bot would settle it on the real title: main vs main + #6499, the logo trace (do the five long frames go away?), time to first frame, and Crash Site. It doesn't change the first import of the big ranges, so the +5 s boot from the 4.5 / 3.2 / 2.1 / 1.4 GiB imports should only shrink by whatever part of it was re-imports.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6198390794 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6060#issuecomment-6198390794). Originally posted by [parl0v](https://github.com/parl0v) on 2026-10-15T17:38:44Z. --- @Sevthered the fix for your five long frames is up as #6499: an import whose head or tail is cut off by a guest protect/unmap is kept and re-attached to the surviving range with a new `VkBuffer` on the same imported memory, so the tail isn't pinned, scanned, copied or settled again. In the synthetic version of your pattern (1126 MiB, start moving up 1440 KiB five times) each re-import goes from 472–560 ms to under 0.02 ms, and the test checks the trimmed import still collects CPU stores and that the GPU sees the guest bytes. If you can, the same A/B you ran on Astro Bot would settle it on the real title: `main` vs `main` + #6499, the logo trace (do the five long frames go away?), time to first frame, and Crash Site. It doesn't change the first import of the big ranges, so the +5 s boot from the 4.5 / 3.2 / 2.1 / 1.4 GiB imports should only shrink by whatever part of it was re-imports. AI-assisted: yes (Claude Code)
frankea commented 2026-10-15 17:52:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by frankea on 2026-10-15T17:52:47Z.


Astro Bot (PPSA21564, v01.018.000, from the package I own), the title intro, on a third machine and a third driver branch. Windows 11 10.0.26200, Ryzen 7 5800X (Zen 3), RTX 4090 (NVIDIA 616.92), MinGW-w64 GCC 15.2.0 r7, Release, 3840x2160. One executable relinked once from main a077a88df with --windows --registry (no --to-intel), the libs/ directory swapped between three builds on that same base: main a077a88df, this PR 6c6a6c85a (merge 1b5ddbc4d) and #5851 22091410a (merge 7720d00ee). Runs alternated main / #6060 / #5851 for three rounds, 200 s each, APS5_TRACE_SECONDS=120:40 the only switch, no input. Round 1 of each build is its cold shader cache (main's window did not complete before the cap; the other two did and are listed), rounds 2 and 3 are warm.

Run presents before the window presents in 40 s FPS frame ms p50 / p90 / p99 GPU busy ms per present memory_wait ms per frame
main-2 1142 124 3.06 232.8 / 753.4 / 792.1 159.1 632
main-3 1152 120 2.97 229.1 / 762.3 / 797.0 168.7 652
pr6060-1 1833 599 14.96 66.8 / 71.2 / 97.3 33.3 131
pr6060-2 2630 611 15.26 66.1 / 70.1 / 72.5 32.3 128
pr6060-3 2576 598 14.94 67.4 / 71.5 / 73.5 32.1 131
pr5851-1 2688 642 16.04 62.6 / 65.9 / 67.7 33.0 122
pr5851-2 2669 641 16.01 62.7 / 66.4 / 68.1 32.5 122
pr5851-3 2774 643 16.05 62.7 / 66.3 / 68.3 32.6 122

Startup line with this PR, every run: keep the write watch: yes (4096 of 4096 ... 0 by its 4-byte settle read, 0 after it, 0 after a full GPU read, 0 after a second, 0 after a GPU write, 1 after a CPU store); direct host imports of private memory are settled and stay watched. main and #5851: Windows direct host imports use comparisons.

So on this box this PR takes the intro from 3.0 to 15.1 FPS, GPU busy per present from 164 to 32 ms, and Driver.Packet.memory_wait from about 640 to 130 ms per frame. #5851 on the same base lands at 16.0 FPS, within 6 % of this PR, and neither stopped.

The window is wall-clock, 120 to 160 s after start, and the title advances per presented frame: main had presented about 1,150 frames when its window opened, the two PRs about 2,600, so the PR captures sit somewhat further into the intro than main's. The three-frame-time consistency across rounds says the scene is stable within each build. No stop, fault or device loss in any of the nine runs; each was killed by the cap. Traces (aps5-trace-*.json.gz) and the full summary lines for every run are on hand if wanted. All summaries have trace_dropped: true (the event buffer fills in about 6 s at this frame rate), the phase totals are complete.

Summary lines (round 2 of each)
{"commit":"a077a88df5bc","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"120:40"},"gpu":"NVIDIA GeForce RTX 4090","driver":"NVIDIA 616.92","os":"Windows 10.0.26200","resolution":"3840x2160","window":{"spec":"seconds 120:40","first_present":1142,"ms":40484.101},"presents":124,"frame_ms":{"p50":232.803,"p90":753.419,"p99":792.1,"max":846.439},"gpu_busy_ms_per_present":159.147,"worker_busy_pct":{"queue worker 0x0":99.803,"queue worker 0x40":98.291,"queue worker 0x48":99.99,"queue worker 0x3a":0.0},"top_phases_ms_per_frame":{"Driver.Packet":972.223,"Driver.Packet.memory_wait":632.291,"Driver.Packet.draw":246.579,"Driver.Draw":246.451,"Driver.Draw.draw_and_resource_release":219.093,"Graphics.Draw":216.939,"Graphics.Draw.draw_and_resource_release":215.298,"Resources.Complete":111.131},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":28.158,"events_lost":48281,"totals_full":false}},"trace":"aps5-trace-a077a88df5bc-3124.json.gz"}
{"commit":"1b5ddbc4d2ce","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"120:40"},"gpu":"NVIDIA GeForce RTX 4090","driver":"NVIDIA 616.92","os":"Windows 10.0.26200","resolution":"3840x2160","window":{"spec":"seconds 120:40","first_present":2630,"ms":40037.771},"presents":611,"frame_ms":{"p50":66.1,"p90":70.121,"p99":72.537,"max":73.336},"gpu_busy_ms_per_present":32.269,"worker_busy_pct":{"queue worker 0x0":99.021,"queue worker 0x40":99.793,"queue worker 0x48":99.179,"queue worker 0x3a":0.0},"top_phases_ms_per_frame":{"Driver.Packet":194.909,"Driver.Packet.memory_wait":128.045,"Driver.Packet.draw":40.53,"Driver.Draw":40.405,"Driver.Draw.draw_and_resource_release":23.816,"Graphics.Draw":23.556,"Graphics.Draw.draw_and_resource_release":22.058,"Driver.Draw.shader_compile_and_link":13.441},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":6.632,"events_lost":1301356,"totals_full":false}},"trace":"aps5-trace-1b5ddbc4d2ce-4060.json.gz"}
{"commit":"7720d00eefad","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"120:40"},"gpu":"NVIDIA GeForce RTX 4090","driver":"NVIDIA 616.92","os":"Windows 10.0.26200","resolution":"3840x2160","window":{"spec":"seconds 120:40","first_present":2669,"ms":40047.036},"presents":641,"frame_ms":{"p50":62.688,"p90":66.379,"p99":68.079,"max":69.536},"gpu_busy_ms_per_present":32.452,"worker_busy_pct":{"queue worker 0x0":98.946,"queue worker 0x40":99.787,"queue worker 0x48":98.321,"queue worker 0x3a":0.0},"top_phases_ms_per_frame":{"Driver.Packet":185.308,"Driver.Packet.memory_wait":121.961,"Driver.Packet.draw":38.245,"Driver.Draw":38.12,"Driver.Draw.draw_and_resource_release":20.326,"Graphics.Draw":20.087,"Graphics.Draw.draw_and_resource_release":18.739,"Driver.Draw.shader_compile_and_link":14.741},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":6.291,"events_lost":1413635,"totals_full":false}},"trace":"aps5-trace-7720d00eefad-12784.json.gz"}

Tested with AI assistance (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6198650709 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6060#issuecomment-6198650709). Originally posted by [frankea](https://github.com/frankea) on 2026-10-15T17:52:47Z. --- Astro Bot (PPSA21564, v01.018.000, from the package I own), the title intro, on a third machine and a third driver branch. Windows 11 10.0.26200, Ryzen 7 5800X (Zen 3), RTX 4090 (NVIDIA 616.92), MinGW-w64 GCC 15.2.0 r7, Release, 3840x2160. One executable relinked once from `main` `a077a88df` with `--windows --registry` (no `--to-intel`), the `libs/` directory swapped between three builds on that same base: `main` `a077a88df`, this PR `6c6a6c85a` (merge `1b5ddbc4d`) and #5851 `22091410a` (merge `7720d00ee`). Runs alternated main / #6060 / #5851 for three rounds, 200 s each, `APS5_TRACE_SECONDS=120:40` the only switch, no input. Round 1 of each build is its cold shader cache (main's window did not complete before the cap; the other two did and are listed), rounds 2 and 3 are warm. | Run | presents before the window | presents in 40 s | FPS | frame ms p50 / p90 / p99 | GPU busy ms per present | memory_wait ms per frame | |---|---:|---:|---:|---|---:|---:| | main-2 | 1142 | 124 | **3.06** | 232.8 / 753.4 / 792.1 | 159.1 | 632 | | main-3 | 1152 | 120 | **2.97** | 229.1 / 762.3 / 797.0 | 168.7 | 652 | | pr6060-1 | 1833 | 599 | **14.96** | 66.8 / 71.2 / 97.3 | 33.3 | 131 | | pr6060-2 | 2630 | 611 | **15.26** | 66.1 / 70.1 / 72.5 | 32.3 | 128 | | pr6060-3 | 2576 | 598 | **14.94** | 67.4 / 71.5 / 73.5 | 32.1 | 131 | | pr5851-1 | 2688 | 642 | **16.04** | 62.6 / 65.9 / 67.7 | 33.0 | 122 | | pr5851-2 | 2669 | 641 | **16.01** | 62.7 / 66.4 / 68.1 | 32.5 | 122 | | pr5851-3 | 2774 | 643 | **16.05** | 62.7 / 66.3 / 68.3 | 32.6 | 122 | Startup line with this PR, every run: `keep the write watch: yes (4096 of 4096 ... 0 by its 4-byte settle read, 0 after it, 0 after a full GPU read, 0 after a second, 0 after a GPU write, 1 after a CPU store); direct host imports of private memory are settled and stay watched`. `main` and #5851: `Windows direct host imports use comparisons`. So on this box this PR takes the intro from 3.0 to 15.1 FPS, GPU busy per present from 164 to 32 ms, and `Driver.Packet.memory_wait` from about 640 to 130 ms per frame. #5851 on the same base lands at 16.0 FPS, within 6 % of this PR, and neither stopped. The window is wall-clock, 120 to 160 s after start, and the title advances per presented frame: `main` had presented about 1,150 frames when its window opened, the two PRs about 2,600, so the PR captures sit somewhat further into the intro than `main`'s. The three-frame-time consistency across rounds says the scene is stable within each build. No stop, fault or device loss in any of the nine runs; each was killed by the cap. Traces (`aps5-trace-*.json.gz`) and the full summary lines for every run are on hand if wanted. All summaries have `trace_dropped: true` (the event buffer fills in about 6 s at this frame rate), the phase totals are complete. <details><summary>Summary lines (round 2 of each)</summary> ```json {"commit":"a077a88df5bc","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"120:40"},"gpu":"NVIDIA GeForce RTX 4090","driver":"NVIDIA 616.92","os":"Windows 10.0.26200","resolution":"3840x2160","window":{"spec":"seconds 120:40","first_present":1142,"ms":40484.101},"presents":124,"frame_ms":{"p50":232.803,"p90":753.419,"p99":792.1,"max":846.439},"gpu_busy_ms_per_present":159.147,"worker_busy_pct":{"queue worker 0x0":99.803,"queue worker 0x40":98.291,"queue worker 0x48":99.99,"queue worker 0x3a":0.0},"top_phases_ms_per_frame":{"Driver.Packet":972.223,"Driver.Packet.memory_wait":632.291,"Driver.Packet.draw":246.579,"Driver.Draw":246.451,"Driver.Draw.draw_and_resource_release":219.093,"Graphics.Draw":216.939,"Graphics.Draw.draw_and_resource_release":215.298,"Resources.Complete":111.131},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":28.158,"events_lost":48281,"totals_full":false}},"trace":"aps5-trace-a077a88df5bc-3124.json.gz"} {"commit":"1b5ddbc4d2ce","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"120:40"},"gpu":"NVIDIA GeForce RTX 4090","driver":"NVIDIA 616.92","os":"Windows 10.0.26200","resolution":"3840x2160","window":{"spec":"seconds 120:40","first_present":2630,"ms":40037.771},"presents":611,"frame_ms":{"p50":66.1,"p90":70.121,"p99":72.537,"max":73.336},"gpu_busy_ms_per_present":32.269,"worker_busy_pct":{"queue worker 0x0":99.021,"queue worker 0x40":99.793,"queue worker 0x48":99.179,"queue worker 0x3a":0.0},"top_phases_ms_per_frame":{"Driver.Packet":194.909,"Driver.Packet.memory_wait":128.045,"Driver.Packet.draw":40.53,"Driver.Draw":40.405,"Driver.Draw.draw_and_resource_release":23.816,"Graphics.Draw":23.556,"Graphics.Draw.draw_and_resource_release":22.058,"Driver.Draw.shader_compile_and_link":13.441},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":6.632,"events_lost":1301356,"totals_full":false}},"trace":"aps5-trace-1b5ddbc4d2ce-4060.json.gz"} {"commit":"7720d00eefad","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"120:40"},"gpu":"NVIDIA GeForce RTX 4090","driver":"NVIDIA 616.92","os":"Windows 10.0.26200","resolution":"3840x2160","window":{"spec":"seconds 120:40","first_present":2669,"ms":40047.036},"presents":641,"frame_ms":{"p50":62.688,"p90":66.379,"p99":68.079,"max":69.536},"gpu_busy_ms_per_present":32.452,"worker_busy_pct":{"queue worker 0x0":98.946,"queue worker 0x40":99.787,"queue worker 0x48":98.321,"queue worker 0x3a":0.0},"top_phases_ms_per_frame":{"Driver.Packet":185.308,"Driver.Packet.memory_wait":121.961,"Driver.Packet.draw":38.245,"Driver.Draw":38.12,"Driver.Draw.draw_and_resource_release":20.326,"Graphics.Draw":20.087,"Graphics.Draw.draw_and_resource_release":18.739,"Driver.Draw.shader_compile_and_link":14.741},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":6.291,"events_lost":1413635,"totals_full":false}},"trace":"aps5-trace-7720d00eefad-12784.json.gz"} ``` </details> Tested with AI assistance (Claude Code).
parl0v commented 2026-10-15 17:54:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by parl0v on 2026-10-15T17:54:23Z.


@frankea thank you, a third machine and driver branch, and a clean three-way on the same base: 3.0 → 15.1 FPS on the Astro Bot intro on a 4090, memory_wait 640 → 130 ms per frame, no stops in nine runs.

On the 6 % to #5851 at the same scene: part of that may be the re-import pattern @Sevthered measured in this title (a ~1.1 GiB range re-imported with its start moving up, each re-import a full watched window and settle with this PR). #6499 keeps an import across such a split instead of re-importing it (472–560 ms → under 0.02 ms per re-import in a synthetic test). If you have a slot, main + #6060 + #6499 on the same three-round setup would show how much of the gap it closes.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6198681607 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6060#issuecomment-6198681607). Originally posted by [parl0v](https://github.com/parl0v) on 2026-10-15T17:54:23Z. --- @frankea thank you, a third machine and driver branch, and a clean three-way on the same base: 3.0 → 15.1 FPS on the Astro Bot intro on a 4090, `memory_wait` 640 → 130 ms per frame, no stops in nine runs. On the 6 % to #5851 at the same scene: part of that may be the re-import pattern @Sevthered measured in this title (a ~1.1 GiB range re-imported with its start moving up, each re-import a full watched window and settle with this PR). #6499 keeps an import across such a split instead of re-importing it (472–560 ms → under 0.02 ms per re-import in a synthetic test). If you have a slot, `main` + #6060 + #6499 on the same three-round setup would show how much of the gap it closes. AI-assisted: yes (Claude Code)
frankea commented 2026-10-15 20:25:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by frankea on 2026-10-15T20:25:53Z.


Follow-up to the Astro Bot three-way above, now that this is merged: today's main 44df21632 runs the same intro window at 20.0 to 20.3 FPS on this box (3 rounds), against 15.1 for head 6c6a6c85a on a077a88df yesterday and 16.0 for #5851, with memory_wait down from 128 to 93 ms per frame and GPU busy unchanged at 31 to 32 ms. So whatever separated the two candidates here is gone on main. #6499 on top of it changes neither the intro nor the logo sequence on this machine; details in https://github.com/boykopovar/AnyPS5/pull/6499#issuecomment-6201569153.

Tested with AI assistance (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6201569551 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6060#issuecomment-6201569551). Originally posted by [frankea](https://github.com/frankea) on 2026-10-15T20:25:53Z. --- Follow-up to the Astro Bot three-way above, now that this is merged: today's `main` `44df21632` runs the same intro window at **20.0 to 20.3 FPS** on this box (3 rounds), against 15.1 for head `6c6a6c85a` on `a077a88df` yesterday and 16.0 for #5851, with `memory_wait` down from 128 to 93 ms per frame and GPU busy unchanged at 31 to 32 ms. So whatever separated the two candidates here is gone on `main`. #6499 on top of it changes neither the intro nor the logo sequence on this machine; details in https://github.com/boykopovar/AnyPS5/pull/6499#issuecomment-6201569153. Tested with AI assistance (Claude Code).
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!6060
No description provided.