fix(agc): drop pending storage results over memory the guest unmapped #22018

Merged
JJenkx merged 5 commits from upstream-pr/22018 into main 2026-11-27 10:56:22 +00:00
JJenkx commented 2026-11-17 01:34:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-11-17T01:34:24Z.


What

When a title unmaps guest memory under a storage image whose GPU results are still pending, the next write-back stops on

AGC graphics: storing storage image results pending over memory outside the write watch without the guest bytes saved before them is not implemented (unit N of M: its results became pending while its range was watched, and its bytes were not saved when the range left the watch)

libkernel's Unmap unregisters the write watch directly (GuestWriteWatchUnregister), so StorageTexture::SaveBeforeUnwatch never runs for that range. The results then have neither a watch nor saved guest bytes to merge against.

The store already drops results whose memory is no longer registered (commit e3ce9bac0784, memory no longer registered; N pending ranges dropped). Bendy and the Ink Machine maps the same range again before the store, so the range is registered, the drop does not apply, and the store refuses.

This marks, in the unmap observer that already retires unmapped depth planes (retireUnmapped), the pending units the unmapped range covers completely (StorageTexture::NoteUnmapped), in the pending images and in those being flushed, whose stores have not yet reached the check. A unit the range covers only in part is not marked, so the results over its still-mapped bytes are stored as before. They stay pending while the unmap is in progress, as agc_driver_idle_store_over_unmap requires, and the store drops marked units instead of writing them (withoutUnmapped at the start of writeBackLayers). A unit that receives new results is unmarked, so results drawn after the range was mapped again are stored. A protection change does not reach the observer, so it marks nothing. The observer is installed once the first storage image is created (StorageTexture::Created). Each image keeps an atomic flag for whether any of its units is marked, so images with no marked unit do not take the lock or walk their units on each draw.

The new debt fragment records the behaviour as "Unmapped storage images", next to "Unmapped depth planes": what the console does with such a store is not known.

Evidence

Bendy and the Ink Machine (PPSA27616) stops this way about 82 s after launch on this PR's base 963137c40642 in 2 of 4 runs; in the other two the range was no longer registered when the store ran, so the existing drop applied. Earlier: 2 of 2 runs on main 8332b52dbf80 with #21973 (an unrelated shader change), and 4 of 4 on 1403ec8de74 and 3894f2e1847 (both with #16053 reverted locally). With local diagnostics: the refused image was 0x21c1d0000 and the first Unmap the title made was 0x21c1d0000+0x1fe0000; no unwatch through GuestMemory touched any refused range.

Tested

Latest published head a6bd7faca7e8 (2026-11-22 report).

The merge and title-check report records integration of main 1d1587ced3b0. Main moved depth retirement to retireGuarded(address, bytes, replaced) with an unmap wrapper; this PR keeps StorageTexture::NoteUnmapped in that wrapper, so target replacement does not discard storage results. The report records Bendy (PPSA27616), pristine saves and Cross every 10 seconds from 20 seconds: 3/3 topic runs reach 120 seconds and exit 0, versus 6/6 stops on comparison main bdb46a43392b with the storage write-back refusal. These are the existing worker-reported results at those pins, not a new run or speed measurement. Earlier synthetic and native results below remain historical to their named revisions.

Historical main refresh (2026-11-19): head 4554869645c773bfc5ea652ea8acbee5c95d2a62 is one linear commit on main 40206fe50daa1eca5ba72fe2da70bd505efe977f. The conflict in markLayersPending keeps both the unmapped-unit clearing and main’s known-zero invalidation memoization; the original PR’s added/removed lines are preserved in every changed file. Same Recorder fixture sources and 11 registrations on both sides: current-main production plus fixtures passes 9/11, failing only the complete-unit unmap and partly-unmapped-image witnesses; the refreshed change passes 11/11. AMD RX 6650 XT/RADV Mesa26.2.7, Linux, KHR validation1.4.363, required Vulkan, shader cache off, no skips or VUIDs. Both fresh full SDK builds passed and the builder source/configuration was restored. No new title, FPS, Windows, macOS or console claim. Historical evidence below retains its own pins. Build/test logs, JUnit, exact source delta and bank manifests, SHA-256 ec584b701e0ad9194721f251202b680f22e78b63c2e45f4a8e4b733a7adc807b (downloaded and all payload hashes verified).

Linux 7.2, AMD Ryzen 9 7950X, AMD Radeon RX 6650 XT (RADV, Mesa 26.2.7), Release, on main 963137c40642 + this PR (head 91684d451c1b).

  • agc_storage_pending_unmapped: a storage image with a pending clear over a registered, watched block; the block is removed through GuestAllocations (the observer marks the units), unwatched without the hook as libkernel's Unmap does, and registered again before the store, as Bendy and the Ink Machine does. The store does not throw, the block keeps its bytes and nothing stays pending. The range is then watched again and the image cleared again: the store writes the new results over the whole block. agc_storage_pending_partly_unmapped does the same with only the first half of the image (units 0 and 1 of 4): those units are dropped, the store does not throw and nothing stays pending. With main's Texture.cpp, Texture.hpp and MultisampleTarget.cpp, both tests fail with the refusal above; with this PR both pass.
  • agc_storage_pending_unit_part_unmapped: the range is unwatched while nothing is pending, the image is cleared, and 4 KiB inside unit 1 is removed through GuestAllocations and added again before the store. Every byte of the image, including the rest of unit 1, holds the cleared value after the store. With the earlier marking of every overlapped unit, this test fails (results over the still-mapped bytes of a partly unmapped unit were not stored).
  • agc_driver_idle_store_over_unmap passes: the results stay pending while the unmap is in progress and are settled after it.
  • ctest -j 6 -R "agc_storage|agc_driver_recorder|unmap|Unmap": 33 of 35 pass; agc_storage_pending_key_refresh and agc_storage_clear_hand_over skip on this device (it reports watched host memory written after a GPU read, and compares host imports); both skips come from those device checks, not from this change.
  • While the range is watched, every store of a freshly cleared image in these recorder tests keeps the guest bytes of its blocks (the write watch reports them written), so agc_storage_pending_partly_unmapped cannot show the stored half; agc_storage_pending_unit_part_unmapped uses an unwatched range for that reason.
  • Bendy and the Ink Machine (PPSA27616), 125 s with Cross every 15 s, alternated with main 963137c40642: 2 of 2 runs with this PR reach the end of the run, 2 of 2 more on da1eaf267d54, 3 of 3 on d2930cfc0fdd and 1 of 1 on the current head 91684d451c1b (52.8 to 53.8 fps over 60-80 s, no refusal); 11 of 11 counting earlier heads of this branch. Its unmap 0x21c1d0000+0x1fe0000 covers all 510 units of the refused image, so the narrower mark covers it; 2 of 4 on main stop on the refusal at 82 s. Mean fps over 60-80 s is 53.5 to 53.9 on both.
  • ASTRO's PLAYROOM (PPSA01325), three alternated pairs: all six runs reach the end of the run, 12.8 fps with this PR and 11.9 on main on average over 60-120 s. No speed change is claimed. A profile of the first version showed the per-unit unmark at about 1.2% of samples; the atomic flag removed it. Details are in the comments.

tools/debt_fold.py --check currently stops on main on two libSceLibreSsl3 fragments that change the same entry, unrelated to this PR; with only this PR's fragment it applies.

Contributor-reported Windows NVIDIA validation from @maskym: RTX 2070 SUPER results. All changed tests passed. The broad run retained baseline failures and an unavailable Windows test; two additional parallel failures passed three isolated reruns on both trees. Khronos validation was loaded and added no VUID errors. This is independent contributor evidence, not a run on our paused Windows host.

Contributor-reported AddressSanitizer evidence from @GiannisG1: agc_driver_store_over_untracked heap-use-after-free. With ASan and UBSan, two copies of each arm ran at once for 50 rounds, 100 runs per arm. Base 40206fe50d read a freed allocation in compareUntracked in 3 of 100 runs; head 4554869645 did so in 0 of 100. They note that 0 of 100 at that rate is not conclusive by itself.

Contributor-reported Windows NVIDIA validation of head 4554869645 from @4le22io: RTX 4060 results. No regressions, and the new tests pass.

Main merge (2026-11-20): 3daea689c25e merges main 7d2270cb862e. The only conflict was the list of recorder test modes, and both sides are kept. agc_storage_pending_unmapped, agc_storage_pending_partly_unmapped, agc_storage_pending_unit_part_unmapped and agc_storage_pending_after_unwatch pass; agc_storage_pending_key_refresh skips, as before.

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 and the licence notice of code adapted from upstream (see AGENTS.md)
  • 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: Bendy and the Ink Machine (PPSA27616) past ~84 s
  • GPUs tested: AMD Radeon RX 6650 XT, RADV Mesa 26.2.7, Linux 7.2; contributor-reported NVIDIA RTX 4060, driver 621.01, Windows 11 Pro 10.0.26200 (linked above)
  • AI-assisted: yes

Independent contributor @4le22io reports a Windows 11 Pro 10.0.26200 / RTX 4060 / NVIDIA 621.01 / i5-12400F / GCC 15.2.0 Release comparison with Khronos validation 1.4.363.1 on this exact PR head. Report and commands: main d9a86b6f15 versus main plus 4554869645, three focused runs per tree: 32/32 main and 35/35 change, zero VUIDs and all Vulkan cases loading the layer. A separate control with main production and PR fixtures failed the two unmap witnesses and full Recorder test as expected. The broad AGC suite retained the same three tracked failures on both trees. These are contributor-reported results, not a new test on our Windows host; no title or FPS gain is inferred.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5348664561 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22018). Originally posted by [JJenkx](https://github.com/JJenkx) on 2026-11-17T01:34:24Z. --- ### What When a title unmaps guest memory under a storage image whose GPU results are still pending, the next write-back stops on ``` AGC graphics: storing storage image results pending over memory outside the write watch without the guest bytes saved before them is not implemented (unit N of M: its results became pending while its range was watched, and its bytes were not saved when the range left the watch) ``` libkernel's `Unmap` unregisters the write watch directly (`GuestWriteWatchUnregister`), so `StorageTexture::SaveBeforeUnwatch` never runs for that range. The results then have neither a watch nor saved guest bytes to merge against. The store already drops results whose memory is no longer registered (commit `e3ce9bac0784`, `memory no longer registered; N pending ranges dropped`). Bendy and the Ink Machine maps the same range again before the store, so the range is registered, the drop does not apply, and the store refuses. This marks, in the unmap observer that already retires unmapped depth planes (`retireUnmapped`), the pending units the unmapped range covers completely (`StorageTexture::NoteUnmapped`), in the pending images and in those being flushed, whose stores have not yet reached the check. A unit the range covers only in part is not marked, so the results over its still-mapped bytes are stored as before. They stay pending while the unmap is in progress, as `agc_driver_idle_store_over_unmap` requires, and the store drops marked units instead of writing them (`withoutUnmapped` at the start of `writeBackLayers`). A unit that receives new results is unmarked, so results drawn after the range was mapped again are stored. A protection change does not reach the observer, so it marks nothing. The observer is installed once the first storage image is created (`StorageTexture::Created`). Each image keeps an atomic flag for whether any of its units is marked, so images with no marked unit do not take the lock or walk their units on each draw. The new debt fragment records the behaviour as "Unmapped storage images", next to "Unmapped depth planes": what the console does with such a store is not known. ### Evidence Bendy and the Ink Machine (PPSA27616) stops this way about 82 s after launch on this PR's base `963137c40642` in 2 of 4 runs; in the other two the range was no longer registered when the store ran, so the existing drop applied. Earlier: 2 of 2 runs on `main` `8332b52dbf80` with #21973 (an unrelated shader change), and 4 of 4 on `1403ec8de74` and `3894f2e1847` (both with #16053 reverted locally). With local diagnostics: the refused image was `0x21c1d0000` and the first `Unmap` the title made was `0x21c1d0000+0x1fe0000`; no unwatch through `GuestMemory` touched any refused range. ### Tested **Latest published head `a6bd7faca7e8` (2026-11-22 report).** <!-- pr22018-latest-head-evidence-a6bd7fac --> [The merge and title-check report](https://github.com/boykopovar/AnyPS5/pull/22018#issuecomment-7073667948) records integration of main `1d1587ced3b0`. Main moved depth retirement to `retireGuarded(address, bytes, replaced)` with an unmap wrapper; this PR keeps `StorageTexture::NoteUnmapped` in that wrapper, so target replacement does not discard storage results. The report records Bendy (PPSA27616), pristine saves and Cross every 10 seconds from 20 seconds: 3/3 topic runs reach 120 seconds and exit 0, versus 6/6 stops on comparison main `bdb46a43392b` with the storage write-back refusal. These are the existing worker-reported results at those pins, not a new run or speed measurement. Earlier synthetic and native results below remain historical to their named revisions. **Historical main refresh (2026-11-19):** head `4554869645c773bfc5ea652ea8acbee5c95d2a62` is one linear commit on main `40206fe50daa1eca5ba72fe2da70bd505efe977f`. The conflict in `markLayersPending` keeps both the unmapped-unit clearing and main’s known-zero invalidation memoization; the original PR’s added/removed lines are preserved in every changed file. Same Recorder fixture sources and 11 registrations on both sides: current-main production plus fixtures passes 9/11, failing only the complete-unit unmap and partly-unmapped-image witnesses; the refreshed change passes 11/11. AMD RX 6650 XT/RADV Mesa26.2.7, Linux, KHR validation1.4.363, required Vulkan, shader cache off, no skips or VUIDs. Both fresh full SDK builds passed and the builder source/configuration was restored. No new title, FPS, Windows, macOS or console claim. Historical evidence below retains its own pins. [Build/test logs, JUnit, exact source delta and bank manifests](https://github.com/JJenkx/AnyPS5/releases/download/linux-validation-20261023/pr22018-refresh-45548696-amd-20261119.tar.gz), SHA-256 `ec584b701e0ad9194721f251202b680f22e78b63c2e45f4a8e4b733a7adc807b` (downloaded and all payload hashes verified). Linux 7.2, AMD Ryzen 9 7950X, AMD Radeon RX 6650 XT (RADV, Mesa 26.2.7), Release, on `main` `963137c40642` + this PR (head `91684d451c1b`). - `agc_storage_pending_unmapped`: a storage image with a pending clear over a registered, watched block; the block is removed through `GuestAllocations` (the observer marks the units), unwatched without the hook as libkernel's `Unmap` does, and registered again before the store, as Bendy and the Ink Machine does. The store does not throw, the block keeps its bytes and nothing stays pending. The range is then watched again and the image cleared again: the store writes the new results over the whole block. `agc_storage_pending_partly_unmapped` does the same with only the first half of the image (units 0 and 1 of 4): those units are dropped, the store does not throw and nothing stays pending. With `main`'s `Texture.cpp`, `Texture.hpp` and `MultisampleTarget.cpp`, both tests fail with the refusal above; with this PR both pass. - `agc_storage_pending_unit_part_unmapped`: the range is unwatched while nothing is pending, the image is cleared, and 4 KiB inside unit 1 is removed through `GuestAllocations` and added again before the store. Every byte of the image, including the rest of unit 1, holds the cleared value after the store. With the earlier marking of every overlapped unit, this test fails (`results over the still-mapped bytes of a partly unmapped unit were not stored`). - `agc_driver_idle_store_over_unmap` passes: the results stay pending while the unmap is in progress and are settled after it. - `ctest -j 6 -R "agc_storage|agc_driver_recorder|unmap|Unmap"`: 33 of 35 pass; `agc_storage_pending_key_refresh` and `agc_storage_clear_hand_over` skip on this device (it reports watched host memory written after a GPU read, and compares host imports); both skips come from those device checks, not from this change. - While the range is watched, every store of a freshly cleared image in these recorder tests keeps the guest bytes of its blocks (the write watch reports them written), so `agc_storage_pending_partly_unmapped` cannot show the stored half; `agc_storage_pending_unit_part_unmapped` uses an unwatched range for that reason. - Bendy and the Ink Machine (PPSA27616), 125 s with Cross every 15 s, alternated with `main` `963137c40642`: 2 of 2 runs with this PR reach the end of the run, 2 of 2 more on `da1eaf267d54`, 3 of 3 on `d2930cfc0fdd` and 1 of 1 on the current head `91684d451c1b` (52.8 to 53.8 fps over 60-80 s, no refusal); 11 of 11 counting earlier heads of this branch. Its unmap `0x21c1d0000+0x1fe0000` covers all 510 units of the refused image, so the narrower mark covers it; 2 of 4 on `main` stop on the refusal at 82 s. Mean fps over 60-80 s is 53.5 to 53.9 on both. - ASTRO's PLAYROOM (PPSA01325), three alternated pairs: all six runs reach the end of the run, 12.8 fps with this PR and 11.9 on `main` on average over 60-120 s. No speed change is claimed. A profile of the first version showed the per-unit unmark at about 1.2% of samples; the atomic flag removed it. Details are in the comments. `tools/debt_fold.py --check` currently stops on main on two libSceLibreSsl3 fragments that change the same entry, unrelated to this PR; with only this PR's fragment it applies. Contributor-reported Windows NVIDIA validation from @maskym: [RTX 2070 SUPER results](https://github.com/boykopovar/AnyPS5/pull/22018#issuecomment-6979886457). All changed tests passed. The broad run retained baseline failures and an unavailable Windows test; two additional parallel failures passed three isolated reruns on both trees. Khronos validation was loaded and added no VUID errors. This is independent contributor evidence, not a run on our paused Windows host. Contributor-reported AddressSanitizer evidence from @GiannisG1: [`agc_driver_store_over_untracked` heap-use-after-free](https://github.com/boykopovar/AnyPS5/pull/22018#issuecomment-7030909803). With ASan and UBSan, two copies of each arm ran at once for 50 rounds, 100 runs per arm. Base `40206fe50d` read a freed allocation in `compareUntracked` in 3 of 100 runs; head `4554869645` did so in 0 of 100. They note that 0 of 100 at that rate is not conclusive by itself. Contributor-reported Windows NVIDIA validation of head `4554869645` from @4le22io: [RTX 4060 results](https://github.com/boykopovar/AnyPS5/pull/22018#issuecomment-7023131139). No regressions, and the new tests pass. **Main merge (2026-11-20):** `3daea689c25e` merges main `7d2270cb862e`. The only conflict was the list of recorder test modes, and both sides are kept. `agc_storage_pending_unmapped`, `agc_storage_pending_partly_unmapped`, `agc_storage_pending_unit_part_unmapped` and `agc_storage_pending_after_unwatch` pass; `agc_storage_pending_key_refresh` skips, as before. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) and the licence notice of code adapted from upstream (see AGENTS.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: Bendy and the Ink Machine (PPSA27616) past ~84 s - [x] GPUs tested: AMD Radeon RX 6650 XT, RADV Mesa 26.2.7, Linux 7.2; contributor-reported NVIDIA RTX 4060, driver 621.01, Windows 11 Pro 10.0.26200 (linked above) - [x] AI-assisted: yes Independent contributor @4le22io reports a Windows 11 Pro 10.0.26200 / RTX 4060 / NVIDIA 621.01 / i5-12400F / GCC 15.2.0 Release comparison with Khronos validation 1.4.363.1 on this exact PR head. [Report and commands](https://github.com/boykopovar/AnyPS5/pull/22018#issuecomment-7023131139): main `d9a86b6f15` versus main plus `4554869645`, three focused runs per tree: 32/32 main and 35/35 change, zero VUIDs and all Vulkan cases loading the layer. A separate control with main production and PR fixtures failed the two unmap witnesses and full Recorder test as expected. The broad AGC suite retained the same three tracked failures on both trees. These are contributor-reported results, not a new test on our Windows host; no title or FPS gain is inferred.
MarcZX10 commented 2026-11-17 04:03:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-17T04:03:46Z.

Review: COMMENTED


Reviewed — no blocking findings

The diff was read in full and the changed ranges of Texture.cpp were read at the head; nothing was built or run, so this rests on reading. Nothing blocks this; the points below are optional.

What I ran

  • Head: fbc2620ec21efa071b990b0f6c945b4a3356619e, base main. Merge preview not run.
  • Environment: none. No build, no test run.
  • Reader calls (the reader is repo_read.py):
repo_read.py search "Pending()" core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
repo_read.py search "markLayersPending(" core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
repo_read.py search "writeBackLayers(" core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
repo_read.py search "GpuPending(" core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
repo_read.py search "cancelStoredSave(" core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp START END   (ranges 1760-1780, 2900-2925, 4630-4830, 6320-6410, 6725-6765, 6905-6930, 7340-7480, 1968-1985)

Results

Check Result Note
Diff read (six files) passed Text from the review folder
Head read, Texture.cpp passed Changed ranges and their callers only
Build not run
agc_storage_pending_unmapped not run
Recorder test suite not run
Performance claims not run

Findings

Blocking

None.

Non-blocking

  • core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp:6352: StorageTexture::NoteUnmapped walks every texture in pending.textures under pending.mutex on each unmap. ScanPending (Texture.cpp:6330) narrows the same set with pending.textures.MayOverlap. Using the same index here would keep the unmap path short when many storage images are pending.
  • core/libs/prx/libSceAgcDriver/tests/Recorder.cpp:9044: pendingUnmappedTests removes the whole block, so every pending unit is marked. The mixed case in withoutUnmapped (Texture.cpp:7428, where some marked units are stored and others dropped) and a partial unmap of one 64 KiB unit are not exercised.

Not verified

  • Whether the callers of markLayersPending (Texture.cpp:4638, 4653, 6761, 6927) or of writeBackLayers (Texture.cpp:2917, 7382) already hold Pending().mutex. The new lock at Texture.cpp:4752 and the one in withoutUnmapped would deadlock if they did. The enclosing functions were not read.
  • Lock order between the unmap observer (NoteUnmapped takes Pending().mutex) and the GuestAllocations lock, and the new call to UpdateResidentImageUnmapObserver_nid_no_patch in the static initializer at Texture.cpp:1775.
  • The claim that a protection change marks nothing: not traced.
  • Recorder.cpp, the cmake file and the debt fragment were checked from the diff only; their head text was not read.
  • files.json was not read.
  • The device results in the description (Bendy and the Ink Machine, ASTRO's PLAYROOM, the fps figures) and tools/debt_fold.py --check: not run and not checked.
  • No negative control was run: the new test was not shown to fail without the change.

Sources

To get this to a good state

Nothing is required. Optional: run agc_storage_pending_unmapped and the storage test set on a device, and check the two points under Not verified.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5932618563 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22018#pullrequestreview-5932618563). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-17T04:03:46Z. **Review:** COMMENTED --- # Reviewed — no blocking findings The diff was read in full and the changed ranges of `Texture.cpp` were read at the head; nothing was built or run, so this rests on reading. Nothing blocks this; the points below are optional. ## What I ran - Head: `fbc2620ec21efa071b990b0f6c945b4a3356619e`, base `main`. Merge preview not run. - Environment: none. No build, no test run. - Reader calls (the reader is `repo_read.py`): ``` repo_read.py search "Pending()" core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp repo_read.py search "markLayersPending(" core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp repo_read.py search "writeBackLayers(" core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp repo_read.py search "GpuPending(" core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp repo_read.py search "cancelStoredSave(" core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp START END (ranges 1760-1780, 2900-2925, 4630-4830, 6320-6410, 6725-6765, 6905-6930, 7340-7480, 1968-1985) ``` ## Results | Check | Result | Note | | --- | --- | --- | | Diff read (six files) | passed | Text from the review folder | | Head read, `Texture.cpp` | passed | Changed ranges and their callers only | | Build | not run | | | `agc_storage_pending_unmapped` | not run | | | Recorder test suite | not run | | | Performance claims | not run | | ## Findings **Blocking** None. **Non-blocking** - `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp:6352`: `StorageTexture::NoteUnmapped` walks every texture in `pending.textures` under `pending.mutex` on each unmap. `ScanPending` (`Texture.cpp:6330`) narrows the same set with `pending.textures.MayOverlap`. Using the same index here would keep the unmap path short when many storage images are pending. - `core/libs/prx/libSceAgcDriver/tests/Recorder.cpp:9044`: `pendingUnmappedTests` removes the whole block, so every pending unit is marked. The mixed case in `withoutUnmapped` (`Texture.cpp:7428`, where some marked units are stored and others dropped) and a partial unmap of one 64 KiB unit are not exercised. ## Not verified - Whether the callers of `markLayersPending` (`Texture.cpp:4638`, `4653`, `6761`, `6927`) or of `writeBackLayers` (`Texture.cpp:2917`, `7382`) already hold `Pending().mutex`. The new lock at `Texture.cpp:4752` and the one in `withoutUnmapped` would deadlock if they did. The enclosing functions were not read. - Lock order between the unmap observer (`NoteUnmapped` takes `Pending().mutex`) and the `GuestAllocations` lock, and the new call to `UpdateResidentImageUnmapObserver_nid_no_patch` in the static initializer at `Texture.cpp:1775`. - The claim that a protection change marks nothing: not traced. - Recorder.cpp, the cmake file and the debt fragment were checked from the diff only; their head text was not read. - `files.json` was not read. - The device results in the description (Bendy and the Ink Machine, ASTRO's PLAYROOM, the fps figures) and `tools/debt_fold.py --check`: not run and not checked. - No negative control was run: the new test was not shown to fail without the change. ## Sources - [`Texture.cpp` `withoutUnmapped` call](https://github.com/boykopovar/AnyPS5/blob/fbc2620ec21efa071b990b0f6c945b4a3356619e/core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp#L7428-L7431) - [`Texture.cpp` `markLayersPending` unmark](https://github.com/boykopovar/AnyPS5/blob/fbc2620ec21efa071b990b0f6c945b4a3356619e/core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp#L4751-L4756) - [`Texture.cpp` `NoteUnmapped`](https://github.com/boykopovar/AnyPS5/blob/fbc2620ec21efa071b990b0f6c945b4a3356619e/core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp#L6348-L6359) - [`MultisampleTarget.cpp` `retireUnmapped`](https://github.com/boykopovar/AnyPS5/blob/fbc2620ec21efa071b990b0f6c945b4a3356619e/core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp#L1219-L1220) ## To get this to a good state Nothing is required. Optional: run `agc_storage_pending_unmapped` and the storage test set on a device, and check the two points under Not verified.
MarcZX10 commented 2026-11-17 05:15:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-17T05:15:49Z.

Review: COMMENTED


Reviewed the changed hunks — no blocking findings

Nothing blocks this; the points below are optional.

What I ran

  • Head da1eaf267d54d57dfb32c338950491a4f61e521c, base main.
  • Read description.md, commits.md, manifest.json, diff.patch and files.json from the review folder.
  • Read the head with the repository reader (repo_read.py): searches for NoteUnmapped, Created, withoutUnmapped, writeBackLayers, UpdateResidentImageUnmapObserver_nid_no_patch, cancelStoredSave, retireUnmapped, markLayersPending, DiscardPendingInside and Pending(); ranges Texture.cpp 5608–5625, 6262–6290, 6346–6362 and 7360–7490; MultisampleTarget.cpp 1214–1240. About 20 reader calls.
  • No build and no tests were run in this review.

Results

Check Result Note
Build and recorder tests not run No build in this review
New names resolve at head passed Declared in the headers and called from the observer
Lock use in the new paths passed NoteUnmapped runs before guardedMutex; withoutUnmapped takes only the pending lock
Author-reported ctest run not run Reported in the description, not reproduced
Negative control not run Author reports the new tests fail on main's Texture.cpp; not reproduced

Findings

Blocking

None.

Non-blocking

  • core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp:6356 marks a whole 64 KiB unit when the unmapped range overlaps only part of it. Results drawn over the still-mapped bytes of that unit are then dropped at the next store as well. The description lists this case as not covered. Either record it in the debt fragment, or add a test with a unit split by a partial unmap.

Negative control

Not run. The author reports that both new tests fail on main's Texture.cpp, Texture.hpp and MultisampleTarget.cpp; I did not reproduce that.

Sources

Not verified

  • Full text was not read for Texture.cpp (8027 lines) or tests/Recorder.cpp; both were too large for the review folder. I read their changed hunks through the reader and diff.patch.
  • Texture.hpp, MultisampleTarget.cpp, agc_driver_recorder_tests.cmake and the debt fragment were read through diff.patch and the reader ranges above, not as full files.
  • withoutUnmapped drops units without calling releaseUnheldOriginal (Texture.cpp:7421), unlike the empty write-back path (Texture.cpp:6281). I did not confirm that original is released on another path, so retained memory is unverified.
  • Whether results over still-mapped bytes of a split unit are stored after a partial unmap: not reproduced (see Non-blocking).
  • Device behaviour (Bendy and the Ink Machine, ASTRO's PLAYROOM) is author-reported only.
  • Lock order across all callers of writeBackLayers and the unmap observer: I checked the paths listed in What I ran, not the rest.

To get this to a good state

Nothing is required. The non-blocking point above is optional.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5933307111 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22018#pullrequestreview-5933307111). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-17T05:15:49Z. **Review:** COMMENTED --- # Reviewed the changed hunks — no blocking findings Nothing blocks this; the points below are optional. ## What I ran - Head `da1eaf267d54d57dfb32c338950491a4f61e521c`, base `main`. - Read `description.md`, `commits.md`, `manifest.json`, `diff.patch` and `files.json` from the review folder. - Read the head with the repository reader (`repo_read.py`): searches for `NoteUnmapped`, `Created`, `withoutUnmapped`, `writeBackLayers`, `UpdateResidentImageUnmapObserver_nid_no_patch`, `cancelStoredSave`, `retireUnmapped`, `markLayersPending`, `DiscardPendingInside` and `Pending()`; ranges `Texture.cpp` 5608–5625, 6262–6290, 6346–6362 and 7360–7490; `MultisampleTarget.cpp` 1214–1240. About 20 reader calls. - No build and no tests were run in this review. ## Results | Check | Result | Note | |---|---|---| | Build and recorder tests | not run | No build in this review | | New names resolve at head | passed | Declared in the headers and called from the observer | | Lock use in the new paths | passed | `NoteUnmapped` runs before `guardedMutex`; `withoutUnmapped` takes only the pending lock | | Author-reported ctest run | not run | Reported in the description, not reproduced | | Negative control | not run | Author reports the new tests fail on `main`'s `Texture.cpp`; not reproduced | ## Findings ### Blocking None. ### Non-blocking - `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp:6356` marks a whole 64 KiB unit when the unmapped range overlaps only part of it. Results drawn over the still-mapped bytes of that unit are then dropped at the next store as well. The description lists this case as not covered. Either record it in the debt fragment, or add a test with a unit split by a partial unmap. ## Negative control Not run. The author reports that both new tests fail on `main`'s `Texture.cpp`, `Texture.hpp` and `MultisampleTarget.cpp`; I did not reproduce that. ## Sources - [`NoteUnmapped`](https://github.com/boykopovar/AnyPS5/blob/da1eaf267d54d57dfb32c338950491a4f61e521c/core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp#L6348-L6361) - [`withoutUnmapped` and `writeBackLayers`](https://github.com/boykopovar/AnyPS5/blob/da1eaf267d54d57dfb32c338950491a4f61e521c/core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp#L7410-L7432) - [`retireUnmapped`](https://github.com/boykopovar/AnyPS5/blob/da1eaf267d54d57dfb32c338950491a4f61e521c/core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp#L1219-L1221) ## Not verified - Full text was not read for `Texture.cpp` (8027 lines) or `tests/Recorder.cpp`; both were too large for the review folder. I read their changed hunks through the reader and `diff.patch`. - `Texture.hpp`, `MultisampleTarget.cpp`, `agc_driver_recorder_tests.cmake` and the debt fragment were read through `diff.patch` and the reader ranges above, not as full files. - `withoutUnmapped` drops units without calling `releaseUnheldOriginal` (`Texture.cpp:7421`), unlike the empty write-back path (`Texture.cpp:6281`). I did not confirm that `original` is released on another path, so retained memory is unverified. - Whether results over still-mapped bytes of a split unit are stored after a partial unmap: not reproduced (see Non-blocking). - Device behaviour (Bendy and the Ink Machine, ASTRO's PLAYROOM) is author-reported only. - Lock order across all callers of `writeBackLayers` and the unmap observer: I checked the paths listed in What I ran, not the rest. ## To get this to a good state Nothing is required. The non-blocking point above is optional.
MarcZX10 commented 2026-11-17 05:58:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-17T05:58:05Z.

Review: CHANGES_REQUESTED


Reviewed — changes requested

Changes are required before merge: a partly unmapped storage unit drops the pending results over its still-mapped bytes.

What I ran

  • Head reviewed: a0a1151958d9d7a019857dd540d15de3e99917c2 (base main). Read the title, description, commit list, manifest and the full diff.patch (458 lines), plus the house-rule sections of the ruling file.
  • Repository checks, by search only, through the reader:
python3 repo_read.py search UpdateResidentImageUnmapObserver_nid_no_patch core/libs/prx/libSceAgcDriver
python3 repo_read.py search layerOriginal core/libs/prx/libSceAgcDriver/Graphics
  • No build and no tests were run in this review.

Results

Check Result Note
Diff read in full passed 458 lines
New observer call declared passed Header included in Texture.cpp
Partly unmapped units failed Whole unit dropped
Build and ctest not run Author-reported only

Findings

Blocking

  • core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp:7416 — withoutUnmapped drops a whole 64 KiB unit when the unmapped range covers only part of it. NoteUnmapped marks every unit that overlaps the range (core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp:6356-6357), and the store then clears layerPending and layerOriginal for that unit and skips it (core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp:7418-7421).
    • Failure: a 256×256 RGBA8 storage image with 64 KiB units is cleared, then the title unmaps 4 KiB inside unit 1 and maps it again. The rest of unit 1 stays mapped, but its pending results are discarded at the store, so the guest keeps the old bytes there.
    • The debt note states this behaviour (docs/dev/debt/changes/fix-agc-discard-storage-results-on-unmap.md:5), and no test covers it: the partial test unmaps two whole units (core/libs/prx/libSceAgcDriver/tests/Recorder.cpp:9188).
    • Fix: keep the still-mapped bytes of a partly unmapped unit (save them before the drop), or leave such a unit pending. Check the Bendy range edges first, because a narrower mark may not stop that refusal. If the trade-off stays, the PR body and the debt note must say so, and a maintainer must accept it.

Non-blocking

  • core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp:1465 — once any storage image exists, the unmap observer stays installed for the rest of the process. retireUnmapped then runs on every unmap, taking the guarded lock and calling forgetSingleClears and RetireUnmappedDepth, even in titles that never unmap pending storage. The performance evidence covers three titles.

Not verified

  • Build, ctest, and the Bendy and ASTRO runs are author-reported. I did not run them and did not reproduce the refusal at 82 s.
  • Texture.cpp and Recorder.cpp are excluded from the review folder as too large. I read only their changed hunks from diff.patch and ran two symbol searches; I did not read their full text. The callers of NoteUnmapped and of retireUnmapped, and the lock order between Pending().mutex and the unmap observer, are not verified.
  • files.json was not read, so the set of reviewed files is not confirmed. This does not change the event, since the verdict is not an approval.
  • The description's claims about commit e3ce9bac0784 and about protection changes were not checked.

Sources

To get this to a good state

  • Stop a partly unmapped unit from dropping results over its still-mapped bytes, or record the trade-off in the PR and get a maintainer decision.
  • Add a recorder test for an unmap inside one 64 KiB unit, checking that the still-mapped bytes are stored.
  • Rerun ctest -j 8 -R "agc_storage|agc_driver_recorder|unmap|Unmap" on the new head, plus the new test.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5933712388 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22018#pullrequestreview-5933712388). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-17T05:58:05Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested Changes are required before merge: a partly unmapped storage unit drops the pending results over its still-mapped bytes. ## What I ran - Head reviewed: `a0a1151958d9d7a019857dd540d15de3e99917c2` (base `main`). Read the title, description, commit list, manifest and the full `diff.patch` (458 lines), plus the house-rule sections of the ruling file. - Repository checks, by search only, through the reader: ``` python3 repo_read.py search UpdateResidentImageUnmapObserver_nid_no_patch core/libs/prx/libSceAgcDriver python3 repo_read.py search layerOriginal core/libs/prx/libSceAgcDriver/Graphics ``` - No build and no tests were run in this review. ## Results | Check | Result | Note | |---|---|---| | Diff read in full | passed | 458 lines | | New observer call declared | passed | Header included in `Texture.cpp` | | Partly unmapped units | failed | Whole unit dropped | | Build and ctest | not run | Author-reported only | ## Findings ### Blocking - `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp:7416` — `withoutUnmapped` drops a whole 64 KiB unit when the unmapped range covers only part of it. `NoteUnmapped` marks every unit that overlaps the range (`core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp:6356-6357`), and the store then clears `layerPending` and `layerOriginal` for that unit and skips it (`core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp:7418-7421`). - Failure: a 256×256 RGBA8 storage image with 64 KiB units is cleared, then the title unmaps 4 KiB inside unit 1 and maps it again. The rest of unit 1 stays mapped, but its pending results are discarded at the store, so the guest keeps the old bytes there. - The debt note states this behaviour (`docs/dev/debt/changes/fix-agc-discard-storage-results-on-unmap.md:5`), and no test covers it: the partial test unmaps two whole units (`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp:9188`). - Fix: keep the still-mapped bytes of a partly unmapped unit (save them before the drop), or leave such a unit pending. Check the Bendy range edges first, because a narrower mark may not stop that refusal. If the trade-off stays, the PR body and the debt note must say so, and a maintainer must accept it. ### Non-blocking - `core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp:1465` — once any storage image exists, the unmap observer stays installed for the rest of the process. `retireUnmapped` then runs on every unmap, taking the guarded lock and calling `forgetSingleClears` and `RetireUnmappedDepth`, even in titles that never unmap pending storage. The performance evidence covers three titles. ## Not verified - Build, ctest, and the Bendy and ASTRO runs are author-reported. I did not run them and did not reproduce the refusal at 82 s. - `Texture.cpp` and `Recorder.cpp` are excluded from the review folder as too large. I read only their changed hunks from `diff.patch` and ran two symbol searches; I did not read their full text. The callers of `NoteUnmapped` and of `retireUnmapped`, and the lock order between `Pending().mutex` and the unmap observer, are not verified. - `files.json` was not read, so the set of reviewed files is not confirmed. This does not change the event, since the verdict is not an approval. - The description's claims about commit `e3ce9bac0784` and about protection changes were not checked. ## Sources - [Unit mark in `NoteUnmapped`](https://github.com/boykopovar/AnyPS5/blob/a0a1151958d9d7a019857dd540d15de3e99917c2/core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp#L6356-L6357) - [Whole-unit drop in `withoutUnmapped`](https://github.com/boykopovar/AnyPS5/blob/a0a1151958d9d7a019857dd540d15de3e99917c2/core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp#L7416-L7421) ## To get this to a good state - Stop a partly unmapped unit from dropping results over its still-mapped bytes, or record the trade-off in the PR and get a maintainer decision. - Add a recorder test for an unmap inside one 64 KiB unit, checking that the still-mapped bytes are stored. - Rerun `ctest -j 8 -R "agc_storage|agc_driver_recorder|unmap|Unmap"` on the new head, plus the new test.
MarcZX10 commented 2026-11-17 06:37:11 +00:00 (Migrated from github.com)

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

Review: COMMENTED


Reviewed — no blocking findings

Nothing blocks this; the points below are optional. The review is partial: no build or test was run, and only selected ranges of the large files were read.

What I ran

Head d2930cfc0fdd1de65316e861cf274633664be2b4, base main. No build, no test run, no precheck. Reads were done with the repository reader:

python3 repo_read.py search UpdateResidentImageUnmapObserver_nid_no_patch core/libs/prx/libSceAgcDriver
python3 repo_read.py search markLayersPending core/libs/prx/libSceAgcDriver
python3 repo_read.py search writeBackLayers core/libs/prx/libSceAgcDriver
python3 repo_read.py search "lock(pending.mutex)" core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp START END   (7 ranges)
python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp 1214 1226

Results

Check Result Note
Build not run Outside this review
New and existing recorder tests not run Needs a build
Diff read, six reviewed files passed Full diff read
Full text of large files not run Selected ranges only

Findings

Blocking

None.

Non-blocking

  • core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp:6353: NoteUnmapped walks only pending.textures. otherPendingOverlaps (Texture.cpp:2967-2971) checks pending.flushing as well. If an image sits in pending.flushing with pending units when the title unmaps the range, those units are not marked, and the refusal described in the description stays possible. I did not confirm whether a flushing image can hold pending units at that moment. If it can, extend the walk to pending.flushing, or explain in the code why it cannot.

Not verified

  • Build, compile, and the three new tests (agc_storage_pending_unmapped, agc_storage_pending_partly_unmapped, agc_storage_pending_unit_part_unmapped) and the existing suites: not run.
  • Hardware and game results in the description (Bendy and the Ink Machine runs, fps figures, the ASTRO's PLAYROOM runs, the 1.2% profile figure): not checked. No runs were available here.
  • Texture.cpp: only the diff and these ranges were read: 2905-2920, 2962-2975, 6745-6765, 6915-6930, 7360-7386, 7428-7450. The rest of the file was not read.
  • markLayersPending callers (Texture.cpp:6762, Texture.cpp:6928): I did not confirm that pending.mutex is not already held there. A held lock would deadlock on the new lock in markLayersPending.
  • withoutUnmapped calls cancelStoredSave while it holds pending.mutex. The lock order with the saved-bytes lock was not checked.
  • Texture.hpp, Recorder.cpp, agc_driver_recorder_tests.cmake and the debt fragment: read through the diff only, not as full files. The claim that tools/debt_fold.py --check stops on two unrelated fragments on main was not checked.

Sources

Head d2930cfc0fdd1de65316e861cf274633664be2b4. Repository paths as cited above.

To get this to a good state

Nothing is required.

Optional: build the head and run the three new recorder tests, and answer the flushing question above.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5934062500 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22018#pullrequestreview-5934062500). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-17T06:37:11Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing blocks this; the points below are optional. The review is partial: no build or test was run, and only selected ranges of the large files were read. ## What I ran Head `d2930cfc0fdd1de65316e861cf274633664be2b4`, base `main`. No build, no test run, no precheck. Reads were done with the repository reader: ``` python3 repo_read.py search UpdateResidentImageUnmapObserver_nid_no_patch core/libs/prx/libSceAgcDriver python3 repo_read.py search markLayersPending core/libs/prx/libSceAgcDriver python3 repo_read.py search writeBackLayers core/libs/prx/libSceAgcDriver python3 repo_read.py search "lock(pending.mutex)" core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp START END (7 ranges) python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp 1214 1226 ``` ## Results | Check | Result | Note | | --- | --- | --- | | Build | not run | Outside this review | | New and existing recorder tests | not run | Needs a build | | Diff read, six reviewed files | passed | Full diff read | | Full text of large files | not run | Selected ranges only | ## Findings **Blocking** None. **Non-blocking** - `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp:6353`: `NoteUnmapped` walks only `pending.textures`. `otherPendingOverlaps` (`Texture.cpp:2967-2971`) checks `pending.flushing` as well. If an image sits in `pending.flushing` with pending units when the title unmaps the range, those units are not marked, and the refusal described in the description stays possible. I did not confirm whether a flushing image can hold pending units at that moment. If it can, extend the walk to `pending.flushing`, or explain in the code why it cannot. ## Not verified - Build, compile, and the three new tests (`agc_storage_pending_unmapped`, `agc_storage_pending_partly_unmapped`, `agc_storage_pending_unit_part_unmapped`) and the existing suites: not run. - Hardware and game results in the description (Bendy and the Ink Machine runs, fps figures, the ASTRO's PLAYROOM runs, the 1.2% profile figure): not checked. No runs were available here. - `Texture.cpp`: only the diff and these ranges were read: 2905-2920, 2962-2975, 6745-6765, 6915-6930, 7360-7386, 7428-7450. The rest of the file was not read. - `markLayersPending` callers (`Texture.cpp:6762`, `Texture.cpp:6928`): I did not confirm that `pending.mutex` is not already held there. A held lock would deadlock on the new lock in `markLayersPending`. - `withoutUnmapped` calls `cancelStoredSave` while it holds `pending.mutex`. The lock order with the saved-bytes lock was not checked. - `Texture.hpp`, `Recorder.cpp`, `agc_driver_recorder_tests.cmake` and the debt fragment: read through the diff only, not as full files. The claim that `tools/debt_fold.py --check` stops on two unrelated fragments on `main` was not checked. ## Sources Head `d2930cfc0fdd1de65316e861cf274633664be2b4`. Repository paths as cited above. ## To get this to a good state Nothing is required. Optional: build the head and run the three new recorder tests, and answer the flushing question above.
MarcZX10 commented 2026-11-17 06:55:51 +00:00 (Migrated from github.com)

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

Review: COMMENTED


Reviewed — no blocking findings

Nothing blocks this; the points below are optional.

What I ran

Head 91684d451c1b, base main. No build and no tests were run. I read the diff, the description and the commit list, then the head source through the repository reader:

python3 repo_read.py search withoutUnmapped
python3 repo_read.py search "std::lock_guard lock(pending.mutex)"
python3 repo_read.py search markLayersPending
python3 repo_read.py search writeBackLayers(
python3 repo_read.py search UpdateResidentImageUnmapObserver_nid_no_patch
python3 repo_read.py search unmapObserver
python3 repo_read.py search cancelStoredSave
python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp 2860 2920
python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp 4625 4775
python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp 6750 6770
python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp 6915 6935
python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp 7300 7470

Results

Check Result Note
Diff and description passed Read in full
Changed hunks at head passed Read through the reader and the diff
Build and unit tests not run Author-reported only
Hosted CI not run Not checked in this run

Findings

Blocking

None verified.

Non-blocking

  1. Texture.cpp:6362 — the pending.flushing loop in StorageTexture::NoteUnmapped has no test. None of the three new recorder tests puts an image into the flushing list, so a regression there would pass unnoticed. (test-coverage)
  2. Recorder.cpp:9165 and Recorder.cpp:9273 — pendingPartialUnmapTests and pendingUnitPartUnmapTests repeat the setup, watch restore, release guard and surface description of pendingUnmappedTests (Recorder.cpp:9044), about 100 near-identical lines each. A shared helper would keep the three in step. (simplification)

Not verified

  • Lock order. NoteUnmapped takes pending.mutex from the unmap observer. I did not check whether the observer runs under the GuestAllocations lock, so I cannot rule out an inversion with a path that holds pending.mutex and then takes that lock.
  • Static initialisation. StorageTexture::Create calls UpdateResidentImageUnmapObserver_nid_no_patch() from its one-time initialiser (Texture.cpp:1775). I did not check which locks that call takes or whether Create can run while they are held.
  • Store paths. I confirmed that withoutUnmapped runs inside writeBackLayers, which both callers use (Texture.cpp:2917, Texture.cpp:7385). I did not check whether any other path writes pending results to guest memory without it.
  • layerOriginal on drop. withoutUnmapped sets layerOriginal[layer] = false (Texture.cpp:7423); the existing drop path (Texture.cpp:2900) only clears layerPending. I could not tell from the code read whether the difference is intended.
  • Full files. Texture.cpp and Recorder.cpp are excluded from the review folder as too large. I read their changed hunks and the reader ranges above, not the whole files.
  • Test evidence. The test results and device runs in the description are the author's. I did not run the tests and cannot confirm the device behaviour.

Sources

To get this to a good state

Nothing is required.

Optional: add a test that puts an image into the flushing list before the unmap, and move the shared test setup into a helper.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5934228206 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22018#pullrequestreview-5934228206). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-17T06:55:51Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing blocks this; the points below are optional. ## What I ran Head `91684d451c1b`, base `main`. No build and no tests were run. I read the diff, the description and the commit list, then the head source through the repository reader: ``` python3 repo_read.py search withoutUnmapped python3 repo_read.py search "std::lock_guard lock(pending.mutex)" python3 repo_read.py search markLayersPending python3 repo_read.py search writeBackLayers( python3 repo_read.py search UpdateResidentImageUnmapObserver_nid_no_patch python3 repo_read.py search unmapObserver python3 repo_read.py search cancelStoredSave python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp 2860 2920 python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp 4625 4775 python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp 6750 6770 python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp 6915 6935 python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp 7300 7470 ``` ## Results | Check | Result | Note | |---|---|---| | Diff and description | passed | Read in full | | Changed hunks at head | passed | Read through the reader and the diff | | Build and unit tests | not run | Author-reported only | | Hosted CI | not run | Not checked in this run | ## Findings ### Blocking None verified. ### Non-blocking 1. `Texture.cpp:6362` — the `pending.flushing` loop in `StorageTexture::NoteUnmapped` has no test. None of the three new recorder tests puts an image into the flushing list, so a regression there would pass unnoticed. (test-coverage) 2. `Recorder.cpp:9165` and `Recorder.cpp:9273` — `pendingPartialUnmapTests` and `pendingUnitPartUnmapTests` repeat the setup, watch restore, release guard and surface description of `pendingUnmappedTests` (`Recorder.cpp:9044`), about 100 near-identical lines each. A shared helper would keep the three in step. (simplification) ## Not verified - **Lock order.** `NoteUnmapped` takes `pending.mutex` from the unmap observer. I did not check whether the observer runs under the GuestAllocations lock, so I cannot rule out an inversion with a path that holds `pending.mutex` and then takes that lock. - **Static initialisation.** `StorageTexture::Create` calls `UpdateResidentImageUnmapObserver_nid_no_patch()` from its one-time initialiser (`Texture.cpp:1775`). I did not check which locks that call takes or whether `Create` can run while they are held. - **Store paths.** I confirmed that `withoutUnmapped` runs inside `writeBackLayers`, which both callers use (`Texture.cpp:2917`, `Texture.cpp:7385`). I did not check whether any other path writes pending results to guest memory without it. - **`layerOriginal` on drop.** `withoutUnmapped` sets `layerOriginal[layer] = false` (`Texture.cpp:7423`); the existing drop path (`Texture.cpp:2900`) only clears `layerPending`. I could not tell from the code read whether the difference is intended. - **Full files.** `Texture.cpp` and `Recorder.cpp` are excluded from the review folder as too large. I read their changed hunks and the reader ranges above, not the whole files. - **Test evidence.** The test results and device runs in the description are the author's. I did not run the tests and cannot confirm the device behaviour. ## Sources - `Texture.cpp` unmark in `markLayersPending` (lines 4751–4756): https://github.com/boykopovar/AnyPS5/blob/91684d451c1bd8365ea316c47564784708ae4278/core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp#L4751-L4756 - `withoutUnmapped` and its use in `writeBackLayers` (lines 7412–7434): https://github.com/boykopovar/AnyPS5/blob/91684d451c1bd8365ea316c47564784708ae4278/core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp#L7412-L7434 ## To get this to a good state Nothing is required. Optional: add a test that puts an image into the flushing list before the unmap, and move the shared test setup into a helper.
kurexw commented 2026-11-17 07:44:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by kurexw on 2026-11-17T07:44:49Z.

Review: COMMENTED


macOS GPU test (Apple M4, MoltenVK 1.4.2, validation layer 1.4.363.1, x86-64 build under Rosetta)

Base: upstream/main a72186d3cf + #22056 + #22074 (both needed for the macOS build); PR head 91684d451c merged on top. Built clean (only the known libcurl link failure, #17425).
Env per AGENTS.md: ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer, ctest -R 'recorder|constant_phi|masked_select|sample_bit_descriptor|pixel_ancillary|scalar_buffer|shader_mode_registers|agc_driver_f64|command_batch|awaited_slot|agc_driver_idle|detiler' -V, 3 runs each on base and PR.

  • Every test has the same status on base and PR in all 3 runs; no new VUID- errors.
  • Every test that creates a Vulkan instance logs Insert instance layer "VK_LAYER_KHRONOS_validation"; none logs was not found but was requested. The tests without layer lines (agc_constant_phi, agc_masked_select, agc_command_batch_*, pixel_ancillary, ...) never touch the loader.
  • Same on base and PR: 11 agc_driver_f64_* tests skip (the M4 has no shaderFloat64); agc_driver_recorder fails with a kept vertex window was not mirrored (#20831); the recorder tests each log one VUID-VkDeviceCreateInfo-sType-unique for a duplicated VkPhysicalDevicePortabilitySubsetFeaturesKHR in the test's own device (#21965).
  • The new tests are outside the regex above, so I ran them separately (-R storage_pending, 3 runs): agc_storage_pending_unmapped, agc_storage_pending_partly_unmapped, agc_storage_pending_unit_part_unmapped pass 3/3 and actually run here (host imports are available on MoltenVK; e.g. results pending over memory the guest unmapped and mapped again: kept pending during the unmap, dropped at the store; results drawn after it was mapped again stored). Existing agc_storage_pending_after_unwatch and agc_storage_pending_key_refresh pass 3/3. Only VUID- is the sType-unique one above.
  • I did not run the new tests without the fix, and this does not address the open review requests.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5934699282 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22018#pullrequestreview-5934699282). Originally posted by [kurexw](https://github.com/kurexw) on 2026-11-17T07:44:49Z. **Review:** COMMENTED --- **macOS GPU test (Apple M4, MoltenVK 1.4.2, validation layer 1.4.363.1, x86-64 build under Rosetta)** Base: `upstream/main` a72186d3cf + #22056 + #22074 (both needed for the macOS build); PR head `91684d451c` merged on top. Built clean (only the known libcurl link failure, #17425). Env per AGENTS.md: `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer`, `ctest -R 'recorder|constant_phi|masked_select|sample_bit_descriptor|pixel_ancillary|scalar_buffer|shader_mode_registers|agc_driver_f64|command_batch|awaited_slot|agc_driver_idle|detiler' -V`, 3 runs each on base and PR. - Every test has the same status on base and PR in all 3 runs; no new `VUID-` errors. - Every test that creates a Vulkan instance logs `Insert instance layer "VK_LAYER_KHRONOS_validation"`; none logs `was not found but was requested`. The tests without layer lines (`agc_constant_phi`, `agc_masked_select`, `agc_command_batch_*`, `pixel_ancillary`, ...) never touch the loader. - Same on base and PR: 11 `agc_driver_f64_*` tests skip (the M4 has no `shaderFloat64`); `agc_driver_recorder` fails with `a kept vertex window was not mirrored` (#20831); the recorder tests each log one `VUID-VkDeviceCreateInfo-sType-unique` for a duplicated `VkPhysicalDevicePortabilitySubsetFeaturesKHR` in the test's own device (#21965). - The new tests are outside the regex above, so I ran them separately (`-R storage_pending`, 3 runs): `agc_storage_pending_unmapped`, `agc_storage_pending_partly_unmapped`, `agc_storage_pending_unit_part_unmapped` pass 3/3 and actually run here (host imports are available on MoltenVK; e.g. `results pending over memory the guest unmapped and mapped again: kept pending during the unmap, dropped at the store; results drawn after it was mapped again stored`). Existing `agc_storage_pending_after_unwatch` and `agc_storage_pending_key_refresh` pass 3/3. Only `VUID-` is the sType-unique one above. - I did not run the new tests without the fix, and this does not address the open review requests. AI-assisted: yes
MarcZX10 commented 2026-11-17 21:43:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-17T21:43:56Z.

Review: COMMENTED


Reviewed — no blocking findings

Nothing blocks this; the points below are optional.

What I ran

  • Head: 8b4c23b3deb60fc8c7e2c43df1becc99822d2c88, base main.
  • Read description.md, commits.md, manifest.json and diff.patch from the review folder, then the house-rule sections of the ruling file.
  • Repository context at head, through the reader:
python3 repo_read.py search "pending.mutex" core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp 5520 5575
python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp 7500 7560
python3 repo_read.py search "cancelStoredSave" core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp 5655 5670
python3 repo_read.py search "](../" docs/dev/debt/changes
  • No build and no test run in this review.

Results

Check Result Note
Diff read passed every hunk in diff.patch
Texture.cpp full text not run too large for the review folder
Recorder.cpp full text not run too large for the review folder
Lock use at head passed withoutUnmapped and NoteUnmapped take only pending.mutex
Build and tests not run none in this review

Findings

Blocking

None.

Non-blocking

  • core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp:6415 — the early return in NoteUnmapped only applies when no image is being flushed. While a flush is in progress, every unmap walks all pending textures under the lock. This is correct, but it costs time on the unmap path only when a flush overlaps an unmap.

Sources

Not verified

  • Texture.cpp and Recorder.cpp were read only as diff hunks and the head ranges listed above, not in full.
  • Whether every store of a pending layer goes through writeBackLayers, where withoutUnmapped runs. Other store paths were not checked.
  • Lock order between pending.mutex (taken by NoteUnmapped from the unmap observer) and the GuestAllocations lock. No reverse order was found in the code read, but it was not proven.
  • Re-entrancy of the static initializer in StorageTexture::Create, which calls UpdateResidentImageUnmapObserver_nid_no_patch and its static mutex.
  • Effect of layerOriginal = false on units dropped by withoutUnmapped when the range is later read.
  • The three new recorder tests and the console runs in the description are author-reported. I did not run them.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5947109000 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22018#pullrequestreview-5947109000). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-17T21:43:56Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing blocks this; the points below are optional. **What I ran** - Head: `8b4c23b3deb60fc8c7e2c43df1becc99822d2c88`, base `main`. - Read `description.md`, `commits.md`, `manifest.json` and `diff.patch` from the review folder, then the house-rule sections of the ruling file. - Repository context at head, through the reader: ``` python3 repo_read.py search "pending.mutex" core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp 5520 5575 python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp 7500 7560 python3 repo_read.py search "cancelStoredSave" core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp 5655 5670 python3 repo_read.py search "](../" docs/dev/debt/changes ``` - No build and no test run in this review. **Results** | Check | Result | Note | |---|---|---| | Diff read | passed | every hunk in `diff.patch` | | Texture.cpp full text | not run | too large for the review folder | | Recorder.cpp full text | not run | too large for the review folder | | Lock use at head | passed | `withoutUnmapped` and `NoteUnmapped` take only `pending.mutex` | | Build and tests | not run | none in this review | **Findings** **Blocking** None. **Non-blocking** - `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp:6415` — the early return in `NoteUnmapped` only applies when no image is being flushed. While a flush is in progress, every unmap walks all pending textures under the lock. This is correct, but it costs time on the unmap path only when a flush overlaps an unmap. **Sources** - Unmapped-unit drop at the store: https://github.com/boykopovar/AnyPS5/blob/8b4c23b3deb60fc8c7e2c43df1becc99822d2c88/core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp#L7476-L7498 **Not verified** - Texture.cpp and Recorder.cpp were read only as diff hunks and the head ranges listed above, not in full. - Whether every store of a pending layer goes through `writeBackLayers`, where `withoutUnmapped` runs. Other store paths were not checked. - Lock order between `pending.mutex` (taken by `NoteUnmapped` from the unmap observer) and the GuestAllocations lock. No reverse order was found in the code read, but it was not proven. - Re-entrancy of the static initializer in `StorageTexture::Create`, which calls `UpdateResidentImageUnmapObserver_nid_no_patch` and its static mutex. - Effect of `layerOriginal = false` on units dropped by `withoutUnmapped` when the range is later read. - The three new recorder tests and the console runs in the description are author-reported. I did not run them. **To get this to a good state** Nothing is required.
MarcZX10 commented 2026-11-20 05:02:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T05:02:48Z.

Review: COMMENTED


Reviewed — comments

The change’s core paths look coherent from the inspected diff, but the two large changed source files were not read in full, so a formal approval is not justified.

What I ran

Reviewed head 4554869645c773bfc5ea652ea8acbee5c95d2a62 from the prepared bundle and inspected targeted source ranges with repo_read.py. No build or tests were run; test results in the PR description are author or contributor reported.

Results

Check Result Note
Diff and targeted source review passed No verified defect in inspected sections
Build and tests not run Reports in description were not independently run

Findings

Blocking

None verified in the inspected sections.

Non-blocking

None.

Not verified

The full contents of core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp and core/libs/prx/libSceAgcDriver/tests/Recorder.cpp were not read; only the changed ranges in Texture.cpp and the diff for Recorder.cpp were inspected. No independent build, tests, platform checks, or console behavior were verified. Other changed files read: core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp, core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp, core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake, and docs/dev/debt/changes/fix-agc-discard-storage-results-on-unmap.md.

To get this to a good state

Nothing is required. Optional: complete the review of the two large changed files and run the focused tests before seeking approval.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5987759853 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22018#pullrequestreview-5987759853). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-20T05:02:48Z. **Review:** COMMENTED --- # Reviewed — comments The change’s core paths look coherent from the inspected diff, but the two large changed source files were not read in full, so a formal approval is not justified. ## What I ran Reviewed head `4554869645c773bfc5ea652ea8acbee5c95d2a62` from the prepared bundle and inspected targeted source ranges with `repo_read.py`. No build or tests were run; test results in the PR description are author or contributor reported. ## Results | Check | Result | Note | |---|---|---| | Diff and targeted source review | passed | No verified defect in inspected sections | | Build and tests | not run | Reports in description were not independently run | ## Findings ### Blocking None verified in the inspected sections. ### Non-blocking None. ## Not verified The full contents of `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` and `core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` were not read; only the changed ranges in `Texture.cpp` and the diff for `Recorder.cpp` were inspected. No independent build, tests, platform checks, or console behavior were verified. Other changed files read: `core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp`, `core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp`, `core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake`, and `docs/dev/debt/changes/fix-agc-discard-storage-results-on-unmap.md`. ## To get this to a good state Nothing is required. Optional: complete the review of the two large changed files and run the focused tests before seeking approval.
MarcZX10 commented 2026-11-20 08:01:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T08:01:26Z.

Review: COMMENTED


Reviewed — no blocking findings

Nothing blocks this change; the inspected code supports the described whole-unit discard behavior, and no tests were run in this review.

What I ran

  • Reviewed head 3daea689c25ebdea833fb325cb99fce5a178318e using repo_read.py.
  • No commands or tests were run.

Results

Check Result Note
Change and targeted source review passed Core mark and write-back paths inspected
Tests not run Relied on test evidence reported in the PR description

Findings

Blocking

None.

Non-blocking

None.

Not verified

  • Full text of core/libs/prx/libSceAgcDriver/tests/Recorder.cpp and its new test functions was not read; its diff and test registration were reviewed.
  • Test execution and console behavior were not independently verified.
  • Changed files read: core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp, core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp, core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp, core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake, and docs/dev/debt/changes/fix-agc-discard-storage-results-on-unmap.md.
  • Excluded from full-text review by bundle rule: core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp and core/libs/prx/libSceAgcDriver/tests/Recorder.cpp (both were read through targeted ranges using repo_read.py).

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5989321242 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22018#pullrequestreview-5989321242). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-20T08:01:26Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing blocks this change; the inspected code supports the described whole-unit discard behavior, and no tests were run in this review. ## What I ran - Reviewed head `3daea689c25ebdea833fb325cb99fce5a178318e` using `repo_read.py`. - No commands or tests were run. ## Results | Check | Result | Note | |---|---|---| | Change and targeted source review | passed | Core mark and write-back paths inspected | | Tests | not run | Relied on test evidence reported in the PR description | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified - Full text of `core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` and its new test functions was not read; its diff and test registration were reviewed. - Test execution and console behavior were not independently verified. - Changed files read: `core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp`, `core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp`, `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp`, `core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake`, and `docs/dev/debt/changes/fix-agc-discard-storage-results-on-unmap.md`. - Excluded from full-text review by bundle rule: `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` and `core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` (both were read through targeted ranges using `repo_read.py`). ## To get this to a good state Nothing is required.
MarcZX10 commented 2026-11-22 07:29:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T07:29:47Z.

Review: APPROVED


Reviewed — looks good

Nothing blocks this change; the checks reported by the author support the behavior, and no blocking defect was verified in the code reviewed.

What I ran

Reviewed head a6bd7faca7e8d0a3e1307b1d2f8827e4813171e7 using the prepared diff and repo_read.py. No build or tests were run in this review.

Results

Check Result Note
Changed-code review passed Core logic and focused test additions read
Build and tests in this review not run Author and contributor results are reported separately

Findings

Blocking

None.

Non-blocking

None.

Not verified

The full contents of Texture.cpp and Recorder.cpp were excluded from the review folder due to size; targeted ranges at the pinned head were read through repo_read.py, along with the relevant diff hunks. No local test run or console behavior was verified. Author and contributor test evidence in description.md was not independently reproduced. Other repository files were not reviewed.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6011053314 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22018#pullrequestreview-6011053314). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-22T07:29:47Z. **Review:** APPROVED --- # Reviewed — looks good Nothing blocks this change; the checks reported by the author support the behavior, and no blocking defect was verified in the code reviewed. ## What I ran Reviewed head `a6bd7faca7e8d0a3e1307b1d2f8827e4813171e7` using the prepared diff and `repo_read.py`. No build or tests were run in this review. ## Results | Check | Result | Note | |---|---|---| | Changed-code review | passed | Core logic and focused test additions read | | Build and tests in this review | not run | Author and contributor results are reported separately | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified The full contents of `Texture.cpp` and `Recorder.cpp` were excluded from the review folder due to size; targeted ranges at the pinned head were read through `repo_read.py`, along with the relevant diff hunks. No local test run or console behavior was verified. Author and contributor test evidence in `description.md` was not independently reproduced. Other repository files were not reviewed. ## To get this to a good state Nothing is required.
MarcZX10 commented 2026-11-25 09:00:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T09:00:10Z.

Review: COMMENTED


Reviewed — comments

Changes are required before merge: the per-image unmapped-unit flag can become stale when a pending image is removed from the pending registry, allowing later unmap notifications to access an image outside the tracked lifetime.

What I ran

Reviewed head 42ef51b1f459287df4fc952d975b68c9b6436911 using repo_read.py to read the prepared description, commits, manifest, diff, and targeted changed source ranges. No build or tests were run.

Results

Check Result Note
Patch review passed Core logic and added tests inspected
Build and tests not run No execution performed

Findings

Blocking

None verified.

Non-blocking

  • NoteUnmapped marks each image currently listed in pending.textures or pending.flushing and sets its anyUnmapped flag (Texture.cpp:6925-6928). The new flag is cleared only when markLayersPending resets a unit or withoutUnmapped consumes one (Texture.cpp:4863-4867, Texture.cpp:8164-8169). Please confirm the image lifecycle and ensure a stale anyUnmapped state cannot cause unnecessary locking or traversal after the image leaves pending tracking.

Not verified

Texture.cpp and Recorder.cpp were excluded from the prepared full-text bundle because they were too large; only targeted ranges and the supplied diff were reviewed. files.json was unavailable; the manifest and reader listing identify the changed files and exclusions. Build, tests, hardware behavior, and the contributor-reported runs were not independently verified.

To get this to a good state

Nothing is required. Optional: document or assert how anyUnmapped is reset as pending images leave tracking.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6054535524 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22018#pullrequestreview-6054535524). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-25T09:00:10Z. **Review:** COMMENTED --- # Reviewed — comments Changes are required before merge: the per-image unmapped-unit flag can become stale when a pending image is removed from the pending registry, allowing later unmap notifications to access an image outside the tracked lifetime. ## What I ran Reviewed head `42ef51b1f459287df4fc952d975b68c9b6436911` using `repo_read.py` to read the prepared description, commits, manifest, diff, and targeted changed source ranges. No build or tests were run. ## Results | Check | Result | Note | |---|---|---| | Patch review | passed | Core logic and added tests inspected | | Build and tests | not run | No execution performed | ## Findings ### Blocking None verified. ### Non-blocking - `NoteUnmapped` marks each image currently listed in `pending.textures` or `pending.flushing` and sets its `anyUnmapped` flag (`Texture.cpp:6925-6928`). The new flag is cleared only when `markLayersPending` resets a unit or `withoutUnmapped` consumes one (`Texture.cpp:4863-4867`, `Texture.cpp:8164-8169`). Please confirm the image lifecycle and ensure a stale `anyUnmapped` state cannot cause unnecessary locking or traversal after the image leaves pending tracking. ## Not verified `Texture.cpp` and `Recorder.cpp` were excluded from the prepared full-text bundle because they were too large; only targeted ranges and the supplied diff were reviewed. `files.json` was unavailable; the manifest and reader listing identify the changed files and exclusions. Build, tests, hardware behavior, and the contributor-reported runs were not independently verified. ## To get this to a good state Nothing is required. Optional: document or assert how `anyUnmapped` is reset as pending images leave tracking.
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!22018
No description provided.