fix(agc): compare pending storage results over a surface whose page walk fails #12792

Open
EagleBearerYS wants to merge 17 commits from upstream-pr/12792 into main
EagleBearerYS commented 2026-10-29 09:26:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-29T09:26:30Z.


What

When a page walk over a storage image stops part way, the surface's collect returns 0 while the range stays watched. The walk also reports the rest of its range as written by the CPU. StorageTexture::Refresh then sees the 64 KiB units that hold GPU results as CPU-written newer than their generations. It drops them, re-uploads them from guest memory, and prints guest memory changed while GPU results were pending; keeping the CPU's blocks. The write-back leaves the same blocks to the CPU.

  • The fix: when the surface's own collect fails, the refresh (scanBlocks) and the write-back (writeBackLayers) no longer read the walk's synthetic stamps as CPU stores.
    • On Linux, a PAGEMAP_SCAN that fails has already written out the dirty regions it found before the failure and re-protected those pages. The new GuestWriteWatchCollectReporting_nid_postfix and GuestWriteWatchCollectArmedReporting_nid_postfix report those regions as written, and the range the walk didn't finish as unreached. The old collect calls are unchanged.
    • The tracker keeps, per page, the genuine CPU stamp that a failed walk would otherwise cover with its synthetic one. A new ChangedBlocks overload answers per 64 KiB block: known (today's stamps), CPU-confirmed (a genuine store after the block's generation) or unknown.
    • The refresh and the write-back keep the stamps of known blocks, leave a CPU-confirmed block to the CPU, and compare only the unknown blocks with the guest bytes saved at the upload or the previous store, as they already do for memory outside the watch. Without saved bytes, or when the query can't answer, they compare the whole surface, as before.
    • On the failed-walk path, the write-back also leaves a block the walk saw the CPU write to the CPU whatever its bytes, as the refresh already does.
    • This PR's first version compared the whole surface on a failed walk. As oneandonlydean, XairRrR and mashingaan pointed out, that loses a same-value CPU store in a block the walk did reach (see Tested).
  • What stays open, recorded in docs/dev/debt/libSceAgcDriver.md:
    • a same-value CPU store in a page the walk never reached is still lost, since that block is compared by bytes;
    • a unit with no saved bytes over a failed walk is handled as outside the watch, so storing it throws;
    • a failed walk of a larger range still stamps the blocks of a surface whose own collect succeeds;
    • a kernel that writes out no regions before its PAGEMAP_SCAN error leaves the whole range unreached (Linux 6.18 writes them);
    • on a complete walk, main's write-back leaves a stamped block to the CPU only when its bytes differ, so a same-value store made while results are pending is overwritten there. That's main's existing rule, in its own entry, and isn't changed here;
    • on Windows, a same-value CPU store followed by a direct write-back with no refresh is lost when the walk over a compared shared page is refused ("guest memory holds 8 results and 0 stored words" on an RTX 3070 Laptop GPU), so that case doesn't run on Windows. With a refresh, or with a store of a different value, the store is kept.
  • Credit: reported by @sktharunbalaji13-cmd in Ghost of Tsushima Director's Cut (PPSA02225) (#9742 comment, #5166 comment). They traced it to markLayersPending and Refresh, and they're co-author of the commit.
    • Their first change stamped the layer's generation at markLayersPending. That doesn't reach the loss: the refresh's own failed walk stamps the blocks newer again. It would also hide a CPU store made between a refresh and the pending mark. Case 3 below covers that.
    • This change compares instead.
  • Platforms: in the tests, this PR's effect is shown on Linux, where the walk is made to fail by remapping a watched page. I found no production Linux path that does that. On Windows, the test reaches a refused walk through a compared shared page, but the surface's other blocks are collected one block at a time and keep the CPU stores, so the Windows case passes on main and on this PR alike. On Windows the title run below is the evidence.

Tested

  • agc_driver_pending_untracked_layer (new):
    • Setup: a watched surface, real image_store dispatches, then a readback through image_load. It sets APS5_NO_HOST_IMPORT=1 itself, so lavapipe doesn't take the range off the watch with an import, and it skips (77) on Windows.

      case main this change
      1. results over a surface whose walk fails red: 0 of 8 results survive, line printed green
      2. the same, with a CPU store to another block while pending red: 0 of 8 results, the CPU word kept green
      3. a CPU store over a result word between a refresh and the pending mark, with the walk complete green green: the image sees the CPU word
      4. the same as 3, with the walk failing green green
    • Red/green on Linux (Ubuntu 24.04, GCC 13.3, lavapipe, Release): red at run 1 of --repeat until-fail:10 on main's Texture.cpp, and 10 of 10 direct runs fail. Green, 10 of 10.

  • ctest -R '^agc' on this change: 1,118 tests, 1,045 passed, 73 skipped, 0 failed.
  • Ghost of Tsushima Director's Cut (PPSA02225, v02.024.000), @sktharunbalaji13-cmd's run (comment). Windows 11, RTX 4060 Laptop, 240 s.
    • The stack: #9742, #9717, #10064, #10727, #12191, #12147, #7985, #12561, #12612 and #12617, with this commit in place of their local change. Ghost needs that stack to reach the scene, so the title line isn't shown on plain main.
    • The line: keeping the CPU's blocks went from every frame to 1 occurrence at allocation on 0x1500010000 (3840x2160 R16G16B16A16_SFLOAT), and 8 in the whole run (7 on 0x1504000000 during setup).
    • The frames: the disclaimer frames 087-089 render (white text on a dark background).
  • GitHub, ×10 on both runners, with the Khronos validation comparison on Linux (run 40868832489):
    • Linux: agc_driver_pending_untracked_layer passed 10 of 10 under validation. With it, the ^agc_storage and ^agc_driver_storage tests ran 21 tests: 20 passed and 1 skipped, agc_storage_clear_hand_over, since lavapipe makes no watched host import.
    • Validation: the layer loaded on both sides, and the only VUID on main and with this change is VUID-VkDeviceCreateInfo-pNext-pNext, for an extension structure the layer predates. The change adds none.
    • Windows runner: 22 tests built and ran, and all skip, since the runner has no Vulkan device.
    • Suites: the libc and libkernel suites, run with APS5_SKIP_TIMING_TESTS=1, pass: 191 and 291 tests on Linux, 220 and 314 on Windows.
    • The new test doesn't exist on main, so the runner's comparison arm has no red. The red is the Linux one above.
  • Checks: MinGW-w64 -fsyntax-only on Texture.cpp and the test gives no warning on the changed lines. check_conventions.py passes, with no comment lines added.
  • 5e106c566d, oneandonlydean's merge of main 88e804b0a7. The one conflict was in docs/dev/debt/libSceAgcDriver.md, where this PR's page-walk entry sits among main's new write-watch entries; both sides are kept. This PR's diff over main is unchanged. On GitHub's runners (run, on 7ed1db8f0d, the same merge with that entry one line higher), agc_driver_pending_untracked_layer and the ^agc_storage and ^agc_driver_storage tests ran 10 times with no failure. Linux: 24 run, 23 pass, 1 skip (agc_storage_clear_hand_over), 0 fail. Windows: 25 run, 0 pass, 25 skip (no Vulkan device), 0 fail. Suites: libc and libkernel pass on Linux (210 and 310) and on Windows (237 and 331). The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
  • 81ad915d78: a case that can't run no longer hides a failure, oneandonlydean's second point (comment). main() runs every case, requires that none came back Lost, and only then returns 77 if a case couldn't run. On GitHub's runners (run), agc_driver_pending_untracked_layer and the ^agc_driver_pending, ^agc_storage and ^agc_driver_storage tests ran 10 times with no failure. Linux: 25 run, 24 pass, 1 skip (agc_storage_clear_hand_over), 0 fail. Windows: 26 run, 0 pass, 26 skip (no Vulkan device), 0 fail. Suites: libc and libkernel pass on Linux (210 and 310) and on Windows (237 and 331). The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
  • AMD Radeon RX 6700 XT (RADV, Mesa 26.2.5), by @crastinator (comment): 5e106c566d merged onto main a4eca2a056, Linux, with the Khronos validation layer. The new test is red on main 3 of 3 and green on the merge 3 of 3. 22 tests under the layer give no new VUID; the gate's exit 1 comes only from agc_storage_clear_hand_over skipping on both sides.
  • NVIDIA RTX 2000 Ada Generation, TechLevelZero's NVIDIA bot (report): 81ad915d78 merged onto main 1d91f29, driver 595.99.02, Ubuntu 26.04.1. 2,621 passed, 3 failed (none new: all 3 fail on main) and 44 skipped, with no new validation IDs over 983 tests on the GPU.
  • 89c782b89e and 37a0eb949a: the CPU stores a failed walk saw are kept, oneandonlydean's first point and the blocking finding in XairRrR's and mashingaan's reviews, on @sktharunbalaji13-cmd's plan, with them as co-author.
    • New cases in agc_driver_pending_untracked_layer: 5, a same-value CPU store in a block the walk reached before it failed on a later block, then a refresh; 6, the same, then a direct write-back (FlushAllPending) with no refresh. Each requires guest memory and the image to hold the 8 stored words and no results, and guest memory still to hold them after a last flush.
    • Red/green on GitHub's Linux runner (run): with 81ad915d78's code, cases 5 and 6 fail ("guest memory holds 8 results and 0 stored words, the image 8 results and 0 stored words"); with the change, the test passes 10 of 10.
    • ×10 on both runners (the same run): that test, the ^agc_driver_pending, ^agc_storage, ^agc_driver_storage and ^guest_memory tests, agc_collect_memo_generation, agc_import_watch and agc_write_watch_coverage. Linux: 32 run, 31 pass, 1 skip (agc_storage_clear_hand_over), 0 fail. Windows: 31 run, 4 pass, 27 skip (no Vulkan device), 0 fail. Suites: libc and libkernel pass on Linux (210 and 310) and on Windows (237 and 331). The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
    • Every agc and guest_memory test, once (run): Linux: 1,223 run, 1,145 pass, 77 skip, 1 fail. Windows: 1,258 run, 382 pass, 876 skip (no Vulkan device), 0 fail. The Linux failure is agc_driver_pipeline_journal's 120-second timeout, which main 7feb37ee3e's own run of that test hits too (run).
    • Validation (run, Khronos layer on GitHub's Linux runner): agc_driver_pending_untracked_layer, agc_import_watch and the ^agc_storage and ^agc_driver_storage tests pass on both arms, and the change adds no VUID.
    • The kernel's behaviour, from a standalone probe on Linux 6.18: a PAGEMAP_SCAN that fails on a remapped page returns -1, but it has already written out the dirty regions before that page and re-protected them. Its walk_end gives the range end, so the whole unfinished range is reported unreached.
    • A complete-walk control (not committed): a same-value store, then a direct write-back, is lost with and without this change. That's main's rule, in its own debt entry.
    • Checks: each commit builds and passes its own tests. check_conventions.py passes, with no comment lines added. On a cloud Linux machine (lavapipe), ctest -R '^agc' runs 1,219 tests on both trees: 1,142 pass, 77 skip, 0 fail.
  • AMD Radeon RX 6300, TechLevelZero's AMD bot (report): 37a0eb949a merged onto main 7feb37e, RADV NAVI24, Mesa 25.2.8. 3,621 passed, 14 failed (none new: 12 fail on main too, 2 are unstable there) and 59 skipped, with no new validation IDs over 1,309 tests on the GPU.
  • NVIDIA RTX 2000 Ada Generation, TechLevelZero's NVIDIA bot (report): 37a0eb949a merged onto main 9090972, driver 595.99.02. 3,502 passed, 5 failed (none new: 3 fail on main too, 2 are unstable there) and 51 skipped, with no new validation IDs over 1,307 tests on the GPU.
  • 51249fede2, test(agc): the walk-failure cases on Windows. The test no longer skips on Windows. There the surface is one section mapped into the guest arena, and the first page of block 3 is mapped a second time and compared when shared (GuestArenaCompareWhenShared), so a walk over the surface is refused, as on the production path.
    • A new case stores a CPU word of a different value in another block while results are pending, then takes a direct write-back with no refresh.
    • On an NVIDIA GeForce RTX 3070 Laptop GPU (Windows 11, WinLibs GCC 15.2.0, Release), with this PR's code: 3 of 3 runs pass. The same-value store followed by a refresh is kept, and so is the new case's store. The same-value store followed by a direct write-back is lost ("guest memory holds 8 results and 0 stored words, the image 8 results and 0 stored words"), so that one case doesn't run on Windows, and the debt entry records it.
    • The earlier cases on main's code: on the same GPU, before the same-value and new cases ran on Windows, the four earlier cases passed 3 of 3 with main 88e804b0a7's code as well as with this PR's, also with the shared page moved under the results' block or the CPU word's block. So on Windows this case covers the refused-walk path without showing a loss.
    • ×10 on GitHub's runners (run), the set of the 37a0eb949a run. Linux: 32 run, 31 pass, 1 skip (agc_storage_clear_hand_over), 0 fail, with agc_driver_pending_untracked_layer passing 10 of 10. Windows: 31 run, 4 pass, 27 skip (no Vulkan device), 0 fail. Suites: libc and libkernel pass on Linux (210 and 310) and on Windows (237 and 331). The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
    • Checks: check_test_registration.py and check_skips.py pass. Only the test and the debt file change, with no comment lines added.
  • NVIDIA RTX 2000 Ada Generation, TechLevelZero's NVIDIA bot (report): 51249fede2 merged onto main f6232fc, driver 595.99.02. 3,636 passed, 6 failed (none new: 3 fail on main too, 3 are unstable there) and 52 skipped, with no new validation IDs over 1,309 tests on the GPU.
  • 4e4cba9535, oneandonlydean's merge of main d1ae628bc2. The one conflict was in Execution/src/GuestMemory.cpp, where #14899 made the write-tracker generations 64-bit. The merge widens this PR's unreached-page tracker (UnreachedPage, noteUnreached, newestUnknownMark, provenCpuStore) to std::uint64_t with them, and agc_driver_pending_untracked_layer runs its cases a second time with the generation past 2^32 (AdvanceTrackerGenerationForTest). Apart from those types and that pass, this PR's diff over main is unchanged.
    • On an NVIDIA GeForce RTX 3070 Laptop GPU (Windows 11, WinLibs GCC 15.2.0, Release): agc_driver_pending_untracked_layer and main's five agc_write_tracking tests pass 3 of 3.
    • ×10 on GitHub's runners (run): the set of the 51249fede2 run, with main's agc_write_tracking tests and the compared-shared tests added. Linux: 34 run, 33 pass, 1 skip (agc_storage_clear_hand_over), 0 fail. With main's implementation only agc_driver_pending_untracked_layer fails there, in cases 1 and 2 and in the same-value direct write-back case, in both generation passes. Windows: 40 run, 13 pass, 27 skip (no Vulkan device), 0 fail. Suites: libc and libkernel pass on Linux (297 and 321) and on Windows (324 and 342). The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
  • Debian 13, Xeon Gold 6136, GCC 14.2.0, lavapipe (Mesa 26.1.6), by @XairRrR (review): 4e4cba9535 merged onto main d1ae628bc2. agc_driver_pending_untracked_layer passes 3 of 3, with all 7 cases run in both generation passes, and 30 of 31 related tests pass, with 1 skip (agc_storage_clear_hand_over). There are no new VUIDs over 768 tests. With main's five production files, the test fails 3 of 3, in cases 1 and 2 and in the same-value direct write-back case, in both passes.
  • 26ed2aec06, a merge of main 4f41f4c375, which brings hugodearaujo's #14302 (a CPU store that rewrote a pending block with its baseline bytes is kept).
    • The one conflict: Graphics/src/Texture.cpp, in StorageTexture::writeBackLayers, on the line that decides whether a block was written. #14302 replaced its !unchangedSinceBaseline(from, to) with !cpuLeftUnchanged(layer, from, to, edge), and this PR had put cpuSeen (a CPU store that a failed walk saw) in front of that check. The merge keeps both: (cpuSeen || !cpuLeftUnchanged(layer, from, to, edge)), with this PR's byBytes where main has compared[layer], and in the skip condition below it, as before.
    • This PR's diff over main stays +723 −32 in 8 files; that line is the only one that changes.
    • ×10 (run): agc_driver_pending_untracked_layer, agc_collect_memo_generation, agc_import_watch, agc_write_watch_coverage and every test matching ^agc_driver_pending, ^agc_storage, ^agc_driver_storage, ^guest_memory or ^agc_write_tracking, with the compared-shared tests (agc_compared_shared_generations, agc_import_alias_shared, agc_resident_direct_remap, agc_rewatched_direct_shared) on Windows, the only runner that has them. Linux: 36 run, 35 pass, 1 skip (agc_storage_clear_hand_over), 0 fail; with main's implementation only agc_driver_pending_untracked_layer fails there. Windows: 42 run, 13 pass, 29 skip (no Vulkan device), 0 fail. The libc and libkernel suites run 300 and 322 tests on Linux and 327 and 342 on Windows, with 0 failed. The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
    • Every agc and guest_memory test, once (run): Linux: 1,277 run, 1,193 pass, 83 skip, 1 fail. Windows: 1,313 run, 402 pass, 911 skip (no Vulkan device), 0 fail. The Linux failure is 751/1277 Test #1389: agc_driver_pipeline_journal ...........................................***Timeout 120.06 sec, the 120-second limit that main's own run of that test reaches too (see the 37a0eb949a sweep above); this PR doesn't touch the journal.
  • 4f13bb4bb0, a debt note (docs only), for XairRrR's review: since #14302, the cpuSeen term is untested for a block the layer covers only in part and for a layer with no pending stamp, which this PR's fixture doesn't reach.
  • e14b677a04 and a3bb73fa98, debt notes (docs only), for XairRrR's review: the same-value write-back entry is narrowed to the cases #14302 left open, a block the layer covers only in part and a layer with no pending stamp. The Windows refused-walk entry and its skip stay: with the skip lifted on the merged code, the same-value direct write-back case still fails 3 of 3 on an RTX 3070 Laptop GPU (driver 617.42, Windows 11, WinLibs GCC 15.2.0, Release) with "guest memory holds 8 results and 0 stored words", in both generation passes, and the other six cases pass.
  • 3317dcb318, a merge of main b5a9a4781c, which brings Tehshortbus's #12452 (aliased direct memory stays on the Linux write watch, and a collect takes stores through every alias).
    • The one conflict: libc/src/GuestWriteWatch.cpp. #12452 rebuilt Collect, CollectFresh and CollectArmed around a Fanout, which reports a written range at its own address and at every alias in an alias plan. This PR had given Collect and CollectArmed an unreached callback for the pages a failed walk couldn't read. The merge keeps both. Fanout carries unreached beside written, and Fanout::ReportUnreached reports an unreached range at every alias address, the same way Report does for a written range. When a step of Collect or CollectArmed fails, the aliases it hasn't reached yet are reported unreached too, and so are their armed parts for CollectArmed. CollectFresh keeps #12452's loop and reports nothing unreached, as before. This PR's takeFresh and scanWritten merged without a conflict.
    • Not covered by a test: reporting an unreached range at every alias address, and marking the remaining aliases unreached when a step fails. agc_driver_pending_untracked_layer makes a walk fail with no alias. #12452's alias tests collect through aliases, but no walk fails in them. So no test runs an unreached report over an aliased range.
    • Diff: the other 7 files' changed lines are unchanged. This PR's diff over main goes from +724 −32 to +776 −46 in 8 files, all of the change in GuestWriteWatch.cpp.
    • ×10 (run): agc_driver_pending_untracked_layer, agc_collect_memo_generation, and every test matching ^agc_driver_pending, ^agc_storage, ^agc_driver_storage, ^agc_write_tracking, ^agc_write_watch, ^write_watch, ^windows_write_watch or ^guest_memory.
      • Linux: 43 run, 42 pass, 1 skip (agc_storage_clear_hand_over), 0 fail. agc_driver_pending_untracked_layer passes 10 of 10.
      • Windows: 48 run, 13 pass, 35 skip (no Vulkan device), 0 fail. agc_driver_pending_untracked_layer is among the skips, as on every earlier Windows-runner run of this PR.
      • Suites: libc and libkernel run 344 and 346 tests on Linux and 375 and 373 on Windows, with 0 failed. They ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners. main's Windows guest_standard_streams failure (#17423) didn't show up in these runs.
    • Every agc test, once (run): Linux: 1,453 run, 1,361 pass, 92 skip, 0 fail. Windows: 1,493 run, 445 pass, 1,048 skip (no Vulkan device), 0 fail.
    • GPU runs on 3317dcb318: Lucke0051's two Linux GPUs (below). The RTX 3070 Laptop runs and TechLevelZero's bot reports above are on the heads they name. The Windows unreached path, the refused walk over a compared shared page, has had no GPU run since this merge.
  • NVIDIA GeForce RTX 3070 Ti and Intel UHD Graphics 630 (CML GT2), by @Lucke0051 (comment): 3317dcb318 merged onto main 02452319ce, CachyOS (Linux 7.3.1), GCC 16.2.1, Release, ctest -R '^(agc|video_out|shader)', against main on the same machine. Both GPUs (NVIDIA 615.78.08; Mesa 26.2.6) show no difference from main, and agc_driver_pending_untracked_layer passes on both. No validation layer was installed there.
  • 7219255b4d, a merge of main ea32608486 (×10, every agc test), which brings JJenkx's #18940 (a pending texture's snapshot at an unwatch covers only the units the unwatched range meets, and when the write-watch query over the whole range fails, each unit is queried on its own).
    • The conflict: Graphics/src/Texture.cpp, four hunks, in StorageTexture::refresh's drop rule and in StorageTexture::writeBackLayers. Where this PR's lines read the range-wide tracked and compared, #18940 reads per-unit answers (unitTracked, and in the refresh unitCompared) when the range query fails. The merge keeps both:
      • the drop rule takes #18940's per-unit compared and tracked, and still compares a unit's stamps when a failed walk left its block unknown;
      • the write-back keeps this PR's compareUnknown ahead of #18940's per-layer queries, which run only when it can't answer. Its unknown and skip conditions read #18940's layerTracked where this PR had tracked, with this PR's !compared[layer] and !byBytes terms kept.
        So in those lines, a surface with no unknown blocks takes main's path, and one with unknown blocks takes 3317dcb318's.
    • Diff: the other 7 files' changed lines are unchanged, and this PR's diff over main stays +776 −46 in 8 files. In Texture.cpp the changed lines are the same, on #18940's per-unit names.
    • ×10: the set of the 3317dcb318 run, with #18940's five agc_unwatch_snapshot_scope* tests. Linux: 51 run, 50 pass, 1 skip (agc_storage_clear_hand_over), 0 fail; agc_driver_pending_untracked_layer and #18940's five tests pass 10 of 10. Windows: 58 run, 15 pass, 43 skip (no Vulkan device; agc_driver_pending_untracked_layer and #18940's five tests are among them), 0 fail. The libc and libkernel suites run 380 and 376 tests on Linux and 410 and 404 on Windows, with 0 failed. They ran with APS5_SKIP_TIMING_TESTS=1, which relaxes only precise_wait's median bounds on GitHub's hosted runners.
    • Every agc test, once: Linux: 1,690 run, 1,582 pass, 106 skip, 2 fail. Windows: 1,728 run, 502 pass, 1,226 skip (no Vulkan device), 0 fail. The two Linux failures are main's:
      • agc_driver_global_atomic_csub: "AGC graphics: global atomic csub without glc: wave64 byte 644 is 146, expected 0";
      • agc_driver_coherent_atomic_loads_enabled: a 60-second timeout.
        main's own Linux job fails both, with the same message and the same timeout, at d2949cd806 (job) and at 67ec0f7d8c (job), covered by #19332.
    • The Windows tree: both runs had Sankalp7317's 4-line _putenv_s test fix (#19899) on top, because main's Windows test build breaks without it ("'setenv' was not declared" in UploadCacheReadOnlyFlush.cpp, from #18037); it isn't on this branch. The first runs, on this head alone (×10, every agc test), gave the same Linux results, and their Windows builds stopped at that error.
    • No GPU run on 7219255b4d.
  • a124bdd5c4, a merge of main 790e9a371c (×10, ×10 with the Windows test fix, every agc test), which brings Ducengarth's #17788 (a storage image's upload copy is renewed when its range leaves the write watch).
    • The conflict: docs/dev/debt/libSceAgcDriver.md only. #17788 rewrote the "Units without a baseline outside the write watch" entry, right before this PR's four entries. The file merges with merge=union, which would keep the old copy of that entry next to the new one, so the merge takes #17788's entry and keeps this PR's four after it.
    • Diff: this PR's changed lines are the same in all 8 files, and its diff over main stays +776 −46. Only context lines moved: that debt entry, and chitters2004's #17766 lines next to this PR's in tests/CollectMemoGeneration.cpp. Texture.cpp, where #17788 also changes StorageTexture, merged without a conflict.
    • ×10: the set of the 7219255b4d run. Linux: 54 run, 53 pass, 1 skip (agc_storage_clear_hand_over), 0 fail. Windows: 64 run, 19 pass, 45 skip (no Vulkan device), 0 fail. The libc and libkernel suites run 388 and 384 tests on Linux and 418 and 412 on Windows, with 0 failed. They ran with APS5_SKIP_TIMING_TESTS=1, which relaxes only precise_wait's median bounds on GitHub's hosted runners.
    • Every agc test, once, on Linux: 1,801 run, 1,677 pass, 114 skip, 10 fail.
      • Seven also fail in main's own Linux job at 3e1b183e43 (job): agc_driver_global_atomic_csub, agc_driver_stencil_copy_draw, agc_driver_coherent_atomic_loads_enabled, agc_driver_image_table_packed_guards, agc_driver_recorder, agc_draw_input_mirrors and agc_draw_input_reuse.
      • The other three passed there: agc_driver_frame_replay_rewind_copy ("FAILED: no memory delta was read while 1 submissions waited for the CPU") and the agc_driver_runtime_buffer_spans_x3_spans and _x4_spans timeouts. Over 10 runs of main 790e9a371c with #19899's test-only commit on top (run), all three fail too, frame_replay_rewind_copy with the same message. Over 10 runs of this merge (run), frame_replay_rewind_copy passes 10 of 10, and the span tests fail as on main.
    • The Windows tree: as for 7219255b4d, the Windows runs had Sankalp7317's #19899 on top, since main's Windows test build still stops at "'setenv' was not declared" in UploadCacheReadOnlyFlush.cpp (from #18037). It isn't on this branch. The Windows builds of the first ×10 and of the agc run, on this head alone, stopped at that error.
    • No GPU run on a124bdd5c4.
  • 095d749357, a merge of main 0694c4cbd6 (×10, every agc test), which brings klosixgaming-arch's #19071 (settled imports under live storage images go back to the write watch).
    • The conflict: the four hunks in Graphics/src/Texture.cpp planned under Overlap, resolved as described there. The declarations keep this PR's unknownBlocks and #19071's rewatchCompared. scanBlocks keeps this PR's ChangedBlocks read, taken only when the surface's own collect succeeded, with #19071's confirmRewatched call after it. droppable keeps both cases in one condition. writeBackLayers keeps this PR's unknownBlocks, and #19071's confirmRewatched call now follows this PR's walked && ChangedBlocks line.
    • Diff: over main it is +777 −47 in the same 8 files, against +776 −46 before. The changed lines are the same, apart from where #19071's code meets this PR's: the droppable condition this PR extends now also holds #19071's rewatched-unit case, and #19071's confirmRewatched call in writeBackLayers moves after this PR's ChangedBlocks line.
    • ×10: the set of the a124bdd5c4 run. Linux: 55 run, 54 pass, 1 skip (agc_storage_clear_hand_over), 0 fail. Windows: 66 run, 19 pass, 47 skip (no Vulkan device), 0 fail. The libc and libkernel suites run 391 and 390 tests on Linux and 421 and 417 on Windows. On Windows, 0 failed. On Linux, libkernel's guest_thermal_sensors reached its 20 s timeout. It times out in every run I have on GitHub's Intel Xeon 6975P-C runners, main 0694c4cbd6 alone included (run), and passes on GitHub's other runners and in main's own job. This PR changes no libkernel file. The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes only precise_wait's median bounds on GitHub's hosted runners.
    • Every agc test, once: Linux: 1,867 run, 1,739 pass, 116 skip, 12 fail. Windows: 1,909 run, 558 pass, 1,351 skip (no Vulkan device), 0 fail.
      • Eight also fail in main's own Linux job at 0694c4cbd6 (job): agc_driver_global_atomic_csub, agc_driver_stencil_copy_draw, agc_driver_coherent_atomic_loads_enabled, agc_hook_clear_access, agc_hook_clear_access_off, agc_driver_recorder, agc_draw_input_mirrors and agc_draw_input_reuse.
      • agc_driver_image_table_packed_guards fails the same way in main's own Linux job at e249fc47b5 (job): three identical "stage 4 pc 0x68" records, then "unrecoverable packed table format was not poisoned". fernandomcrsilva's open #21255 changes that test.
      • The agc_driver_runtime_buffer_spans_x2_spans, _x3_spans and _x4_spans timeouts: main's own Linux job passes them at 0694c4cbd6, in 3.09, 3.79 and 4.16 s, and times them out at dcf3d15978 (job), together with _x4_reference. On GitHub's runners, ×10 of the span tests with this PR's set in both arms, main 0694c4cbd6 (run, Intel Xeon 6975P-C) and this merge (run, AMD EPYC 9V74) differ by little. The merge's passing medians are 0.99 to 1.12 of main's: runtime_buffer_spans 3.92 and 3.90 s, _x2_reference 1.55 and 1.66 s, _x3_reference 1.89 and 2.08 s, _fault_stop 0.205 and 0.230 s, _fault_barrier 0.210 and 0.230 s. Its timeouts are the four main's own job shows at dcf3d15978. The two arms ran on different CPUs. For scale, main's own code takes 0.68 to 0.78 of the time on the Xeon that it takes on an AMD EPYC 7763 (run), and two runs of this merge on the same EPYC 9V74 differ from each other by up to 20% (run).
    • The Windows tree: as before, the Windows runs had Sankalp7317's #19899 on top; it isn't on this branch.
    • A GPU run on 095d749357: @domx4q's RTX 4090 run with the validation layer (below).
  • NVIDIA GeForce RTX 4090, by @domx4q, with the Khronos validation layer (comment): Arch Linux (kernel 7.3.4), GCC 16.2.1 Release, driver 620.70.06, Vulkan 1.4.357, validation layer 1.4.363.1, with ANYPS5_REQUIRE_VULKAN=1 and ANYPS5_NO_SHADER_CACHE=1. This head 095d749357 merged onto main e4caa07950 (a clean merge), against main e4caa07950 alone, ctest -R '^agc_(driver_pending|collect_memo_generation|storage|driver_storage|write_tracking|write_watch_coverage|import_watch)'. main: 45 of 45 pass. This PR: 46 of 46 pass, including agc_driver_pending_untracked_layer, which main doesn't have, run on the RTX 4090 (no skip). No VUID- line on either side, and every device test selected the RTX 4090.
  • Ghost of Tsushima Director's Cut (PPSA02225) on plain main, by @milescoviello (comment): Ubuntu 26.04.1, NVIDIA GeForce RTX 4070 Ti (driver 615.71.09), Release libraries, main eb20410673 against its merge with 095d749357, 3 runs per arm of up to 600 s from a pinned save with a cold shader cache.
    • The line: every run logs keeping the CPU's blocks 8 times, all during setup. Without the stack above, this title doesn't reach the per-frame case, so the run can't show the fix, as expected.
    • The rest: after Continue the screen stays black in both arms. A phase of 1-2 presents per 10 s, at 1-4 s of GPU per present, came in one main run and two of this PR's runs; they read it as varying from run to run rather than following the change. The two PR runs with the most of it also had the highest RSS (25.0 and 24.1 GB, one killed at the 22G cap at 393 s, against 19.2 to 20.3 GB for main). main's third run entered the same phase and was killed at 237 s, so they don't read the memory difference as coming from this PR.

Overlap

  • #19071 (klosixgaming-arch) returns settled imports under live storage images to the write watch. It has merged, first, as planned. Its four hunks in Graphics/src/Texture.cpp, in StorageTexture::Refresh and StorageTexture::writeBackLayers, conflicted with this PR, and the merge of main 0694c4cbd6 resolves them like this (see Tested):
    • The declarations: this PR's unknownBlocks and #19071's rewatchCompared are added on the same line, and both are kept.
    • scanBlocks and writeBackLayers: this PR reads ChangedBlocks only when the surface's own collect succeeded, and moves main's awaitStoredSave into its !tracked path, after the unknown-block compare. #19071 calls confirmRewatched after main's ChangedBlocks call. The merge keeps this PR's lines and calls confirmRewatched after this PR's ChangedBlocks call, with #19071's conditions.
    • droppable: both add a case to the same condition, this PR's unknown blocks and #19071's rewatched units, and both are kept.
  • #24008 (chitters2004) closes two write-watch report races on Linux in libc/src/GuestWriteWatch.cpp: a fresh range is protected before it is reported, and each Fanout re-resolves its alias translations when a link changes during a collect. It conflicts with this PR in four hunks, in Collect, CollectFresh, CollectArmed and Fanout::Report (git merge-tree of its 895760f025 and this PR's 095d749357; each merges cleanly with main d50640e264 on its own). Proposed order: #24008 first, and this PR then resolves the conflict keeping both sides (note):
    • Fanout: carries both PRs' members, #24008's watch, range, link version and refreshed translations, and this PR's unreached. Every Fanout is built with all of them, including this PR's constructions in CollectArmed's uncovered-range path and in unreachAliases, which merge without a text conflict; unreachAliases stops being static so it can pass the watch.
    • The calls: takeFresh and scanWritten take this PR's unreached report beside Fanout::Report, and this PR's failure paths, which report the remaining aliases as unreached before returning false, are kept. ReportUnreached calls #24008's refresh() before it fans out, as Report does, so an unreached range also reaches a view linked during the collect.
    • Tests: whichever goes second runs #24008's agc_write_tracking tests and this PR's agc_driver_pending_untracked_layer, ^agc_storage and ^agc_driver_storage tests on the merged tree.

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: #24008 (merge order only); #19071 has merged, and the merge of main 0694c4cbd6 keeps both
  • Fixes: none
  • Unblocks: PPSA02225 #5166 (with the stack above)
  • GPUs tested: lavapipe (llvmpipe, LLVM 20.1.2), Ubuntu 24.04; NVIDIA GeForce RTX 4060 Laptop GPU, Windows 11 (the reporter's title run); AMD Radeon RX 6700 XT, RADV (Linux, crastinator); NVIDIA RTX 2000 Ada Generation (Linux, TechLevelZero's NVIDIA GPU test); AMD Radeon RX 6300, RADV (Linux, TechLevelZero's AMD GPU test); NVIDIA GeForce RTX 3070 Laptop GPU, Windows 11 (the Windows case); NVIDIA GeForce RTX 3070 Ti and Intel UHD Graphics 630 (Linux, Lucke0051); NVIDIA GeForce RTX 4090 (driver 620.70.06, Arch Linux, with the validation layer), by @domx4q; NVIDIA GeForce RTX 4070 Ti (driver 615.71.09, Ubuntu 26.04.1, Ghost of Tsushima on plain main, which doesn't reach the case), by @milescoviello
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5065512166 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12792). Originally posted by [EagleBearerYS](https://github.com/EagleBearerYS) on 2026-10-29T09:26:30Z. --- ### What When a page walk over a storage image stops part way, the surface's collect returns 0 while the range stays watched. The walk also reports the rest of its range as written by the CPU. `StorageTexture::Refresh` then sees the 64 KiB units that hold GPU results as CPU-written newer than their generations. It drops them, re-uploads them from guest memory, and prints `guest memory changed while GPU results were pending; keeping the CPU's blocks`. The write-back leaves the same blocks to the CPU. - **The fix:** when the surface's own collect fails, the refresh (`scanBlocks`) and the write-back (`writeBackLayers`) no longer read the walk's synthetic stamps as CPU stores. - On Linux, a `PAGEMAP_SCAN` that fails has already written out the dirty regions it found before the failure and re-protected those pages. The new `GuestWriteWatchCollectReporting_nid_postfix` and `GuestWriteWatchCollectArmedReporting_nid_postfix` report those regions as written, and the range the walk didn't finish as unreached. The old collect calls are unchanged. - The tracker keeps, per page, the genuine CPU stamp that a failed walk would otherwise cover with its synthetic one. A new `ChangedBlocks` overload answers per 64 KiB block: known (today's stamps), CPU-confirmed (a genuine store after the block's generation) or unknown. - The refresh and the write-back keep the stamps of known blocks, leave a CPU-confirmed block to the CPU, and compare only the unknown blocks with the guest bytes saved at the upload or the previous store, as they already do for memory outside the watch. Without saved bytes, or when the query can't answer, they compare the whole surface, as before. - On the failed-walk path, the write-back also leaves a block the walk saw the CPU write to the CPU whatever its bytes, as the refresh already does. - This PR's first version compared the whole surface on a failed walk. As oneandonlydean, XairRrR and mashingaan pointed out, that loses a same-value CPU store in a block the walk did reach (see Tested). - **What stays open,** recorded in `docs/dev/debt/libSceAgcDriver.md`: - a same-value CPU store in a page the walk never reached is still lost, since that block is compared by bytes; - a unit with no saved bytes over a failed walk is handled as outside the watch, so storing it throws; - a failed walk of a larger range still stamps the blocks of a surface whose own collect succeeds; - a kernel that writes out no regions before its `PAGEMAP_SCAN` error leaves the whole range unreached (Linux 6.18 writes them); - on a complete walk, `main`'s write-back leaves a stamped block to the CPU only when its bytes differ, so a same-value store made while results are pending is overwritten there. That's `main`'s existing rule, in its own entry, and isn't changed here; - on Windows, a same-value CPU store followed by a direct write-back with no refresh is lost when the walk over a compared shared page is refused ("guest memory holds 8 results and 0 stored words" on an RTX 3070 Laptop GPU), so that case doesn't run on Windows. With a refresh, or with a store of a different value, the store is kept. - **Credit:** reported by @sktharunbalaji13-cmd in Ghost of Tsushima Director's Cut (PPSA02225) ([#9742 comment](https://github.com/boykopovar/AnyPS5/pull/9742#issuecomment-6491543723), [#5166 comment](https://github.com/boykopovar/AnyPS5/issues/5166#issuecomment-6491557320)). They traced it to `markLayersPending` and `Refresh`, and they're co-author of the commit. - Their first change stamped the layer's generation at `markLayersPending`. That doesn't reach the loss: the refresh's own failed walk stamps the blocks newer again. It would also hide a CPU store made between a refresh and the pending mark. Case 3 below covers that. - This change compares instead. - **Platforms:** in the tests, this PR's effect is shown on Linux, where the walk is made to fail by remapping a watched page. I found no production Linux path that does that. On Windows, the test reaches a refused walk through a compared shared page, but the surface's other blocks are collected one block at a time and keep the CPU stores, so the Windows case passes on `main` and on this PR alike. On Windows the title run below is the evidence. ### Tested - **`agc_driver_pending_untracked_layer` (new):** - **Setup:** a watched surface, real `image_store` dispatches, then a readback through `image_load`. It sets `APS5_NO_HOST_IMPORT=1` itself, so lavapipe doesn't take the range off the watch with an import, and it skips (77) on Windows. | case | main | this change | |---|---|---| | 1. results over a surface whose walk fails | red: 0 of 8 results survive, line printed | green | | 2. the same, with a CPU store to another block while pending | red: 0 of 8 results, the CPU word kept | green | | 3. a CPU store over a result word between a refresh and the pending mark, with the walk complete | green | green: the image sees the CPU word | | 4. the same as 3, with the walk failing | green | green | - **Red/green on Linux** (Ubuntu 24.04, GCC 13.3, lavapipe, Release): red at run 1 of `--repeat until-fail:10` on `main`'s `Texture.cpp`, and 10 of 10 direct runs fail. Green, 10 of 10. - **`ctest -R '^agc'`** on this change: 1,118 tests, 1,045 passed, 73 skipped, 0 failed. - **Ghost of Tsushima Director's Cut (PPSA02225, v02.024.000), @sktharunbalaji13-cmd's run** ([comment](https://github.com/boykopovar/AnyPS5/issues/5166#issuecomment-6492874290)). Windows 11, RTX 4060 Laptop, 240 s. - **The stack:** #9742, #9717, #10064, #10727, #12191, #12147, #7985, #12561, #12612 and #12617, with this commit in place of their local change. Ghost needs that stack to reach the scene, so the title line isn't shown on plain `main`. - **The line:** `keeping the CPU's blocks` went from every frame to 1 occurrence at allocation on `0x1500010000` (3840x2160 `R16G16B16A16_SFLOAT`), and 8 in the whole run (7 on `0x1504000000` during setup). - **The frames:** the disclaimer frames 087-089 render (white text on a dark background). - **GitHub, ×10 on both runners, with the Khronos validation comparison on Linux** ([run 40868832489](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40868832489)): - **Linux:** `agc_driver_pending_untracked_layer` passed 10 of 10 under validation. With it, the `^agc_storage` and `^agc_driver_storage` tests ran 21 tests: 20 passed and 1 skipped, `agc_storage_clear_hand_over`, since lavapipe makes no watched host import. - **Validation:** the layer loaded on both sides, and the only VUID on `main` and with this change is `VUID-VkDeviceCreateInfo-pNext-pNext`, for an extension structure the layer predates. The change adds none. - **Windows runner:** 22 tests built and ran, and all skip, since the runner has no Vulkan device. - **Suites:** the libc and libkernel suites, run with `APS5_SKIP_TIMING_TESTS=1`, pass: 191 and 291 tests on Linux, 220 and 314 on Windows. - The new test doesn't exist on `main`, so the runner's comparison arm has no red. The red is the Linux one above. - **Checks:** MinGW-w64 `-fsyntax-only` on `Texture.cpp` and the test gives no warning on the changed lines. `check_conventions.py` passes, with no comment lines added. - **5e106c566d, oneandonlydean's merge of `main` 88e804b0a7.** The one conflict was in `docs/dev/debt/libSceAgcDriver.md`, where this PR's page-walk entry sits among `main`'s new write-watch entries; both sides are kept. This PR's diff over `main` is unchanged. On GitHub's runners ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41416906941), on 7ed1db8f0d, the same merge with that entry one line higher), `agc_driver_pending_untracked_layer` and the `^agc_storage` and `^agc_driver_storage` tests ran 10 times with no failure. Linux: 24 run, 23 pass, 1 skip (`agc_storage_clear_hand_over`), 0 fail. Windows: 25 run, 0 pass, 25 skip (no Vulkan device), 0 fail. Suites: libc and libkernel pass on Linux (210 and 310) and on Windows (237 and 331). The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **81ad915d78: a case that can't run no longer hides a failure,** oneandonlydean's second point ([comment](https://github.com/boykopovar/AnyPS5/pull/12792#issuecomment-6493452852)). `main()` runs every case, requires that none came back `Lost`, and only then returns 77 if a case couldn't run. On GitHub's runners ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41522085310)), `agc_driver_pending_untracked_layer` and the `^agc_driver_pending`, `^agc_storage` and `^agc_driver_storage` tests ran 10 times with no failure. Linux: 25 run, 24 pass, 1 skip (`agc_storage_clear_hand_over`), 0 fail. Windows: 26 run, 0 pass, 26 skip (no Vulkan device), 0 fail. Suites: libc and libkernel pass on Linux (210 and 310) and on Windows (237 and 331). The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **AMD Radeon RX 6700 XT (RADV, Mesa 26.2.5), by @crastinator** ([comment](https://github.com/boykopovar/AnyPS5/pull/12792#issuecomment-6587906650)): 5e106c566d merged onto `main` a4eca2a056, Linux, with the Khronos validation layer. The new test is red on `main` 3 of 3 and green on the merge 3 of 3. 22 tests under the layer give no new VUID; the gate's exit 1 comes only from `agc_storage_clear_hand_over` skipping on both sides. - **NVIDIA RTX 2000 Ada Generation, TechLevelZero's NVIDIA bot** ([report](https://github.com/boykopovar/AnyPS5/pull/12792#issuecomment-6590101763)): 81ad915d78 merged onto `main` 1d91f29, driver 595.99.02, Ubuntu 26.04.1. 2,621 passed, 3 failed (none new: all 3 fail on `main`) and 44 skipped, with no new validation IDs over 983 tests on the GPU. - **89c782b89e and 37a0eb949a: the CPU stores a failed walk saw are kept,** oneandonlydean's first point and the blocking finding in XairRrR's and mashingaan's reviews, on @sktharunbalaji13-cmd's plan, with them as co-author. - **New cases** in `agc_driver_pending_untracked_layer`: 5, a same-value CPU store in a block the walk reached before it failed on a later block, then a refresh; 6, the same, then a direct write-back (`FlushAllPending`) with no refresh. Each requires guest memory and the image to hold the 8 stored words and no results, and guest memory still to hold them after a last flush. - **Red/green on GitHub's Linux runner** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41559174803)): with 81ad915d78's code, cases 5 and 6 fail ("guest memory holds 8 results and 0 stored words, the image 8 results and 0 stored words"); with the change, the test passes 10 of 10. - **×10 on both runners** (the same run): that test, the `^agc_driver_pending`, `^agc_storage`, `^agc_driver_storage` and `^guest_memory` tests, `agc_collect_memo_generation`, `agc_import_watch` and `agc_write_watch_coverage`. Linux: 32 run, 31 pass, 1 skip (`agc_storage_clear_hand_over`), 0 fail. Windows: 31 run, 4 pass, 27 skip (no Vulkan device), 0 fail. Suites: libc and libkernel pass on Linux (210 and 310) and on Windows (237 and 331). The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **Every `agc` and `guest_memory` test, once** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41559188012)): Linux: 1,223 run, 1,145 pass, 77 skip, 1 fail. Windows: 1,258 run, 382 pass, 876 skip (no Vulkan device), 0 fail. The Linux failure is `agc_driver_pipeline_journal`'s 120-second timeout, which `main` 7feb37ee3e's own run of that test hits too ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41551689674)). - **Validation** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41559199785), Khronos layer on GitHub's Linux runner): `agc_driver_pending_untracked_layer`, `agc_import_watch` and the `^agc_storage` and `^agc_driver_storage` tests pass on both arms, and the change adds no VUID. - **The kernel's behaviour,** from a standalone probe on Linux 6.18: a `PAGEMAP_SCAN` that fails on a remapped page returns -1, but it has already written out the dirty regions before that page and re-protected them. Its `walk_end` gives the range end, so the whole unfinished range is reported unreached. - **A complete-walk control** (not committed): a same-value store, then a direct write-back, is lost with and without this change. That's `main`'s rule, in its own debt entry. - **Checks:** each commit builds and passes its own tests. `check_conventions.py` passes, with no comment lines added. On a cloud Linux machine (lavapipe), `ctest -R '^agc'` runs 1,219 tests on both trees: 1,142 pass, 77 skip, 0 fail. - **AMD Radeon RX 6300, TechLevelZero's AMD bot** ([report](https://github.com/boykopovar/AnyPS5/pull/12792#issuecomment-6594878397)): 37a0eb949a merged onto `main` 7feb37e, RADV NAVI24, Mesa 25.2.8. 3,621 passed, 14 failed (none new: 12 fail on `main` too, 2 are unstable there) and 59 skipped, with no new validation IDs over 1,309 tests on the GPU. - **NVIDIA RTX 2000 Ada Generation, TechLevelZero's NVIDIA bot** ([report](https://github.com/boykopovar/AnyPS5/pull/12792#issuecomment-6595016130)): 37a0eb949a merged onto `main` 9090972, driver 595.99.02. 3,502 passed, 5 failed (none new: 3 fail on `main` too, 2 are unstable there) and 51 skipped, with no new validation IDs over 1,307 tests on the GPU. - **51249fede2, `test(agc)`: the walk-failure cases on Windows.** The test no longer skips on Windows. There the surface is one section mapped into the guest arena, and the first page of block 3 is mapped a second time and compared when shared (`GuestArenaCompareWhenShared`), so a walk over the surface is refused, as on the production path. - **A new case** stores a CPU word of a different value in another block while results are pending, then takes a direct write-back with no refresh. - **On an NVIDIA GeForce RTX 3070 Laptop GPU** (Windows 11, WinLibs GCC 15.2.0, Release), with this PR's code: 3 of 3 runs pass. The same-value store followed by a refresh is kept, and so is the new case's store. The same-value store followed by a direct write-back is lost ("guest memory holds 8 results and 0 stored words, the image 8 results and 0 stored words"), so that one case doesn't run on Windows, and the debt entry records it. - **The earlier cases on `main`'s code:** on the same GPU, before the same-value and new cases ran on Windows, the four earlier cases passed 3 of 3 with `main` 88e804b0a7's code as well as with this PR's, also with the shared page moved under the results' block or the CPU word's block. So on Windows this case covers the refused-walk path without showing a loss. - **×10 on GitHub's runners** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41574966003)), the set of the 37a0eb949a run. Linux: 32 run, 31 pass, 1 skip (`agc_storage_clear_hand_over`), 0 fail, with `agc_driver_pending_untracked_layer` passing 10 of 10. Windows: 31 run, 4 pass, 27 skip (no Vulkan device), 0 fail. Suites: libc and libkernel pass on Linux (210 and 310) and on Windows (237 and 331). The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **Checks:** `check_test_registration.py` and `check_skips.py` pass. Only the test and the debt file change, with no comment lines added. - **NVIDIA RTX 2000 Ada Generation, TechLevelZero's NVIDIA bot** ([report](https://github.com/boykopovar/AnyPS5/pull/12792#issuecomment-6596339087)): 51249fede2 merged onto `main` f6232fc, driver 595.99.02. 3,636 passed, 6 failed (none new: 3 fail on `main` too, 3 are unstable there) and 52 skipped, with no new validation IDs over 1,309 tests on the GPU. - **4e4cba9535, oneandonlydean's merge of `main` d1ae628bc2.** The one conflict was in `Execution/src/GuestMemory.cpp`, where #14899 made the write-tracker generations 64-bit. The merge widens this PR's unreached-page tracker (`UnreachedPage`, `noteUnreached`, `newestUnknownMark`, `provenCpuStore`) to `std::uint64_t` with them, and `agc_driver_pending_untracked_layer` runs its cases a second time with the generation past 2^32 (`AdvanceTrackerGenerationForTest`). Apart from those types and that pass, this PR's diff over `main` is unchanged. - **On an NVIDIA GeForce RTX 3070 Laptop GPU** (Windows 11, WinLibs GCC 15.2.0, Release): `agc_driver_pending_untracked_layer` and `main`'s five `agc_write_tracking` tests pass 3 of 3. - **×10 on GitHub's runners** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41585211603)): the set of the 51249fede2 run, with `main`'s `agc_write_tracking` tests and the compared-shared tests added. Linux: 34 run, 33 pass, 1 skip (`agc_storage_clear_hand_over`), 0 fail. With `main`'s implementation only `agc_driver_pending_untracked_layer` fails there, in cases 1 and 2 and in the same-value direct write-back case, in both generation passes. Windows: 40 run, 13 pass, 27 skip (no Vulkan device), 0 fail. Suites: libc and libkernel pass on Linux (297 and 321) and on Windows (324 and 342). The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **Debian 13, Xeon Gold 6136, GCC 14.2.0, lavapipe (Mesa 26.1.6), by @XairRrR** ([review](https://github.com/boykopovar/AnyPS5/pull/12792#pullrequestreview-5747913508)): 4e4cba9535 merged onto `main` d1ae628bc2. `agc_driver_pending_untracked_layer` passes 3 of 3, with all 7 cases run in both generation passes, and 30 of 31 related tests pass, with 1 skip (`agc_storage_clear_hand_over`). There are no new VUIDs over 768 tests. With `main`'s five production files, the test fails 3 of 3, in cases 1 and 2 and in the same-value direct write-back case, in both passes. - **26ed2aec06, a merge of `main` 4f41f4c375**, which brings hugodearaujo's #14302 (a CPU store that rewrote a pending block with its baseline bytes is kept). - **The one conflict:** `Graphics/src/Texture.cpp`, in `StorageTexture::writeBackLayers`, on the line that decides whether a block was written. #14302 replaced its `!unchangedSinceBaseline(from, to)` with `!cpuLeftUnchanged(layer, from, to, edge)`, and this PR had put `cpuSeen` (a CPU store that a failed walk saw) in front of that check. The merge keeps both: `(cpuSeen || !cpuLeftUnchanged(layer, from, to, edge))`, with this PR's `byBytes` where `main` has `compared[layer]`, and in the skip condition below it, as before. - This PR's diff over `main` stays +723 −32 in 8 files; that line is the only one that changes. - **×10** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41614600774)): `agc_driver_pending_untracked_layer`, `agc_collect_memo_generation`, `agc_import_watch`, `agc_write_watch_coverage` and every test matching `^agc_driver_pending`, `^agc_storage`, `^agc_driver_storage`, `^guest_memory` or `^agc_write_tracking`, with the compared-shared tests (`agc_compared_shared_generations`, `agc_import_alias_shared`, `agc_resident_direct_remap`, `agc_rewatched_direct_shared`) on Windows, the only runner that has them. Linux: 36 run, 35 pass, 1 skip (`agc_storage_clear_hand_over`), 0 fail; with `main`'s implementation only `agc_driver_pending_untracked_layer` fails there. Windows: 42 run, 13 pass, 29 skip (no Vulkan device), 0 fail. The libc and libkernel suites run 300 and 322 tests on Linux and 327 and 342 on Windows, with 0 failed. The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **Every `agc` and `guest_memory` test, once** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41614614427)): Linux: 1,277 run, 1,193 pass, 83 skip, 1 fail. Windows: 1,313 run, 402 pass, 911 skip (no Vulkan device), 0 fail. The Linux failure is `751/1277 Test #1389: agc_driver_pipeline_journal ...........................................***Timeout 120.06 sec`, the 120-second limit that `main`'s own run of that test reaches too (see the 37a0eb949a sweep above); this PR doesn't touch the journal. - **4f13bb4bb0, a debt note** (docs only), for XairRrR's [review](https://github.com/boykopovar/AnyPS5/pull/12792#pullrequestreview-5754540137): since #14302, the `cpuSeen` term is untested for a block the layer covers only in part and for a layer with no pending stamp, which this PR's fixture doesn't reach. - **e14b677a04 and a3bb73fa98, debt notes** (docs only), for XairRrR's [review](https://github.com/boykopovar/AnyPS5/pull/12792#pullrequestreview-5755065745): the same-value write-back entry is narrowed to the cases #14302 left open, a block the layer covers only in part and a layer with no pending stamp. The Windows refused-walk entry and its skip stay: with the skip lifted on the merged code, the same-value direct write-back case still fails 3 of 3 on an RTX 3070 Laptop GPU (driver 617.42, Windows 11, WinLibs GCC 15.2.0, Release) with "guest memory holds 8 results and 0 stored words", in both generation passes, and the other six cases pass. - **3317dcb318, a merge of `main` b5a9a4781c**, which brings Tehshortbus's #12452 (aliased direct memory stays on the Linux write watch, and a collect takes stores through every alias). - **The one conflict:** `libc/src/GuestWriteWatch.cpp`. #12452 rebuilt `Collect`, `CollectFresh` and `CollectArmed` around a `Fanout`, which reports a written range at its own address and at every alias in an alias plan. This PR had given `Collect` and `CollectArmed` an `unreached` callback for the pages a failed walk couldn't read. The merge keeps both. `Fanout` carries `unreached` beside `written`, and `Fanout::ReportUnreached` reports an unreached range at every alias address, the same way `Report` does for a written range. When a step of `Collect` or `CollectArmed` fails, the aliases it hasn't reached yet are reported unreached too, and so are their armed parts for `CollectArmed`. `CollectFresh` keeps #12452's loop and reports nothing unreached, as before. This PR's `takeFresh` and `scanWritten` merged without a conflict. - **Not covered by a test:** reporting an unreached range at every alias address, and marking the remaining aliases unreached when a step fails. `agc_driver_pending_untracked_layer` makes a walk fail with no alias. #12452's alias tests collect through aliases, but no walk fails in them. So no test runs an unreached report over an aliased range. - **Diff:** the other 7 files' changed lines are unchanged. This PR's diff over `main` goes from +724 −32 to +776 −46 in 8 files, all of the change in `GuestWriteWatch.cpp`. - **×10** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/42535632684)): `agc_driver_pending_untracked_layer`, `agc_collect_memo_generation`, and every test matching `^agc_driver_pending`, `^agc_storage`, `^agc_driver_storage`, `^agc_write_tracking`, `^agc_write_watch`, `^write_watch`, `^windows_write_watch` or `^guest_memory`. - Linux: 43 run, 42 pass, 1 skip (`agc_storage_clear_hand_over`), 0 fail. `agc_driver_pending_untracked_layer` passes 10 of 10. - Windows: 48 run, 13 pass, 35 skip (no Vulkan device), 0 fail. `agc_driver_pending_untracked_layer` is among the skips, as on every earlier Windows-runner run of this PR. - Suites: libc and libkernel run 344 and 346 tests on Linux and 375 and 373 on Windows, with 0 failed. They ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. `main`'s Windows `guest_standard_streams` failure (#17423) didn't show up in these runs. - **Every `agc` test, once** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/42535646059)): Linux: 1,453 run, 1,361 pass, 92 skip, 0 fail. Windows: 1,493 run, 445 pass, 1,048 skip (no Vulkan device), 0 fail. - **GPU runs on 3317dcb318:** Lucke0051's two Linux GPUs (below). The RTX 3070 Laptop runs and TechLevelZero's bot reports above are on the heads they name. The Windows unreached path, the refused walk over a compared shared page, has had no GPU run since this merge. - **NVIDIA GeForce RTX 3070 Ti and Intel UHD Graphics 630 (CML GT2), by @Lucke0051** ([comment](https://github.com/boykopovar/AnyPS5/pull/12792#issuecomment-6763648841)): 3317dcb318 merged onto `main` 02452319ce, CachyOS (Linux 7.3.1), GCC 16.2.1, Release, `ctest -R '^(agc|video_out|shader)'`, against `main` on the same machine. Both GPUs (NVIDIA 615.78.08; Mesa 26.2.6) show no difference from `main`, and `agc_driver_pending_untracked_layer` passes on both. No validation layer was installed there. - **7219255b4d, a merge of `main` ea32608486** ([×10](https://github.com/EagleBearerYS/AnyPS5/actions/runs/43571652487), [every `agc` test](https://github.com/EagleBearerYS/AnyPS5/actions/runs/43571695181)), which brings JJenkx's #18940 (a pending texture's snapshot at an unwatch covers only the units the unwatched range meets, and when the write-watch query over the whole range fails, each unit is queried on its own). - **The conflict:** `Graphics/src/Texture.cpp`, four hunks, in `StorageTexture::refresh`'s drop rule and in `StorageTexture::writeBackLayers`. Where this PR's lines read the range-wide `tracked` and `compared`, #18940 reads per-unit answers (`unitTracked`, and in the refresh `unitCompared`) when the range query fails. The merge keeps both: - the drop rule takes #18940's per-unit `compared` and `tracked`, and still compares a unit's stamps when a failed walk left its block unknown; - the write-back keeps this PR's `compareUnknown` ahead of #18940's per-layer queries, which run only when it can't answer. Its `unknown` and skip conditions read #18940's `layerTracked` where this PR had `tracked`, with this PR's `!compared[layer]` and `!byBytes` terms kept. So in those lines, a surface with no unknown blocks takes `main`'s path, and one with unknown blocks takes 3317dcb318's. - **Diff:** the other 7 files' changed lines are unchanged, and this PR's diff over `main` stays +776 −46 in 8 files. In `Texture.cpp` the changed lines are the same, on #18940's per-unit names. - **×10:** the set of the 3317dcb318 run, with #18940's five `agc_unwatch_snapshot_scope*` tests. Linux: 51 run, 50 pass, 1 skip (`agc_storage_clear_hand_over`), 0 fail; `agc_driver_pending_untracked_layer` and #18940's five tests pass 10 of 10. Windows: 58 run, 15 pass, 43 skip (no Vulkan device; `agc_driver_pending_untracked_layer` and #18940's five tests are among them), 0 fail. The libc and libkernel suites run 380 and 376 tests on Linux and 410 and 404 on Windows, with 0 failed. They ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes only `precise_wait`'s median bounds on GitHub's hosted runners. - **Every `agc` test, once:** Linux: 1,690 run, 1,582 pass, 106 skip, 2 fail. Windows: 1,728 run, 502 pass, 1,226 skip (no Vulkan device), 0 fail. The two Linux failures are `main`'s: - `agc_driver_global_atomic_csub`: "AGC graphics: global atomic csub without glc: wave64 byte 644 is 146, expected 0"; - `agc_driver_coherent_atomic_loads_enabled`: a 60-second timeout. `main`'s own Linux job fails both, with the same message and the same timeout, at d2949cd806 ([job](https://github.com/boykopovar/AnyPS5/actions/runs/43549645830/job/132332373767)) and at 67ec0f7d8c ([job](https://github.com/boykopovar/AnyPS5/actions/runs/43553714011/job/132335135662)), covered by #19332. - **The Windows tree:** both runs had Sankalp7317's 4-line `_putenv_s` test fix ([#19899](https://github.com/boykopovar/AnyPS5/pull/19899)) on top, because `main`'s Windows test build breaks without it ("'setenv' was not declared" in `UploadCacheReadOnlyFlush.cpp`, from #18037); it isn't on this branch. The first runs, on this head alone ([×10](https://github.com/EagleBearerYS/AnyPS5/actions/runs/43565590442), [every `agc` test](https://github.com/EagleBearerYS/AnyPS5/actions/runs/43565657516)), gave the same Linux results, and their Windows builds stopped at that error. - **No GPU run on 7219255b4d.** - **a124bdd5c4, a merge of `main` 790e9a371c** ([×10](https://github.com/EagleBearerYS/AnyPS5/actions/runs/43757084700), [×10 with the Windows test fix](https://github.com/EagleBearerYS/AnyPS5/actions/runs/43765299084), [every `agc` test](https://github.com/EagleBearerYS/AnyPS5/actions/runs/43757137887)), which brings Ducengarth's #17788 (a storage image's upload copy is renewed when its range leaves the write watch). - **The conflict:** `docs/dev/debt/libSceAgcDriver.md` only. #17788 rewrote the "Units without a baseline outside the write watch" entry, right before this PR's four entries. The file merges with `merge=union`, which would keep the old copy of that entry next to the new one, so the merge takes #17788's entry and keeps this PR's four after it. - **Diff:** this PR's changed lines are the same in all 8 files, and its diff over `main` stays +776 −46. Only context lines moved: that debt entry, and chitters2004's #17766 lines next to this PR's in `tests/CollectMemoGeneration.cpp`. `Texture.cpp`, where #17788 also changes `StorageTexture`, merged without a conflict. - **×10:** the set of the 7219255b4d run. Linux: 54 run, 53 pass, 1 skip (`agc_storage_clear_hand_over`), 0 fail. Windows: 64 run, 19 pass, 45 skip (no Vulkan device), 0 fail. The libc and libkernel suites run 388 and 384 tests on Linux and 418 and 412 on Windows, with 0 failed. They ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes only `precise_wait`'s median bounds on GitHub's hosted runners. - **Every `agc` test, once, on Linux:** 1,801 run, 1,677 pass, 114 skip, 10 fail. - Seven also fail in `main`'s own Linux job at 3e1b183e43 ([job](https://github.com/boykopovar/AnyPS5/actions/runs/43752627274/job/132933973639)): `agc_driver_global_atomic_csub`, `agc_driver_stencil_copy_draw`, `agc_driver_coherent_atomic_loads_enabled`, `agc_driver_image_table_packed_guards`, `agc_driver_recorder`, `agc_draw_input_mirrors` and `agc_draw_input_reuse`. - The other three passed there: `agc_driver_frame_replay_rewind_copy` ("FAILED: no memory delta was read while 1 submissions waited for the CPU") and the `agc_driver_runtime_buffer_spans_x3_spans` and `_x4_spans` timeouts. Over 10 runs of `main` 790e9a371c with #19899's test-only commit on top ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/43765537506)), all three fail too, `frame_replay_rewind_copy` with the same message. Over 10 runs of this merge ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/43765483530)), `frame_replay_rewind_copy` passes 10 of 10, and the span tests fail as on `main`. - **The Windows tree:** as for 7219255b4d, the Windows runs had Sankalp7317's [#19899](https://github.com/boykopovar/AnyPS5/pull/19899) on top, since `main`'s Windows test build still stops at "'setenv' was not declared" in `UploadCacheReadOnlyFlush.cpp` (from #18037). It isn't on this branch. The Windows builds of the first ×10 and of the `agc` run, on this head alone, stopped at that error. - **No GPU run on a124bdd5c4.** - **095d749357, a merge of `main` 0694c4cbd6** ([×10](https://github.com/EagleBearerYS/AnyPS5/actions/runs/43818810072), [every `agc` test](https://github.com/EagleBearerYS/AnyPS5/actions/runs/43818889560)), which brings klosixgaming-arch's #19071 (settled imports under live storage images go back to the write watch). - **The conflict:** the four hunks in `Graphics/src/Texture.cpp` planned under Overlap, resolved as described there. The declarations keep this PR's `unknownBlocks` and #19071's `rewatchCompared`. `scanBlocks` keeps this PR's `ChangedBlocks` read, taken only when the surface's own collect succeeded, with #19071's `confirmRewatched` call after it. `droppable` keeps both cases in one condition. `writeBackLayers` keeps this PR's `unknownBlocks`, and #19071's `confirmRewatched` call now follows this PR's `walked && ChangedBlocks` line. - **Diff:** over `main` it is +777 −47 in the same 8 files, against +776 −46 before. The changed lines are the same, apart from where #19071's code meets this PR's: the `droppable` condition this PR extends now also holds #19071's rewatched-unit case, and #19071's `confirmRewatched` call in `writeBackLayers` moves after this PR's `ChangedBlocks` line. - **×10:** the set of the a124bdd5c4 run. Linux: 55 run, 54 pass, 1 skip (`agc_storage_clear_hand_over`), 0 fail. Windows: 66 run, 19 pass, 47 skip (no Vulkan device), 0 fail. The libc and libkernel suites run 391 and 390 tests on Linux and 421 and 417 on Windows. On Windows, 0 failed. On Linux, libkernel's `guest_thermal_sensors` reached its 20 s timeout. It times out in every run I have on GitHub's Intel Xeon 6975P-C runners, `main` 0694c4cbd6 alone included ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/43832502375)), and passes on GitHub's other runners and in `main`'s own job. This PR changes no libkernel file. The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes only `precise_wait`'s median bounds on GitHub's hosted runners. - **Every `agc` test, once:** Linux: 1,867 run, 1,739 pass, 116 skip, 12 fail. Windows: 1,909 run, 558 pass, 1,351 skip (no Vulkan device), 0 fail. - Eight also fail in `main`'s own Linux job at 0694c4cbd6 ([job](https://github.com/boykopovar/AnyPS5/actions/runs/43817785545/job/133149144450)): `agc_driver_global_atomic_csub`, `agc_driver_stencil_copy_draw`, `agc_driver_coherent_atomic_loads_enabled`, `agc_hook_clear_access`, `agc_hook_clear_access_off`, `agc_driver_recorder`, `agc_draw_input_mirrors` and `agc_draw_input_reuse`. - `agc_driver_image_table_packed_guards` fails the same way in `main`'s own Linux job at e249fc47b5 ([job](https://github.com/boykopovar/AnyPS5/actions/runs/43816702928/job/133145283420)): three identical "stage 4 pc 0x68" records, then "unrecoverable packed table format was not poisoned". fernandomcrsilva's open #21255 changes that test. - The `agc_driver_runtime_buffer_spans_x2_spans`, `_x3_spans` and `_x4_spans` timeouts: `main`'s own Linux job passes them at 0694c4cbd6, in 3.09, 3.79 and 4.16 s, and times them out at dcf3d15978 ([job](https://github.com/boykopovar/AnyPS5/actions/runs/43834891663/job/133202991353)), together with `_x4_reference`. On GitHub's runners, ×10 of the span tests with this PR's set in both arms, `main` 0694c4cbd6 ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/43869264030), Intel Xeon 6975P-C) and this merge ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/43869052706), AMD EPYC 9V74) differ by little. The merge's passing medians are 0.99 to 1.12 of `main`'s: `runtime_buffer_spans` 3.92 and 3.90 s, `_x2_reference` 1.55 and 1.66 s, `_x3_reference` 1.89 and 2.08 s, `_fault_stop` 0.205 and 0.230 s, `_fault_barrier` 0.210 and 0.230 s. Its timeouts are the four `main`'s own job shows at dcf3d15978. The two arms ran on different CPUs. For scale, `main`'s own code takes 0.68 to 0.78 of the time on the Xeon that it takes on an AMD EPYC 7763 ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/43853110628)), and two runs of this merge on the same EPYC 9V74 differ from each other by up to 20% ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/43832583077)). - **The Windows tree:** as before, the Windows runs had Sankalp7317's [#19899](https://github.com/boykopovar/AnyPS5/pull/19899) on top; it isn't on this branch. - **A GPU run on 095d749357:** @domx4q's RTX 4090 run with the validation layer (below). - **NVIDIA GeForce RTX 4090, by @domx4q, with the Khronos validation layer** ([comment](https://github.com/boykopovar/AnyPS5/pull/12792#issuecomment-6922565565)): Arch Linux (kernel 7.3.4), GCC 16.2.1 Release, driver 620.70.06, Vulkan 1.4.357, validation layer 1.4.363.1, with `ANYPS5_REQUIRE_VULKAN=1` and `ANYPS5_NO_SHADER_CACHE=1`. This head 095d749357 merged onto `main` e4caa07950 (a clean merge), against `main` e4caa07950 alone, `ctest -R '^agc_(driver_pending|collect_memo_generation|storage|driver_storage|write_tracking|write_watch_coverage|import_watch)'`. `main`: 45 of 45 pass. This PR: 46 of 46 pass, including `agc_driver_pending_untracked_layer`, which `main` doesn't have, run on the RTX 4090 (no skip). No `VUID-` line on either side, and every device test selected the RTX 4090. - **Ghost of Tsushima Director's Cut (PPSA02225) on plain `main`, by @milescoviello** ([comment](https://github.com/boykopovar/AnyPS5/pull/12792#issuecomment-6965840017)): Ubuntu 26.04.1, NVIDIA GeForce RTX 4070 Ti (driver 615.71.09), Release libraries, `main` eb20410673 against its merge with 095d749357, 3 runs per arm of up to 600 s from a pinned save with a cold shader cache. - **The line:** every run logs `keeping the CPU's blocks` 8 times, all during setup. Without the stack above, this title doesn't reach the per-frame case, so the run can't show the fix, as expected. - **The rest:** after Continue the screen stays black in both arms. A phase of 1-2 presents per 10 s, at 1-4 s of GPU per present, came in one `main` run and two of this PR's runs; they read it as varying from run to run rather than following the change. The two PR runs with the most of it also had the highest RSS (25.0 and 24.1 GB, one killed at the 22G cap at 393 s, against 19.2 to 20.3 GB for `main`). `main`'s third run entered the same phase and was killed at 237 s, so they don't read the memory difference as coming from this PR. ### Overlap - **#19071** (klosixgaming-arch) returns settled imports under live storage images to the write watch. It has merged, first, as planned. Its four hunks in `Graphics/src/Texture.cpp`, in `StorageTexture::Refresh` and `StorageTexture::writeBackLayers`, conflicted with this PR, and the merge of `main` 0694c4cbd6 resolves them like this (see Tested): - **The declarations:** this PR's `unknownBlocks` and #19071's `rewatchCompared` are added on the same line, and both are kept. - **`scanBlocks` and `writeBackLayers`:** this PR reads `ChangedBlocks` only when the surface's own collect succeeded, and moves `main`'s `awaitStoredSave` into its `!tracked` path, after the unknown-block compare. #19071 calls `confirmRewatched` after `main`'s `ChangedBlocks` call. The merge keeps this PR's lines and calls `confirmRewatched` after this PR's `ChangedBlocks` call, with #19071's conditions. - **`droppable`:** both add a case to the same condition, this PR's unknown blocks and #19071's rewatched units, and both are kept. - **#24008** (chitters2004) closes two write-watch report races on Linux in `libc/src/GuestWriteWatch.cpp`: a fresh range is protected before it is reported, and each `Fanout` re-resolves its alias translations when a link changes during a collect. It conflicts with this PR in four hunks, in `Collect`, `CollectFresh`, `CollectArmed` and `Fanout::Report` (`git merge-tree` of its 895760f025 and this PR's 095d749357; each merges cleanly with `main` d50640e264 on its own). Proposed order: #24008 first, and this PR then resolves the conflict keeping both sides ([note](https://github.com/boykopovar/AnyPS5/pull/24008#issuecomment-7029419115)): - **`Fanout`:** carries both PRs' members, #24008's watch, range, link version and refreshed translations, and this PR's `unreached`. Every `Fanout` is built with all of them, including this PR's constructions in `CollectArmed`'s uncovered-range path and in `unreachAliases`, which merge without a text conflict; `unreachAliases` stops being `static` so it can pass the watch. - **The calls:** `takeFresh` and `scanWritten` take this PR's unreached report beside `Fanout::Report`, and this PR's failure paths, which report the remaining aliases as unreached before returning `false`, are kept. `ReportUnreached` calls #24008's `refresh()` before it fans out, as `Report` does, so an unreached range also reaches a view linked during the collect. - **Tests:** whichever goes second runs #24008's `agc_write_tracking` tests and this PR's `agc_driver_pending_untracked_layer`, `^agc_storage` and `^agc_driver_storage` tests on the merged tree. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: #24008 (merge order only); #19071 has merged, and the merge of `main` 0694c4cbd6 keeps both - [x] Fixes: none - [x] Unblocks: PPSA02225 #5166 (with the stack above) - [x] GPUs tested: lavapipe (llvmpipe, LLVM 20.1.2), Ubuntu 24.04; NVIDIA GeForce RTX 4060 Laptop GPU, Windows 11 (the reporter's title run); AMD Radeon RX 6700 XT, RADV (Linux, crastinator); NVIDIA RTX 2000 Ada Generation (Linux, TechLevelZero's NVIDIA GPU test); AMD Radeon RX 6300, RADV (Linux, TechLevelZero's AMD GPU test); NVIDIA GeForce RTX 3070 Laptop GPU, Windows 11 (the Windows case); NVIDIA GeForce RTX 3070 Ti and Intel UHD Graphics 630 (Linux, Lucke0051); NVIDIA GeForce RTX 4090 (driver 620.70.06, Arch Linux, with the validation layer), by @domx4q; NVIDIA GeForce RTX 4070 Ti (driver 615.71.09, Ubuntu 26.04.1, Ghost of Tsushima on plain `main`, which doesn't reach the case), by @milescoviello - [x] AI-assisted: yes
mashingaan commented 2026-11-02 20:42:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by mashingaan on 2026-11-02T20:42:59Z.

Review: CHANGES_REQUESTED


The current head still has the same-value CPU-store loss described in the earlier issue review. The new test only writes a distinct value in another block, so it does not exercise the case where the guest bytes equal the saved baseline but a real CPU store must still win. Please preserve successful CPU-write provenance across a later failed page walk, or otherwise distinguish confirmed writes from synthetic failure stamps, and cover both Refresh and direct write-back.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5743044578 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12792#pullrequestreview-5743044578). Originally posted by [mashingaan](https://github.com/mashingaan) on 2026-11-02T20:42:59Z. **Review:** CHANGES_REQUESTED --- The current head still has the same-value CPU-store loss described in the earlier issue review. The new test only writes a distinct value in another block, so it does not exercise the case where the guest bytes equal the saved baseline but a real CPU store must still win. Please preserve successful CPU-write provenance across a later failed page walk, or otherwise distinguish confirmed writes from synthetic failure stamps, and cover both Refresh and direct write-back.
XairRrR commented 2026-11-02 20:54:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-02T20:54:00Z.

Review: CHANGES_REQUESTED


Reviewed — changes requested

The fix builds, the new test passes and fails on main's Texture.cpp, but I reproduced the open same-value-store point. When the walk fails on a later page, GPU results overwrite a CPU store that the successful part of the walk had recorded. The path that walks the whole surface keeps that store.

What I ran

Head 5e106c566dda63169ca2accc08b7b0008994918d, main 9090972b7e91fd266819cbd77a8b058e177b5682, merged tree d50c2a238617b5054bb243dbd17474bd57ec10db. Debian 13 VM, Xeon Gold 6136, GCC 14.2.0, lavapipe (Mesa 26.1.6, LLVM 19), Release.

git diff --check 9090972b7e91fd266819cbd77a8b058e177b5682...5e106c566dda63169ca2accc08b7b0008994918d
python3 tools/check_conventions.py --base 9090972b7e91fd266819cbd77a8b058e177b5682
ctest --test-dir build -R '^agc_driver_pending_untracked_layer$' --repeat until-fail:3 --output-on-failure
build/tests/agc_driver_pending_untracked_layer_tests
# negative control
git show 9090972b7e91fd266819cbd77a8b058e177b5682:core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp > core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
ninja -C build agc_driver_pending_untracked_layer_tests
build/tests/agc_driver_pending_untracked_layer_tests   # x3
# same-value probe (temporary local edit of the test, merged Texture.cpp)
ninja -C build agc_driver_pending_untracked_layer_tests
build/tests/agc_driver_pending_untracked_layer_tests   # x3
# restore merged files, rebuild, rerun, git status --porcelain (clean)

Results

Check Result
git diff --check clean
check_conventions.py passed
Build (script) and the tests it selected 2033 ran, 0 new failures, 0 timeouts; the 7 known failures also fail on main
Vulkan validation comparison (script) 758 tests, layer loaded in 757 and missing in none, 0 new VUIDs
agc_driver_pending_untracked_layer (merged) passed 3/3, about 0.6 s; all four cases ran (no not run line)
Negative control (main's Texture.cpp) failed 3/3
Same-value CPU store probe the CPU store is lost when the walk fails (see below)
Negative control output (each of 3 runs)
[pending untracked layer] results over a surface whose walk fails: the image holds 0 of 8 results, guest memory 0, CPU words 0, CPU write reported 1
[pending untracked layer] results and a CPU store over a surface whose walk fails: the image holds 0 of 8 results, guest memory 0, CPU words 1, CPU write reported 1
AGC graphics: pending storage results or a CPU store over a write-watched surface were lost
exit=1
Same-value probe output (identical in 3 of 3 runs)

What the probe does: after the first store (guest holds Stored, which is also the saved baseline), the StoreAgainCode result is held pending. The CPU then stores Stored again to the first result word, in block 0, and Refresh runs. One case remaps the block 3 page (LoseWalk), so the walk succeeds over block 0 and fails later. The other case keeps the walk complete.

[probe] same-value store, walk fails: image 8 StoredAgain, guest 8 StoredAgain, 0 Stored
[probe] same-value store, walk complete: image 0 StoredAgain, guest 0 StoredAgain, 8 Stored
  • Walk complete: the existing tracked path sees the CPU store in block 0 and leaves the block to the CPU.
  • Walk fails on block 3: the same store, in a block the walk reached, is discarded and the GPU results overwrite it.

The probe's non-zero exit came only from the probe case's own pass condition. It was a local edit and is not part of the PR.

Negative control

I restored core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp from main and rebuilt the test executable:

  • On main's code: the new test failed 3 of 3 runs, in cases 1 and 2, matching the description's main column.
  • After restoring the merged file: it passes.

git status --porcelain was empty afterwards.

Findings

Blocking

  1. A failed walk on a later page discards confirmed CPU stores from the part the walk reached. This is at core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp:2355-2363 for the refresh, and at Texture.cpp:6490 and Texture.cpp:6500 for the write-back.
    • What the code does: when current == 0 or walked is false, both paths drop every stamp from ChangedBlocks and decide only by comparing bytes with the saved baseline.
    • Why it matters: a CPU store that writes back the baseline value, in a block whose pages were walked and stamped, now reads as unchanged. The pending GPU results then win over it. Normally the CPU wins whenever the watch saw it write while results were pending.
    • Status: oneandonlydean raised this in the 2026-10-29 review and mashingaan in the change request on this head. The reply describes a plan, but no change has been pushed. The probe above is new evidence that it happens on the merged tree.
    • Debt entry: docs/dev/debt/libSceAgcDriver.md:193 does not record this loss.
    • Suggested fix: keep the stamps for the pages the walk reached, and treat only the unreached part as unknown. For example, stop scanWritten from stamping [cursor, end) as CPU writes, or report that part separately. Compare bytes only for blocks in the unreached part.
    • Test: add a same-value store case with the failure on an unrelated later page, for Refresh and for a direct write-back with no Refresh first.

Non-blocking

  1. A later skipped case can hide an earlier failure. At core/libs/prx/libSceAgcDriver/tests/execution/PendingUntrackedLayer.cpp:372, main() returns VulkanTestSkipped on the first NotRun, even when an earlier case already came back Lost. oneandonlydean raised this on 2026-10-29 and it is still there. Fail when kept is already false before returning 77, or skip only the cases that cannot run.
  2. The Windows path has no test. The new executable always skips on Windows, so the production path the description names for Windows (collectWindowsWrites failing, then noteRefusedWalk) is not tested. The debt entry should at least say so if no test can reach it.

Not verified

  • Windows: not built or run here, including the noteRefusedWalk path.
  • Hardware GPUs: only lavapipe here. The RADV and NVIDIA runs in the discussion were not repeated.
  • The title: Ghost of Tsushima (PPSA02225) was not launched, so the title evidence was not checked.
  • Probe coverage: the probe covers only Refresh on Linux, with a page remapped by the test. I did not build a direct write-back variant.

To get this to a good state

  • Keep the stamps: keep the walk's CPU stamps for the pages it reached, and limit the byte comparison to the part it did not reach. Cover this with a same-value store test, for Refresh and for a direct write-back.
  • Fix the skip: make the test fail rather than skip when an earlier case was lost.
  • Update the debt entry: have it state what is still open after the fix, including the missing Windows coverage.
  • Ask for re-review: re-request review from mashingaan once it is pushed.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5743180342 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12792#pullrequestreview-5743180342). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-02T20:54:00Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested The fix builds, the new test passes and fails on `main`'s `Texture.cpp`, but I reproduced the open same-value-store point. When the walk fails on a later page, GPU results overwrite a CPU store that the successful part of the walk had recorded. The path that walks the whole surface keeps that store. ## What I ran Head `5e106c566dda63169ca2accc08b7b0008994918d`, `main` `9090972b7e91fd266819cbd77a8b058e177b5682`, merged tree `d50c2a238617b5054bb243dbd17474bd57ec10db`. Debian 13 VM, Xeon Gold 6136, GCC 14.2.0, lavapipe (Mesa 26.1.6, LLVM 19), Release. ``` git diff --check 9090972b7e91fd266819cbd77a8b058e177b5682...5e106c566dda63169ca2accc08b7b0008994918d python3 tools/check_conventions.py --base 9090972b7e91fd266819cbd77a8b058e177b5682 ctest --test-dir build -R '^agc_driver_pending_untracked_layer$' --repeat until-fail:3 --output-on-failure build/tests/agc_driver_pending_untracked_layer_tests # negative control git show 9090972b7e91fd266819cbd77a8b058e177b5682:core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp > core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp ninja -C build agc_driver_pending_untracked_layer_tests build/tests/agc_driver_pending_untracked_layer_tests # x3 # same-value probe (temporary local edit of the test, merged Texture.cpp) ninja -C build agc_driver_pending_untracked_layer_tests build/tests/agc_driver_pending_untracked_layer_tests # x3 # restore merged files, rebuild, rerun, git status --porcelain (clean) ``` ## Results | Check | Result | |---|---| | `git diff --check` | clean | | `check_conventions.py` | passed | | Build (script) and the tests it selected | 2033 ran, 0 new failures, 0 timeouts; the 7 known failures also fail on `main` | | Vulkan validation comparison (script) | 758 tests, layer loaded in 757 and missing in none, 0 new VUIDs | | `agc_driver_pending_untracked_layer` (merged) | passed 3/3, about 0.6 s; all four cases ran (no `not run` line) | | Negative control (`main`'s `Texture.cpp`) | failed 3/3 | | Same-value CPU store probe | the CPU store is lost when the walk fails (see below) | <details><summary>Negative control output (each of 3 runs)</summary> ``` [pending untracked layer] results over a surface whose walk fails: the image holds 0 of 8 results, guest memory 0, CPU words 0, CPU write reported 1 [pending untracked layer] results and a CPU store over a surface whose walk fails: the image holds 0 of 8 results, guest memory 0, CPU words 1, CPU write reported 1 AGC graphics: pending storage results or a CPU store over a write-watched surface were lost exit=1 ``` </details> <details><summary>Same-value probe output (identical in 3 of 3 runs)</summary> What the probe does: after the first store (guest holds `Stored`, which is also the saved baseline), the `StoreAgainCode` result is held pending. The CPU then stores `Stored` again to the first result word, in block 0, and `Refresh` runs. One case remaps the block 3 page (`LoseWalk`), so the walk succeeds over block 0 and fails later. The other case keeps the walk complete. ``` [probe] same-value store, walk fails: image 8 StoredAgain, guest 8 StoredAgain, 0 Stored [probe] same-value store, walk complete: image 0 StoredAgain, guest 0 StoredAgain, 8 Stored ``` - **Walk complete:** the existing tracked path sees the CPU store in block 0 and leaves the block to the CPU. - **Walk fails on block 3:** the same store, in a block the walk reached, is discarded and the GPU results overwrite it. The probe's non-zero exit came only from the probe case's own pass condition. It was a local edit and is not part of the PR. </details> ## Negative control I restored `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` from `main` and rebuilt the test executable: - **On `main`'s code:** the new test failed 3 of 3 runs, in cases 1 and 2, matching the description's main column. - **After restoring the merged file:** it passes. `git status --porcelain` was empty afterwards. ## Findings ### Blocking 1. **A failed walk on a later page discards confirmed CPU stores from the part the walk reached.** This is at `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp:2355-2363` for the refresh, and at `Texture.cpp:6490` and `Texture.cpp:6500` for the write-back. - **What the code does:** when `current == 0` or `walked` is false, both paths drop every stamp from `ChangedBlocks` and decide only by comparing bytes with the saved baseline. - **Why it matters:** a CPU store that writes back the baseline value, in a block whose pages were walked and stamped, now reads as unchanged. The pending GPU results then win over it. Normally the CPU wins whenever the watch saw it write while results were pending. - **Status:** oneandonlydean raised this in the 2026-10-29 review and mashingaan in the change request on this head. The reply describes a plan, but no change has been pushed. The probe above is new evidence that it happens on the merged tree. - **Debt entry:** `docs/dev/debt/libSceAgcDriver.md:193` does not record this loss. - **Suggested fix:** keep the stamps for the pages the walk reached, and treat only the unreached part as unknown. For example, stop `scanWritten` from stamping `[cursor, end)` as CPU writes, or report that part separately. Compare bytes only for blocks in the unreached part. - **Test:** add a same-value store case with the failure on an unrelated later page, for `Refresh` and for a direct write-back with no `Refresh` first. ### Non-blocking 1. **A later skipped case can hide an earlier failure.** At `core/libs/prx/libSceAgcDriver/tests/execution/PendingUntrackedLayer.cpp:372`, `main()` returns `VulkanTestSkipped` on the first `NotRun`, even when an earlier case already came back `Lost`. oneandonlydean raised this on 2026-10-29 and it is still there. Fail when `kept` is already false before returning 77, or skip only the cases that cannot run. 2. **The Windows path has no test.** The new executable always skips on Windows, so the production path the description names for Windows (`collectWindowsWrites` failing, then `noteRefusedWalk`) is not tested. The debt entry should at least say so if no test can reach it. ## Not verified - **Windows:** not built or run here, including the `noteRefusedWalk` path. - **Hardware GPUs:** only lavapipe here. The RADV and NVIDIA runs in the discussion were not repeated. - **The title:** Ghost of Tsushima (PPSA02225) was not launched, so the title evidence was not checked. - **Probe coverage:** the probe covers only `Refresh` on Linux, with a page remapped by the test. I did not build a direct write-back variant. ## To get this to a good state - **Keep the stamps:** keep the walk's CPU stamps for the pages it reached, and limit the byte comparison to the part it did not reach. Cover this with a same-value store test, for `Refresh` and for a direct write-back. - **Fix the skip:** make the test fail rather than skip when an earlier case was lost. - **Update the debt entry:** have it state what is still open after the fix, including the missing Windows coverage. - **Ask for re-review:** re-request review from mashingaan once it is pushed. <!-- anyps5-bots job=1917 head=5e106c566dda63169ca2accc08b7b0008994918d -->
XairRrR commented 2026-11-02 22:25:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-02T22:25:02Z.

Review: CHANGES_REQUESTED


Re-checked — changes still requested

The one new commit, 81ad915d78, changes how the test handles a skipped case: an earlier failure now fails the test instead of being reported as a skip. Texture.cpp did not change, so the blocking same-value CPU-store loss from my last review is still open.

What changed since my last review

  • New commit 81ad915d78: it changes only PendingUntrackedLayer.cpp. A case that cannot run (NotRun) is now noted and skipped over. main() checks that no case was Lost before it returns 77.
  • Same production code: git diff 5e106c566d 81ad915d78 touches no other file. Texture.cpp and the debt entry are the same as in the head I reviewed last time.
  • Author reply (2026-11-02): EagleBearerYS agrees with the same-value-store point. They describe a fix: keep the confirmed stamps and compare only the blocks the walk never reached, with tests for Refresh, a direct write-back, and Windows. None of it has been pushed yet.

What I ran

Head 81ad915d786415669b61143d7bb202272ab521a2, main 9090972b7e91fd266819cbd77a8b058e177b5682, merged tree 0036d44d39bfe7ff176afa824122aca64a268a47. Debian 13 VM, Xeon Gold 6136, GCC 14.2.0, lavapipe (Mesa 26.1.6, LLVM 19), Release.

git diff --check 9090972b7e91fd266819cbd77a8b058e177b5682...81ad915d786415669b61143d7bb202272ab521a2
python3 tools/check_conventions.py --base 9090972b7e91fd266819cbd77a8b058e177b5682
git diff 5e106c566dda63169ca2accc08b7b0008994918d 81ad915d786415669b61143d7bb202272ab521a2
ctest --test-dir build -R '^agc_driver_pending_untracked_layer$' --repeat until-fail:3 --output-on-failure
# negative control
git show 9090972b7e91fd266819cbd77a8b058e177b5682:core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp > core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
ninja -C build -j32 -l32 agc_driver_pending_untracked_layer_tests
ctest --test-dir build -R '^agc_driver_pending_untracked_layer$' --output-on-failure   # x3
# restore
git show 0036d44d39bfe7ff176afa824122aca64a268a47:core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp > core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
ninja -C build -j32 -l32 agc_driver_pending_untracked_layer_tests
ctest --test-dir build -R '^agc_driver_pending_untracked_layer$'
git status --porcelain
Check Result
git diff --check clean
check_conventions.py passed
Build and selected tests (script) 2033 tests ran, with 0 new failures and 0 timeouts. The 7 known failures also fail on main.
Vulkan validation comparison (script) 758 tests ran. The layer loaded in 757, with no test reported missing it, and there were 0 new VUIDs.
agc_driver_pending_untracked_layer (merged tree) passed 3/3, about 0.5 s per run
Negative control (main's Texture.cpp) failed 3/3, in cases 1 and 2; passes again once the merged file is restored
git status --porcelain after the restore empty
Negative control output (identical in all 3 runs)
[pending untracked layer] results over a surface whose walk fails: the image holds 0 of 8 results, guest memory 0, CPU words 0, CPU write reported 1
[pending untracked layer] results and a CPU store over a surface whose walk fails: the image holds 0 of 8 results, guest memory 0, CPU words 1, CPU write reported 1
AGC graphics: pending storage results or a CPU store over a write-watched surface were lost

Previous findings

  • Blocking 1, a failed walk on a later page discards confirmed CPU stores: still open.
    • Evidence: Texture.cpp is the same as in the head I reviewed last time. On a failed walk, core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp:2355-2360 still overwrites every stamp. The write-back does the same at Texture.cpp:6490 and Texture.cpp:6500.
    • Effect: my same-value probe from the last review still applies. When the walk fails on a later page, the GPU results overwrite a CPU store in a block the walk did reach.
    • Debt entry: docs/dev/debt/libSceAgcDriver.md:193 still does not record this loss.
    • Author's position: the author agrees, and the plan in their reply would address it once it is pushed.
  • Non-blocking 1, a later skipped case can hide an earlier failure: resolved.
    • Evidence: PendingUntrackedLayer.cpp:368-380 now sets notRun, finishes the loop, calls Require(kept, ...), and only then returns VulkanTestSkipped. A Lost outcome therefore fails the test even when a later case cannot run.
    • How I checked: by reading the code. On this machine all four cases run, so the skip branch was not exercised.
  • Non-blocking 2, no test reaches the Windows path: still open. The executable still returns 77 on _WIN32. The author's reply plans a Windows case through GuestArenaCompareWhenShared_nid_no_patch, but none has been pushed.

New findings

Blocking

None beyond the open finding above.

Non-blocking

None.

Not verified

  • Windows: not built or run here.
  • Hardware GPUs: only lavapipe here. The RADV and NVIDIA runs in the discussion were not repeated.
  • The skip branch: it never ran here, because all four cases ran.
  • The title: Ghost of Tsushima (PPSA02225) was not launched.

To get this to a good state

  • Keep the stamps: push the planned fix. Keep the confirmed CPU stamps for the pages the walk reached, and compare bytes only for the blocks it never reached.
  • Add the same-value test: cover a same-value CPU store with a failed walk on an unrelated later page, through Refresh and through a direct write-back with no Refresh before it. Each should fail without the fix and pass with it.
  • Update the debt entry: have it state what is still open after the fix, including Windows coverage if no Windows test lands.
  • Ask for re-review: re-request review from the reviewers who asked for changes.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5744287277 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12792#pullrequestreview-5744287277). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-02T22:25:02Z. **Review:** CHANGES_REQUESTED --- # Re-checked — changes still requested The one new commit, 81ad915d78, changes how the test handles a skipped case: an earlier failure now fails the test instead of being reported as a skip. `Texture.cpp` did not change, so the blocking same-value CPU-store loss from my last review is still open. ## What changed since my last review - **New commit `81ad915d78`:** it changes only `PendingUntrackedLayer.cpp`. A case that cannot run (`NotRun`) is now noted and skipped over. `main()` checks that no case was `Lost` before it returns 77. - **Same production code:** `git diff 5e106c566d 81ad915d78` touches no other file. `Texture.cpp` and the debt entry are the same as in the head I reviewed last time. - **Author reply (2026-11-02):** EagleBearerYS agrees with the same-value-store point. They describe a fix: keep the confirmed stamps and compare only the blocks the walk never reached, with tests for `Refresh`, a direct write-back, and Windows. None of it has been pushed yet. ## What I ran Head `81ad915d786415669b61143d7bb202272ab521a2`, `main` `9090972b7e91fd266819cbd77a8b058e177b5682`, merged tree `0036d44d39bfe7ff176afa824122aca64a268a47`. Debian 13 VM, Xeon Gold 6136, GCC 14.2.0, lavapipe (Mesa 26.1.6, LLVM 19), Release. ``` git diff --check 9090972b7e91fd266819cbd77a8b058e177b5682...81ad915d786415669b61143d7bb202272ab521a2 python3 tools/check_conventions.py --base 9090972b7e91fd266819cbd77a8b058e177b5682 git diff 5e106c566dda63169ca2accc08b7b0008994918d 81ad915d786415669b61143d7bb202272ab521a2 ctest --test-dir build -R '^agc_driver_pending_untracked_layer$' --repeat until-fail:3 --output-on-failure # negative control git show 9090972b7e91fd266819cbd77a8b058e177b5682:core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp > core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp ninja -C build -j32 -l32 agc_driver_pending_untracked_layer_tests ctest --test-dir build -R '^agc_driver_pending_untracked_layer$' --output-on-failure # x3 # restore git show 0036d44d39bfe7ff176afa824122aca64a268a47:core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp > core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp ninja -C build -j32 -l32 agc_driver_pending_untracked_layer_tests ctest --test-dir build -R '^agc_driver_pending_untracked_layer$' git status --porcelain ``` | Check | Result | |---|---| | `git diff --check` | clean | | `check_conventions.py` | passed | | Build and selected tests (script) | 2033 tests ran, with 0 new failures and 0 timeouts. The 7 known failures also fail on `main`. | | Vulkan validation comparison (script) | 758 tests ran. The layer loaded in 757, with no test reported missing it, and there were 0 new VUIDs. | | `agc_driver_pending_untracked_layer` (merged tree) | passed 3/3, about 0.5 s per run | | Negative control (`main`'s `Texture.cpp`) | failed 3/3, in cases 1 and 2; passes again once the merged file is restored | | `git status --porcelain` after the restore | empty | <details><summary>Negative control output (identical in all 3 runs)</summary> ``` [pending untracked layer] results over a surface whose walk fails: the image holds 0 of 8 results, guest memory 0, CPU words 0, CPU write reported 1 [pending untracked layer] results and a CPU store over a surface whose walk fails: the image holds 0 of 8 results, guest memory 0, CPU words 1, CPU write reported 1 AGC graphics: pending storage results or a CPU store over a write-watched surface were lost ``` </details> ## Previous findings - **Blocking 1, a failed walk on a later page discards confirmed CPU stores: still open.** - **Evidence:** `Texture.cpp` is the same as in the head I reviewed last time. On a failed walk, `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp:2355-2360` still overwrites every stamp. The write-back does the same at `Texture.cpp:6490` and `Texture.cpp:6500`. - **Effect:** my same-value probe from the last review still applies. When the walk fails on a later page, the GPU results overwrite a CPU store in a block the walk did reach. - **Debt entry:** `docs/dev/debt/libSceAgcDriver.md:193` still does not record this loss. - **Author's position:** the author agrees, and the plan in their reply would address it once it is pushed. - **Non-blocking 1, a later skipped case can hide an earlier failure: resolved.** - **Evidence:** `PendingUntrackedLayer.cpp:368-380` now sets `notRun`, finishes the loop, calls `Require(kept, ...)`, and only then returns `VulkanTestSkipped`. A `Lost` outcome therefore fails the test even when a later case cannot run. - **How I checked:** by reading the code. On this machine all four cases run, so the skip branch was not exercised. - **Non-blocking 2, no test reaches the Windows path: still open.** The executable still returns 77 on `_WIN32`. The author's reply plans a Windows case through `GuestArenaCompareWhenShared_nid_no_patch`, but none has been pushed. ## New findings ### Blocking None beyond the open finding above. ### Non-blocking None. ## Not verified - **Windows:** not built or run here. - **Hardware GPUs:** only lavapipe here. The RADV and NVIDIA runs in the discussion were not repeated. - **The skip branch:** it never ran here, because all four cases ran. - **The title:** Ghost of Tsushima (PPSA02225) was not launched. ## To get this to a good state - **Keep the stamps:** push the planned fix. Keep the confirmed CPU stamps for the pages the walk reached, and compare bytes only for the blocks it never reached. - **Add the same-value test:** cover a same-value CPU store with a failed walk on an unrelated later page, through `Refresh` and through a direct write-back with no `Refresh` before it. Each should fail without the fix and pass with it. - **Update the debt entry:** have it state what is still open after the fix, including Windows coverage if no Windows test lands. - **Ask for re-review:** re-request review from the reviewers who asked for changes. <!-- anyps5-bots job=2634 head=81ad915d786415669b61143d7bb202272ab521a2 -->
XairRrR commented 2026-11-03 06:11:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T06:11:18Z.

Review: APPROVED


Re-checked — approved

New commits 89c782b89e, 37a0eb949a and 51249fede2 resolve the blocking finding. A failed walk now keeps the CPU stores it saw before it stopped. The new same-value cases fail with this PR's earlier Texture.cpp and pass now, and the test also runs on Windows.

What changed since my last review

I last reviewed 81ad915d78. Since then:

  • 89c782b89e, a production change:
    • On Linux, a PAGEMAP_SCAN that fails now reports the regions the kernel wrote out before the error. It also reports the rest of the range as unreached, through the new GuestWriteWatchCollect(Armed)Reporting_nid_postfix exports.
    • The tracker keeps each page's real CPU stamp under the synthetic one (noteUnreached, provenCpuStore).
    • A new ChangedBlocks overload marks each block as known, CPU-confirmed or unknown.
    • StorageTexture::refresh and writeBackLayers compare bytes only for unknown blocks.
    • On the failed-walk path, the write-back leaves a block the walk saw the CPU write to the CPU whatever its bytes (cpuSeen).
  • 37a0eb949a: adds the same-value store cases through Refresh and through a direct write-back.
  • 51249fede2: the test runs on Windows, where the walk is refused over a compared shared page. It also adds a case that stores a different value, then does a direct write-back. The Windows same-value write-back case is excluded there and recorded as debt.
  • 4e4cba9535, a merge of main: it widens the new tracker fields to 64-bit, and the test runs every case a second time with the generation past 2^32.
  • Debt file: three entries in docs/dev/debt/libSceAgcDriver.md.
  • Author replies: two, on 2026-11-03. The first suspected a Windows regression. The second retracts it after a GPU run, saying the surface's other blocks are collected one block at a time and keep their stamps.

What I ran

Head 4e4cba95350d08a31066b643fe1a2f286f576215, main d1ae628bc2f62459cce1e9872ba5632c938c71f2, merged tree d95e062d196a92cd78b9eb7e4c3fc108866c8a41. Debian 13 VM, Xeon Gold 6136, GCC 14.2.0, lavapipe (Mesa 26.1.6, LLVM 19), Release.

git diff --check d1ae628bc2f62459cce1e9872ba5632c938c71f2...4e4cba95350d08a31066b643fe1a2f286f576215
python3 tools/check_conventions.py --base d1ae628bc2f62459cce1e9872ba5632c938c71f2
ctest --test-dir build -R '^agc_driver_pending_untracked_layer$' --repeat until-fail:3 --output-on-failure
ctest --test-dir build -R '^agc_driver_pending_untracked_layer$' -V      # checked: no "not run"
# negative control A: all production files from main
git show d1ae628bc2:<path> > <path>   # GuestMemory.hpp/.cpp, Texture.cpp, GuestWriteWatch.hpp/.cpp
ninja -C build -j32 -l32 agc_driver_pending_untracked_layer_tests
ctest --test-dir build -R '^agc_driver_pending_untracked_layer$' --output-on-failure   # x3
# negative control B: main + this PR's first-version Texture.cpp change (87b51a63b9)
git show 87b51a63b991 -- core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp | git apply
ninja -C build -j32 -l32 agc_driver_pending_untracked_layer_tests
ctest --test-dir build -R '^agc_driver_pending_untracked_layer$' --output-on-failure   # x3
# restore
git show d95e062d19:<path> > <path>   # same five files
git status --porcelain
ninja -C build -j32 -l32 agc_driver_pending_untracked_layer_tests agc_collect_memo_generation_tests
ctest --test-dir build -j8 --test-load 32 -R '^(agc_driver_pending_untracked_layer|agc_collect_memo_generation|agc_import_watch|agc_write_watch_coverage)$|^agc_storage|^agc_driver_storage|^guest_memory' --output-on-failure
Check Result
git diff --check clean
check_conventions.py passed
Build and selected tests (script) 3670 ran, 0 timeouts. The 8 known failures also fail on main. One new failure, unwrap_self_UnwrapTest_test_new_output_inherits_the_destination_directory_group, is an os.chown EINVAL in a tools/ test inside the sandbox. This PR touches no file under tools/.
Vulkan validation comparison (script) 768 tests ran. The layer loaded in 767, no test reported it missing, and there were 0 new VUIDs.
agc_driver_pending_untracked_layer (merged tree) passed 3 of 3, about 0.5 s per run. All 7 cases ran in both passes, with no not run line.
31 related tests (storage, guest memory, collect memo, import watch, write-watch coverage) 30 passed. 1 skipped, agc_storage_clear_hand_over, because lavapipe makes no watched host import.
git status --porcelain after the restore empty

Negative control

  • A, all five production files from main: the test failed 3 of 3. It failed in cases 1 and 2 and in the same-value direct write-back case, in both generation passes.
    • The same-value refresh case passes on main. That is expected: there, every block of the failed walk is stamped as CPU-written, so the refresh keeps the CPU's block.
  • B, main plus this PR's first-version Texture.cpp change (87b51a63b9): the test failed 3 of 3. Only the two new same-value cases failed, which is the loss my previous review reported.
  • Restore: with the merged files back, the test passes and the worktree is clean.
Control B output (identical in all 3 runs)
[pending untracked layer] a same-value CPU store in a block the walk reached before it failed, then a refresh: guest memory holds 8 results and 0 stored words, the image 8 results and 0 stored words, guest memory after the last flush 8 results and 0 stored words
[pending untracked layer] a same-value CPU store in a block the walk reached before it failed, then a direct write-back: guest memory holds 8 results and 0 stored words, the image 8 results and 0 stored words, guest memory after the last flush 8 results and 0 stored words
(the same two lines again for the pass past 2^32)
AGC graphics: pending storage results or a CPU store over a write-watched surface were lost
Control A output (identical in all 3 runs)
[pending untracked layer] results over a surface whose walk fails: the image holds 0 of 8 results, guest memory 0, CPU words 0, CPU write reported 1
[pending untracked layer] results and a CPU store over a surface whose walk fails: the image holds 0 of 8 results, guest memory 0, CPU words 1, CPU write reported 1
[pending untracked layer] a same-value CPU store in a block the walk reached before it failed, then a direct write-back: guest memory holds 8 results and 0 stored words, the image 8 results and 0 stored words, guest memory after the last flush 8 results and 0 stored words
(the same three lines again for the pass past 2^32)
AGC graphics: pending storage results or a CPU store over a write-watched surface were lost

Previous findings

  • Blocking: a failed walk on a later page discards confirmed CPU stores. Resolved.
    • Stamps kept: core/libs/prx/libc/src/GuestWriteWatch.cpp:218-225 now reports the regions the kernel wrote out before the error, then the unfinished range as unreached. noteUnreached and provenCpuStore (core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp:1218-1257) keep the real stamp under the synthetic one.
    • Only unknown blocks compared: the new ChangedBlocks overload (GuestMemory.cpp:2487) flags only unknown blocks. The refresh compares just those (Texture.cpp:2352), and so does the write-back (Texture.cpp:6539). The write-back's cpuSeen (Texture.cpp:6626-6627) leaves a block the walk saw the CPU write to the CPU.
    • Tests: control B shows the two new cases catch the loss, and the merged tree passes them.
    • Debt: docs/dev/debt/libSceAgcDriver.md:193 records what is still open: a same-value store in a page the walk never reached.
  • Non-blocking: a later skipped case can hide an earlier failure. Resolved in my previous review, and unchanged since.
  • Non-blocking: no test reaches the Windows path. Resolved, as reported by the author.
    • The change: the executable no longer returns 77 on _WIN32. It makes the walk fail through GuestArenaCompareWhenShared_nid_no_patch on a second mapping of block 3.
    • Not run here: I did not build or run it on Windows. The RTX 3070 Laptop results are the author's.
    • What the author reports: on Windows the case also passes on main, so it is coverage, not a red/green. The same-value direct write-back case is excluded there, and docs/dev/debt/libSceAgcDriver.md:194 records that loss.

New findings

Blocking

None.

Non-blocking

None.

Not verified

  • Windows: not built or run here, including the shared-page walk refusal and the excluded same-value write-back case.
  • Hardware GPUs: I only had lavapipe. The RADV and NVIDIA runs in the discussion were not repeated here.
  • The kernel's behaviour: the claim that a failing PAGEMAP_SCAN writes out the regions it found first, and re-protects those pages. I did not run a standalone probe; I only saw that the test passes on this kernel (6.12).
  • The title: Ghost of Tsushima (PPSA02225) was not launched.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5747913508 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12792#pullrequestreview-5747913508). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-03T06:11:18Z. **Review:** APPROVED --- # Re-checked — approved New commits 89c782b89e, 37a0eb949a and 51249fede2 resolve the blocking finding. A failed walk now keeps the CPU stores it saw before it stopped. The new same-value cases fail with this PR's earlier `Texture.cpp` and pass now, and the test also runs on Windows. ## What changed since my last review I last reviewed 81ad915d78. Since then: - **89c782b89e, a production change:** - On Linux, a `PAGEMAP_SCAN` that fails now reports the regions the kernel wrote out before the error. It also reports the rest of the range as unreached, through the new `GuestWriteWatchCollect(Armed)Reporting_nid_postfix` exports. - The tracker keeps each page's real CPU stamp under the synthetic one (`noteUnreached`, `provenCpuStore`). - A new `ChangedBlocks` overload marks each block as known, CPU-confirmed or unknown. - `StorageTexture::refresh` and `writeBackLayers` compare bytes only for unknown blocks. - On the failed-walk path, the write-back leaves a block the walk saw the CPU write to the CPU whatever its bytes (`cpuSeen`). - **37a0eb949a:** adds the same-value store cases through `Refresh` and through a direct write-back. - **51249fede2:** the test runs on Windows, where the walk is refused over a compared shared page. It also adds a case that stores a different value, then does a direct write-back. The Windows same-value write-back case is excluded there and recorded as debt. - **4e4cba9535, a merge of `main`:** it widens the new tracker fields to 64-bit, and the test runs every case a second time with the generation past 2^32. - **Debt file:** three entries in `docs/dev/debt/libSceAgcDriver.md`. - **Author replies:** two, on 2026-11-03. The first suspected a Windows regression. The second retracts it after a GPU run, saying the surface's other blocks are collected one block at a time and keep their stamps. ## What I ran Head `4e4cba95350d08a31066b643fe1a2f286f576215`, `main` `d1ae628bc2f62459cce1e9872ba5632c938c71f2`, merged tree `d95e062d196a92cd78b9eb7e4c3fc108866c8a41`. Debian 13 VM, Xeon Gold 6136, GCC 14.2.0, lavapipe (Mesa 26.1.6, LLVM 19), Release. ``` git diff --check d1ae628bc2f62459cce1e9872ba5632c938c71f2...4e4cba95350d08a31066b643fe1a2f286f576215 python3 tools/check_conventions.py --base d1ae628bc2f62459cce1e9872ba5632c938c71f2 ctest --test-dir build -R '^agc_driver_pending_untracked_layer$' --repeat until-fail:3 --output-on-failure ctest --test-dir build -R '^agc_driver_pending_untracked_layer$' -V # checked: no "not run" # negative control A: all production files from main git show d1ae628bc2:<path> > <path> # GuestMemory.hpp/.cpp, Texture.cpp, GuestWriteWatch.hpp/.cpp ninja -C build -j32 -l32 agc_driver_pending_untracked_layer_tests ctest --test-dir build -R '^agc_driver_pending_untracked_layer$' --output-on-failure # x3 # negative control B: main + this PR's first-version Texture.cpp change (87b51a63b9) git show 87b51a63b991 -- core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp | git apply ninja -C build -j32 -l32 agc_driver_pending_untracked_layer_tests ctest --test-dir build -R '^agc_driver_pending_untracked_layer$' --output-on-failure # x3 # restore git show d95e062d19:<path> > <path> # same five files git status --porcelain ninja -C build -j32 -l32 agc_driver_pending_untracked_layer_tests agc_collect_memo_generation_tests ctest --test-dir build -j8 --test-load 32 -R '^(agc_driver_pending_untracked_layer|agc_collect_memo_generation|agc_import_watch|agc_write_watch_coverage)$|^agc_storage|^agc_driver_storage|^guest_memory' --output-on-failure ``` | Check | Result | |---|---| | `git diff --check` | clean | | `check_conventions.py` | passed | | Build and selected tests (script) | 3670 ran, 0 timeouts. The 8 known failures also fail on `main`. One new failure, `unwrap_self_UnwrapTest_test_new_output_inherits_the_destination_directory_group`, is an `os.chown` EINVAL in a `tools/` test inside the sandbox. This PR touches no file under `tools/`. | | Vulkan validation comparison (script) | 768 tests ran. The layer loaded in 767, no test reported it missing, and there were 0 new VUIDs. | | `agc_driver_pending_untracked_layer` (merged tree) | passed 3 of 3, about 0.5 s per run. All 7 cases ran in both passes, with no `not run` line. | | 31 related tests (storage, guest memory, collect memo, import watch, write-watch coverage) | 30 passed. 1 skipped, `agc_storage_clear_hand_over`, because lavapipe makes no watched host import. | | `git status --porcelain` after the restore | empty | ## Negative control - **A, all five production files from `main`:** the test failed 3 of 3. It failed in cases 1 and 2 and in the same-value direct write-back case, in both generation passes. - The same-value refresh case passes on `main`. That is expected: there, every block of the failed walk is stamped as CPU-written, so the refresh keeps the CPU's block. - **B, `main` plus this PR's first-version `Texture.cpp` change (87b51a63b9):** the test failed 3 of 3. Only the two new same-value cases failed, which is the loss my previous review reported. - **Restore:** with the merged files back, the test passes and the worktree is clean. <details><summary>Control B output (identical in all 3 runs)</summary> ``` [pending untracked layer] a same-value CPU store in a block the walk reached before it failed, then a refresh: guest memory holds 8 results and 0 stored words, the image 8 results and 0 stored words, guest memory after the last flush 8 results and 0 stored words [pending untracked layer] a same-value CPU store in a block the walk reached before it failed, then a direct write-back: guest memory holds 8 results and 0 stored words, the image 8 results and 0 stored words, guest memory after the last flush 8 results and 0 stored words (the same two lines again for the pass past 2^32) AGC graphics: pending storage results or a CPU store over a write-watched surface were lost ``` </details> <details><summary>Control A output (identical in all 3 runs)</summary> ``` [pending untracked layer] results over a surface whose walk fails: the image holds 0 of 8 results, guest memory 0, CPU words 0, CPU write reported 1 [pending untracked layer] results and a CPU store over a surface whose walk fails: the image holds 0 of 8 results, guest memory 0, CPU words 1, CPU write reported 1 [pending untracked layer] a same-value CPU store in a block the walk reached before it failed, then a direct write-back: guest memory holds 8 results and 0 stored words, the image 8 results and 0 stored words, guest memory after the last flush 8 results and 0 stored words (the same three lines again for the pass past 2^32) AGC graphics: pending storage results or a CPU store over a write-watched surface were lost ``` </details> ## Previous findings - **Blocking: a failed walk on a later page discards confirmed CPU stores. Resolved.** - **Stamps kept:** `core/libs/prx/libc/src/GuestWriteWatch.cpp:218-225` now reports the regions the kernel wrote out before the error, then the unfinished range as unreached. `noteUnreached` and `provenCpuStore` (`core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp:1218-1257`) keep the real stamp under the synthetic one. - **Only unknown blocks compared:** the new `ChangedBlocks` overload (`GuestMemory.cpp:2487`) flags only unknown blocks. The refresh compares just those (`Texture.cpp:2352`), and so does the write-back (`Texture.cpp:6539`). The write-back's `cpuSeen` (`Texture.cpp:6626-6627`) leaves a block the walk saw the CPU write to the CPU. - **Tests:** control B shows the two new cases catch the loss, and the merged tree passes them. - **Debt:** `docs/dev/debt/libSceAgcDriver.md:193` records what is still open: a same-value store in a page the walk never reached. - **Non-blocking: a later skipped case can hide an earlier failure. Resolved** in my previous review, and unchanged since. - **Non-blocking: no test reaches the Windows path. Resolved, as reported by the author.** - **The change:** the executable no longer returns 77 on `_WIN32`. It makes the walk fail through `GuestArenaCompareWhenShared_nid_no_patch` on a second mapping of block 3. - **Not run here:** I did not build or run it on Windows. The RTX 3070 Laptop results are the author's. - **What the author reports:** on Windows the case also passes on `main`, so it is coverage, not a red/green. The same-value direct write-back case is excluded there, and `docs/dev/debt/libSceAgcDriver.md:194` records that loss. ## New findings ### Blocking None. ### Non-blocking None. ## Not verified - **Windows:** not built or run here, including the shared-page walk refusal and the excluded same-value write-back case. - **Hardware GPUs:** I only had lavapipe. The RADV and NVIDIA runs in the discussion were not repeated here. - **The kernel's behaviour:** the claim that a failing `PAGEMAP_SCAN` writes out the regions it found first, and re-protects those pages. I did not run a standalone probe; I only saw that the test passes on this kernel (6.12). - **The title:** Ghost of Tsushima (PPSA02225) was not launched. <!-- anyps5-bots job=3007 head=4e4cba95350d08a31066b643fe1a2f286f576215 -->
XairRrR commented 2026-11-03 15:06:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T15:06:02Z.

Review: APPROVED


Re-checked — approved

The only change since my last review is merge 26ed2aec06, which brings in main 4f41f4c375 (#14302). Its conflict resolution in StorageTexture::writeBackLayers is correct, the new test still fails on main's code and passes on the merge, and I found nothing blocking.

What changed since my last review

I last reviewed 4e4cba9535. Since then:

  • The PR's own commits are unchanged. The range-diff (delta.patch) shows 87b51a63b9…51249fede2 as identical.
  • 26ed2aec06 merges main 4f41f4c375. The one conflict was the written condition in writeBackLayers. #14302 replaced !unchangedSinceBaseline(from, to) with !cpuLeftUnchanged(layer, from, to, edge). The merge keeps that and puts this PR's cpuSeen || in front of it, with byBytes where main has compared[layer] (core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp:6679). Compared with main 4f41f4c375, the diff is still +723 −32 in 8 files.
  • PendingUntrackedLayer.cpp, GuestWriteWatch.* and the PR's debt entries are unchanged. Every other difference between 4e4cba9535 and 26ed2aec06 comes from main.
  • The description adds a section for the merge. There are no new author comments.

What I ran

Head 26ed2aec065e159ab16b4f519042b6968039c6dd, main 4f41f4c375f5abb487dbd184fbc150f31994d762, merged tree 093e485ae28cbf12e38f92fda7d5861125a49aaf. Debian 13 VM, Xeon Gold 6136, GCC 14.2.0, lavapipe (Mesa 26.1.6), Release.

git diff --check 4f41f4c375f5abb487dbd184fbc150f31994d762...26ed2aec065e159ab16b4f519042b6968039c6dd
python3 tools/check_conventions.py --base 4f41f4c375f5abb487dbd184fbc150f31994d762
git diff 4f41f4c375 093e485ae2 -- core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
ctest --test-dir build -R '^agc_driver_pending_untracked_layer$' --repeat until-fail:3 --output-on-failure
ctest --test-dir build -V -R '^agc_driver_pending_untracked_layer$'   # no "not run" lines
# control A: the five production files from main 4f41f4c375
git show 4f41f4c375:<path> > <path>
ninja -C build -j32 -l32 agc_driver_pending_untracked_layer_tests
ctest --test-dir build -R '^agc_driver_pending_untracked_layer$' --output-on-failure   # x3
# control B: merged tree with only the `cpuSeen ||` term removed from Texture.cpp:6679
git show 093e485ae2:<path> > <path>; sed -i '6679s/(cpuSeen || !cpuLeftUnchanged(...))/!cpuLeftUnchanged(...)/' Texture.cpp
ninja -C build -j32 -l32 agc_driver_pending_untracked_layer_tests
ctest --test-dir build -R '^agc_driver_pending_untracked_layer$' --output-on-failure   # x3
# restore
git show 093e485ae2:core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp > ...
git status --porcelain
ninja -C build -j32 -l32 agc_driver_pending_untracked_layer_tests agc_collect_memo_generation_tests
ctest --test-dir build -j8 --test-load 32 -R '^(agc_driver_pending_untracked_layer|agc_collect_memo_generation|agc_import_watch|agc_write_watch_coverage)$|^agc_storage|^agc_driver_storage|^agc_driver_pending|^agc_write_tracking|^guest_memory' --output-on-failure
Check Result
git diff --check clean
check_conventions.py passed
Build and selected tests (script) 3701 ran, 0 new failures, 0 timeouts. The 9 failures also fail on main. guest_net_ctl skips for a reason check_skips.py doesn't expect, and it does the same on main.
Vulkan validation comparison (script) 771 tests ran. The layer loaded in 770, no test reported it missing, and there were 0 new VUIDs.
agc_driver_pending_untracked_layer (merged tree) passed 3 of 3, about 0.65 s per run, with no not run line
36 related tests (pending, storage, write tracking, guest memory, collect memo, import watch, write-watch coverage) 35 passed. 1 skipped, agc_storage_clear_hand_over, because lavapipe makes no watched host import.
git status --porcelain after the restore empty

Negative control

  • A, the five production files from main 4f41f4c375: the test fails 3 of 3. Cases 1 and 2 fail in both generation passes, and so does the different-value direct write-back case. Since #14302 is in main, the same-value direct write-back case no longer fails there, so main now loses one case fewer than my last control showed.

    Control A output (the same in all 3 runs; counts are per run)
    2 [pending untracked layer] results over a surface whose walk fails: the image holds 0 of 8 results, guest memory 0, CPU words 0, CPU write reported 1
    2 [pending untracked layer] results and a CPU store over a surface whose walk fails: the image holds 0 of 8 results, guest memory 0, CPU words 1, CPU write reported 1
    2 [pending untracked layer] results and a CPU store over a surface whose walk fails, then a direct write-back: guest memory holds 0 of 8 results and 1 CPU words
    1 AGC graphics: pending storage results or a CPU store over a write-watched surface were lost
    
  • B, the merged tree without the merged-in cpuSeen || term: the test still passes 3 of 3. See the non-blocking finding below.

  • Restore: with the merged file back, the worktree is clean and the test passes.

Previous findings

  • Blocking: a failed walk on a later page discards confirmed CPU stores. Still resolved. The merge keeps the per-block query and the byBytes / cpuSeen logic (Texture.cpp:6677-6679). The same-value refresh and write-back cases pass on the merge.
  • Non-blocking: a later skipped case can hide an earlier failure. Still resolved. The test is unchanged.
  • Non-blocking: no test reaches the Windows path. Resolved, as reported by the author. The test is unchanged, and I did not run it on Windows.

New findings

Blocking

None.

Non-blocking

  • No test covers the cpuSeen term since the merge (core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp:6678-6679).
    • What I saw: in control B, removing cpuSeen || from the merged condition leaves agc_driver_pending_untracked_layer green. #14302's cpuLeftUnchanged (Texture.cpp:6526-6534) now queries the CPU stamps since layerPendingSince, which already keeps a same-value store in a whole 64 KiB block.
    • Why the term is still needed: cpuLeftUnchanged returns true as soon as the bytes are unchanged when edge is set or layerPendingSince[layer] == 0 (Texture.cpp:6528). In those cases a block the failed walk saw the CPU write is still only kept by cpuSeen.
    • Suggested fix: add a case where the same-value store lands in a partial (edge) block of the surface, so that this path has a red/green. Alternatively, record in the debt entry that it is untested.

Not verified

  • Windows: not built or run here, including the refused walk over a shared page and the same-value write-back case the test leaves out on Windows.
  • Hardware GPUs: I only had lavapipe. No hardware GPU run covers this merge yet. The NVIDIA and AMD runs in the discussion are on earlier heads.
  • The kernel: I did not probe on its own how a failing PAGEMAP_SCAN writes out regions. The test passes on this VM's kernel (6.12).
  • The title: Ghost of Tsushima (PPSA02225) was not launched.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5754540137 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12792#pullrequestreview-5754540137). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-03T15:06:02Z. **Review:** APPROVED --- # Re-checked — approved The only change since my last review is merge 26ed2aec06, which brings in `main` 4f41f4c375 (#14302). Its conflict resolution in `StorageTexture::writeBackLayers` is correct, the new test still fails on `main`'s code and passes on the merge, and I found nothing blocking. ## What changed since my last review I last reviewed 4e4cba9535. Since then: - **The PR's own commits are unchanged.** The range-diff (delta.patch) shows 87b51a63b9…51249fede2 as identical. - **26ed2aec06 merges `main` 4f41f4c375.** The one conflict was the `written` condition in `writeBackLayers`. #14302 replaced `!unchangedSinceBaseline(from, to)` with `!cpuLeftUnchanged(layer, from, to, edge)`. The merge keeps that and puts this PR's `cpuSeen ||` in front of it, with `byBytes` where `main` has `compared[layer]` (`core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp:6679`). Compared with `main` 4f41f4c375, the diff is still +723 −32 in 8 files. - `PendingUntrackedLayer.cpp`, `GuestWriteWatch.*` and the PR's debt entries are unchanged. Every other difference between 4e4cba9535 and 26ed2aec06 comes from `main`. - The description adds a section for the merge. There are no new author comments. ## What I ran Head `26ed2aec065e159ab16b4f519042b6968039c6dd`, `main` `4f41f4c375f5abb487dbd184fbc150f31994d762`, merged tree `093e485ae28cbf12e38f92fda7d5861125a49aaf`. Debian 13 VM, Xeon Gold 6136, GCC 14.2.0, lavapipe (Mesa 26.1.6), Release. ``` git diff --check 4f41f4c375f5abb487dbd184fbc150f31994d762...26ed2aec065e159ab16b4f519042b6968039c6dd python3 tools/check_conventions.py --base 4f41f4c375f5abb487dbd184fbc150f31994d762 git diff 4f41f4c375 093e485ae2 -- core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp ctest --test-dir build -R '^agc_driver_pending_untracked_layer$' --repeat until-fail:3 --output-on-failure ctest --test-dir build -V -R '^agc_driver_pending_untracked_layer$' # no "not run" lines # control A: the five production files from main 4f41f4c375 git show 4f41f4c375:<path> > <path> ninja -C build -j32 -l32 agc_driver_pending_untracked_layer_tests ctest --test-dir build -R '^agc_driver_pending_untracked_layer$' --output-on-failure # x3 # control B: merged tree with only the `cpuSeen ||` term removed from Texture.cpp:6679 git show 093e485ae2:<path> > <path>; sed -i '6679s/(cpuSeen || !cpuLeftUnchanged(...))/!cpuLeftUnchanged(...)/' Texture.cpp ninja -C build -j32 -l32 agc_driver_pending_untracked_layer_tests ctest --test-dir build -R '^agc_driver_pending_untracked_layer$' --output-on-failure # x3 # restore git show 093e485ae2:core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp > ... git status --porcelain ninja -C build -j32 -l32 agc_driver_pending_untracked_layer_tests agc_collect_memo_generation_tests ctest --test-dir build -j8 --test-load 32 -R '^(agc_driver_pending_untracked_layer|agc_collect_memo_generation|agc_import_watch|agc_write_watch_coverage)$|^agc_storage|^agc_driver_storage|^agc_driver_pending|^agc_write_tracking|^guest_memory' --output-on-failure ``` | Check | Result | |---|---| | `git diff --check` | clean | | `check_conventions.py` | passed | | Build and selected tests (script) | 3701 ran, 0 new failures, 0 timeouts. The 9 failures also fail on `main`. `guest_net_ctl` skips for a reason `check_skips.py` doesn't expect, and it does the same on `main`. | | Vulkan validation comparison (script) | 771 tests ran. The layer loaded in 770, no test reported it missing, and there were 0 new VUIDs. | | `agc_driver_pending_untracked_layer` (merged tree) | passed 3 of 3, about 0.65 s per run, with no `not run` line | | 36 related tests (pending, storage, write tracking, guest memory, collect memo, import watch, write-watch coverage) | 35 passed. 1 skipped, `agc_storage_clear_hand_over`, because lavapipe makes no watched host import. | | `git status --porcelain` after the restore | empty | ## Negative control - **A, the five production files from `main` 4f41f4c375:** the test fails 3 of 3. Cases 1 and 2 fail in both generation passes, and so does the different-value direct write-back case. Since #14302 is in `main`, the same-value direct write-back case no longer fails there, so `main` now loses one case fewer than my last control showed. <details><summary>Control A output (the same in all 3 runs; counts are per run)</summary> ``` 2 [pending untracked layer] results over a surface whose walk fails: the image holds 0 of 8 results, guest memory 0, CPU words 0, CPU write reported 1 2 [pending untracked layer] results and a CPU store over a surface whose walk fails: the image holds 0 of 8 results, guest memory 0, CPU words 1, CPU write reported 1 2 [pending untracked layer] results and a CPU store over a surface whose walk fails, then a direct write-back: guest memory holds 0 of 8 results and 1 CPU words 1 AGC graphics: pending storage results or a CPU store over a write-watched surface were lost ``` </details> - **B, the merged tree without the merged-in `cpuSeen ||` term:** the test still **passes** 3 of 3. See the non-blocking finding below. - **Restore:** with the merged file back, the worktree is clean and the test passes. ## Previous findings - **Blocking: a failed walk on a later page discards confirmed CPU stores. Still resolved.** The merge keeps the per-block query and the `byBytes` / `cpuSeen` logic (`Texture.cpp:6677-6679`). The same-value refresh and write-back cases pass on the merge. - **Non-blocking: a later skipped case can hide an earlier failure. Still resolved.** The test is unchanged. - **Non-blocking: no test reaches the Windows path. Resolved, as reported by the author.** The test is unchanged, and I did not run it on Windows. ## New findings ### Blocking None. ### Non-blocking - **No test covers the `cpuSeen` term since the merge** (`core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp:6678-6679`). - **What I saw:** in control B, removing `cpuSeen ||` from the merged condition leaves `agc_driver_pending_untracked_layer` green. #14302's `cpuLeftUnchanged` (`Texture.cpp:6526-6534`) now queries the CPU stamps since `layerPendingSince`, which already keeps a same-value store in a whole 64 KiB block. - **Why the term is still needed:** `cpuLeftUnchanged` returns `true` as soon as the bytes are unchanged when `edge` is set or `layerPendingSince[layer] == 0` (`Texture.cpp:6528`). In those cases a block the failed walk saw the CPU write is still only kept by `cpuSeen`. - **Suggested fix:** add a case where the same-value store lands in a partial (edge) block of the surface, so that this path has a red/green. Alternatively, record in the debt entry that it is untested. ## Not verified - **Windows:** not built or run here, including the refused walk over a shared page and the same-value write-back case the test leaves out on Windows. - **Hardware GPUs:** I only had lavapipe. No hardware GPU run covers this merge yet. The NVIDIA and AMD runs in the discussion are on earlier heads. - **The kernel:** I did not probe on its own how a failing `PAGEMAP_SCAN` writes out regions. The test passes on this VM's kernel (6.12). - **The title:** Ghost of Tsushima (PPSA02225) was not launched. <!-- anyps5-bots job=3394 head=26ed2aec065e159ab16b4f519042b6968039c6dd -->
XairRrR commented 2026-11-03 15:39:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T15:39:25Z.

Review: APPROVED


Re-checked — approved

The only new commit is 4f13bb4bb0. It changes only the docs: it adds a debt entry saying the cpuSeen term has no test since #14302. The entry matches the code and resolves my earlier non-blocking finding. The checks and the new test still pass, and nothing is blocking.

What changed since my last review

I last reviewed 26ed2aec06. Since then:

  • Commits 1–5 are unchanged. The range-diff shows 87b51a63b9…51249fede2 as identical.
  • 4f13bb4bb0 is new. It adds one entry to docs/dev/debt/libSceAgcDriver.md, "Blocks a failed walk saw the CPU write". No code changes.
  • The author replied to my earlier finding (2026-11-03T15:27). They agree that the fixture can't reach the edge case or the case of a layer with no pending stamp. They chose to record both as debt instead of adding a second surface geometry, which was one of the two options I suggested.
  • The description adds a line for 4f13bb4bb0.

What I ran

Head 4f13bb4bb02a5b15c0e32d318287b23c1c614e32, main 4f41f4c375f5abb487dbd184fbc150f31994d762, merged tree 2a6f5f25fee0de1dc40bb76d64bd4fcbed728ed4. Debian 13 VM, Xeon Gold 6136, GCC 14.2.0, lavapipe (Mesa 26.1.6), Release.

git show 4f13bb4bb02a5b15c0e32d318287b23c1c614e32
git diff --check 4f41f4c375f5abb487dbd184fbc150f31994d762...4f13bb4bb02a5b15c0e32d318287b23c1c614e32
python3 tools/check_conventions.py --base 4f41f4c375f5abb487dbd184fbc150f31994d762
git diff 4f41f4c375 2a6f5f25fe -- docs/dev/debt/libSceAgcDriver.md
grep -n "cpuLeftUnchanged\|cpuSeen" core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
ctest --test-dir build -R '^agc_driver_pending_untracked_layer$' --output-on-failure
git status --porcelain
Check Result
git diff --check clean
check_conventions.py passed
Build and selected tests (script) 3701 ran, 0 new failures, 0 timeouts. The 9 failures also fail on main. guest_net_ctl skips for a reason check_skips.py doesn't expect, and it does the same on main.
Vulkan validation comparison (script) 771 tests ran. The layer loaded in 770, no test reported it missing, and there were 0 new VUIDs.
agc_driver_pending_untracked_layer (merged tree) passed, 0.51 s
git status --porcelain empty

Negative control: not rerun. The new commit changes only docs, and the tests and production code are the same as in 26ed2aec06, where control A failed on main's code.

Previous findings

  • Non-blocking: no test covers the cpuSeen term since the merge. Resolved, as debt.
    • The new entry at docs/dev/debt/libSceAgcDriver.md:199 matches the code. cpuLeftUnchanged (core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp:6526-6534) returns true from the bytes alone when edge is set or layerPendingSince[layer] == 0. In those two cases only cpuSeen (Texture.cpp:6678-6679) keeps the store.
    • I agree that a fixture of whole 64 KiB tiles from an aligned base, with every layer stamped at each pending mark, reaches neither case.
  • Blocking: a failed walk on a later page discards confirmed CPU stores. Still resolved. The code is unchanged since 26ed2aec06.
  • Non-blocking: a later skipped case can hide an earlier failure. Still resolved. The test is unchanged.
  • Non-blocking: no test reaches the Windows path. Resolved, as reported by the author. I did not run it on Windows.

New findings

Blocking

None.

Non-blocking

  • The "Same-value CPU stores under a write-back" entry predates #14302 and now overstates the gap (docs/dev/debt/libSceAgcDriver.md:201).
    • What the entry says: after a complete walk, the write-back leaves a CPU-stamped block to the CPU only when its bytes differ, so a same-value store made while results are pending is overwritten.
    • What the code does now: since #14302, cpuLeftUnchanged asks for the CPU stamps since layerPendingSince and keeps that store in a whole block of a layer with a pending stamp. The project rule is to cut an entry down to what is still open.
    • Related evidence: in my previous control A, main's code no longer loses the same-value direct write-back case.
    • The Windows entry: the "Refused walks over a compared shared page" entry (line 200) may be affected in the same way. Its Windows result was measured before the merge.
    • Suggested fix: narrow line 201 to the edge case and the case of a layer with no pending stamp. Re-check the Windows case on the merged code, and update or drop line 200 to match.

Not verified

  • Windows: not built or run here, including the refused walk and the same-value write-back case the test leaves out on Windows.
  • Hardware GPUs: I only had lavapipe. No hardware GPU run covers the current head; the NVIDIA and AMD runs in the discussion are on earlier heads.
  • The kernel: I did not probe on its own how a failing PAGEMAP_SCAN writes out regions. The test passes on this VM's kernel (6.12).
  • The title: Ghost of Tsushima (PPSA02225) was not launched.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5755065745 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12792#pullrequestreview-5755065745). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-03T15:39:25Z. **Review:** APPROVED --- # Re-checked — approved The only new commit is 4f13bb4bb0. It changes only the docs: it adds a debt entry saying the `cpuSeen` term has no test since #14302. The entry matches the code and resolves my earlier non-blocking finding. The checks and the new test still pass, and nothing is blocking. ## What changed since my last review I last reviewed 26ed2aec06. Since then: - **Commits 1–5 are unchanged.** The range-diff shows 87b51a63b9…51249fede2 as identical. - **4f13bb4bb0 is new.** It adds one entry to `docs/dev/debt/libSceAgcDriver.md`, "Blocks a failed walk saw the CPU write". No code changes. - **The author replied to my earlier finding** (2026-11-03T15:27). They agree that the fixture can't reach the `edge` case or the case of a layer with no pending stamp. They chose to record both as debt instead of adding a second surface geometry, which was one of the two options I suggested. - The description adds a line for 4f13bb4bb0. ## What I ran Head `4f13bb4bb02a5b15c0e32d318287b23c1c614e32`, `main` `4f41f4c375f5abb487dbd184fbc150f31994d762`, merged tree `2a6f5f25fee0de1dc40bb76d64bd4fcbed728ed4`. Debian 13 VM, Xeon Gold 6136, GCC 14.2.0, lavapipe (Mesa 26.1.6), Release. ``` git show 4f13bb4bb02a5b15c0e32d318287b23c1c614e32 git diff --check 4f41f4c375f5abb487dbd184fbc150f31994d762...4f13bb4bb02a5b15c0e32d318287b23c1c614e32 python3 tools/check_conventions.py --base 4f41f4c375f5abb487dbd184fbc150f31994d762 git diff 4f41f4c375 2a6f5f25fe -- docs/dev/debt/libSceAgcDriver.md grep -n "cpuLeftUnchanged\|cpuSeen" core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp ctest --test-dir build -R '^agc_driver_pending_untracked_layer$' --output-on-failure git status --porcelain ``` | Check | Result | |---|---| | `git diff --check` | clean | | `check_conventions.py` | passed | | Build and selected tests (script) | 3701 ran, 0 new failures, 0 timeouts. The 9 failures also fail on `main`. `guest_net_ctl` skips for a reason `check_skips.py` doesn't expect, and it does the same on `main`. | | Vulkan validation comparison (script) | 771 tests ran. The layer loaded in 770, no test reported it missing, and there were 0 new VUIDs. | | `agc_driver_pending_untracked_layer` (merged tree) | passed, 0.51 s | | `git status --porcelain` | empty | **Negative control:** not rerun. The new commit changes only docs, and the tests and production code are the same as in 26ed2aec06, where control A failed on `main`'s code. ## Previous findings - **Non-blocking: no test covers the `cpuSeen` term since the merge. Resolved, as debt.** - The new entry at `docs/dev/debt/libSceAgcDriver.md:199` matches the code. `cpuLeftUnchanged` (`core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp:6526-6534`) returns `true` from the bytes alone when `edge` is set or `layerPendingSince[layer] == 0`. In those two cases only `cpuSeen` (`Texture.cpp:6678-6679`) keeps the store. - I agree that a fixture of whole 64 KiB tiles from an aligned base, with every layer stamped at each pending mark, reaches neither case. - **Blocking: a failed walk on a later page discards confirmed CPU stores. Still resolved.** The code is unchanged since 26ed2aec06. - **Non-blocking: a later skipped case can hide an earlier failure. Still resolved.** The test is unchanged. - **Non-blocking: no test reaches the Windows path. Resolved, as reported by the author.** I did not run it on Windows. ## New findings ### Blocking None. ### Non-blocking - **The "Same-value CPU stores under a write-back" entry predates #14302 and now overstates the gap** (`docs/dev/debt/libSceAgcDriver.md:201`). - **What the entry says:** after a complete walk, the write-back leaves a CPU-stamped block to the CPU only when its bytes differ, so a same-value store made while results are pending is overwritten. - **What the code does now:** since #14302, `cpuLeftUnchanged` asks for the CPU stamps since `layerPendingSince` and keeps that store in a whole block of a layer with a pending stamp. The project rule is to cut an entry down to what is still open. - **Related evidence:** in my previous control A, `main`'s code no longer loses the same-value direct write-back case. - **The Windows entry:** the "Refused walks over a compared shared page" entry (line 200) may be affected in the same way. Its Windows result was measured before the merge. - **Suggested fix:** narrow line 201 to the `edge` case and the case of a layer with no pending stamp. Re-check the Windows case on the merged code, and update or drop line 200 to match. ## Not verified - **Windows:** not built or run here, including the refused walk and the same-value write-back case the test leaves out on Windows. - **Hardware GPUs:** I only had lavapipe. No hardware GPU run covers the current head; the NVIDIA and AMD runs in the discussion are on earlier heads. - **The kernel:** I did not probe on its own how a failing `PAGEMAP_SCAN` writes out regions. The test passes on this VM's kernel (6.12). - **The title:** Ghost of Tsushima (PPSA02225) was not launched. <!-- anyps5-bots job=3413 head=4f13bb4bb02a5b15c0e32d318287b23c1c614e32 -->
XairRrR commented 2026-11-03 16:14:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T16:14:35Z.

Review: APPROVED


Re-checked — approved

The two new commits, e14b677a04 and a3bb73fa98, change only docs/dev/debt/libSceAgcDriver.md. The narrowed same-value write-back entry now matches what the code does after #14302, and the Windows entry records the author's re-check on the merged code. That resolves my last non-blocking finding, and nothing is blocking.

What changed since my last review

I last reviewed 4f13bb4bb0. Commits 1–6 are unchanged; the range-diff shows them as identical. The new commits are:

  • e14b677a04 rewrites the "Same-value CPU stores under a write-back of pending storage-image results" entry (line 201). It now covers only two cases:
    • a CPU-stamped block that the layer covers only in part;
    • any block of a layer with no pending stamp.
  • a3bb73fa98 adds one sentence to the "Refused walks over a compared shared page" entry (line 200). It says the Windows loss still occurs on the code merged with #14302: 3 of 3 runs, RTX 3070 Laptop GPU, driver 617.42.
  • The author replied (2026-11-03T15:59). With the Windows skip lifted on the merged code, the same-value direct write-back case fails 3 of 3 in both generation passes, and the other six cases pass.

No code or test changed.

What I ran

Head a3bb73fa980199e51b91ebcacd40ed7a2e051829, main 4f41f4c375f5abb487dbd184fbc150f31994d762, merged tree 4fafe195290374dbf4ff40c0ba16bea7198e333b. Debian 13 VM, Xeon Gold 6136, GCC 14.2.0, lavapipe (Mesa 26.1.6), Release.

git diff 4f13bb4bb02a5b15c0e32d318287b23c1c614e32 a3bb73fa980199e51b91ebcacd40ed7a2e051829
git diff --check 4f41f4c375f5abb487dbd184fbc150f31994d762...a3bb73fa980199e51b91ebcacd40ed7a2e051829
python3 tools/check_conventions.py --base 4f41f4c375f5abb487dbd184fbc150f31994d762
grep -n "cpuLeftUnchanged\|cpuSeen" core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
ctest --test-dir build -R '^agc_driver_pending_untracked_layer$' --output-on-failure
git status --porcelain
Check Result
git diff --check clean
check_conventions.py passed
Build and selected tests (script) 3701 tests ran, with 0 new failures and 0 timeouts. The 9 failures also fail on main. guest_net_ctl skips for an unexpected reason, and it does the same on main.
Vulkan validation comparison (script) 771 tests ran and the layer loaded in 770. No test reported the layer missing, and there were 0 new VUIDs.
agc_driver_pending_untracked_layer (merged tree) passed, 0.89 s
git status --porcelain empty

Negative control: not rerun. The new commits change only docs. The test and production code are the same as at 26ed2aec06, where my earlier control failed with main's code.

Previous findings

  • Non-blocking: the same-value write-back entry predated #14302. Resolved.
    • Line 201: the entry now names only the partly covered block and the layer with no pending stamp. That matches cpuLeftUnchanged. Once the bytes equal the baseline, it returns true without asking for CPU stamps when edge || layerPendingSince[layer] == 0. Otherwise it keeps a same-value store through the stamps since the pending mark.
    • Line 200: the Windows entry now says the loss still holds after #14302. I accept that result as author-reported; I did not run Windows.
  • Non-blocking: no test covers the cpuSeen term since the merge. Still resolved, as debt. The entry is unchanged.
  • Blocking: a failed walk on a later page discarded confirmed CPU stores. Still resolved. The code is unchanged.
  • Non-blocking: a later skipped case could hide an earlier failure. Still resolved. The test is unchanged.
  • Non-blocking: no test reached the Windows path. Resolved, as reported by the author.

New findings

Blocking

None.

Non-blocking

None.

Not verified

  • Windows: not built or run here. That includes the refused walk and the re-check that a3bb73fa98 records.
  • Hardware GPUs: I only had lavapipe. The NVIDIA and AMD runs in the discussion are on 26ed2aec06, which has the same code as this head.
  • The kernel: I did not probe on its own how a failing PAGEMAP_SCAN writes out regions. The test passes on this VM's kernel (6.12).
  • The title: Ghost of Tsushima (PPSA02225) was not launched.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5755651258 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12792#pullrequestreview-5755651258). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-03T16:14:35Z. **Review:** APPROVED --- # Re-checked — approved The two new commits, e14b677a04 and a3bb73fa98, change only `docs/dev/debt/libSceAgcDriver.md`. The narrowed same-value write-back entry now matches what the code does after #14302, and the Windows entry records the author's re-check on the merged code. That resolves my last non-blocking finding, and nothing is blocking. ## What changed since my last review I last reviewed 4f13bb4bb0. Commits 1–6 are unchanged; the range-diff shows them as identical. The new commits are: - **e14b677a04** rewrites the "Same-value CPU stores under a write-back of pending storage-image results" entry (line 201). It now covers only two cases: - a CPU-stamped block that the layer covers only in part; - any block of a layer with no pending stamp. - **a3bb73fa98** adds one sentence to the "Refused walks over a compared shared page" entry (line 200). It says the Windows loss still occurs on the code merged with #14302: 3 of 3 runs, RTX 3070 Laptop GPU, driver 617.42. - **The author replied** (2026-11-03T15:59). With the Windows skip lifted on the merged code, the same-value direct write-back case fails 3 of 3 in both generation passes, and the other six cases pass. No code or test changed. ## What I ran Head `a3bb73fa980199e51b91ebcacd40ed7a2e051829`, `main` `4f41f4c375f5abb487dbd184fbc150f31994d762`, merged tree `4fafe195290374dbf4ff40c0ba16bea7198e333b`. Debian 13 VM, Xeon Gold 6136, GCC 14.2.0, lavapipe (Mesa 26.1.6), Release. ``` git diff 4f13bb4bb02a5b15c0e32d318287b23c1c614e32 a3bb73fa980199e51b91ebcacd40ed7a2e051829 git diff --check 4f41f4c375f5abb487dbd184fbc150f31994d762...a3bb73fa980199e51b91ebcacd40ed7a2e051829 python3 tools/check_conventions.py --base 4f41f4c375f5abb487dbd184fbc150f31994d762 grep -n "cpuLeftUnchanged\|cpuSeen" core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp ctest --test-dir build -R '^agc_driver_pending_untracked_layer$' --output-on-failure git status --porcelain ``` | Check | Result | |---|---| | `git diff --check` | clean | | `check_conventions.py` | passed | | Build and selected tests (script) | 3701 tests ran, with 0 new failures and 0 timeouts. The 9 failures also fail on `main`. `guest_net_ctl` skips for an unexpected reason, and it does the same on `main`. | | Vulkan validation comparison (script) | 771 tests ran and the layer loaded in 770. No test reported the layer missing, and there were 0 new VUIDs. | | `agc_driver_pending_untracked_layer` (merged tree) | passed, 0.89 s | | `git status --porcelain` | empty | **Negative control:** not rerun. The new commits change only docs. The test and production code are the same as at 26ed2aec06, where my earlier control failed with `main`'s code. ## Previous findings - **Non-blocking: the same-value write-back entry predated #14302. Resolved.** - **Line 201:** the entry now names only the partly covered block and the layer with no pending stamp. That matches [`cpuLeftUnchanged`](https://github.com/boykopovar/AnyPS5/blob/a3bb73fa980199e51b91ebcacd40ed7a2e051829/core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp#L6526-L6529). Once the bytes equal the baseline, it returns `true` without asking for CPU stamps when `edge || layerPendingSince[layer] == 0`. Otherwise it keeps a same-value store through the stamps since the pending mark. - **Line 200:** the Windows entry now says the loss still holds after #14302. I accept that result as author-reported; I did not run Windows. - **Non-blocking: no test covers the `cpuSeen` term since the merge. Still resolved, as debt.** The entry is unchanged. - **Blocking: a failed walk on a later page discarded confirmed CPU stores. Still resolved.** The code is unchanged. - **Non-blocking: a later skipped case could hide an earlier failure. Still resolved.** The test is unchanged. - **Non-blocking: no test reached the Windows path. Resolved, as reported by the author.** ## New findings ### Blocking None. ### Non-blocking None. ## Not verified - **Windows:** not built or run here. That includes the refused walk and the re-check that a3bb73fa98 records. - **Hardware GPUs:** I only had lavapipe. The NVIDIA and AMD runs in the discussion are on 26ed2aec06, which has the same code as this head. - **The kernel:** I did not probe on its own how a failing `PAGEMAP_SCAN` writes out regions. The test passes on this VM's kernel (6.12). - **The title:** Ghost of Tsushima (PPSA02225) was not launched. <!-- anyps5-bots job=3435 head=a3bb73fa980199e51b91ebcacd40ed7a2e051829 -->
MarcZX10 commented 2026-11-20 06:14:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T06:14:17Z.

Review: APPROVED


Reviewed — looks good

No verified defect blocks this change; the prepared evidence includes targeted regression runs and a GPU validation run at this head, while I did not run checks myself.

What I ran

Reviewed head 095d74935785c1090069e4b427f2388f52120b32. I did not run tests or build commands. Read description.md, commits.md, manifest.json, diff.patch, and all included changed files except only portions of long files; read Texture.cpp through repo_read.py for the changed refresh block. The full text of Texture.cpp was excluded from the review folder as too large, and I read only its relevant range through the reader. files.json was not present; the review folder listing served to identify included and excluded changed files.

Results

Check Result Note
Prepared regression evidence not run Reported by author; not independently run
Changed-code review passed No concrete blocking defect verified
Full-file review not run Texture.cpp was read only in the relevant range

Findings

Blocking

None.

Non-blocking

None.

Not verified

I did not run tests, builds, or GPU checks. I did not read the entire Texture.cpp file or all unchanged repository context. The prepared description reports several known limitations and an untested alias failure-reporting path; I did not verify those behaviors independently.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5988330888 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12792#pullrequestreview-5988330888). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-20T06:14:17Z. **Review:** APPROVED --- # Reviewed — looks good No verified defect blocks this change; the prepared evidence includes targeted regression runs and a GPU validation run at this head, while I did not run checks myself. ## What I ran Reviewed head `095d74935785c1090069e4b427f2388f52120b32`. I did not run tests or build commands. Read `description.md`, `commits.md`, `manifest.json`, `diff.patch`, and all included changed files except only portions of long files; read `Texture.cpp` through `repo_read.py` for the changed refresh block. The full text of `Texture.cpp` was excluded from the review folder as too large, and I read only its relevant range through the reader. `files.json` was not present; the review folder listing served to identify included and excluded changed files. ## Results | Check | Result | Note | |---|---|---| | Prepared regression evidence | not run | Reported by author; not independently run | | Changed-code review | passed | No concrete blocking defect verified | | Full-file review | not run | `Texture.cpp` was read only in the relevant range | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified I did not run tests, builds, or GPU checks. I did not read the entire `Texture.cpp` file or all unchanged repository context. The prepared description reports several known limitations and an untested alias failure-reporting path; I did not verify those behaviors independently. ## To get this to a good state Nothing is required.
MarcZX10 commented 2026-11-25 18:28:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T18:28:34Z.

Review: COMMENTED


Reviewed — comments

A complete approval is not justified because I could not run checks or read every changed file in full.

What I ran

Reviewed head 38516b5e639672419eed45fae5ede9caef11c917 against main using the prepared review bundle and repo_read.py targeted reads. No commands or tests were run.

Results

Check Result Note
Prepared diff review passed 8 changed files listed
Tests and prechecks not run No execution environment available
Full changed-file review not run Some files were read only in relevant ranges

Negative control

Not run; no tests were executed.

Findings

Blocking

None identified in the code ranges reviewed.

Non-blocking

None.

Sources

Reviewed description.md, commits.md, manifest.json, and diff.patch, plus targeted ranges in GuestMemory.hpp, GuestMemory.cpp, Texture.cpp, PendingUntrackedLayer.cpp, and GuestWriteWatch.cpp at the pinned head.

Not verified

Did not run tests or prechecks. Did not read all lines of the changed files; in particular, the full text of Texture.cpp was excluded from the review folder as too large, and only relevant ranges were read through repo_read.py. The full test and documentation files were not read. The file listing shows eight changed files; Texture.cpp is the only one excluded from the prepared full-text bundle.

To get this to a good state

Nothing is required. Optional: run the relevant AGC tests and review the remaining changed-file content before treating this as a complete approval.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6062887785 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12792#pullrequestreview-6062887785). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-25T18:28:34Z. **Review:** COMMENTED --- # Reviewed — comments A complete approval is not justified because I could not run checks or read every changed file in full. ## What I ran Reviewed head `38516b5e639672419eed45fae5ede9caef11c917` against `main` using the prepared review bundle and `repo_read.py` targeted reads. No commands or tests were run. ## Results | Check | Result | Note | |---|---|---| | Prepared diff review | passed | 8 changed files listed | | Tests and prechecks | not run | No execution environment available | | Full changed-file review | not run | Some files were read only in relevant ranges | ## Negative control Not run; no tests were executed. ## Findings ### Blocking None identified in the code ranges reviewed. ### Non-blocking None. ## Sources Reviewed `description.md`, `commits.md`, `manifest.json`, and `diff.patch`, plus targeted ranges in `GuestMemory.hpp`, `GuestMemory.cpp`, `Texture.cpp`, `PendingUntrackedLayer.cpp`, and `GuestWriteWatch.cpp` at the pinned head. ## Not verified Did not run tests or prechecks. Did not read all lines of the changed files; in particular, the full text of `Texture.cpp` was excluded from the review folder as too large, and only relevant ranges were read through `repo_read.py`. The full test and documentation files were not read. The file listing shows eight changed files; `Texture.cpp` is the only one excluded from the prepared full-text bundle. ## To get this to a good state Nothing is required. Optional: run the relevant AGC tests and review the remaining changed-file content before treating this as a complete approval.
ligmaSec commented 2026-12-03 22:54:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T22:54:41Z.

Review: COMMENTED


The trial merge conflicts in GuestWriteWatch.cpp. The new behavior depends on an unavailable page walk triggering byte comparison instead of discarding pending GPU results. Please keep a case where only part of the range can be collected, with a CPU update in that range and unchanged bytes beside it. That can verify that the fallback preserves the GPU result while still detecting CPU edits. Please move the direct debt update to a fragment. I have no paired Vulkan result for this head.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6180076250 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12792#pullrequestreview-6180076250). Originally posted by [ligmaSec](https://github.com/ligmaSec) on 2026-12-03T22:54:41Z. **Review:** COMMENTED --- The trial merge conflicts in `GuestWriteWatch.cpp`. The new behavior depends on an unavailable page walk triggering byte comparison instead of discarding pending GPU results. Please keep a case where only part of the range can be collected, with a CPU update in that range and unchanged bytes beside it. That can verify that the fallback preserves the GPU result while still detecting CPU edits. Please move the direct debt update to a fragment. I have no paired Vulkan result for this head. AI-assisted: yes.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/12792:upstream-pr/12792'
git switch 'upstream-pr/12792'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/12792'
git switch 'upstream-pr/12792'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/12792'
git switch 'upstream-pr/12792'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/12792'
git switch 'main'
git merge --squash 'upstream-pr/12792'
git switch 'main'
git merge --ff-only 'upstream-pr/12792'
git switch 'main'
git merge 'upstream-pr/12792'
git push origin 'main'
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!12792
No description provided.