fix(agc): run the unwatch hook when a watched import leaves the write watch #6308

Closed
LeandroLP23 wants to merge 0 commits from upstream-pr/6308 into main
LeandroLP23 commented 2026-10-15 10:44:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-15T10:44:36Z.


What

Fixes #6301. Since #6060, ProsperoPuzzles (PPSA99006) stops 5 s in on Windows:

AGC graphics: storing storage image results pending over memory outside the write watch without the guest bytes saved before them is not implemented

GuestMemory::ImportWatched with staysWatched still drops the range from the write watch when the range was only partly watched (before is false) or the import window can't be resolved. That fallback called unwatchLocked without beforeUnwatch, so the storage-image hook (StorageTexture::SaveBeforeUnwatch) never saved the guest bytes of results pending there. The !staysWatched path always runs the hook first.

Before #6060, Windows direct imports never took this path. Now settled private imports do. In ProsperoPuzzles an 8 MiB import at 0x21f800000 took the fallback with the range only partly watched, and unwatched the storage image at 0x21fc00000 with results pending.

The fallback now releases the tracker lock, runs the hook over the page range, takes the lock again and unwatches. The hook takes the pending-texture mutex and GpuMutex (and, with #5671, the tracker lock), so it can't run under the tracker lock.

agc_write_tracking gets CheckImportWindowOverUnwatchedPart. It unwatches the middle block of three, imports all three with staysWatched, and requires the hook to have covered the range.

This complements #5671, which widens the span the hook gets to whole 64 KiB blocks. The two touch different lines.

Tested

Windows 11 (26300), Radeon 860M (RDNA 3.5, driver 32.0.13058.8001), WinLibs GCC 15.2.0, Release, on main e49ec591d.

  • ProsperoPuzzles (catalog 01.000.010, --windows --trap-sdk-syscall-stubs, new run folder, 60 s, no input): 3 of 3 alive at 60 s, 19.0–19.2 FPS. On main, every run stops at 5–7 s (data in #6301). Before #6060 it ran at 9.5–13.7 FPS.
  • agc_write_tracking passes. With the GuestMemory.cpp change reverted, the new check fails: an import that left the write watch did not run the unwatch hook over its range.
  • ctest -R '^agc_|guest_memory|write_watch' -j 1 from an empty tests/shader_cache: 583 of 585 pass. The two failures fail on main here too: agc_driver_quad_pixel_mask (#6255) and agc_driver_layered_volume_vertex_no_gpl (#4768).
  • tools/check_conventions.py --base origin/main passes; git diff --check is clean.

Fork CI (run): Windows 1264 of 1265 and Linux 1241 of 1242, the one failure in each being the fork-only conventions_ci_gate. The first Linux attempt also failed agc_driver_preparation_scope_settle (the link did not wait for the vertex shader's registration preparation), a shader-registration timing test that uses no imports. It passed on the job rerun and 10 of 10 locally.

Not tested: NVIDIA, Intel, other titles.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: ProsperoPuzzles (PPSA99006) on Windows, #6301
  • GPUs tested: AMD Radeon 860M (RDNA 3.5), driver 32.0.13058.8001, Windows 11 26300
  • AI-assisted: yes (Claude Code)
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4872002150 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6308). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-10-15T10:44:36Z. --- ### What Fixes #6301. Since #6060, ProsperoPuzzles (PPSA99006) stops 5 s in on Windows: ``` AGC graphics: storing storage image results pending over memory outside the write watch without the guest bytes saved before them is not implemented ``` `GuestMemory::ImportWatched` with `staysWatched` still drops the range from the write watch when the range was only partly watched (`before` is false) or the import window can't be resolved. That fallback called `unwatchLocked` without `beforeUnwatch`, so the storage-image hook (`StorageTexture::SaveBeforeUnwatch`) never saved the guest bytes of results pending there. The `!staysWatched` path always runs the hook first. Before #6060, Windows direct imports never took this path. Now settled private imports do. In ProsperoPuzzles an 8 MiB import at `0x21f800000` took the fallback with the range only partly watched, and unwatched the storage image at `0x21fc00000` with results pending. The fallback now releases the tracker lock, runs the hook over the page range, takes the lock again and unwatches. The hook takes the pending-texture mutex and `GpuMutex` (and, with #5671, the tracker lock), so it can't run under the tracker lock. `agc_write_tracking` gets `CheckImportWindowOverUnwatchedPart`. It unwatches the middle block of three, imports all three with `staysWatched`, and requires the hook to have covered the range. This complements #5671, which widens the span the hook gets to whole 64 KiB blocks. The two touch different lines. ### Tested Windows 11 (26300), Radeon 860M (RDNA 3.5, driver 32.0.13058.8001), WinLibs GCC 15.2.0, Release, on `main` `e49ec591d`. - **ProsperoPuzzles** (catalog 01.000.010, `--windows --trap-sdk-syscall-stubs`, new run folder, 60 s, no input): 3 of 3 alive at 60 s, 19.0–19.2 FPS. On `main`, every run stops at 5–7 s (data in #6301). Before #6060 it ran at 9.5–13.7 FPS. - **`agc_write_tracking`** passes. With the `GuestMemory.cpp` change reverted, the new check fails: `an import that left the write watch did not run the unwatch hook over its range`. - **`ctest -R '^agc_|guest_memory|write_watch' -j 1`** from an empty `tests/shader_cache`: 583 of 585 pass. The two failures fail on `main` here too: `agc_driver_quad_pixel_mask` (#6255) and `agc_driver_layered_volume_vertex_no_gpl` (#4768). - `tools/check_conventions.py --base origin/main` passes; `git diff --check` is clean. Fork CI ([run](https://github.com/LeandroLP23/AnyPS5/actions/runs/38722374475)): Windows 1264 of 1265 and Linux 1241 of 1242, the one failure in each being the fork-only `conventions_ci_gate`. The first Linux attempt also failed `agc_driver_preparation_scope_settle` (`the link did not wait for the vertex shader's registration preparation`), a shader-registration timing test that uses no imports. It passed on the job rerun and 10 of 10 locally. Not tested: NVIDIA, Intel, other titles. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: ProsperoPuzzles (PPSA99006) on Windows, #6301 - [x] GPUs tested: AMD Radeon 860M (RDNA 3.5), driver 32.0.13058.8001, Windows 11 26300 - [x] AI-assisted: yes (Claude Code)
zaryabzip commented 2026-10-15 11:49:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by zaryabzip on 2026-10-15T11:49:10Z.


NVIDIA run, for the "Not tested: NVIDIA, Intel, Linux, other titles." line. Windows 11 (26200), RTX 3060 Laptop GPU (NVIDIA 617.42), WinLibs GCC 15.2.0 r7 (UCRT), Release, BUILD_TESTING=ON. Head 93df5c42a merged onto main 8856f180c (clean); ANYPS5_GPU=3060, and a verbose test log shows the RTX 3060 selected.

  • agc_write_tracking: passes.
  • With GuestMemory.cpp from main and the PR's test (2 of 2 runs), agc_write_tracking fails: an import that left the write watch did not run the unwatch hook over its range.
  • ctest -R "agc|shader|guest_memory|write_watch" -j4: 591/591 pass with the PR, and 591/591 on main. Both skip the same 3 tests (agc_host_import_sparse, agc_driver_sparse_dma_buf_import, agc_driver_stencil_ref_export).
  • agc_driver_quad_pixel_mask and agc_driver_layered_volume_vertex_no_gpl pass here, with the PR and on main.

Not run: ProsperoPuzzles or any other title, Intel, Linux.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6191339276 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6308#issuecomment-6191339276). Originally posted by [zaryabzip](https://github.com/zaryabzip) on 2026-10-15T11:49:10Z. --- NVIDIA run, for the "Not tested: NVIDIA, Intel, Linux, other titles." line. Windows 11 (26200), RTX 3060 Laptop GPU (NVIDIA 617.42), WinLibs GCC 15.2.0 r7 (UCRT), Release, `BUILD_TESTING=ON`. Head `93df5c42a` merged onto `main` `8856f180c` (clean); `ANYPS5_GPU=3060`, and a verbose test log shows the RTX 3060 selected. - `agc_write_tracking`: passes. - With `GuestMemory.cpp` from `main` and the PR's test (2 of 2 runs), `agc_write_tracking` fails: `an import that left the write watch did not run the unwatch hook over its range`. - `ctest -R "agc|shader|guest_memory|write_watch" -j4`: 591/591 pass with the PR, and 591/591 on `main`. Both skip the same 3 tests (`agc_host_import_sparse`, `agc_driver_sparse_dma_buf_import`, `agc_driver_stencil_ref_export`). - `agc_driver_quad_pixel_mask` and `agc_driver_layered_volume_vertex_no_gpl` pass here, with the PR and on `main`. Not run: ProsperoPuzzles or any other title, Intel, Linux. AI-assisted: yes (Claude Code)
github-actions[bot] commented 2026-10-15 12:18:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T12:18:24Z.


Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 4448 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 5021 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6169 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6185 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6186 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6187 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6188 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6192 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6209 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6273 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp
PR 6292 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6615 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6718 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6759 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6820 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6868 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp
PR 6921 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6926 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6946 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6947 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6960 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 7201 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp
PR 7233 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp
PR 7332 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp
PR 7371 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp
PR 7615 core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp
PR 7642 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 7981 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp
PR 8139 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6191864221 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6308#issuecomment-6191864221). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-15T12:18:24Z. --- <!-- pr-overlap --> Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap. | Pull request | Shared files not compared | |---|---| | [PR 4448](https://www.github.com/boykopovar/AnyPS5/pull/4448) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 5021](https://www.github.com/boykopovar/AnyPS5/pull/5021) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 6169](https://www.github.com/boykopovar/AnyPS5/pull/6169) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 6185](https://www.github.com/boykopovar/AnyPS5/pull/6185) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 6186](https://www.github.com/boykopovar/AnyPS5/pull/6186) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 6187](https://www.github.com/boykopovar/AnyPS5/pull/6187) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 6188](https://www.github.com/boykopovar/AnyPS5/pull/6188) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 6192](https://www.github.com/boykopovar/AnyPS5/pull/6192) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 6209](https://www.github.com/boykopovar/AnyPS5/pull/6209) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 6273](https://www.github.com/boykopovar/AnyPS5/pull/6273) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp` | | [PR 6292](https://www.github.com/boykopovar/AnyPS5/pull/6292) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 6615](https://www.github.com/boykopovar/AnyPS5/pull/6615) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 6718](https://www.github.com/boykopovar/AnyPS5/pull/6718) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 6759](https://www.github.com/boykopovar/AnyPS5/pull/6759) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 6820](https://www.github.com/boykopovar/AnyPS5/pull/6820) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 6868](https://www.github.com/boykopovar/AnyPS5/pull/6868) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp` | | [PR 6921](https://www.github.com/boykopovar/AnyPS5/pull/6921) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 6926](https://www.github.com/boykopovar/AnyPS5/pull/6926) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 6946](https://www.github.com/boykopovar/AnyPS5/pull/6946) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 6947](https://www.github.com/boykopovar/AnyPS5/pull/6947) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 6960](https://www.github.com/boykopovar/AnyPS5/pull/6960) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 7201](https://www.github.com/boykopovar/AnyPS5/pull/7201) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp` | | [PR 7233](https://www.github.com/boykopovar/AnyPS5/pull/7233) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp` | | [PR 7332](https://www.github.com/boykopovar/AnyPS5/pull/7332) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp` | | [PR 7371](https://www.github.com/boykopovar/AnyPS5/pull/7371) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp` | | [PR 7615](https://www.github.com/boykopovar/AnyPS5/pull/7615) | `core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp` | | [PR 7642](https://www.github.com/boykopovar/AnyPS5/pull/7642) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 7981](https://www.github.com/boykopovar/AnyPS5/pull/7981) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp` | | [PR 8139](https://www.github.com/boykopovar/AnyPS5/pull/8139) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` |
simonbbby commented 2026-10-15 12:26:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by simonbbby on 2026-10-15T12:26:19Z.


Independent Linux CPU write-tracking control at exact head 93df5c42a1b3ddd9362d7fc8541f811eac730248: Ubuntu 24.04, kernel 7.0.0-38, GCC 13.3, Ryzen 9 9950X.

Compiled the unchanged WriteTracking.cpp test with the production GuestMemory.cpp, GuestAllocations.cpp, GuestArena.cpp and GuestWriteWatch.cpp directly (-std=c++20 -O2 -pthread -msse4.2, function/data sections and link-time garbage collection). This avoids the unrelated SDL/XRandR configuration blocker; no watch implementation or tracker was mocked.

  • PR objects: 5/5 pass, write tracking tests passed (exit 0, not the exit-77 no-write-watch skip).
  • Same test and support objects, replacing only GuestMemory.cpp with HEAD^: 5/5 fail at an import that left the write watch did not run the unwatch hook over its range. The preceding import and unwatched-block assertions succeed, isolating the missing callback rather than a failed import or range-unwatch operation.
  • Additional scratch-test control: the new hook calls Watched on the first and last blocks and requires both still watched. 5/5 pass with the PR. This checks that the hook runs before unwatching and can re-enter the real tracker. Removing only the surrounding lock.unlock()/lock.lock() in a scratch production copy makes this control time out at 5 s, consistent with the mutex-order requirement in the description.

A traced pass also shows successful UFFDIO_REGISTER, UFFDIO_WRITEPROTECT and PAGEMAP_SCAN calls through the real Linux write watch. The exact-head worktree is unchanged. Scope: standalone production CPU tracker/write-watch test and callback re-entry; no full runtime/renderer build, GPU execution, or ProsperoPuzzles/title replay.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6192007128 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6308#issuecomment-6192007128). Originally posted by [simonbbby](https://github.com/simonbbby) on 2026-10-15T12:26:19Z. --- Independent **Linux CPU write-tracking** control at exact head `93df5c42a1b3ddd9362d7fc8541f811eac730248`: Ubuntu 24.04, kernel 7.0.0-38, GCC 13.3, Ryzen 9 9950X. Compiled the unchanged `WriteTracking.cpp` test with the production `GuestMemory.cpp`, `GuestAllocations.cpp`, `GuestArena.cpp` and `GuestWriteWatch.cpp` directly (`-std=c++20 -O2 -pthread -msse4.2`, function/data sections and link-time garbage collection). This avoids the unrelated SDL/XRandR configuration blocker; no watch implementation or tracker was mocked. - PR objects: **5/5 pass**, `write tracking tests passed` (exit 0, not the exit-77 no-write-watch skip). - Same test and support objects, replacing only `GuestMemory.cpp` with `HEAD^`: **5/5 fail** at `an import that left the write watch did not run the unwatch hook over its range`. The preceding import and unwatched-block assertions succeed, isolating the missing callback rather than a failed import or range-unwatch operation. - Additional scratch-test control: the new hook calls `Watched` on the first and last blocks and requires both still watched. **5/5 pass** with the PR. This checks that the hook runs before unwatching and can re-enter the real tracker. Removing only the surrounding `lock.unlock()`/`lock.lock()` in a scratch production copy makes this control time out at 5 s, consistent with the mutex-order requirement in the description. A traced pass also shows successful `UFFDIO_REGISTER`, `UFFDIO_WRITEPROTECT` and `PAGEMAP_SCAN` calls through the real Linux write watch. The exact-head worktree is unchanged. Scope: standalone production CPU tracker/write-watch test and callback re-entry; no full runtime/renderer build, GPU execution, or ProsperoPuzzles/title replay.
screamm commented 2026-10-15 12:39:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by screamm on 2026-10-15T12:39:48Z.


Cross-validation on Windows 11 Pro 26220, NVIDIA RTX 4070 (596.21), MinGW GCC 15.2, PR head 93df5c42a merged on main 8856f180c:

ProsperoPuzzles (PPSA99006), catalog 01.000.010, relinked with --windows (same launch as our catalog run 7), new run folder each run, 90 s limit, no input. Runs alternated before/after.

Build Run Result
main 8856f180c 1 stops at 11.4 s, 3 frames, exit 0xC0000409
main 8856f180c 2 stops at 21.3 s, before the first FPS sample, exit 0xC0000409
#6308 merged 1 alive at 90 s (killed), 749 frames
#6308 merged 2 alive at 90 s (killed), 1007 frames
#6308 merged 3 alive at 90 s (killed), 901 frames

On main both runs end with:

terminate called after throwing an instance of 'std::runtime_error'
  what():  AGC graphics: storing storage image results pending over memory outside the write watch without the guest bytes saved before them is not implemented
FATAL: abort() (SIGABRT) on thread 42764

right after [gpu] storage image 0x21fc00000: guest memory changed while GPU results were pending; keeping the CPU's blocks in download0/prosperopuzzles/app.log, as in #6301. With the PR, the title gets past that line in all three runs and keeps rendering the menu. Frame dumps at presents 30-360 have the same mean brightness (about 105) as in our earlier run on main d92a8dad3, before #6060 (984 frames in 60 s). FPS at the end was 2-11. This host was heavily loaded by other builds and tests, so FPS is not comparable with the 19 FPS in the PR.

Tests (merged tree):

  • agc_write_tracking: 3/3 pass. With the GuestMemory.cpp hunk reverted, it fails with an import that left the write watch did not run the unwatch hook over its range.
  • Non-GPU suite (-E '^agc_driver_|^video_out_flip', -j8): 797/816, then 809/816 after serial reruns. The 7 left are timeouts (conventions_function_bodies, hardware_oracle_compare, guest_raise_exception, guest_file_lock_process, guest_none_relocations, tls_function_coverage_register_address_loads, windows_diagnostic_fixture_isolation) that also time out serially on main 8856f180c on this host under the same load.
  • GPU suite (-R '^agc_driver_', -j1), one full pass: 435 passed, 2 skipped, 1 failed. The failure is agc_driver_preparation_scope_settle ("the link did not wait for the vertex shader's registration preparation"), which is flaky on main too: 3 of 7 runs pass on each build. The storage, import and watch tests (host_import_*, storage_*, store_over_untracked, untracked_snapshot_hint, depth_storage*, resource_cache_*storage*, 17 run + 1 skipped) pass 3/3.
  • tools/check_conventions.py --base origin/main passes; git diff origin/main --check is clean.

Notes, none blocking:

  • In the !staysWatched path the hook runs before the import; in the new fallback it runs after it. That makes no difference for host-pointer imports, which don't write guest bytes. For the partly-watched case (!covered), the fallback is already known before the import, so the hook could also run before it, as in the other path.
  • The new check covers the partly-watched branch, not the walkWrites window-resolution failure branch.
  • docs/dev/debt/libSceAgcDriver.md ("Pending storage-image results over memory outside the write watch") says the bytes are saved at Unwatch "or a host import that does not stay watched". An import that should stay watched but falls back to leaving the watch now saves them too, so that sentence could mention it.

Written with Claude Code assistance.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6192258550 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6308#issuecomment-6192258550). Originally posted by [screamm](https://github.com/screamm) on 2026-10-15T12:39:48Z. --- Cross-validation on Windows 11 Pro 26220, NVIDIA RTX 4070 (596.21), MinGW GCC 15.2, PR head 93df5c42a merged on main 8856f180c: **ProsperoPuzzles (PPSA99006)**, catalog 01.000.010, relinked with `--windows` (same launch as our catalog run 7), new run folder each run, 90 s limit, no input. Runs alternated before/after. | Build | Run | Result | |---|---|---| | `main` 8856f180c | 1 | stops at 11.4 s, 3 frames, exit `0xC0000409` | | `main` 8856f180c | 2 | stops at 21.3 s, before the first FPS sample, exit `0xC0000409` | | #6308 merged | 1 | alive at 90 s (killed), 749 frames | | #6308 merged | 2 | alive at 90 s (killed), 1007 frames | | #6308 merged | 3 | alive at 90 s (killed), 901 frames | On `main` both runs end with: terminate called after throwing an instance of 'std::runtime_error' what(): AGC graphics: storing storage image results pending over memory outside the write watch without the guest bytes saved before them is not implemented FATAL: abort() (SIGABRT) on thread 42764 right after `[gpu] storage image 0x21fc00000: guest memory changed while GPU results were pending; keeping the CPU's blocks` in `download0/prosperopuzzles/app.log`, as in #6301. With the PR, the title gets past that line in all three runs and keeps rendering the menu. Frame dumps at presents 30-360 have the same mean brightness (about 105) as in our earlier run on `main` d92a8dad3, before #6060 (984 frames in 60 s). FPS at the end was 2-11. This host was heavily loaded by other builds and tests, so FPS is not comparable with the 19 FPS in the PR. **Tests** (merged tree): - `agc_write_tracking`: 3/3 pass. With the `GuestMemory.cpp` hunk reverted, it fails with `an import that left the write watch did not run the unwatch hook over its range`. - Non-GPU suite (`-E '^agc_driver_|^video_out_flip'`, `-j8`): 797/816, then 809/816 after serial reruns. The 7 left are timeouts (`conventions_function_bodies`, `hardware_oracle_compare`, `guest_raise_exception`, `guest_file_lock_process`, `guest_none_relocations`, `tls_function_coverage_register_address_loads`, `windows_diagnostic_fixture_isolation`) that also time out serially on `main` 8856f180c on this host under the same load. - GPU suite (`-R '^agc_driver_'`, `-j1`), one full pass: 435 passed, 2 skipped, 1 failed. The failure is `agc_driver_preparation_scope_settle` ("the link did not wait for the vertex shader's registration preparation"), which is flaky on `main` too: 3 of 7 runs pass on each build. The storage, import and watch tests (`host_import_*`, `storage_*`, `store_over_untracked`, `untracked_snapshot_hint`, `depth_storage*`, `resource_cache_*storage*`, 17 run + 1 skipped) pass 3/3. - `tools/check_conventions.py --base origin/main` passes; `git diff origin/main --check` is clean. **Notes**, none blocking: - In the `!staysWatched` path the hook runs before the import; in the new fallback it runs after it. That makes no difference for host-pointer imports, which don't write guest bytes. For the partly-watched case (`!covered`), the fallback is already known before the import, so the hook could also run before it, as in the other path. - The new check covers the partly-watched branch, not the `walkWrites` window-resolution failure branch. - `docs/dev/debt/libSceAgcDriver.md` ("Pending storage-image results over memory outside the write watch") says the bytes are saved at `Unwatch` "or a host import that does not stay watched". An import that should stay watched but falls back to leaving the watch now saves them too, so that sentence could mention it. Written with Claude Code assistance.
AlxcBTW commented 2026-10-15 21:46:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by AlxcBTW on 2026-10-15T21:46:24Z.


A second title that stops with this text and that this PR moves on: Minecraft Dungeons II (PPSA16064, Unreal Engine 5), Windows 11, RTX 5070 Laptop (NVIDIA 617.42). On a build of main that contains #5671 it stops while loading its first world (2 of 2 runs):

[videoout] presentation failed: compute shader 0x16000e2000: AGC graphics: storing storage image results pending over memory outside the write watch without the guest bytes saved before them is not implemented

The refused image is the 2564x1444 scene colour target (DCC, 252 units of 64 KiB, all with results pending, none with saved guest bytes, none of its memory write-watched). With this PR's change (a lab build with the same hunk, the hook run in the fallback after the import) the title loads the world and plays. Five of five rows of that build loaded the world and played (one fresh world load from the main menu, four from a save inside the world; each walking 180 s with the HUD up), 2.6 FPS mean on the fresh load and 4.0-4.5 FPS warm, with no refusal; the hook ran 32 times per row. Without the change 2 of 2 world loads stopped. One earlier row that combined the hunk with a second, unrelated lab change aborted later on a different check (a heap mirror's range is no longer write-watched); the hunk cannot change which ranges are watched, and #6546 addresses that path.

The first 16 fallback events of that run (the build's report stops at 16), all 8 MiB import windows, had before false because the range was not wholly watched before the import (covered before 0, the first walk was not made); none came from a failing walk. The same holds for the other rows of the job. So the title takes the branch that CheckImportWindowOverUnwatchedPart covers.

Two notes, not blocking, in the direction of the third note of the cross-validation above:

  • In that branch the range leaves the watch whatever the import does, so the hook can run before the import, as it does for the import that does not stay watched. After the import the walk with the window compare is skipped (!before), so the hook collects the pages the import itself marked written (4096 of 4096 scratch pages reported written at the import in the probe line) as CPU writes, and saveBeforeUnwatch keeps the blocks they cover for the CPU unless unchangedSinceBaseline proves their bytes unchanged; an image over 1 MiB has no generationBaseline (GenerationBaselineBytes), so it cannot. Read from the code, not shown on a title.
  • A test of the whole flow (results pending over a surface, an import over a range with an unwatched block, the flush) passes with this PR on lavapipe. I have a follow-up ready for after this is merged: that test, the hook before the import in that branch, the same save for the other exit without the hook (MarkWritten excluding a block after a failed fresh collect, when the caller holds the GPU mutex), a unit test per exit and the debt entry sentence.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6202950743 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6308#issuecomment-6202950743). Originally posted by [AlxcBTW](https://github.com/AlxcBTW) on 2026-10-15T21:46:24Z. --- A second title that stops with this text and that this PR moves on: Minecraft Dungeons II (PPSA16064, Unreal Engine 5), Windows 11, RTX 5070 Laptop (NVIDIA 617.42). On a build of `main` that contains #5671 it stops while loading its first world (2 of 2 runs): ``` [videoout] presentation failed: compute shader 0x16000e2000: AGC graphics: storing storage image results pending over memory outside the write watch without the guest bytes saved before them is not implemented ``` The refused image is the 2564x1444 scene colour target (DCC, 252 units of 64 KiB, all with results pending, none with saved guest bytes, none of its memory write-watched). With this PR's change (a lab build with the same hunk, the hook run in the fallback after the import) the title loads the world and plays. Five of five rows of that build loaded the world and played (one fresh world load from the main menu, four from a save inside the world; each walking 180 s with the HUD up), 2.6 FPS mean on the fresh load and 4.0-4.5 FPS warm, with no refusal; the hook ran 32 times per row. Without the change 2 of 2 world loads stopped. One earlier row that combined the hunk with a second, unrelated lab change aborted later on a different check (`a heap mirror's range is no longer write-watched`); the hunk cannot change which ranges are watched, and #6546 addresses that path. The first 16 fallback events of that run (the build's report stops at 16), all 8 MiB import windows, had `before` false because the range was not wholly watched before the import (`covered before 0`, the first walk was not made); none came from a failing walk. The same holds for the other rows of the job. So the title takes the branch that `CheckImportWindowOverUnwatchedPart` covers. Two notes, not blocking, in the direction of the third note of the cross-validation above: - In that branch the range leaves the watch whatever the import does, so the hook can run before the import, as it does for the import that does not stay watched. After the import the walk with the window compare is skipped (`!before`), so the hook collects the pages the import itself marked written (`4096 of 4096 scratch pages reported written at the import` in the probe line) as CPU writes, and `saveBeforeUnwatch` keeps the blocks they cover for the CPU unless `unchangedSinceBaseline` proves their bytes unchanged; an image over 1 MiB has no `generationBaseline` (`GenerationBaselineBytes`), so it cannot. Read from the code, not shown on a title. - A test of the whole flow (results pending over a surface, an import over a range with an unwatched block, the flush) passes with this PR on lavapipe. I have a follow-up ready for after this is merged: that test, the hook before the import in that branch, the same save for the other exit without the hook (`MarkWritten` excluding a block after a failed fresh collect, when the caller holds the GPU mutex), a unit test per exit and the debt entry sentence. AI-assisted: yes
LeandroLP23 commented 2026-10-16 00:34:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-16T00:34:21Z.


@AlxcBTW thanks, a second title (and a UE5 one) is good to have, and your trace matches the covered before 0 branch the test covers.

Agreed on both notes. Running the hook before the import in that branch avoids counting the import's own written pages as CPU writes, and the MarkWritten exit is the same gap. I'd keep this PR to the minimal fix that the three verifications ran on, so your follow-up after merge sounds right to me.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6205274328 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6308#issuecomment-6205274328). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-10-16T00:34:21Z. --- @AlxcBTW thanks, a second title (and a UE5 one) is good to have, and your trace matches the `covered before 0` branch the test covers. Agreed on both notes. Running the hook before the import in that branch avoids counting the import's own written pages as CPU writes, and the `MarkWritten` exit is the same gap. I'd keep this PR to the minimal fix that the three verifications ran on, so your follow-up after merge sounds right to me. AI-assisted: yes (Claude Code)
screamm commented 2026-10-16 08:22:08 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by screamm on 2026-10-16T08:22:08Z.


Rerun on current main 5d9dcc42d (which includes #5671), Windows 11 Pro 26220, NVIDIA GeForce RTX 4070 (596.21), WinLibs MinGW-w64 GCC 15.2, PR head 93df5c42a merged clean. ProsperoPuzzles PPSA99006, 150 s limit, no input:

Build Result
main 5d9dcc42d 2 of 2 stop at 13.4 s and 18.9 s, exit 0xC0000409
main + this PR alive at 150 s, 6616 frames
main + #6444 + this PR alive at 150 s, 5823 frames

The stop on main is still the same line, right after [gpu] storage image 0x21fc00000: guest memory changed while GPU results were pending; keeping the CPU's blocks (0x220800000 in the other run):

terminate called after throwing an instance of 'std::runtime_error'
  what():  AGC graphics: storing storage image results pending over memory outside the write watch without the guest bytes saved before them is not implemented

So #5671 did not change this stop here, and this PR still removes it. Frame dumps with the PR have a mean of 105.3 to 105.5, as in my earlier runs. The host was loaded by parallel builds, so I did not compare frame rates.

Not rerun today: the PR's tests and the suite (see my earlier comment), Linux.

Written with Claude Code assistance (validation by a subagent, reviewed in this session).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6211278537 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6308#issuecomment-6211278537). Originally posted by [screamm](https://github.com/screamm) on 2026-10-16T08:22:08Z. --- Rerun on current main `5d9dcc42d` (which includes #5671), Windows 11 Pro 26220, NVIDIA GeForce RTX 4070 (596.21), WinLibs MinGW-w64 GCC 15.2, PR head `93df5c42a` merged clean. ProsperoPuzzles PPSA99006, 150 s limit, no input: | Build | Result | |---|---| | main `5d9dcc42d` | 2 of 2 stop at 13.4 s and 18.9 s, exit `0xC0000409` | | main + this PR | alive at 150 s, 6616 frames | | main + #6444 + this PR | alive at 150 s, 5823 frames | The stop on main is still the same line, right after `[gpu] storage image 0x21fc00000: guest memory changed while GPU results were pending; keeping the CPU's blocks` (`0x220800000` in the other run): terminate called after throwing an instance of 'std::runtime_error' what(): AGC graphics: storing storage image results pending over memory outside the write watch without the guest bytes saved before them is not implemented So #5671 did not change this stop here, and this PR still removes it. Frame dumps with the PR have a mean of 105.3 to 105.5, as in my earlier runs. The host was loaded by parallel builds, so I did not compare frame rates. Not rerun today: the PR's tests and the suite (see my earlier comment), Linux. Written with Claude Code assistance (validation by a subagent, reviewed in this session).
nicolasfalesy commented 2026-10-16 08:52:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by nicolasfalesy on 2026-10-16T08:52:34Z.


Tested on Linux (Arch), c++ (GCC) 16.2.1 20260810, Release, BUILD_TESTING=ON, main at 5d9dcc42d2ec5401aebd089028b8d4d7410a77b4.

This PR and #6169 do not compile together. Each one builds GuestMemory.cpp alone on main. Merged together, in either order, it fails (2 of 2 for each order):

GuestMemory.cpp:1404:14: error: 'class AgcDriver::GuestMemory::{anonymous}::TrackerLock' has no member named 'unlock'; did you mean 'Unlock'?
GuestMemory.cpp:1406:14: error: 'std::unique_lock<std::mutex> AgcDriver::GuestMemory::{anonymous}::TrackerLock::lock' is private within this context
GuestMemory.cpp:1406:18: error: no match for call to '(std::unique_lock<std::mutex>) ()'

Cause: #6169 turns lockTracker into a TrackerLock class (GuestMemory.cpp:1018 on its head). It has Unlock() and no way to take the mutex again, and its lock member is private. The new fallback in this PR (GuestMemory.cpp:1349 and :1351) calls lock.unlock(); beforeUnwatch(...); lock.lock();.

Whichever of the two lands second has to adapt. A fix would be a Lock() method on TrackerLock that takes the mutex again, and lock.Unlock() / lock.Lock() in this fallback.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6211820475 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6308#issuecomment-6211820475). Originally posted by [nicolasfalesy](https://github.com/nicolasfalesy) on 2026-10-16T08:52:34Z. --- Tested on Linux (Arch), `c++ (GCC) 16.2.1 20260810`, Release, `BUILD_TESTING=ON`, `main` at `5d9dcc42d2ec5401aebd089028b8d4d7410a77b4`. This PR and #6169 do not compile together. Each one builds `GuestMemory.cpp` alone on `main`. Merged together, in either order, it fails (2 of 2 for each order): ``` GuestMemory.cpp:1404:14: error: 'class AgcDriver::GuestMemory::{anonymous}::TrackerLock' has no member named 'unlock'; did you mean 'Unlock'? GuestMemory.cpp:1406:14: error: 'std::unique_lock<std::mutex> AgcDriver::GuestMemory::{anonymous}::TrackerLock::lock' is private within this context GuestMemory.cpp:1406:18: error: no match for call to '(std::unique_lock<std::mutex>) ()' ``` Cause: #6169 turns `lockTracker` into a `TrackerLock` class (`GuestMemory.cpp:1018` on its head). It has `Unlock()` and no way to take the mutex again, and its `lock` member is private. The new fallback in this PR (`GuestMemory.cpp:1349` and `:1351`) calls `lock.unlock(); beforeUnwatch(...); lock.lock();`. Whichever of the two lands second has to adapt. A fix would be a `Lock()` method on `TrackerLock` that takes the mutex again, and `lock.Unlock()` / `lock.Lock()` in this fallback. AI-assisted: yes
LeandroLP23 commented 2026-10-16 08:59:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-16T08:59:02Z.


@nicolasfalesy thanks, that's a real conflict. If #6169 lands first, I'll rebase this onto it with a Lock() on TrackerLock and lock.Unlock() / lock.Lock() around beforeUnwatch in the fallback, as you suggest. If this lands first, #6169 needs the same Lock() for this call site. @screamm thanks for the rerun on current main; it confirms #5671 alone doesn't reach this path.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6211926124 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6308#issuecomment-6211926124). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-10-16T08:59:02Z. --- @nicolasfalesy thanks, that's a real conflict. If #6169 lands first, I'll rebase this onto it with a `Lock()` on `TrackerLock` and `lock.Unlock()` / `lock.Lock()` around `beforeUnwatch` in the fallback, as you suggest. If this lands first, #6169 needs the same `Lock()` for this call site. @screamm thanks for the rerun on current `main`; it confirms #5671 alone doesn't reach this path. AI-assisted: yes (Claude Code)
parl0v commented 2026-10-16 15:40:16 +00:00 (Migrated from github.com)

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


A second Windows machine for this: RTX 4060 8 GB (NVIDIA 617.42), i5-14400F, Windows 10 19045, Minecraft Dungeons II (PPSA16064 01.100.100). Every world load I ran today had this PR in it (main 5d9dcc42d + this PR + other open PRs, scripted from boot to the first world): 151 first-world loads, 136 reached the HUD. None stopped with the storing storage image results pending over memory outside the write watch abort the world load hits on main.

What did stop the others, for completeness: two out-of-memory aborts with an oversized APS5_TEXTURE_CACHE_MIB (host heap full, see #6553), seven aborts by Unreal itself at the start of the world load (LowLevelFatalError, five of them FMallocBinned3 Attempt to free an unrecognized pointer 3c00000000000000, also seen on a second machine and under investigation on AlxcBTW/AnyPS5#56; nothing ties them to this PR), and rows I stopped myself.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6219054690 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6308#issuecomment-6219054690). Originally posted by [parl0v](https://github.com/parl0v) on 2026-10-16T15:40:16Z. --- A second Windows machine for this: RTX 4060 8 GB (NVIDIA 617.42), i5-14400F, Windows 10 19045, Minecraft Dungeons II (PPSA16064 01.100.100). Every world load I ran today had this PR in it (`main` 5d9dcc42d + this PR + other open PRs, scripted from boot to the first world): 151 first-world loads, 136 reached the HUD. None stopped with the `storing storage image results pending over memory outside the write watch` abort the world load hits on `main`. What did stop the others, for completeness: two out-of-memory aborts with an oversized `APS5_TEXTURE_CACHE_MIB` (host heap full, see #6553), seven aborts by Unreal itself at the start of the world load (`LowLevelFatalError`, five of them `FMallocBinned3 Attempt to free an unrecognized pointer 3c00000000000000`, also seen on a second machine and under investigation on AlxcBTW/AnyPS5#56; nothing ties them to this PR), and rows I stopped myself. AI-assisted: yes (Claude Code)
LeandroLP23 commented 2026-10-18 08:14:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-18T08:14:41Z.


Still needed on current main 1c523bdb4, after #6455 merged. ProsperoPuzzles (PPSA99006 01.000.010), Radeon 860M (driver 32.0.13058.8001, Windows 11 26300), WinLibs GCC 15.2.0, Release, two 60 s runs each (first with empty AnyPS5 shader cache, second warm), tools/title_run.py from #7264:

Build Cold Warm FPS
main 1c523bdb4 crashed crashed 0.0
main 1c523bdb4 + this PR (48a1d3453) rendering rendering 29.2

Both main runs stop on AGC graphics: storing storage image results pending over memory outside the write watch without the guest bytes. The merge of this PR onto main is clean.

AI-assisted

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6247520724 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6308#issuecomment-6247520724). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-10-18T08:14:41Z. --- Still needed on current `main` `1c523bdb4`, after #6455 merged. ProsperoPuzzles (PPSA99006 01.000.010), Radeon 860M (driver 32.0.13058.8001, Windows 11 26300), WinLibs GCC 15.2.0, Release, two 60 s runs each (first with empty AnyPS5 shader cache, second warm), `tools/title_run.py` from #7264: | Build | Cold | Warm | FPS | |---|---|---|---| | `main` `1c523bdb4` | crashed | crashed | 0.0 | | `main` `1c523bdb4` + this PR (`48a1d3453`) | rendering | rendering | 29.2 | Both `main` runs stop on `AGC graphics: storing storage image results pending over memory outside the write watch without the guest bytes`. The merge of this PR onto `main` is clean. AI-assisted
ionut27001 commented 2026-10-19 03:26:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ionut27001 on 2026-10-19T03:26:28Z.


Marvel's Wolverine (PPSA03671) stops on this Require on current main, and every run with this PR got past it.

Setup: Windows 11 Pro 26300, RTX 4080 SUPER 16 GB (NVIDIA 617.42), Ryzen 7 5800X3D, 32 GB RAM, WinLibs GCC 15.2.0 r7, Release. Content 01.001.005; eboot.bin and its three modules unwrapped with tools/unwrap_self.py and converted with relinker --windows --module-dir .. Base: main f3059421f + #6901 (8cd400aa4), which the title needs to load. Every run is the same scene, the "Sony Interactive Entertainment presents" card, with no input, a shader cache from earlier runs and APS5_PROFILE_DRAW=1.

  • Without this PR: 11 of 11 runs aborted between 419 and 620 s, all on the same shader (the base twice, and the base plus one of #6473, #6194, #6340, #6223, #6937, #6417, #7395, #6472 or #6313):
    terminate called after throwing an instance of 'std::runtime_error'
      what():  compute shader 0x11d03f7900: AGC graphics: storing storage image results pending over memory outside the write watch without the guest bytes saved before them is not implemented
    
    Each of the two base runs also printed 658 [textures] sampled texture ... keeps the snapshot path: AGC graphics: storing storage image results pending over memory outside the write watch ... lines.
  • With this PR (48a1d3453) merged on the same base: 5 of 5 runs reached the 900 s limit without the abort and printed none of those lines. That is this PR alone (1 run), with #7432 (1), with #7048 (1) and with both (2).

Not checked: anything past the splash card, Linux.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6258988580 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6308#issuecomment-6258988580). Originally posted by [ionut27001](https://github.com/ionut27001) on 2026-10-19T03:26:28Z. --- Marvel's Wolverine (PPSA03671) stops on this `Require` on current `main`, and every run with this PR got past it. Setup: Windows 11 Pro 26300, RTX 4080 SUPER 16 GB (NVIDIA 617.42), Ryzen 7 5800X3D, 32 GB RAM, WinLibs GCC 15.2.0 r7, Release. Content 01.001.005; `eboot.bin` and its three modules unwrapped with `tools/unwrap_self.py` and converted with `relinker --windows --module-dir .`. Base: `main` f3059421f + #6901 (8cd400aa4), which the title needs to load. Every run is the same scene, the "Sony Interactive Entertainment presents" card, with no input, a shader cache from earlier runs and `APS5_PROFILE_DRAW=1`. - Without this PR: 11 of 11 runs aborted between 419 and 620 s, all on the same shader (the base twice, and the base plus one of #6473, #6194, #6340, #6223, #6937, #6417, #7395, #6472 or #6313): ``` terminate called after throwing an instance of 'std::runtime_error' what(): compute shader 0x11d03f7900: AGC graphics: storing storage image results pending over memory outside the write watch without the guest bytes saved before them is not implemented ``` Each of the two base runs also printed 658 `[textures] sampled texture ... keeps the snapshot path: AGC graphics: storing storage image results pending over memory outside the write watch ...` lines. - With this PR (48a1d3453) merged on the same base: 5 of 5 runs reached the 900 s limit without the abort and printed none of those lines. That is this PR alone (1 run), with #7432 (1), with #7048 (1) and with both (2). Not checked: anything past the splash card, Linux. AI-assisted: yes
oneandonlydean commented 2026-10-20 07:07:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-20T07:07:43Z.


Thanks for this and for the title reports. #8172 (the fix for #8103) has now merged and rewrites the staysWatched path of ImportWatched: a range that is only partly watched is now split into runs of covered 64 KiB blocks, those blocks stay watched, and only the gaps plus any span whose walk fails are unwatched. That removes the most common way this fallback was reached (a partly watched range used to unwatch the whole range), so the stop you saw may already be gone on #8172. Could you rerun the titles you reported on current main (which has #8172) without this PR and say whether the Require still triggers?

Either way, the hook is still missing on the path that remains: on #8172, a covered span whose CPU walk fails before the import (dropped before runImport) or whose window walk fails after it is unwatched by unwatchLocked without beforeUnwatch, so pending storage-image results over it aren't saved. Could you rebase onto main and reduce this PR to that:

  1. For spans dropped because the walk before the import failed, run beforeUnwatch on them before runImport (with the tracker lock released, as you do now). #7505's "save early" idea fits here: the bytes are saved before the import can change them.
  2. For spans whose window walk fails after the import, run beforeUnwatch on them before they're unwatched (same lock release).
  3. Rewrite the test to #8172's semantics: a partly watched import now KEEPS its watched blocks watched, so the old assertion that they get unwatched no longer holds. Instead, make a covered block fail its walk (a CPU write before the import, or a write inside the import window) with a storage result pending over it, and check that the hook ran and the bytes were saved.

#7505 (@AlxcBTW) contains this PR plus the save-early change, so it'd be simplest to land one combined PR. Please agree between you which branch carries it.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6285422768 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6308#issuecomment-6285422768). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-20T07:07:43Z. --- Thanks for this and for the title reports. #8172 (the fix for #8103) has now merged and rewrites the `staysWatched` path of `ImportWatched`: a range that is only partly watched is now split into runs of covered 64 KiB blocks, those blocks stay watched, and only the gaps plus any span whose walk fails are unwatched. That removes the most common way this fallback was reached (a partly watched range used to unwatch the whole range), so the stop you saw may already be gone on #8172. Could you rerun the titles you reported on current main (which has #8172) without this PR and say whether the `Require` still triggers? Either way, the hook is still missing on the path that remains: on #8172, a covered span whose CPU walk fails before the import (dropped before `runImport`) or whose window walk fails after it is unwatched by `unwatchLocked` without `beforeUnwatch`, so pending storage-image results over it aren't saved. Could you rebase onto main and reduce this PR to that: 1. For spans dropped because the walk before the import failed, run `beforeUnwatch` on them before `runImport` (with the tracker lock released, as you do now). #7505's "save early" idea fits here: the bytes are saved before the import can change them. 2. For spans whose window walk fails after the import, run `beforeUnwatch` on them before they're unwatched (same lock release). 3. Rewrite the test to #8172's semantics: a partly watched import now KEEPS its watched blocks watched, so the old assertion that they get unwatched no longer holds. Instead, make a covered block fail its walk (a CPU write before the import, or a write inside the import window) with a storage result pending over it, and check that the hook ran and the bytes were saved. #7505 (@AlxcBTW) contains this PR plus the save-early change, so it'd be simplest to land one combined PR. Please agree between you which branch carries it.
LeandroLP23 commented 2026-10-20 07:18:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-20T07:18:40Z.


Rechecked on current main e9cc4a8ef. That tree includes #7432, which fixes another path to the same refusal. This branch (48a1d3453) still merges cleanly.

ProsperoPuzzles (PPSA99006):

Tree Runs alive at 60 s
main 0 of 2: stops at about 4 s with the write-back refusal
main + this PR 3 of 3

main + #7048 still stops at 3 s (0 of 3), so this path isn't covered elsewhere. Same setup as the description: AMD Radeon 860M, Windows 11, Release, new run folder each time, 60 s, no input.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6285586707 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6308#issuecomment-6285586707). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-10-20T07:18:40Z. --- Rechecked on current `main` e9cc4a8ef. That tree includes #7432, which fixes another path to the same refusal. This branch (48a1d3453) still merges cleanly. ProsperoPuzzles (PPSA99006): | Tree | Runs alive at 60 s | |---|---| | `main` | 0 of 2: stops at about 4 s with the write-back refusal | | `main` + this PR | 3 of 3 | `main` + #7048 still stops at 3 s (0 of 3), so this path isn't covered elsewhere. Same setup as the description: AMD Radeon 860M, Windows 11, Release, new run folder each time, 60 s, no input.
LeandroLP23 commented 2026-10-20 11:52:51 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-20T11:52:51Z.


Superseded by #8172, so I'm closing this. Data is in #6301: ProsperoPuzzles stops at 4 s on #8172's parent (e9cc4a8ef, 0 of 2 alive at 60 s), and runs with #8172 (2 of 2) and on current main d50ec76da (3 of 3).

With #8172, a stays-watched import keeps the spans that were watched before it. A span leaves the watch only when the walk after the import fails (walkWrites with the window), and that unwatchLocked still runs without beforeUnwatch. That's the same kind of gap this PR closed, but I have no title or test that reaches an incomplete collection there. If you'd like the hook on that path anyway, say so and I'll rebase this onto #8172's structure: collect the spans to unwatch, run the hook outside the tracker lock, then unwatch them, as MarkWritten does.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6290226545 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6308#issuecomment-6290226545). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-10-20T11:52:51Z. --- Superseded by #8172, so I'm closing this. Data is in #6301: ProsperoPuzzles stops at 4 s on #8172's parent (e9cc4a8ef, 0 of 2 alive at 60 s), and runs with #8172 (2 of 2) and on current `main` d50ec76da (3 of 3). With #8172, a stays-watched import keeps the spans that were watched before it. A span leaves the watch only when the walk after the import fails (`walkWrites` with the window), and that `unwatchLocked` still runs without `beforeUnwatch`. That's the same kind of gap this PR closed, but I have no title or test that reaches an incomplete collection there. If you'd like the hook on that path anyway, say so and I'll rebase this onto #8172's structure: collect the spans to unwatch, run the hook outside the tracker lock, then unwatch them, as `MarkWritten` does. AI-assisted: yes (Claude Code)
screamm commented 2026-10-20 14:21:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by screamm on 2026-10-20T14:21:15Z.


ProsperoPuzzles (PPSA99006) on main 1d4164552 (includes #8172, d9df34d08), without this PR: Windows 11 Pro 26220, RTX 4070 (596.21), WinLibs GCC 15.2.0 r7, Release, --windows, new run folder each run, no input. 3 of 3 runs were still alive at the 150 s kill (7581, 8281 and 7575 frames, about 50-55 fps at the end), and none logged the write-watch Require refusal or terminate called. On the earlier main c9e6c45de the same title stopped at about 7 s with 0xC0000409 on that refusal (reported above on 93df5c42a). So on current main the Require no longer triggers for this title here.

Written with Claude Code assistance.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6293078419 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6308#issuecomment-6293078419). Originally posted by [screamm](https://github.com/screamm) on 2026-10-20T14:21:15Z. --- ProsperoPuzzles (PPSA99006) on `main` `1d4164552` (includes #8172, `d9df34d08`), without this PR: Windows 11 Pro 26220, RTX 4070 (596.21), WinLibs GCC 15.2.0 r7, Release, `--windows`, new run folder each run, no input. 3 of 3 runs were still alive at the 150 s kill (7581, 8281 and 7575 frames, about 50-55 fps at the end), and none logged the write-watch `Require` refusal or `terminate called`. On the earlier `main` `c9e6c45de` the same title stopped at about 7 s with 0xC0000409 on that refusal (reported above on `93df5c42a`). So on current `main` the `Require` no longer triggers for this title here. Written with Claude Code assistance.

Pull request closed

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!6308
No description provided.