Skip to content

fix(agc): serialize builds of identical graphics pipelines - #11914

Open
Bram910 wants to merge 4 commits into
boykopovar:mainfrom
Bram910:fix/serialize-pipeline-cache-misses
Open

Bram910 wants to merge 4 commits into
boykopovar:mainfrom
Bram910:fix/serialize-pipeline-cache-misses

Conversation

@Bram910

@Bram910 Bram910 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

What

Concurrent misses for an identical graphics-pipeline key can currently compile the same pipeline or library part multiple times before discarding the raced result. Serialize builds for the same full key, recheck the resident entry after waiting, and release the build marker on Vulkan failures and C++ exceptions. Different keys and resident hits can continue independently. Retain the current LTO key and cache admission policies. A cache hit after waiting also returns its store hash, so the caller can memoize the pipeline for that draw shape.

Tested

Windows 11 Pro 10.0.26200, MinGW GCC 15.2, Release, same NVIDIA GeForce RTX 3080 and driver 610.47 (Windows 32.0.16.1047).

Built libSceAgcDriver, recorder/graphics/disk-cache/queue-failure test targets and this PR's added fixture target(s). Focused baseline at ca0e9557aab1d1496c2c317077dd258f2d16fbf8: 100% tests passed, 0 tests failed out of 22. This branch at da3ca94b1e64663ecbc799f7ddbeba072fbfaafd: 100% tests passed, 0 tests failed out of 32.

Both runs used ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, ANYPS5_GPU=NVIDIA, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, and VK_LAYER_PATH=C:\VulkanSDK\1.4.363.0\Bin:

ctest --test-dir build-win -R '^agc_pipeline_(cache|library|journal|store|queue_failure)|^agc_shader_disk_cache($|_long_paths$|_host_stderr$|_pack_ownership$)' -V

Neither verbose log reports a missing validation layer, skipped/unrun selected tests, or VUID- errors. Ten deterministic concurrency/failure/teardown fixture modes, repeated 20 times each (200 executions). Existing real-Vulkan library reuse, LTO, cache, teardown, store and journal tests also run.

python tools/check_conventions.py --base origin/main and git diff --check origin/main...HEAD pass. The project's pr_overlap.py comparison logic was run against open PRs using a public REST transport adapter because local gh is unauthenticated. Its report warns about older PRs that conflict with main; their shared-file diffs were inspected separately. No equivalent fix was found. Related overlapping files may still need integration rebases as those older branches are refreshed.

No full-project suite, Linux/macOS run or new title benchmark is claimed. This submission does not establish a GTA FPS or RAM reduction.

Related stale branches #5925, #7642, #9508 and #10193 change pipeline scheduling or descriptor handling; they do not provide the same per-key build ownership. CMake-only neighbors add different test targets.

Review follow-up (2026-11-03)

Integrated current main 4f41f4c375. Addressed the waited-hit storeHash issue reported by chitters2004 and oneandonlydean: the successful lookup after acquiring the per-key build mutex now sets *storeHash = hash, matching the other successful shared-cache return paths.

The existing concurrent store fixture now captures both threads' returned hashes and requires the waited hit's hash to be nonzero and equal to the builder's. With the new assertions and the previous implementation, agc_pipeline_store_builds_shared fails with a completed lookup did not return its store hash; with the fix it passes, including 10 repeated runs.

Windows 10.0.26200.9457, WinLibs GCC 15.2 Release, NVIDIA GeForce RTX 3080 / 610.47:

  • Main production implementation: 8/8 optimized-pipeline readback cases pass. Both Pipeline.cpp and PipelineLibrary.cpp were restored from main 4f41f4c375 for this baseline; the PR's test registration remained in the build tree.
  • Change: 18/18 pass: the same eight real-Vulkan readback cases and all ten store/library build-coordination fixture modes.
  • Both verbose runs used ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, ANYPS5_GPU=NVIDIA, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation and VK_LAYER_PATH=C:\VulkanSDK\1.4.363.0\Bin. Neither log contains a missing-requested-layer warning or a VUID- error.
  • check_conventions.py --base origin/main and git diff --check pass.
cmake --build build-win --target agc_driver_pipeline_optimized_readback_tests agc_pipeline_store_builds_tests agc_pipeline_library_builds_tests -j4
ctest --test-dir build-win -R '^agc_driver_pipeline_optimized_readback_|^agc_pipeline_(store|library)_builds_' -V
ctest --test-dir build-win -R '^agc_pipeline_store_builds_shared
<!-- 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)
- [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 <!-- #PR, or none -->
- [x] Fixes: none <!-- issue it closes as Fixes #N, or none -->
- [x] Unblocks: none <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none -->
- [x] GPUs tested: NVIDIA GeForce RTX 3080; NVIDIA driver 610.47 (32.0.16.1047); Windows 11 Pro 10.0.26200. <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a -->
- [x] AI-assisted: yes <!-- yes / no -->
 --repeat until-fail:10 --output-on-failure

No new full-suite, Linux, macOS or title-performance result is claimed for this push. The older validation below remains pinned to its original revisions.

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 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 3080; NVIDIA driver 610.47 (32.0.16.1047); Windows 11 Pro 10.0.26200.
  • AI-assisted: yes

@github-actions

github-actions Bot commented Oct 27, 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 28925 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp L1886, L1901-1905
PR 28934 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp L1886, L1901-1905
PR 28936 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp L1886, L1901-1905
PR 29032 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp L1886, L1901-1905
PR 29033 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp L1886, L1901-1905
PR 29058 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp L1886, L1901-1905
PR 29060 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp L1886, L1901-1905
PR 29085 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp L1886, L1901-1905
PR 29098 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp L1886, L1901-1905
PR 29110 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp L1886, L1901-1905
PR 29113 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp L1886, L1901-1905
PR 29115 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp L1886, L1901-1905
PR 29116 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp L1886, L1901-1905
PR 29117 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp L1886, L1901-1905

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 5609 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
PR 5925 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineLibrary.cpp
PR 7275 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
PR 7642 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineLibrary.cpp
PR 9356 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
PR 9387 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
PR 9508 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineLibrary.cpp
PR 10193 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineLibrary.cpp
PR 13928 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineLibrary.cpp
PR 13929 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineLibrary.cpp
PR 15548 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
PR 17022 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
PR 17611 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
PR 20518 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
PR 22424 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
PR 22439 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
PR 23811 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
PR 26084 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
PR 28142 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
PR 28229 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
PR 28470 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
PR 28487 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
PR 28488 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
PR 28586 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
PR 28590 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
PR 28668 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
PR 28673 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
PR 29042 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
PR 29066 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
PR 29067 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
PR 29076 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
PR 29084 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
PR 29087 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
PR 29089 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
PR 29095 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
PR 29101 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
PR 29103 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
PR 29104 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
PR 29105 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
PR 29106 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
PR 29107 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
PR 29118 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
PR 29119 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineLibrary.cpp
PR 29120 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineLibrary.cpp
PR 29121 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineLibrary.cpp
PR 29123 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineLibrary.cpp

@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 the per-key build coordination in both CachedPipeline and LinkPipelineFromLibraries. The key-specific mutex/set is acquired outside the global cache mutex; after waiting, each path rechecks the resident cache, and RAII clears its in-flight marker on Vulkan failures or exceptions. The library store tracks active builds so clear waits for them. The added synthetic tests cover shared keys, distinct keys, cache hits, failure/exception cleanup and clear-time waiting; the PR reports 32/32 focused Windows tests with validation enabled, and its Windows CI plus conventions/intake/labels/report checks pass. Linux product jobs were skipped by path policy; I did not run the GPU suite locally.

@github-actions github-actions Bot added build agc libSceAgc* labels Oct 27, 2026
@oneandonlydean oneandonlydean self-assigned this Oct 28, 2026
@TechLevelZero

Copy link
Copy Markdown
Contributor

❌ NVIDIA GPU test: failed

PR head da3ca94 merged onto main ba5b533 · tested 2026-10-29 16:17 UTC · 36 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,298 passed · 4 failed (0 new, 3 also fail on main, 1 unstable on main) · 39 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,341 of 2,891 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ❌ 1 new validation ID(s) vs main (904 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 46.7 s

New validation errors

This PR changes test files, so each test below was also run on main with only the PR's test changes applied; 0 there means the PR's other changes cause the error.

ID Test main ba5b533 main + this PR's test changes only PR PR, test re-run alone
VUID-vkCmdCopyBuffer-commonparent agc_driver_depth_clear_hle 0 0 6 6 (in 2 runs)
agc_driver_depth_clear_hle: new validation messages
VUID-vkCmdCopyBuffer-commonparent(ERROR / SPEC): msgNum: -1223163212 - Validation Error: [ VUID-vkCmdCopyBuffer-commonparent ] Object 0: handle = 0x7737400176e0, type = VK_OBJECT_TYPE_INSTANCE; | MessageID = 0xb71802b4 | vkCmdCopyBuffer(): srcBuffer (VkBuffer 0x3d900000003d9) was created, allocated or retrieved from VkDevice 0x5b9135bf8ca0[], but command is using (or its dispatchable parameter is associated with) VkDevice 0x77374016f1a0[]. The Vulkan spec states: Each of commandBuffer, dstBuffer, and srcBuffer must have been created, allocated, or retrieved from the same VkDevice (https://www.
VUID-vkCmdCopyBuffer-commonparent(ERROR / SPEC): msgNum: -1223163212 - Validation Error: [ VUID-vkCmdCopyBuffer-commonparent ] Object 0: handle = 0x7737400176e0, type = VK_OBJECT_TYPE_INSTANCE; | MessageID = 0xb71802b4 | vkCmdCopyBuffer(): dstBuffer (VkBuffer 0x3dd00000003dd) was created, allocated or retrieved from VkDevice 0x5b9135bf8ca0[], but command is using (or its dispatchable parameter is associated with) VkDevice 0x77374016f1a0[]. The Vulkan spec states: Each of commandBuffer, dstBuffer, and srcBuffer must have been created, allocated, or retrieved from the same VkDevice (https://www.
Unstable on main (1, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_submit_progress: failed in 3 of the last 5 main runs
Failing on main too (3, not counted against this PR)
agc_compute_pipeline_inspection
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_depth_clear_hle: SEGFAULT in the parallel run; also passed only on retry in 42 other runs in the last 7 days
Validated but not compared (10, not in the main baseline's validation pass)
agc_pipeline_library_builds_clear
agc_pipeline_library_builds_exception
agc_pipeline_library_builds_failure
agc_pipeline_library_builds_independent
agc_pipeline_library_builds_shared
agc_pipeline_store_builds_cached
agc_pipeline_store_builds_exception
agc_pipeline_store_builds_failure
agc_pipeline_store_builds_independent
agc_pipeline_store_builds_shared
Validation IDs already present on main (4 IDs in 439 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (439 tests): agc_compute_pipeline_replay, agc_driver, agc_driver_address_passes, agc_driver_address_passes_draw_transitions, agc_driver_address_passes_targets_split, agc_driver_alpha_to_coverage, agc_driver_array_layer_target_cpu, agc_driver_bc_block_copy, and 431 more
VUID-vkCmdCopyImage-srcImage-01548 (11 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_storage_dispatch, and 3 more
VUID-vkCmdCopyImage-srcImage-01551 (11 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_storage_dispatch, and 3 more
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (2 tests): agc_driver_prepared_exports, agc_driver_srgb8_color_target
Skipped (39)
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_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_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 platform
video_out_flip_labels: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SD
Reproduce
git fetch origin da3ca94b1e64663ecbc799f7ddbeba072fbfaafd ba5b5330b37724bca4b99f30faab504653635a04
git checkout ba5b5330b37724bca4b99f30faab504653635a04 && git merge --no-ff da3ca94b1e64663ecbc799f7ddbeba072fbfaafd
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
# the failing tests, on this merge and on main:
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc_driver_depth_clear_hle)$' --parallel 1 -V

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.

@chitters2004

Copy link
Copy Markdown
Contributor

This branch predates storeHash, so this shows up only once it merges with current main (the merge is clean, checked at da3ca94b1e). In the merged CachedPipeline, the hit after waiting on the key's build mutex returns without setting *storeHash:

build.lock = std::unique_lock(*build.mutex);
{
    std::lock_guard lock(store.mutex);
    bool collision = false;
    if (auto pipeline = lookup(collision)) {
        ++store.hits;
        ++store.totals.hits;
        return pipeline;
    }

The first hit path and the raced-insert path both set it. prepareDraw passes storeHash to rememberShape, which keeps the shape memo's pipeline only for a non-zero hash. A draw that waited for another thread's build of its key therefore doesn't remember its pipeline, and the next draw of that shape looks it up again. Rendering stays correct.

Fix: if (storeHash != nullptr) *storeHash = hash; before that return pipeline;.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 31, 2026
# Conflicts:
#	core/libs/prx/libSceAgcDriver/CMakeLists.txt
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Nov 1, 2026
@oneandonlydean

Copy link
Copy Markdown
Collaborator

For #11914 (head d64f2385ec): in CachedPipeline (libSceAgcDriver/Graphics/src/Pipeline.cpp, the lookup after build.lock is taken, ~line 1317) the hit returns without setting *storeHash, unlike the first-hit and raced-insert paths. A draw that waited on another thread's build then does not memoize its pipeline in rememberShape (rendering stays correct, repeated lookups). Please add if (storeHash != nullptr) *storeHash = hash; there (as chitters2004 suggested on 2026-10-30), with a test covering a waited hit if practical.

@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head d64f238 merged onto main e6f5730 · tested 2026-11-01 15:56 UTC · 25 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,491 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,542 of 3,148 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.4 s, ⚠️ agc_driver_graphics_maps_fallback 42.3 s, ⚠️ agc_driver_graphics 35.3 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 8 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 (10, not in the main baseline's validation pass)
agc_pipeline_library_builds_clear
agc_pipeline_library_builds_exception
agc_pipeline_library_builds_failure
agc_pipeline_library_builds_independent
agc_pipeline_library_builds_shared
agc_pipeline_store_builds_cached
agc_pipeline_store_builds_exception
agc_pipeline_store_builds_failure
agc_pipeline_store_builds_independent
agc_pipeline_store_builds_shared
Validation IDs already present on main (5 IDs in 484 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (484 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 476 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 d64f2385ec00db2e9d83248b9c72bd487563bebe e6f57307fa7f47165d7fc1bee945abdb2f6816e7
git checkout e6f57307fa7f47165d7fc1bee945abdb2f6816e7 && git merge --no-ff d64f2385ec00db2e9d83248b9c72bd487563bebe
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.

@XairRrR XairRrR 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 — approved

The per-key serialization of identical graphics-pipeline and library-part builds is correct. The new fixtures pass on the merged tree and fail with main's production files. The two automated flags (agc_map_gate_disjoint, one VUID) also reproduce with main's production files.

What I ran

Head 951b79acc77505d59e4c1c976312b3fff58e5bf7, main 4f41f4c375f5abb487dbd184fbc150f31994d762, merged tree 1acd9902125e6099293588bd55055d974c5960f6 (Debian 13 VM, GCC 14.2.0, Release, lavapipe / Mesa 26.1.6, LLVM 19).

git diff --check 4f41f4c375f5abb487dbd184fbc150f31994d762...951b79acc77505d59e4c1c976312b3fff58e5bf7
python3 tools/check_conventions.py --base 4f41f4c375f5abb487dbd184fbc150f31994d762
ctest --test-dir build -j8 --test-load 32 -R "^agc_pipeline_(store|library)_builds_|^agc_map_gate_disjoint$" --output-on-failure
ctest --test-dir build -R "^agc_map_gate_disjoint$" --repeat until-fail:20 --output-on-failure
ctest --test-dir build -j8 --test-load 32 -R "^agc_pipeline_(store|library)_builds_" --repeat until-fail:20
# negative control: Pipeline.cpp and PipelineLibrary.cpp restored from main
ninja -C build -j32 -l32 agc_driver_recorder_tests agc_pipeline_store_builds_tests agc_pipeline_library_builds_tests agc_driver_native_multisample_depth_tests
ctest --test-dir build -j8 --test-load 32 -R "^agc_pipeline_(store|library)_builds_" --output-on-failure
ctest --test-dir build -R "^agc_map_gate_disjoint$" --repeat until-fail:30
env VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer ctest --test-dir build -V -R "^agc_driver_native_depth_uniform_planes$"   # merged and main production files

Results

Check Result
git diff --check clean
check_conventions.py All conventions checks passed
Configure / build / libs (script) passed
New tests agc_pipeline_store_builds_* (5), agc_pipeline_library_builds_* (5) 10/10 pass; 20 repeats each under -j8 pass; each run ≤ 0.35 s
agc_map_gate_disjoint (script's only new failure) flaky: failed on the 2nd of 20 repeats on the merged tree, and on the 8th of 30 repeats with main's Pipeline.cpp/PipelineLibrary.cpp. It comes from main, not this PR
Validation: agc_driver_native_depth_uniform_planes new VUID-vkCmdDispatch-groupCountX-00386 (script, "test not run on main") 8 occurrences on the merged tree and the same 8 with main's production files; the layer loaded in both runs. It comes from main, not this PR
Other selected tests (script) 2117 passed; the 7 known failures also fail on main; 114 expected skips
agc_map_gate_disjoint failure (same output on the merged tree and with main's production files)
[libc] unhandled exception 'St13runtime_error' thrown from 0x564020783afe
Vulkan device: llvmpipe (LLVM 19.1.7, 256 bits)
host imports are compared
AGC graphics: (d) no watched block on other stripes

Negative control

I restored core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp and PipelineLibrary.cpp from main, kept the PR's tests and rebuilt. 7 of the 10 new tests failed:

Output
agc_pipeline_store_builds_shared / failure / exception: FAIL: lookup did not wait only for its own in-flight pipeline
agc_pipeline_library_builds_shared / failure / exception: FAIL: the same library part was compiled concurrently more than once
agc_pipeline_library_builds_clear: FAIL: clearing allowed duplicate part builds
30% tests passed, 7 tests failed out of 10

The 3 modes that still pass (store_builds_cached, store_builds_independent, library_builds_independent) check that unrelated work is not blocked, so they should pass on main too. I then restored the merged files and rebuilt; git status --porcelain is empty.

Findings

Blocking

None.

Non-blocking

  • The per-key build mutex is held across the journal append. build (see Pipeline.cpp#L1309-L1319) is destroyed only at function return. So threads waiting on the same key also wait for RecordGraphicsPipeline at Pipeline.cpp#L1382, even though the entry is already resident after the store insert. Rendering is still correct; this only adds latency for the waiter. Releasing build.lock once the insert block has finished would let waiters hit straight away.
  • The description is garbled. In the "Review follow-up" section, a copy of the checklist is pasted inside the text code block, which splits the --repeat until-fail:10 command line. The real checklist further down is complete (Depends on, Fixes, Unblocks, GPUs tested and AI-assisted are all filled in). Cosmetic only.

Code reading, for the record:

  • Lock order is always per-key mutex, then store.mutex. Waiters release store.mutex before taking the per-key mutex, and ~PipelineBuild takes store.mutex while the per-key lock is still held. There is no inversion.
  • use_count() == 1 is evaluated under store.mutex, the same mutex under which waiters get their shared_ptr. An expired weak_ptr is replaced through insert_or_assign.
  • In LinkPipelineFromLibraries, a thread holds a part marker only while it builds that part, and drops it before the next part. A waiting thread holds no marker, so cross-part waits cannot deadlock. PartBuild re-locks before erasing on both the Check throw and the exception path.
  • The waited-hit storeHash fix reported by chitters2004 and oneandonlydean is in Pipeline.cpp#L1320-L1328, and store_builds_shared checks it. I confirm that their finding is resolved.

Not verified

  • I had no hardware GPU, only lavapipe. The NVIDIA RTX 3080 results in the description and the NVIDIA CI comments are the author's and TechLevelZero's; I did not reproduce them. The new fixtures use stub Vulkan entry points, so they do not depend on the driver.
  • I did not run the full suite or any title. I did not measure throughput when several draw threads miss on the same key.
  • The VUID-vkCmdCopyBuffer-commonparent reported on agc_driver_depth_clear_hle in the first NVIDIA CI run, at the older head da3ca94, did not reappear in the later run at d64f238. I did not investigate it on lavapipe.

@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ AMD GPU test: passed

PR head 951b79a merged onto main 4f41f4c · tested 2026-11-03 11:36 UTC · 18 min

GPU AMD Radeon RX 6300 (RADV NAVI24), driver Mesa 25.2.8-0ubuntu0.24.04.4, Vulkan 1.4.318
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-42-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 2,756 passed · 10 failed (0 new, 8 also fail on main, 2 unstable on main) · 58 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,824 of 3,811 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 (942 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 120.3 s, ⚠️ public_headers 78.6 s, ⚠️ check_skips 34.8 s, ⚠️ agc_shader_sampler_limits 34.5 s
Unstable on main (2, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_pipeline_journal: failed in 7 of the last 9 main runs
agc_driver_store_over_untracked: failed in 1 of the last 9 main runs
Failing on main too (8, not counted against this PR)
agc_driver_image_table
agc_driver_native_depth_bda_clear
agc_driver_native_multisample_depth
agc_driver_submit_progress
agc_submit_progress
agc_submit_progress_no_timeline
guest_mmap_executable
guest_socket_options_multicast
Validated but not compared (10, not in the main baseline's validation pass)
agc_pipeline_library_builds_clear
agc_pipeline_library_builds_exception
agc_pipeline_library_builds_failure
agc_pipeline_library_builds_independent
agc_pipeline_library_builds_shared
agc_pipeline_store_builds_cached
agc_pipeline_store_builds_exception
agc_pipeline_store_builds_failure
agc_pipeline_store_builds_independent
agc_pipeline_store_builds_shared
Validation IDs already present on main (4 IDs in 516 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (516 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 508 more
VUID-vkCmdCopyImage-srcImage-01548 (8 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth, agc_driver_stencil_null_feedback, agc_driver_stencil_plane_memory
VUID-vkCmdCopyImage-srcImage-01551 (8 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth, agc_driver_stencil_null_feedback, agc_driver_stencil_plane_memory
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (1 test): agc_driver_srgb8_color_target
Skipped (58)
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_copied_writer_label_order: skipped, the device reports a minStorageBufferOffsetAlignment of 4, so the dispatch binds its record at +0x1004 in place and nothing is written back; the test needs an alignment above 4
agc_driver_float16_unused_nan_payloads: skipped, the device has no native f16 conversions with RTE rounding and kept f16 denormals
agc_driver_image_table_vouched_lookups: skipped, the device reports 4 of 4 host-imported pages written after a GPU read, so a watched imported table cannot be vouched for
agc_driver_linear_target_direct_write_completion: skipped, the device does not keep host imports write-watched, so no completion stamp over the target is tracked
agc_driver_ngg_vertex_wave_reduction: skipped, s3 describes a 32-lane wave only on 32-lane subgroups, and the device has 64 lanes
agc_driver_scattered_runs: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_sparse_dma_buf_import: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_unit_shadow: skipped, the device does not import watched host memory for unit shadows
agc_driver_unit_shadow_budget: skipped, the device does not import watched host memory for unit shadows
agc_host_import_sparse: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_idle_publish_wait: skipped, the device reports 4 of 4 host-imported pages written after a GPU read, so a forced watch of the import reads its submissions as CPU stores
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_shadowed_key_stores: skipped, the device imports no watched host memory under a unit shadow
agc_small_tiled_shadow_label: skipped, host imports are unavailable: the test block is not imported and watched
agc_storage_clear_hand_over: skipped, the device imports no watched host memory for the clear-key hand-over
agc_unit_shadow: skipped, the device does not import watched host memory for unit shadows
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: DisplayW
Reproduce
git fetch origin 951b79acc77505d59e4c1c976312b3fff58e5bf7 4f41f4c375f5abb487dbd184fbc150f31994d762
git checkout 4f41f4c375f5abb487dbd184fbc150f31994d762 && git merge --no-ff 951b79acc77505d59e4c1c976312b3fff58e5bf7
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 12 --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 16 --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 AMD machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs.

@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head 951b79a merged onto main 4f41f4c · tested 2026-11-03 12:04 UTC · 25 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,772 passed · 4 failed (0 new, 3 also fail on main, 1 unstable on main) · 48 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,824 of 3,811 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 (940 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 120.1 s
Unstable on main (1, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_pipeline_journal: failed in 4 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 (10, not in the main baseline's validation pass)
agc_pipeline_library_builds_clear
agc_pipeline_library_builds_exception
agc_pipeline_library_builds_failure
agc_pipeline_library_builds_independent
agc_pipeline_library_builds_shared
agc_pipeline_store_builds_cached
agc_pipeline_store_builds_exception
agc_pipeline_store_builds_failure
agc_pipeline_store_builds_independent
agc_pipeline_store_builds_shared
Validation IDs already present on main (4 IDs in 517 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (517 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 509 more
VUID-vkCmdCopyImage-srcImage-01548 (9 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, agc_driver_stencil_null_feedback, and 1 more
VUID-vkCmdCopyImage-srcImage-01551 (9 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, agc_driver_stencil_null_feedback, and 1 more
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (1 test): agc_driver_srgb8_color_target
Skipped (48)
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_driver_scattered_runs: skipped, host imports are unavailable: /dev/udmabuf is not accessible
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_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 co
Reproduce
git fetch origin 951b79acc77505d59e4c1c976312b3fff58e5bf7 4f41f4c375f5abb487dbd184fbc150f31994d762
git checkout 4f41f4c375f5abb487dbd184fbc150f31994d762 && git merge --no-ff 951b79acc77505d59e4c1c976312b3fff58e5bf7
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

Copy link
Copy Markdown
Collaborator

@Bram910 the build of this PR on current main fails at Pipeline.cpp:1414: store.builds.find(key) no longer compiles. Since #18863 the key in CachedPipeline is a std::span<const std::byte>, while builds is an unordered_map<std::vector<std::byte>, std::weak_ptr<std::mutex>, KeyHash> and that KeyHash is not transparent, so the heterogeneous lookup has no match.

Either make KeyHash and the key equality transparent (is_transparent, hashing and comparing a std::span<const std::byte>), or build a std::vector<std::byte> copy of the key for the find, insert_or_assign and erase calls. Once it builds on main I will test it again.

@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 — no blocking findings

Nothing blocks this change; the review points below are optional.

What I ran

Reviewed head 951b79acc77505d59e4c1c976312b3fff58e5bf7 using repo_read.py reader tools. I inspected the prepared description, commits, manifest and diff, and read all six changed repository files. No executable checks were run; test results in the PR description are author-reported.

Results

Check Result Note
Changed code review passed All six changed files read
Tests in this review not run No execution environment available
Author-reported tests not run Not independently verified

Findings

Blocking

None.

Non-blocking

None.

Not verified

The PR's reported test runs, build, conventions check, and diff check were not independently verified. review/files.json was not available through the reader; the manifest and file listing show six changed files, all included and read. No changed files were excluded in the manifest.

To get this to a good state

Nothing is required.

@ligmaSec ligmaSec left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The trial merge is clean. The new store and library fixtures cover same-key sharing, independence across keys, and retry after both a Vulkan failure and a C++ exception. Please retain the clear-versus-build fixture as well as the resident lookup control. Together they check that waiters are woken on failure and that clearing cannot destroy a part still being published. I have no paired Vulkan result for this head yet.

AI-assisted: yes.

This branch has not been deployed

No deployments
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.

7 participants