test(agc): require the fast image proof only if the memory stayed watched across it #22989

Merged
BrDhaker merged 1 commit from upstream-pr/22989 into main 2026-11-27 15:24:06 +00:00
BrDhaker commented 2026-11-18 16:02:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by BrDhaker on 2026-11-18T16:02:21Z.


What

agc_driver_cached_image_multisample_guard fails now and then on Windows with:

checking draw storage image reuse
AGC graphics: the fixture did not exercise the fast image proof

CheckCachedImage runs the initial proof and only then asks GuestMemory::Watched whether that proof had to take the fast path. For the storage images the memory starts compared and becomes watched when its deferred settle completes, and that can happen while the proof is running. The proof correctly takes the full path, since the memory wasn't watched when it started, but the later query sees watched memory and the test demands ProofPath::Fast.

I added temporary prints of the watch state before and after the proof. In 30 runs on the RTX 4060, the storage cases were watchedBefore=0 path=Full watchedAfter=0 every time except the failing run, which was watchedBefore=0 path=Full watchedAfter=1. The sampled cases were watchedBefore=1 path=Fast watchedAfter=1 in all runs.

The test now records the watch state before the proof, and requires the fast path only when the memory is watched both before and after it. Otherwise it takes the existing "compared, not watched" branch. The sampled cases still prove the fast path on every run, so the fast-path check keeps its coverage.

Tested

Windows 11 (build 26300), WinLibs GCC 15.2.0, full build, ANYPS5_REQUIRE_VULKAN=1, the test run on its own.

runs failed
main 738e9da767, RTX 4060 60 13
this PR, RTX 4060 40 0
this PR, Intel Arc iGPU 40 0

In the 80 passing runs with this change, the compared branch was taken exactly twice per run (the two storage cases), and the sampled cases required and got the fast path each time. It also failed in 2 of the 4 full ctest -j 8 runs I did on the 4060 before this change.

This only changes the test's own check. No Vulkan calls change, so I didn't do the validation-layer comparison; the layer isn't installed on this machine, and I can run it if you want it. check_conventions.py --base upstream/main passes. gh isn't installed here, so instead of tools/pr_overlap.py I searched open PRs by hand: #13963 also edits this file, but adds a separate case and doesn't touch the fast-proof check.

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 and the licence notice of code adapted from upstream (see AGENTS.md)
  • 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: none
  • GPUs tested: NVIDIA GeForce RTX 4060 Laptop GPU (NVIDIA 617.14) and Intel Arc Graphics iGPU (32.0.101.6556), Windows 11 build 26300
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5379465213 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22989). Originally posted by [BrDhaker](https://github.com/BrDhaker) on 2026-11-18T16:02:21Z. --- ### What `agc_driver_cached_image_multisample_guard` fails now and then on Windows with: ``` checking draw storage image reuse AGC graphics: the fixture did not exercise the fast image proof ``` `CheckCachedImage` runs the initial proof and only *then* asks `GuestMemory::Watched` whether that proof had to take the fast path. For the storage images the memory starts compared and becomes watched when its deferred settle completes, and that can happen while the proof is running. The proof correctly takes the full path, since the memory wasn't watched when it started, but the later query sees watched memory and the test demands `ProofPath::Fast`. I added temporary prints of the watch state before and after the proof. In 30 runs on the RTX 4060, the storage cases were `watchedBefore=0 path=Full watchedAfter=0` every time except the failing run, which was `watchedBefore=0 path=Full watchedAfter=1`. The sampled cases were `watchedBefore=1 path=Fast watchedAfter=1` in all runs. The test now records the watch state before the proof, and requires the fast path only when the memory is watched both before and after it. Otherwise it takes the existing "compared, not watched" branch. The sampled cases still prove the fast path on every run, so the fast-path check keeps its coverage. ### Tested Windows 11 (build 26300), WinLibs GCC 15.2.0, full build, `ANYPS5_REQUIRE_VULKAN=1`, the test run on its own. | | runs | failed | |---|---|---| | `main` 738e9da767, RTX 4060 | 60 | 13 | | this PR, RTX 4060 | 40 | 0 | | this PR, Intel Arc iGPU | 40 | 0 | In the 80 passing runs with this change, the compared branch was taken exactly twice per run (the two storage cases), and the sampled cases required and got the fast path each time. It also failed in 2 of the 4 full `ctest -j 8` runs I did on the 4060 before this change. This only changes the test's own check. No Vulkan calls change, so I didn't do the validation-layer comparison; the layer isn't installed on this machine, and I can run it if you want it. `check_conventions.py --base upstream/main` passes. `gh` isn't installed here, so instead of `tools/pr_overlap.py` I searched open PRs by hand: #13963 also edits this file, but adds a separate case and doesn't touch the fast-proof check. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [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) and the licence notice of code adapted from upstream (see AGENTS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: NVIDIA GeForce RTX 4060 Laptop GPU (NVIDIA 617.14) and Intel Arc Graphics iGPU (32.0.101.6556), Windows 11 build 26300 - [x] AI-assisted: yes
MarcZX10 commented 2026-11-20 05:09:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T05:09:28Z.

Review: APPROVED


Reviewed — looks good

The two-line test change conditions the fast-proof assertion on the guest memory being watched both before and after revalidation; no blocking defect is evident in the changed code.

What I ran

  • Reviewed head 63b4ce9bc3ae50d60a12c45af2606acebf1fa403; base is main.
  • Read the prepared description, commit summary, manifest, diff, and the full changed file’s relevant function at the pinned head. Also read the Watched declaration and a nearby use in ShaderResources.cpp for context.
  • No build or test commands were run. The PR description reports Windows test runs; those are author-provided results.

Results

Check Result Note
Diff and changed function review passed Two changed lines reviewed
Build and tests not run Author reports Windows runs
Coverage claims not run Not independently confirmed

Findings

Blocking

None.

Non-blocking

None.

Not verified

  • The reported Windows builds and test runs were not reproduced.
  • No validation-layer comparison was run; the description says it was not available to the author.
  • No other repository files were read. The manifest lists one changed file, and its full text was accessible at the pinned head.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5987812809 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22989#pullrequestreview-5987812809). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-20T05:09:28Z. **Review:** APPROVED --- # Reviewed — looks good The two-line test change conditions the fast-proof assertion on the guest memory being watched both before and after revalidation; no blocking defect is evident in the changed code. ## What I ran - Reviewed head `63b4ce9bc3ae50d60a12c45af2606acebf1fa403`; base is `main`. - Read the prepared description, commit summary, manifest, diff, and the full changed file’s relevant function at the pinned head. Also read the `Watched` declaration and a nearby use in `ShaderResources.cpp` for context. - No build or test commands were run. The PR description reports Windows test runs; those are author-provided results. ## Results | Check | Result | Note | |---|---|---| | Diff and changed function review | passed | Two changed lines reviewed | | Build and tests | not run | Author reports Windows runs | | Coverage claims | not run | Not independently confirmed | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified - The reported Windows builds and test runs were not reproduced. - No validation-layer comparison was run; the description says it was not available to the author. - No other repository files were read. The manifest lists one changed file, and its full text was accessible at the pinned head. ## To get this to a good state Nothing is required.
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!22989
No description provided.