test(agc): expect the stored-again flush waits only while the earlier store is pending #21741

Merged
androidbaklava merged 1 commit from upstream-pr/21741 into main 2026-11-27 17:43:25 +00:00
androidbaklava commented 2026-11-16 18:04:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by androidbaklava on 2026-11-16T18:04:55Z.


What

agc_driver_storage_flush_ordering fails on every run on an Intel UHD iGPU on Windows since #12070:

AGC graphics: storage flush ordering, 2 images stored again in the open batch: the second store did not wait for the earlier store, which only a single image with a host import may skip

On this GPU the driver has one queue, so Windows direct host imports are compared instead of watched ([write-watch] Windows direct host imports use comparisons). When the restore dispatch refreshes the image, GuestMemory::ChangedBlocks reports the range as untracked and StorageTexture::awaitStoredSave syncs the recorder through the earlier write-back (Recorder::SyncThrough). The earlier store has finished before the second FlushPending runs, so that flush has nothing to wait for and the open serial does not change. The test only excuses compared imports through ComparedHostImportCovers, which always returns false on Windows.

The test now reads Recorder::PendingWriteOverlaps over the flushed range just before the second flush, and expects that flush to wait only while the earlier store is still pending, in RunStoredAgain and in RunStoredAloneAfterJoint. Where the earlier store is still pending (watched imports, Linux, macOS) the checks are unchanged. The check that the newer texels land over the earlier store is unchanged everywhere. No production code changes.

Tested

Windows 11 Home 10.0.26200, WinLibs GCC 15.2.0 r7, Release, BUILD_TESTING=ON, main ed957ca35c. ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer ctest --test-dir build -R '^agc_driver_storage_flush_ordering' -V, 3 runs each, rebuilding in between:

agc_driver_storage_flush_ordering agc_driver_storage_flush_ordering_no_import VUID- lines
main fails 3/3 (message above) passes 3/3 0
this PR passes 3/3 passes 3/3 0

Every log shows Insert instance layer "VK_LAYER_KHRONOS_validation" and none shows was not found but was requested. The wait in the restore dispatch was found by breaking on Recorder::Sync and Recorder::SyncThrough under gdb: the only sync between the two flushes is SyncThrough from StorageTexture::awaitStoredSave. To build main on Windows I applied #19899's _putenv_s change to UploadCacheReadOnlyFlush.cpp locally; it is not part of this PR.

Not tested on Linux, macOS or a GPU with a second queue, where the earlier store is still pending at the second flush and the expectations are the same as before.

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: Intel UHD Graphics (Raptor Lake, 8086:a7a8), Intel driver 101.7084, Windows 11
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5342322498 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/21741). Originally posted by [androidbaklava](https://github.com/androidbaklava) on 2026-11-16T18:04:55Z. --- ### What `agc_driver_storage_flush_ordering` fails on every run on an Intel UHD iGPU on Windows since #12070: ``` AGC graphics: storage flush ordering, 2 images stored again in the open batch: the second store did not wait for the earlier store, which only a single image with a host import may skip ``` On this GPU the driver has one queue, so Windows direct host imports are compared instead of watched (`[write-watch] Windows direct host imports use comparisons`). When the restore dispatch refreshes the image, `GuestMemory::ChangedBlocks` reports the range as untracked and `StorageTexture::awaitStoredSave` syncs the recorder through the earlier write-back (`Recorder::SyncThrough`). The earlier store has finished before the second `FlushPending` runs, so that flush has nothing to wait for and the open serial does not change. The test only excuses compared imports through `ComparedHostImportCovers`, which always returns `false` on Windows. The test now reads `Recorder::PendingWriteOverlaps` over the flushed range just before the second flush, and expects that flush to wait only while the earlier store is still pending, in `RunStoredAgain` and in `RunStoredAloneAfterJoint`. Where the earlier store is still pending (watched imports, Linux, macOS) the checks are unchanged. The check that the newer texels land over the earlier store is unchanged everywhere. No production code changes. ### Tested Windows 11 Home 10.0.26200, WinLibs GCC 15.2.0 r7, Release, `BUILD_TESTING=ON`, `main` `ed957ca35c`. `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer ctest --test-dir build -R '^agc_driver_storage_flush_ordering' -V`, 3 runs each, rebuilding in between: | | `agc_driver_storage_flush_ordering` | `agc_driver_storage_flush_ordering_no_import` | `VUID-` lines | |---|---|---|---| | `main` | fails 3/3 (message above) | passes 3/3 | 0 | | this PR | passes 3/3 | passes 3/3 | 0 | Every log shows `Insert instance layer "VK_LAYER_KHRONOS_validation"` and none shows `was not found but was requested`. The wait in the restore dispatch was found by breaking on `Recorder::Sync` and `Recorder::SyncThrough` under gdb: the only sync between the two flushes is `SyncThrough` from `StorageTexture::awaitStoredSave`. To build `main` on Windows I applied #19899's `_putenv_s` change to `UploadCacheReadOnlyFlush.cpp` locally; it is not part of this PR. Not tested on Linux, macOS or a GPU with a second queue, where the earlier store is still pending at the second flush and the expectations are the same as before. ### 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: Intel UHD Graphics (Raptor Lake, `8086:a7a8`), Intel driver 101.7084, Windows 11 - [x] AI-assisted: yes
MarcZX10 commented 2026-11-21 12:47:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T12:47:28Z.

Review: APPROVED


Reviewed — looks good

Nothing blocks this test-only change; the inspected code supports conditioning the wait assertion on whether overlapping writes remain pending.

What I ran

Reviewed head cc14d60ac4feebdfa26f2412e1a6d61373e77536. No commands or tests were run. Read the PR description, commits, manifest, diff, the complete changed test file, Recorder::PendingWriteOverlaps, and a related recorder test assertion.

Results

Check Result Note
Diff and changed test passed One test file reviewed
Targeted recorder behavior passed Pending query includes open and in-flight batches
Test execution not run PR-reported Windows results not independently reproduced

Findings

Blocking

None.

Non-blocking

None.

Not verified

The PR-reported Windows test runs were not independently run. Linux, macOS, and second-queue behavior were not tested in this review. No files were excluded by the provided manifest.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6005275620 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/21741#pullrequestreview-6005275620). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-21T12:47:28Z. **Review:** APPROVED --- # Reviewed — looks good Nothing blocks this test-only change; the inspected code supports conditioning the wait assertion on whether overlapping writes remain pending. ## What I ran Reviewed head `cc14d60ac4feebdfa26f2412e1a6d61373e77536`. No commands or tests were run. Read the PR description, commits, manifest, diff, the complete changed test file, `Recorder::PendingWriteOverlaps`, and a related recorder test assertion. ## Results | Check | Result | Note | |---|---|---| | Diff and changed test | passed | One test file reviewed | | Targeted recorder behavior | passed | Pending query includes open and in-flight batches | | Test execution | not run | PR-reported Windows results not independently reproduced | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified The PR-reported Windows test runs were not independently run. Linux, macOS, and second-queue behavior were not tested in this review. No files were excluded by the provided manifest. ## 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!21741
No description provided.