Skip to content

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

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
androidbaklava:fix/agc-storage-flush-ordering-settled-store
Nov 27, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
androidbaklava:fix/agc-storage-flush-ordering-settled-store

Conversation

@androidbaklava

Copy link
Copy Markdown
Contributor

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

@github-actions github-actions Bot added the agc libSceAgc* label Nov 16, 2026
@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

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 7642 core/libs/prx/libSceAgcDriver/tests/execution/StorageFlushOrdering.cpp
PR 9508 core/libs/prx/libSceAgcDriver/tests/execution/StorageFlushOrdering.cpp
PR 10193 core/libs/prx/libSceAgcDriver/tests/execution/StorageFlushOrdering.cpp
PR 13863 core/libs/prx/libSceAgcDriver/tests/execution/StorageFlushOrdering.cpp
PR 13920 core/libs/prx/libSceAgcDriver/tests/execution/StorageFlushOrdering.cpp
PR 13928 core/libs/prx/libSceAgcDriver/tests/execution/StorageFlushOrdering.cpp
PR 13929 core/libs/prx/libSceAgcDriver/tests/execution/StorageFlushOrdering.cpp

@rafaconvaitis

rafaconvaitis commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Windows + NVIDIA run (AMD run added below), for a GPU the description lists as not tested. Head cc14d60ac4 merged alone onto main 6286d36449 with git merge --no-ff (clean merge).

Setup: Windows 11 25H2 (build 26200), NVIDIA GeForce RTX 3050 6 GB (10de:2584), driver 610.88, WinLibs GCC 15.2.0 r7 UCRT, Release, BUILD_TESTING=ON, Khronos validation layer 1.4.363 (LunarG SDK 1.4.363.1). Only the focused test targets were built; the other execution tests were left out with ANYPS5_AGC_EXECUTION_TESTS. UploadCacheReadOnlyFlush was among the tests left out, so the _putenv_s change of #19899 was not needed to build main.

ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer, ctest -R '^(agc_driver_storage_flush_ordering|agc_driver_storage_flush_ordering_no_import)$' -V -j 1, 3 runs per side.

agc_driver_storage_flush_ordering agc_driver_storage_flush_ordering_no_import VUID- lines
main passes 3/3 passes 3/3 0
this PR passes 3/3 passes 3/3 0
  • On this GPU the test logs [write-watch] host imports of write-watched memory keep the write watch: yes, not Windows direct host imports use comparisons, and main already passes, unlike on the Intel UHD. So this is a no-regression data point for the relaxed check on a watched-import device, not a reproduction of the failure.
  • Every run logs Insert instance layer "VK_LAYER_KHRONOS_validation" and none logs was not found but was requested.

Update, same day: AMD run added. Same head, same main, same commands and 3 runs per side, on the second GPU of this machine, selected with ANYPS5_GPU=Radeon: AMD Radeon 760M integrated graphics (1002:15bf, Vulkan device name Radeon 5), AMD Software 26.11.2 (driver 32.0.32029.2010, Vulkan 1.4.359), Windows 11 25H2 (build 26200).

Radeon 760M agc_driver_storage_flush_ordering agc_driver_storage_flush_ordering_no_import VUID- lines
main passes 3/3 passes 3/3 0
this PR passes 3/3 passes 3/3 0
  • This GPU also logs [write-watch] host imports of write-watched memory keep the write watch: yes and main already passes, so it is another no-regression data point on a watched-import device, not a reproduction of the Intel UHD failure.
  • Every run logs Selected GPU name=Radeon 5 vendor=0x1002 device=0x15bf and Insert instance layer "VK_LAYER_KHRONOS_validation", and none logs was not found but was requested.

AI-assisted: yes (build and runs scripted with an AI assistant, on the hardware above).

@Colewiz7

Copy link
Copy Markdown
Contributor

Head cc14d60ac4 merged onto main f15df3256c as 1a3de61b93, no conflict. Linux 7.3.4, GCC 16.2.1 Release, Mesa 26.2.6 RADV, RX 7900 XT (gfx1100) and 7800X3D iGPU (gfx1036).

No new failures and no new validation messages on either GPU.

RX 7900 XT iGPU
full suite (6145 tests), new failures vs main none none
-R '^agc' (1936 tests) with the layer, new failures vs main none none
VUID- / SYNC-HAZARD lines 0 / 0 0 / 0

Layer runs used VK_LAYER_KHRONOS_validation 1.4.363.1 with VK_LOADER_DEBUG=layer and ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1; the loader inserted the layer in every run, and the validation message set matches main. agc_driver_host_write_shadowed_unit fails solo on main at the same commit too, so it comes from this machine, not the PR.

AI-assisted: yes

@domx4q

domx4q commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Ran the focused tests with the Khronos validation layer on Linux and an NVIDIA GPU, since CI runs the GPU tests only on lavapipe and the NVIDIA run in the comments is on Windows.

Setup: Arch Linux (kernel 7.3.4), GCC 16.2.1, Release, NVIDIA GeForce RTX 4090 (vendor 0x10de, device 0x2684, Ada), proprietary driver 620.70.06, Vulkan 1.4.357, Khronos validation layer 1.4.363.1. Head cc14d60ac4 merged onto main fbaae8a79d with --no-ff (clean, as 138a09e668). Main baseline is a Release build of fbaae8a79d on the same machine.

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
main fbaae8a79d this PR
Result 2 of 2 passed 2 of 2 passed
Insert instance layer "VK_LAYER_KHRONOS_validation" 2 2
was not found but was requested by env var VK_INSTANCE_LAYERS 0 0
VUID- none none

Test-only change. Both tests already pass on main here: the device reports imported ranges stay watched, not the compared host imports of the Intel/Windows case in the description, so the failure the PR fixes does not reproduce on this machine and this run cannot show the fix. It shows that the changed test still passes on Ada and adds no validation messages. Every device selected the RTX 4090. No negative control (test-only).

No new VUID- errors; both focused tests pass on Ada.

AI-assisted: yes (Claude Code)

@kiwe147

kiwe147 commented Nov 21, 2026

Copy link
Copy Markdown

Tested head cc14d60ac4, applied with git apply on main fd4aeed483 together with the other 29 PRs of one batch (#24470, #24601, #17439, #17546, #21117, #21261, #21995, #22067, #22398, #23111, #23346, #23864, #24377, #24475, #24556, #14106, #14109, #19966, #20050, #20161, #20622, #21237, #22215, #22764, #22884, #22938, #23745, #24399, #24460). All applied without conflicts and the whole tree built.

Setup: Windows 11 Pro 10.0.26200, Ryzen 7 9800X3D, WinLibs GCC 15.2.0 r7, Release, BUILD_TESTING=ON. GPUs: NVIDIA GeForce RTX 3080 (driver 621.24) and the AMD Radeon iGPU of the CPU (gfx1036, driver 32.0.21036.18). No validation layer. iGPU run: ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 ANYPS5_GPU="AMD Radeon", agc_/video tests only.

tests RTX 3080 iGPU
agc_driver_storage_flush_ordering, agc_driver_storage_flush_ordering_no_import, agc_storage_flush_wait_mip_chain (3 tests, matched by name to the test file this PR changes) all pass all pass

Whole batch: the full ctest -j 12 (6525 tests) on the RTX 3080 has 5 failing tests; the 4 that also fail on main fd4aeed483 are agc_driver_stencil_plane_memory, agc_driver_msaa_dcc_unwatch, agc_storage_write_back_host_retile, and pr_overlap_names, which needs a newer Python than my 3.10. Traced to other PRs of the batch, each by reverting it and testing again: #21117 (guest_pad); none is in this PR's area. The 2125 agc_/video tests on the iGPU have 1 failing: agc_driver_stencil_plane_memory (agc_driver_stencil_plane_memory also fails on main).

This is one combined tree, not a run of this PR alone.

AI-assisted: yes (Claude Code)

This was referenced Nov 21, 2026

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc*

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants