fix(agc): save pending storage results in every 64 KiB block that leaves the write watch #5671

Merged
oneandonlydean merged 1 commit from upstream-pr/5671 into main 2026-10-15 12:13:49 +00:00
oneandonlydean commented 2026-10-14 05:51:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T05:51:47Z.


What

Follow-up to #5657, for the throw still reported in #361 on Disney Epic Mickey: Rebrushed (PPSA15657) by @johnmaia:

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

On Windows a range leaves the write watch in whole 64 KiB blocks (WriteWatchCoverage::Exclude), but the unwatch hook from #5657 got the page range of the import. An image with results pending in the same block as an imported page, but outside that page, lost the watch without its guest bytes being saved. Its next store threw.

WriteWatchCoverage::ExcludedSpan returns the blocks Exclude drops, using the same block math. On Windows the hook gets that span, so every image with results pending in those blocks saves its bytes first. Linux drops the watch per page, so it is unchanged.

This covers one of the remaining paths to the throw. The trace requested in #361 will confirm whether it is the one PPSA15657 takes.

Tested

Linux (CachyOS, GCC 16.2.1, RTX 4090), Release, BUILD_TESTING=ON, on main f74ec639c:

  • agc_write_watch_coverage: new checks of ExcludedSpan for a single page, a block boundary, the last partial block and the arena start.
  • agc_driver_store_over_untracked: new case where the page before a linear surface is imported, so the surface's first block leaves the watch. It fails on Windows main: the hook range does not overlap the surface. On Linux it passes before and after, because the watch drops only the page there. Windows CI runs it.
  • ctest -R "agc_|guest_memory|write_watch": 500 of 501 pass. agc_driver_bc_block_copy fails the same way on main.
  • With APS5_WRITE_WATCH_IMPORTS=unwatch: store_over_untracked, recorded_kept_bytes, write_watch, guest_memory all pass.
  • tools/check_conventions.py passes.

Not run on Windows or with the title.

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: PPSA15657 #361 (one of the remaining paths)
  • GPUs tested: NVIDIA RTX 4090, Linux
  • AI-assisted: yes (Claude Code)
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4853585693 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5671). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-14T05:51:47Z. --- ### What Follow-up to #5657, for the throw still reported in #361 on Disney Epic Mickey: Rebrushed (PPSA15657) by @johnmaia: ``` AGC graphics: storing storage image results pending over memory outside the write watch without the guest bytes saved before them is not implemented ``` On Windows a range leaves the write watch in whole 64 KiB blocks (`WriteWatchCoverage::Exclude`), but the unwatch hook from #5657 got the page range of the import. An image with results pending in the same block as an imported page, but outside that page, lost the watch without its guest bytes being saved. Its next store threw. `WriteWatchCoverage::ExcludedSpan` returns the blocks `Exclude` drops, using the same block math. On Windows the hook gets that span, so every image with results pending in those blocks saves its bytes first. Linux drops the watch per page, so it is unchanged. This covers one of the remaining paths to the throw. The trace requested in #361 will confirm whether it is the one PPSA15657 takes. ### Tested Linux (CachyOS, GCC 16.2.1, RTX 4090), Release, `BUILD_TESTING=ON`, on `main` f74ec639c: - `agc_write_watch_coverage`: new checks of `ExcludedSpan` for a single page, a block boundary, the last partial block and the arena start. - `agc_driver_store_over_untracked`: new case where the page before a linear surface is imported, so the surface's first block leaves the watch. It fails on Windows `main`: the hook range does not overlap the surface. On Linux it passes before and after, because the watch drops only the page there. Windows CI runs it. - `ctest -R "agc_|guest_memory|write_watch"`: 500 of 501 pass. `agc_driver_bc_block_copy` fails the same way on `main`. - With `APS5_WRITE_WATCH_IMPORTS=unwatch`: `store_over_untracked`, `recorded_kept_bytes`, `write_watch`, `guest_memory` all pass. - `tools/check_conventions.py` passes. Not run on Windows or with the title. ### 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: PPSA15657 #361 (one of the remaining paths) - [x] GPUs tested: NVIDIA RTX 4090, Linux - [x] AI-assisted: yes (Claude Code)
MarcZX10 commented 2026-10-14 05:53:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-14T05:53:38Z.


Validation check: the description says “Windows CI runs it,” but the current PR check list reports the Windows job as skipped. The reproducer is specifically about Windows 64 KiB write-watch blocks, and the local Linux run is expected to pass both before and after the change. Could you run agc_driver_store_over_untracked on Windows, or clarify that this Windows-only regression still awaits CI/manual validation?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6161904891 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5671#issuecomment-6161904891). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-14T05:53:38Z. --- Validation check: the description says “Windows CI runs it,” but the current PR check list reports the Windows job as skipped. The reproducer is specifically about Windows 64 KiB write-watch blocks, and the local Linux run is expected to pass both before and after the change. Could you run `agc_driver_store_over_untracked` on Windows, or clarify that this Windows-only regression still awaits CI/manual validation?
oneandonlydean commented 2026-10-14 05:59:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T05:59:27Z.


This covers one of the paths left after #5657: on Windows the write watch is dropped in whole 64 KiB blocks, and now every pending storage image in those blocks has its guest bytes saved. It needs a Windows run before it goes in. @johnmaia could you try Epic Mickey (PPSA15657) on this head with the same steps? @AlxcBTW the same for Sword of the Sea (PPSA25344), since it hit the same throw. Please post where it gets to, and the throw if it still happens (with APS5_TRACE_FLUSH=1 APS5_TRACE_HOST_IMPORT=1 APS5_TRACE_MEMORY=1 if you can).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6161974773 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5671#issuecomment-6161974773). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-14T05:59:27Z. --- This covers one of the paths left after #5657: on Windows the write watch is dropped in whole 64 KiB blocks, and now every pending storage image in those blocks has its guest bytes saved. It needs a Windows run before it goes in. @johnmaia could you try Epic Mickey (PPSA15657) on this head with the same steps? @AlxcBTW the same for Sword of the Sea (PPSA25344), since it hit the same throw. Please post where it gets to, and the throw if it still happens (with `APS5_TRACE_FLUSH=1 APS5_TRACE_HOST_IMPORT=1 APS5_TRACE_MEMORY=1` if you can).
johnmaia commented 2026-10-14 06:57:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by johnmaia on 2026-10-14T06:57:48Z.


PPSA15657 (Epic Mickey: Rebrushed) on this PR: Windows 11, RTX 4080, head 9190e9541 merged into main d8888df9b, game relinked with that build, same steps as on #5657 (title, Continue into Dark Beauty Castle).

The storage-results throw from #5657 is gone. At the same point, 17 s after Continue, the game now faults on a null read in its own code:

FATAL: unhandled exception 0xc0000005
  rip app.exe+0x1b3fd0d          (eboot 0x1b2fd0d)
  read of 0x0000000000000000
  rax 0 rcx 0 rdx 0 rsi 0 rdi 0
  r13 = r14 = r15 = 0x204d700000, whose first 64 bytes read as zero
Build Result
main d8888df9b storage-results throw 17 s after Continue (trace on #5657)
main d8888df9b + this PR null read at eboot 0x1b2fd0d, 17 s after Continue
main a31043146 with #5596 reverted level loaded, 10 min, no fault

One run each, so I can't rule out the fault being intermittent. The zeroed guest memory at 0x204d700000 might be data the title expected to find stored, but I haven't confirmed which image or buffer covers it.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6162762804 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5671#issuecomment-6162762804). Originally posted by [johnmaia](https://github.com/johnmaia) on 2026-10-14T06:57:48Z. --- PPSA15657 (Epic Mickey: Rebrushed) on this PR: Windows 11, RTX 4080, head 9190e9541 merged into `main` d8888df9b, game relinked with that build, same steps as on #5657 (title, Continue into Dark Beauty Castle). The storage-results throw from #5657 is gone. At the same point, 17 s after Continue, the game now faults on a null read in its own code: ``` FATAL: unhandled exception 0xc0000005 rip app.exe+0x1b3fd0d (eboot 0x1b2fd0d) read of 0x0000000000000000 rax 0 rcx 0 rdx 0 rsi 0 rdi 0 r13 = r14 = r15 = 0x204d700000, whose first 64 bytes read as zero ``` | Build | Result | |---|---| | `main` d8888df9b | storage-results throw 17 s after Continue (trace on #5657) | | `main` d8888df9b + this PR | null read at eboot 0x1b2fd0d, 17 s after Continue | | `main` a31043146 with #5596 reverted | level loaded, 10 min, no fault | One run each, so I can't rule out the fault being intermittent. The zeroed guest memory at 0x204d700000 might be data the title expected to find stored, but I haven't confirmed which image or buffer covers it. AI-assisted: yes (Claude Code)
tibzejoker commented 2026-10-14 08:30:00 +00:00 (Migrated from github.com)

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


Runs for this PR at head 9190e9541. Windows 11, MinGW-w64 GCC 15.2.0 Release, two GPUs in one machine: Intel UHD Graphics 770 (driver 32.0.101.6129, picked with ANYPS5_GPU=Intel) and RTX 4090 (NVIDIA 616.92).

  • The tests built from this PR's changed test files (agc_driver_store_over_untracked, agc_write_watch_coverage) pass on both GPUs.
  • ctest -R "agc_driver|agc_masked|agc_shader" -j4: no failures on either GPU. Intel: 396 tests, 28 skipped. NVIDIA: 396 tests, 1 skipped (agc_driver_stencil_ref_export). The skips are the same as on main with each GPU. On the UHD 770 they are features it doesn't support: f64, 64-bit and float atomics, mesh shaders, fp16 interpolation and dot, shader clock.

No difference between the two GPUs.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6164223434 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5671#issuecomment-6164223434). Originally posted by [tibzejoker](https://github.com/tibzejoker) on 2026-10-14T08:30:00Z. --- Runs for this PR at head `9190e9541`. Windows 11, MinGW-w64 GCC 15.2.0 Release, two GPUs in one machine: Intel UHD Graphics 770 (driver 32.0.101.6129, picked with `ANYPS5_GPU=Intel`) and RTX 4090 (NVIDIA 616.92). - The tests built from this PR's changed test files (`agc_driver_store_over_untracked`, `agc_write_watch_coverage`) pass on both GPUs. - `ctest -R "agc_driver|agc_masked|agc_shader" -j4`: no failures on either GPU. Intel: 396 tests, 28 skipped. NVIDIA: 396 tests, 1 skipped (`agc_driver_stencil_ref_export`). The skips are the same as on `main` with each GPU. On the UHD 770 they are features it doesn't support: f64, 64-bit and float atomics, mesh shaders, fp16 interpolation and dot, shader clock. No difference between the two GPUs. AI-assisted (Claude Code).
simonbronk commented 2026-10-14 08:59:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by simonbronk on 2026-10-14T08:59:23Z.


AMD and NVIDIA runs for this PR at head 9190e9541. Windows 11 Pro 26200, WinLibs GCC 15.2.0 (MinGW-w64), Release, one machine with two GPUs, each picked with ANYPS5_GPU:

  • NVIDIA GeForce RTX 5070, driver 617.42 (32.0.16.1742)
  • AMD Radeon(TM) Graphics, Ryzen integrated, gfx1036 (1002:13c0, RDNA 2), driver 32.0.21036.18

ctest -R "agc|shader|video_out" -j 8 (515 tests, including the ones this PR adds or changes):

  • RTX 5070: all 515 pass.
  • AMD gfx1036: all pass except agc_driver_lds_mixed_width_atomics, agc_driver_pixel_interlock and agc_driver_layered_volume_vertex_no_gpl. These three fail the same way on current main (872f52320) on this GPU and pass there on the RTX 5070; they are the three of #5271, so not caused by this PR.

No title run. AI-assisted: yes (Claude Code ran the builds and tests).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6164725367 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5671#issuecomment-6164725367). Originally posted by [simonbronk](https://github.com/simonbronk) on 2026-10-14T08:59:23Z. --- AMD and NVIDIA runs for this PR at head `9190e9541`. Windows 11 Pro 26200, WinLibs GCC 15.2.0 (MinGW-w64), Release, one machine with two GPUs, each picked with `ANYPS5_GPU`: - NVIDIA GeForce RTX 5070, driver 617.42 (32.0.16.1742) - AMD Radeon(TM) Graphics, Ryzen integrated, gfx1036 (`1002:13c0`, RDNA 2), driver 32.0.21036.18 `ctest -R "agc|shader|video_out" -j 8` (515 tests, including the ones this PR adds or changes): - RTX 5070: all 515 pass. - AMD gfx1036: all pass except `agc_driver_lds_mixed_width_atomics`, `agc_driver_pixel_interlock` and `agc_driver_layered_volume_vertex_no_gpl`. These three fail the same way on current `main` (`872f52320`) on this GPU and pass there on the RTX 5070; they are the three of #5271, so not caused by this PR. No title run. AI-assisted: yes (Claude Code ran the builds and tests).
MarcZX10 commented 2026-10-14 19:04:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-14T19:04:21Z.


The PR description still says “Windows CI runs it,” while the current Windows job is skipped by path eligibility. Two independent Windows reports in this PR thread do validate head 9190e9541 on four GPUs, and the Epic Mickey result is also recorded as one run with an unresolved guest null read. Please consider updating the Tested section to reflect those contributor-run results and remove the CI claim; I couldn’t update the description because the PR is authored from your fork.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6176104388 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5671#issuecomment-6176104388). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-14T19:04:21Z. --- The PR description still says “Windows CI runs it,” while the current Windows job is skipped by path eligibility. Two independent Windows reports in this PR thread do validate head `9190e9541` on four GPUs, and the Epic Mickey result is also recorded as one run with an unresolved guest null read. Please consider updating the Tested section to reflect those contributor-run results and remove the CI claim; I couldn’t update the description because the PR is authored from your fork.
adriadam10 commented 2026-10-15 12:03:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-15T12:03:10Z.


Rebased onto current main: the only conflict was in StoreOverUntracked.cpp (main added NeighbourCopied, WaitForWork and the side parameter). I kept both cases, so the case list is now 9 entries. Rebuilt and re-ran agc_write_watch_coverage, agc_driver_store_over_untracked and agc_driver_recorded_kept_bytes on the result, also with APS5_WRITE_WATCH_IMPORTS=unwatch: all pass.

The Windows runs in this thread (@tibzejoker on Intel UHD 770 and RTX 4090, @simonbronk on RTX 5070 and AMD gfx1036) cover the Windows-only path, and @johnmaia confirms the throw is gone on PPSA15657. The description's "Windows CI runs it" is not accurate, since the Windows job is skipped on PRs; the merge goes through the full Windows build.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6191586631 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5671#issuecomment-6191586631). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-15T12:03:10Z. --- Rebased onto current `main`: the only conflict was in `StoreOverUntracked.cpp` (`main` added `NeighbourCopied`, `WaitForWork` and the `side` parameter). I kept both cases, so the case list is now 9 entries. Rebuilt and re-ran `agc_write_watch_coverage`, `agc_driver_store_over_untracked` and `agc_driver_recorded_kept_bytes` on the result, also with `APS5_WRITE_WATCH_IMPORTS=unwatch`: all pass. The Windows runs in this thread (@tibzejoker on Intel UHD 770 and RTX 4090, @simonbronk on RTX 5070 and AMD gfx1036) cover the Windows-only path, and @johnmaia confirms the throw is gone on PPSA15657. The description's "Windows CI runs it" is not accurate, since the Windows job is skipped on PRs; the merge goes through the full Windows build.
github-actions[bot] commented 2026-10-15 12:08:32 +00:00 (Migrated from github.com)

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


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#5708 core/libs/prx/libSceAgcDriver/tests/execution/StoreOverUntracked.cpp L213, L421, L429

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
#1747 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#1896 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#3891 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#4156 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#4396 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#4397 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#4422 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#4423 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#4424 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#4448 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#4520 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#4521 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#4522 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#4523 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#4566 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#4599 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#4718 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#4740 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#4749 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#4760 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#4813 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#5021 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#5867 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#6187 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#6188 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/tests/execution/StoreOverUntracked.cpp
#6192 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#6208 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#6209 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#6222 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#6300 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6191684678 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5671#issuecomment-6191684678). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-15T12:08:32Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | #5708 | `core/libs/prx/libSceAgcDriver/tests/execution/StoreOverUntracked.cpp` [L213](https://github.com/boykopovar/AnyPS5/blob/34454bd835ce334c3c395467da50546b433fe200/core/libs/prx/libSceAgcDriver/tests/execution/StoreOverUntracked.cpp#L213), [L421](https://github.com/boykopovar/AnyPS5/blob/34454bd835ce334c3c395467da50546b433fe200/core/libs/prx/libSceAgcDriver/tests/execution/StoreOverUntracked.cpp#L421), [L429](https://github.com/boykopovar/AnyPS5/blob/34454bd835ce334c3c395467da50546b433fe200/core/libs/prx/libSceAgcDriver/tests/execution/StoreOverUntracked.cpp#L429) | | | 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 | |---|---| | #1747 | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | #1896 | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | #3891 | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | #4156 | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | #4396 | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | #4397 | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | #4422 | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | #4423 | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | #4424 | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | #4448 | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | #4520 | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | #4521 | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | #4522 | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | #4523 | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | #4566 | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | #4599 | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | #4718 | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | #4740 | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | #4749 | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | #4760 | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | #4813 | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | #5021 | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | #5867 | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | #6187 | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | #6188 | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/execution/StoreOverUntracked.cpp` | | #6192 | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | #6208 | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | #6209 | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | #6222 | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | #6300 | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` |
SleglJan commented 2026-10-15 12:55:26 +00:00 (Migrated from github.com)

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


The case this PR added, "a surface whose first block left the write watch with the page before it", fails on Linux:

AGC graphics: store over untracked: the result did not reach a block the CPU left alone
  • main 3ee537191; Linux 7.2.10 (CachyOS), RTX 3080 with NVIDIA 615.78.08, GCC 16.2.1, Release, BUILD_TESTING=ON. Reproduce: APS5_WRITE_WATCH_IMPORTS=watch ctest -R '^agc_driver_store_over_untracked$' --output-on-failure.
  • With APS5_WRITE_WATCH_IMPORTS=watch, and with probe, it fails in 3 of 3 runs each. On this machine the probe keeps imports watched: [write-watch] host imports resolve write protection: no (...); imported ranges stay watched.
  • With watch or probe, the eight cases before it print nothing. The last surface made is the linear one (tile=0) that only this case uses, and the log has [gpu] storage image <surface> destroyed with GPU results pending right before the failure.
  • With APS5_WRITE_WATCH_IMPORTS=unwatch the case reports "not run, the surface is not write-watched".
  • The PR's change to beforeUnwatch applies only on Windows (#ifdef _WIN32); the new case also runs on Linux.
  • With unwatch, 2 of 3 runs then fail in RunSecondStore at "the first result was not stored", the assertion #6347 reports on Windows. Since this PR that surface is linear as well (tile=0 in the log): surfaceTile is set only in Run(), and the last case leaves it at TileLinear.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6192561568 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5671#issuecomment-6192561568). Originally posted by [SleglJan](https://github.com/SleglJan) on 2026-10-15T12:55:26Z. --- The case this PR added, "a surface whose first block left the write watch with the page before it", fails on Linux: ``` AGC graphics: store over untracked: the result did not reach a block the CPU left alone ``` - `main` 3ee537191; Linux 7.2.10 (CachyOS), RTX 3080 with NVIDIA 615.78.08, GCC 16.2.1, Release, `BUILD_TESTING=ON`. Reproduce: `APS5_WRITE_WATCH_IMPORTS=watch ctest -R '^agc_driver_store_over_untracked$' --output-on-failure`. - With `APS5_WRITE_WATCH_IMPORTS=watch`, and with `probe`, it fails in 3 of 3 runs each. On this machine the probe keeps imports watched: `[write-watch] host imports resolve write protection: no (...); imported ranges stay watched`. - With `watch` or `probe`, the eight cases before it print nothing. The last surface made is the linear one (`tile=0`) that only this case uses, and the log has `[gpu] storage image <surface> destroyed with GPU results pending` right before the failure. - With `APS5_WRITE_WATCH_IMPORTS=unwatch` the case reports "not run, the surface is not write-watched". - The PR's change to `beforeUnwatch` applies only on Windows (`#ifdef _WIN32`); the new case also runs on Linux. - With `unwatch`, 2 of 3 runs then fail in `RunSecondStore` at "the first result was not stored", the assertion #6347 reports on Windows. Since this PR that surface is linear as well (`tile=0` in the log): `surfaceTile` is set only in `Run()`, and the last case leaves it at `TileLinear`. AI-assisted: yes (Claude Code)
milescoviello commented 2026-10-15 13:04:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-15T13:04:40Z.


agc_driver_store_over_untracked fails on main on Linux (Ubuntu 24.04, GCC 13.3, Release, RTX 4070 Ti, NVIDIA 595.99), every run since this merge:

AGC graphics: store over untracked: the result did not reach a block the CPU left alone

Bisecting the first-parent merges between 0afa6a607 (passes) and 71bd2876e: it passes 2 of 2 at d106eefb8 and fails 2 of 2 from e53927780 (this merge). It still fails 6 of 6 at e890b4a38, also with nothing else using the GPU.

Not checked, from reading the diff: the test now counts the new neighbour case as leaving the watch (leaves = ... || neighbour), so the check at StoreOverUntracked.cpp:410 expects its result in a block the CPU left alone. On Windows, ExcludedSpan drops the import's whole 64 KiB block. Under #else the hook still gets the import's page range, so on Linux the neighbouring page presumably stays watched and never takes that path. If so, neighbour would only count as leaving on Windows.

Update: my guess above was wrong. On Linux the failing case is NeighbourLeftWatch, and it passes 3/3 when NeighbourCopied is skipped. The failure comes from NeighbourCopied's early Missed returns, and #6385 fixes it (15/15 here, main fails 5/5). Details are on #6385.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6192744401 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5671#issuecomment-6192744401). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-10-15T13:04:40Z. --- `agc_driver_store_over_untracked` fails on `main` on Linux (Ubuntu 24.04, GCC 13.3, Release, RTX 4070 Ti, NVIDIA 595.99), every run since this merge: ``` AGC graphics: store over untracked: the result did not reach a block the CPU left alone ``` Bisecting the first-parent merges between 0afa6a607 (passes) and 71bd2876e: it passes 2 of 2 at d106eefb8 and fails 2 of 2 from e53927780 (this merge). It still fails 6 of 6 at e890b4a38, also with nothing else using the GPU. Not checked, from reading the diff: the test now counts the new `neighbour` case as leaving the watch (`leaves = ... || neighbour`), so the check at `StoreOverUntracked.cpp:410` expects its result in a block the CPU left alone. On Windows, `ExcludedSpan` drops the import's whole 64 KiB block. Under `#else` the hook still gets the import's page range, so on Linux the neighbouring page presumably stays watched and never takes that path. If so, `neighbour` would only count as leaving on Windows. **Update:** my guess above was wrong. On Linux the failing case is `NeighbourLeftWatch`, and it passes 3/3 when `NeighbourCopied` is skipped. The failure comes from `NeighbourCopied`'s early `Missed` returns, and #6385 fixes it (15/15 here, `main` fails 5/5). Details are on #6385. AI-assisted: yes
Amoenus commented 2026-10-15 13:22:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-15T13:22:43Z.


@SleglJan The RunSecondStore first-result assertion in your unwatch runs is the one tracked by #6347. #6359 changes its wait to require FindPending(address, SurfaceBytes) to equal the expected live image. With the old predicate, a diagnostic reports that image is not pending immediately before the assertion; the two-line correction passes100/100 on each of our Windows NVIDIA/AMD GPUs.

A tile reset alone was also tested on unchanged main2db: still5/5 first-result failures per GPU. That rules it out as the Windows fix, not as a Linux-specific factor. I have not reproduced your Linux runs. Your earlier neighboring-page result did not reach a block the CPU left alone failure occurs before this wait and remains separate; #6359 is not evidence that it fixes that case.

If you retest #6359 on Linux, please distinguish those two assertions and the watch/probe/unwatch modes. Exact Windows pins, controls and limits are in #6347. AI-assisted: Codex.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6193108600 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5671#issuecomment-6193108600). Originally posted by [Amoenus](https://github.com/Amoenus) on 2026-10-15T13:22:43Z. --- @SleglJan The `RunSecondStore` first-result assertion in your `unwatch` runs is the one tracked by #6347. #6359 changes its wait to require `FindPending(address, SurfaceBytes)` to equal the expected live image. With the old predicate, a diagnostic reports that image is not pending immediately before the assertion; the two-line correction passes100/100 on each of our Windows NVIDIA/AMD GPUs. A tile reset alone was also tested on unchanged main2db: still5/5 first-result failures per GPU. That rules it out as the Windows fix, not as a Linux-specific factor. I have not reproduced your Linux runs. Your earlier neighboring-page `result did not reach a block the CPU left alone` failure occurs before this wait and remains separate; #6359 is not evidence that it fixes that case. If you retest #6359 on Linux, please distinguish those two assertions and the watch/probe/unwatch modes. Exact Windows pins, controls and limits are in #6347. AI-assisted: Codex. <!-- codex-5671-distinct-failures-v1 -->
johnmaia commented 2026-10-15 17:02:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by johnmaia on 2026-10-15T17:02:16Z.


@oneandonlydean an update for PPSA15657 on Windows, now that this and #5679 #5321 #5522 are on main: on main 0029e62f9 (plus #6236 only to get past the PlayGo stop from #6205), Epic Mickey: Rebrushed loads its level and plays about 5 minutes, through a death and a checkpoint reload, on an RTX 4080. There's no storage-results throw (the log has no "storing storage image results pending ..." line) and no fault, including the null read at eboot 0x1b2fd0d from my earlier run. So the Windows regression from #5596 that I reported on #361 is resolved for this title. In the earlier runs the red-zone fault came about 3 minutes into play; this run reached about 5 minutes without it. That's one run, not a soak test.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6197688043 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5671#issuecomment-6197688043). Originally posted by [johnmaia](https://github.com/johnmaia) on 2026-10-15T17:02:16Z. --- @oneandonlydean an update for PPSA15657 on Windows, now that this and #5679 #5321 #5522 are on `main`: on `main` 0029e62f9 (plus #6236 only to get past the PlayGo stop from #6205), Epic Mickey: Rebrushed loads its level and plays about 5 minutes, through a death and a checkpoint reload, on an RTX 4080. There's no storage-results throw (the log has no "storing storage image results pending ..." line) and no fault, including the null read at eboot 0x1b2fd0d from my earlier run. So the Windows regression from #5596 that I reported on #361 is resolved for this title. In the earlier runs the red-zone fault came about 3 minutes into play; this run reached about 5 minutes without it. That's one run, not a soak test. AI-assisted: yes (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!5671
No description provided.