Skip to content

refactor(agc): split prepareDraw's read-only plan from its record-time work - #14051

Open
vingelvatten wants to merge 1 commit into
boykopovar:mainfrom
vingelvatten:refactor/agc-draw-prepare-stages
Open

vingelvatten wants to merge 1 commit into
boykopovar:mainfrom
vingelvatten:refactor/agc-draw-prepare-stages

Conversation

@vingelvatten

@vingelvatten vingelvatten commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

What

Step 2 of the draw-side series in #7895 (the outline of 21 October, endorsed by @oneandonlydean): make the read-only part of prepareDraw explicit and movable, still on the committer and still in the same order relative to every record-time effect.

Piece Function What it holds or does
plan planDraw → DrawPlan the draw's validation and its nothing-to-draw early outs, the fragment outputs and pipeline stages (CachedFragmentOutputs, PipelineStages), the mesh group count and limits, the tessellation patch check, the viewport, depth-bounds and sample-mask checks, the vertex input layout, and the resource-cache key (DrawResourceKey). It reads the state, the draw parameters and the compiled stages only: no guest memory, no recorder, no registry, nothing another draw left behind. It does touch three memoizations, each synchronized and order-insensitive: CachedFragmentOutputs (its own mutex, the memo of validated outputs), VertexInputCache::TryGet (its own mutex; a lookup can move an LRU entry, insert, evict or set a bypass bit) and the resource-key memo DrawResourceKey publishes on the program (atomic, idempotent). A plan built on any thread, in any order, gets the same values from them; what they change is cache state, never the plan's output.
inputs prepareDrawInputs what must stay at record time: the index range and multisample-target checks, the occlusion-sampling check, the index and vertex captures (in-place binds, copies, snapshot keeps, restart compaction), the vertex fetch plan (it needs the highest index of the captured bytes) and the copies. It starts from the plan's fields, so DrawInputs and everything downstream (recordDraw, recordDrawCommands, the recipe path) are unchanged.
resources resolveDrawResources as before, with the key taken from the plan instead of built in place; cacheable is still decided here because it needs recordable, which needs the resident targets.

prepareDraw builds the plan right after the timer starts (after BoundKeptBytes, as #8992 arranged) and then runs the same sequence as today. DrawWithRecipe builds the plan from the recipe's fragment outputs, stages and vertex layout as prepareDrawInputs did for it before. drawTessellationGeometry is untouched: each of its two draws gets its own plan through Draw.

What changes in behaviour, deliberately:

  • A draw that fails one of the plan's checks now throws before its index and vertex capture and before the target loop, instead of after some of them. The checks and their messages are the same.
  • The vertex input layout is looked up before the index capture instead of after it, so a draw whose index capture finds nothing to draw still touches the layout cache once.
  • DrawResourceKey is built for every draw whose stages allow a cache key, not only for recordable ones (a synchronous draw used to skip it). The key is idempotent on the program and cheap; cacheable still gates the cache lookup.
  • Phase accounting: validation is still charged to validate, the layout to vertex and the key build to lookup (DrawTimer::charge moves the key's time out of the phase it would otherwise land in), so [draws] and APS5_TRACE_DRAWS keep their meaning.

Debug aid: APS5_VERIFY_DRAW_PLAN=1 (off by default) builds the plan a second time at the end of prepareDraw, after every record-time effect, and requires it to equal the plan the draw used (the content of the layout, the key and the scalar fields; not the memo hit flags, which a second lookup may legitimately change). It is a consistency check that the plan reads nothing the record-time work changes; it is not a thread-safety proof, and it does not cover the three memoizations' internal state (the LRU position or a bypass bit), which the plan's output does not depend on. The draw-pipeline test set gets _plan_verify variants with that switch on top of the pipelined settings.

No speed claim: the plan is a small share of the committer (the validate and pipeline phases together are a few percent at Astro Bot's Crash Site). The point is the seam: step 3 and the preparer thread on feat/agc-draw-prepare-ahead can take planDraw as the work that leaves the committer, and the adopt-time check sits where prepareDrawInputs begins.

Tested

Windows 11 Pro 26300, Ryzen 7 7800X3D, 31 GB; WinLibs GCC 15.2.0 r7, Release, BUILD_TESTING=ON. Based on main d1ae628 (3 November; rebased twice: on 1 November after #12862 split the test registrations and #13894 changed the mesh group limit, on 3 November after #14857 moved the Graphics.Draw trace marks into prepareDrawInputs); head 4aa5f51. The validate trace mark now sits in prepareDrawInputs after the three checks that stay there, so the slice still covers all of a draw's validation; index_upload and vertex_upload are where #14857 put them. The main arm of every comparison is a build of that same commit from a second worktree, so the two trees differ only by this change.

  • NVIDIA RTX 4070 Ti SUPER (617.42), focused draw tests (agc_driver_.*(draw|stencil|indirect|multisample|msaa|target|pass|pipelined|finisher|recipe|plan_verify)|^agc_driver_graphics) with ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation: main 175 tests, 100% passed, 4 skipped (agc_driver_msaa_dcc_compared_import_{2,4,8}, agc_driver_stencil_ref_export); branch 197 tests (the same 175 plus the 22 _plan_verify variants), 100% passed, the same 4 skipped. Neither log has was not found but was requested by env var VK_INSTANCE_LAYERS; both hold the same 4 lines of VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 from agc_driver_srgb8_color_target_tests; no new VUID.

  • AMD Radeon Graphics (Ryzen 7 7800X3D iGPU, RDNA2 gfx1036, AMD driver 32.0.21045.16010 / 2.0.353), same set and switches: main 175 tests, 100% passed, 4 skipped (agc_driver_msaa_dcc_compared_import_{2,4,8}, agc_driver_mesh_draw_relocation); branch 197 tests, 100% passed, the same 4 skipped. 0 layer-missing lines; both logs hold the same 6 lines of the sRGB8 blend VUID; no new VUID.

  • lavapipe (llvmpipe, LLVM 21.1.8, Mesa 25.x, WSL Ubuntu 26.04 x86-64), same focused set and switches, ctest -j 4: main 176 tests, 100% passed, 6 skipped; branch 198 tests, 100% passed, the same 6 skipped ( agc_driver_msaa_dcc_{srgb_clear,clear,compared_import}_2, agc_driver_linear_target_direct_write_completion, agc_driver_mesh_draw_relocation, agc_driver_sample_order_recipe_depth_locations). 0 layer-missing lines; both logs hold the same 6 lines of the sRGB8 blend VUID; no new VUID.

  • ASTRO BOT PPSA21567 01.018.000, app.exe -lvl hub_crashsite, no input, warm shader cache, APS5_HOST_IMPORT_MIB=13312 (without it the title aborts about 110 s in on this machine with a pinned guest allocation, see fix(libc): wait only for imports over the freed span #12157), APS5_PROFILE_DRAW=1 APS5_TRACE_SUMMARY_EVERY=10, guest 3840x2160 in a 2226x1252 window, RTX 4070 Ti SUPER, one title on the GPU. Two run folders that differ only in libs/: main ab6f5d3 and this head. Three alternated pairs in the order main, branch, branch, main, main, branch, 200 s each, the last eight 10 s windows of each run averaged. The first run (main) is discarded: the new main build has a new shader-cache key, so that run compiled pipelines for its whole 200 s and never left the menus (371 presents per 10 s, 89k commits at 4.5 ms); the five later runs are steady.

    arm runs presents per 10 s [draw] pipelined commits per 10 s µs per commit committer busy room wait per draw
    main ab6f5d3 2 (77.1, 75.8) 76.4 244k 32.94 80.4 % 3.9 µs
    this PR e2d277a 3 (76.6, 78.0, 77.1) 77.3 245k 32.83 80.5 % 3.8 µs

    Three earlier pair sets on the previous base (main 73f4f7e, heads before the rebase) gave 74.4 vs 75.1, 74.0 vs 73.0 and 74.5 vs 74.3 presents per 10 s, so the branch lands on both sides of main: run-to-run noise. The [draws] phase totals per 10 s are the same on both arms for vertex (899 vs 903 ms), lookup (1474 vs 1473 ms), pipeline (135 vs 128 ms) and record (988 vs 974 ms). validate reads 109 ms on main and 135 ms on the branch: the difference is the three extra steady_clock::now() reads per draw that DrawTimer::charge and the second PhaseValidate mark cost under APS5_PROFILE_DRAW (about 0.1 µs at 245k draws per 10 s); without the switch the plan reads no clock at all.

  • python tools/check_conventions.py --base origin/main: all checks passed.

  • python tools/env_reference.py --check: 0 undocumented (the stale APS5_PAD_SPEAKER_FALLBACK_DB row is main's)

Checklist

Overlap

#10678 (perf(agc): build a pipelined draw's resource-cache key before it reaches the committer) adds a contentKey parameter through Draw and resolveDrawResources. With this PR the key lives in DrawPlan. Proposed order, asked of its author on #10678: this PR lands first, because it is a refactor with no behaviour change and it gives the early key a home; #10678 then shrinks to passing the finisher's key into planDraw and taking it when KeyForDevice matches (about ten lines instead of its current plumbing). If #10678 lands first instead, this PR rebases: planDraw takes the given key when KeyForDevice matches and builds it otherwise. johandavidcm's feat/agc-draw-prepare-ahead (not a PR yet) prepares the fragment outputs, stages, vertex layout and set layouts on a preparer thread; with this PR that work is planDraw.

🤖 Generated with Claude Code

@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 — changes requested

The checklist leaves this PR's overlap with open #10678 at Depends on: none, and neither PR's discussion records an agreed landing order.

What I ran

Reviewed head aa0880e4ebc0b1a705118028eb68fa93d69fd7a8. GitHub reports base 474030e58424fefdb65e5df9f3820810fbb4553c; I also checked the merge preview against the newer live main tip 0f302813cebfc09e3e0b6f8fced15262d186879e, which merged cleanly. Environment: Debian 12, Linux 6.1, Python 3.11.2, GCC 12.2.0. No local build or C++ tests were run.

python3 tools/pr_precheck.py --base upstream/main --head aa0880e4ebc0b1a705118028eb68fa93d69fd7a8 --title "refactor(agc): split prepareDraw's read-only plan from its record-time work" --body-file /tmp/anyps5-14051-review-current/pr-body.md --output-dir /tmp/anyps5-14051-review-final --no-negative-controls
git merge-tree --write-tree upstream/main aa0880e4ebc0b1a705118028eb68fa93d69fd7a8
gh run view 41222879876 -R boykopovar/AnyPS5 --job 124600944041 --log
grep -c 'plan_verify.*\*\*\*Skipped' /tmp/ci-14051-windows.log

Results

Check Result
Diff whitespace (git diff --check) Passed against live main 0f302813cebfc09e3e0b6f8fced15262d186879e
Repository conventions and PR template Passed against live main
Merge preview Clean against live main; preview tree 4678f46d088f119e2d4da4131c8f24e070d70972
Hosted Windows build and CTest Passed: 0 failed of 2,545 listed; all 22 new _plan_verify variants were skipped
Precheck's optional ABI/test-quality helpers Unavailable in the extracted PR tree; no exports or Python tests changed, so these do not indicate a PR defect
Unedited check output
All conventions checks passed.

4678f46d088f119e2d4da4131c8f24e070d70972
windows	Build and run changed guest core/libs tests	2026-10-31T17:16:14.2462242Z 100% tests passed, 0 tests failed out of 2545
22
/usr/bin/python3: can't open file '/tmp/anyps5-14051-review-latest-main/head-aa0880e4ebc0-37cc6df8/tools/pr_abi_audit.py': [Errno 2] No such file or directory
/usr/bin/python3: can't open file '/tmp/anyps5-14051-review-latest-main/head-aa0880e4ebc0-37cc6df8/tools/pr_test_quality.py': [Errno 2] No such file or directory

Findings

Blocking

  • Coordinate the shared implementation order with #10678. This PR moves the DrawResourceKey construction into planDraw and passes it through resolveDrawResources; #10678 changes that same resource-resolution path to accept a finisher-built contentKey. The PR body itself says whichever lands second must rebase, but its checklist says Depends on: none, and I found no agreement with #10678's author in either PR's discussion. The repository requires authors of overlapping PRs to agree which lands first and declare the dependency. Please agree on the order, then update the later PR's Depends on entry accordingly.

Non-blocking

  • Clarify the “read-only plan” contract. planDraw calls VertexInputCache::TryGet. That call can move an LRU entry, insert or evict cache entries, or set a bypass bit; the cache mutex protects those updates, so this is not by itself evidence of a data race. However, the description says the plan uses “no shared cache,” and the repeat-plan verifier compares plan outputs without checking those cache mutations. Please describe this synchronized cache interaction in the plan contract and verifier rationale, or move the cache operation outside the read-only stage if that property is required for the preparer boundary.

Sources

Not verified

  • The hosted Windows job skipped the 22 new _plan_verify variants; Linux and specialized hosted jobs were skipped. I did not reproduce the author-reported RTX 4070 Ti SUPER, RDNA2 iGPU, or lavapipe runs.
  • No local C++ build, CTest, console run, or preparer-thread execution was performed.

To get this to a good state

Please agree with the #10678 author on landing order and update the dependency checklist on the later PR. Please also clarify the cache interaction in the plan contract. I will rerun the same checks on the updated head.

@TechLevelZero

TechLevelZero commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head aa0880e merged onto main 73f4f7e · tested 2026-10-31 20:23 UTC · 22 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,451 passed · 4 failed (0 new, 4 also fail on main) · 50 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,505 of 3,072 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 (945 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_bda_device 56.6 s, ⚠️ agc_driver_graphics_maps_fallback 31.1 s, ⚠️ agc_driver_graphics 30.3 s
Failing on main too (4, not counted against this PR)
agc_submit_progress
agc_submit_progress_no_timeline
guest_mmap_executable
guest_socket_options_multicast
Validated but not compared (22, not in the main baseline's validation pass)
agc_driver_bda_span_reads_plan_verify
agc_driver_buffer_load_store_plan_verify
agc_driver_copied_writer_copy_plan_verify
agc_driver_depth_storage_reuse_plan_verify
agc_driver_draw_cache_relocation_plan_verify
agc_driver_draw_cache_reuse_plan_verify
agc_driver_draw_data_hit_user_words_plan_verify
agc_driver_draw_unsupported_buffer_type_plan_verify
agc_driver_draw_write_ranges_plan_verify
agc_driver_finisher_label_order_plan_verify
agc_driver_gated_dispatch_capture_plan_verify
agc_driver_image_table_reuse_plan_verify
agc_driver_pipelined_dma_plan_verify
agc_driver_pipelined_fill_plan_verify
agc_driver_pipelined_metadata_pass_plan_verify
agc_driver_pipelined_predicated_label_order_plan_verify
agc_driver_pipelined_predication_read_plan_verify
agc_driver_same_queue_label_wait_plan_verify
agc_driver_staged_clear_sampled_read_plan_verify
agc_driver_storage_write_back_overhang_plan_verify
agc_driver_unimported_label_order_plan_verify
agc_driver_write_data_written_ahead_plan_verify
Validation IDs already present on main (4 IDs in 428 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (428 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_alias_copy_label, agc_driver_alpha_to_coverage, agc_driver_array_layer_target, and 420 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 (1 test): agc_driver_srgb8_color_target
Skipped (50)
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_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 pla
Reproduce
git fetch origin aa0880e4ebc0b1a705118028eb68fa93d69fd7a8 73f4f7e06e4f210a8c6570e335fd654dc0a86134
git checkout 73f4f7e06e4f210a8c6570e335fd654dc0a86134 && git merge --no-ff aa0880e4ebc0b1a705118028eb68fa93d69fd7a8
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.

@github-actions

github-actions Bot commented Oct 31, 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 9248 docs/dev/ENVIRONMENT.md L497
PR 9508 core/libs/prx/libSceAgcDriver/CMakeLists.txt L615
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp L1722-1729, L1885
PR 10678 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp L1871, L1887, L3076
PR 13021 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp L3076
PR 13023 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp L3076
PR 13858 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp L1870-1871, L1885
PR 14857 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp L1469-1470, L1549, L2938-2939, L3808

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/Graphics/src/Draw.cpp
PR 1395 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 1896 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/ENVIRONMENT.md
PR 4472 docs/dev/ENVIRONMENT.md
PR 5021 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5371 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5609 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 5925 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 6186 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/ENVIRONMENT.md
PR 6187 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6188 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 6192 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6209 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6280 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6412 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6481 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6808 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6924 docs/dev/ENVIRONMENT.md
PR 7085 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 7223 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7256 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 7275 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 7449 docs/dev/ENVIRONMENT.md
PR 7457 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/ENVIRONMENT.md
PR 7508 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7514 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/ENVIRONMENT.md
PR 7604 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/ENVIRONMENT.md
PR 7642 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/ENVIRONMENT.md
PR 7668 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 7689 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 8004 docs/dev/ENVIRONMENT.md
PR 8246 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/ENVIRONMENT.md
PR 8484 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/ENVIRONMENT.md
PR 8592 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 8707 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 9012 docs/dev/ENVIRONMENT.md
PR 9020 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 9335 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 9345 docs/dev/ENVIRONMENT.md
PR 9356 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/ENVIRONMENT.md
PR 9387 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/ENVIRONMENT.md
PR 9712 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/ENVIRONMENT.md
PR 9748 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 9852 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/ENVIRONMENT.md
PR 9884 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 9897 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 9898 docs/dev/ENVIRONMENT.md
PR 9915 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 10193 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/ENVIRONMENT.md
PR 10233 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 10359 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 10442 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/ENVIRONMENT.md
PR 10757 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/ENVIRONMENT.md
PR 10867 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 10894 docs/dev/ENVIRONMENT.md
PR 10920 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 11351 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/ENVIRONMENT.md
PR 11435 docs/dev/ENVIRONMENT.md
PR 11436 docs/dev/ENVIRONMENT.md
PR 11452 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 11825 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 12120 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/ENVIRONMENT.md
PR 12125 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 12323 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/ENVIRONMENT.md
PR 12324 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/ENVIRONMENT.md
PR 12544 docs/dev/ENVIRONMENT.md
PR 12567 docs/dev/ENVIRONMENT.md
PR 12746 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/ENVIRONMENT.md
PR 12828 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 12863 docs/dev/ENVIRONMENT.md
PR 12921 docs/dev/ENVIRONMENT.md
PR 12930 docs/dev/ENVIRONMENT.md
PR 12970 docs/dev/ENVIRONMENT.md
PR 13148 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 13262 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 13646 docs/dev/ENVIRONMENT.md
PR 13707 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/ENVIRONMENT.md
PR 13863 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/ENVIRONMENT.md
PR 13920 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/ENVIRONMENT.md
PR 13928 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/ENVIRONMENT.md
PR 13929 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/ENVIRONMENT.md
PR 14032 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 14262 docs/dev/ENVIRONMENT.md
PR 14264 docs/dev/ENVIRONMENT.md
PR 14299 docs/dev/ENVIRONMENT.md
PR 14344 docs/dev/ENVIRONMENT.md
PR 14943 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/ENVIRONMENT.md
PR 14944 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 15059 docs/dev/ENVIRONMENT.md

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 31, 2026
@janzezno

Copy link
Copy Markdown
Contributor

@vingelvatten heads-up: #12862 split the AGC test registrations into tests/cmake/<executable>.cmake fragments, so this PR now conflicts in core/libs/prx/libSceAgcDriver/CMakeLists.txt. Most PRs can fix that by running python3 tools/agc_test_split.py resolve during the stopped rebase, but this one can't: it stops with more than one draw pipeline loop.

The reason is that the split removed the agcDrawPipelineTests list. Each draw-pipeline executable now calls agc_add_draw_pipeline_test from its own fragment, so a second foreach over that list has nothing to loop over. The _plan_verify mode belongs inside the function instead, next to _draw_pipeline:

function(agc_add_draw_pipeline_test agcTestName)
    add_test(NAME ${agcTestName}_draw_pipeline COMMAND ${agcTestName}_tests)
    set_tests_properties(${agcTestName}_draw_pipeline PROPERTIES ENVIRONMENT "ANYPS5_NO_SHADER_CACHE=1;APS5_DRAW_PIPELINE=1;APS5_PIPELINED_DRAWS=32;APS5_PIPELINE_DISPATCH=1" SKIP_RETURN_CODE 77 WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")
    if(WIN32)
        set_tests_properties(${agcTestName}_draw_pipeline PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$<TARGET_FILE_DIR:libc>")
    endif()
    add_test(NAME ${agcTestName}_plan_verify COMMAND ${agcTestName}_tests)
    set_tests_properties(${agcTestName}_plan_verify PROPERTIES ENVIRONMENT "ANYPS5_NO_SHADER_CACHE=1;APS5_DRAW_PIPELINE=1;APS5_PIPELINED_DRAWS=32;APS5_PIPELINE_DISPATCH=1;APS5_VERIFY_DRAW_PLAN=1" SKIP_RETURN_CODE 77 WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")
    if(WIN32)
        set_tests_properties(${agcTestName}_plan_verify PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$<TARGET_FILE_DIR:libc>")
    endif()
endfunction()

So during the rebase, keep main's side of the CMakeLists.txt conflict, drop your foreach, and add the five _plan_verify lines to the function. I checked this on main 0836dfd: it registers the same 22 _plan_verify tests as your head aa0880e does on its base, with identical commands and properties in ctest --show-only=json-v1.

Sorry the tool's error message doesn't point you to this.

chitters2004 pushed a commit to chitters2004/AnyPS5 that referenced this pull request Nov 1, 2026
…and main

Merge johandavidcm's feat/agc-draw-prepare-ahead (4c1af4f, with boykopovar#10678)
for the Windows A/B measurement. The prepared-ahead fragment outputs,
stages and vertex layout and the early resource key feed planDraw. An
adopted pipeline takes precedence over main's shape memo. Main's shape
parameter is kept ahead of contentKey and ahead in every Draw signature.
The pipelined summary keeps main's separate read-range field.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011mLh2dBi2gkidDMAs7CY9u
chitters2004 pushed a commit to chitters2004/AnyPS5 that referenced this pull request Nov 1, 2026
…rison

Fold the boykopovar#7895 thread digest, the boykopovar#14051 review state, the Amdahl and
shared-state analysis, both merges, the exit crash fix and the lavapipe
test comparison against main dc9dc7e into one report.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011mLh2dBi2gkidDMAs7CY9u
@SleglJan

SleglJan commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

@vingelvatten Main-menu A/B of this PR on 007 First Light, on an NVIDIA discrete GPU under Linux, as a second title next to your Crash Site pairs. Each series was declared before its own runs. I stopped the first by hand after five runs, when a validity rule (the desktop's GPU memory, below) had left too few valid PR runs for three pairs; it decides nothing under the declaration, and its per-run FPS are below for the record. The second was declared after that stop, with the first's per-run figures already recorded. All six of its runs are valid: the PR's mean FPS is 0.9821 of main's (range ends 0.9621 and 1.0001) and its mean frame p50 1.0149 of main's (0.9913 and 1.0437) (details below). The declaration fixed what is reported (each run, the ranges, the ratio of the means and of the range ends), not a faster/slower rule.

Setup

  • Builds: main 73f4f7e (this PR's merge-base) and the PR head aa0880e, each from its own worktree, both Release, GCC 16.2.1, ANYPS5_ENABLE_SPIRV_TOOLS=OFF. Both have the same shader-cache source version, so one seed serves both: made on main by a run from an empty shader cache through the menu and the Resume into gameplay (that seed run alone had APS5_PROFILE_DRAW=1 and APS5_TRACE_SUMMARY_EVERY=60), with the NVIDIA driver cache (carried over from an earlier main's seed) frozen with it. Every run starts warm from it: the recompiler cache's first [shader-disk-cache] (10 s) line reads 2,195 hits, 0 misses on all six runs, and each whole run 2,201 hits, 0 misses.
  • RTX 3080 10 GB, NVIDIA 615.78.08, Linux 7.2 (CachyOS), Ryzen 9 7950X3D. Output 3840x2160 (the summary line's resolution). The same GPU drives the GNOME desktop; the title's window goes through Xwayland (SDL_VIDEODRIVER=x11).
  • The title's two feedback-wait limits widened in its executable as described in 007 First Light (PPSA11386): the terrain crash after Resume is a stale read of a GPU feedback buffer past the title's own wait limits #6172 (local only, both sides), scripted pad input, no APS5_PROFILE_* switch, trace window 180 s from 1,320 s after the title's first present (APS5_TRACE_SECONDS=1320:180, APS5_TRACE_EVENTS=2097152, and APS5_TRACE_DIR, which only names the directory the trace and summary files are written to), the menu held from its arrival to the end of the run, main's defaults otherwise (APS5_HOST_IMPORT_MIB not set; your runs used 13312); the title's scope runs with swap off. The title's output goes to a log file (the sandbox launcher redirects it), which the Performance report form advises against; APS5_TRACE_EVENTS is also outside the form's switch list. APS5_VERIFY_DRAW_PLAN is not set. Without APS5_PROFILE_DRAW (and APS5_PIPELINE_STATS, also unset) neither the [draw] pipelined line your table quotes nor the [draws] phase totals below it print, so they are not compared here.
  • Order main, PR, main, PR, main, PR; each run capped at 1,560 s. The menu came 517-539 s after the harness's poll first saw the title's process.
  • One of the validity rules fixed before the runs: the GPU memory the desktop holds before a run must be at most 16 MiB above the series' first main run's. In the first series a desktop service started during its first run, and the desktop held 628-651 MiB before the later runs against 571 MiB before the first; four of its five runs were invalid by that rule alone, too few valid PR runs could remain for three pairs, and I stopped it. Its FPS in start order (the second PR run is the extra the rules add after an invalid run), for the record only: main 0.9999 (the valid run), PR 0.9844, PR 1.0160, main 1.0485, PR 1.0191. The second series was declared after that stop, after those per-run figures were recorded, and before its own runs, with the same builds, seed and rules and its own first main run as the desktop baseline; the desktop held 628 MiB before each of its six runs, with the desktop service from the first series still running.

Result (second series, one window per run)

run commit FPS frame p50 / p90 ms GPU busy ms/present
main 1 73f4f7e 1.0458 952.7 / 1,055.9 144.5
PR 1 aa0880e 1.0293 962.4 / 1,097.3 147.7
main 2 73f4f7e 1.0405 962.4 / 1,075.9 147.4
PR 2 aa0880e 1.0406 954.0 / 1,068.4 146.8
main 3 73f4f7e 1.0493 943.7 / 1,067.7 148.5
PR 3 aa0880e 1.0095 985.0 / 1,104.9 151.9
  • FPS (presents over the window's seconds): main 1.0405–1.0493, PR 1.0095–1.0406; PR/main of the means 0.9821; lowest PR / highest main 0.9621, highest PR / lowest main 1.0001.
  • Frame p50: main 943.7–962.4 ms, PR 954.0–985.0 ms; PR/main of the means 1.0149; 0.9913 and 1.0437 at the range ends.
  • GPU busy per present: main 144.5–148.5 ms, PR 146.8–151.9 ms.
  • queue worker 0x0, ms per present, main → PR, from the traces (the summary lines' top_phases_ms_per_frame sum all threads): Driver.Packet.draw 603–610 → 610–618; Driver.Draw.draw_enqueued 513–518 → 515–526; Driver.Draw.shader_compile_and_link 83–85 → 85–88; Shader.DrawStage.capture_resources 28–29 → 28–29; Driver.Packet.dispatch 274–286 → 273–298; Vulkan.Dispatch 186–199 → 187–210; Driver.Packet as a whole 945–953 → 953–982. Which of these phases holds planDraw's work on this path was not checked.
  • Peak memory.used in the window (1 s samples, all processes on the GPU): main 8,962–9,001 MiB, PR 8,919–8,963 MiB; no [bufferpool] recovered or out-of-device-memory line in the window on any run.
  • Summary lines:
{"commit":"73f4f7e06e4f","dirty":false,"env":{"APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"2097152","APS5_TRACE_SECONDS":"1320:180"},"gpu":"NVIDIA GeForce RTX 3080","driver":"NVIDIA 615.78.08","os":"Linux 7.2.10-1-cachyos","cpu":"AMD Ryzen 9 7950X3D 16-Core Processor","cpu_threads":32,"memory_mib":63428,"title_id":"PPSA11386","title":"007 First Light","content_version":"01.018.000","resolution":"3840x2160","window":{"spec":"seconds 1320:180","first_present":1529,"ms":180722.566},"presents":189,"frame_ms":{"p50":952.701,"p90":1055.911,"p99":1164.663,"max":1228.102},"gpu_busy_ms_per_present":144.541,"worker_busy_pct":{"queue worker 0x0":99.949,"queue worker 0x20":99.488,"queue worker 0x28":99.714,"queue worker 0x30":99.713,"queue worker 0x38":99.696},"top_phases_ms_per_frame":{"Driver.Packet":4753.506,"Driver.Packet.memory_wait":3327.255,"Resources.Complete":798.024,"GpuMutex.wait.hook":795.035,"Driver.Packet.dispatch":767.105,"Driver.Dispatch":723.133,"Driver.Packet.draw":610.587,"Graphics.Draw":610.583},"trace_dropped":false,"trace":"aps5-trace-73f4f7e06e4f-2.json.gz"}
{"commit":"aa0880e4ebc0","dirty":false,"env":{"APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"2097152","APS5_TRACE_SECONDS":"1320:180"},"gpu":"NVIDIA GeForce RTX 3080","driver":"NVIDIA 615.78.08","os":"Linux 7.2.10-1-cachyos","cpu":"AMD Ryzen 9 7950X3D 16-Core Processor","cpu_threads":32,"memory_mib":63428,"title_id":"PPSA11386","title":"007 First Light","content_version":"01.018.000","resolution":"3840x2160","window":{"spec":"seconds 1320:180","first_present":1503,"ms":180711.264},"presents":186,"frame_ms":{"p50":962.412,"p90":1097.310,"p99":1214.673,"max":1226.959},"gpu_busy_ms_per_present":147.746,"worker_busy_pct":{"queue worker 0x0":99.930,"queue worker 0x20":99.579,"queue worker 0x28":99.744,"queue worker 0x30":99.744,"queue worker 0x38":99.739},"top_phases_ms_per_frame":{"Driver.Packet":4831.336,"Driver.Packet.memory_wait":3396.620,"Resources.Complete":812.809,"GpuMutex.wait.hook":796.653,"Driver.Packet.dispatch":777.855,"Driver.Dispatch":734.865,"Graphics.Draw":611.660,"Driver.Packet.draw":610.241},"trace_dropped":false,"trace":"aps5-trace-aa0880e4ebc0-2.json.gz"}
{"commit":"73f4f7e06e4f","dirty":false,"env":{"APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"2097152","APS5_TRACE_SECONDS":"1320:180"},"gpu":"NVIDIA GeForce RTX 3080","driver":"NVIDIA 615.78.08","os":"Linux 7.2.10-1-cachyos","cpu":"AMD Ryzen 9 7950X3D 16-Core Processor","cpu_threads":32,"memory_mib":63428,"title_id":"PPSA11386","title":"007 First Light","content_version":"01.018.000","resolution":"3840x2160","window":{"spec":"seconds 1320:180","first_present":1508,"ms":180676.425},"presents":188,"frame_ms":{"p50":962.389,"p90":1075.899,"p99":1222.941,"max":1271.359},"gpu_busy_ms_per_present":147.400,"worker_busy_pct":{"queue worker 0x0":99.951,"queue worker 0x20":99.457,"queue worker 0x28":99.699,"queue worker 0x30":99.697,"queue worker 0x38":99.588},"top_phases_ms_per_frame":{"Driver.Packet":4776.285,"Driver.Packet.memory_wait":3350.958,"Resources.Complete":799.964,"GpuMutex.wait.hook":780.211,"Driver.Packet.dispatch":771.339,"Driver.Dispatch":728.784,"Driver.Packet.draw":605.151,"Driver.Draw":604.898},"trace_dropped":false,"trace":"aps5-trace-73f4f7e06e4f-2.json.gz"}
{"commit":"aa0880e4ebc0","dirty":false,"env":{"APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"2097152","APS5_TRACE_SECONDS":"1320:180"},"gpu":"NVIDIA GeForce RTX 3080","driver":"NVIDIA 615.78.08","os":"Linux 7.2.10-1-cachyos","cpu":"AMD Ryzen 9 7950X3D 16-Core Processor","cpu_threads":32,"memory_mib":63428,"title_id":"PPSA11386","title":"007 First Light","content_version":"01.018.000","resolution":"3840x2160","window":{"spec":"seconds 1320:180","first_present":1514,"ms":180657.061},"presents":188,"frame_ms":{"p50":953.993,"p90":1068.382,"p99":1196.979,"max":1202.609},"gpu_busy_ms_per_present":146.763,"worker_busy_pct":{"queue worker 0x0":99.951,"queue worker 0x20":99.552,"queue worker 0x28":99.736,"queue worker 0x30":99.736,"queue worker 0x38":99.712},"top_phases_ms_per_frame":{"Driver.Packet":4780.893,"Driver.Packet.memory_wait":3340.072,"GpuMutex.wait.hook":833.248,"Resources.Complete":797.166,"Driver.Packet.dispatch":777.838,"Driver.Dispatch":734.256,"Graphics.Draw":616.409,"Driver.Packet.draw":615.043},"trace_dropped":false,"trace":"aps5-trace-aa0880e4ebc0-2.json.gz"}
{"commit":"73f4f7e06e4f","dirty":false,"env":{"APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"2097152","APS5_TRACE_SECONDS":"1320:180"},"gpu":"NVIDIA GeForce RTX 3080","driver":"NVIDIA 615.78.08","os":"Linux 7.2.10-1-cachyos","cpu":"AMD Ryzen 9 7950X3D 16-Core Processor","cpu_threads":32,"memory_mib":63428,"title_id":"PPSA11386","title":"007 First Light","content_version":"01.018.000","resolution":"3840x2160","window":{"spec":"seconds 1320:180","first_present":1526,"ms":180112.308},"presents":189,"frame_ms":{"p50":943.705,"p90":1067.736,"p99":1168.333,"max":1304.805},"gpu_busy_ms_per_present":148.516,"worker_busy_pct":{"queue worker 0x0":99.949,"queue worker 0x20":99.999,"queue worker 0x28":99.997,"queue worker 0x30":99.999,"queue worker 0x38":99.995},"top_phases_ms_per_frame":{"Driver.Packet":4751.606,"Driver.Packet.memory_wait":3339.526,"Resources.Complete":794.029,"GpuMutex.wait.hook":782.633,"Driver.Packet.dispatch":761.799,"Driver.Dispatch":716.878,"Driver.Packet.draw":603.375,"Driver.Draw":603.122},"trace_dropped":false,"trace":"aps5-trace-73f4f7e06e4f-2.json.gz"}
{"commit":"aa0880e4ebc0","dirty":false,"env":{"APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"2097152","APS5_TRACE_SECONDS":"1320:180"},"gpu":"NVIDIA GeForce RTX 3080","driver":"NVIDIA 615.78.08","os":"Linux 7.2.10-1-cachyos","cpu":"AMD Ryzen 9 7950X3D 16-Core Processor","cpu_threads":32,"memory_mib":63428,"title_id":"PPSA11386","title":"007 First Light","content_version":"01.018.000","resolution":"3840x2160","window":{"spec":"seconds 1320:180","first_present":1497,"ms":180280.769},"presents":182,"frame_ms":{"p50":984.974,"p90":1104.881,"p99":1262.459,"max":1287.959},"gpu_busy_ms_per_present":151.940,"worker_busy_pct":{"queue worker 0x0":99.953,"queue worker 0x20":99.534,"queue worker 0x28":99.722,"queue worker 0x38":99.713,"queue worker 0x30":99.722},"top_phases_ms_per_frame":{"Driver.Packet":4927.081,"Driver.Packet.memory_wait":3455.790,"GpuMutex.wait.hook":886.080,"Resources.Complete":827.735,"Driver.Packet.dispatch":805.734,"Driver.Dispatch":763.176,"Driver.Packet.draw":617.961,"Driver.Draw":617.724},"trace_dropped":false,"trace":"aps5-trace-aa0880e4ebc0-2.json.gz"}

AI-assisted: yes (Claude Code)

@vingelvatten
vingelvatten force-pushed the refactor/agc-draw-prepare-stages branch from aa0880e to e2d277a Compare November 1, 2026 13:53
@vingelvatten

Copy link
Copy Markdown
Contributor Author

@MarcZX10 thanks for the exact-head review. Both points, in order.

Landing order with #10678. Agreed that the checklist should name it. I have asked @WallisSkill on #10678 whether this PR can land first: it is a refactor with no behaviour change, and once planDraw exists the early key becomes about ten lines (pass the finisher's key into planDraw, take it when KeyForDevice matches) instead of #10678's current plumbing through Draw and resolveDrawResources. If they prefer the other order, this PR rebases onto #10678 the same way and the checklist moves to Depends on: #10678. The description's Overlap section now says this, and Depends on records the proposal as pending their answer.

The plan contract. You are right that "no shared cache" was too strong. planDraw touches three memoizations, all synchronized and order-insensitive: CachedFragmentOutputs under its own mutex, VertexInputCache::TryGet under its own mutex (a lookup can move an LRU entry, insert, evict or set the bypass bit), and the idempotent key memo DrawResourceKey publishes on the program. What they change is cache state, never the plan's output: a plan built on any thread, in any order, gets the same values. The description now says that, and says that the verifier compares the plan's output, not those caches' internal state, which the output does not depend on. I kept the lookups in the plan rather than moving them out, because the preparer boundary needs the layout and the outputs and both memoizations are already safe to call from the finisher (#10678 calls DrawResourceKey there today).

Rebase. The head is now e2d277a41b on main ab6f5d3: #12862 moved the test registrations into per-executable fragments (the _plan_verify variants now live in agc_add_draw_pipeline_test, as @janzezno described), and #13894 changed the mesh group limit, so the plan carries meshLayers and meshLayerStride as DrawInputs does. The device runs in the description are being redone on this head; I will note here when they are up.

@vingelvatten

Copy link
Copy Markdown
Contributor Author

@janzezno thank you, that is exactly what the rebase needed: main's side of the file, the foreach dropped, and the five _plan_verify lines inside agc_add_draw_pipeline_test. ctest -N -R _plan_verify registers the same 22 tests on the rebased head.

@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head e2d277a merged onto main f2d874c · tested 2026-11-01 23:38 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,522 passed · 7 failed (0 new, 4 also fail on main, 3 unstable on main) · 46 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,575 of 3,168 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 (960 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 120.1 s, ⚠️ agc_driver_lookup_log_fits_build 63.3 s, ⚠️ agc_driver_graphics_maps_fallback 31.1 s, ⚠️ agc_driver_graphics 30.0 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 5 of the last 10 main runs
agc_submit_progress_no_timeline: failed in 7 of the last 10 main runs
Failing on main too (4, not counted against this PR)
agc_driver_dcc_keys_first_write
agc_driver_image_table
guest_mmap_executable
guest_socket_options_multicast
Validated but not compared (12, not in the main baseline's validation pass)
agc_driver_gated_dispatch_capture_plan_verify
agc_driver_image_table_reuse_plan_verify
agc_driver_pipelined_dma_plan_verify
agc_driver_pipelined_fill_plan_verify
agc_driver_pipelined_metadata_pass_plan_verify
agc_driver_pipelined_predicated_label_order_plan_verify
agc_driver_pipelined_predication_read_plan_verify
agc_driver_same_queue_label_wait_plan_verify
agc_driver_staged_clear_sampled_read_plan_verify
agc_driver_storage_write_back_overhang_plan_verify
agc_driver_unimported_label_order_plan_verify
agc_driver_write_data_written_ahead_plan_verify
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 (46)
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_pipeline_binary_vulkan: skipped, the device lacks VK_KHR_pipeline_binary
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
Reproduce
git fetch origin e2d277a41bc36d3fcc4952d8cceba31601b451e3 f2d874c1fdccf781c0fa5d86619bb5dd8894b958
git checkout f2d874c1fdccf781c0fa5d86619bb5dd8894b958 && git merge --no-ff e2d277a41bc36d3fcc4952d8cceba31601b451e3
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.

slopradish added a commit to slopradish/AnyPS5 that referenced this pull request Nov 2, 2026
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Nov 3, 2026
…e work

Step 2 of the draw-side series in boykopovar#7895. planDraw builds a DrawPlan from
the state, the draw parameters and the compiled stages alone: the
validation and nothing-to-draw exits, the fragment outputs and pipeline
stages, the mesh and tessellation checks, the viewport, depth-bounds and
sample-mask checks, the vertex input layout and the resource-cache key.
prepareDrawInputs starts from the plan and keeps the index range and
multisample-target checks, the occlusion-sampling check and every
capture. resolveDrawResources takes the key from the plan. The same
calls run in the same order relative to every record-time effect; a
draw that fails a plan check now throws before its captures.

APS5_VERIFY_DRAW_PLAN=1 builds the plan again after the record-time
work and requires it to equal the plan the draw used. The draw-pipeline
test set gets _plan_verify variants with that switch.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@vingelvatten

Copy link
Copy Markdown
Contributor Author

Rebased onto main d1ae628 as 4aa5f51473 (the PR had conflicted again). The conflict was #14857, which moved the Graphics.Draw trace marks into prepareDrawInputs: the validate mark now sits after the three checks that stay in prepareDrawInputs (index range, multisample target, occlusion sampling), so the slice still covers all of a draw's validation, and index_upload and vertex_upload are where #14857 put them. The diff is otherwise the same as the reviewed head (118 added, 45 removed, three files). The focused runs on NVIDIA, AMD and lavapipe against a main build of the same commit are redone on this head: NVIDIA RTX 4070 Ti SUPER main 175 / branch 197 tests, AMD RDNA2 iGPU 175 / 197, lavapipe 176 / 198, all 100% passed with the same skips per device, the validation layer loaded in every run and identical VUID sets (only the pre-existing sRGB8 blend VUID). The description's Tested section carries the numbers. The Crash Site pairs in the description are from the previous base; nothing in the merged range touches the committer's draw path beyond the trace marks, so I have not rerun them; say if you want a fresh set.

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

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head 4aa5f51 merged onto main 1e65852 · tested 2026-11-03 22:05 UTC · 17 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,799 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,851 of 3,818 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 (960 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 (5, not in the main baseline's validation pass)
agc_driver_same_queue_label_wait_plan_verify
agc_driver_staged_clear_sampled_read_plan_verify
agc_driver_storage_write_back_overhang_plan_verify
agc_driver_unimported_label_order_plan_verify
agc_driver_write_data_written_ahead_plan_verify
Validation IDs already present on main (4 IDs in 533 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (533 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 525 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_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 4aa5f514735d5b06ba887f5ecee225da4024ef69 1e658521a0a599872612bb91949311e2956b5283
git checkout 1e658521a0a599872612bb91949311e2956b5283 && git merge --no-ff 4aa5f514735d5b06ba887f5ecee225da4024ef69
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.

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

Copy link
Copy Markdown
Contributor

✅ AMD GPU test: passed

PR head 4aa5f51 merged onto main 1e65852 · tested 2026-11-03 22:24 UTC · 16 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,782 passed · 10 failed (0 new, 9 also fail on main, 1 unstable on main) · 59 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,851 of 3,818 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 (960 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 120.5 s, ⚠️ public_headers 49.5 s, ⚠️ agc_driver_image_sample_unnormalized 37.6 s, ⚠️ agc_driver_stream_copy 36.0 s, ⚠️ agc_driver_lazy_resolved_abi 32.4 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 7 of the last 9 main runs
Failing on main too (9, not counted against this PR)
agc_driver_image_table
agc_driver_native_depth_bda_clear
agc_driver_native_multisample_depth
agc_driver_store_over_untracked
agc_driver_submit_progress
agc_submit_progress
agc_submit_progress_no_timeline
guest_mmap_executable
guest_socket_options_multicast
Validated but not compared (5, not in the main baseline's validation pass)
agc_driver_same_queue_label_wait_plan_verify
agc_driver_staged_clear_sampled_read_plan_verify
agc_driver_storage_write_back_overhang_plan_verify
agc_driver_unimported_label_order_plan_verify
agc_driver_write_data_written_ahead_plan_verify
Validation IDs already present on main (4 IDs in 533 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (533 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 525 more
VUID-vkCmdCopyImage-srcImage-01548 (4 tests): agc_driver_depth_clear_hle, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-vkCmdCopyImage-srcImage-01551 (4 tests): agc_driver_depth_clear_hle, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (1 test): agc_driver_srgb8_color_target
Skipped (59)
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_storage_pending_key_refresh: skipped, refreshes over a pending key store are not testable here
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 dr
Reproduce
git fetch origin 4aa5f514735d5b06ba887f5ecee225da4024ef69 1e658521a0a599872612bb91949311e2956b5283
git checkout 1e658521a0a599872612bb91949311e2956b5283 && git merge --no-ff 4aa5f514735d5b06ba887f5ecee225da4024ef69
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.

@adriadam10 adriadam10 self-assigned this Nov 6, 2026

@adriadam10 adriadam10 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

main moved under this head and it now conflicts in core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp (three hunks, all around resolveDrawResources and its call in prepareDraw). It needs a design decision, not a mechanical rebase:

  • resolveDrawResources: main now computes const bool candidate = recordable && !noDrawResourceCache && !noTextureCache && all PipelineVariantId() != 0 and then resolved.cacheable = candidate && !ShaderResources::NeverReusable(shaders). address (addressStages, AddressDrawReuse::NotReadOnly/NotSpaceOnly) is derived from candidate, so it also applies to stages that are NeverReusable. plan.keyed folds NeverReusable into the same flag, so the address-reuse classification would change for those draws. DrawPlan needs to carry the candidate condition and the NeverReusable condition separately (and the noDrawResourceCache/noTextureCache statics that main's code still reads in resolveDrawResources, which this PR removes).
  • prepareDraw: keep main's stopAfterResolve block and NoteDepthSurfaceWrite after resolveDrawResources when passing plan.
  • main's new helpers (AddressStages, snapshotsInTable, verifyServedSpace, drawStagingEnabled) sit right above resolveDrawResources, which is where the conflict markers land.

After the rebase, please rerun the focused draw tests with the _plan_verify variants on the new head, since the key's inputs changed on main.

The landing order with #10678 is still only agreed in comments; Depends on stays none as you wrote it, so that is fine once it is confirmed there.

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 docs needs rebase Conflicts with main, rebase needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants