test(agc-driver): flush untracked storage results before checking guest memory #2248

Merged
MarcZX10 merged 1 commit from upstream-pr/2248 into main 2026-10-10 05:36:25 +00:00
MarcZX10 commented 2026-10-09 13:10:20 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T13:10:20Z.


What

Fixes the untracked storage refresh check in agc_driver_recorder_tests for #2155. StorageTexture::Refresh() can keep an image's pending GPU results resident when guest-memory comparison is unchanged. The test now checks that the image remains pending, explicitly flushes it, waits for the GPU, and then verifies guest memory. The watched-memory assertion remains for platforms where watched imports are available.

The unit-shadow host-import retirement fix was removed from this PR after it merged in #2299 (0856926c) and is now part of main.

Tested

The current head cf043ca6 is based on upstream main 0df342c6400ddafeaab3f8ccbc6eb751a1ca35a3. On Linux x86-64 with GCC 12.2 and lavapipe, agc_driver_recorder_tests built and the full executable passed when run directly. This checkout does not register that executable with CTest. The runtime reports no write watching, so the watched-memory cases, including the watched storage-refresh assertion, were skipped; the untracked explicit-flush path did run.

python3 tools/check_conventions.py --base upstream/main and git diff --check upstream/main...HEAD pass.

Earlier Windows 10 / RTX 3060 Laptop runs passed the combined refresh and unit-shadow changes 30/30 on a pre-rebase tree. Those results are not a run of this head. Earlier native macOS fixture evidence reproduced the original guest-memory assertion failure and passed with the explicit-flush test change; it was an isolated fixture, not the repository recorder suite.

Eligibility and report checks, plus all three relinker jobs, pass on this head. Conventions is still queued. The automated PR workflow skipped the full Linux and Windows Build jobs; an authorized collaborator must start Build for those under #2113.

Checklist

  • Based on current main; no other open PR implements this refresh visibility change
  • One topic: recorder coverage for untracked storage refresh visibility
  • Code comments follow the project policy
  • Unimplemented paths throw; silent stubs are documented (not applicable)
  • No notes, investigation files or images added to the repository
  • New third-party code is a submodule built from source (not applicable)
  • General behavior; test identifies recorder expectations/lifecycle, not a title-specific special case
  • Depends on: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4800857339 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2248). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-09T13:10:20Z. --- ### What Fixes the untracked storage refresh check in `agc_driver_recorder_tests` for #2155. `StorageTexture::Refresh()` can keep an image's pending GPU results resident when guest-memory comparison is unchanged. The test now checks that the image remains pending, explicitly flushes it, waits for the GPU, and then verifies guest memory. The watched-memory assertion remains for platforms where watched imports are available. The unit-shadow host-import retirement fix was removed from this PR after it merged in #2299 (`0856926c`) and is now part of `main`. ### Tested The current head `cf043ca6` is based on upstream `main` `0df342c6400ddafeaab3f8ccbc6eb751a1ca35a3`. On Linux x86-64 with GCC 12.2 and lavapipe, `agc_driver_recorder_tests` built and the full executable passed when run directly. This checkout does not register that executable with CTest. The runtime reports no write watching, so the watched-memory cases, including the watched storage-refresh assertion, were skipped; the untracked explicit-flush path did run. `python3 tools/check_conventions.py --base upstream/main` and `git diff --check upstream/main...HEAD` pass. Earlier Windows 10 / RTX 3060 Laptop runs passed the combined refresh and unit-shadow changes 30/30 on a pre-rebase tree. Those results are not a run of this head. Earlier native macOS fixture evidence reproduced the original guest-memory assertion failure and passed with the explicit-flush test change; it was an isolated fixture, not the repository recorder suite. Eligibility and report checks, plus all three relinker jobs, pass on this head. Conventions is still queued. The automated PR workflow skipped the full Linux and Windows Build jobs; an authorized collaborator must start Build for those under #2113. ### Checklist - [x] Based on current `main`; no other open PR implements this refresh visibility change - [x] One topic: recorder coverage for untracked storage refresh visibility - [x] Code comments follow the project policy - [x] Unimplemented paths throw; silent stubs are documented (not applicable) - [x] No notes, investigation files or images added to the repository - [x] New third-party code is a submodule built from source (not applicable) - [x] General behavior; test identifies recorder expectations/lifecycle, not a title-specific special case - [x] Depends on: none - [x] AI-assisted: yes
MarcZX10 commented 2026-10-09 14:42:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T14:42:49Z.


The current-head diff is scoped to the recorder regression test, and the focused Linux tests and Conventions check are green. The contribution matrix also requires the full Linux/Windows Build and relinker jobs on the PR head (d7d8005521e151f3c3879da6e49b4129f8ec2925); the current PR check list only contains Conventions. I do not have upstream Actions dispatch access from this account, so could an authorized collaborator run the required Build workflow against this open PR before merge? The fork main baseline run does not cover this PR head.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6083184831 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2248#issuecomment-6083184831). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-09T14:42:49Z. --- The current-head diff is scoped to the recorder regression test, and the focused Linux tests and Conventions check are green. The contribution matrix also requires the full Linux/Windows Build and relinker jobs on the PR head (`d7d8005521e151f3c3879da6e49b4129f8ec2925`); the current PR check list only contains Conventions. I do not have upstream Actions dispatch access from this account, so could an authorized collaborator run the required Build workflow against this open PR before merge? The fork `main` baseline run does not cover this PR head.
popcoder565 commented 2026-10-09 15:01:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by popcoder565 on 2026-10-09T15:01:28Z.


Native Windows run, since this was tested on Linux with llvmpipe. Setup: Windows 10 (19045), RTX 3060 Laptop (NVIDIA 616.92), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. agc_driver_recorder_tests was built with --target.

tree runs result
main d70b8998 25 19 refresh store, 6 device loss
main + this PR (d7d80055) 30 23 pass, 7 device loss
main + this PR + #2299 30 30 pass
  • With this PR no run fails at the refresh store or at the new checks.
  • The remaining failures are the device loss from #2155. It isn't caused by this PR: unitShadowTests leaves its import behind on Windows, and #2299 fixes that.
  • On Windows both storage refresh passes run unwatched ("storage refresh in watched memory runs as unwatched"). So each run exercises the new untracked branch twice, but never the watched branch.
  • agc_driver_dcc_keys_first_write: 10 of 10 with this PR.

🤖 Addressed by Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6083508766 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2248#issuecomment-6083508766). Originally posted by [popcoder565](https://github.com/popcoder565) on 2026-10-09T15:01:28Z. --- Native Windows run, since this was tested on Linux with llvmpipe. Setup: Windows 10 (19045), RTX 3060 Laptop (NVIDIA 616.92), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. `agc_driver_recorder_tests` was built with `--target`. | tree | runs | result | |---|---|---| | `main` d70b8998 | 25 | 19 refresh store, 6 device loss | | `main` + this PR (d7d80055) | 30 | 23 pass, 7 device loss | | `main` + this PR + #2299 | 30 | 30 pass | - With this PR no run fails at the refresh store or at the new checks. - The remaining failures are the device loss from #2155. It isn't caused by this PR: `unitShadowTests` leaves its import behind on Windows, and #2299 fixes that. - On Windows both storage refresh passes run unwatched ("storage refresh in watched memory runs as unwatched"). So each run exercises the new untracked branch twice, but never the watched branch. - `agc_driver_dcc_keys_first_write`: 10 of 10 with this PR. _🤖 Addressed by [Claude Code](https://claude.com/claude-code)_
MarcZX10 commented 2026-10-09 18:15:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T18:15:45Z.


I rebased this existing PR onto current upstream main and force-pushed the reviewed head 8c236281ade4db49cd68e8ccf1ca3a999c3acca4 to the existing fork branch. The full diff remains limited to the recorder regression test. Local validation on that exact head: agc_driver_recorder_tests builds successfully; the full executable passes on lavapipe, including the new untracked refresh checks; git diff --check and python3 tools/check_conventions.py --base upstream/main pass. The Build workflow is still absent from the upstream PR checks, so the previously requested full Linux/Windows Build and relinker jobs on this exact head remain outstanding.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6086675851 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2248#issuecomment-6086675851). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-09T18:15:45Z. --- I rebased this existing PR onto current upstream main and force-pushed the reviewed head `8c236281ade4db49cd68e8ccf1ca3a999c3acca4` to the existing fork branch. The full diff remains limited to the recorder regression test. Local validation on that exact head: `agc_driver_recorder_tests` builds successfully; the full executable passes on lavapipe, including the new untracked refresh checks; `git diff --check` and `python3 tools/check_conventions.py --base upstream/main` pass. The Build workflow is still absent from the upstream PR checks, so the previously requested full Linux/Windows Build and relinker jobs on this exact head remain outstanding.
krishalivaibhav commented 2026-10-09 18:37:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by krishalivaibhav on 2026-10-09T18:37:31Z.


Native Apple M2 evidence for the recorder refresh test change: an isolated storageRefreshTests(false) fixture reproduced the original guest-memory assertion twice; applying the exact test patch from this PR made it pass. A separate subagent independently reproduced failure before and success after the patch. The checks establish pending-image identity, explicit flush, synchronization, and guest-memory contents rather than changing production Refresh behavior.

The companion original agc_driver_dcc_keys_first_write_tests also passed its ordinary/untracked-reuse cases on the real Apple M2 VulkanDevice. Watched-memory coverage is unavailable in this macOS runtime and explicitly skipped; Windows shared-import cases are excluded. The external recorder harness now reports a requested watched run as unsupported (77), not a pass. These companion outcomes were independently rerun.

Environment: Apple M2 / 16 GB, macOS 27.2 beta 3, Apple Clang 21 / SDK 27, bundled SDL, MoltenVK 1.4.2, explicit ICD/loader, cache disabled and 30-second limits. The narrow Recorder fixture required enabling advertised VK_KHR_portability_subset in an external copy and adding selected-device logging; no repository changes were made. It uses its own fixture Device, distinct from the companion test's production VulkanDevice.

Tested against our local macOS integration 4d910ce3, including existing ARM64/macOS, placeholder-image and SPIRV1.3 dependencies. The original PR2248 test hunk at d7d80055 was used; its added/removed lines are unchanged at rebased 8c236281. This is not an exact-current-head full Linux/Windows Build validation. No full recorder suite or unit-shadow/device-loss path was tested. No claim about watched-memory correctness, PR #2299 or game compatibility. AI-assisted validation with independent subagent review.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6087009233 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2248#issuecomment-6087009233). Originally posted by [krishalivaibhav](https://github.com/krishalivaibhav) on 2026-10-09T18:37:31Z. --- Native Apple M2 evidence for the recorder refresh test change: an isolated `storageRefreshTests(false)` fixture reproduced the original guest-memory assertion twice; applying the exact test patch from this PR made it pass. A separate subagent independently reproduced failure before and success after the patch. The checks establish pending-image identity, explicit flush, synchronization, and guest-memory contents rather than changing production Refresh behavior. The companion original `agc_driver_dcc_keys_first_write_tests` also passed its ordinary/untracked-reuse cases on the real Apple M2 VulkanDevice. Watched-memory coverage is unavailable in this macOS runtime and explicitly skipped; Windows shared-import cases are excluded. The external recorder harness now reports a requested watched run as unsupported (77), not a pass. These companion outcomes were independently rerun. Environment: Apple M2 / 16 GB, macOS 27.2 beta 3, Apple Clang 21 / SDK 27, bundled SDL, MoltenVK 1.4.2, explicit ICD/loader, cache disabled and 30-second limits. The narrow Recorder fixture required enabling advertised VK_KHR_portability_subset in an external copy and adding selected-device logging; no repository changes were made. It uses its own fixture Device, distinct from the companion test's production VulkanDevice. Tested against our local macOS integration `4d910ce3`, including existing ARM64/macOS, placeholder-image and SPIRV1.3 dependencies. The original PR2248 test hunk at `d7d80055` was used; its added/removed lines are unchanged at rebased `8c236281`. This is not an exact-current-head full Linux/Windows Build validation. No full recorder suite or unit-shadow/device-loss path was tested. No claim about watched-memory correctness, PR #2299 or game compatibility. AI-assisted validation with independent subagent review.
MarcZX10 commented 2026-10-09 18:39:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T18:39:22Z.


Thanks for the native macOS reproduction and for spelling out the fixture boundaries. I added the result to the PR description, including that the original test hunk is unchanged at the current head, while the external fixture was not a full repository Build and could not exercise watched memory.

The evidence strengthens the targeted untracked refresh regression check. The exact-head Linux/Windows Build and relinker matrix is still outstanding under the repository's contribution rules.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6087037840 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2248#issuecomment-6087037840). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-09T18:39:22Z. --- Thanks for the native macOS reproduction and for spelling out the fixture boundaries. I added the result to the PR description, including that the original test hunk is unchanged at the current head, while the external fixture was not a full repository Build and could not exercise watched memory. The evidence strengthens the targeted untracked refresh regression check. The exact-head Linux/Windows Build and relinker matrix is still outstanding under the repository's contribution rules.
MarcZX10 commented 2026-10-09 19:16:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T19:16:46Z.


Rebased the existing PR linearly onto current main (ae3d5f95) at head 66708cd8. The complete source diff remains the same 10-line test change in Recorder.cpp. On this head, Linux agc_driver_recorder_tests builds and the full executable passes on lavapipe; it explicitly skips watched-memory coverage because write watching is unavailable. Local and GitHub Conventions pass. I updated the description to keep the macOS and Windows evidence clearly identified as pre-rebase/fixture evidence with their limits.\n\nCould a collaborator with write access run the required upstream Linux/Windows Build and relinker matrix on this exact head under CONTRIBUTING/#2113?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6087622683 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2248#issuecomment-6087622683). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-09T19:16:46Z. --- Rebased the existing PR linearly onto current `main` (`ae3d5f95`) at head `66708cd8`. The complete source diff remains the same 10-line test change in `Recorder.cpp`. On this head, Linux `agc_driver_recorder_tests` builds and the full executable passes on lavapipe; it explicitly skips watched-memory coverage because write watching is unavailable. Local and GitHub Conventions pass. I updated the description to keep the macOS and Windows evidence clearly identified as pre-rebase/fixture evidence with their limits.\n\nCould a collaborator with write access run the required upstream Linux/Windows Build and relinker matrix on this exact head under CONTRIBUTING/#2113?
MarcZX10 commented 2026-10-09 22:00:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T22:00:43Z.


After #2299 merged, I rebased this PR on current main and removed the already-merged unit-shadow host-import retirement commit. The PR now contains only the explicit-flush coverage for untracked storage refresh visibility. The recorder test executable builds and passes locally on Linux/lavapipe; this runtime has no write watching, so the watched-memory storage-refresh case is skipped. The official Build/relinker matrix remains for a collaborator to run on this head.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6089972367 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2248#issuecomment-6089972367). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-09T22:00:43Z. --- After #2299 merged, I rebased this PR on current main and removed the already-merged unit-shadow host-import retirement commit. The PR now contains only the explicit-flush coverage for untracked storage refresh visibility. The recorder test executable builds and passes locally on Linux/lavapipe; this runtime has no write watching, so the watched-memory storage-refresh case is skipped. The official Build/relinker matrix remains for a collaborator to run on this head.
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!2248
No description provided.