Skip to content

fix(agc): stop draining for GPU-clock COPY_DATA - #7963

Merged
oneandonlydean merged 3 commits into
boykopovar:mainfrom
MuteRex:fix/agc-gpu-clock-copy-data
Nov 14, 2026
Merged

oneandonlydean merged 3 commits into
boykopovar:mainfrom
MuteRex:fix/agc-gpu-clock-copy-data

Conversation

@MuteRex

@MuteRex MuteRex commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

What

A COPY_DATA (0x40) whose source is the GPU clock (source 18) drained work it never depended on:

  • In keepsDrawPipeline it was not a keeping opcode, so every one drained the pipelined draw queue. It now keeps the pipeline unless its destination overlaps a pending range, in which case it still drains.
  • In PacketMemory, a clock copy into memory that is not imported while the recorder was busy (reason 3) drained the whole device before the store. It is now stored on the CPU, as with an idle recorder, unless the device has a store pending over the destination.

The clock value is read when the packet runs, before either drain, so the drains only stalled the queue. PPSA16833 issues these copies every frame for GPU timing.

Tested

Linux 7.0, AMD Radeon RX 9060 XT (RADV, Mesa 26.0.8).

  • New agc_driver case testGpuClockCopyBehindGpuWork: a 128 KiB GPU copy followed by two clock copies into host memory. It checks the copy landed, the clocks increase, no device drain happened, and both stores went to the CPU. It fails on main with "a GPU-clock COPY_DATA into host memory behind GPU work drained the device".
  • New agc_driver_pipelined_clock_copy: with APS5_PIPELINED_DRAWS=1 and the pipeline held over a pending range, it checks that clock copies elsewhere do not drain it and that a clock copy onto the held range still drains once. It fails on main with "a GPU-clock COPY_DATA off the pending range drained the pipeline".
  • Both passed 30/30 and 10/10 repeated runs.
  • VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build -R '^(agc_driver|agc_driver_pipelined_clock_copy|agc_driver_pipelined_dma|agc_driver_pm4)$' -V:
    • change: 4/4 pass;
    • main: the two new tests fail;
    • both logs: no was not found but was requested by env var VK_INSTANCE_LAYERS, and no VUID- messages.
  • Full ctest: all pass except agc_driver_image_table_vouched_lookups and agc_driver_guest_memory_lifetime, which fail the same way on main.

Performance, PPSA16833 (LEGO Batman: Legacy of the Dark Knight) main menu, 3840x2160, warm caches, APS5_TRACE_SECONDS=180:30, same machine and session. Traces attached.

main this PR
presents 112 113
frame p50 / p90 / p99 / max (ms) 267.9 / 275.2 / 295.4 / 302.9 265.1 / 270.9 / 287.0 / 289.1
GPU busy per present (ms) 113.7 113.2
queue worker 0x0 busy / wait (ms per frame) 262.3 / 5.7 177.7 / 86.7
Driver.Packet.device_lock (ms per frame) 173.9 not in the top phases

Frame time at this scene is unchanged within noise. The queue worker that ran the clock copies spends about 85 ms less per frame busy, mostly the removed device drain. The frame here is bound elsewhere: the second queue worker waits in Driver.Packet.memory_wait and the draw committer in Recorder.Sync. Both builds carry the same local window-placement change, which is why the summaries say dirty. 315f1a99fd4b is this change on c017549dc; this PR's commit is the same change rebased onto 10 later commits of main, none of which touches libSceAgcDriver. The main capture reverted the two driver files to main.

main:

{"commit":"315f1a99fd4b","dirty":true,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"180:30"},"gpu":"AMD Radeon RX 9060 XT (RADV GFX1200)","driver":"radv Mesa 26.0.8-1ubuntu0.3","os":"Linux 7.0.0-38-generic","resolution":"3840x2160","window":{"spec":"seconds 180:30","first_present":1436,"ms":30161.106},"presents":112,"frame_ms":{"p50":267.922,"p90":275.207,"p99":295.449,"max":302.908},"gpu_busy_ms_per_present":113.678,"worker_busy_pct":{"queue worker 0x0":99.881,"queue worker 0x20":96.099},"top_phases_ms_per_frame":{"Driver.Packet":527.219,"Driver.Packet.memory_wait":224.507,"Driver.Packet.device_lock":173.858,"Recorder.Sync":128.804,"Resources.Complete":107.409,"Driver.Packet.dispatch":94.176,"Driver.Dispatch":93.408,"Vulkan.Dispatch":83.002},"trace_dropped":false,"trace":"aps5-trace-315f1a99fd4b-1113523.json.gz"}

this PR:

{"commit":"315f1a99fd4b","dirty":true,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"180:30"},"gpu":"AMD Radeon RX 9060 XT (RADV GFX1200)","driver":"radv Mesa 26.0.8-1ubuntu0.3","os":"Linux 7.0.0-38-generic","resolution":"3840x2160","window":{"spec":"seconds 180:30","first_present":733,"ms":30039.493},"presents":113,"frame_ms":{"p50":265.1,"p90":270.88,"p99":287.004,"max":289.107},"gpu_busy_ms_per_present":113.241,"worker_busy_pct":{"queue worker 0x0":99.897,"queue worker 0x20":97.04},"top_phases_ms_per_frame":{"Driver.Packet":523.113,"Driver.Packet.memory_wait":223.019,"Driver.Packet.dispatch":182.407,"Recorder.Sync":128.071,"Driver.Dispatch":124.245,"Resources.Complete":106.868,"GpuMutex.wait.label":106.481,"Driver.Packet.prepare_memory":106.471},"trace_dropped":false,"trace":"aps5-trace-315f1a99fd4b-1118384.json.gz"}

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: AMD Radeon RX 9060 XT, RADV (Mesa 26.0.8), Linux 7.0.0-38
  • AI-assisted: yes

🤖 Generated with Claude Code

@MuteRex

MuteRex commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

pr7963-traces.zip

Traces for the summary lines above: main-aps5-trace-315f1a99fd4b-1113523.json.gz is main, fix-aps5-trace-315f1a99fd4b-1118384.json.gz is this PR (GitHub does not accept .gz attachments, so both are in the zip).

@github-actions

github-actions Bot commented Oct 19, 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 7464 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketMemory.cpp L208

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 4448 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
PR 5925 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
PR 6188 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
PR 9335 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
PR 10442 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketMemory.cpp
PR 18515 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketMemory.cpp

@github-actions github-actions Bot added agc libSceAgc* needs rebase Conflicts with main, rebase needed labels Oct 19, 2026
@oneandonlydean oneandonlydean self-assigned this Oct 20, 2026
@blawesom

Copy link
Copy Markdown
Contributor

Rebase handoff — rebased onto current main (3fd1cc393, authorship unchanged). One test-call conflict: main's testSmallCopyBehindPendingSource and your testGpuClockCopyBehindGpuWork now both run.

Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, BUILD_TESTING=ON, AMD RX 9070 XT / RADV): builds; 1673/1676 — green apart from the three known main failures (#7584 BDA, #7784 guest-memory, tessellation), none from this PR; conventions pass.

To pick it up:

git fetch https://github.com/blawesom/AnyPS5 rebase/7963
git checkout <your branch>
git merge --ff-only FETCH_HEAD

Head is a6f0732f6.

@MuteRex

MuteRex commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @blawesom for the rebase and the test run! Picked it up: the branch is now at a6f0732f6 and the PR is mergeable again. (git merge --ff-only refused because the rebase rewrote the commit, so I force-pushed your commit instead.)

@milescoviello

Copy link
Copy Markdown
Contributor

A second title with these copies: MGS4 (PPSA18194, Master Collection), in Act 1's first gameplay scene. The route is the launcher, then Game Selection, Start Game, New Game and Liquid Easy, skipping the opening cutscene. Linux 6.8, RTX 4070 Ti (595.99.02), release libs, APS5_PROFILE_DRAW=1. Each column below is the same two consecutive 10 s windows.

main 8727ddb + this PR (a6f0732)
draw pipeline packet drains 4208 / 4316 (2449 / 2543 ms) 10 / 23 (0.3 / 1.2 ms)
drains by opcode 0x40 ×4207 / ×4313, 0x15 ×1 / ×3 0x15 ×10 / ×23
commits per 10 s, cost on the committer 204110 / 209862 at 31.7 / 32.2 µs 215149 / 213434 at 28.9 / 28.8 µs
presents per 10 s 79 / 85 77 / 75

So every COPY_DATA drain in this scene is a clock copy, and this PR removes them all. As in your LEGO Batman measurement, the frame rate doesn't change. The frame is bound by per-draw CPU work: about 2,800 draws per frame at about 28 µs to record and 29 µs to commit, with the GPU busy about 31–37 ms of each frame.

One note: my first launch on this build crashed in the launcher at 23 s (EXIT-139, no message). Three more runs on the same build didn't repeat it (two 60 s runs and the long run above), and main didn't crash in four runs, so I don't think it's related.

AI-assisted: yes (Claude Code)

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 20, 2026
@MuteRex

MuteRex commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @milescoviello for testing a second title! Good to see every COPY_DATA drain was a clock copy there too, and that the PR removes them on NVIDIA as well. Agreed on the frame rate: it is bound elsewhere in both games, so this PR removes overhead rather than raising FPS. Thanks also for checking the launcher crash with the extra runs.

@milescoviello

Copy link
Copy Markdown
Contributor

A title data point for this PR: Metal Gear Solid 4 (PPSA18194), which drains the draw pipeline on COPY_DATA thousands of times a second on main.

Setup: Ubuntu 26.04.1, GCC 15.2, Release libs (SPIRV-Tools off), RTX 4070 Ti, NVIDIA 615.71.09. main e7f46f5 against main + this PR (a6f0732, merged cleanly as 32d0905d64). Warm shader cache, pad input, APS5_PROFILE_DRAW=1 on both sides, 300 s per run, runs interleaved main / PR three times. The numbers are the mean presents per 10 s window from 100 s on, and the queue-0 packet drains by opcode line of the last five windows.

run main presents / 10 s main 0x40 drains / 10 s this PR presents / 10 s this PR 0x40 drains / 10 s
1 303.1 17,993 505.8 0
2 294.2 17,486 312.4 0
3 401.4 13,324 304.8 0
  • Every queue-0 COPY_DATA drain is gone, so all of this title's are GPU-clock copies. On main they cost the packet worker about 2.4 s of every 10 s in an earlier profiled run.
  • The frame rate doesn't separate the two sides in these runs: the medians are 303.1 and 312.4, and each side has one run far from its other two. That matches the frame being bound by more than the drains in this scene. So this is evidence for the drain removal on a title, not a frame-rate claim.

AI-assisted: yes (Claude Code)

@MuteRex

MuteRex commented Oct 24, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @milescoviello for the longer interleaved runs! Zero 0x40 drains in all three confirms every queue-0 COPY_DATA drain in MGS4 is a clock copy, and agreed that the frame rate difference is within run-to-run noise here.

Summary for review: across LEGO Batman (AMD) and MGS4 (NVIDIA), the PR removes the GPU-clock COPY_DATA drains, and the test suite passes apart from the three known main failures.

@Tamalero

Copy link
Copy Markdown
Contributor

@MuteRex a run on NVIDIA: RTX 4090, driver 615.78.08, Linux 7.3 (CachyOS), GCC 16.2, Release. I cherry-picked this PR (a6f0732f60) onto main e13027a, with #9694 and #10388 also applied. Neither of those touches Packets/.

Tests. The command from the description, with VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1:

  • This change: 4/4 pass.
  • Negative control: with PacketExecution.cpp and PacketMemory.cpp taken from the commit before, agc_driver and agc_driver_pipelined_clock_copy fail. The messages are a GPU-clock COPY_DATA into host memory behind GPU work drained the device and pipelined clock copy: a GPU-clock COPY_DATA off the pending range drained the pipeline.
  • Validation layer: found in both runs, so the was not found line never appears. Both runs also log the same pre-existing error twice, VUID-vkCreateDevice-ppEnabledExtensionNames-01387. It is printed while agc_driver creates its device: VK_KHR_present_mode_fifo_latest_ready is enabled without VK_KHR_swapchain. It's the same with and without this change.
  • Not run: the full ctest.

Performance, PPSA01748 (Marvel's Guardians of the Galaxy) main menu. Warm caches, APS5_TRACE_FRAMES=1150:40, no input, the two builds launched one after the other:

without this PR this PR
frame p50 / p90 / max (ms) 665 / 846 / 954 682 / 868 / 1184
GPU busy per present (ms) 134 136
Driver.Packet.pipeline_drain events in the 40 frames 2,479 2,368
time in them (ms) 3,052 2,697
Driver.Packet.device_lock events 4 2

This PR removes about 110 of the 40-frame window's ~2,480 pipeline drains, and saves about 9 ms per frame of drain time. The frame time doesn't change within noise. In this title most drains aren't clock copies, so for Guardians this is a no-regression result, not a speed-up. The menu is bound the way #10441 describes: queue 0x0 is busy recording draws and dispatches, and queue 0x23 waits on a label.

Two more launches, one per build, aren't in the table. On those, frame 1150 came before the menu, so the 40 frames included a load of about 150 s and don't measure the same scene.

Tested and written by Claude (AI assistant) on a contributor's machine.

@MuteRex

MuteRex commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @Tamalero for the run on a 4090 and for the negative control! Good to see both new tests fail with the two driver files reverted and pass with the change, on NVIDIA as well. Agreed on Guardians: most of its drains aren't clock copies, so removing ~110 of ~2,480 is a no-regression result rather than a speed-up, and the frame-time difference is within noise. The VUID-vkCreateDevice-ppEnabledExtensionNames-01387 error appears with and without this change, so it isn't from this PR.

That makes three titles across AMD and NVIDIA (LEGO Batman, MGS4, Guardians): the GPU-clock COPY_DATA drains are gone and nothing regresses.

@babyhuey

Copy link
Copy Markdown
Contributor

Windows run of this head a6f0732f60d, merged onto main 204c6747d0a (clean merge, local only), with the selection CI's skipped Windows product job uses: Windows 11, Ryzen 7 5800X, RTX 3080, WinLibs GCC 15.2, Release, BUILD_TESTING=ON. The tree was configured fresh after the merge, then select_tests.py select / ninja -f select.ninja selected / --target libs / select_tests.py ctest --parallel 4 --timeout 120, with check_skips.py --job windows (all skips expected).

AI-assisted: yes (Claude Code)

@milescoviello

Copy link
Copy Markdown
Contributor

@MuteRex a title where this PR's copies are the main drain: Super Meat Boy 3D (PPSA31162 02.000.001), level 1 of World 1.

A local diagnostic counted the queue-0 COPY_DATA packets that drained the draw pipeline on main cbee224. In every 10 s window it found about 11,000 to 12,300 of them, all of one kind: source 18 (the GPU clock), destination memory, 8 bytes, with no pending write over the destination. That is exactly the case this PR keeps in the pipeline.

Setup. Linux (Ubuntu 26.04.1, kernel 7.0), RTX 4070 Ti, NVIDIA 615.71.09, i7-13700K, Release libraries, warm shader cache, 3840x2160.

  • A is main cbee224. C is the same commit with this PR's head a6f0732f60 merged locally, which merged cleanly.
  • Every run follows the same scripted route into level 1, where the camera stays still from about 200 s.
  • Each run lasts 330 s with only APS5_TRACE_SUMMARY_EVERY=10, in the order C A C A C A. The numbers come from the aps5-summary.jsonl windows that start at 240 s or later, 8 per run.
run presents per 10 s frame p50 (median of windows)
C1 50.31 197.1 ms
A1 48.73 202.6 ms
C2 49.53 201.6 ms
A2 49.11 201.9 ms
C3 49.63 199.0 ms
A3 48.67 205.1 ms
  • Mean presents per 10 s: A 48.84, C 49.82 (+2.0 %). Every C run is above every A run.
  • Frame p50 is about 1.6 % lower, but C2 and A2 are only 0.3 ms apart, so I'd only claim the presents.

Drains (APS5_PROFILE_DRAW=1, one 10 s window in the same stretch, which adds its own cost):

The frame doesn't move more than that because the draw committer bounds this scene: with this PR the queue worker waits 6.4 µs per draw for room in the full pipeline.

AI-assisted: yes (Claude Code)

@oneandonlydean

Copy link
Copy Markdown
Collaborator

@milescoviello Thanks, an interleaved same-machine A/B on the exact head with the drain counts alongside is exactly what we need here. We're checking it against the remaining test requirements for this PR.

@oneandonlydean

Copy link
Copy Markdown
Collaborator

@milescoviello One thing before we can count these runs in place of our own game test: on 20 Oct you saw a launcher exit with code 139 after about 23 s on this head, which didn't happen on main in four launches. Did it come back in the runs since, and did you find what caused it? If it turned out to be unrelated (a stale build, a driver hiccup), a line saying so is enough.

@milescoviello

Copy link
Copy Markdown
Contributor

@oneandonlydean it didn't come back. Since that crash I've launched builds with this PR seven times, and all seven ran to their timeouts:

  • MGS4 (PPSA18194), through the same launcher and mgs4.elf route, three 300 s runs on 23 Oct: main e7f46f5 + a6f0732f60, interleaved with three main runs;
  • Super Meat Boy 3D, four 330 s runs today: main cbee224 + a6f0732f60 (C1 to C3 and the profiled run in the A/B above).

I didn't find a cause. The 20 Oct run left no error message and no core I could use. That week this host also had a few one-off crashes on main that didn't repeat (non-ECC memory, since retried), which is how I'd read this one. Going by those seven runs, I don't think it's this PR.

AI-assisted: yes (Claude Code)

@oneandonlydean

Copy link
Copy Markdown
Collaborator

@BunnyFl Thanks, this is the kind of evidence these functions were missing. The second-call result (0x23 with no syscall) and the unchecked null name differ from what the current tests expect, so we're checking the PR's assertions against your results. @alvaroelpob please take a look too, particularly the repeated rename and the null-name cases.

@MuteRex

MuteRex commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @milescoviello for the Super Meat Boy 3D A/B. A title where the GPU-clock COPY_DATA copies are the main drain is exactly the case this change targets. It's good to see them go to zero with this head, and the interleaved order with every C run above every A run is more convincing than the frame p50. Agreed that the draw committer bounds that scene. Thanks also for following up on the 20 Oct exit.

A COPY_DATA of the GPU clock into memory no longer drains the draw
pipeline when its destination does not overlap pending writes, and is
stored on the CPU instead of draining the device when the destination
is not imported. The value is read before either drain, so the drains
only stalled the queue.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MuteRex
MuteRex force-pushed the fix/agc-gpu-clock-copy-data branch from a6f0732 to c512147 Compare October 28, 2026 17:43
@MuteRex

MuteRex commented Oct 28, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (3b362ba2e0). The commit applied without conflicts and is now c512147967.

Retested on Linux 7.0.0-38, AMD Radeon RX 9060 XT (RADV GFX1200), Release, BUILD_TESTING=ON, with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1 and VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation:

  • agc_driver and agc_driver_pipelined_clock_copy: both pass, with no VUID- errors. The validation layer loaded (no was not found line).
  • All 812 agc_driver|agc_submit tests: 811 pass. agc_driver_native_multisample_depth fails at cached storage span retires only intersecting native depth owners, and agc_driver_prepared_exports and agc_driver_srgb8_color_target log VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 20 and 6 times. On main 3b362ba2e0, those three tests give the same failure and the same 26 errors, so they don't come from this change.
  • tools/check_conventions.py --base origin/main passes.

AI-assisted: yes (Claude Code)

@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head c512147 merged onto main 52c09d5 · tested 2026-10-29 11:14 UTC · 19 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,200 passed · 5 failed (0 new, 5 also fail 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,244 of 2,873 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 (856 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) none
Failing on main too (5, not counted against this PR)
agc_compute_pipeline_inspection
agc_submit_progress
agc_submit_progress_no_timeline
guest_mmap_executable
guest_socket_options_multicast
Validated but not compared (1, not in the main baseline's validation pass)
agc_driver_pipelined_clock_copy
Validation IDs already present on main (4 IDs in 404 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (404 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 396 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 c51214796791c72918feafc58dabb98ccc47e9cf 52c09d567d2fa453494dd720fcf53a98149468e4
git checkout 52c09d567d2fa453494dd720fcf53a98149468e4 && git merge --no-ff c51214796791c72918feafc58dabb98ccc47e9cf
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 1, 2026
@mrfelek

mrfelek commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Data from two UE5 titles: a gain in one, no change in the other

Both titles issue GPU-clock COPY_DATA (source 18, 64-bit into memory) by the thousand. In both, every COPY_DATA that drained the draw pipeline was one of these, about 16,500 per 10 s in a menu.

Trees: A = main 1c8c0efc8c + #15656 + #11346. B = A + this PR, merged locally. The only conflict was in tests/Submit.cpp, where main and this PR each add new tests at the same spot. I kept both.

PPSA22408 (Hot Wheels Infinite Rush), garage menu. Radeon 780M (RADV, Mesa 26.0.8), Ryzen 9 PRO 8945HS, Ubuntu 26.04.1 (Linux 7.0). Same scripted route, one run each, 5 minutes in the garage:

A B
presents per 10 s 29–31 (~3.0) 32–34 (~3.35), +11%
draw-pipeline drains per 10 s 10,415 5,881
time waiting in drains per 10 s 1,816 ms 1,175 ms
COPY_DATA drains per 10 s 8,041 0

PPSA28416 (Star Wars Galactic Racer), title screen. RTX 3080 Ti (NVIDIA 615.71.09), Ryzen 9 5950X, Ubuntu 26.10 (Linux 7.3), two alternating runs each:

  • Drains: COPY_DATA drains drop from about 16,000 to 0 per 10 s, and all drains from 18,000–19,300 to 5,900–6,200.
  • No speed-up: the time spent waiting in drains stays at about 1.6 s per 10 s, and presents per second are unchanged (4.44 for A, 4.42 for B, means of two runs).
  • Why: the wait moves to the next drain (dispatches, EVENT_WRITE), because the draw committer still works through the same backlog. On the committer itself, about 40% of its samples spin in DrawPipeline::run waiting for work, and Recorder::refreshDrawSnapshot's memcmp is about 21%.

So the change works in both titles. Whether it shows up as frame rate depends on whether the remaining drains take over the wait.

AI-assisted.

…er side

Main now stores labels in unregistered host memory on the GPU, so the two
GPU-clock COPY_DATA stores into the test's host vector land on the GPU rather
than through the CPU path. The test still requires no drain, an increasing
clock and both stores made, counted on the CPU, on the GPU or behind
completions.

Co-authored-by: MuteRex <99267426+MuteRex@users.noreply.github.com>
@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ AMD GPU test: passed

PR head 12bc599 merged onto main 5b1d381 · tested 2026-11-04 14:09 UTC · 20 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,742 passed · 9 failed (0 new, 7 also fail on main, 2 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,810 of 3,883 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 (969 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 120.3 s, ⚠️ public_headers 88.4 s, ⚠️ agc_shader_sampler_limits 33.0 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 8 of the last 10 main runs
guest_pthread_start: failed in 1 of the last 10 main runs
Failing on main too (7, not counted against this PR)
agc_driver_image_table
agc_driver_native_depth_bda_clear
agc_driver_native_multisample_depth
agc_submit_progress
agc_submit_progress_no_timeline
guest_mmap_executable
guest_socket_options_multicast
Validated but not compared (1, not in the main baseline's validation pass)
agc_driver_pipelined_clock_copy
Validation IDs already present on main (8 IDs in 542 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (542 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 534 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 (2 tests): agc_driver_prepared_exports, agc_driver_srgb8_color_target
VUID-VkSamplerCreateInfo-addressModeU-01079 (1 test): agc_driver_image_gather_volume
VUID-VkSamplerCreateInfo-addressModeU-parameter (1 test): agc_driver_image_gather_volume
VUID-VkSamplerCreateInfo-addressModeV-parameter (1 test): agc_driver_image_gather_volume
VUID-VkSamplerCreateInfo-addressModeW-parameter (1 test): agc_driver_image_gather_volume
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_gcn_display_present: skipped, no display: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
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_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 V
Reproduce
git fetch origin 12bc59908d00b0bcdd3d4c4a82e28bc46cc0be68 5b1d381d5ad5d9f923326b18479c3bd889cdd588
git checkout 5b1d381d5ad5d9f923326b18479c3bd889cdd588 && git merge --no-ff 12bc59908d00b0bcdd3d4c4a82e28bc46cc0be68
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 12bc599 merged onto main b11c7bf · tested 2026-11-04 14:23 UTC · 21 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) · 49 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,825 of 3,894 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 (975 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 120.2 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 3 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
Validation IDs already present on main (13 IDs in 545 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (545 tests): agc_driver, agc_driver_address_draw_space_reuse, 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, and 537 more
VUID-VkShaderModuleCreateInfo-pCode-08737 (8 tests): agc_driver_dpp16_operands, agc_driver_dpp8_pk_fmac, agc_driver_dx10_clamp, agc_driver_float16_fma_rounding, agc_driver_float16_unused_nan_payloads, agc_driver_packed_alu, agc_driver_packed_f16_denormal_modes, agc_driver_packed_float16_native
VUID-VkShaderModuleCreateInfo-pCode-08739 (8 tests): agc_driver_dpp16_operands, agc_driver_dpp8_pk_fmac, agc_driver_dx10_clamp, agc_driver_float16_fma_rounding, agc_driver_float16_unused_nan_payloads, agc_driver_packed_alu, agc_driver_packed_f16_denormal_modes, agc_driver_packed_float16_native
VUID-VkShaderModuleCreateInfo-pCode-08741 (8 tests): agc_driver_dpp16_operands, agc_driver_dpp8_pk_fmac, agc_driver_dx10_clamp, agc_driver_float16_fma_rounding, agc_driver_float16_unused_nan_payloads, agc_driver_packed_alu, agc_driver_packed_f16_denormal_modes, agc_driver_packed_float16_native
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 (2 tests): agc_driver_prepared_exports, agc_driver_srgb8_color_target
VUID-VkPipelineShaderStageCreateInfo-module-parameter (1 test): agc_driver_float16_unused_nan_payloads
VUID-VkPipelineShaderStageCreateInfo-pSpecializationInfo-06849 (1 test): agc_driver_float16_unused_nan_payloads
VUID-VkSamplerCreateInfo-addressModeU-01079 (1 test): agc_driver_image_gather_volume
VUID-VkSamplerCreateInfo-addressModeU-parameter (1 test): agc_driver_image_gather_volume
VUID-VkSamplerCreateInfo-addressModeV-parameter (1 test): agc_driver_image_gather_volume
VUID-VkSamplerCreateInfo-addressModeW-parameter (1 test): agc_driver_image_gather_volume
Skipped (49)
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_gcn_display_present: skipped, no display: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
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 av
Reproduce
git fetch origin 12bc59908d00b0bcdd3d4c4a82e28bc46cc0be68 b11c7bf84f5d2f636ff60166cc3371bd071e24d5
git checkout b11c7bf84f5d2f636ff60166cc3371bd071e24d5 && git merge --no-ff 12bc59908d00b0bcdd3d4c4a82e28bc46cc0be68
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 removed the needs rebase Conflicts with main, rebase needed label Nov 4, 2026
@milescoviello

Copy link
Copy Markdown
Contributor

A third title for this change: Metal Gear Solid 4 (PPSA18194, Master Collection) on Linux. RTX 4070 Ti, NVIDIA 615.71.09, Release libraries. I compared main 9a4bcc3018 with head 12bc59908d merged onto it (9c39f4c941), running to the title tree and idling there for 120 s.

Drains. One run per build with APS5_PROFILE_DRAW=1 APS5_TRACE_DRAW_CACHE=1, read from the [draw] pipelined lines:

drains: packet, per 10 s time in those drains
main 19,941 and 20,132 489 and 484 ms
this PR 600 and 623 11 and 16 ms

On main, the queue runs about 41k COPY_DATA per 10 s. The packet drains by opcode lines put nearly all the drains on them: 0x40 x20832 0x15 x16, 0x40 x20791 0x15 x13.

Frame rate. Four plain runs, alternating main / PR / main / PR, rows from 40 s on:

fps queue worker busy
main 59.9 / 59.9 97.3% / 95.5%
this PR 59.9 / 59.9 97.0% / 94.2%

The title tree is held at the 60 fps cap. At that cap, the ~470 ms per 10 s of worker time the change saves shows only as a point or so of worker busy, which is within the run-to-run spread. No crash or regression in any run.

AI-assisted: yes (Claude Code)

@JJenkx

JJenkx commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Found a GDS destination ordering regression in this head, with a reproducer and proposed correction.

Pm4::Execute resolves a GDS destination to GdsAddress() + packet[4], but the new keepsDrawPipeline check compares pending writes against the raw encoded offset. An overlapping earlier pipeline write is therefore missed. The regression fixture queues a write to GDS offset 256, then submits a GPU-clock COPY_DATA to that same GDS location. With this PR, the earlier write overwrites the clock store.

  • Baseline: fixture passes 3/3.
  • This PR: fails with GDS clock copy was overwritten by an earlier pending pipeline write.
  • Proposed correction: fixture passes 3/3. It resolves the effective GDS address before testing overlap, preserving the existing ordinary-memory check.

This fixture tests CPU command/pipeline ordering and creates no Vulkan device. Separately, the same four focused Vulkan groups (agc_driver, agc_driver_pipelined_clock_copy, agc_driver_pipelined_dma, agc_driver_pm4) pass 3/3 each on the original PR and on the correction: RX 6650 XT/RADV, Khronos validation loaded, zero skips or VUIDs. Conventions: zero errors.

Correction and registered regression test · logs, patch and receipts

Test source: main 65351c2931ec with common #9999/#11630 integration, then this PR 12bc59908d00 (90aac4b2314a), then the correction (ac8f9390623d). This is scoped integration evidence, not a latest-main or FPS-gain claim. Archive SHA-256: 3c920c5735f370069ce3f5b89d44a2774137bc1db388d8aa2f802f07f8e6fa4e.

AI-assisted: yes.

@blawesom

Copy link
Copy Markdown
Contributor

Validation result (item 7 of batch wt5): GREEN — no regression

Environment: CachyOS, kernel 7.3.4-1-cachyos, x86-64, Ryzen 7 9800X3D, AMD Radeon RX 9070 XT (RADV, GFX1201) + AI PRO R9700, /dev/kfd present. Linux only.

SHAs

  • Base (origin/main, reused read-only build at /home/benj/scratch/wt5/base-main, HEAD verified, no tracked mods, build/build.ninja present): a9f291040088cac6babfbe270c50f344a4f6f27d
  • PR head tested: 12bc59908d00b0bcdd3d4c4a82e28bc46cc0be68 (worktree /home/benj/scratch/wt5/pr-7963, submodules initialized)

Build lock: /tmp/opencode/build.lock. Wait 10 s for the first acquisition (14:36:24+01:00); the lock was removed underneath by another batch agent's release mid-section (lock-protocol race observed: item6/item8/item10 builds were running concurrently), so the build/test section re-acquired at 15:09:27+01:00 (wait 0 s, stale lock age 54565 s removed per protocol). Tests ran under the held lock; lock released 15:11:42+01:00.

Build (PR tree, inside lock, CMAKE_BUILD_PARALLEL_LEVEL=12 MAKEFLAGS=-j12, --parallel 12 only):

  • cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DBUILD_TESTING=ON → exit=0, wall=23 s (log item7-pr7963-configure.log)
  • cmake --build build --parallel 12 → exit=0 (log item7-pr7963-build.log; initial invocation 14:38:07→~15:07 reached 7423/7424 before its wrapper was killed externally while ninja continued; resume at 15:09:29 exit=0 wall=1 s finished the remaining edges; follow-up recheck exit=0). Total build wall ≈ 29 min under CPU contention from other batch agents.

Focused test pattern (identical set verified by diffing ctest --test-dir build -N -R output of both trees — 13 tests in each; saved item7-pattern.txt, item7-pattern-tests-base.txt, item7-pattern-tests-pr.txt):

^(agc_driver|agc_copy_data|agc_driver_pm4|agc_driver_pm4_failure|agc_driver_pm4_ring|agc_driver_pm4_replay|agc_driver_calibrated_clock|agc_driver_shader_clock|agc_subgroup_clock|agc_wait_on_address_size|agc_driver_same_queue_label_wait|agc_completion_label_wait|agc_driver_copied_writer_label_order_drain)$

agc_driver is the Submit.cpp suite containing the PR's testGpuClockCopyBehindGpuWork. The PR-only new test agc_driver_pipelined_clock_copy has no base counterpart, so it is outside the identical-set comparison.

Test command (identical env, both trees, inside lock, timeout 3600 each):

ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_ADD_LAYER_PATH=/tmp/opencode/vvl-layer VK_LOADER_DEBUG=layer ANYPS5_GPU='AMD Radeon RX 9070 XT' ctest --test-dir build -R '<pattern>' -V

Results base vs head (logs item7-tests-base.log, item7-tests-pr.log):

  • base: exit=0, wall=14 s — 100% tests passed out of 13 (12 Passed, agc_driver_copied_writer_label_order_drain Skipped via skip-code 77, both trees)
  • head: exit=0, wall=12 s — 100% tests passed out of 13, identical per-test outcomes (same 12 Passed, same 1 Skipped); agc_driver Passed 12.95 s (base) vs 11.09 s (head)

Layer checks (per AGENTS.md):

  • Insert instance layer "VK_LAYER_KHRONOS_validation" present: 8× in base log, 8× in PR log
  • was not found but was requested by env var VK_INSTANCE_LAYERS: 0 occurrences in both logs (absent ✓)

VUID / hazard diff: VUID- count 0 in both logs; SYNC-HAZARD 0 in both; Validation Error|Validation Warning lines 0 in both. Per-test bracketed IDs: none in either log. New IDs on head vs base: none.

Push: tested SHA pushed to fork as refs/heads/validation/pr-7963 → 12bc59908d00b0bcdd3d4c4a82e28bc46cc0be68 (blawesom/AnyPS5).

Verdict: PASS — build clean, focused AGC COPY_DATA/GPU-clock/drain/wait/pm4 set identical outcomes on base and head, validation layer inserted in both, no new VUID-/SYNC-HAZARD diagnostics on the PR head.

Limitations: focused 13-test set only (not the full suite); single run per tree, no repetition; the PR's new agc_driver_pipelined_clock_copy execution test exists only on the PR head and is not part of the identical-set comparison (the agc_driver Submit suite that covers the change did run and pass on both); Linux/AMD RADV GFX1201 only — no NVIDIA/Intel/AMD-pro/other-driver or Windows coverage; build executed under lock contention from other batch agents on the shared machine.

@oneandonlydean
oneandonlydean merged commit 35ab037 into boykopovar:main Nov 14, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc*

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants