fix(agc): keep a DCC target's refresh proof while its keys are pending driver stores #10159

Merged
EagleBearerYS merged 13 commits from upstream-pr/10159 into main 2026-11-03 16:43:21 +00:00
EagleBearerYS commented 2026-10-23 11:17:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-23T11:17:26Z.


What

A color target with DCC whose keys were fast-cleared has its keys decided on the GPU by its first draw, which records an uncompressed key store.

  • What went wrong: while that store stayed pending in the batch, every key query answered from the driver's pending-store state and dropped the key proof. So the image's refresh proof couldn't be taken, and every later draw into the unchanged target ran the full storage refresh: the host import lookup, the write preparation over the target's pages with its write collection, and the alias checks. That's once per draw instead of once per change.
  • The fix: a key answer taken from the driver's own pending key state (the store memo, or the keys the pending fills leave) is now a proof tagged with the recorder's newest write note over the key range.
    • It holds while that note is unchanged, the write is still unsignaled, and the range is unstamped: the same conditions under which the pending-store answer itself stays current.
    • A new recorded write, a retired batch or any stamp ends it, and the next query reads the keys again.

Authorship: the fix is @fable-void's (fable-void/AnyPS5@77e9ac4632), carried unchanged under his authorship as 7fbe9f0b82.

  • His own test (ResidentTargetRefresh.cpp) needs fixtures main doesn't have, so this PR adds a new one.
  • The counter and the test are ours.

The commits:

  1. 7fbe9f0b82 (fable-void): the fix.
  2. 27fa6746ec: a profile-only counter on the [storage] line behind APS5_PROFILE_DRAW: refreshes proved N, N of them over pending driver key stores (cumulative). With the profile off it costs one test of a static const bool.
  3. 31023e2f7a: the test, agc_storage_pending_key_refresh (tests/Recorder.cpp, beside refreshProofTests and pendingKeyStoreTests).
    • A 256x256 kR64KBX target with fast-cleared keys gets a first draw that records the uncompressed key store, left pending.
    • Then come 16 more draws into the unchanged target in the same batch.
    • After that: a CPU write, which must end the proof, and the batch's retirement, which must end it and then let it be taken again.
  4. d87ce93a0b: the proof also records the id of the recorder that issued its write note, and only that recorder, while active, can confirm it. Every Recorder numbers its write notes from 1, so before this a proof taken on one recorder could hold on another that had an unsignaled write with the same number over the keys (@oneandonlydean found this in review). The id is Recorder::Id(), taken from a process-wide counter when the recorder is built, so a recorder built at a reused address gets a new one.
    • The test adds a second recorder whose newest note over the keys has the proof's number, activates it and requires the proof not to hold, then requires it to hold again with its own recorder active.
  5. be127b3be1: those two checks run after the first recorder's Sync, so a failing one reports its message instead of unwinding with the GPU write in flight.

Tested

  • Resident Evil Village (PPSA01556), Windows, RTX 3070 Laptop GPU, clocks not held. Static menu, 5 minutes, APS5_PROFILE_DRAW=1, on our lane F tree (12aa911767), which carries this fix with fable-void's other shared-code fixes:

    [storage] ... refreshes proved 536562, 655 of them over pending driver key stores (cumulative)
    

    Each of these would run in full on main, which drops the proof while the store is pending (this PR's commit alone was not run in the title).

  • The test (agc_storage_pending_key_refresh), against main's code (only the fix's .cpp hunks reverted) and against this PR:

    full refreshes of 16 proved
    main's code 16 0
    this PR 1 15
    • Red: "AGC graphics: 16 of 16 refreshes of the unchanged target over its pending key store ran in full, not 1".
    • Under APS5_DRAW_PIPELINE=1: 1 and 15, and every check passes, including the retire check.
  • Linux, CI's configure flags (lavapipe, on a cloud worker):

    • the test plus the DCC/storage/refresh/resident set, 46 tests, --repeat until-fail:20: 42 ran 20 times each and passed, and 4 skip on that machine as on main (agc_driver_msaa_dcc_clear_2, agc_driver_msaa_dcc_clear_8, agc_shadowed_key_stores, agc_storage_clear_hand_over);
    • CI's Linux job mirrored: 1,931 tests, with only that machine's four IPv6 failures;
    • every commit builds and passes its own tests.
  • GitHub's runners (run 39933869671, this head on main aef58d4674; the new test and agc_pending_key_stores, plus the 57 more AGC tests mapped from the changed files on Linux, and 70 on Windows):

    • Linux: red with main's implementation, where only agc_storage_pending_key_refresh fails ("16 of 16 refreshes … ran in full, not 1"): 52 pass, 1 fails, 6 skip. Green ×10 with this PR: 53 pass, 6 skip, 0 fail. The 6 that skip on both trees are agc_driver_unit_shadow, agc_driver_unit_shadow_budget, agc_pipeline_cache_file, agc_shadowed_key_stores, agc_storage_clear_hand_over and agc_unit_shadow.
    • Windows: the runner has no Vulkan device, so 69 of the 72 tests skip on both trees, the new test among them. The 3 that run (agc_partial_watch_restoration, agc_queued_write_groups, agc_recorder_device_selection) pass on both, ×10 with this PR.
    • The libc and libkernel suites pass on both.
  • Validation layer (Khronos 1.3.275, lavapipe), main and this PR over the same 46 tests: the same 87 messages in the same 23 tests (VUID-VkDeviceCreateInfo-pNext-pNext, VkImageViewCreateInfo-usage-02275, VkImageCreateInfo-samples-02258). The new test has none. No new VUID-.

  • Not tested: this commit alone in a title.

  • 40309b2447, a merge of main e05ba6feeb (run). main changed the lines in tests/Recorder.cpp next to where this PR adds pendingKeyRefreshTests; the merge keeps both, and nothing else conflicted. The agc_storage_ tests, agc_unchanged_cpu_stamps and the other recorder tests the selection pulls in pass 10 runs in a row. Linux: 67 run, 60 pass, 7 skip (agc_driver_unit_shadow, agc_driver_unit_shadow_budget, agc_import_settle_initial_dcc, agc_pipeline_cache_file, agc_shadowed_key_stores, agc_storage_clear_hand_over, agc_unit_shadow), 0 fail; agc_storage_pending_key_refresh passes, and fails in the before arm. Windows: 83 run, 3 pass, 80 skip (no Vulkan device), 0 fail. Suites: libc and libkernel pass on Linux (144 and 207) and on Windows (171 and 223). The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.

  • a0ee9b5c5f, a merge of main 7e4f6e0440 (run). main added a drawn-linear-target part to the texture profile line in Texture.cpp next to this PR's refresh-proof part; the merge keeps both, this PR's part after evicted stale and main's after it, with 24 format specifiers for 24 arguments. Nothing else conflicted. The agc_storage_ tests, agc_unchanged_cpu_stamps and the other recorder tests the selection pulls in pass 10 runs in a row. Linux: 77 run, 69 pass, 8 skip (agc_driver_linear_target_direct_write_completion, agc_driver_unit_shadow, agc_driver_unit_shadow_budget, agc_import_settle_initial_dcc, agc_pipeline_cache_file, agc_shadowed_key_stores, agc_storage_clear_hand_over, agc_unit_shadow), 0 fail; agc_storage_pending_key_refresh passes, and fails in the before arm. Windows: 93 run, 3 pass, 90 skip (no Vulkan device), 0 fail. Suites: libc and libkernel pass on Linux (144 and 208) and on Windows (171 and 224). The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.

  • be127b3be1: d87ce93a0b's recorder check and its test (run 40634626781), against this head with d87ce93a0b's DccMetadata.hpp, Recorder.hpp and DccMetadata.cpp hunks reverted (on a0ee9b5c5f):

    • Linux: red without the check: only agc_storage_pending_key_refresh fails, with "AGC graphics: the pending key proof held with another recorder active, holding the same write note over the keys" (67 run, 59 pass, 7 skip, 1 fail). With it, the test and the storage and recorder tests the selection pulls in ran 10 times with no failure: 67 run, 60 pass, 7 skip (agc_driver_unit_shadow, agc_driver_unit_shadow_budget, agc_import_settle_initial_dcc, agc_pipeline_cache_file, agc_shadowed_key_stores, agc_storage_clear_hand_over, agc_unit_shadow), 0 fail.
    • Windows: the runner has no Vulkan device, so this red/green is Linux-only. With and without the check: 83 run, 3 pass, 80 skip, 0 fail, agc_storage_pending_key_refresh among the skips.
    • Suites: libc and libkernel pass on Linux (144 and 208) and on Windows (171 and 224). The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
  • 0e12c53ead, a merge of main 0836dfdf4f (run). #12862 moved libSceAgcDriver's test registrations into tests/cmake/; the conflict in CMakeLists.txt is resolved with tools/agc_test_split.py resolve, which moves this PR's registration into tests/cmake/agc_driver_recorder_tests.cmake (+6 lines). Nothing else conflicted. Apart from the move, this PR's diff is unchanged, except that one Recorder.hpp line, Id(), drops out of it: main now has the same line from #8105. With -DBUILD_TESTING=ON, ctest -N gives 3076 tests: main's 3075 plus agc_storage_pending_key_refresh, each listed once. agc_pending_key_stores, agc_storage_pending_key_refresh, agc_unchanged_cpu_stamps pass 10 runs in a row. Linux: 3 run, 3 pass, 0 skip, 0 fail. Windows: 3 run, 0 pass, 3 skip (no Vulkan device), 0 fail. Suites: libc and libkernel pass on Linux (199 and 308) and on Windows (226 and 330). The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.

  • NVIDIA, TechLevelZero's GPU runner (report): 0e12c53ead merged onto main 0836dfdf4f, NVIDIA RTX 2000 Ada Generation, driver 595.99.02, Linux. Passed: 2,445 passed, 0 new failures (4 fail on main too, and 1 is unstable there), and no new validation IDs against main over 925 tests run on the GPU. agc_storage_pending_key_refresh ran on the GPU under the validation layer and passed; it isn't in main's baseline, so its validation wasn't compared.

  • cc62b099ac and c64a365d2c, oneandonlydean's merges of main 3c3b3cda73 and 88e804b0a7. This PR's diff over main is unchanged.

    • c64a365d2c (main 88e804b0a7): the one conflict was tests/cmake/agc_driver_recorder_tests.cmake, where this PR's agc_storage_pending_key_refresh registration sits beside main's agc_storage_pending_after_unwatch; both are kept. On GitHub's runners (run, on 4d675060ba, which has the same tree), agc_pending_key_stores, agc_storage_pending_after_unwatch, agc_storage_pending_key_refresh and agc_unchanged_cpu_stamps ran 10 times with no failure. Linux: 4 run, 4 pass, 0 skip, 0 fail. Windows: 4 run, 0 pass, 4 skip (no Vulkan device), 0 fail. Suites: libc and libkernel pass on Linux (210 and 310) and on Windows (237 and 331).
    • cc62b099ac (main 3c3b3cda73): the one conflict was tests/Recorder.cpp, where main's new repeatedNeighbourStoreTests lands next to this PR's tests; both are kept. On GitHub's runners (run, on f6d0845802, the same merge with main's function at another place in the file), the same tests with agc_repeated_neighbour_stores ran 10 times with no failure. Linux: 5 run, 5 pass, 0 skip, 0 fail. Windows: 5 run, 0 pass, 5 skip (no Vulkan device), 0 fail. Suites: libc and libkernel pass on Linux (214 and 316) and on Windows (241 and 337). The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
  • fef053fad6 and 5c9b173556, test(agc): the case skips where a GPU read marks watched imports written. TechLevelZero's AMD bot (report) ran cc62b099ac merged onto main a4eca2a on an AMD Radeon RX 6300 (RADV NAVI24, Mesa 25.2.8). agc_storage_pending_key_refresh failed, also alone, with "the proof was not taken again over the landed keys". It was the only new failure (2,669 passed, 13 failed, 12 of them on main too, 55 skipped), with no new validation IDs over 1,033 tests on the GPU.

    • Why the case can't run there: it forces a watched host import over the target's keys, and that device's host-import probe reports 4 of 4 scratch pages written after a GPU read, 4 after a GPU write and 4 after the import. So each refresh's own GPU read reads as a CPU write. The driver compares imports on such a device instead of watching them, so this isn't a product bug.
    • The change: the case probes the import first and skips (77) where a GPU read marks watched pages written. Only the test changes.
    • Why 5c9b173556 narrows fef053fad6's skip: fef053fad6 also skipped where the import alone marks watched pages written, the condition addressShadowTests in the same file uses. That skipped the case on TechLevelZero's NVIDIA bot (report, fef053fad6 merged onto main 9090972, RTX 2000 Ada, driver 595.99.02), whose probe reads "0 of 4 scratch pages written after a GPU read, 0 after a GPU write, 4 after the import; imported ranges stay watched". The case passed on that GPU at 0e12c53ead (above), so 5c9b173556 drops the import term. Otherwise that run passed: 2,699 passed, 4 failed (none new: 3 fail on main too, 1 is unstable there), 46 skipped, with no new validation IDs over 977 tests on the GPU.
    • On GitHub's runners: lavapipe's probe (0 after a GPU read, 4 after a GPU write, 0 after the import) triggers neither commit's skip, and the case still runs, with "16 draws into the unchanged target over its pending key store: 1 full refreshes, 15 proved" (run at fef053fad6, run at 5c9b173556).
    • ×10 at fef053fad6 (run): agc_storage_pending_key_refresh, agc_pending_key_stores, agc_unchanged_cpu_stamps, agc_storage_pending_after_unwatch and agc_repeated_neighbour_stores. Linux: 5 run, 5 pass, 0 skip, 0 fail. Windows: 5 run, 0 pass, 5 skip (no Vulkan device), 0 fail. Suites: libc and libkernel pass on Linux (214 and 316) and on Windows (241 and 337). The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
    • ×10 at 5c9b173556 (run), the same 5 tests with their output logged. Linux: 5 run, 5 pass, 0 skip, 0 fail, with agc_storage_pending_key_refresh passing all 10, each with lavapipe's probe line and "1 full refreshes, 15 proved". Windows: 5 run, 0 pass, 5 skip (no Vulkan device), 0 fail. Suites: libc and libkernel pass on Linux (214 and 316) and on Windows (241 and 337). The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
    • TechLevelZero's AMD bot at fef053fad6 (report), merged onto main 7feb37e, RX 6300: passed, 2,723 passed, 9 failed (none new: 8 fail on main too, 1 is unstable there), 59 skipped, with no new validation IDs over 935 tests on the GPU. agc_storage_pending_key_refresh skips there, as intended. A GPU read marks 4 of 4 watched pages written on that GPU, so 5c9b173556's narrower skip covers it too.

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 (none added)
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none (a per-draw cost; PPSA01556 measured)
  • GPUs tested: NVIDIA GeForce RTX 3070 Laptop GPU (Windows, the title run); NVIDIA RTX 2000 Ada Generation (Linux, TechLevelZero's GPU runner); AMD Radeon RX 6300, RADV (Linux, TechLevelZero's AMD GPU test); Mesa llvmpipe (Linux, tests)
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4981907551 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10159). Originally posted by [EagleBearerYS](https://github.com/EagleBearerYS) on 2026-10-23T11:17:26Z. --- ### What A color target with DCC whose keys were fast-cleared has its keys decided on the GPU by its first draw, which records an uncompressed key store. - **What went wrong:** while that store stayed pending in the batch, every key query answered from the driver's pending-store state and dropped the key proof. So the image's refresh proof couldn't be taken, and every later draw into the unchanged target ran the full storage refresh: the host import lookup, the write preparation over the target's pages with its write collection, and the alias checks. That's once per draw instead of once per change. - **The fix:** a key answer taken from the driver's own pending key state (the store memo, or the keys the pending fills leave) is now a proof tagged with the recorder's newest write note over the key range. - It holds while that note is unchanged, the write is still unsignaled, and the range is unstamped: the same conditions under which the pending-store answer itself stays current. - A new recorded write, a retired batch or any stamp ends it, and the next query reads the keys again. **Authorship:** the fix is @fable-void's (fable-void/AnyPS5@77e9ac4632), carried unchanged under his authorship as 7fbe9f0b82. - His own test (`ResidentTargetRefresh.cpp`) needs fixtures `main` doesn't have, so this PR adds a new one. - The counter and the test are ours. **The commits:** 1. **7fbe9f0b82** (fable-void): the fix. 2. **27fa6746ec:** a profile-only counter on the `[storage]` line behind `APS5_PROFILE_DRAW`: `refreshes proved N, N of them over pending driver key stores (cumulative)`. With the profile off it costs one test of a `static const bool`. 3. **31023e2f7a:** the test, `agc_storage_pending_key_refresh` (`tests/Recorder.cpp`, beside `refreshProofTests` and `pendingKeyStoreTests`). - A 256x256 `kR64KBX` target with fast-cleared keys gets a first draw that records the uncompressed key store, left pending. - Then come 16 more draws into the unchanged target in the same batch. - After that: a CPU write, which must end the proof, and the batch's retirement, which must end it and then let it be taken again. 4. **d87ce93a0b:** the proof also records the id of the recorder that issued its write note, and only that recorder, while active, can confirm it. Every `Recorder` numbers its write notes from 1, so before this a proof taken on one recorder could hold on another that had an unsignaled write with the same number over the keys (@oneandonlydean found this in review). The id is `Recorder::Id()`, taken from a process-wide counter when the recorder is built, so a recorder built at a reused address gets a new one. - The test adds a second recorder whose newest note over the keys has the proof's number, activates it and requires the proof not to hold, then requires it to hold again with its own recorder active. 5. **be127b3be1:** those two checks run after the first recorder's `Sync`, so a failing one reports its message instead of unwinding with the GPU write in flight. ### Tested - **Resident Evil Village (PPSA01556),** Windows, RTX 3070 Laptop GPU, clocks not held. Static menu, 5 minutes, `APS5_PROFILE_DRAW=1`, on our lane F tree (12aa911767), which carries this fix with fable-void's other shared-code fixes: ``` [storage] ... refreshes proved 536562, 655 of them over pending driver key stores (cumulative) ``` Each of these would run in full on `main`, which drops the proof while the store is pending (this PR's commit alone was not run in the title). - **The test** (`agc_storage_pending_key_refresh`), against `main`'s code (only the fix's `.cpp` hunks reverted) and against this PR: | | full refreshes of 16 | proved | |---|---|---| | `main`'s code | 16 | 0 | | this PR | 1 | 15 | - **Red:** "AGC graphics: 16 of 16 refreshes of the unchanged target over its pending key store ran in full, not 1". - **Under `APS5_DRAW_PIPELINE=1`:** 1 and 15, and every check passes, including the retire check. - **Linux, CI's configure flags (lavapipe, on a cloud worker):** - the test plus the DCC/storage/refresh/resident set, 46 tests, `--repeat until-fail:20`: 42 ran 20 times each and passed, and 4 skip on that machine as on `main` (`agc_driver_msaa_dcc_clear_2`, `agc_driver_msaa_dcc_clear_8`, `agc_shadowed_key_stores`, `agc_storage_clear_hand_over`); - CI's Linux job mirrored: 1,931 tests, with only that machine's four IPv6 failures; - every commit builds and passes its own tests. - **GitHub's runners** ([run 39933869671](https://github.com/EagleBearerYS/AnyPS5/actions/runs/39933869671), this head on `main` aef58d4674; the new test and `agc_pending_key_stores`, plus the 57 more AGC tests mapped from the changed files on Linux, and 70 on Windows): - **Linux:** red with `main`'s implementation, where only `agc_storage_pending_key_refresh` fails ("16 of 16 refreshes … ran in full, not 1"): 52 pass, 1 fails, 6 skip. Green ×10 with this PR: 53 pass, 6 skip, 0 fail. The 6 that skip on both trees are `agc_driver_unit_shadow`, `agc_driver_unit_shadow_budget`, `agc_pipeline_cache_file`, `agc_shadowed_key_stores`, `agc_storage_clear_hand_over` and `agc_unit_shadow`. - **Windows:** the runner has no Vulkan device, so 69 of the 72 tests skip on both trees, the new test among them. The 3 that run (`agc_partial_watch_restoration`, `agc_queued_write_groups`, `agc_recorder_device_selection`) pass on both, ×10 with this PR. - The libc and libkernel suites pass on both. - **Validation layer** (Khronos 1.3.275, lavapipe), `main` and this PR over the same 46 tests: the same 87 messages in the same 23 tests (`VUID-VkDeviceCreateInfo-pNext-pNext`, `VkImageViewCreateInfo-usage-02275`, `VkImageCreateInfo-samples-02258`). The new test has none. No new `VUID-`. - **Not tested:** this commit alone in a title. - **40309b2447, a merge of `main` e05ba6feeb** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40200124882)). `main` changed the lines in `tests/Recorder.cpp` next to where this PR adds `pendingKeyRefreshTests`; the merge keeps both, and nothing else conflicted. The `agc_storage_` tests, `agc_unchanged_cpu_stamps` and the other recorder tests the selection pulls in pass 10 runs in a row. Linux: 67 run, 60 pass, 7 skip (`agc_driver_unit_shadow`, `agc_driver_unit_shadow_budget`, `agc_import_settle_initial_dcc`, `agc_pipeline_cache_file`, `agc_shadowed_key_stores`, `agc_storage_clear_hand_over`, `agc_unit_shadow`), 0 fail; `agc_storage_pending_key_refresh` passes, and fails in the before arm. Windows: 83 run, 3 pass, 80 skip (no Vulkan device), 0 fail. Suites: libc and libkernel pass on Linux (144 and 207) and on Windows (171 and 223). The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **a0ee9b5c5f, a merge of `main` 7e4f6e0440** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40216053498)). `main` added a drawn-linear-target part to the texture profile line in `Texture.cpp` next to this PR's refresh-proof part; the merge keeps both, this PR's part after `evicted stale` and `main`'s after it, with 24 format specifiers for 24 arguments. Nothing else conflicted. The `agc_storage_` tests, `agc_unchanged_cpu_stamps` and the other recorder tests the selection pulls in pass 10 runs in a row. Linux: 77 run, 69 pass, 8 skip (`agc_driver_linear_target_direct_write_completion`, `agc_driver_unit_shadow`, `agc_driver_unit_shadow_budget`, `agc_import_settle_initial_dcc`, `agc_pipeline_cache_file`, `agc_shadowed_key_stores`, `agc_storage_clear_hand_over`, `agc_unit_shadow`), 0 fail; `agc_storage_pending_key_refresh` passes, and fails in the before arm. Windows: 93 run, 3 pass, 90 skip (no Vulkan device), 0 fail. Suites: libc and libkernel pass on Linux (144 and 208) and on Windows (171 and 224). The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **be127b3be1: d87ce93a0b's recorder check and its test** ([run 40634626781](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40634626781)), against this head with d87ce93a0b's `DccMetadata.hpp`, `Recorder.hpp` and `DccMetadata.cpp` hunks reverted (on a0ee9b5c5f): - **Linux:** red without the check: only `agc_storage_pending_key_refresh` fails, with "AGC graphics: the pending key proof held with another recorder active, holding the same write note over the keys" (67 run, 59 pass, 7 skip, 1 fail). With it, the test and the storage and recorder tests the selection pulls in ran 10 times with no failure: 67 run, 60 pass, 7 skip (`agc_driver_unit_shadow`, `agc_driver_unit_shadow_budget`, `agc_import_settle_initial_dcc`, `agc_pipeline_cache_file`, `agc_shadowed_key_stores`, `agc_storage_clear_hand_over`, `agc_unit_shadow`), 0 fail. - **Windows:** the runner has no Vulkan device, so this red/green is Linux-only. With and without the check: 83 run, 3 pass, 80 skip, 0 fail, `agc_storage_pending_key_refresh` among the skips. - Suites: libc and libkernel pass on Linux (144 and 208) and on Windows (171 and 224). The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **0e12c53ead, a merge of `main` 0836dfdf4f** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41239506085)). #12862 moved `libSceAgcDriver`'s test registrations into `tests/cmake/`; the conflict in `CMakeLists.txt` is resolved with `tools/agc_test_split.py resolve`, which moves this PR's registration into `tests/cmake/agc_driver_recorder_tests.cmake` (+6 lines). Nothing else conflicted. Apart from the move, this PR's diff is unchanged, except that one `Recorder.hpp` line, `Id()`, drops out of it: `main` now has the same line from #8105. With `-DBUILD_TESTING=ON`, `ctest -N` gives 3076 tests: `main`'s 3075 plus `agc_storage_pending_key_refresh`, each listed once. `agc_pending_key_stores`, `agc_storage_pending_key_refresh`, `agc_unchanged_cpu_stamps` pass 10 runs in a row. Linux: 3 run, 3 pass, 0 skip, 0 fail. Windows: 3 run, 0 pass, 3 skip (no Vulkan device), 0 fail. Suites: libc and libkernel pass on Linux (199 and 308) and on Windows (226 and 330). The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **NVIDIA, TechLevelZero's GPU runner** ([report](https://github.com/boykopovar/AnyPS5/pull/10159#issuecomment-6549742855)): 0e12c53ead merged onto `main` 0836dfdf4f, NVIDIA RTX 2000 Ada Generation, driver 595.99.02, Linux. Passed: 2,445 passed, 0 new failures (4 fail on `main` too, and 1 is unstable there), and no new validation IDs against `main` over 925 tests run on the GPU. `agc_storage_pending_key_refresh` ran on the GPU under the validation layer and passed; it isn't in `main`'s baseline, so its validation wasn't compared. - **cc62b099ac and c64a365d2c, oneandonlydean's merges of `main` 3c3b3cda73 and 88e804b0a7.** This PR's diff over `main` is unchanged. - **c64a365d2c** (`main` 88e804b0a7): the one conflict was `tests/cmake/agc_driver_recorder_tests.cmake`, where this PR's `agc_storage_pending_key_refresh` registration sits beside `main`'s `agc_storage_pending_after_unwatch`; both are kept. On GitHub's runners ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41416698322), on 4d675060ba, which has the same tree), `agc_pending_key_stores`, `agc_storage_pending_after_unwatch`, `agc_storage_pending_key_refresh` and `agc_unchanged_cpu_stamps` ran 10 times with no failure. Linux: 4 run, 4 pass, 0 skip, 0 fail. Windows: 4 run, 0 pass, 4 skip (no Vulkan device), 0 fail. Suites: libc and libkernel pass on Linux (210 and 310) and on Windows (237 and 331). - **cc62b099ac** (`main` 3c3b3cda73): the one conflict was `tests/Recorder.cpp`, where `main`'s new `repeatedNeighbourStoreTests` lands next to this PR's tests; both are kept. On GitHub's runners ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41434044965), on f6d0845802, the same merge with `main`'s function at another place in the file), the same tests with `agc_repeated_neighbour_stores` ran 10 times with no failure. Linux: 5 run, 5 pass, 0 skip, 0 fail. Windows: 5 run, 0 pass, 5 skip (no Vulkan device), 0 fail. Suites: libc and libkernel pass on Linux (214 and 316) and on Windows (241 and 337). The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **fef053fad6 and 5c9b173556, `test(agc)`: the case skips where a GPU read marks watched imports written.** TechLevelZero's AMD bot ([report](https://github.com/boykopovar/AnyPS5/pull/10159#issuecomment-6593317738)) ran cc62b099ac merged onto `main` a4eca2a on an AMD Radeon RX 6300 (RADV NAVI24, Mesa 25.2.8). `agc_storage_pending_key_refresh` failed, also alone, with "the proof was not taken again over the landed keys". It was the only new failure (2,669 passed, 13 failed, 12 of them on `main` too, 55 skipped), with no new validation IDs over 1,033 tests on the GPU. - **Why the case can't run there:** it forces a watched host import over the target's keys, and that device's host-import probe reports 4 of 4 scratch pages written after a GPU read, 4 after a GPU write and 4 after the import. So each refresh's own GPU read reads as a CPU write. The driver compares imports on such a device instead of watching them, so this isn't a product bug. - **The change:** the case probes the import first and skips (77) where a GPU read marks watched pages written. Only the test changes. - **Why 5c9b173556 narrows fef053fad6's skip:** fef053fad6 also skipped where the import alone marks watched pages written, the condition `addressShadowTests` in the same file uses. That skipped the case on TechLevelZero's NVIDIA bot ([report](https://github.com/boykopovar/AnyPS5/pull/10159#issuecomment-6595180560), fef053fad6 merged onto `main` 9090972, RTX 2000 Ada, driver 595.99.02), whose probe reads "0 of 4 scratch pages written after a GPU read, 0 after a GPU write, 4 after the import; imported ranges stay watched". The case passed on that GPU at 0e12c53ead (above), so 5c9b173556 drops the import term. Otherwise that run passed: 2,699 passed, 4 failed (none new: 3 fail on `main` too, 1 is unstable there), 46 skipped, with no new validation IDs over 977 tests on the GPU. - **On GitHub's runners:** lavapipe's probe (0 after a GPU read, 4 after a GPU write, 0 after the import) triggers neither commit's skip, and the case still runs, with "16 draws into the unchanged target over its pending key store: 1 full refreshes, 15 proved" ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41565117276) at fef053fad6, [run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41576594072) at 5c9b173556). - **×10 at fef053fad6** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41563143752)): `agc_storage_pending_key_refresh`, `agc_pending_key_stores`, `agc_unchanged_cpu_stamps`, `agc_storage_pending_after_unwatch` and `agc_repeated_neighbour_stores`. Linux: 5 run, 5 pass, 0 skip, 0 fail. Windows: 5 run, 0 pass, 5 skip (no Vulkan device), 0 fail. Suites: libc and libkernel pass on Linux (214 and 316) and on Windows (241 and 337). The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **×10 at 5c9b173556** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41576594072)), the same 5 tests with their output logged. Linux: 5 run, 5 pass, 0 skip, 0 fail, with `agc_storage_pending_key_refresh` passing all 10, each with lavapipe's probe line and "1 full refreshes, 15 proved". Windows: 5 run, 0 pass, 5 skip (no Vulkan device), 0 fail. Suites: libc and libkernel pass on Linux (214 and 316) and on Windows (241 and 337). The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **TechLevelZero's AMD bot at fef053fad6** ([report](https://github.com/boykopovar/AnyPS5/pull/10159#issuecomment-6595616595)), merged onto `main` 7feb37e, RX 6300: passed, 2,723 passed, 9 failed (none new: 8 fail on `main` too, 1 is unstable there), 59 skipped, with no new validation IDs over 935 tests on the GPU. `agc_storage_pending_key_refresh` skips there, as intended. A GPU read marks 4 of 4 watched pages written on that GPU, so 5c9b173556's narrower skip covers it too. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source (none added) - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none (a per-draw cost; PPSA01556 measured) - [x] GPUs tested: NVIDIA GeForce RTX 3070 Laptop GPU (Windows, the title run); NVIDIA RTX 2000 Ada Generation (Linux, TechLevelZero's GPU runner); AMD Radeon RX 6300, RADV (Linux, TechLevelZero's AMD GPU test); Mesa llvmpipe (Linux, tests) - [x] AI-assisted: yes
MarcZX10 commented 2026-10-23 11:24:01 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-23T11:24:01Z.

Review: CHANGES_REQUESTED


The implementation and the reported pending-key regression test are promising, but this branch needs a current-main refresh before I can approve it. Its merge base is aef58d4674, 131 commits behind today’s main; those intervening commits modify the same AGC area, including DccMetadata.cpp, Texture.cpp, Recorder.cpp and the AGC test registrations. The merge preview is clean, but the test evidence in the description is qualified against that older base, so it does not establish behavior with the current recorder/storage changes. Please rebase onto current main, resolve any semantic interactions, and rerun the pending-key test and the focused DCC/storage set on both main and the refreshed PR with the validation-layer comparison required for AGC changes. I attempted the focused local build, but configuration is blocked here because the SDL2 submodule has no CMakeLists and this host lacks the XRandR development support required by the project. The manual full-build workflow dispatch was also rejected by GitHub with HTTP 403 (repository admin rights required); I am not counting either as a test run. Exact-head git diff --check and the current conventions check pass.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5627548281 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10159#pullrequestreview-5627548281). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-23T11:24:01Z. **Review:** CHANGES_REQUESTED --- The implementation and the reported pending-key regression test are promising, but this branch needs a current-main refresh before I can approve it. Its merge base is `aef58d4674`, 131 commits behind today’s `main`; those intervening commits modify the same AGC area, including `DccMetadata.cpp`, `Texture.cpp`, `Recorder.cpp` and the AGC test registrations. The merge preview is clean, but the test evidence in the description is qualified against that older base, so it does not establish behavior with the current recorder/storage changes. Please rebase onto current `main`, resolve any semantic interactions, and rerun the pending-key test and the focused DCC/storage set on both main and the refreshed PR with the validation-layer comparison required for AGC changes. I attempted the focused local build, but configuration is blocked here because the SDL2 submodule has no CMakeLists and this host lacks the XRandR development support required by the project. The manual full-build workflow dispatch was also rejected by GitHub with HTTP 403 (repository admin rights required); I am not counting either as a test run. Exact-head `git diff --check` and the current conventions check pass.
MarcZX10 commented 2026-10-31 18:17:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-31T18:17:48Z.

Review: APPROVED


Re-checked — new head, looks good

The pending-key proof now identifies the recorder that issued its write note, and the new cross-recorder regression test rejects a matching note from another recorder.

What I ran

Reviewed exact PR head be127b3be14745b51461ebbe33a32c4534791429; the PR base field is 7e4f6e0440b3b39206f0a6e21b1d177f6975d930. The no-build stack check previewed this head cleanly against current main ca073ec3ad0d766ea9f4658e418a5c977001a353. The author’s focused verification run was on merge 67785fe378 with main 474030e584; current main has 12 later commits, none touching AGC paths. Environment for local checks: Linux x86-64, Python 3.11.2, Git 2.39.5. I did not build or run tests locally.

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 10159 --output-dir /tmp/anyps5-10159-recheck
gh pr checks 10159 -R boykopovar/AnyPS5
gh api repos/boykopovar/AnyPS5/compare/474030e58424fefdb65e5df9f3820810fbb4553c...ca073ec3ad0d766ea9f4658e418a5c977001a353 --jq '[.files[].filename]'
gh api repos/boykopovar/AnyPS5/contents/core/libs/prx/libSceAgcDriver/Graphics/src/DccMetadata.cpp?ref=be127b3be14745b51461ebbe33a32c4534791429
gh api repos/boykopovar/AnyPS5/contents/core/libs/prx/libSceAgcDriver/tests/Recorder.cpp?ref=be127b3be14745b51461ebbe33a32c4534791429

Results

Check Result
Diff check Passed.
Conventions and PR template Passed locally and in hosted CI.
Merge preview against current main Clean.
Hosted Windows workflow on PR head Passed.
Linux and specialized hosted jobs Skipped.
Author-reported focused tests on verification merge Repeated 10 times: Linux 70 passed / 8 skipped / 0 failed; Windows 4 passed / 90 skipped / 0 failed. Reported libc and libkernel suites also passed.
Author-reported Vulkan validation on verification merge No VUID- lines; validation layer was inserted and not reported missing.
ABI and test-quality helper scripts Not available in the isolated PR snapshot; these checks were not run.
Local build or tests Not run.

The author’s Linux/Windows repetitions and validation run are evidence from the linked verification workflows, not tests I ran. The verification merge used main 474030e584; the 12 commits since then do not change AGC files, and the current-head merge preview is clean.

Findings

Blocking

None found in the re-reviewed changes.

Non-blocking

The PR’s GitHub base SHA still reports 7e4f6e0440b3b39206f0a6e21b1d177f6975d930; the current-main merge preview is clean, and the author supplied focused verification against a merge with 474030e584. Linux and specialized jobs for the PR’s own hosted workflow remain skipped.

Sources

Not verified

I did not reproduce the author’s focused tests, run a local build, test on a physical console, or run Linux/specialized checks independently.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5724244538 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10159#pullrequestreview-5724244538). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-31T18:17:48Z. **Review:** APPROVED --- # Re-checked — new head, looks good The pending-key proof now identifies the recorder that issued its write note, and the new cross-recorder regression test rejects a matching note from another recorder. ## What I ran Reviewed exact PR head `be127b3be14745b51461ebbe33a32c4534791429`; the PR base field is `7e4f6e0440b3b39206f0a6e21b1d177f6975d930`. The no-build stack check previewed this head cleanly against current `main` `ca073ec3ad0d766ea9f4658e418a5c977001a353`. The author’s focused verification run was on merge `67785fe378` with `main` `474030e584`; current `main` has 12 later commits, none touching AGC paths. Environment for local checks: Linux x86-64, Python 3.11.2, Git 2.39.5. I did not build or run tests locally. ```sh python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 10159 --output-dir /tmp/anyps5-10159-recheck gh pr checks 10159 -R boykopovar/AnyPS5 gh api repos/boykopovar/AnyPS5/compare/474030e58424fefdb65e5df9f3820810fbb4553c...ca073ec3ad0d766ea9f4658e418a5c977001a353 --jq '[.files[].filename]' gh api repos/boykopovar/AnyPS5/contents/core/libs/prx/libSceAgcDriver/Graphics/src/DccMetadata.cpp?ref=be127b3be14745b51461ebbe33a32c4534791429 gh api repos/boykopovar/AnyPS5/contents/core/libs/prx/libSceAgcDriver/tests/Recorder.cpp?ref=be127b3be14745b51461ebbe33a32c4534791429 ``` ## Results | Check | Result | |---|---| | Diff check | Passed. | | Conventions and PR template | Passed locally and in hosted CI. | | Merge preview against current `main` | Clean. | | Hosted Windows workflow on PR head | Passed. | | Linux and specialized hosted jobs | Skipped. | | Author-reported focused tests on verification merge | Repeated 10 times: Linux 70 passed / 8 skipped / 0 failed; Windows 4 passed / 90 skipped / 0 failed. Reported libc and libkernel suites also passed. | | Author-reported Vulkan validation on verification merge | No `VUID-` lines; validation layer was inserted and not reported missing. | | ABI and test-quality helper scripts | Not available in the isolated PR snapshot; these checks were not run. | | Local build or tests | Not run. | The author’s Linux/Windows repetitions and validation run are evidence from the linked verification workflows, not tests I ran. The verification merge used `main` `474030e584`; the 12 commits since then do not change AGC files, and the current-head merge preview is clean. ## Findings ### Blocking None found in the re-reviewed changes. ### Non-blocking The PR’s GitHub base SHA still reports `7e4f6e0440b3b39206f0a6e21b1d177f6975d930`; the current-main merge preview is clean, and the author supplied focused verification against a merge with `474030e584`. Linux and specialized jobs for the PR’s own hosted workflow remain skipped. ## Sources - [Pending proof records the issuing recorder ID and validates it on reuse](https://github.com/boykopovar/AnyPS5/blob/be127b3be14745b51461ebbe33a32c4534791429/core/libs/prx/libSceAgcDriver/Graphics/src/DccMetadata.cpp#L747-L768) - [Recorder identity is assigned at construction](https://github.com/boykopovar/AnyPS5/blob/be127b3be14745b51461ebbe33a32c4534791429/core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp#L1142-L1147) - [Cross-recorder test collides write-note numbers, rejects the other recorder, then accepts the owner](https://github.com/boykopovar/AnyPS5/blob/be127b3be14745b51461ebbe33a32c4534791429/core/libs/prx/libSceAgcDriver/tests/Recorder.cpp#L7339-L7362) - [Author’s repeated focused and Vulkan validation runs](https://github.com/boykopovar/AnyPS5/pull/10159#issuecomment-6547286068) - [Exact-head hosted check summary](https://github.com/boykopovar/AnyPS5/actions/runs/40640694949) ## Not verified I did not reproduce the author’s focused tests, run a local build, test on a physical console, or run Linux/specialized checks independently.
XairRrR commented 2026-11-03 14:44:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T14:44:26Z.

Review: APPROVED


Reviewed — approved

The pending-key refresh proof merges cleanly and builds, and its new test passes. The test goes red when the DccMetadata.cpp part of the fix is reverted, and no new failures or validation IDs show up on lavapipe.

What I ran

Head 5c9b17355684a2e5e9a787c5eb60cc98af67606e, main 4f41f4c375f5abb487dbd184fbc150f31994d762, merged tree 030b9531e55105c3a0fa84ca8dbccf835afbb0d5. Debian 13 VM, GCC 14.2.0, Release, lavapipe (Mesa 26.1.6, LLVM 19), no GPU.

git diff --check 4f41f4c375f5abb487dbd184fbc150f31994d762...5c9b17355684a2e5e9a787c5eb60cc98af67606e
python3 tools/check_conventions.py --base 4f41f4c375f5abb487dbd184fbc150f31994d762
ctest --test-dir build -R "agc_storage_pending_key_refresh|agc_pending_key_stores|agc_unchanged_cpu_stamps|agc_storage_pending_after_unwatch|agc_repeated_neighbour_stores" --output-on-failure -j8 --test-load 32
ctest --test-dir build -V -R "^agc_storage_pending_key_refresh$"
# negative control 1: Texture.cpp restored from main
git show 4f41f4c375:core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp > core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
ninja -C build -j32 -l32 agc_driver_recorder_tests
ctest --test-dir build -V -R "^agc_storage_pending_key_refresh$"
# negative control 2: DccMetadata.cpp also restored from main, plus two link stubs (below)
ninja -C build -j32 -l32 agc_driver_recorder_tests
ctest --test-dir build -V -R "^agc_storage_pending_key_refresh$"
# restore the merged files
git show 030b9531e5:<path> > <path>   # both files
git status --porcelain
ninja -C build -j32 -l32 agc_driver_recorder_tests
ctest --test-dir build -R "^agc_storage_pending_key_refresh$" --repeat until-fail:10

Results

Check Result
git diff --check clean
check_conventions.py All conventions checks passed
Configure, build, libs (script) ok
Selected tests (script): 2214 ran 2093 passed, 114 expected skips, 0 new failures, 0 timeouts; 7 known failures that also fail on main
Validation layer (script): 770 tests, layer loaded in 769, none missing 0 tests with a new VUID-
Focused set (5 tests) 5/5 passed
agc_storage_pending_key_refresh passed (it ran, not skipped), 0.11 s; ×10 with no failure
Worktree after restore git status --porcelain is empty
agc_storage_pending_key_refresh on the merged tree
host imports are compared
16 draws into the unchanged target over its pending key store: 1 full refreshes, 15 proved
Refreshes over a pending DCC key store passed

Negative control

The test calls PendingKeyProofHolds and reads DccKeyProof::pendingNote, so it can't be built against main's production files alone. I ran two steps:

  1. Texture.cpp restored from main: the test still passes (1 full refresh, 15 proved). See the non-blocking finding below.
  2. DccMetadata.cpp restored from main as well. The header stays as in the PR. I added two link stubs equivalent to main's behaviour: PendingKeyProof returns {}, and PendingKeyProofHolds returns proof.pendingNote == 0. The test fails:
    16 draws into the unchanged target over its pending key store: 16 full refreshes, 0 proved
    AGC graphics: 16 of 16 refreshes of the unchanged target over its pending key store ran in full, not 1
    
    This matches the description's red arm. I restored both files from the merged tree and rebuilt; the worktree is clean.

Findings

Blocking

None.

Non-blocking

  • The Texture.cpp hunks are not pinned by the new test.
    • What they do: StorageTexture::ProvedKeys at core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp:2585 takes a pending proof on the WaitForKeyWriters path. StorageTexture::refreshProved at core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp:2620 adds the PendingKeyProofHolds check.
    • What I saw: with main's Texture.cpp, agc_storage_pending_key_refresh passes every check, including "held after its batch retired" and the cross-recorder check. The case therefore goes through ProvedClearKeys (DccMetadata.cpp:732, :751) only.
    • Why it matters: the extra check in refreshProved is what keeps a stale pending proof from being reused on the refresh-proof path. A regression there would go unnoticed.
    • Suggested fix: a follow-up case where WaitForKeyWriters gives the answer (for example, pending fills that leave the keys uncompressed), with a check that the refresh proof is refused once the batch retires or another recorder is active.
  • The new code paths are conservative. PendingKeyProof and PendingKeyProofHolds (DccMetadata.cpp:757-781) refuse the proof when the GPU mutex isn't held, when no recorder is active, or when the write is signaled. The recorder-id check from d87ce93a0b resolves oneandonlydean's cross-recorder concern, and the test covers it. I found no correctness problem.

Not verified

  • No hardware GPU here: the narrowed skip (5c9b173556) on RADV and NVIDIA is not checked by me. On lavapipe the probe doesn't trigger the skip and the case runs.
  • I did not run the title measurement (PPSA01556) or the profile counter's [storage] output under APS5_PROFILE_DRAW.
  • Windows/MinGW build not checked.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5754193296 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10159#pullrequestreview-5754193296). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-03T14:44:26Z. **Review:** APPROVED --- # Reviewed — approved The pending-key refresh proof merges cleanly and builds, and its new test passes. The test goes red when the `DccMetadata.cpp` part of the fix is reverted, and no new failures or validation IDs show up on lavapipe. ## What I ran Head `5c9b17355684a2e5e9a787c5eb60cc98af67606e`, `main` `4f41f4c375f5abb487dbd184fbc150f31994d762`, merged tree `030b9531e55105c3a0fa84ca8dbccf835afbb0d5`. Debian 13 VM, GCC 14.2.0, Release, lavapipe (Mesa 26.1.6, LLVM 19), no GPU. ``` git diff --check 4f41f4c375f5abb487dbd184fbc150f31994d762...5c9b17355684a2e5e9a787c5eb60cc98af67606e python3 tools/check_conventions.py --base 4f41f4c375f5abb487dbd184fbc150f31994d762 ctest --test-dir build -R "agc_storage_pending_key_refresh|agc_pending_key_stores|agc_unchanged_cpu_stamps|agc_storage_pending_after_unwatch|agc_repeated_neighbour_stores" --output-on-failure -j8 --test-load 32 ctest --test-dir build -V -R "^agc_storage_pending_key_refresh$" # negative control 1: Texture.cpp restored from main git show 4f41f4c375:core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp > core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp ninja -C build -j32 -l32 agc_driver_recorder_tests ctest --test-dir build -V -R "^agc_storage_pending_key_refresh$" # negative control 2: DccMetadata.cpp also restored from main, plus two link stubs (below) ninja -C build -j32 -l32 agc_driver_recorder_tests ctest --test-dir build -V -R "^agc_storage_pending_key_refresh$" # restore the merged files git show 030b9531e5:<path> > <path> # both files git status --porcelain ninja -C build -j32 -l32 agc_driver_recorder_tests ctest --test-dir build -R "^agc_storage_pending_key_refresh$" --repeat until-fail:10 ``` ## Results | Check | Result | |---|---| | `git diff --check` | clean | | `check_conventions.py` | All conventions checks passed | | Configure, build, `libs` (script) | ok | | Selected tests (script): 2214 ran | 2093 passed, 114 expected skips, 0 new failures, 0 timeouts; 7 known failures that also fail on `main` | | Validation layer (script): 770 tests, layer loaded in 769, none missing | 0 tests with a new `VUID-` | | Focused set (5 tests) | 5/5 passed | | `agc_storage_pending_key_refresh` | passed (it ran, not skipped), 0.11 s; ×10 with no failure | | Worktree after restore | `git status --porcelain` is empty | <details><summary>agc_storage_pending_key_refresh on the merged tree</summary> ``` host imports are compared 16 draws into the unchanged target over its pending key store: 1 full refreshes, 15 proved Refreshes over a pending DCC key store passed ``` </details> ## Negative control The test calls `PendingKeyProofHolds` and reads `DccKeyProof::pendingNote`, so it can't be built against `main`'s production files alone. I ran two steps: 1. **`Texture.cpp` restored from `main`:** the test still **passes** (1 full refresh, 15 proved). See the non-blocking finding below. 2. **`DccMetadata.cpp` restored from `main` as well.** The header stays as in the PR. I added two link stubs equivalent to `main`'s behaviour: `PendingKeyProof` returns `{}`, and `PendingKeyProofHolds` returns `proof.pendingNote == 0`. The test **fails**: ``` 16 draws into the unchanged target over its pending key store: 16 full refreshes, 0 proved AGC graphics: 16 of 16 refreshes of the unchanged target over its pending key store ran in full, not 1 ``` This matches the description's red arm. I restored both files from the merged tree and rebuilt; the worktree is clean. ## Findings ### Blocking None. ### Non-blocking - **The `Texture.cpp` hunks are not pinned by the new test.** - **What they do:** `StorageTexture::ProvedKeys` at `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp:2585` takes a pending proof on the `WaitForKeyWriters` path. `StorageTexture::refreshProved` at `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp:2620` adds the `PendingKeyProofHolds` check. - **What I saw:** with `main`'s `Texture.cpp`, `agc_storage_pending_key_refresh` passes every check, including "held after its batch retired" and the cross-recorder check. The case therefore goes through `ProvedClearKeys` (`DccMetadata.cpp:732`, `:751`) only. - **Why it matters:** the extra check in `refreshProved` is what keeps a stale pending proof from being reused on the refresh-proof path. A regression there would go unnoticed. - **Suggested fix:** a follow-up case where `WaitForKeyWriters` gives the answer (for example, pending fills that leave the keys uncompressed), with a check that the refresh proof is refused once the batch retires or another recorder is active. - **The new code paths are conservative.** `PendingKeyProof` and `PendingKeyProofHolds` (`DccMetadata.cpp:757-781`) refuse the proof when the GPU mutex isn't held, when no recorder is active, or when the write is signaled. The recorder-id check from d87ce93a0b resolves oneandonlydean's cross-recorder concern, and the test covers it. I found no correctness problem. ## Not verified - No hardware GPU here: the narrowed skip (5c9b173556) on RADV and NVIDIA is not checked by me. On lavapipe the probe doesn't trigger the skip and the case runs. - I did not run the title measurement (PPSA01556) or the profile counter's `[storage]` output under `APS5_PROFILE_DRAW`. - Windows/MinGW build not checked. <!-- anyps5-bots job=2171 head=5c9b17355684a2e5e9a787c5eb60cc98af67606e -->
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!10159
No description provided.