test(agc): fix two stale expectations in the full recorder run #3103

Merged
fma-rc merged 2 commits from upstream-pr/3103 into main 2026-10-11 07:55:18 +00:00
fma-rc commented 2026-10-10 22:12:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fma-rc on 2026-10-10T22:12:54Z.


What

Test-only changes in tests/Recorder.cpp so that a full agc_driver_recorder_tests run (no arguments, which ctest never does) gets to the end again on current main.

staleGenerationTests, step (s): after the Refresh() over untracked memory the image is still pending, so the check now flushes it explicitly first, the way the unwatched branch of storageRefreshTests already does.

importWindowTests, step (w): image->MarkDirty() already creates the import, so cached was taken after the pages were reported and UnchangedSince stayed true.

Both steps, since #2699: StorageTexture::upload now calls HostImportFor on the fast-clear path (Texture.cpp:1940), so constructing the image imports the surface and takes the range off the watch. The image still collects its generation before that import (Texture.cpp:1915), which is what the steps guard, so only their precondition was stale. (s) now requires the block to be watched before the image is constructed and the image to hold a generation afterwards. (w) takes cached and checks !HostImportCovers before the constructor, and checks that the image's generation predates the import window.

Refs #1532 (the full run is still not registered with ctest, so the issue stays open with this).

Tested

Arch Linux, GCC 16.2.1, Release, RTX 5080 (NVIDIA 615.78.08) and Radeon 610M (RADV), ANYPS5_REQUIRE_VULKAN=1, full run with no arguments. The branch is rebased onto main 65a4e8ef.

RTX 5080 RADV
main 2bb78d2c + the first commit only exit 1, (s) the storage image imported its memory before a generation was taken same
+ the (s) change only exit 1, (w) the storage image imported its memory before a generation was taken same
this branch (on main 65a4e8ef) exit 0, Recorder read tracking and label tests passed same

Mutations on the driver, each run on both devices: counting an image with a generation as tracked in Texture.cpp:1564 turns (s) red (the image is not pending after the refresh); forcing written = true in GuestMemory.cpp:945 turns (w) red (the pages the import reported read as written by the CPU). Removing the import at Texture.cpp:1940 leaves the run green. The [gpu] lease wait failed ... Vulkan result -4 line in the old logs came from the image being destroyed with its clear recorded when the Require threw; it is in no passing log.

Not shown: no mutation targets the "results pending over the import window" drop path of (w), whose window now falls inside the constructor. Not tested on Windows by me (both steps are skipped there).

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 in TechnicalDebt
  • 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
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4814804082 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3103). Originally posted by [fma-rc](https://github.com/fma-rc) on 2026-10-10T22:12:54Z. --- ### What Test-only changes in `tests/Recorder.cpp` so that a full `agc_driver_recorder_tests` run (no arguments, which ctest never does) gets to the end again on current `main`. `staleGenerationTests`, step (s): after the `Refresh()` over untracked memory the image is still pending, so the check now flushes it explicitly first, the way the unwatched branch of `storageRefreshTests` already does. `importWindowTests`, step (w): `image->MarkDirty()` already creates the import, so `cached` was taken after the pages were reported and `UnchangedSince` stayed true. Both steps, since #2699: `StorageTexture::upload` now calls `HostImportFor` on the fast-clear path (`Texture.cpp:1940`), so constructing the image imports the surface and takes the range off the watch. The image still collects its generation before that import (`Texture.cpp:1915`), which is what the steps guard, so only their precondition was stale. (s) now requires the block to be watched before the image is constructed and the image to hold a generation afterwards. (w) takes `cached` and checks `!HostImportCovers` before the constructor, and checks that the image's generation predates the import window. Refs #1532 (the full run is still not registered with ctest, so the issue stays open with this). ### Tested Arch Linux, GCC 16.2.1, Release, RTX 5080 (NVIDIA 615.78.08) and Radeon 610M (RADV), `ANYPS5_REQUIRE_VULKAN=1`, full run with no arguments. The branch is rebased onto `main` 65a4e8ef. | | RTX 5080 | RADV | |---|---|---| | `main` 2bb78d2c + the first commit only | exit 1, `(s) the storage image imported its memory before a generation was taken` | same | | + the (s) change only | exit 1, `(w) the storage image imported its memory before a generation was taken` | same | | this branch (on `main` 65a4e8ef) | exit 0, `Recorder read tracking and label tests passed` | same | Mutations on the driver, each run on both devices: counting an image with a generation as tracked in `Texture.cpp:1564` turns (s) red (`the image is not pending after the refresh`); forcing `written = true` in `GuestMemory.cpp:945` turns (w) red (`the pages the import reported read as written by the CPU`). Removing the import at `Texture.cpp:1940` leaves the run green. The `[gpu] lease wait failed ... Vulkan result -4` line in the old logs came from the image being destroyed with its clear recorded when the `Require` threw; it is in no passing log. Not shown: no mutation targets the "results pending over the import window" drop path of (w), whose window now falls inside the constructor. Not tested on Windows by me (both steps are skipped there). ### 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 in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [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] AI-assisted: yes
github-actions[bot] commented 2026-10-10 22:13:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-10T22:13:05Z.


Thank you for your interest in the project! We are sorry, but we cannot accept more PRs while we work through the existing backlog. This PR has been automatically closed and labeled "intake paused". This is not a judgment of the quality of your changes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6102733603 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3103#issuecomment-6102733603). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-10T22:13:05Z. --- Thank you for your interest in the project! We are sorry, but we cannot accept more PRs while we work through the existing backlog. This PR has been automatically closed and labeled "intake paused". This is not a judgment of the quality of your changes.
adriadam10 commented 2026-10-11 07:06:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T07:06:26Z.

Review: CHANGES_REQUESTED


Thanks for the follow-up. I ran the full agc_driver_recorder_tests (no arguments, RADV) with this PR merged onto current main: it exits 1 on (s) the storage image imported its memory before a generation was taken, before reaching either step this PR changes. That matches your note on #1532 (it started with #2699), so on main the PR's two fixes can't be shown to work.

  • The (s) stop after #2699 needs to be settled first, either by taking the generation before constructing the image in staleGenerationTests, or by deciding that the early import is a problem for what (s) guards. It can go in this PR or a separate one.
  • Then please show the full run exiting 0 on current main with the PR, and update the Tested table.
  • Fixes #1532 should stay only if the full run is green on main; the issue also covers the test never running in CI.

The two changes themselves (explicit flush in (s), cached taken before MarkDirty() in (w)) look reasonable.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5482276138 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3103#pullrequestreview-5482276138). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-11T07:06:26Z. **Review:** CHANGES_REQUESTED --- Thanks for the follow-up. I ran the full `agc_driver_recorder_tests` (no arguments, RADV) with this PR merged onto current `main`: it exits 1 on `(s) the storage image imported its memory before a generation was taken`, before reaching either step this PR changes. That matches your note on #1532 (it started with #2699), so on `main` the PR's two fixes can't be shown to work. - The `(s)` stop after #2699 needs to be settled first, either by taking the generation before constructing the image in `staleGenerationTests`, or by deciding that the early import is a problem for what `(s)` guards. It can go in this PR or a separate one. - Then please show the full run exiting 0 on current `main` with the PR, and update the `Tested` table. - `Fixes #1532` should stay only if the full run is green on `main`; the issue also covers the test never running in CI. The two changes themselves (explicit flush in `(s)`, `cached` taken before `MarkDirty()` in `(w)`) look reasonable.
Mouhand-Kaddo commented 2026-10-11 07:24:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Mouhand-Kaddo on 2026-10-11T07:24:12Z.


Additional platform validation of standalone PR head 1c7ff0bfbd5acde358f85c699149425750406ec5 (2026-10-11):

Windows: passed — Windows 11, WinLibs GCC 15.2.0 UCRT/POSIX/SEH r7; CMake 4.3.1 / Ninja; Release, BUILD_TESTING=ON.

1 checks, 0 failures, 0 CTest skips. Built the selected targets and dependencies; this is focused validation, not a full build or full-suite run.

Checks: agc_driver_graphics.

Command after building: ctest --test-dir <build> --verbose --no-tests=error --timeout 30 -R "^agc_driver_graphics$".

This scope checks CPU-side behavior; no GPU execution result is claimed.

passed full recorder executable

No title/gameplay validation. These results cover the standalone head, not a merge with current main.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6106647007 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3103#issuecomment-6106647007). Originally posted by [Mouhand-Kaddo](https://github.com/Mouhand-Kaddo) on 2026-10-11T07:24:12Z. --- <!-- anyps5-platform-validation:1c7ff0bfbd5acde358f85c699149425750406ec5 --> Additional platform validation of standalone PR head `1c7ff0bfbd5acde358f85c699149425750406ec5` (2026-10-11): **Windows: passed** — Windows 11, WinLibs GCC 15.2.0 UCRT/POSIX/SEH r7; CMake 4.3.1 / Ninja; Release, `BUILD_TESTING=ON`. 1 checks, 0 failures, 0 CTest skips. Built the selected targets and dependencies; this is focused validation, not a full build or full-suite run. Checks: `agc_driver_graphics`. Command after building: `ctest --test-dir <build> --verbose --no-tests=error --timeout 30 -R "^agc_driver_graphics$"`. This scope checks CPU-side behavior; no GPU execution result is claimed. passed full recorder executable No title/gameplay validation. These results cover the standalone head, not a merge with current main.
reyani-dev commented 2026-10-11 07:29:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by reyani-dev on 2026-10-11T07:29:15Z.


Windows run, Windows 11 (10.0.26200), WinLibs GCC 15.2.0 r7, Release, with VK_LOADER_DRIVERS_DISABLE=*dzn* (this machine's Dozen ICD crashes on its own, #3255), NVIDIA RTX 4070 Laptop GPU (driver 616.92), head 1c7ff0bf merged onto current main:

  • The full agc_driver_recorder_tests run with no arguments (ANYPS5_REQUIRE_VULKAN=1) exits 0 (Recorder read tracking and label tests passed) both with this change and on plain main. Both steps it fixes print Linux write watch only and are skipped on Windows, so this run only shows the change is harmless there; it doesn't exercise the fix.
  • ctest -R "^agc_|video_out|^shader|recompiler": 358/358 pass.
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6106685252 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3103#issuecomment-6106685252). Originally posted by [reyani-dev](https://github.com/reyani-dev) on 2026-10-11T07:29:15Z. --- Windows run, Windows 11 (10.0.26200), WinLibs GCC 15.2.0 r7, Release, with `VK_LOADER_DRIVERS_DISABLE=*dzn*` (this machine's Dozen ICD crashes on its own, #3255), NVIDIA RTX 4070 Laptop GPU (driver 616.92), head `1c7ff0bf` merged onto current `main`: - The full `agc_driver_recorder_tests` run with no arguments (`ANYPS5_REQUIRE_VULKAN=1`) exits 0 (`Recorder read tracking and label tests passed`) both with this change and on plain `main`. Both steps it fixes print `Linux write watch only` and are skipped on Windows, so this run only shows the change is harmless there; it doesn't exercise the fix. - `ctest -R "^agc_|video_out|^shader|recompiler"`: 358/358 pass.
fma-rc commented 2026-10-11 07:50:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fma-rc on 2026-10-11T07:50:42Z.


Done in 433302be, and the branch is rebased onto main 65a4e8ef: the full run exits 0 on the RTX 5080 and on RADV.

The early import is the fast-clear path of StorageTexture::upload calling HostImportFor (Texture.cpp:1940, from #2699). The image still collects its generation before that import (Texture.cpp:1915), so what (s) guards holds and only the test's precondition was stale. (s) now requires the block to be watched before the image is constructed and the image to hold a generation afterwards. With (s) fixed the run stopped on the same message in (w), for the same reason, so that step got the same treatment.

The description has the new table and two driver mutations that turn each step red. I changed Fixes #1532 to Refs, since the full run is still not registered with ctest.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6106848173 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3103#issuecomment-6106848173). Originally posted by [fma-rc](https://github.com/fma-rc) on 2026-10-11T07:50:42Z. --- Done in 433302be, and the branch is rebased onto `main` 65a4e8ef: the full run exits 0 on the RTX 5080 and on RADV. The early import is the fast-clear path of `StorageTexture::upload` calling `HostImportFor` (`Texture.cpp:1940`, from #2699). The image still collects its generation before that import (`Texture.cpp:1915`), so what (s) guards holds and only the test's precondition was stale. (s) now requires the block to be watched before the image is constructed and the image to hold a generation afterwards. With (s) fixed the run stopped on the same message in (w), for the same reason, so that step got the same treatment. The description has the new table and two driver mutations that turn each step red. I changed `Fixes #1532` to `Refs`, since the full run is still not registered with ctest.
adriadam10 commented 2026-10-11 07:55:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T07:55:15Z.

Review: APPROVED


Checked the full agc_driver_recorder_tests run (no arguments, ANYPS5_REQUIRE_VULKAN=1, RADV) with this PR merged onto current main: exits 0. The same run with main's Recorder.cpp stops at (s) the storage image imported its memory before a generation was taken. The test-only diff fits the StorageTexture::upload fast-clear import from #2699; merging once CI is green.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5482445011 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3103#pullrequestreview-5482445011). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-11T07:55:15Z. **Review:** APPROVED --- Checked the full `agc_driver_recorder_tests` run (no arguments, `ANYPS5_REQUIRE_VULKAN=1`, RADV) with this PR merged onto current `main`: exits 0. The same run with `main`'s `Recorder.cpp` stops at `(s) the storage image imported its memory before a generation was taken`. The test-only diff fits the `StorageTexture::upload` fast-clear import from #2699; merging once CI 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!3103
No description provided.