Skip to content

fix(agc): avoid CPU waits for GPU-ordered labels - #9445

Merged
oneandonlydean merged 4 commits into
boykopovar:mainfrom
Zenodeon:agc-resource-completion-label-waits
Nov 2, 2026
Merged

oneandonlydean merged 4 commits into
boykopovar:mainfrom
Zenodeon:agc-resource-completion-label-waits

Conversation

@Zenodeon

@Zenodeon Zenodeon commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

What

Both CompletePendingCpuWrites and VulkanDevice::FillBuffer combine a global count of pending host completions with PendingLabelIn over the accessed range. An unrelated host callback can therefore make an ordinary GPU-ordered label trigger SyncThrough, even though that label needs no CPU completion.

Use the existing CompletionLabelIn range query at both sites. Resource reads and fills still wait for overlapping CPU completion stores and copied writers, and queued labels retain conservative handling. GPU label stores remain ordered before the fill by the existing store flush and transfer barriers.

Add regressions for fresh and revalidated resource bindings and for uniform/patterned fills. The fill suite covers 16-byte and 4096-byte fills, 4/8/64/256-byte labels, labels crossing either fill boundary, disjoint labels, submitted batches, inline label runs and the in-place pattern-fill path. It checks that unrelated callbacks remain deferred, overlapping CPU labels finish before the fill, and completed bytes have the fill pattern. It also checks that overwritten labels are refused for later submissions with the optional late-label shortcut enabled, while earlier submission ordering remains intact. The seven fill test registrations exercise 324 scenarios.

agc_completion_label_wait is adapted from EagleBearerYS/AnyPS5@59fad38624, with contributor attribution preserved. The fresh/reused-binding regression remains.

Related: #9858 independently changes the same resource-consumer predicate. This PR retains its original resource fix and includes the equivalent fill-path correction and its regressions. Neither PR is a dependency. No FPS or frame-time improvement is claimed without a matched gameplay benchmark.

Tested

November 2 rebase: head 03f66fe05fa1c6b8cf3e47fbfef7f18750661bfa is based on main 0580e5c951a8d436af2976a3f86a980c798ef5c2. Resolved the recorder test-registration conflict by placing agc_completion_label_wait in upstream’s new tests/cmake/agc_driver_recorder_tests.cmake; retained all four topic commits and contributor attribution. Fresh Release focused targets built with GCC 15.2 and SPIR-V Tools. The same 10 focused fill/recorder/resource-label tests on Windows RTX 4070 pass 10/10 on the rebased candidate; pinned main with identical fixtures and counter instrumentation fails the 8 intended false-wait cases. Overlapping CPU completion labels and existing recorder classification pass on both. Required Vulkan and disabled shader cache were used, Khronos validation actually loaded, no missing-layer warnings, skips or VUID errors; every test completed within 30 seconds. Earlier wider-suite results below are historical, not fresh results for this rebased head. No gameplay or Linux rerun is claimed. Conventions against this upstream base and diff checks pass; the required stale fork origin/main comparison still reports inherited findings.

Rebased the combined branch onto upstream main b3b96098997751c89c32693ac67297f50f48a51d. The three commits retain the resource fix, attributed completion-wait regression and fill follow-up separately; candidate head is cdb2ff3f7426b588c6e09092272b59062fc43c2c.

Built complete patched Release libraries and 33 focused test executable targets with GCC 15.2, CMake/Ninja and bundled SPIR-V Tools on Windows 11 build 26200, Intel Core i7-13700 and NVIDIA GeForce RTX 4070 (12 GiB), driver 610.88.

Ran the same 48 focused tests sequentially on the same machine/GPU with a 30-second timeout per test:

Production code under test Result
Upstream main b3b96098997751c89c32693ac67297f50f48a51d, with this PR's regressions and registration overlaid 40/48 pass; eight intended false-wait regressions fail
Combined branch cdb2ff3f7426b588c6e09092272b59062fc43c2c 48/48 pass

For the main control, both changed production files were restored byte-for-byte from the pinned main commit. All remaining production files were already from that base. Both runs use identical test code, test names, environments and timeouts.

Main fails only agc_copied_direct_ordering, agc_completion_label_wait and the six fill cases for GPU labels/disjoint CPU labels. The positive overlapping CPU-label case passes on both main and the change. The combined branch passes all eight regressions and all existing focused tests.

Both runs set ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1 and VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, with verbose ctest. Khronos validation layer 1.4.335 actually loaded in both runs. Neither log contains was not found but was requested by env var VK_INSTANCE_LAYERS; neither contains a VUID- validation error. No tests skipped and every test completed in under 30 seconds.

The focused set covers resource binding/revalidation, CPU/GPU completion labels, uniform/patterned fills, stale-label lookups, copied/direct writers, pipelined fills and label waits, unimported-label ordering, host-import lifetime, BDA reads and shader-semantic regressions.

git diff --check and conventions against the pinned upstream base pass. The required python tools/check_conventions.py --base origin/main was also run: the fork's stale main causes 275 findings / 43 inherited errors; the isolated comparison against current upstream main passes.

Ran python tools/pr_overlap.py --branch codex/resource-fill-completion-labels --repo boykopovar/AnyPS5. The scan reported no confirmed collisions and 98 shared-file warnings from PRs that conflict with its base. Their topic patches were inspected for both changed predicates and the regression/test names. No duplicate fill-predicate change or fill regression was found. The independently verified parallel resource-predicate change in #9858 is disclosed above; the checker does not flag identical changes as a collision.

Gameplay, cross-title stability and matched main-versus-PR game performance measurements are not completed for this combined branch. These tests establish removal of the false waits and preservation of the tested ordering/results. Logs are retained locally; no performance or stability gain is claimed.

Counter assertion follow-up (db78f141cd5d620bd4b5be21a6fa489e91079849): the fill regression now directly checks that GPU-ordered labels leave the existing completion-label sync counter unchanged, disjoint CPU labels leave it unchanged, and overlapping CPU labels increment it exactly once. On the same Windows RTX 4070 setup with Vulkan validation loaded and shader caching disabled, all 9 focused fill/recorder tests pass; the same fixtures over pinned main b3b96098997751c89c32693ac67297f50f48a51d with counter instrumentation fail 7 intended false-wait cases, including the new counter assertions. The overlapping CPU-label and existing recorder classification tests pass on both. No missing validation layer, skips or VUID errors; each test finishes within 30 seconds. This follow-up does not repeat gameplay or Linux testing.

Checklist

  • Based on current main; no other open PR implements the same functions — exception: perf(agc): wait only for CPU-completion labels before direct consumers #9858 independently changes the resource-consumer predicate, disclosed above
  • 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 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 4070 (12 GiB), driver 610.88, Windows 11 build 26200
  • AI-assisted: yes

@Zenodeon
Zenodeon marked this pull request as ready for review October 21, 2026 22:25
@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 6185 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp L12683
PR 9508 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp L142
PR 10043 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp L3982
PR 10193 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp L142
PR 10668 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp L2769
PR 10867 core/libs/prx/libSceAgcDriver/CMakeLists.txt L912
PR 13928 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp L142
PR 13929 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp L142

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 1368 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 1395 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 1896 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 4040 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 4472 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 5021 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 5371 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5925 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6186 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
PR 6187 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6188 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6192 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6194 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6209 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6223 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6280 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6300 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6412 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6481 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6501 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6808 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6970 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6977 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 7048 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7223 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7275 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 7369 core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 7449 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 7457 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7464 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 7508 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7514 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7604 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7642 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
PR 7689 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 8004 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 8484 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 8592 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 8707 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 9012 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 9020 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 9248 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 9335 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 9356 core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 9387 core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 9432 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 9489 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 9592 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 9712 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 9852 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 9884 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 10069 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 10233 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 10256 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 10359 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 10442 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 10547 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 10757 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 10894 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 10920 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 11351 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 11483 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 11551 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 11901 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 12120 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 12323 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 12324 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 12575 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 12746 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 12828 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 13148 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 13262 core/libs/prx/libSceAgcDriver/CMakeLists.txt

@EagleBearerYS

Copy link
Copy Markdown
Contributor

A data point for this change. fable-void made the same change on his fork (18b3bcaed9 on wip/new-gpu-path; his recorder names the query LabelStoredAtCompletionIn) and measured it on his tree. In a 110 s title check, this call site's sync waited 21.8 s in 376 syncs, about 58 ms each and roughly once per frame, all under GuestBufferMemory::UploadFinish. That was 22 % of queue worker 0's samples. After the change, frame time went from 222 to 204 ms, and the sync was gone from the samples.

We had ported his fix to main, and it comes to exactly this line, so we won't open ours. Its test is in 59fad38624 on our fork, in case it's useful: agc_completion_label_wait (--completion-wait-only of the recorder tests) carries his two checks.

  • A GPU-stored label in range, whose batch's only pending action writes no memory, leaves the batch in flight.
  • A label stored behind a completion still makes the reader wait for its store.

On GitHub's Linux runner it fails ×3 with main's code ("a reader of a GPU-stored label waited for a batch whose only completion action writes no memory") and passes ×10 with the change (run).

@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.

The implementation narrows the wait predicate from any pending label to an actual completion label, and the regression proves that the unrelated callback remains deferred while the consumer gets the GPU-written value. The paired same-machine main/change run follows the repository’s required Vulkan-validation protocol: layer load is confirmed, no new VUID- errors are reported, and the complete 31-test focused set passes on the changed head. Good evidence.

The branch is still based on a6dcea927, while current main is 110a18ba01. I checked the intervening upstream history and found no commits to either changed file (ShaderResources.cpp or Recorder.cpp), so this appears isolated; please nevertheless update the branch and rerun the focused validation comparison plus conventions/overlap so the report/checklist is current. Hosted product jobs are skipped. I did not run local GPU tests.

@github-actions github-actions Bot added the agc libSceAgc* label Oct 22, 2026
@Zenodeon
Zenodeon force-pushed the agc-resource-completion-label-waits branch from a9209d9 to f7e0da2 Compare October 22, 2026 09:23
@Zenodeon

Copy link
Copy Markdown
Contributor Author

@MarcZX10 Rebased onto upstream main 7e2ba73e4c8c; the updated PR head is f7e0da24ca2e. The production predicate change is unchanged.

Added agc_completion_label_wait, adapted from EagleBearerYS's offered regression with co-author credit. It checks both the already GPU-stored label plus host-only callback case and the CPU completion label that must still make its reader wait. The original fresh/revalidated-binding coverage remains. The new test uses independent registration to avoid conflicts with other test additions.

Reran the same 32 focused tests on Windows 11 build 26200, NVIDIA RTX 4070, driver 610.88:

Production code Result
Main 7e2ba73e4c8c, with the regressions overlaid 30/32 pass; only agc_copied_direct_ordering and agc_completion_label_wait fail at their intended false-wait assertions
Updated PR 32/32 pass

Both runs used ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1 and VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation with verbose ctest. Khronos validation 1.4.335 loaded in both; no missing-layer warnings, zero VUID- errors, no skips, and every test finished within 30 seconds.

Conventions against upstream pass, and GitHub's conventions check passed on the published head. The required origin/main comparison was also rerun; its stale fork base still includes 43 inherited errors, documented in the PR. The overlap scan completed with no confirmed collisions; its 49 shared-file warnings were reviewed for duplicate changes.

The description and checklist now contain the refreshed commits, test set and results. Hosted product jobs remain skipped; these GPU results are from the local matched runs. Ready for another review.

@tibzejoker

Copy link
Copy Markdown
Contributor

Two notes from GTA V (PPSA04264), Windows, RTX 4090 / i9-13900K. These come from reading the code. I have not run this head yet.

  1. perf: GTA V Story, queue 0 spends a third of its time waiting for GPU writes it reads while preparing dispatches #5694 (our issue) was measured on the older main d8888df. The waits there went through FlushForAccess (ShaderMemory::page -> GuestMemory::Read) and StorageTexture::compareUntracked, not through CompletePendingCpuWrites. So, as MarcZX10 says, this PR should not move those numbers. I will rerun that scene on current main, with and without f7e0da2, and post both aps5-summary.jsonl lines on perf: GTA V Story, queue 0 spends a third of its time waiting for GPU writes it reads while preparing dispatches #5694.

  2. There is a sibling site with the same pattern: VulkanDevice::WriteLabelOnGpu, the GPU fill path (line 2451 on eb8dcfe). When PendingCompletionLabels() != 0, it syncs if PendingLabelIn(address, bytes). Its comment says the concern is "a label the CPU will store after a completion", which is what CompletionLabelIn answers. An ordinary GPU label in the filled range is already ordered before the fill on the GPU. One open question: does that sync also keep the label table right, so a later lookup does not return the label value after the fill has overwritten it? If not, the same change could be a follow-up, not part of this PR. The [fill-sync] line (APS5_PROFILE_DRAW=1) already counts these syncs ("with a completion label pending"), so a title can show whether this matters before anyone changes it.

Also checked: CompletionLabelIn skips wideLabelInLocked, unlike PendingLabelIn. That looks fine, because wide labels only come from NoteLabel (GPU stores), never from AfterCompletions.

AI-assisted: yes (Claude Code)

@ycbuzi

ycbuzi commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

A run of this head on Windows with an AMD device, and with a second NVIDIA generation.

Windows 11 Home 10.0.26200, WinLibs GCC 15.2.0 r7 (MinGW-w64 UCRT), Release. cdb2ff3f74 merged onto main 0119103fa9 with no conflicts, and the build has no warnings. One GPU at a time with ANYPS5_GPU, plus ANYPS5_REQUIRE_VULKAN=1 and ANYPS5_NO_SHADER_CACHE=1, run with ctest -V --repeat until-fail:2. Each log's Selected GPU line names the device in its row.

The set has 26 tests:

  • the PR's eight: agc_completion_label_wait, agc_copied_direct_ordering and the six agc_driver_fill_completion_labels_* cases;
  • the existing label and fill tests: agc_recorder_completion_labels; agc_driver_alias_copy_label; copied_writer_label_order (and _drain); finisher_label_order, same_queue_label_wait, unimported_label_order and pipelined_predicated_label_order (each with _draw_pipeline); pipelined_fill (and _draw_pipeline); and the constant, pattern, memory-value and pattern-buffer fills.
device result
GeForce RTX 4070 SUPER (0x2783, Ada), NVIDIA 616.92 26 of 26 pass, both runs
GeForce GTX 1650 SUPER (0x2187, Turing), NVIDIA 616.92 26 of 26 pass, both runs
AMD Radeon(TM) Graphics (1002:164e, RDNA2 iGPU, subgroup=64), AMD 32.0.21030.2001 24 pass, both runs. agc_driver_copied_writer_label_order and its _drain variant skip through that test's own device check, which this PR doesn't change.

Negative control on the RTX 4070 SUPER and on the Radeon: Execution/src/VulkanDevice.cpp and Graphics/src/ShaderResources.cpp taken from main, with the tests unchanged. 7 of the 8 PR tests fail on both devices, with messages such as a reader of a GPU-stored label waited for a batch whose only completion action writes no memory and an unrelated completion forced a CPU wait for a GPU-ordered label. agc_driver_fill_completion_labels_cpu_overlap passes, as the description says for the overlapping CPU-label case.

Not run: the validation layer, Linux, a title.

AI-assisted: yes (Claude Code)

@blawesom

Copy link
Copy Markdown
Contributor

Static review plus an independent Linux/AMD run on both trees per the repo AGENTS AGC protocol (CachyOS, kernel 7.2.10, GCC 16.2.1, Ninja 1.13.2, Release, BUILD_TESTING=ON, Ryzen 7 9800X3D). No findings.

What I checked (static)

  • The sync predicate in VulkanDevice::FillBuffer and CompletePendingCpuWrites (ShaderResources.cpp) narrows from PendingLabelIn to CompletionLabelIn — matching the invariant the comment already states ("a label the CPU will store after a completion must not be overwritten"), since a GPU-ordered label is safe to fill across (it will be rewritten by the GPU ordering, not by the CPU's store-after-completion). Two sites updated consistently, pendingCompletionLabels count check unchanged.
  • The new fixture matrix is all branches of the new predicate: --cpu-overlap (must wait), --cpu-disjoint (must not), --submitted, --inline (APS5_LABEL_RUNS_INLINE=1), --chain (APS5_FILL_CHAIN=1), --late (APS5_LABEL_TRUST_LATE=1). agc_completion_label_wait exercises the recorder-side classification (PendingLabelIn(...)&& !CompletionLabelIn(...)), matching how Recording.cpp guards it.
  • Pinned regression class is real: an unrelated completion previously forced a CPU wait around a GPU-only label (!CompletePendingCpuWrites(...) asserted across both the reuse and rebuild cached-shader path) — that blocking behavior is exactly the "CPU waits for GPU-ordered labels" the title describes.

Focused paired run (VVL env)

tree agc_completion_label_wait agc_driver_fill_completion_labels* (8) total VUID- missing-layer
this head cdb2ff3f74 Passed (0.01s) 8/8 Passed (~0.03s ea) 9/9 0 0
main bb04a4f1ea Passed (0.01s) 7 fixtures are New on this PR — only agc_recorder_completion_labels pre-exists and Passed 1/1 0 0

The 8 agc_driver_fill_completion_labels* fixtures are registered new in this PR (per its CMakeLists.txt diff) at base; the paired classname agc_recorder_completion_labels from Recorder.cpp covers the same classification logic and passes on both. Comparing logs, no new validation errors from this change.

Not covered

Every branch of CompletionLabelIn's distinction from PendingLabelIn is pinned by the new fixtures; what isn't nailed down explicitly is the reverse (that a GPU-ordered label in the fill range still avoids a needless wait is asserted only via CompletePendingCpuWrites returning false, not via the fill path's labelSynced counter staying put). Would be a one-line assertion if you want it nailed.

@TechLevelZero

TechLevelZero commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head cdb2ff3 merged onto main 98ddd9c · tested 2026-10-30 12:00 UTC · 29 min

GPU NVIDIA RTX 2000 Ada Generation, driver 595.99.02, Vulkan 1.4.329
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-38-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 2,372 passed · 5 failed (0 new, 2 also fail on main, 3 unstable on main) · 41 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Test selection 2,418 of 2,987 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ✅ no new validation IDs vs main (911 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_bda_device 71.0 s
Intermittent validation messages (1, seen once in the parallel run, not reproduced when the test was re-run alone 2 times; not counted against this PR)
agc_driver_depth_clear_hle: VUID-vkCmdCopyBuffer-commonparent (6x)
Unstable on main (3, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_depth_clear_hle: failed in 1 of the last 8 main runs
agc_submit_progress: failed in 5 of the last 8 main runs
agc_submit_progress_no_timeline: failed in 6 of the last 8 main runs
Failing on main too (2, not counted against this PR)
guest_mmap_executable
guest_socket_options_multicast
Passed on retry (1, failed in the parallel run, passed when re-run with a 360 s timeout; not counted against this PR)
agc_driver_job_manager_compute_capacity: Failed in the parallel run; also passed only on retry in 98 other runs in the last 7 days
Validated but not compared (7, not in the main baseline's validation pass)
agc_completion_label_wait
agc_driver_fill_completion_labels_chain
agc_driver_fill_completion_labels_cpu_disjoint
agc_driver_fill_completion_labels_cpu_overlap
agc_driver_fill_completion_labels_inline
agc_driver_fill_completion_labels_late
agc_driver_fill_completion_labels_submitted
Validation IDs already present on main (4 IDs in 425 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (425 tests): agc_compute_pipeline_replay, agc_driver, agc_driver_address_passes_draw_transitions, agc_driver_address_passes_targets_split, agc_driver_array_layer_target_cpu, agc_driver_bda_span_reads, agc_driver_bda_span_reads_draw_pipeline, agc_driver_bitfield_mask, and 417 more
VUID-vkCmdCopyImage-srcImage-01548 (13 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_cpu_write_after_memo, agc_driver_depth_plane_cpu_write_after_page_unwatch, agc_driver_depth_plane_cpu_write_after_partial_unwatch, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_partial_store_unimported, agc_driver_depth_plane_sampling, and 5 more
VUID-vkCmdCopyImage-srcImage-01551 (13 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_cpu_write_after_memo, agc_driver_depth_plane_cpu_write_after_page_unwatch, agc_driver_depth_plane_cpu_write_after_partial_unwatch, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_partial_store_unimported, agc_driver_depth_plane_sampling, and 5 more
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (2 tests): agc_driver_prepared_exports, agc_driver_srgb8_color_target
Skipped (41)
agc_driver_bda_reads_shadowed_results: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_bda_reads_shadowed_results_per_build: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_msaa_dcc_compared_import_2: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_msaa_dcc_compared_import_4: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_msaa_dcc_compared_import_8: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_sample_order_grid_reference: skipped, the device does not keep depth drawn at custom sample locations at those locations, even after a transition that names them: the composite of uniform renders holds the guest's depth in 0 of 3005 sloped samples, so no path can be compared with it bit for bit
agc_driver_sparse_dma_buf_import: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_stencil_ref_export: skipped, the device lacks VK_EXT_shader_stencil_export
agc_driver_vertex_elected_atomic_max: skipped, the device runs vertex programs in subgroups, so they keep their cross-lane reductions
agc_host_import_sparse: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_import_settle_initial_dcc: skipped, the device has no deferred settle of host imports: imports under 1 MiB wait for one only on Windows
agc_unit_shadow_completion_store: skipped, the device reports watched host memory written when it imports or reads it
guest_http_uri_locale: 
guest_net_ctl: skipped, the host has no IPv4 address
guest_video_out_color_space: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_hdr: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_high_frame_rate: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_output_mode: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_resolution_status: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_wqhd_detection: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
video_out_flip_controls: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip_in_order: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_aftergpu: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_main: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_fresh: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or plat
Reproduce
git fetch origin cdb2ff3f7426b588c6e09092272b59062fc43c2c 98ddd9c1792bbab016ceed5db267a93d1d61f00a
git checkout 98ddd9c1792bbab016ceed5db267a93d1d61f00a && git merge --no-ff cdb2ff3f7426b588c6e09092272b59062fc43c2c
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
VK_DRIVER_FILES=/nonexistent/icd.json ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 32 --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 4 --output-on-failure
# failures are then re-run alone: --timeout 360 --parallel 2; new validation IDs: the test alone, twice, --parallel 1

Automated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs.

@Zenodeon

Copy link
Copy Markdown
Contributor Author

Added in db78f14: direct fill-wait counter assertions for GPU labels and overlapping/disjoint CPU completion labels.

9/9 focused tests pass on RTX 4070 with Vulkan validation; pinned main fails the 7 intended false-wait cases, including the new assertions. No VUID errors or skips. Thanks for the suggestion.

@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head db78f14 merged onto main 98ddd9c · tested 2026-10-30 13:46 UTC · 26 min

GPU NVIDIA RTX 2000 Ada Generation, driver 595.99.02, Vulkan 1.4.329
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-38-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 2,373 passed · 4 failed (0 new, 2 also fail on main, 2 unstable on main) · 41 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Test selection 2,418 of 2,987 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ✅ no new validation IDs vs main (911 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) none
Unstable on main (2, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_submit_progress: failed in 5 of the last 8 main runs
agc_submit_progress_no_timeline: failed in 6 of the last 8 main runs
Failing on main too (2, not counted against this PR)
guest_mmap_executable
guest_socket_options_multicast
Validated but not compared (7, not in the main baseline's validation pass)
agc_completion_label_wait
agc_driver_fill_completion_labels_chain
agc_driver_fill_completion_labels_cpu_disjoint
agc_driver_fill_completion_labels_cpu_overlap
agc_driver_fill_completion_labels_inline
agc_driver_fill_completion_labels_late
agc_driver_fill_completion_labels_submitted
Validation IDs already present on main (4 IDs in 425 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (425 tests): agc_compute_pipeline_replay, agc_driver, agc_driver_address_passes_draw_transitions, agc_driver_address_passes_targets_split, agc_driver_array_layer_target_cpu, agc_driver_bda_span_reads, agc_driver_bda_span_reads_draw_pipeline, agc_driver_bitfield_mask, and 417 more
VUID-vkCmdCopyImage-srcImage-01548 (13 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_cpu_write_after_memo, agc_driver_depth_plane_cpu_write_after_page_unwatch, agc_driver_depth_plane_cpu_write_after_partial_unwatch, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_partial_store_unimported, agc_driver_depth_plane_sampling, and 5 more
VUID-vkCmdCopyImage-srcImage-01551 (13 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_cpu_write_after_memo, agc_driver_depth_plane_cpu_write_after_page_unwatch, agc_driver_depth_plane_cpu_write_after_partial_unwatch, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_partial_store_unimported, agc_driver_depth_plane_sampling, and 5 more
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (2 tests): agc_driver_prepared_exports, agc_driver_srgb8_color_target
Skipped (41)
agc_driver_bda_reads_shadowed_results: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_bda_reads_shadowed_results_per_build: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_msaa_dcc_compared_import_2: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_msaa_dcc_compared_import_4: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_msaa_dcc_compared_import_8: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_sample_order_grid_reference: skipped, the device does not keep depth drawn at custom sample locations at those locations, even after a transition that names them: the composite of uniform renders holds the guest's depth in 0 of 3005 sloped samples, so no path can be compared with it bit for bit
agc_driver_sparse_dma_buf_import: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_stencil_ref_export: skipped, the device lacks VK_EXT_shader_stencil_export
agc_driver_vertex_elected_atomic_max: skipped, the device runs vertex programs in subgroups, so they keep their cross-lane reductions
agc_host_import_sparse: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_import_settle_initial_dcc: skipped, the device has no deferred settle of host imports: imports under 1 MiB wait for one only on Windows
agc_unit_shadow_completion_store: skipped, the device reports watched host memory written when it imports or reads it
guest_http_uri_locale: 
guest_net_ctl: skipped, the host has no IPv4 address
guest_video_out_color_space: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_hdr: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_high_frame_rate: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_output_mode: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_resolution_status: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_wqhd_detection: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
video_out_flip_controls: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip_in_order: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_aftergpu: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_main: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_fresh: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or plat
Reproduce
git fetch origin db78f141cd5d620bd4b5be21a6fa489e91079849 98ddd9c1792bbab016ceed5db267a93d1d61f00a
git checkout 98ddd9c1792bbab016ceed5db267a93d1d61f00a && git merge --no-ff db78f141cd5d620bd4b5be21a6fa489e91079849
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
VK_DRIVER_FILES=/nonexistent/icd.json ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 32 --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 4 --output-on-failure
# failures are then re-run alone: --timeout 360 --parallel 2; new validation IDs: the test alone, twice, --parallel 1

Automated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs.

@bunbeans2-arch

Copy link
Copy Markdown
Contributor

An AMD RDNA 4 run on Windows of db78f141cd, since the GPUs tested are NVIDIA.

Windows 11 Pro 10.0.22631, AMD Radeon RX 9070 XT (1002:7550, driver 32.0.32015.7029, amdvlk64), MSYS2 UCRT64 g++ 16.1.0, Release. ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation; with VK_LOADER_DEBUG=layer the loader logs Insert instance layer "VK_LAYER_KHRONOS_validation" in every run of every test below that creates a Vulkan instance. This head merged onto main f7f03daf52, 3 runs:

  • agc_driver_fill_completion_labels, _cpu_disjoint, _cpu_overlap and _submitted pass 3 of 3, each with fill completion label tests passed.
  • No VUID- line.

AI-assisted: yes (Claude Code)

@blawesom

blawesom commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

GPU test run at current head db78f141cd (fix(agc): avoid CPU waits for GPU-ordered labels) on AMD Radeon RX 9070 XT (RADV GFX1201), Vulkan 1.4.354 / Mesa 26.2.4, CachyOS. Env: ANYP5S_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 — correction: the env var used was ANYP5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1. Supersedes my earlier RADV run at prior head cdb2ff3f.

Head db78f14 (3 runs each, all Passed):

Test Run 1 Run 2 Run 3
agc_completion_label_wait (#330) Passed Passed Passed
agc_driver_fill_completion_labels (#598, base) Passed Passed Passed
agc_driver_fill_completion_labels_cpu_overlap (#1193) Passed Passed Passed
agc_driver_fill_completion_labels_cpu_disjoint (#1194) Passed Passed Passed
agc_driver_fill_completion_labels_submitted (#1195) Passed Passed Passed
agc_driver_fill_completion_labels_inline (#1196) Passed Passed Passed
agc_driver_fill_completion_labels_chain (#1197) Passed Passed Passed
agc_driver_fill_completion_labels_late (#1198) Passed Passed Passed

Device evidence line printed by the tests: Vulkan device: AMD Radeon RX 9070 XT (RADV GFX1201).

Baseline main cd087bd12c (build-gpu, 2 runs each, all Passed): the agc_driver_fill_completion_labels* suite and agc_completion_label_wait are new tests introduced by this PR (no such ctest entries exist on main at cd087bd12c — confirmed via ctest -N), so no direct head-vs-main comparison is possible for them. As adjacent coverage on main I ran the existing label-related tests that main has: agc_recorder_completion_labels (#905) and agc_driver_same_queue_label_wait (#1448) — Passed in 2/2 runs each.

Limitation: no Vulkan validation layer is available on this machine, so no VUID comparison is possible; runs are functional-only.

python3 tools/check_conventions.py --base origin/main at head: all conventions checks passed.

@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.

Re-checked — new head, looks good

The new counter assertions and focused reruns address the remaining review request, and the current upstream base has no intervening changes to the reviewed implementation or tests.

At head db78f141cd5d620bd4b5be21a6fa489e91079849 against current base 8948f1cec5b2a43f5da47ee2e581449acc3a02ca, the no-build precheck passed diff, conventions, and live mergeability; the hosted Windows job passed on this exact head. The author reports three passing runs of the focused tests on an AMD RX 9070 XT and reports paired Windows RTX 4070 baseline/change tests on the prior functional head; intervening upstream commits from tested base b3b96098997751c89c32693ac67297f50f48a51d do not change any reviewed implementation or test files. I did not run a local build or GPU tests; Linux hosted CI was skipped, and the AMD run did not have a Vulkan validation layer available.

Zenodeon and others added 4 commits November 2, 2026 02:19
Use the existing completion-store range query when deciding whether resource acquisition needs a CPU write-back wait. An unrelated pending host completion must not turn an ordinary GPU label into a CPU dependency. This applies the distinction already used in CopyBuffer by merged PR boykopovar#4496.

Cover fresh and cached direct consumers with an unrelated host completion, exact GPU output and deferred completion execution. The focused regression fails with the broad label query and passes with the completion-store query on an RTX 4070 under Vulkan validation. No gameplay speed claim.
Adapt the completion wait regression offered in EagleBearerYS/AnyPS5@59fad38. Keep the host callback state alive if an assertion unwinds before recorder teardown.

Co-authored-by: Yunus Shaikh <75296019+EagleBearerYS@users.noreply.github.com>
@Zenodeon
Zenodeon force-pushed the agc-resource-completion-label-waits branch from db78f14 to 03f66fe Compare November 1, 2026 22:29
@Zenodeon

Zenodeon commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto main 0580e5c951 at 03f66fe05f. Resolved the CMake conflict using upstream’s recorder-test fragment; all regressions remain registered.

Fresh RTX 4070 validation: 10/10 focused tests pass; matched main fails the 8 expected false-wait cases. No VUID errors or skips. Earlier wider-suite results remain historical.

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Nov 1, 2026
@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head 03f66fe merged onto main 0dbf9fb · tested 2026-11-02 01:56 UTC · 35 min

GPU NVIDIA RTX 2000 Ada Generation, driver 595.99.02, Vulkan 1.4.329
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-38-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 2,506 passed · 6 failed (0 new, 3 also fail on main, 3 unstable on main) · 45 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Test selection 2,557 of 3,164 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ✅ no new validation IDs vs main (941 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 120.2 s, ⚠️ agc_driver_graphics_maps_fallback 35.3 s, ⚠️ agc_driver_graphics 34.8 s
Unstable on main (3, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_pipeline_journal: failed in 1 of the last 10 main runs
agc_submit_progress: failed in 6 of the last 10 main runs
agc_submit_progress_no_timeline: failed in 7 of the last 10 main runs
Failing on main too (3, not counted against this PR)
agc_driver_image_table
guest_mmap_executable
guest_socket_options_multicast
Validated but not compared (8, not in the main baseline's validation pass)
agc_completion_label_wait
agc_driver_fill_completion_labels
agc_driver_fill_completion_labels_chain
agc_driver_fill_completion_labels_cpu_disjoint
agc_driver_fill_completion_labels_cpu_overlap
agc_driver_fill_completion_labels_inline
agc_driver_fill_completion_labels_late
agc_driver_fill_completion_labels_submitted
Validation IDs already present on main (5 IDs in 483 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (483 tests): agc_driver, agc_driver_address_passes, agc_driver_alias_copy_label, agc_driver_alpha_to_coverage, agc_driver_array_layer_target, agc_driver_bc_block_copy, agc_driver_bda_anchor_reads, agc_driver_bda_span_reads, and 475 more
VUID-vkCmdCopyImage-srcImage-01548 (7 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_sampling, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-vkCmdCopyImage-srcImage-01551 (7 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_sampling, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (1 test): agc_driver_prepared_exports
VUID-VkShaderModuleCreateInfo-pCode-08737 (1 test): agc_driver_image_sample_derivatives
Skipped (45)
agc_driver_bda_reads_shadowed_results: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_bda_reads_shadowed_results_per_build: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_sample_order_grid_reference: skipped, the device does not keep depth drawn at custom sample locations at those locations, even after a transition that names them: the composite of uniform renders holds the guest's depth in 0 of 3005 sloped samples, so no path can be compared with it bit for bit
agc_host_import_sparse: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_import_settle_initial_dcc: skipped, the device has no deferred settle of host imports: imports under 1 MiB wait for one only on Windows
agc_unit_shadow_completion_store: skipped, the device reports watched host memory written when it imports or reads it
guest_http_uri_locale: 
guest_net_ctl: skipped, the host has no IPv4 address
guest_video_out_color_space: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_hdr: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_high_frame_rate: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_output_mode: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_resolution_status: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_wqhd_detection: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
video_out_flip_aftergpu: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_backtoback: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_controls: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip_in_order: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_dcc: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_deferred: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_aftergpu: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_main: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_fps_limit: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_o
Reproduce
git fetch origin 03f66fe05fa1c6b8cf3e47fbfef7f18750661bfa 0dbf9fb7d2d3a16859a0b3bb7b8b86bc93bea9ef
git checkout 0dbf9fb7d2d3a16859a0b3bb7b8b86bc93bea9ef && git merge --no-ff 03f66fe05fa1c6b8cf3e47fbfef7f18750661bfa
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
VK_DRIVER_FILES=/nonexistent/icd.json ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 32 --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 4 --output-on-failure
# failures are then re-run alone: --timeout 360 --parallel 2; new validation IDs: the test alone, twice, --parallel 1

Automated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs.

@oneandonlydean
oneandonlydean merged commit 1fe1531 into boykopovar:main Nov 2, 2026
12 of 13 checks passed
oneandonlydean added a commit to Meh7an/AnyPS5 that referenced this pull request Nov 2, 2026
main renamed the fill-sync counter labelSynced to fillCompletionSyncs (boykopovar#9445). The [fill-sync] profile line keeps this branch's elided-fill fields and uses the new name.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants