fix(agc): store an occasionally written image before a label #14311

Merged
XatiX merged 2 commits from upstream-pr/14311 into main 2026-11-03 08:08:08 +00:00
XatiX commented 2026-11-01 09:17:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XatiX on 2026-11-01T09:17:36Z.


What

A title can render a tiled image by compute and read it on the CPU after a label. StoreReadbackBeforeLabel stores only linear images and those up to 64 KiB, so a larger tiled image stays on the GPU and the CPU reads the old bytes at that address.

PPSA06866 renders its save thumbnail into a 768 KiB tiled image this way. Every save stored noise as its PNG. The PNG was valid, and its pixels were BC1 blocks of a ground texture that had been at that address.

An image up to 1 MiB that was not written in the last 8 flips is now stored before the label too, and so is an image's first write. That takes one store: the label clears the flag when it chooses the image, so with no flips it cannot store the image at every label. An image written on consecutive flips stays on the GPU, because storing those at every label is the cost the 64 KiB limit avoids.

The 1 MiB and 8 flip limits come from this one case. An image above 1 MiB, a write after that one store with no gap, or an image the CPU reads while it is rewritten every few flips still reads stale bytes. The debt entry records this. Other values, or another way to tell these images apart, would be welcome.

Tested

Windows 11 Pro 10.0.26300, GCC 15.2.0 (WinLibs), NVIDIA GeForce RTX 5080 (617.42).

  • agc_driver_linear_readback_label gains a 256 KiB tiled image: a first write is stored before its label and chosen once, a second write with no flip between is not chosen, a write on the next flip is not, and a write after a gap of more than 8 flips is. The "not chosen" steps read a counter of label choices, so the idle store cannot fail them. Restoring the old behaviour fails on the second-write step. The earlier revision was also checked without the change, with every image up to 1 MiB stored, and with the gap never reached. The test advances the flip counter by hand, so the NoteFlip call in Driver::execute has no assertion.
  • With VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ANYPS5_NO_SHADER_CACHE=1 and ANYPS5_REQUIRE_VULKAN=1 using ctest -V -R 'label|readback|video_out_flip', 64 of 64 pass on main f2d874c1fd and on this change at 84946a6af6, on the same machine, with none skipped. Neither log reports a missing layer, and neither has a VUID- line. The logs are on this pull request. The main run uses main's version of the test, so it does not contain the new cases.
  • PPSA06866: plain main stops earlier, at the unsupported stencil copy, so the title cannot reach this code there. On a local branch that also carries #9717 and #13021, three saves before the last rebase have correct, different thumbnails. A probe build showed the one save it recorded writing the image once and taking one store, so these saves may all be first writes. The gap path is not shown in the title.
  • No speed claim. On that branch, Continue from the menu into play with about 45 s of play made 76 label stores with and without the store clearing the flag, at the same frame rate. That route has only a short load, so it is not a long flip-less phase.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: PPSA06866 #13726, a later stop; the title stops earlier on main
  • GPUs tested: NVIDIA GeForce RTX 5080, 617.42, Windows 11
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5105656194 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14311). Originally posted by [XatiX](https://github.com/XatiX) on 2026-11-01T09:17:36Z. --- ### What A title can render a tiled image by compute and read it on the CPU after a label. `StoreReadbackBeforeLabel` stores only linear images and those up to 64 KiB, so a larger tiled image stays on the GPU and the CPU reads the old bytes at that address. PPSA06866 renders its save thumbnail into a 768 KiB tiled image this way. Every save stored noise as its PNG. The PNG was valid, and its pixels were BC1 blocks of a ground texture that had been at that address. An image up to 1 MiB that was not written in the last 8 flips is now stored before the label too, and so is an image's first write. That takes one store: the label clears the flag when it chooses the image, so with no flips it cannot store the image at every label. An image written on consecutive flips stays on the GPU, because storing those at every label is the cost the 64 KiB limit avoids. The 1 MiB and 8 flip limits come from this one case. An image above 1 MiB, a write after that one store with no gap, or an image the CPU reads while it is rewritten every few flips still reads stale bytes. The debt entry records this. Other values, or another way to tell these images apart, would be welcome. ### Tested Windows 11 Pro 10.0.26300, GCC 15.2.0 (WinLibs), NVIDIA GeForce RTX 5080 (617.42). - `agc_driver_linear_readback_label` gains a 256 KiB tiled image: a first write is stored before its label and chosen once, a second write with no flip between is not chosen, a write on the next flip is not, and a write after a gap of more than 8 flips is. The "not chosen" steps read a counter of label choices, so the idle store cannot fail them. Restoring the old behaviour fails on the second-write step. The earlier revision was also checked without the change, with every image up to 1 MiB stored, and with the gap never reached. The test advances the flip counter by hand, so the `NoteFlip` call in `Driver::execute` has no assertion. - With `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, `ANYPS5_NO_SHADER_CACHE=1` and `ANYPS5_REQUIRE_VULKAN=1` using `ctest -V -R 'label|readback|video_out_flip'`, 64 of 64 pass on `main` `f2d874c1fd` and on this change at `84946a6af6`, on the same machine, with none skipped. Neither log reports a missing layer, and neither has a `VUID-` line. The logs are on this pull request. The `main` run uses `main`'s version of the test, so it does not contain the new cases. - PPSA06866: plain `main` stops earlier, at the unsupported stencil copy, so the title cannot reach this code there. On a local branch that also carries #9717 and #13021, three saves before the last rebase have correct, different thumbnails. A probe build showed the one save it recorded writing the image once and taking one store, so these saves may all be first writes. The gap path is not shown in the title. - No speed claim. On that branch, Continue from the menu into play with about 45 s of play made 76 label stores with and without the store clearing the flag, at the same frame rate. That route has only a short load, so it is not a long flip-less phase. ### 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/blob/main/docs/dev/TechnicalDebt.md) 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: PPSA06866 #13726, a later stop; the title stops earlier on `main` - [x] GPUs tested: NVIDIA GeForce RTX 5080, 617.42, Windows 11 - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
MarcZX10 commented 2026-11-01 09:00:57 +00:00 (Migrated from github.com)

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

Review: CHANGES_REQUESTED


Reviewed — changes requested

The exact head has a reproducible conflict with open PR #13879, and the repository-required paired AGC Vulkan validation is not evidenced; both are needed before this can be cleared.

What I ran

Reviewed head c1a81eb25b5d7f1634f12f4ba1159cfd10f66068 against PR base 5c9837bfe7c5533f2c77c968dd8193157a8c342a. GitHub reports the PR mergeable with main; the pairwise preview against #13879 used merge base 5e936063e3a74b7f03ff06905be04c5a00be60a7 and conflicted in Texture.hpp and Texture.cpp. Environment: Linux 6.1.0-54-amd64; no compiler was invoked. I did not configure, build, or run local CTest under the no-build initial-review rule.

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14311
python3 tools/pr_abi_audit.py --repo /marc/AnyPS5 --base 5c9837bfe7c5533f2c77c968dd8193157a8c342a --head c1a81eb25b5d7f1634f12f4ba1159cfd10f66068 --json
python3 tools/pr_test_quality.py --root /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14311-c1a81eb25b5d/head-c1a81eb25b5d-e8f4724c --json core/libs/prx/libSceAgcDriver/tests/execution/LinearReadbackLabel.cpp
git fetch https://github.com/boykopovar/AnyPS5.git refs/pull/14311/head:refs/review/new-pr/14311-20261101
git fetch https://github.com/boykopovar/AnyPS5.git refs/pull/13879/head:refs/review/new-pr/13879-20261101
git merge-tree --write-tree refs/review/new-pr/14311-20261101 refs/review/new-pr/13879-20261101
gh pr checks 14311 --repo boykopovar/AnyPS5
gh run view 41288250942 --repo boykopovar/AnyPS5 --job 124795776558 --log | grep -i 'readback' | tail -30

Results

Check Result
git diff --check Passed in the exact-head precheck.
Repository conventions and PR template Passed locally and in hosted CI.
Export/ABI audit Not applicable: the diff changes no recognized exports or ABI declarations.
Test-quality heuristic One possible-unregistered-test warning; false positive after checking CMake's tests/execution/*.cpp target discovery and the test fragment.
Mergeability with main GitHub reports clean.
Pairwise integration with #13879 Conflict in core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp and Graphics/src/Texture.cpp.
Hosted Windows job Passed, but both agc_driver_linear_readback_label and agc_driver_linear_readback_label_off were skipped.
Hosted Linux and specialized jobs Skipped.
Local build/CTest Not run.

The precheck's aggregate status was checks failed because its detached exact-head checkout lacks the workspace-only ABI and test-quality helper scripts. I reran those helpers from the workspace: the ABI audit found no applicable ABI changes, and the test-quality warning is explained by CMake's automatic source discovery.

Unedited outputs from the relevant checks
All conventions checks passed.

{
  "status": "not_applicable",
  "symbols": [],
  "findings": [],
  "limitations": [
    "No changed APS5_VABI declaration/definition or APS5_EXPORT alias was recognized in the PR diff."
  ]
}
{
  "findings": [
    {
      "path": "core/libs/prx/libSceAgcDriver/tests/execution/LinearReadbackLabel.cpp",
      "line": 1,
      "kind": "possible-unregistered-cpp-test",
      "message": "Changed C++ test source path was not found literally in CMake files; inspect registration, generated source lists, and workflow coverage."
    }
  ],
  "negative_control_candidates": [],
  "limits": [
    "Heuristics can miss weak assertions and can flag valid tests; inspect every finding.",
    "A test that passes against base is not by itself proof that the PR test is inadequate.",
    "Negative controls are only candidates until the test actually runs against base and fails by assertion rather than import/setup error."
  ]
}
CONFLICT (content): Merge conflict in core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
CONFLICT (content): Merge conflict in core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
windows	Build and run changed guest core/libs tests	2026-11-01T08:55:40.6519937Z 	1100 - agc_driver_linear_readback_label (Skipped)
windows	Build and run changed guest core/libs tests	2026-11-01T08:55:40.6591784Z 	1568 - agc_driver_linear_readback_label_off (Skipped)

Negative control

Assertion Change to code under test Did the new test fail?
Readback ordering, including the _off CTest variant No mutation was made; both hosted variants were skipped and I did not build locally. Could not exercise on this review.

Findings

Blocking

  1. Coordinate the overlapping texture changes. The pairwise merge preview of this head with open #13879 conflicts in Texture.hpp and Texture.cpp, and the repository asks authors of overlapping PRs to agree on landing order and declare it with Depends on. The body currently says Depends on: none. Please coordinate with #13879's author, then update the dependency/landing-order line and branch so the two changes integrate cleanly.
  2. Provide the required paired AGC validation. The repository requires the same focused tests on main and this change with VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ANYPS5_NO_SHADER_CACHE=1, and ANYPS5_REQUIRE_VULKAN=1, with logs checked for a missing validation layer and new VUID- errors. The hosted Windows run skipped both changed readback tests, and the PR description does not include comparable baseline/change logs. Please attach the focused outputs from the same machine and GPU; if this new test cannot run on main unchanged, describe the equivalent baseline procedure and include both logs.

Non-blocking

  • The C++ test-quality warning is a heuristic false positive: the execution-test source is discovered from the CMake glob, and its CTest fragment registers the normal and readback-disabled cases.

Sources

Not verified

  • Actual assertions from the two GPU-dependent CTests; both were skipped in hosted Windows CI.
  • The author's RTX 5080 run and its claimed title result; no paired raw main/change validation logs were attached.
  • Validation-layer messages, VUID- comparison, other GPU vendors, Linux behavior, and console behavior.
  • A local build or local CTest run.

To get this to a good state

Coordinate the overlapping PR order and update Depends on, then attach the paired focused AGC validation logs. I will re-check the new head, repeat the no-build review commands, and verify the new CI and integration state.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5727300304 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14311#pullrequestreview-5727300304). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-01T09:00:57Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested The exact head has a reproducible conflict with open PR #13879, and the repository-required paired AGC Vulkan validation is not evidenced; both are needed before this can be cleared. ## What I ran Reviewed head `c1a81eb25b5d7f1634f12f4ba1159cfd10f66068` against PR base `5c9837bfe7c5533f2c77c968dd8193157a8c342a`. GitHub reports the PR mergeable with `main`; the pairwise preview against #13879 used merge base `5e936063e3a74b7f03ff06905be04c5a00be60a7` and conflicted in `Texture.hpp` and `Texture.cpp`. Environment: Linux 6.1.0-54-amd64; no compiler was invoked. I did not configure, build, or run local CTest under the no-build initial-review rule. ```sh python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14311 python3 tools/pr_abi_audit.py --repo /marc/AnyPS5 --base 5c9837bfe7c5533f2c77c968dd8193157a8c342a --head c1a81eb25b5d7f1634f12f4ba1159cfd10f66068 --json python3 tools/pr_test_quality.py --root /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14311-c1a81eb25b5d/head-c1a81eb25b5d-e8f4724c --json core/libs/prx/libSceAgcDriver/tests/execution/LinearReadbackLabel.cpp git fetch https://github.com/boykopovar/AnyPS5.git refs/pull/14311/head:refs/review/new-pr/14311-20261101 git fetch https://github.com/boykopovar/AnyPS5.git refs/pull/13879/head:refs/review/new-pr/13879-20261101 git merge-tree --write-tree refs/review/new-pr/14311-20261101 refs/review/new-pr/13879-20261101 gh pr checks 14311 --repo boykopovar/AnyPS5 gh run view 41288250942 --repo boykopovar/AnyPS5 --job 124795776558 --log | grep -i 'readback' | tail -30 ``` ## Results | Check | Result | |---|---| | `git diff --check` | Passed in the exact-head precheck. | | Repository conventions and PR template | Passed locally and in hosted CI. | | Export/ABI audit | Not applicable: the diff changes no recognized exports or ABI declarations. | | Test-quality heuristic | One possible-unregistered-test warning; false positive after checking CMake's `tests/execution/*.cpp` target discovery and the test fragment. | | Mergeability with `main` | GitHub reports `clean`. | | Pairwise integration with #13879 | Conflict in `core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp` and `Graphics/src/Texture.cpp`. | | Hosted Windows job | Passed, but both `agc_driver_linear_readback_label` and `agc_driver_linear_readback_label_off` were skipped. | | Hosted Linux and specialized jobs | Skipped. | | Local build/CTest | Not run. | The precheck's aggregate status was `checks failed` because its detached exact-head checkout lacks the workspace-only ABI and test-quality helper scripts. I reran those helpers from the workspace: the ABI audit found no applicable ABI changes, and the test-quality warning is explained by CMake's automatic source discovery. <details><summary>Unedited outputs from the relevant checks</summary> ```text All conventions checks passed. ``` ```text { "status": "not_applicable", "symbols": [], "findings": [], "limitations": [ "No changed APS5_VABI declaration/definition or APS5_EXPORT alias was recognized in the PR diff." ] } ``` ```text { "findings": [ { "path": "core/libs/prx/libSceAgcDriver/tests/execution/LinearReadbackLabel.cpp", "line": 1, "kind": "possible-unregistered-cpp-test", "message": "Changed C++ test source path was not found literally in CMake files; inspect registration, generated source lists, and workflow coverage." } ], "negative_control_candidates": [], "limits": [ "Heuristics can miss weak assertions and can flag valid tests; inspect every finding.", "A test that passes against base is not by itself proof that the PR test is inadequate.", "Negative controls are only candidates until the test actually runs against base and fails by assertion rather than import/setup error." ] } ``` ```text CONFLICT (content): Merge conflict in core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp CONFLICT (content): Merge conflict in core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp ``` ```text windows Build and run changed guest core/libs tests 2026-11-01T08:55:40.6519937Z 1100 - agc_driver_linear_readback_label (Skipped) windows Build and run changed guest core/libs tests 2026-11-01T08:55:40.6591784Z 1568 - agc_driver_linear_readback_label_off (Skipped) ``` </details> ## Negative control | Assertion | Change to code under test | Did the new test fail? | |---|---|---| | Readback ordering, including the `_off` CTest variant | No mutation was made; both hosted variants were skipped and I did not build locally. | Could not exercise on this review. | ## Findings ### Blocking 1. **Coordinate the overlapping texture changes.** The pairwise merge preview of this head with open #13879 conflicts in `Texture.hpp` and `Texture.cpp`, and the repository asks authors of overlapping PRs to agree on landing order and declare it with `Depends on`. The body currently says `Depends on: none`. Please coordinate with #13879's author, then update the dependency/landing-order line and branch so the two changes integrate cleanly. 2. **Provide the required paired AGC validation.** The repository requires the same focused tests on `main` and this change with `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, `ANYPS5_NO_SHADER_CACHE=1`, and `ANYPS5_REQUIRE_VULKAN=1`, with logs checked for a missing validation layer and new `VUID-` errors. The hosted Windows run skipped both changed readback tests, and the PR description does not include comparable baseline/change logs. Please attach the focused outputs from the same machine and GPU; if this new test cannot run on `main` unchanged, describe the equivalent baseline procedure and include both logs. ### Non-blocking - The C++ test-quality warning is a heuristic false positive: the execution-test source is discovered from the CMake glob, and its CTest fragment registers the normal and readback-disabled cases. ## Sources - [Repository overlap and AGC validation rules at the PR base](https://github.com/boykopovar/AnyPS5/blob/5c9837bfe7c5533f2c77c968dd8193157a8c342a/CONTRIBUTING.md#L65-L73) - [PR-specific AGC validation instruction](https://github.com/boykopovar/AnyPS5/blob/5c9837bfe7c5533f2c77c968dd8193157a8c342a/AGENTS.md#L15) - [The readback heuristic at this head](https://github.com/boykopovar/AnyPS5/blob/c1a81eb25b5d7f1634f12f4ba1159cfd10f66068/core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp#L3924-L3936) and [its label-store selection](https://github.com/boykopovar/AnyPS5/blob/c1a81eb25b5d7f1634f12f4ba1159cfd10f66068/core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp#L4736-L4747) - [Flip-event hook at this head](https://github.com/boykopovar/AnyPS5/blob/c1a81eb25b5d7f1634f12f4ba1159cfd10f66068/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp#L393-L400) - [Execution-test target discovery at this head](https://github.com/boykopovar/AnyPS5/blob/c1a81eb25b5d7f1634f12f4ba1159cfd10f66068/core/libs/prx/libSceAgcDriver/CMakeLists.txt#L553-L567) and [the CTest cases](https://github.com/boykopovar/AnyPS5/blob/c1a81eb25b5d7f1634f12f4ba1159cfd10f66068/core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_linear_readback_label_tests.cmake#L1-L7) - [Overlapping #13879 texture changes at its current head](https://github.com/boykopovar/AnyPS5/blob/bafc1a1346e6d6756821f1abba3cb6a9d1972eb0/core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp) - [Hosted Windows run for this exact head](https://github.com/boykopovar/AnyPS5/actions/runs/41288250942/job/124795776558) ## Not verified - Actual assertions from the two GPU-dependent CTests; both were skipped in hosted Windows CI. - The author's RTX 5080 run and its claimed title result; no paired raw main/change validation logs were attached. - Validation-layer messages, `VUID-` comparison, other GPU vendors, Linux behavior, and console behavior. - A local build or local CTest run. ## To get this to a good state Coordinate the overlapping PR order and update `Depends on`, then attach the paired focused AGC validation logs. I will re-check the new head, repeat the no-build review commands, and verify the new CI and integration state.
MarcZX10 commented 2026-11-01 10:27:51 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T10:27:51Z.

Review: COMMENTED


Re-checked — new head, no blocking findings

The two blocking items from c1a81eb25b (the #13879 merge conflict and the paired AGC validation logs) appear resolved at 48f5fce43a on the evidence below, and the remaining items are non-blocking; this review does not replace the earlier CHANGES_REQUESTED review 5727300304.

What I ran

Head reviewed: 48f5fce43a4cf850b4833cb6543a9aa096c432bf. PR base: 26fa1212b82f76dd49cf12d65e445d6ff3e0844c. Merge previews, all git merge-tree --write-tree with exit 0 (clean): head against current main ba8dcc6ae82a5c4443efd93bbb99dfa91faf7fa4, against #13879 head 90f0b5fd3b22d57a8d42a8bd133005003e93dcf4, and against #13678 head a3046f449ce09fabc19f7564816272ea115a4dad. Environment: Linux 6.1.0-54-amd64, Python 3.11.2, git 2.39.5. No compiler was invoked; no configure, build, CTest, or GPU run.

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14311
python3 -I tools/pr_abi_audit.py --repo /marc/AnyPS5 --base 26fa1212b82f76dd49cf12d65e445d6ff3e0844c --head 48f5fce43a4cf850b4833cb6543a9aa096c432bf --json
git archive 48f5fce43a core/libs/prx/libSceAgcDriver | tar -x -C <new-dir>
python3 -I tools/pr_test_quality.py --root <new-dir> --json core/libs/prx/libSceAgcDriver/tests/execution/LinearReadbackLabel.cpp
git merge-tree --write-tree 48f5fce43a 90f0b5fd3b22d57a8d42a8bd133005003e93dcf4
git merge-tree --write-tree 48f5fce43a a3046f449ce09fabc19f7564816272ea115a4dad
git merge-tree --write-tree 48f5fce43a ba8dcc6ae82a5c4443efd93bbb99dfa91faf7fa4
curl -sL -o main-ctest.log https://github.com/user-attachments/files/34235415/main-ctest.log
curl -sL -o change-ctest.log https://github.com/user-attachments/files/34235418/change-ctest.log
grep -c 'VUID-' main-ctest.log change-ctest.log
grep -c 'was not found but was requested by env var VK_INSTANCE_LAYERS' main-ctest.log change-ctest.log
grep -c 'Validation Warning' main-ctest.log change-ctest.log

The precheck ran at the exact head, and head and base were unchanged at completion. Its ABI audit and test-quality steps failed only because tools/pr_abi_audit.py and tools/pr_test_quality.py are absent from the detached head tree, so I ran both by hand from /marc/AnyPS5/tools as shown above.

Results

Check Result
git diff --check (precheck) Passed
Conventions and PR template (precheck) Passed
Live dependency and mergeability (precheck stack report) Passed
ABI audit, by hand not_applicable: no APS5_VABI or APS5_EXPORT change recognized
Test-quality heuristic, by hand One possible-unregistered-cpp-test finding; false positive, see Findings
Merge with current main ba8dcc6a Clean
Merge with #13879 90f0b5fd Clean
Merge with #13678 a3046f44 Clean
Hosted Windows, run 41295660562, job 124816577262 Success, but agc_driver_linear_readback_label is built from an ExecutionTestNotBuilt.cpp stub and reported Skipped
Author-attached paired logs (main and head, RTX 5080) Both report 64 of 64 passing, with no VUID- lines and no missing-layer lines. Author-reported; I did not reproduce them
Unedited output
$ git merge-tree --write-tree 48f5fce43a 90f0b5fd3b22d57a8d42a8bd133005003e93dcf4; echo "exit=$?"
d951c99f1dde81c03fa4268ee2c9992dab248d1f
exit=0
$ git merge-tree --write-tree 48f5fce43a a3046f449ce09fabc19f7564816272ea115a4dad; echo "exit=$?"
0d4fc12a301898b01ea2165279ce6410e7c4942b
exit=0
$ git merge-tree --write-tree 48f5fce43a ba8dcc6ae82a5c4443efd93bbb99dfa91faf7fa4; echo "exit=$?"
ebf681ffd865ea80fcebbec451e99c69f6caffb6
exit=0
$ python3 -I tools/pr_test_quality.py --root <new-dir> --json core/libs/prx/libSceAgcDriver/tests/execution/LinearReadbackLabel.cpp
      "kind": "possible-unregistered-cpp-test",
      "message": "Changed C++ test source path was not found literally in CMake files; inspect registration, generated source lists, and workflow coverage."
$ hosted Windows log, job 124816577262
2026-11-01T10:13:31.5876163Z [414/1165] Building CXX object core/libs/prx/libSceAgcDriver/CMakeFiles/agc_driver_linear_readback_label_tests.dir/tests/ExecutionTestNotBuilt.cpp.obj
2026-11-01T10:16:53.4750256Z  676/2582 Test #1100: agc_driver_linear_readback_label .........................................***Skipped   0.02 sec
$ grep -c 'VUID-' main-ctest.log change-ctest.log
main-ctest.log:0
change-ctest.log:0
$ grep -c 'was not found but was requested by env var VK_INSTANCE_LAYERS' main-ctest.log change-ctest.log
main-ctest.log:0
change-ctest.log:0
$ grep -c 'Validation Warning' main-ctest.log change-ctest.log
change-ctest.log:6
main-ctest.log:6
$ tr -d '\r' < main-ctest.log | grep -E "Test *#(1100|1568):|100% tests passed"
 5/64 Test #1100: agc_driver_linear_readback_label ............................   Passed    0.46 sec
13/64 Test #1568: agc_driver_linear_readback_label_off ........................   Passed    0.40 sec
100% tests passed, 0 tests failed out of 64
$ tr -d '\r' < change-ctest.log | grep -E "Test *#(1100|1568):|100% tests passed"
 5/64 Test #1100: agc_driver_linear_readback_label ............................   Passed    0.46 sec
13/64 Test #1568: agc_driver_linear_readback_label_off ........................   Passed    0.41 sec
100% tests passed, 0 tests failed out of 64

Negative control

Assertion Change to code under test Did the new test fail?
Occasional store: a second write with no flip between is not chosen for its label Not run by me. The PR body reports that restoring the old behaviour fails on that step. From source, removing the clear at Texture.cpp line 4753 would make the same-flip second write choose the image again. Not exercised in this review
agc_driver_linear_readback_label_off (sets APS5_NO_LABEL_READBACK_STORE=1) Not a negative control for the new block. The run stops at the linear check in ReadAfterLabel before ReadOccasionalAfterLabel runs. No; the new path is not reached

Findings

Blocking

None.

The first blocker is resolved on the evidence: the head merges cleanly with #13879, #13678 and current main. The second is resolved on the evidence in the attachments: both logs report the same focused tests passing on main and on the head, the validation layer is active (both logs contain six Validation Warning lines, none of them VUID- errors), and neither log has a missing-layer message.

Non-blocking

  1. The base moved in the function this PR extends. #13499 merged at 2026-11-01T10:09:35Z and rewrote StoreReadbackBeforeLabel on main with an Apple-only trap path. The non-Apple selection of linear and small images is unchanged, so the Windows evidence still covers that branch. The new tiled-image loop at head (lines 4751 to 4757) is not gated on the Apple trap path, and the body does not say whether that is intended on macOS. The smallest useful step is to state how the two interact on macOS, or to check on current main.
  2. Overlap declaration. The overlap rule in CONTRIBUTING asks overlapping authors to agree a landing order and declare it with Depends on. The merges are clean, and the author says the lines differ from #13879, so this may not apply. The body still says Depends on: none. A reply on #13879 or a short note in the body would settle it; if #13879 lands first, the merge should be previewed again.
  3. GPU coverage. Hosted CI does not run these tests, so the only GPU evidence is the author's RTX 5080 logs. CONTRIBUTING says reviewers may ask for a run on another GPU vendor before merging. That call is left to the maintainer.
  4. Test gaps the author acknowledges. The NoteFlip() call in Driver::execute (PacketExecution.cpp line 399) has no assertion, because the test advances the counter by hand.
  5. Cost not measured. Each first write of a tiled image between 64 KiB and 1 MiB arms one store before the next label. The author makes no speed claim. If one is added later, the CONTRIBUTING performance rules apply.

The test-quality finding for LinearReadbackLabel.cpp is a false positive: CMakeLists.txt line 555 globs tests/execution/*.cpp, and tests/cmake/agc_driver_linear_readback_label_tests.cmake registers the executable.

Sources

Not verified

  • No build, CTest, or GPU run by me. The two readback tests were not executed in this review.
  • No macOS, Linux, or non-NVIDIA run. The hosted readback tests are skipped.
  • The attached logs are author-reported. They do not name the commit each build came from, so the main and head identities are the author's statement. The main run uses main's version of the test, which has no new cases, as the author notes.
  • #13499 and #13678 were checked for merge conflicts only, not for semantics.

To get this to a good state

  • Reply on the macOS interaction with #13499, or re-test on current main if the Apple path matters.
  • Confirm the landing order with the #13879 author, or state in the body why none is needed.
  • The earlier CHANGES_REQUESTED review 5727300304 at c1a81eb25b is not dismissed by this review; that decision is left to MarcZX10. oneandonlydean's comments at c1a81eb25b are answered at 48f5fce43a, and their re-review is pending.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5727596809 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14311#pullrequestreview-5727596809). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-01T10:27:51Z. **Review:** COMMENTED --- # Re-checked — new head, no blocking findings The two blocking items from c1a81eb25b (the #13879 merge conflict and the paired AGC validation logs) appear resolved at 48f5fce43a on the evidence below, and the remaining items are non-blocking; this review does not replace the earlier CHANGES_REQUESTED review 5727300304. ## What I ran Head reviewed: `48f5fce43a4cf850b4833cb6543a9aa096c432bf`. PR base: `26fa1212b82f76dd49cf12d65e445d6ff3e0844c`. Merge previews, all `git merge-tree --write-tree` with exit 0 (clean): head against current main `ba8dcc6ae82a5c4443efd93bbb99dfa91faf7fa4`, against #13879 head `90f0b5fd3b22d57a8d42a8bd133005003e93dcf4`, and against #13678 head `a3046f449ce09fabc19f7564816272ea115a4dad`. Environment: Linux 6.1.0-54-amd64, Python 3.11.2, git 2.39.5. No compiler was invoked; no configure, build, CTest, or GPU run. ```sh python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14311 python3 -I tools/pr_abi_audit.py --repo /marc/AnyPS5 --base 26fa1212b82f76dd49cf12d65e445d6ff3e0844c --head 48f5fce43a4cf850b4833cb6543a9aa096c432bf --json git archive 48f5fce43a core/libs/prx/libSceAgcDriver | tar -x -C <new-dir> python3 -I tools/pr_test_quality.py --root <new-dir> --json core/libs/prx/libSceAgcDriver/tests/execution/LinearReadbackLabel.cpp git merge-tree --write-tree 48f5fce43a 90f0b5fd3b22d57a8d42a8bd133005003e93dcf4 git merge-tree --write-tree 48f5fce43a a3046f449ce09fabc19f7564816272ea115a4dad git merge-tree --write-tree 48f5fce43a ba8dcc6ae82a5c4443efd93bbb99dfa91faf7fa4 curl -sL -o main-ctest.log https://github.com/user-attachments/files/34235415/main-ctest.log curl -sL -o change-ctest.log https://github.com/user-attachments/files/34235418/change-ctest.log grep -c 'VUID-' main-ctest.log change-ctest.log grep -c 'was not found but was requested by env var VK_INSTANCE_LAYERS' main-ctest.log change-ctest.log grep -c 'Validation Warning' main-ctest.log change-ctest.log ``` The precheck ran at the exact head, and head and base were unchanged at completion. Its ABI audit and test-quality steps failed only because `tools/pr_abi_audit.py` and `tools/pr_test_quality.py` are absent from the detached head tree, so I ran both by hand from `/marc/AnyPS5/tools` as shown above. ## Results | Check | Result | |---|---| | `git diff --check` (precheck) | Passed | | Conventions and PR template (precheck) | Passed | | Live dependency and mergeability (precheck stack report) | Passed | | ABI audit, by hand | `not_applicable`: no APS5_VABI or APS5_EXPORT change recognized | | Test-quality heuristic, by hand | One `possible-unregistered-cpp-test` finding; false positive, see Findings | | Merge with current main `ba8dcc6a` | Clean | | Merge with #13879 `90f0b5fd` | Clean | | Merge with #13678 `a3046f44` | Clean | | Hosted Windows, run 41295660562, job 124816577262 | Success, but `agc_driver_linear_readback_label` is built from an `ExecutionTestNotBuilt.cpp` stub and reported Skipped | | Author-attached paired logs (`main` and head, RTX 5080) | Both report 64 of 64 passing, with no `VUID-` lines and no missing-layer lines. Author-reported; I did not reproduce them | <details><summary>Unedited output</summary> ```text $ git merge-tree --write-tree 48f5fce43a 90f0b5fd3b22d57a8d42a8bd133005003e93dcf4; echo "exit=$?" d951c99f1dde81c03fa4268ee2c9992dab248d1f exit=0 $ git merge-tree --write-tree 48f5fce43a a3046f449ce09fabc19f7564816272ea115a4dad; echo "exit=$?" 0d4fc12a301898b01ea2165279ce6410e7c4942b exit=0 $ git merge-tree --write-tree 48f5fce43a ba8dcc6ae82a5c4443efd93bbb99dfa91faf7fa4; echo "exit=$?" ebf681ffd865ea80fcebbec451e99c69f6caffb6 exit=0 ``` ```text $ python3 -I tools/pr_test_quality.py --root <new-dir> --json core/libs/prx/libSceAgcDriver/tests/execution/LinearReadbackLabel.cpp "kind": "possible-unregistered-cpp-test", "message": "Changed C++ test source path was not found literally in CMake files; inspect registration, generated source lists, and workflow coverage." ``` ```text $ hosted Windows log, job 124816577262 2026-11-01T10:13:31.5876163Z [414/1165] Building CXX object core/libs/prx/libSceAgcDriver/CMakeFiles/agc_driver_linear_readback_label_tests.dir/tests/ExecutionTestNotBuilt.cpp.obj 2026-11-01T10:16:53.4750256Z 676/2582 Test #1100: agc_driver_linear_readback_label .........................................***Skipped 0.02 sec ``` ```text $ grep -c 'VUID-' main-ctest.log change-ctest.log main-ctest.log:0 change-ctest.log:0 $ grep -c 'was not found but was requested by env var VK_INSTANCE_LAYERS' main-ctest.log change-ctest.log main-ctest.log:0 change-ctest.log:0 $ grep -c 'Validation Warning' main-ctest.log change-ctest.log change-ctest.log:6 main-ctest.log:6 ``` ```text $ tr -d '\r' < main-ctest.log | grep -E "Test *#(1100|1568):|100% tests passed" 5/64 Test #1100: agc_driver_linear_readback_label ............................ Passed 0.46 sec 13/64 Test #1568: agc_driver_linear_readback_label_off ........................ Passed 0.40 sec 100% tests passed, 0 tests failed out of 64 $ tr -d '\r' < change-ctest.log | grep -E "Test *#(1100|1568):|100% tests passed" 5/64 Test #1100: agc_driver_linear_readback_label ............................ Passed 0.46 sec 13/64 Test #1568: agc_driver_linear_readback_label_off ........................ Passed 0.41 sec 100% tests passed, 0 tests failed out of 64 ``` </details> ## Negative control | Assertion | Change to code under test | Did the new test fail? | |---|---|---| | Occasional store: a second write with no flip between is not chosen for its label | Not run by me. The PR body reports that restoring the old behaviour fails on that step. From source, removing the clear at `Texture.cpp` line 4753 would make the same-flip second write choose the image again. | Not exercised in this review | | `agc_driver_linear_readback_label_off` (sets `APS5_NO_LABEL_READBACK_STORE=1`) | Not a negative control for the new block. The run stops at the linear check in `ReadAfterLabel` before `ReadOccasionalAfterLabel` runs. | No; the new path is not reached | ## Findings ### Blocking None. The first blocker is resolved on the evidence: the head merges cleanly with #13879, #13678 and current main. The second is resolved on the evidence in the attachments: both logs report the same focused tests passing on `main` and on the head, the validation layer is active (both logs contain six `Validation Warning` lines, none of them `VUID-` errors), and neither log has a missing-layer message. ### Non-blocking 1. **The base moved in the function this PR extends.** #13499 merged at 2026-11-01T10:09:35Z and rewrote `StoreReadbackBeforeLabel` on main with an Apple-only trap path. The non-Apple selection of linear and small images is unchanged, so the Windows evidence still covers that branch. The new tiled-image loop at head (lines 4751 to 4757) is not gated on the Apple trap path, and the body does not say whether that is intended on macOS. The smallest useful step is to state how the two interact on macOS, or to check on current main. 2. **Overlap declaration.** The overlap rule in CONTRIBUTING asks overlapping authors to agree a landing order and declare it with `Depends on`. The merges are clean, and the author says the lines differ from #13879, so this may not apply. The body still says `Depends on: none`. A reply on #13879 or a short note in the body would settle it; if #13879 lands first, the merge should be previewed again. 3. **GPU coverage.** Hosted CI does not run these tests, so the only GPU evidence is the author's RTX 5080 logs. CONTRIBUTING says reviewers may ask for a run on another GPU vendor before merging. That call is left to the maintainer. 4. **Test gaps the author acknowledges.** The `NoteFlip()` call in `Driver::execute` (PacketExecution.cpp line 399) has no assertion, because the test advances the counter by hand. 5. **Cost not measured.** Each first write of a tiled image between 64 KiB and 1 MiB arms one store before the next label. The author makes no speed claim. If one is added later, the CONTRIBUTING performance rules apply. The test-quality finding for `LinearReadbackLabel.cpp` is a false positive: `CMakeLists.txt` line 555 globs `tests/execution/*.cpp`, and `tests/cmake/agc_driver_linear_readback_label_tests.cmake` registers the executable. ## Sources - Current main, `StoreReadbackBeforeLabel` with the Apple trap path: https://github.com/boykopovar/AnyPS5/blob/ba8dcc6ae82a5c4443efd93bbb99dfa91faf7fa4/core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp#L4752-L4782 - Head, occasional-store loop: https://github.com/boykopovar/AnyPS5/blob/48f5fce43a4cf850b4833cb6543a9aa096c432bf/core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp#L4741-L4759 - Head, arming on write: https://github.com/boykopovar/AnyPS5/blob/48f5fce43a4cf850b4833cb6543a9aa096c432bf/core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp#L3940-L3943 - Head, `NoteFlip()` in the flip branch: https://github.com/boykopovar/AnyPS5/blob/48f5fce43a4cf850b4833cb6543a9aa096c432bf/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp#L399 - Head, execution-test glob and stub: https://github.com/boykopovar/AnyPS5/blob/48f5fce43a4cf850b4833cb6543a9aa096c432bf/core/libs/prx/libSceAgcDriver/CMakeLists.txt#L553-L555 - Head, `_off` CTest fragment: https://github.com/boykopovar/AnyPS5/blob/48f5fce43a4cf850b4833cb6543a9aa096c432bf/core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_linear_readback_label_tests.cmake#L3 - Repository rules at base: https://github.com/boykopovar/AnyPS5/blob/26fa1212b82f76dd49cf12d65e445d6ff3e0844c/CONTRIBUTING.md#L68-L73 ## Not verified - No build, CTest, or GPU run by me. The two readback tests were not executed in this review. - No macOS, Linux, or non-NVIDIA run. The hosted readback tests are skipped. - The attached logs are author-reported. They do not name the commit each build came from, so the `main` and head identities are the author's statement. The `main` run uses `main`'s version of the test, which has no new cases, as the author notes. - #13499 and #13678 were checked for merge conflicts only, not for semantics. ## To get this to a good state - Reply on the macOS interaction with #13499, or re-test on current main if the Apple path matters. - Confirm the landing order with the #13879 author, or state in the body why none is needed. - The earlier CHANGES_REQUESTED review 5727300304 at c1a81eb25b is not dismissed by this review; that decision is left to MarcZX10. oneandonlydean's comments at c1a81eb25b are answered at 48f5fce43a, and their re-review is pending.
CnRJay commented 2026-11-01 19:41:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-11-01T19:41:11Z.

Review: COMMENTED


The bug is real and well described: a CPU read after a label of a tiled image that stayed on the GPU. oneandonlydean has covered the flag logic and the debt entry. The part I'd add is the cost of the fix on the GPU side, which the description handles as "no speed claim".

1. Storing before the label is a GPU→CPU round trip. StoreReadbackBeforeLabel records a copy of the image into host memory and the label has to wait for it. For 1 MiB that is a readback and a queue wait on the label's path, in the middle of a frame. The 64 KiB limit for tiled images exists because that cost adds up. This change raises it 16× for images that are "written occasionally", chosen by a heuristic of 8 flips and 1 MiB that the description itself says comes from one case.

2. The cost is paid per qualifying write, not once. The description says an armed image "takes one store until the next first write or long gap". An image written once every 9+ flips is therefore stored again at each such write. A dynamic atlas, a UI or minimap target that is redrawn every second or two (which is 9+ flips at 60 fps) takes a 1 MiB readback and wait on every redraw, indefinitely. That is the pattern the limit of 8 flips lets through. The test covers "write after a gap of more than 8 flips is chosen" but not how often a real title does it.

3. The numbers shown cover only the quiet case. 76 label stores with and without the change over 45 s of play is "no harm on a route that never hits the path". The PR needs a trace from a scene where it does: a count of selected images and bytes stored per second, and the Driver.Packet.memory_wait or label-wait phase from tools/trace_digest.py, main against the change, same machine and scene. Without that the "no speed claim" line leaves the one thing a reviewer must judge unmeasured.

4. Can the store be deferred? The only reader of this image is the CPU after the label. If the title reads it later than the label, the copy can be issued at the label and waited on only when the CPU's read happens (the existing write-watch/trap path on the destination page). That removes the wait from the GPU path for every image size and makes the 1 MiB / 8-flip thresholds unnecessary. If there's a reason it can't be, state it in the debt entry.

5. Thresholds from one title. AGENTS.md and CONTRIBUTING say not to special-case a value seen in one title's trace. The 1 MiB and 8-flip values are exactly that. If a general rule is unknown, the convention is to throw and record the gap in docs/dev/debt/libSceAgcDriver.md, not to ship a heuristic tuned to PPSA06866.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5729892913 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14311#pullrequestreview-5729892913). Originally posted by [CnRJay](https://github.com/CnRJay) on 2026-11-01T19:41:11Z. **Review:** COMMENTED --- The bug is real and well described: a CPU read after a label of a tiled image that stayed on the GPU. oneandonlydean has covered the flag logic and the debt entry. The part I'd add is the cost of the fix on the GPU side, which the description handles as "no speed claim". **1. Storing before the label is a GPU→CPU round trip.** `StoreReadbackBeforeLabel` records a copy of the image into host memory and the label has to wait for it. For 1 MiB that is a readback and a queue wait on the label's path, in the middle of a frame. The 64 KiB limit for tiled images exists because that cost adds up. This change raises it 16× for images that are "written occasionally", chosen by a heuristic of 8 flips and 1 MiB that the description itself says comes from one case. **2. The cost is paid per qualifying write, not once.** The description says an armed image "takes one store until the next first write or long gap". An image written once every 9+ flips is therefore stored again at each such write. A dynamic atlas, a UI or minimap target that is redrawn every second or two (which is 9+ flips at 60 fps) takes a 1 MiB readback and wait on every redraw, indefinitely. That is the pattern the limit of 8 flips lets through. The test covers "write after a gap of more than 8 flips is chosen" but not how often a real title does it. **3. The numbers shown cover only the quiet case.** 76 label stores with and without the change over 45 s of play is "no harm on a route that never hits the path". The PR needs a trace from a scene where it does: a count of selected images and bytes stored per second, and the `Driver.Packet.memory_wait` or label-wait phase from `tools/trace_digest.py`, `main` against the change, same machine and scene. Without that the "no speed claim" line leaves the one thing a reviewer must judge unmeasured. **4. Can the store be deferred?** The only reader of this image is the CPU after the label. If the title reads it later than the label, the copy can be issued at the label and waited on only when the CPU's read happens (the existing write-watch/trap path on the destination page). That removes the wait from the GPU path for every image size and makes the 1 MiB / 8-flip thresholds unnecessary. If there's a reason it can't be, state it in the debt entry. **5. Thresholds from one title.** AGENTS.md and CONTRIBUTING say not to special-case a value seen in one title's trace. The 1 MiB and 8-flip values are exactly that. If a general rule is unknown, the convention is to throw and record the gap in `docs/dev/debt/libSceAgcDriver.md`, not to ship a heuristic tuned to PPSA06866.
MarcZX10 commented 2026-11-02 07:51:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-02T07:51:02Z.

Review: COMMENTED


Reviewed — no blocking findings in the code read; the new label-store path runs only in an execution test that is a stub on Windows

This PR stores an occasionally written image's guest range before a label is set. A texture is marked "occasionally written" when it was written once or after more than 8 flips since its last write, and only textures between SmallStoreBytes and 1 MiB are stored. I read the production change in full. The Windows run passed 2594 of 2594, but the test for this path, agc_driver_linear_readback_label, was Skipped, so the new behaviour has no hosted pass.

What I ran

  • Head 84946a6af663f18da7bae6ac99178cbc443a20da; base f2d874c1fdccf781c0fa5d86619bb5dd8894b958. 5 files, +81/-6: Driver/Packets/PacketExecution.cpp (+1), Graphics/include/Texture.hpp (+6), Graphics/src/Texture.cpp (+23), tests/execution/LinearReadbackLabel.cpp (+56/-6), and docs/dev/debt/libSceAgcDriver.md (+1; not read).
  • Read the production change in full. NoteFlip increments a process-wide flip counter. Each texture records the flip at its last write. Its writtenOccasionally flag is set when it was written once or the flip count has moved more than 8 since. The label path skips linear textures, textures no larger than SmallStoreBytes (value not read here), and textures larger than 1 MiB. For the rest, it stores the range only if the flag was set, and it counts those stores.
  • Test file: read the names only.
  • Hosted, Windows CTest: 2594 of 2594 passed. agc_driver_linear_readback_label (Test #1107) is Skipped, as are the other label-order execution tests (Test #808, #845, #953). Those are the stubs for execution tests that are not in ANYPS5_AGC_EXECUTION_TESTS.
  • Hosted, other jobs: conventions passed on the later run (an earlier run was cancelled); library-portability and report succeeded. Linux, relinkers and write-watch skipped.
  • Read-only checks from the trusted main checkout: diff check and conventions passed. ABI audit not applicable. Stack check: clean, no declared dependencies, no errors.
  • No MarcZX10 review at this head.

Results

Check Result Note
Diff check passed
Conventions and PR template passed the later run succeeded; an earlier run was cancelled
Mergeability and dependencies passed stack check: clean; no declared dependencies
ABI audit not applicable no export changed
Windows CTest (hosted) passed 2594 of 2594, with the label-order execution tests skipped
agc_driver_linear_readback_label (the changed test) skipped the execution stub on Windows
Production change (read) passed by reading the flip counter and the store rule are as described; no blocking defect found
The thresholds (8 flips, 1 MiB) and SmallStoreBytes not verified the basis for the thresholds was not checked; the debt line was not read
Negative controls not run no local build
Read-only check output

Precheck was not run: no PR-head code is run here. Diff check: passed. Conventions: passed. ABI audit: not applicable. Stack check: clean, no declared dependencies, no errors. Hosted: gh api repos/boykopovar/AnyPS5/commits/84946a6af663f18da7bae6ac99178cbc443a20da/check-runs, and the Windows job log (2594 of 2594).

Negative control

Not run here. A negative control needs a local build and run of the label test, and code from this head is not run here.

Findings

Blocking

None from the code read.

Non-blocking

  • The store decision depends on a process-wide flip count, so whether a texture is stored depends on how many frames passed between its writes. That is a timing heuristic. Its thresholds (8 flips, 1 MiB, and SmallStoreBytes) are fixed in the code, and the basis for them is not stated in the diff.
  • The label-order test that covers the change is a Windows stub, so nothing hosted runs the new store path.

Sources

Not verified

  • The basis for the thresholds and for SmallStoreBytes.
  • The label behaviour on hardware, and the new path under the execution test (a stub on Windows).
  • The debt entry line (not read).

To get this to a good state

  • Nothing blocking. Run agc_driver_linear_readback_label at this head on a host that builds the execution tests, and say where the thresholds come from.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5733431704 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14311#pullrequestreview-5733431704). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-02T07:51:02Z. **Review:** COMMENTED --- # Reviewed — no blocking findings in the code read; the new label-store path runs only in an execution test that is a stub on Windows This PR stores an occasionally written image's guest range before a label is set. A texture is marked "occasionally written" when it was written once or after more than 8 flips since its last write, and only textures between `SmallStoreBytes` and 1 MiB are stored. I read the production change in full. The Windows run passed 2594 of 2594, but the test for this path, `agc_driver_linear_readback_label`, was Skipped, so the new behaviour has no hosted pass. ## What I ran - Head `84946a6af663f18da7bae6ac99178cbc443a20da`; base `f2d874c1fdccf781c0fa5d86619bb5dd8894b958`. 5 files, +81/-6: `Driver/Packets/PacketExecution.cpp` (+1), `Graphics/include/Texture.hpp` (+6), `Graphics/src/Texture.cpp` (+23), `tests/execution/LinearReadbackLabel.cpp` (+56/-6), and `docs/dev/debt/libSceAgcDriver.md` (+1; not read). - Read the production change in full. `NoteFlip` increments a process-wide flip counter. Each texture records the flip at its last write. Its `writtenOccasionally` flag is set when it was written once or the flip count has moved more than 8 since. The label path skips linear textures, textures no larger than `SmallStoreBytes` (value not read here), and textures larger than 1 MiB. For the rest, it stores the range only if the flag was set, and it counts those stores. - Test file: read the names only. - Hosted, Windows CTest: 2594 of 2594 passed. `agc_driver_linear_readback_label` (Test #1107) is Skipped, as are the other label-order execution tests (Test #808, #845, #953). Those are the stubs for execution tests that are not in `ANYPS5_AGC_EXECUTION_TESTS`. - Hosted, other jobs: conventions passed on the later run (an earlier run was cancelled); library-portability and report succeeded. Linux, relinkers and write-watch skipped. - Read-only checks from the trusted main checkout: diff check and conventions passed. ABI audit not applicable. Stack check: clean, no declared dependencies, no errors. - No MarcZX10 review at this head. ## Results | Check | Result | Note | | --- | --- | --- | | Diff check | passed | | | Conventions and PR template | passed | the later run succeeded; an earlier run was cancelled | | Mergeability and dependencies | passed | stack check: clean; no declared dependencies | | ABI audit | not applicable | no export changed | | Windows CTest (hosted) | passed | 2594 of 2594, with the label-order execution tests skipped | | `agc_driver_linear_readback_label` (the changed test) | skipped | the execution stub on Windows | | Production change (read) | passed by reading | the flip counter and the store rule are as described; no blocking defect found | | The thresholds (8 flips, 1 MiB) and `SmallStoreBytes` | not verified | the basis for the thresholds was not checked; the debt line was not read | | Negative controls | not run | no local build | <details><summary>Read-only check output</summary> Precheck was not run: no PR-head code is run here. Diff check: passed. Conventions: passed. ABI audit: not applicable. Stack check: clean, no declared dependencies, no errors. Hosted: `gh api repos/boykopovar/AnyPS5/commits/84946a6af663f18da7bae6ac99178cbc443a20da/check-runs`, and the Windows job log (2594 of 2594). </details> ## Negative control Not run here. A negative control needs a local build and run of the label test, and code from this head is not run here. ## Findings **Blocking** None from the code read. **Non-blocking** - The store decision depends on a process-wide flip count, so whether a texture is stored depends on how many frames passed between its writes. That is a timing heuristic. Its thresholds (8 flips, 1 MiB, and `SmallStoreBytes`) are fixed in the code, and the basis for them is not stated in the diff. - The label-order test that covers the change is a Windows stub, so nothing hosted runs the new store path. ## Sources - Production: https://github.com/boykopovar/AnyPS5/blob/84946a6af663f18da7bae6ac99178cbc443a20da/core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp - Header: https://github.com/boykopovar/AnyPS5/blob/84946a6af663f18da7bae6ac99178cbc443a20da/core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp - Test: https://github.com/boykopovar/AnyPS5/blob/84946a6af663f18da7bae6ac99178cbc443a20da/core/libs/prx/libSceAgcDriver/tests/execution/LinearReadbackLabel.cpp - Windows job log: check-run `windows` on 84946a6af663f18da7bae6ac99178cbc443a20da ## Not verified - The basis for the thresholds and for `SmallStoreBytes`. - The label behaviour on hardware, and the new path under the execution test (a stub on Windows). - The debt entry line (not read). ## To get this to a good state - Nothing blocking. Run `agc_driver_linear_readback_label` at this head on a host that builds the execution tests, and say where the thresholds come from.
MarcZX10 commented 2026-11-02 18:34:21 +00:00 (Migrated from github.com)

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

Review: APPROVED


Reviewed — looks good

I reviewed all six changed files at head 54fad51133fe12a637c0b395e4b5c6d420691c89 and found no blocking issue; the earlier overlap is resolved and the paired AGC validation is reported for this head.

What I ran

Reviewed against PR base a4eca2a056bf3bbbec98ab42e9d28163e4ea9cb8. The stack precheck reported a clean merge preview against current main. The former overlap, #13879, merged on November 1. The author reports a paired Vulkan run against main bc12e152250ce963451f3e25c4adbe799abfb656 and this head on Windows 11 Pro 10.0.26300, GCC 15.2.0, NVIDIA RTX 5080, driver 617.42. I checked that current main has no changes to the touched AGC source or test files since that baseline.

Reviewer environment: Debian 12, Linux 6.1.0-54-amd64, Python 3.11.2, GCC 12.2.0 (not used for a build).

git diff --check a4eca2a056bf3bbbec98ab42e9d28163e4ea9cb8...54fad51133fe12a637c0b395e4b5c6d420691c89
python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14311 --output-dir /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14311-54fad51133
python3 tools/pr_abi_audit.py --repo /marc/AnyPS5 --base a4eca2a056bf3bbbec98ab42e9d28163e4ea9cb8 --head 54fad51133fe12a637c0b395e4b5c6d420691c89 --json
python3 tools/pr_test_quality.py --root /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14311-54fad51133/head-54fad51133fe-6805d102 --json core/libs/prx/libSceAgcDriver/tests/execution/LinearReadbackLabel.cpp
python3 tools/pr_stack_check.py 14311 --repo boykopovar/AnyPS5
gh pr checks 14311 --repo boykopovar/AnyPS5
gh api repos/boykopovar/AnyPS5/actions/jobs/125451071780/logs > /tmp/anyps5-14311-win.log
rg -n 'agc_driver_linear_readback_label|tests passed|tests failed' /tmp/anyps5-14311-win.log | tail -8
git diff --name-only bc12e152250ce963451f3e25c4adbe799abfb656..a4eca2a056bf3bbbec98ab42e9d28163e4ea9cb8 -- core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp core/libs/prx/libSceAgcDriver/tests/execution/LinearReadbackLabel.cpp

The author’s paired GPU results are reported in the follow-up, not independently run by me. The precheck’s isolated snapshot lacks the optional ABI and test-quality helpers; I ran the ABI audit separately and checked the test’s CMake glob and CTest fragment manually. I did not configure or build AnyPS5 or run local CTest.

Results

Check Result Note
Diff and conventions passed Exact head; template and conventions pass.
ABI audit not applicable No changed exports or ABI declarations.
Test registration passed CMake glob and CTest fragment register the test.
Merge preview passed Clean against current main; #13879 is merged.
Hosted Windows passed Exact head; both GPU-dependent label tests were skipped in hosted CI.
Paired AGC Vulkan tests passed Author-reported: 74/74 on baseline and change, zero skips or new VUIDs.
Other hosted jobs not run Linux and specialized jobs were skipped.
Local build, CTest and negative control not run No exact-head local binary was built.
Full precheck failed Optional helper scripts are absent from its isolated snapshot; see details.
Precheck table and selected unedited outputs
Precheck Status Reason
Build and compile not applicable Precheck does not build.
Diff check passed Exact base and head.
Conventions and PR template passed Exact head.
Changed-export ABI audit failed Helper absent from isolated snapshot; separate audit was not applicable.
Python checks not applicable No changed Python files.
Dependency and mergeability passed Clean current-base preview; no declared dependencies.
Build-dependent C++ tests not applicable Require an exact-head build.
Test-quality heuristic failed Helper absent from isolated snapshot; registration was manually confirmed.
Negative controls not applicable No changed Python test module.

Conventions output:

All conventions checks passed.

Standalone ABI audit:

not_applicable symbols 0 findings 0

Test-quality heuristic output:

{
  "findings": [
    {
      "path": "core/libs/prx/libSceAgcDriver/tests/execution/LinearReadbackLabel.cpp",
      "line": 1,
      "kind": "possible-unregistered-cpp-test",
      "message": "Changed C++ test source path was not found literally in CMake files; inspect registration, generated source lists, and workflow coverage."
    }
  ],
  "negative_control_candidates": [],
  "limits": [
    "Heuristics can miss weak assertions and can flag valid tests; inspect every finding.",
    "A test that passes against base is not by itself proof that the PR test is inadequate.",
    "Negative controls are only candidates until the test actually runs against base and fails by assertion rather than import/setup error."
  ]
}

Hosted Windows output:

2026-11-02T18:15:22.2755627Z [961/1170] Linking CXX executable tests\agc_driver_linear_readback_label_tests.exe
2026-11-02T18:19:21.1628638Z           Start 1184: agc_driver_linear_readback_label
2026-11-02T18:19:21.1908353Z  730/2966 Test #1184: agc_driver_linear_readback_label .................................................................***Skipped   0.03 sec
2026-11-02T18:19:33.7050288Z           Start 1679: agc_driver_linear_readback_label_off
2026-11-02T18:19:33.7138725Z 1216/2966 Test #1679: agc_driver_linear_readback_label_off .............................................................***Skipped   0.01 sec
2026-11-02T18:21:40.9366241Z 100% tests passed, 0 tests failed out of 2966

Current PR check summary: conventions, labels, eligibility, library-portability, report and Windows passed. Linux, relinker, ASan, edge-watch, register-context and write-watch were skipped.

Negative control

Assertion Change to code under test Did the new test fail?
A consecutive-flip rewrite is not stored at the label, while the first write and a write after a gap are stored. I did not mutate code or run the binary. The author reports restoring the prior behavior fails the consecutive-write assertion on an earlier revision. Not exercised by me; current-head paired test pass is author-reported.

Findings

Blocking

None.

Non-blocking

None.

Sources

Not verified

I did not run local build/CTest, Linux/macOS tests, the PS5 console, or a reviewer-side negative control. Hosted Linux and specialized jobs were skipped. The paired GPU run and its validation-layer/VUID results are author-reported.

To get this to a good state

No further author action is required for this review. Approval covers only head 54fad51133fe12a637c0b395e4b5c6d420691c89.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5741459596 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14311#pullrequestreview-5741459596). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-02T18:34:21Z. **Review:** APPROVED --- # Reviewed — looks good I reviewed all six changed files at head `54fad51133fe12a637c0b395e4b5c6d420691c89` and found no blocking issue; the earlier overlap is resolved and the paired AGC validation is reported for this head. ## What I ran Reviewed against PR base `a4eca2a056bf3bbbec98ab42e9d28163e4ea9cb8`. The stack precheck reported a clean merge preview against current `main`. The former overlap, #13879, merged on November 1. The author reports a paired Vulkan run against `main` `bc12e152250ce963451f3e25c4adbe799abfb656` and this head on Windows 11 Pro 10.0.26300, GCC 15.2.0, NVIDIA RTX 5080, driver 617.42. I checked that current `main` has no changes to the touched AGC source or test files since that baseline. Reviewer environment: Debian 12, Linux 6.1.0-54-amd64, Python 3.11.2, GCC 12.2.0 (not used for a build). ```sh git diff --check a4eca2a056bf3bbbec98ab42e9d28163e4ea9cb8...54fad51133fe12a637c0b395e4b5c6d420691c89 python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14311 --output-dir /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14311-54fad51133 python3 tools/pr_abi_audit.py --repo /marc/AnyPS5 --base a4eca2a056bf3bbbec98ab42e9d28163e4ea9cb8 --head 54fad51133fe12a637c0b395e4b5c6d420691c89 --json python3 tools/pr_test_quality.py --root /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14311-54fad51133/head-54fad51133fe-6805d102 --json core/libs/prx/libSceAgcDriver/tests/execution/LinearReadbackLabel.cpp python3 tools/pr_stack_check.py 14311 --repo boykopovar/AnyPS5 gh pr checks 14311 --repo boykopovar/AnyPS5 gh api repos/boykopovar/AnyPS5/actions/jobs/125451071780/logs > /tmp/anyps5-14311-win.log rg -n 'agc_driver_linear_readback_label|tests passed|tests failed' /tmp/anyps5-14311-win.log | tail -8 git diff --name-only bc12e152250ce963451f3e25c4adbe799abfb656..a4eca2a056bf3bbbec98ab42e9d28163e4ea9cb8 -- core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp core/libs/prx/libSceAgcDriver/tests/execution/LinearReadbackLabel.cpp ``` The author’s paired GPU results are reported in [the follow-up](https://github.com/boykopovar/AnyPS5/pull/14311#issuecomment-6584334821), not independently run by me. The precheck’s isolated snapshot lacks the optional ABI and test-quality helpers; I ran the ABI audit separately and checked the test’s CMake glob and CTest fragment manually. I did not configure or build AnyPS5 or run local CTest. ## Results | Check | Result | Note | |---|---|---| | Diff and conventions | passed | Exact head; template and conventions pass. | | ABI audit | not applicable | No changed exports or ABI declarations. | | Test registration | passed | CMake glob and CTest fragment register the test. | | Merge preview | passed | Clean against current `main`; #13879 is merged. | | Hosted Windows | passed | Exact head; both GPU-dependent label tests were skipped in hosted CI. | | Paired AGC Vulkan tests | passed | Author-reported: 74/74 on baseline and change, zero skips or new VUIDs. | | Other hosted jobs | not run | Linux and specialized jobs were skipped. | | Local build, CTest and negative control | not run | No exact-head local binary was built. | | Full precheck | failed | Optional helper scripts are absent from its isolated snapshot; see details. | <details> <summary>Precheck table and selected unedited outputs</summary> | Precheck | Status | Reason | |---|---|---| | Build and compile | not applicable | Precheck does not build. | | Diff check | passed | Exact base and head. | | Conventions and PR template | passed | Exact head. | | Changed-export ABI audit | failed | Helper absent from isolated snapshot; separate audit was not applicable. | | Python checks | not applicable | No changed Python files. | | Dependency and mergeability | passed | Clean current-base preview; no declared dependencies. | | Build-dependent C++ tests | not applicable | Require an exact-head build. | | Test-quality heuristic | failed | Helper absent from isolated snapshot; registration was manually confirmed. | | Negative controls | not applicable | No changed Python test module. | Conventions output: ```text All conventions checks passed. ``` Standalone ABI audit: ```text not_applicable symbols 0 findings 0 ``` Test-quality heuristic output: ```json { "findings": [ { "path": "core/libs/prx/libSceAgcDriver/tests/execution/LinearReadbackLabel.cpp", "line": 1, "kind": "possible-unregistered-cpp-test", "message": "Changed C++ test source path was not found literally in CMake files; inspect registration, generated source lists, and workflow coverage." } ], "negative_control_candidates": [], "limits": [ "Heuristics can miss weak assertions and can flag valid tests; inspect every finding.", "A test that passes against base is not by itself proof that the PR test is inadequate.", "Negative controls are only candidates until the test actually runs against base and fails by assertion rather than import/setup error." ] } ``` Hosted Windows output: ```text 2026-11-02T18:15:22.2755627Z [961/1170] Linking CXX executable tests\agc_driver_linear_readback_label_tests.exe 2026-11-02T18:19:21.1628638Z Start 1184: agc_driver_linear_readback_label 2026-11-02T18:19:21.1908353Z 730/2966 Test #1184: agc_driver_linear_readback_label .................................................................***Skipped 0.03 sec 2026-11-02T18:19:33.7050288Z Start 1679: agc_driver_linear_readback_label_off 2026-11-02T18:19:33.7138725Z 1216/2966 Test #1679: agc_driver_linear_readback_label_off .............................................................***Skipped 0.01 sec 2026-11-02T18:21:40.9366241Z 100% tests passed, 0 tests failed out of 2966 ``` Current PR check summary: conventions, labels, eligibility, library-portability, report and Windows passed. Linux, relinker, ASan, edge-watch, register-context and write-watch were skipped. </details> ## Negative control | Assertion | Change to code under test | Did the new test fail? | |---|---|---| | A consecutive-flip rewrite is not stored at the label, while the first write and a write after a gap are stored. | I did not mutate code or run the binary. The author reports restoring the prior behavior fails the consecutive-write assertion on an earlier revision. | Not exercised by me; current-head paired test pass is author-reported. | ## Findings ### Blocking None. ### Non-blocking None. ## Sources - [Flip counter and write-frequency tracking at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/54fad51133fe12a637c0b395e4b5c6d420691c89/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp#L406-L420) and [texture write tracking and label selection](https://github.com/boykopovar/AnyPS5/blob/54fad51133fe12a637c0b395e4b5c6d420691c89/core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp#L4096-L4116) - [Device-scoped label store](https://github.com/boykopovar/AnyPS5/blob/54fad51133fe12a637c0b395e4b5c6d420691c89/core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp#L2596-L2602) and [occasional image regression assertions](https://github.com/boykopovar/AnyPS5/blob/54fad51133fe12a637c0b395e4b5c6d420691c89/core/libs/prx/libSceAgcDriver/tests/execution/LinearReadbackLabel.cpp#L230-L267) - [Execution-test source discovery](https://github.com/boykopovar/AnyPS5/blob/54fad51133fe12a637c0b395e4b5c6d420691c89/core/libs/prx/libSceAgcDriver/CMakeLists.txt#L591-L606), [CTest registration](https://github.com/boykopovar/AnyPS5/blob/54fad51133fe12a637c0b395e4b5c6d420691c89/core/libs/prx/libSceAgcDriver/CMakeLists.txt#L681-L700) and [readback-disabled test](https://github.com/boykopovar/AnyPS5/blob/54fad51133fe12a637c0b395e4b5c6d420691c89/core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_linear_readback_label_tests.cmake#L1-L7) - [Author’s paired Vulkan test report](https://github.com/boykopovar/AnyPS5/pull/14311#issuecomment-6584334821) ## Not verified I did not run local build/CTest, Linux/macOS tests, the PS5 console, or a reviewer-side negative control. Hosted Linux and specialized jobs were skipped. The paired GPU run and its validation-layer/VUID results are author-reported. ## To get this to a good state No further author action is required for this review. Approval covers only head `54fad51133fe12a637c0b395e4b5c6d420691c89`.
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!14311
No description provided.