perf(agc): return settled imports under live storage images to the write watch #19071

Merged
klosixgaming-arch merged 4 commits from upstream-pr/19071 into main 2026-11-16 06:33:24 +00:00
klosixgaming-arch commented 2026-11-12 18:42:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by klosixgaming-arch on 2026-11-12T18:42:42Z.


What

A Windows host import of private memory under the settle floor starts out compared. When its deferred settle read completes, it returns to the write watch. Since 0623263512, an import that a live storage image overlaps stays compared for good, because GuestMemory::Rewatch stamps the returning blocks as a CPU store. An image with results pending would take that stamp for a CPU store over its results and drop them.

Keeping it compared is expensive. One compared block makes every storage image over it untracked, so each refresh of such an image compares the image's whole guest range. Before comparing, it flushes the pending results of the other images over that range. In Cyberpunk 2077 (PPSA03974) this happens in every run:

  • A 64 KiB import at the start of a pool of aliased render targets stays compared.
  • 1 to 6 large images (up to 26 MiB) end up untracked because of it.
  • On my test stack (main with #10443 and my open series), I profiled a run with 6 such images. There, StorageTexture::compareUntracked takes about 20% of queue worker 0's time, and 62% of that is the flush hook's Recorder::SyncThrough.

This change returns such an import to the write watch even under live storage images. An image then proves a block that only the rewatch stamped, instead of reading the stamp as a CPU store:

  • Rewatch records the stamp it gives each block.
  • GuestMemory::RewatchedBlocks (one tracker lock per block scan), OnlyRewatchedSince and Rewatched tell a storage image which of its stamped blocks were last stamped by a rewatch. An atomic skips the lookup while no rewatch has happened.
  • StorageTexture::rewatchProof, after FlushGpuWrites over the block:
    • Units with a generation: the block counts as unchanged when the image's copy still matches it, or when baselineMiss proves the units' bytes (the upload copy of a small image, or the hash taken when the range left the watch). Without a proof, the stamp keeps its old meaning.
    • Units without a generation (the image was made while the block was compared): the copy decides, as it did while the block was compared. Equal is unchanged. Different counts as a CPU store, and the drop rule treats the unit like a compared one.
  • The proof runs in refresh (in the block scan and in the per-layer check) and in writeBackLayers.
  • APS5_NO_REWATCH_UNDER_IMAGES restores the old rule, with one docs/dev/ENVIRONMENT.md row.

Tests:

  • agc_import_settle_storage_image (changed). The settled import of a 64 KiB image now returns to the write watch.
    • (i) The image's GPU clear survives the next refresh and write-back.
    • (ii) A CPU store made while the import was compared still wins over the pending clear.
  • agc_import_rewatch_under_image (new). A 2 MiB image is uploaded over watched memory, so its units have generations. Then its first block leaves the watch and returns through Unwatch and Rewatch, as an overlapping compared import would.
    • (i) The GPU clear survives in every block, and one rewatched block is proved unchanged.
    • (ii) A CPU store made while the block was out of the watch wins in that block, and the clear survives everywhere else.

Tested

Windows 11 (10.0.26200), NVIDIA GeForce RTX 5090 (driver 617.42), Ryzen 9 9950X3D, WinLibs GCC 15.2, Release.

Tests.

  • At this head, all 36 tests matching ^agc_(import|storage|unwatch|untracked) pass, the two above included. They ran with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1 and VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, as did the same 35 tests on main 09ab49de96, which also pass. Neither log has a VUID- line or a layer-not-found line.
  • Each case of the two tests fails when the proof is broken (local mutation builds):
    • proof never given: agc_import_settle_storage_image (ii) loses the CPU store, and agc_import_rewatch_under_image (i) loses the clear in the rewatched block;
    • proof given without the comparison: both (ii) cases lose the CPU store.
  • With the rule simply deleted, agc_import_settle_storage_image (ii) and agc_import_rewatch_under_image (i) fail as well. That is why the proof is needed.

Cyberpunk 2077 (PPSA03974), intro movie, 3200x1800. Alternating builds on an otherwise idle machine, APS5_TRACE_SECONDS=60:10 and APS5_TRACE_SUMMARY_EVERY=10. "Movie mean" is the mean of the run's 10 s summary windows during the movie. Traces and every summary line are in the release perf-captures-2026-11-12.

traced window: presents / frame p50 / GPU busy per present movie mean, presents / 10 s
main 09ab49de96 59 / 170.6 / 44.0, 44 / 224.6 / 52.6, 51 / 198.9 / 51.1, 46 / 204.8 / 54.8 57.4, 43.1, 50.9, 46.2
this PR 52207f887a 76 / 145.3 / 31.7, 91 / 108.2 / 31.9, 99 / 100.8 / 30.7, 96 / 99.8 / 31.1 76.9, 91.6, 97.4, 90.5

The median of the movie means goes from 48.6 to 91.1 presents per 10 s, about +85%. In the traced windows Vulkan.Dispatch.shader_resources falls from 86.9 to 16.7 ms per frame (run 3 of each).

On my experimental stack (this change plus #10443 and my open series), the intro ran at 122.8, 125.5, 104.5, 114.0 and 103.6. With APS5_NO_REWATCH_UNDER_IMAGES=1 in the same build it ran at 101.6, 65.2, 67.9, 110.4 and 78.9. The old rule's slow runs do not happen with the change.

Frame dumps of the intro movie and of the title screen with the change look right. No run aborted.

Summary lines of the traced windows, run 3 of each (paths replaced)
{"commit":"09ab49de9649","dirty":false,"env":{"APS5_LOG_TIMESTAMPS":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"1048576","APS5_TRACE_SECONDS":"60:10","APS5_TRACE_SUMMARY_EVERY":"10"},"gpu":"NVIDIA GeForce RTX 5090","driver":"NVIDIA 617.42","os":"Windows 10.0.26200","cpu":"AMD Ryzen 9 9950X3D 16-Core Processor","cpu_threads":32,"memory_mib":194197,"title_id":"PPSA03974","title":"Cyberpunk 2077","content_version":"02.120.000","resolution":"3200x1800","window":{"spec":"seconds 60:10","first_present":393,"ms":10133.803},"presents":51,"frame_ms":{"p50":198.926,"p90":213.142,"p99":228.256,"max":228.256},"gpu_busy_ms_per_present":51.126,"worker_busy_pct":{"queue worker 0x0":99.432,"queue worker 0x23":99.928},"top_phases_ms_per_frame":{"Driver.Packet":385.846,"Driver.Packet.memory_wait":180.582,"Driver.Packet.dispatch":180.150,"Driver.Dispatch":128.499,"Vulkan.Dispatch":91.015,"Vulkan.Dispatch.shader_resources":86.917,"Graphics.Draw":51.013,"Graphics.Draw.draw_and_resource_release":49.778},"owned_draw_counts":{},"trace_dropped":false,"trace":"aps5-trace-09ab49de9649-52600.json.gz"}
{"commit":"52207f887a74","dirty":false,"env":{"APS5_LOG_TIMESTAMPS":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"1048576","APS5_TRACE_SECONDS":"60:10","APS5_TRACE_SUMMARY_EVERY":"10"},"gpu":"NVIDIA GeForce RTX 5090","driver":"NVIDIA 617.42","os":"Windows 10.0.26200","cpu":"AMD Ryzen 9 9950X3D 16-Core Processor","cpu_threads":32,"memory_mib":194197,"title_id":"PPSA03974","title":"Cyberpunk 2077","content_version":"02.120.000","resolution":"3200x1800","window":{"spec":"seconds 60:10","first_present":603,"ms":10093.772},"presents":99,"frame_ms":{"p50":100.788,"p90":109.801,"p99":134.389,"max":134.389},"gpu_busy_ms_per_present":30.737,"worker_busy_pct":{"queue worker 0x0":99.044,"queue worker 0x23":99.894},"top_phases_ms_per_frame":{"Driver.Packet":195.429,"Driver.Packet.memory_wait":90.640,"Driver.Packet.dispatch":83.958,"Driver.Dispatch":52.343,"Graphics.Draw":36.884,"Graphics.Draw.draw_and_resource_release":35.822,"Vulkan.Dispatch":21.989,"Vulkan.Dispatch.shader_resources":16.740},"owned_draw_counts":{},"trace_dropped":false,"trace":"aps5-trace-52207f887a74-44076.json.gz"}

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: NVIDIA GeForce RTX 5090, driver 617.42, Windows 11 (10.0.26200)
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5283196669 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/19071). Originally posted by [klosixgaming-arch](https://github.com/klosixgaming-arch) on 2026-11-12T18:42:42Z. --- ### What A Windows host import of private memory under the settle floor starts out compared. When its deferred settle read completes, it returns to the write watch. Since 0623263512, an import that a live storage image overlaps stays compared for good, because `GuestMemory::Rewatch` stamps the returning blocks as a CPU store. An image with results pending would take that stamp for a CPU store over its results and drop them. Keeping it compared is expensive. One compared block makes every storage image over it untracked, so each refresh of such an image compares the image's whole guest range. Before comparing, it flushes the pending results of the other images over that range. In Cyberpunk 2077 (PPSA03974) this happens in every run: - A 64 KiB import at the start of a pool of aliased render targets stays compared. - 1 to 6 large images (up to 26 MiB) end up untracked because of it. - On my test stack (`main` with #10443 and my open series), I profiled a run with 6 such images. There, `StorageTexture::compareUntracked` takes about 20% of queue worker 0's time, and 62% of that is the flush hook's `Recorder::SyncThrough`. This change returns such an import to the write watch even under live storage images. An image then proves a block that only the rewatch stamped, instead of reading the stamp as a CPU store: - `Rewatch` records the stamp it gives each block. - `GuestMemory::RewatchedBlocks` (one tracker lock per block scan), `OnlyRewatchedSince` and `Rewatched` tell a storage image which of its stamped blocks were last stamped by a rewatch. An atomic skips the lookup while no rewatch has happened. - `StorageTexture::rewatchProof`, after `FlushGpuWrites` over the block: - Units with a generation: the block counts as unchanged when the image's copy still matches it, or when `baselineMiss` proves the units' bytes (the upload copy of a small image, or the hash taken when the range left the watch). Without a proof, the stamp keeps its old meaning. - Units without a generation (the image was made while the block was compared): the copy decides, as it did while the block was compared. Equal is unchanged. Different counts as a CPU store, and the drop rule treats the unit like a compared one. - The proof runs in `refresh` (in the block scan and in the per-layer check) and in `writeBackLayers`. - `APS5_NO_REWATCH_UNDER_IMAGES` restores the old rule, with one `docs/dev/ENVIRONMENT.md` row. Tests: - `agc_import_settle_storage_image` (changed). The settled import of a 64 KiB image now returns to the write watch. - (i) The image's GPU clear survives the next refresh and write-back. - (ii) A CPU store made while the import was compared still wins over the pending clear. - `agc_import_rewatch_under_image` (new). A 2 MiB image is uploaded over watched memory, so its units have generations. Then its first block leaves the watch and returns through `Unwatch` and `Rewatch`, as an overlapping compared import would. - (i) The GPU clear survives in every block, and one rewatched block is proved unchanged. - (ii) A CPU store made while the block was out of the watch wins in that block, and the clear survives everywhere else. ### Tested Windows 11 (10.0.26200), NVIDIA GeForce RTX 5090 (driver 617.42), Ryzen 9 9950X3D, WinLibs GCC 15.2, Release. **Tests.** - At this head, all 36 tests matching `^agc_(import|storage|unwatch|untracked)` pass, the two above included. They ran with `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1` and `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, as did the same 35 tests on `main` `09ab49de96`, which also pass. Neither log has a `VUID-` line or a layer-not-found line. - Each case of the two tests fails when the proof is broken (local mutation builds): - proof never given: `agc_import_settle_storage_image` (ii) loses the CPU store, and `agc_import_rewatch_under_image` (i) loses the clear in the rewatched block; - proof given without the comparison: both (ii) cases lose the CPU store. - With the rule simply deleted, `agc_import_settle_storage_image` (ii) and `agc_import_rewatch_under_image` (i) fail as well. That is why the proof is needed. **Cyberpunk 2077 (PPSA03974), intro movie**, 3200x1800. Alternating builds on an otherwise idle machine, `APS5_TRACE_SECONDS=60:10` and `APS5_TRACE_SUMMARY_EVERY=10`. "Movie mean" is the mean of the run's 10 s summary windows during the movie. Traces and every summary line are in the release [perf-captures-2026-11-12](https://github.com/klosixgaming-arch/AnyPS5/releases/tag/perf-captures-2026-11-12). | | traced window: presents / frame p50 / GPU busy per present | movie mean, presents / 10 s | |---|---|---| | `main` `09ab49de96` | 59 / 170.6 / 44.0, 44 / 224.6 / 52.6, 51 / 198.9 / 51.1, 46 / 204.8 / 54.8 | 57.4, 43.1, 50.9, 46.2 | | this PR `52207f887a` | 76 / 145.3 / 31.7, 91 / 108.2 / 31.9, 99 / 100.8 / 30.7, 96 / 99.8 / 31.1 | 76.9, 91.6, 97.4, 90.5 | The median of the movie means goes from 48.6 to 91.1 presents per 10 s, about +85%. In the traced windows `Vulkan.Dispatch.shader_resources` falls from 86.9 to 16.7 ms per frame (run 3 of each). On my experimental stack (this change plus #10443 and my open series), the intro ran at 122.8, 125.5, 104.5, 114.0 and 103.6. With `APS5_NO_REWATCH_UNDER_IMAGES=1` in the same build it ran at 101.6, 65.2, 67.9, 110.4 and 78.9. The old rule's slow runs do not happen with the change. Frame dumps of the intro movie and of the title screen with the change look right. No run aborted. <details><summary>Summary lines of the traced windows, run 3 of each (paths replaced)</summary> ```json {"commit":"09ab49de9649","dirty":false,"env":{"APS5_LOG_TIMESTAMPS":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"1048576","APS5_TRACE_SECONDS":"60:10","APS5_TRACE_SUMMARY_EVERY":"10"},"gpu":"NVIDIA GeForce RTX 5090","driver":"NVIDIA 617.42","os":"Windows 10.0.26200","cpu":"AMD Ryzen 9 9950X3D 16-Core Processor","cpu_threads":32,"memory_mib":194197,"title_id":"PPSA03974","title":"Cyberpunk 2077","content_version":"02.120.000","resolution":"3200x1800","window":{"spec":"seconds 60:10","first_present":393,"ms":10133.803},"presents":51,"frame_ms":{"p50":198.926,"p90":213.142,"p99":228.256,"max":228.256},"gpu_busy_ms_per_present":51.126,"worker_busy_pct":{"queue worker 0x0":99.432,"queue worker 0x23":99.928},"top_phases_ms_per_frame":{"Driver.Packet":385.846,"Driver.Packet.memory_wait":180.582,"Driver.Packet.dispatch":180.150,"Driver.Dispatch":128.499,"Vulkan.Dispatch":91.015,"Vulkan.Dispatch.shader_resources":86.917,"Graphics.Draw":51.013,"Graphics.Draw.draw_and_resource_release":49.778},"owned_draw_counts":{},"trace_dropped":false,"trace":"aps5-trace-09ab49de9649-52600.json.gz"} {"commit":"52207f887a74","dirty":false,"env":{"APS5_LOG_TIMESTAMPS":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"1048576","APS5_TRACE_SECONDS":"60:10","APS5_TRACE_SUMMARY_EVERY":"10"},"gpu":"NVIDIA GeForce RTX 5090","driver":"NVIDIA 617.42","os":"Windows 10.0.26200","cpu":"AMD Ryzen 9 9950X3D 16-Core Processor","cpu_threads":32,"memory_mib":194197,"title_id":"PPSA03974","title":"Cyberpunk 2077","content_version":"02.120.000","resolution":"3200x1800","window":{"spec":"seconds 60:10","first_present":603,"ms":10093.772},"presents":99,"frame_ms":{"p50":100.788,"p90":109.801,"p99":134.389,"max":134.389},"gpu_busy_ms_per_present":30.737,"worker_busy_pct":{"queue worker 0x0":99.044,"queue worker 0x23":99.894},"top_phases_ms_per_frame":{"Driver.Packet":195.429,"Driver.Packet.memory_wait":90.640,"Driver.Packet.dispatch":83.958,"Driver.Dispatch":52.343,"Graphics.Draw":36.884,"Graphics.Draw.draw_and_resource_release":35.822,"Vulkan.Dispatch":21.989,"Vulkan.Dispatch.shader_resources":16.740},"owned_draw_counts":{},"trace_dropped":false,"trace":"aps5-trace-52207f887a74-44076.json.gz"} ``` </details> ### 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: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: NVIDIA GeForce RTX 5090, driver 617.42, Windows 11 (10.0.26200) - [x] AI-assisted: yes
MarcZX10 commented 2026-11-12 20:05:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-12T20:05:02Z.

Review: COMMENTED


Reviewed — no blocking findings

Nothing blocks this; the points below are optional.

What I ran

Head 52207f887a74d7ff3f0071ff3187c75aeaadc446 (PR #19071, base main). I read the diff and the head text through repo_read.py. I did not build or run the tests: the change is Windows-only, and this review ran on Linux.

python3 repo_read.py search "baselineMiss" core/libs/prx/libSceAgcDriver/Graphics
python3 repo_read.py search "EqualsCommittedUnsynced" core/libs/prx/libSceAgcDriver/Execution
python3 repo_read.py search "BlockUnchanged" core/libs/prx/libSceAgcDriver/Execution/include
python3 repo_read.py search "rewatchStamps" core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
python3 repo_read.py search "settledImportsWatchPrivate" core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
python3 repo_read.py search "stampOf(" core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
python3 repo_read.py search "#ifdef _WIN32" core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp 3060 3100
python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp 2566 2600
python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp 7160 7190
python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp 2300 2330
python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp 2408 2432

Read: the diff hunks of all 8 files in files.json reviewed. Head text of GuestMemory.cpp and Texture.cpp in the ranges above. Not read at head: GuestBufferMemory.cpp and Recorder.cpp, which are excluded from the review folder as too large, and the rest of Texture.cpp.

Results

Check Result Note
Build on Linux not applicable Windows-only code path
agc_import_* tests not run Author-reported; not rerun here
Symbols used by the diff exist at head passed Found by search; not compiled
Added code comments passed None in the added lines

Findings

Blocking

None.

Non-blocking

  1. core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp:1431: rewatchStamps gets one entry per rewatched block (GuestMemory.cpp:2322) and nothing ever erases one. A search for rewatchStamps finds no erase. Stale entries are harmless, because lookups compare the stored stamp with the current one (GuestMemory.cpp:2445, GuestMemory.cpp:2477). The map still keeps an entry for each rewatched 64 KiB block for the life of the process. Erasing the entry when the block is stamped again would bound it.

Not verified

  • The PR's test runs and its performance numbers. They are author-reported and come from a release I did not open. I did not run them.
  • Whether a block that confirmRewatched proves unchanged gets proved again on every refresh. That depends on whether the block-scan path advances layerGeneration after an unchanged proof, and I did not read that path (Texture.cpp:2592 to 2640).
  • What write-back does with a block stamped as a CPU store in writeBackLayers (Texture.cpp:7187, where comparedUnits is nullptr). I did not trace it.
  • The head text of GuestBufferMemory.cpp and Recorder.cpp, and most of Texture.cpp. I read only their diff hunks.
  • Compilation on Windows and on Linux. The new GuestMemory.cpp functions (from line 2433) sit outside the #ifdef _WIN32 block at 2411 to 2413, as WriteWatched does. I checked this by reading, not by building.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5881236701 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/19071#pullrequestreview-5881236701). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-12T20:05:02Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing blocks this; the points below are optional. ## What I ran Head `52207f887a74d7ff3f0071ff3187c75aeaadc446` (PR #19071, base `main`). I read the diff and the head text through `repo_read.py`. I did not build or run the tests: the change is Windows-only, and this review ran on Linux. ``` python3 repo_read.py search "baselineMiss" core/libs/prx/libSceAgcDriver/Graphics python3 repo_read.py search "EqualsCommittedUnsynced" core/libs/prx/libSceAgcDriver/Execution python3 repo_read.py search "BlockUnchanged" core/libs/prx/libSceAgcDriver/Execution/include python3 repo_read.py search "rewatchStamps" core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp python3 repo_read.py search "settledImportsWatchPrivate" core/libs/prx/libSceAgcDriver/tests/Recorder.cpp python3 repo_read.py search "stampOf(" core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp python3 repo_read.py search "#ifdef _WIN32" core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp 3060 3100 python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp 2566 2600 python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp 7160 7190 python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp 2300 2330 python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp 2408 2432 ``` Read: the diff hunks of all 8 files in `files.json` `reviewed`. Head text of `GuestMemory.cpp` and `Texture.cpp` in the ranges above. Not read at head: `GuestBufferMemory.cpp` and `Recorder.cpp`, which are excluded from the review folder as too large, and the rest of `Texture.cpp`. ## Results | Check | Result | Note | |---|---|---| | Build on Linux | not applicable | Windows-only code path | | `agc_import_*` tests | not run | Author-reported; not rerun here | | Symbols used by the diff exist at head | passed | Found by search; not compiled | | Added code comments | passed | None in the added lines | ## Findings **Blocking** None. **Non-blocking** 1. `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp:1431`: `rewatchStamps` gets one entry per rewatched block (`GuestMemory.cpp:2322`) and nothing ever erases one. A search for `rewatchStamps` finds no erase. Stale entries are harmless, because lookups compare the stored stamp with the current one (`GuestMemory.cpp:2445`, `GuestMemory.cpp:2477`). The map still keeps an entry for each rewatched 64 KiB block for the life of the process. Erasing the entry when the block is stamped again would bound it. ## Not verified - The PR's test runs and its performance numbers. They are author-reported and come from a release I did not open. I did not run them. - Whether a block that `confirmRewatched` proves unchanged gets proved again on every refresh. That depends on whether the block-scan path advances `layerGeneration` after an unchanged proof, and I did not read that path (`Texture.cpp:2592` to `2640`). - What write-back does with a block stamped as a CPU store in `writeBackLayers` (`Texture.cpp:7187`, where `comparedUnits` is `nullptr`). I did not trace it. - The head text of `GuestBufferMemory.cpp` and `Recorder.cpp`, and most of `Texture.cpp`. I read only their diff hunks. - Compilation on Windows and on Linux. The new `GuestMemory.cpp` functions (from line 2433) sit outside the `#ifdef _WIN32` block at 2411 to 2413, as `WriteWatched` does. I checked this by reading, not by building. ## To get this to a good state Nothing is required.
MarcZX10 commented 2026-11-13 23:01:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-13T23:01:36Z.

Review: COMMENTED


Reviewed — no blocking findings

Nothing blocks this change; the points below are optional.

What I ran

Reviewed head 699ec1e45f90000020acb1c368e72cf65d2c1611 from the prepared diff and targeted source reads. No commands or tests were run in this review.

Results

Check Result Note
Changed code review passed Core proof and write-back paths inspected
Tests not run Author reports passing Windows tests
Full changed-file coverage not run Two changed source files were excluded from the review bundle

Findings

Blocking

None.

Non-blocking

  • Please ensure GuestBufferMemory.cpp and Texture.cpp receive a final full-file review before merge; the review bundle excluded them because they were too large. The changed hunks and relevant code paths were inspected through repo_read.py.

Not verified

The full text of core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp, core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp, and core/libs/prx/libSceAgcDriver/tests/Recorder.cpp was excluded as too large; targeted relevant ranges were read through repo_read.py. The other changed files were included in the manifest, but not all were opened in full. No tests, build, runtime, or physical-console checks were performed. The reported Windows test and performance results were not independently verified.

To get this to a good state

Nothing is required. Optional: complete a full review of the excluded files before merge.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5899263182 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/19071#pullrequestreview-5899263182). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-13T23:01:36Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing blocks this change; the points below are optional. ## What I ran Reviewed head `699ec1e45f90000020acb1c368e72cf65d2c1611` from the prepared diff and targeted source reads. No commands or tests were run in this review. ## Results | Check | Result | Note | |---|---|---| | Changed code review | passed | Core proof and write-back paths inspected | | Tests | not run | Author reports passing Windows tests | | Full changed-file coverage | not run | Two changed source files were excluded from the review bundle | ## Findings ### Blocking None. ### Non-blocking - Please ensure `GuestBufferMemory.cpp` and `Texture.cpp` receive a final full-file review before merge; the review bundle excluded them because they were too large. The changed hunks and relevant code paths were inspected through `repo_read.py`. ## Not verified The full text of `core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp`, `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp`, and `core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` was excluded as too large; targeted relevant ranges were read through `repo_read.py`. The other changed files were included in the manifest, but not all were opened in full. No tests, build, runtime, or physical-console checks were performed. The reported Windows test and performance results were not independently verified. ## To get this to a good state Nothing is required. Optional: complete a full review of the excluded files before merge.
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!19071
No description provided.