test(agc): cover repeated untracked storage writes after sampling #5708

Merged
MarcZX10 merged 3 commits from upstream-pr/5708 into main 2026-10-15 15:04:27 +00:00
MarcZX10 commented 2026-10-14 07:35:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-14T07:35:33Z.


What

Adds an execution regression for #5693's repeated unwatched storage-image case. It stores an image, samples the live image into a separate surface, marks the original image dirty again without re-uploading it, then changes guest bytes while the repeated result is pending. The next guest read must preserve the CPU-written bytes.

This case failed at the existing "guest bytes not saved" guard before #5679. That fix is now on main; the case passes there and guards the behavior. It covers the sample-then-redirty path, distinct from #5760's direct second-store kernel case. The overlap bot also flags #5761, an explicitly test-only combined integration build that is not intended for merging; this PR contains only this regression case.

Tested

  • Rebased on current main (145cb82f3b54d8360e728c3cd7ed82a6fa2eee1a), including #5679 and #5707.
  • Debian 12, GCC 12.2, Ninja; Mesa llvmpipe (LLVM 15.0.6), Mesa Vulkan driver 22.3.6: the focused CTest passes (1/1). This host lacks the PS5-required LZCNT/BMI1/BMI2/MOVBE/AVX2/FMA CPU features, so I temporarily bypassed only the emulator startup CPU gate in the local test build; that source edit was restored and is not in this PR.
  • tools/check_conventions.py --base upstream/main --head HEAD and git diff --check pass.
  • No title run; this is a test-only follow-up.

Checklist

  • Based on current main; no other open PR adds this sample-then-redirty regression case
  • 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
  • New third-party code is a submodule built from source
  • Generic behavior, not specific to one title
  • Depends on: #5790 (shared fixture lifetime fix)
  • Unblocks: #5693
  • GPU tested: Mesa software Vulkan, llvmpipe (LLVM 15.0.6), Mesa 22.3.6, Debian 12
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4854544899 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5708). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-14T07:35:33Z. --- ### What Adds an execution regression for #5693's repeated unwatched storage-image case. It stores an image, samples the live image into a separate surface, marks the original image dirty again without re-uploading it, then changes guest bytes while the repeated result is pending. The next guest read must preserve the CPU-written bytes. This case failed at the existing "guest bytes not saved" guard before #5679. That fix is now on `main`; the case passes there and guards the behavior. It covers the sample-then-redirty path, distinct from #5760's direct second-store kernel case. The overlap bot also flags #5761, an explicitly test-only combined integration build that is not intended for merging; this PR contains only this regression case. ### Tested - Rebased on current `main` (`145cb82f3b54d8360e728c3cd7ed82a6fa2eee1a`), including #5679 and #5707. - Debian 12, GCC 12.2, Ninja; Mesa llvmpipe (LLVM 15.0.6), Mesa Vulkan driver 22.3.6: the focused CTest passes (1/1). This host lacks the PS5-required LZCNT/BMI1/BMI2/MOVBE/AVX2/FMA CPU features, so I temporarily bypassed only the emulator startup CPU gate in the local test build; that source edit was restored and is not in this PR. - `tools/check_conventions.py --base upstream/main --head HEAD` and `git diff --check` pass. - No title run; this is a test-only follow-up. ### Checklist - [x] Based on current `main`; no other open PR adds this sample-then-redirty regression case - [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 - [x] New third-party code is a submodule built from source - [x] Generic behavior, not specific to one title - [x] Depends on: #5790 (shared fixture lifetime fix) - [x] Unblocks: #5693 - [x] GPU tested: Mesa software Vulkan, llvmpipe (LLVM 15.0.6), Mesa 22.3.6, Debian 12 - [x] AI-assisted: yes
MarcZX10 commented 2026-10-14 11:35:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-14T11:35:44Z.


The overlap is with #5761, whose description explicitly marks it as a combined test build, not for merging. This PR adds only the sample-then-redirty regression; it is distinct from the direct second-store case in #5760. I updated the body to record that distinction and the dependency on #5790 for safe fixture cleanup.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6167414921 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5708#issuecomment-6167414921). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-14T11:35:44Z. --- The overlap is with #5761, whose description explicitly marks it as a combined test build, not for merging. This PR adds only the sample-then-redirty regression; it is distinct from the direct second-store case in #5760. I updated the body to record that distinction and the dependency on #5790 for safe fixture cleanup.
github-actions[bot] commented 2026-10-15 12:08:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T12:08:50Z.


Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 5761 core/libs/prx/libSceAgcDriver/tests/execution/StoreOverUntracked.cpp
PR 6188 core/libs/prx/libSceAgcDriver/tests/execution/StoreOverUntracked.cpp
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6191689867 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5708#issuecomment-6191689867). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-15T12:08:50Z. --- <!-- pr-overlap --> Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap. | Pull request | Shared files not compared | |---|---| | [PR 5761](https://www.github.com/boykopovar/AnyPS5/pull/5761) | `core/libs/prx/libSceAgcDriver/tests/execution/StoreOverUntracked.cpp` | | [PR 6188](https://www.github.com/boykopovar/AnyPS5/pull/6188) | `core/libs/prx/libSceAgcDriver/tests/execution/StoreOverUntracked.cpp` |
adriadam10 commented 2026-10-15 12:13:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-15T12:13:24Z.


Checked the new UntrackedRepeat case: it builds and passes on Linux (agc_driver_store_over_untracked, repeated runs).

Added one commit on your branch: output was a Surface local to the if block, so its memory was freed while ReadImage could still be queued. It is now an std::optional<Surface> declared before waitForWork, so it outlives the queued dispatch (same lifetime issue as #5790).

Merging once the full Build is green.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6191771440 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5708#issuecomment-6191771440). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-15T12:13:24Z. --- Checked the new `UntrackedRepeat` case: it builds and passes on Linux (`agc_driver_store_over_untracked`, repeated runs). Added one commit on your branch: `output` was a `Surface` local to the `if` block, so its memory was freed while `ReadImage` could still be queued. It is now an `std::optional<Surface>` declared before `waitForWork`, so it outlives the queued dispatch (same lifetime issue as #5790). Merging once the full Build is green.
adriadam10 commented 2026-10-15 12:29:13 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-15T12:29:13Z.


Rebased onto current main: the conflict was with the new NeighbourLeftWatch case in StoreOverUntracked.cpp; both cases are kept and the cases array is now sized 10. agc_driver_store_over_untracked passes on Linux (repeated runs). The earlier commit that keeps the sampled output surface alive until the queued read finishes stays.

Merging once the full Build is green.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6192059577 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5708#issuecomment-6192059577). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-15T12:29:13Z. --- Rebased onto current `main`: the conflict was with the new `NeighbourLeftWatch` case in `StoreOverUntracked.cpp`; both cases are kept and the `cases` array is now sized 10. `agc_driver_store_over_untracked` passes on Linux (repeated runs). The earlier commit that keeps the sampled `output` surface alive until the queued read finishes stays. Merging once the full Build is green.
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!5708
No description provided.