Skip to content

perf(agc): copy contiguous rows of a drawn linear target store in one region - #10656

Open
thuanquang wants to merge 1 commit into
boykopovar:mainfrom
thuanquang:perf/linear-target-store-merged-copies
Open

thuanquang wants to merge 1 commit into
boykopovar:mainfrom
thuanquang:perf/linear-target-store-merged-copies

Conversation

@thuanquang

@thuanquang thuanquang commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

What

StorageTexture::storeDrawnRect stores a drawn linear target's rectangles in two steps. It copies the image into a scratch buffer, then the scratch buffer into the host import, and also into the target's saved bytes when the target is outside the write watch. Each copy uses one VkBufferCopy region per span that drawnSpans returns. drawnSpans returns one span per row, so storing a full-width rectangle issued one region per row: about 2048 regions for a 3072x2048 target.

In both copies, regions that are contiguous in both the source and the destination are now merged into one. Storing whole rows of a target without row padding becomes one region per import segment, split only where a 64 KiB block is kept for the CPU. The stored bytes, the stamps and the settle after the store are unchanged; only the number of regions changes.

Why

PPSA14363 (METAL GEAR SOLID - Master Collection Version, own dump): on the PS1 part's codec screen, the PS1 renderer redraws a whole 3072x2048 linear color target (found with a local diagnostic build). StoreDrawnLinear("flip") stores it through storeDrawnRect; before this change, the store used one copy region per row. In the trace pair below, the queue worker submits one GPU batch per present, inside Driver.Packet.flip_flush, the stage that also runs StoreDrawnLinear("flip"). At about every second present that stage takes 0.1 ms or more, and the batch it submits then holds the store together with the rest of that frame's GPU work. Every leg has 598 to 600 such batches per 1199 presents, at p50 9.90 ms on main and 7.54 ms with this change. The other batches take p50 1.05 ms on both arms, and their total differs by at most 0.013 ms per present between the arms.

Trace pair: main against this head merged onto it, on the RX 6700 XT (AMD driver 32.0.21045.16010, shown as 26.10.1 in the summary lines; Windows 11, build 26300 in the summary lines). Four legs in two exclusive pairs (main, PR, main, PR), 2026-11-12 12:17-12:38 UTC.

  • Base: main f57c971559a8dcacdb7b090ad5f4a82b7633ea96.
  • Change: a00f02a4d168f86d0a269052dfcae0177f38fe7a, this head fdea400fce merged onto that main (evidence/10656-main-f57c). Both are full builds of clean trees.
  • Scene: the codec screen, reached by the same scripted pad timeline from the same save, sent 25 s after launch. Window: APS5_TRACE_SECONDS=95:20; the four windows start at presents 5537 to 5653. The measured legs dump no frames.
  • The log is not redirected: each leg starts the emulator in its own console window, and nothing writes its stdout or stderr to a file. The summary env holds only APS5_TRACE_SECONDS, APS5_PAD_INPUT_FILE and APS5_NO_PAD_INPUT. No other game ran: before each leg the pair runner checks for running games, and the process list showed no game process when I checked it between and after the pairs. The caches were warm: both run folders had run the same route in six legs earlier that hour. Since the log is not kept, the shader cache hit counts quoted for the earlier pair are not available for this one.
leg build commit presents frame p50 / p99 / max GPU busy per present
1 main f57c971559a8 1199 16.683 / 17.415 / 17.804 ms 5.377 ms
2 change a00f02a4d168 1199 16.683 / 17.365 / 17.719 ms 4.275 ms
3 main f57c971559a8 1199 16.683 / 17.163 / 17.358 ms 5.312 ms
4 change a00f02a4d168 1199 16.684 / 17.304 / 17.649 ms 4.211 ms

tools/performance_compare.py --require-matching-context, main first: GPU busy per present -1.10 (legs 1/2), -1.04 (3/2) and -1.10 ms (3/4). Between legs of the same build it differs by 0.065 ms (main) and 0.064 ms (change). The mean frame is 16.683-16.684 ms in all four legs, at the 60 Hz cap, so the change frees GPU time without moving the frame time here.

tools/trace_digest.py:

**seconds 95:20** from present 5650: 1199 presents, frame p50 16.7 / p90 16.9 / p99 17.4 / max 17.8 ms, GPU busy 5.4 ms per present
**seconds 95:20** from present 5653: 1199 presents, frame p50 16.7 / p90 16.9 / p99 17.4 / max 17.7 ms, GPU busy 4.3 ms per present
**seconds 95:20** from present 5537: 1199 presents, frame p50 16.7 / p90 16.9 / p99 17.2 / max 17.4 ms, GPU busy 5.3 ms per present
**seconds 95:20** from present 5642: 1199 presents, frame p50 16.7 / p90 16.9 / p99 17.3 / max 17.6 ms, GPU busy 4.2 ms per present
Summary lines, legs 1-4
{"commit":"f57c971559a8","dirty":false,"env":{"APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_SECONDS":"95:20"},"gpu":"AMD Radeon RX 6700 XT","driver":"AMD proprietary driver 26.10.1 (AMD proprietary shader compiler)","os":"Windows 10.0.26300","cpu":"AMD Ryzen 5 5600X 6-Core Processor","cpu_threads":12,"memory_mib":32690,"title_id":"PPSA14363","title":"METAL GEAR SOLID - Master Collection Version","content_version":"03.000.000","resolution":"1920x1080","window":{"spec":"seconds 95:20","first_present":5650,"ms":20003.421},"presents":1199,"frame_ms":{"p50":16.683,"p90":16.909,"p99":17.415,"max":17.804},"gpu_busy_ms_per_present":5.377,"worker_busy_pct":{"queue worker 0x0":25.107},"top_phases_ms_per_frame":{"VideoOut.Flip":11.011,"VideoOut.Flip.vblank_wait":9.927,"Driver.Packet":4.183,"Driver.Packet.flip_flush":3.572,"Recorder.Sync":3.366,"VideoOut.Flip.present":0.987,"Driver.Present":0.985,"Driver.Present.queue_present":0.628},"owned_draw_counts":{},"trace_dropped":false,"trace":"aps5-trace-f57c971559a8-17900.json.gz"}
{"commit":"a00f02a4d168","dirty":false,"env":{"APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_SECONDS":"95:20"},"gpu":"AMD Radeon RX 6700 XT","driver":"AMD proprietary driver 26.10.1 (AMD proprietary shader compiler)","os":"Windows 10.0.26300","cpu":"AMD Ryzen 5 5600X 6-Core Processor","cpu_threads":12,"memory_mib":32690,"title_id":"PPSA14363","title":"METAL GEAR SOLID - Master Collection Version","content_version":"03.000.000","resolution":"1920x1080","window":{"spec":"seconds 95:20","first_present":5653,"ms":20003.272},"presents":1199,"frame_ms":{"p50":16.683,"p90":16.898,"p99":17.365,"max":17.719},"gpu_busy_ms_per_present":4.275,"worker_busy_pct":{"queue worker 0x0":13.016},"top_phases_ms_per_frame":{"VideoOut.Flip":13.055,"VideoOut.Flip.vblank_wait":11.927,"Driver.Packet":2.166,"Driver.Packet.flip_flush":1.551,"Recorder.Sync":1.385,"VideoOut.Flip.present":0.998,"Driver.Present":0.996,"Driver.Present.queue_present":0.628},"owned_draw_counts":{},"trace_dropped":false,"trace":"aps5-trace-a00f02a4d168-21152.json.gz"}
{"commit":"f57c971559a8","dirty":false,"env":{"APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_SECONDS":"95:20"},"gpu":"AMD Radeon RX 6700 XT","driver":"AMD proprietary driver 26.10.1 (AMD proprietary shader compiler)","os":"Windows 10.0.26300","cpu":"AMD Ryzen 5 5600X 6-Core Processor","cpu_threads":12,"memory_mib":32690,"title_id":"PPSA14363","title":"METAL GEAR SOLID - Master Collection Version","content_version":"03.000.000","resolution":"1920x1080","window":{"spec":"seconds 95:20","first_present":5537,"ms":20003.360},"presents":1199,"frame_ms":{"p50":16.683,"p90":16.892,"p99":17.163,"max":17.358},"gpu_busy_ms_per_present":5.312,"worker_busy_pct":{"queue worker 0x0":24.989},"top_phases_ms_per_frame":{"VideoOut.Flip":10.929,"VideoOut.Flip.vblank_wait":9.786,"Driver.Packet":4.163,"Driver.Packet.flip_flush":3.505,"Recorder.Sync":3.291,"VideoOut.Flip.present":1.037,"Driver.Present":1.035,"Driver.Present.queue_present":0.664},"owned_draw_counts":{},"trace_dropped":false,"trace":"aps5-trace-f57c971559a8-15596.json.gz"}
{"commit":"a00f02a4d168","dirty":false,"env":{"APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_SECONDS":"95:20"},"gpu":"AMD Radeon RX 6700 XT","driver":"AMD proprietary driver 26.10.1 (AMD proprietary shader compiler)","os":"Windows 10.0.26300","cpu":"AMD Ryzen 5 5600X 6-Core Processor","cpu_threads":12,"memory_mib":32690,"title_id":"PPSA14363","title":"METAL GEAR SOLID - Master Collection Version","content_version":"03.000.000","resolution":"1920x1080","window":{"spec":"seconds 95:20","first_present":5642,"ms":20003.309},"presents":1199,"frame_ms":{"p50":16.684,"p90":16.910,"p99":17.304,"max":17.649},"gpu_busy_ms_per_present":4.211,"worker_busy_pct":{"queue worker 0x0":21.972},"top_phases_ms_per_frame":{"VideoOut.Flip":11.342,"VideoOut.Flip.vblank_wait":10.166,"Driver.Packet":3.659,"Driver.Packet.flip_flush":2.944,"Recorder.Sync":2.745,"VideoOut.Flip.present":1.061,"Driver.Present":1.059,"Driver.Present.queue_present":0.670},"owned_draw_counts":{},"trace_dropped":false,"trace":"aps5-trace-a00f02a4d168-17252.json.gz"}

The traces, digests, summary lines and the pair's score are on my fork at https://github.com/thuanquang/AnyPS5/tree/evidence/10656-main5084-traces (folder codec-95-20-main-f57c-head-fdea). The traces hold only timings and emulator scope and thread names; the digests and summary lines add the machine, the commits and the title.

Earlier pair (2026-10-31, main 50843f4, previous head; the log was redirected)

Trace pair: main against this change merged onto it, on the RX 6700 XT (AMD driver 32.0.21045.16010, shown as 26.10.1 in the summary lines; Windows 11 26200). Four legs in two exclusive pairs (main, PR, main, PR), 2026-10-31 19:54-20:18 UTC.

  • Base: main 50843f45d95b60e5772f4396431f9a39b8709d72.
  • Change: ba38183755751d4f1ddd223d9d402b333fbe076b, this PR's previous head fe506b00d0 merged onto that main (evidence/10656-main5084). The head named under Tested, fdea400fce, is 976a71c337 rebased onto main 2a3df01d6f (git range-diff shows only context lines moved; the conflict was two blocks added next to each other in Texture.hpp/Texture.cpp). 976a71c337 is the same change as one commit on main f2d874c1fd: git diff 50843f45d9 ba38183755 and git diff f2d874c1fd 976a71c337 add and remove the same 57 lines in the same order, and only the counter declaration sits at another line. storeDrawnRect, drawnSpans and StoreDrawnLinear are textually identical on both main commits.
  • Scene: the codec screen, reached by a scripted pad timeline from the same save, sent 25 s after launch. Window: APS5_TRACE_SECONDS=95:20; the four windows start at presents 5652 to 5659. I located the codec with frame dumps in an earlier shared run of the same route on main 319621ba2e; the measured legs dump no frames.
  • The summary env holds only APS5_TRACE_SECONDS, APS5_PAD_INPUT_FILE and APS5_NO_PAD_INPUT. The caches were warm: the shader disk cache reports 54 hits and 0 misses in every leg. One box of the performance form is not met: our launcher wrote the emulator's stdout and stderr to a file in all four legs, and the form asks not to redirect the log. Before each leg it waits until no build or other game is running and the CPU is idle; that check allows League of Legends and does not log it, so it may have been open.
leg build commit presents frame p50 / p99 / max GPU busy per present
1 main 50843f45d95b 1199 16.683 / 17.315 / 17.699 ms 5.490 ms
2 change ba3818375575 1199 16.683 / 17.263 / 17.742 ms 4.348 ms
3 main 50843f45d95b 1199 16.683 / 17.289 / 17.435 ms 5.542 ms
4 change ba3818375575 1199 16.683 / 17.212 / 17.719 ms 4.337 ms

tools/performance_compare.py --require-matching-context, main first: GPU busy per present -1.142 (legs 1/2), -1.194 (3/2) and -1.205 ms (3/4). Between legs of the same build it differs by 0.052 ms (main) and 0.011 ms (change). The mean frame is 16.683 ms in all four legs, at the 60 Hz cap, so the change frees GPU time without changing the frame rate on this GPU.

tools/trace_digest.py:

**seconds 95:20** from present 5655: 1199 presents, frame p50 16.7 / p90 16.9 / p99 17.3 / max 17.7 ms, GPU busy 5.5 ms per present
**seconds 95:20** from present 5652: 1199 presents, frame p50 16.7 / p90 16.9 / p99 17.3 / max 17.7 ms, GPU busy 4.3 ms per present
**seconds 95:20** from present 5658: 1199 presents, frame p50 16.7 / p90 16.9 / p99 17.3 / max 17.4 ms, GPU busy 5.5 ms per present
**seconds 95:20** from present 5659: 1199 presents, frame p50 16.7 / p90 16.9 / p99 17.2 / max 17.7 ms, GPU busy 4.3 ms per present
Summary lines, legs 1-4
{"commit":"50843f45d95b","dirty":false,"env":{"APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_SECONDS":"95:20"},"gpu":"AMD Radeon RX 6700 XT","driver":"AMD proprietary driver 26.10.1 (AMD proprietary shader compiler)","os":"Windows 10.0.26200","cpu":"AMD Ryzen 5 5600X 6-Core Processor","cpu_threads":12,"memory_mib":32690,"title_id":"PPSA14363","title":"METAL GEAR SOLID - Master Collection Version","content_version":"03.000.000","resolution":"1920x1080","window":{"spec":"seconds 95:20","first_present":5655,"ms":20003.475},"presents":1199,"frame_ms":{"p50":16.683,"p90":16.912,"p99":17.315,"max":17.699},"gpu_busy_ms_per_present":5.490,"worker_busy_pct":{"queue worker 0x0":4.523},"top_phases_ms_per_frame":{"VideoOut.Flip":14.529,"VideoOut.Flip.vblank_wait":13.403,"VideoOut.Flip.present":1.013,"Driver.Present":1.012,"Driver.Packet":0.751,"Driver.Present.queue_present":0.644,"Vulkan.QueuePresent":0.643,"Vulkan.QueuePresent.queue_present":0.640},"trace_dropped":false,"trace":"aps5-trace-50843f45d95b-9088.json.gz"}
{"commit":"ba3818375575","dirty":false,"env":{"APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_SECONDS":"95:20"},"gpu":"AMD Radeon RX 6700 XT","driver":"AMD proprietary driver 26.10.1 (AMD proprietary shader compiler)","os":"Windows 10.0.26200","cpu":"AMD Ryzen 5 5600X 6-Core Processor","cpu_threads":12,"memory_mib":32690,"title_id":"PPSA14363","title":"METAL GEAR SOLID - Master Collection Version","content_version":"03.000.000","resolution":"1920x1080","window":{"spec":"seconds 95:20","first_present":5652,"ms":20003.363},"presents":1199,"frame_ms":{"p50":16.683,"p90":16.907,"p99":17.263,"max":17.742},"gpu_busy_ms_per_present":4.348,"worker_busy_pct":{"queue worker 0x0":4.461},"top_phases_ms_per_frame":{"VideoOut.Flip":14.533,"VideoOut.Flip.vblank_wait":13.405,"VideoOut.Flip.present":1.012,"Driver.Present":1.009,"Driver.Packet":0.741,"Driver.Present.queue_present":0.631,"Vulkan.QueuePresent":0.630,"Vulkan.QueuePresent.queue_present":0.628},"trace_dropped":false,"trace":"aps5-trace-ba3818375575-19668.json.gz"}
{"commit":"50843f45d95b","dirty":false,"env":{"APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_SECONDS":"95:20"},"gpu":"AMD Radeon RX 6700 XT","driver":"AMD proprietary driver 26.10.1 (AMD proprietary shader compiler)","os":"Windows 10.0.26200","cpu":"AMD Ryzen 5 5600X 6-Core Processor","cpu_threads":12,"memory_mib":32690,"title_id":"PPSA14363","title":"METAL GEAR SOLID - Master Collection Version","content_version":"03.000.000","resolution":"1920x1080","window":{"spec":"seconds 95:20","first_present":5658,"ms":20003.510},"presents":1199,"frame_ms":{"p50":16.683,"p90":16.907,"p99":17.289,"max":17.435},"gpu_busy_ms_per_present":5.542,"worker_busy_pct":{"queue worker 0x0":4.529},"top_phases_ms_per_frame":{"VideoOut.Flip":14.550,"VideoOut.Flip.vblank_wait":13.452,"VideoOut.Flip.present":0.985,"Driver.Present":0.982,"Driver.Packet":0.752,"Driver.Present.queue_present":0.607,"Vulkan.QueuePresent":0.605,"Vulkan.QueuePresent.queue_present":0.603},"trace_dropped":false,"trace":"aps5-trace-50843f45d95b-2788.json.gz"}
{"commit":"ba3818375575","dirty":false,"env":{"APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_SECONDS":"95:20"},"gpu":"AMD Radeon RX 6700 XT","driver":"AMD proprietary driver 26.10.1 (AMD proprietary shader compiler)","os":"Windows 10.0.26200","cpu":"AMD Ryzen 5 5600X 6-Core Processor","cpu_threads":12,"memory_mib":32690,"title_id":"PPSA14363","title":"METAL GEAR SOLID - Master Collection Version","content_version":"03.000.000","resolution":"1920x1080","window":{"spec":"seconds 95:20","first_present":5659,"ms":20003.334},"presents":1199,"frame_ms":{"p50":16.683,"p90":16.896,"p99":17.212,"max":17.719},"gpu_busy_ms_per_present":4.337,"worker_busy_pct":{"queue worker 0x0":4.415},"top_phases_ms_per_frame":{"VideoOut.Flip":14.523,"VideoOut.Flip.vblank_wait":13.458,"VideoOut.Flip.present":0.982,"Driver.Present":0.980,"Driver.Packet":0.733,"Driver.Present.queue_present":0.605,"Vulkan.QueuePresent":0.603,"Vulkan.QueuePresent.queue_present":0.601},"trace_dropped":false,"trace":"aps5-trace-ba3818375575-7124.json.gz"}

The traces, digests and summary lines are on my fork at https://github.com/thuanquang/AnyPS5/tree/evidence/10656-main5084-traces (folder codec-95-20). The traces hold only timings and emulator scope and thread names; the digests and summary lines add the machine, the commits and the title.

Open PRs on the same code. #10159's Texture.cpp merges into this head's without a conflict. #8246's Texture.cpp and Texture.hpp merge without a textual conflict too, but as #8246 stands (head 9377004c3c), writeBackLayers calls storeDrawnRect only when no pre-draw snapshot exists, and PrepareLinearDraw takes one for each linear target a recorded draw writes. Read from the code, not run: with #8246, a store like the codec's would no longer reach the code this PR changes. The merge order with #8246 is not agreed yet.

Tested

Windows 11 26200, Radeon RX 6700 XT (gfx1031), AMD driver 32.0.21045.16010, WinLibs GCC 15.2.0 r7, Release, BUILD_TESTING=ON, on this head fdea400fce (main 2a3df01d6f).

New case in agc_driver_linear_target_rectangle_bound: on a 64x256 RGBA32F linear target (rows contiguous, one import segment), it draws one seed pixel and waits for the device to go idle, which stores the target, then draws a full-width scissor over 128 rows and waits again. It checks every pixel: the band must hold the band draw's output, the seed pixel the seed draw's output, and every other pixel the initial bytes. Through a new StorageTexture::TakeDrawnStoreCounts, it also checks that the band's store used one copy region per destination: one when the target stays write-watched, two when it is outside the write watch (the import and the saved bytes). On this machine the band was outside the write watch at the store, so both merged copies ran (two regions). The write-watched branch, which has only the import copy, did not run here.

  • Red (on the earlier head 976a71c337), with only the region merge reverted (append back to push_back, the counter kept), 3 of 3: AGC graphics: a drawn linear target's store copied contiguous whole rows in more than one region per copy.
  • Green: on this head, 1 of 1 with ctest -V under the validation layer (below), and 3 of 3 inside the suite runs; on 976a71c337 3 of 3: linear target rectangle bound, full-width band of 128 rows, unwatched memory: 1 stores in 2 copy regions (expected 1 in 2), wrong drawn pixels 0, changed untouched pixels 0.

ctest -R "^agc_driver_(linear_target|bda_)" (21 entries) with ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1: 21 of 21 in each of 3 runs, on main 2a3df01d6f and on this head. With VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation added to the same two variables (one run each, with ctest -V, VK_LOADER_DEBUG=layer and VK_LOADER_LAYERS_DISABLE=~implicit~):

  • main: 21 of 21, layer inserted 24 times, no "was not found" line, 0 VUID- lines;
  • this head: 21 of 21, layer inserted 24 times, no "was not found" line, 0 VUID- lines.

On the earlier head fe506b00d0 (on #9685's head d6d8966bba, main b930da950d): ctest -R "^(agc|shader)_" passed 1011 of 1014. The 3 failures are the sample_order tests that main fails on this GPU.

Runs by others in this thread, on other bases (supporting only):

  • JulesB40 (NVIDIA GeForce RTX 4070 Laptop GPU, driver 616.92, Windows 11), fe506b00d0 merged onto d4cb89300f: all 1,125 agc_ tests match that main.
  • TechLevelZero's NVIDIA CI (RTX 2000 Ada Generation, driver 595.99.02, Ubuntu 26.04.1), fe506b0 merged onto 73f4f7e: 0 new failures. Its test selection did not include agc_driver_linear_target_rectangle_bound.

Linux path, WSL2 Ubuntu 24.04 with lavapipe (Mesa 25.2.8), GCC 13, Release, on the earlier head 976a71c337: the new case passes 3 of 3 with APS5_WRITE_WATCH_IMPORTS=unwatch and 1 of 1 with the default, each with linear target rectangle bound, full-width band of 128 rows, unwatched memory: 1 stores in 2 copy regions (expected 1 in 2), wrong drawn pixels 0, changed untouched pixels 0. WSL2's kernel has no guest write watch, so the band is outside it in both modes.

Not tested: the write-watched branch of the new case (its memory was outside the write watch on both machines), and macOS.

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 6700 XT (gfx1031), AMD Windows driver 32.0.21045.16010, Windows 11 26200; NVIDIA GeForce RTX 4070 Laptop GPU, driver 616.92, Windows 11 (JulesB40, on d4cb89300f); NVIDIA RTX 2000 Ada Generation, driver 595.99.02, Ubuntu 26.04.1 (TechLevelZero CI, on 73f4f7e, without the new case)
  • AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

@github-actions github-actions Bot added the perf Performance change label Oct 24, 2026

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The implementation’s merge condition is appropriately limited to adjacent regions whose source and destination offsets are both contiguous, and the focused test checks the resulting region count and bytes. I also see the reported RX 6700 XT validation run, including 54/54 focused Vulkan validation checks with no VUID lines; those are author-reported results, not runs I reproduced. The hosted product jobs were skipped.

The performance evidence still does not meet the repository requirement for a perf PR: the report compares the change against #9879 (5575dc3108), not main against this PR, and the two trace files are not attached. The stated reason (commercial title content) explains the omission but does not replace the required captures. Please provide compliant paired main/PR summaries and attach traces, or remove the performance claim/title/label and keep this as a correctness/optimization change without a measured speed claim. The current checklist also says Depends on: #9685, while the text says merge #9685 first; please ensure the dependency remains explicit and the complete diff is reviewed after #9685 lands.

@github-actions

github-actions Bot commented Oct 24, 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 21669 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp L159

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/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 1395 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 4448 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 5609 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6188 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6192 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6197 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6209 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6280 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6481 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 7085 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 7642 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 9508 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 10193 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 10442 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 10743 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 11444 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 12746 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 12792 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 13251 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 13863 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 13920 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 13928 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 13929 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 15621 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 18173 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 18185 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 20183 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 20315 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 20580 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 21238 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 22190 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 22531 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 22647 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 24445 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 25610 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The expanded body adds useful red/green evidence for the region-count change and reports the GPU-validation suite. The performance pair still needs a reproducible commit mapping before it can support this PR: the summaries compare #9879 head 5575dc3 with 500e4c227069 (described as the first version of this commit), while the current PR head is fe506b0 and its declared dependency is #9685 at d6d8966. Please rerun the paired trace on the same machine/scene using the current dependency stack as the base and this exact PR head as the candidate, then state both full commit IDs and include the resulting trace_digest summaries. Raw title traces need not be attached if that would disclose protected content; the summaries should identify the exact source commits and show the same scene/window. The local regression and validation-layer results are useful separately, but they do not resolve this attribution gap.

@thuanquang

Copy link
Copy Markdown
Contributor Author

@MarcZX10 Thanks. I reran the pair with the commit mapping you asked for and replaced the evidence in the description:

The base is #9879 rather than #9685 alone because in PPSA14363 these targets only reach storeDrawnRect once #9879 creates their host imports; with #9685 alone they are drawn synchronously and the changed code does not run in this scene. Same machine and scene for all four runs (RX 6700 XT, the codec screen, warm caches, gpu and build locks held, nothing else on the GPU, APS5_TRACE_SECONDS=160:30, no profiling switch), alternating base and candidate:

run build commit presents frame p99 frame max GPU busy per present
1 base 5575dc3108c7 1799 17.1 ms 17.6 ms 5.717 ms
2 candidate b12e6b60f9a0 1799 17.2 ms 17.6 ms 4.570 ms
3 candidate b12e6b60f9a0 1799 17.4 ms 17.8 ms 4.527 ms
4 base 5575dc3108c7 1799 17.2 ms 17.6 ms 5.560 ms

tools/performance_compare.py on each pair: GPU busy per present -1.147 ms (-20.1 %) and -1.033 ms (-18.6 %), mean frame 16.683 ms on both sides. The trace_digest.py header of each run, both pairs' compare rows and the summary lines of runs 1 and 2 are in the description. The traces are not attached (commercial title); every number is read from them unchanged.

On the dependency: the checklist keeps Depends on: #9685, and the description states the merge order (#9685 first). Once #9685 lands I will merge main here so the diff shows only this change.

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The updated description now supplies an attributable base/candidate pair (5575dc3108c7 and b12e6b60f9a0), confirms the candidate is exactly this PR’s diff on the declared stack, and includes trace-digest summaries and paired runs. That resolves the commit-mapping gap I raised. One repository-required item remains: CONTRIBUTING.md says a speed claim must attach the traces. The description says the captures are not attached because they come from a commercial title. Please attach the required captures, or remove the speed claim and perf classification and retain the correctness/region-count evidence. I have not independently reproduced the Windows GPU runs.

@thuanquang

Copy link
Copy Markdown
Contributor Author

@MarcZX10 The four traces behind the table are now attached, as files on our fork: https://github.com/thuanquang/AnyPS5/tree/evidence/10656-traces

run build commit trace
1 base 5575dc3108c7 aps5-trace-5575dc3108c7-15592.json.gz
2 candidate b12e6b60f9a0 aps5-trace-b12e6b60f9a0-19400.json.gz
3 candidate b12e6b60f9a0 aps5-trace-b12e6b60f9a0-20084.json.gz
4 base 5575dc3108c7 aps5-trace-5575dc3108c7-27404.json.gz

They hold only the emulator's scope and thread names, timestamps, durations, host process and thread IDs, and three counters (batch, present, ms). Before attaching them I listed every key and every string value in all four: 89 distinct strings, all emulator scope, event or thread names or trace-format values, with no file paths, title text or memory contents. None of the four dropped events, and tools/trace_digest.py on each one prints the lines already in the description.

@JulesB40

Copy link
Copy Markdown
Contributor

Note

🤖 Claude Opus 5.5 responding on behalf of JulesB40

On Windows + NVIDIA (Ada), head fe506b00d0 merged onto main d4cb89300f matches that main exactly across all 1,125 agc_ tests: same passes, same skips, same VUID- lines.

Setup: Windows 11 Home 10.0.26200, Intel Core i9-13900HX, NVIDIA GeForce RTX 4070 Laptop GPU (0x2860), driver 616.92, Vulkan SDK 1.4.335 (VK_LAYER_KHRONOS_validation), WinLibs GCC 15.2.0 r7, Release, BUILD_TESTING=ON. Both sides were built in the same tree; the merge (2fe6367f7, local only) applied cleanly.

Command, the same on both sides:

ANYPS5_GPU=4070 ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^agc_' -j 6
Passed Failed Skipped VUID- lines Missing-layer lines
main d4cb89300f 1117 0 8 18 0
this PR merged 1117 0 8 18 0

No title was run.

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Rechecked exact head fe506b00d065f0dd7b7bbd2878c8c26f81dd8f7d and the follow-up evidence.

Findings

Blocking — the attached capture pair does not satisfy the repository performance-report protocol. The new summary lines are useful and the four traces are now attached, but they show APS5_TRACE_SUMMARY_EVERY=10 and APS5_TRACE_DIR in addition to APS5_TRACE_SECONDS; they also show APS5_DUMP_FRAMES and APS5_DUMP_FRAMES_EVERY. The current performance form says not to set additional trace/profile switches because they affect timings, and asks for a matched capture on main and with the change. The pair currently compares #9879 (5575dc3108c7) with that stack plus this PR (b12e6b60f9a0). Please recapture with only the required trace setting and the form's permitted environment, using the correct comparable main/integration base, or remove the performance claim and perf classification if a compliant pair cannot be produced. Keep the exact commit IDs and paired summaries/traces/digests for any replacement captures.

The Windows correctness evidence is useful: the author reports the focused tests and validation suite on the RX 6700 XT, with the three broad-suite failures matching main on that GPU. I did not independently run the GPU tests or captures; this workspace has no Vulkan device. The current PR remains stacked on #9685, so the integrated branch and any replacement performance baseline should preserve that dependency.

@TechLevelZero

TechLevelZero commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head fe506b0 merged onto main 73f4f7e · tested 2026-10-31 19:42 UTC · 15 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,338 passed · 2 failed (0 new, 2 also fail 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,388 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 (878 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_graphics 35.4 s, ⚠️ agc_driver_graphics_maps_fallback 31.0 s
Failing on main too (2, not counted against this PR)
guest_mmap_executable
guest_socket_options_multicast
Validation IDs already present on main (3 IDs in 387 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (387 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 379 more
VUID-vkCmdCopyImage-srcImage-01548 (12 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 4 more
VUID-vkCmdCopyImage-srcImage-01551 (12 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 4 more
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_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_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 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 plat
Reproduce
git fetch origin fe506b00d065f0dd7b7bbd2878c8c26f81dd8f7d 73f4f7e06e4f210a8c6570e335fd654dc0a86134
git checkout 73f4f7e06e4f210a8c6570e335fd654dc0a86134 && git merge --no-ff fe506b00d065f0dd7b7bbd2878c8c26f81dd8f7d
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.

@thuanquang
thuanquang force-pushed the perf/linear-target-store-merged-copies branch from fe506b0 to 5808a6c Compare November 1, 2026 10:19
@thuanquang

Copy link
Copy Markdown
Contributor Author

@MarcZX10 I recaptured the pair as you asked: main against this change merged onto it, with only the trace window and the pad input set. The window is now in the codec screen, where the store runs. The #9879-based pair is gone from the description, and the branch is rebased onto main dc9dc7eaae (below).

Pair. PPSA14363 on the RX 6700 XT (driver 32.0.21045.16010, shown as 26.10.1 in the summary lines; Windows 11 26200). Four legs in two exclusive pairs (main, PR, main, PR), 2026-10-31 19:54-20:18 UTC.

  • Base: main 50843f45d95b60e5772f4396431f9a39b8709d72.
  • Change: ba38183755751d4f1ddd223d9d402b333fbe076b, this PR's previous head fe506b00d0 merged onto that main. It is on my fork as evidence/10656-main5084.
  • Every leg starts the title from the same save, sends the same pad timeline 25 s after launch and records APS5_TRACE_SECONDS=95:20. The four windows start at presents 5652 to 5659.
  • On this route that window is the codec screen. I located it with frame dumps in an earlier shared run of the same route on main 319621ba2e; these legs dump no frames. The old 160:30 window falls after the codec on this route (last section).
  • The summary env holds only APS5_TRACE_SECONDS, APS5_PAD_INPUT_FILE and APS5_NO_PAD_INPUT, and every summary has dirty:false and trace_dropped:false.
  • The caches were warm: the shader disk cache reports 54 hits and 0 misses in every leg.
  • One box of the performance form is not met: our launcher wrote the emulator's stdout and stderr to a file in all four legs, and the form asks not to redirect the log. Both arms ran the same way.
  • Before each leg the launcher pauses our other jobs and waits until no build or other game is running and the CPU is idle. That check allows League of Legends and does not log it, so it may have been open.
leg build commit presents frame p50 / p99 / max GPU busy per present
1 main 50843f45d95b 1199 16.683 / 17.315 / 17.699 ms 5.490 ms
2 PR ba3818375575 1199 16.683 / 17.263 / 17.742 ms 4.348 ms
3 main 50843f45d95b 1199 16.683 / 17.289 / 17.435 ms 5.542 ms
4 PR ba3818375575 1199 16.683 / 17.212 / 17.719 ms 4.337 ms

tools/performance_compare.py --require-matching-context, main first: GPU busy per present -1.142 (legs 1/2), -1.194 (3/2) and -1.205 ms (3/4). Between legs of the same build it differs by 0.052 ms (main) and 0.011 ms (PR). The mean frame is 16.683 ms in every leg, at the 60 Hz cap.

The saving sits in the GPU batch that the queue worker submits inside Driver.Packet.flip_flush, the stage that also runs StoreDrawnLinear("flip"). The queue worker submits one batch per present. At about every second present that stage takes 0.1 ms or more, and the batch it submits then holds the store together with the rest of that frame's GPU work. I count each batch slice on the trace's gpu thread that starts at most 0.5 ms after such a flip_flush ends. Every leg has 598 to 600 of them, 146 to 151 in each 5 s of the window, at p50 9.90 ms on main and 7.54 ms with this change. The other batches take p50 1.05 ms on both arms, and their total differs by at most 0.013 ms per present between the arms.

Traces, tools/trace_digest.py output and summary lines: https://github.com/thuanquang/AnyPS5/tree/evidence/10656-main5084-traces (folder codec-95-20). The traces hold only timings and emulator scope and thread names; the digests and summary lines add the machine, the commits and the title. The summary lines and digest headers are also in the description.

These timings come from ba38183755, an earlier revision equivalent to the new head. The head is now 5808a6c967ad672065fdb011c6b9afaf404fbf2b, the same change as one commit on main dc9dc7eaaeaf99b1c491d426e68bb999def3da16. git diff 50843f45d9 ba38183755 and git diff dc9dc7eaae 5808a6c967 add and remove the same 57 lines in the same order; only the position of the counter declaration differs (see "Other open PRs"). storeDrawnRect, drawnSpans and StoreDrawnLinear are textually identical on both main commits. main has moved to a644edf30c since. It changes Texture.cpp, Texture.hpp and PacketExecution.cpp, but not this PR's lines, those three functions or the flip_flush stage, and this head merges into it without a textual conflict. I'll rebase onto the latest main, rerun the focused set, the validation comparison and the negative control there, and update the description.

On 5808a6c967 (same machine):

  • The new case reads a counter that this PR adds (StorageTexture::TakeDrawnStoreCounts), so it cannot run on main. With only the region merge reverted (append back to push_back, the counter kept), it fails 3 of 3: AGC graphics: a drawn linear target's store copied contiguous whole rows in more than one region per copy. With the change it passes 3 of 3: linear target rectangle bound, full-width band of 128 rows, unwatched memory: 1 stores in 2 copy regions (expected 1 in 2), wrong drawn pixels 0, changed untouched pixels 0.
  • On this machine the band's memory was outside the write watch at the store, so both merged copies ran (two regions). The write-watched branch, which has only the import copy, did not run here, and the case has not run on Linux lavapipe yet.
  • ctest -R "^agc_driver_(linear_target|bda_)" (19 entries) with ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 passes 19 of 19 in each of 3 runs, on main dc9dc7eaae and on the head.
  • With VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation added to the same two variables (one run each, with ctest -V, VK_LOADER_DEBUG=layer and VK_LOADER_LAYERS_DISABLE=~implicit~), main and the head each pass 19 of 19, with the layer inserted 22 times, no "was not found" line and 0 VUID- lines.

Other open PRs.

A first pair with the old 160:30 window (not evidence for this change)

On 2026-10-31 the same two commits ran with APS5_TRACE_SECONDS=160:30. On this route that window falls after the codec, so neither arm had the store batches: each leg had 1 to 4 GPU batches of 3 ms or more, against 862 to 880 in each of the four earlier #9879-based traces. GPU busy was 1.413 and 1.596 ms per present on main, and 1.589 and 1.594 ms with the change. Its first two legs started with a cold shader cache. Traces: same branch, folder after-codec-160-30.

@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head 5808a6c merged onto main 3741ca9 · tested 2026-11-01 10:59 UTC · 23 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,425 passed · 3 failed (0 new, 3 also fail on main) · 44 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,472 of 3,121 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 (929 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 50.8 s, ⚠️ agc_driver_lookup_log_fits_build 47.7 s, ⚠️ agc_driver_graphics_maps_fallback 31.8 s
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 (5 IDs in 480 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (480 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 472 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 (44)
agc_driver_bda_reads_shadowed_results: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_bda_reads_shadowed_results_per_build: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_sample_order_grid_reference: skipped, the device does not keep depth drawn at custom sample locations at those locations, even after a transition that names them: the composite of uniform renders holds the guest's depth in 0 of 3005 sloped samples, so no path can be compared with it bit for bit
agc_host_import_sparse: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_import_settle_initial_dcc: skipped, the device has no deferred settle of host imports: imports under 1 MiB wait for one only on Windows
agc_unit_shadow_completion_store: skipped, the device reports watched host memory written when it imports or reads it
guest_http_uri_locale: 
guest_net_ctl: skipped, the host has no IPv4 address
guest_video_out_color_space: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_hdr: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_high_frame_rate: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_output_mode: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_resolution_status: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_wqhd_detection: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
video_out_flip_aftergpu: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_backtoback: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_controls: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip_in_order: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_dcc: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_deferred: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_aftergpu: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_main: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_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_f
Reproduce
git fetch origin 5808a6c967ad672065fdb011c6b9afaf404fbf2b 3741ca9327246d0df81638726a986cef862b6db5
git checkout 3741ca9327246d0df81638726a986cef862b6db5 && git merge --no-ff 5808a6c967ad672065fdb011c6b9afaf404fbf2b
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.

@thuanquang
thuanquang force-pushed the perf/linear-target-store-merged-copies branch from 5808a6c to 976a71c Compare November 2, 2026 07:51
@thuanquang

Copy link
Copy Markdown
Contributor Author

@MarcZX10 As promised, the branch is now rebased onto main f2d874c1fd: head 976a71c337, the same patch (git range-diff shows the commit unchanged). git diff f2d874c1fd 976a71c337 adds and removes the same 57 lines in the same order as the pair's ba38183755, and storeDrawnRect, drawnSpans and StoreDrawnLinear are textually identical on 50843f45d9 and f2d874c1fd, so the trace pair still applies to this head.

Reruns on this head (RX 6700 XT, Windows 11 26200):

  • ctest -R "^agc_driver_(linear_target|bda_)" (19 entries) with ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1: 19 of 19 in each of 3 runs, on main f2d874c1fd and on the head.
  • With VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation added (one run each, ctest -V): both 19 of 19, layer inserted 22 times in each log, no "was not found" line, 0 VUID- lines.
  • Negative control, only the region merge reverted (the counter kept): the new case fails 3 of 3 with AGC graphics: a drawn linear target's store copied contiguous whole rows in more than one region per copy; with the change it passes 3 of 3.
  • The path CI takes: WSL2 Ubuntu 24.04 with lavapipe (Mesa 25.2.8). The new case passes 3 of 3 with APS5_WRITE_WATCH_IMPORTS=unwatch and 1 of 1 with the default: 1 stores in 2 copy regions (expected 1 in 2), wrong drawn pixels 0, changed untouched pixels 0. WSL2 has no guest write watch, so the write-watched branch of the case hasn't run on either machine.

The description is updated to this head.

@TechLevelZero

TechLevelZero commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head 976a71c merged onto main f6232fc · tested 2026-11-03 07:48 UTC · 30 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,676 passed · 6 failed (0 new, 3 also fail on main, 3 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,731 of 3,743 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 (934 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 120.3 s, ⚠️ agc_driver_lookup_log_fits_build 44.3 s, ⚠️ public_headers 30.8 s
Unstable on main (3, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_pipeline_journal: failed in 4 of the last 10 main runs
agc_submit_progress: failed in 6 of the last 10 main runs
agc_submit_progress_no_timeline: failed in 5 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 (4 IDs in 525 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (525 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 517 more
VUID-vkCmdCopyImage-srcImage-01548 (8 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_sampling, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth, agc_driver_stencil_null_feedback
VUID-vkCmdCopyImage-srcImage-01551 (8 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_sampling, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth, agc_driver_stencil_null_feedback
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (1 test): agc_driver_srgb8_color_target
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_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_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 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
Reproduce
git fetch origin 976a71c337b005c0289a7ffae766f161702591ac f6232fcfda70644495273f6b8dd88cf0603463d6
git checkout f6232fcfda70644495273f6b8dd88cf0603463d6 && git merge --no-ff 976a71c337b005c0289a7ffae766f161702591ac
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.

@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ AMD GPU test: passed

PR head 976a71c merged onto main f2d874c · tested 2026-11-02 19:20 UTC · 50 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,432 passed · 13 failed (0 new, 9 also fail on main, 4 unstable on main) · 54 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,499 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 (938 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 120.2 s, ⚠️ agc_driver_graphics_maps_fallback 90.1 s, ⚠️ agc_driver_graphics 86.1 s, ⚠️ public_headers 80.1 s, ⚠️ unwrap_self 57.9 s
Unstable on main (4, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_job_manager_compute_capacity: failed in 4 of the last 5 main runs
agc_driver_pipeline_journal: failed in 3 of the last 5 main runs
agc_submit_progress: failed in 4 of the last 5 main runs
agc_submit_progress_no_timeline: failed in 4 of the last 5 main runs
Failing on main too (9, not counted against this PR)
agc_driver_guest_memory_lifetime_direct
agc_driver_image_table
agc_driver_native_depth_bda_clear
agc_driver_native_depth_buffer_clear
agc_driver_native_depth_clears
agc_driver_native_multisample_depth
agc_idle_publish_wait
guest_mmap_executable
guest_socket_options_multicast
Validated but not compared (2, not in the main baseline's validation pass)
guest_pthread_start
trace_digest_TraceDigestTests_test_cli_rejects_invalid_event_fields_without_partial_output
Validation IDs already present on main (5 IDs in 483 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (483 tests): agc_driver, agc_driver_address_passes, agc_driver_alias_copy_label, agc_driver_alpha_to_coverage, agc_driver_array_layer_target, agc_driver_bc_block_copy, agc_driver_bda_anchor_reads, agc_driver_bda_span_reads, and 475 more
VUID-vkCmdCopyImage-srcImage-01548 (6 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-vkCmdCopyImage-srcImage-01551 (6 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (1 test): agc_driver_prepared_exports
VUID-VkShaderModuleCreateInfo-pCode-08737 (1 test): agc_driver_image_sample_derivatives
Skipped (54)
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_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_ngg_vertex_wave_reduction: skipped, s3 describes a 32-lane wave only on 32-lane subgroups, and the device has 64 lanes
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_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_shadowed_key_stores: skipped, the device imports no watched host memory under a unit shadow
agc_small_tiled_shadow_label: skipped, host imports are unavailable: the test block is not imported and watched
agc_storage_clear_hand_over: skipped, the device imports no watched host memory for the clear-key hand-over
agc_unit_shadow: skipped, the device does not import watched host memory for unit shadows
agc_unit_shadow_completion_store: skipped, the device reports watched host memory written when it imports or reads it
guest_http_uri_locale: 
guest_net_ctl: skipped, the host has no IPv4 address
guest_video_out_color_space: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_hdr: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_high_frame_rate: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_output_mode: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_resolution_status: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_wqhd_detection: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
video_out_flip_aftergpu: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_backtoback: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_controls: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip: skipped, no display or Vulkan device: 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: DisplayWindo
Reproduce
git fetch origin 976a71c337b005c0289a7ffae766f161702591ac f2d874c1fdccf781c0fa5d86619bb5dd8894b958
git checkout f2d874c1fdccf781c0fa5d86619bb5dd8894b958 && git merge --no-ff 976a71c337b005c0289a7ffae766f161702591ac
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.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Nov 10, 2026
… region

storeDrawnRect issued one vkCmdCopyBuffer region per row span, into the
host import and, outside the write watch, into the saved bytes, so a
full-width store of a 3072x2048 target issued about 2048 regions per
copy. Regions that are contiguous in both source and destination are now
merged; the stored bytes, the stamps and the settle are unchanged.

Co-Authored-By: Claude <noreply@anthropic.com>
@thuanquang
thuanquang force-pushed the perf/linear-target-store-merged-copies branch from 976a71c to fdea400 Compare November 11, 2026 09:15
@thuanquang

Copy link
Copy Markdown
Contributor Author

Rebased onto main 2a3df01d6f to clear the conflict: head fdea400fce, the same patch (git range-diff shows only context lines moved; the conflict was two blocks added next to each other in Texture.hpp and Texture.cpp). Tested is updated for this head: ctest -R "^agc_driver_(linear_target|bda_)" 21 of 21 in each of 3 runs on main 2a3df01d6f and on this head, and once each under the Khronos validation layer (inserted 24 times, 0 VUID- lines on both). RX 6700 XT, Windows 11, AMD driver 32.0.21045.16010.

@oneandonlydean
oneandonlydean dismissed MarcZX10’s stale review November 11, 2026 10:36

The 10-29 request for a main vs change capture pair is answered by the 11-01 recapture (#10656 (comment)), and the patch is unchanged since (range-diff on fdea400).

@thuanquang

Copy link
Copy Markdown
Contributor Author

The red windows job (run 42993674059) is guest_relative_sleep from #15931 (returned before the requested duration, abort 0xc0000409), which this diff doesn't touch: locally (Windows 11, WinLibs GCC 15.2.0 r7, Release) it also fails on main f57c971559, 12 of 200 runs, against 6 of 100 for this head merged onto it and 0 of 100 with #18299 added.

@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 code change and reported test results are credible, but the performance captures do not follow the repository’s required capture procedure because the emulator logs were redirected.

What I ran

Reviewed head fdea400fcefbee630eeb086e13df08a3840ec686. The PR API reports base 17fec482248b110379dadb86b9a228e3cb1e79b7; local checks and the merge preview used current main 32d5fb01e47da227a0b3f5c9bf25c3fa1d5c8614, against which the head merges cleanly.

Environment: Debian 12, Python 3.11.2, Git 2.39.5, GCC 12.2.0.

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 10656 --output-dir /tmp/pr-10656-precheck-current
git diff --check 32d5fb01e47da227a0b3f5c9bf25c3fa1d5c8614...fdea400fcefbee630eeb086e13df08a3840ec686
gh pr checks 10656 --repo boykopovar/AnyPS5
gh pr checks 10656 --repo boykopovar/AnyPS5 --required

I read all three changed files and the performance report form. The reported Windows and Linux focused runs, negative control, and traces are author-provided evidence; I did not run those tests or captures locally.

Results

Check Result Note
Diff and conventions passed Exact head checked against current main.
Merge preview passed Clean; no declared dependency.
Test registration passed The heuristic warning is a false positive; CMake discovers this test through a glob.
Focused build and tests not run Author reports focused Windows and Linux runs; not independently reproduced here.
Hosted CI failed Windows job failed; author reports the same flaky test also fails on main. No required checks are reported.
Performance capture procedure failed PR description says emulator output was redirected, contrary to the required capture form.

Negative control

The author reports reverting only the region merge made the new test fail 3/3, while the changed version passed 3/3 on Windows and 1/1 under validation on the current head. I did not run this control.

Findings

Blocking

  • Repeat the performance capture using the required procedure. The report says stdout and stderr were redirected for all four legs; the performance form explicitly says not to redirect the log. It also notes that League of Legends may have been open during a leg. Since this PR’s central claim is measured performance, those captures do not meet the repository’s stated protocol. Please repeat the paired main/change captures with the log left unredirected and no other game running, then update the summary lines, traces, and digest. This is a report-evidence request; I found no blocking defect in the code diff.

Non-blocking

  • The Windows hosted job is red on guest_relative_sleep. The author reports observing that failure on main too (12/200 baseline runs versus 6/100 candidate runs, and 0/100 with #18299). I could not independently reproduce those rates; this review does not attribute that failure to this PR.

Sources

Not verified

  • I did not run a build or CTest locally.
  • The author-reported GPU results and negative control were read from the PR description, not reproduced.
  • The Windows hosted failure’s claimed baseline frequency was not independently checked.

To get this to a good state

Repeat the paired captures without redirecting emulator output or running another game, and update the performance evidence. I will re-check the exact new head and rerun the relevant no-build checks after that update.

thuanquang added a commit to thuanquang/AnyPS5 that referenced this pull request Nov 12, 2026
…f02a (head fdea400 + main f57c971), codec window 95:20

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thuanquang

Copy link
Copy Markdown
Contributor Author

@MarcZX10 I re-captured the trace pair as the performance form asks. The emulator log is not redirected: each leg starts the emulator in its own console window. No other game ran. The pair compares main f57c971559 against this head merged onto it (a00f02a4d1, pushed to my fork), on the same codec screen and window (APS5_TRACE_SECONDS=95:20), in two exclusive pairs.

  • GPU busy per present: 5.377 and 5.312 ms on main, 4.275 and 4.211 ms with the change. performance_compare.py gives -1.10, -1.04 and -1.10 ms between neighbouring legs.
  • Frame time stays at the 60 Hz cap in all four legs: p50 16.683 ms, 1199 presents per window, no dropped trace events.

The description now has the new summary lines, digests and table, with the traces in folder codec-95-20-main-f57c-head-fdea on the evidence branch. The earlier pair is kept, folded, below it.

@klosixgaming-arch

Copy link
Copy Markdown
Contributor

Tested on Cyberpunk 2077 on Linux. No measurable difference in the intro: this PR is within 0.5 % of the base boots, inside the spread between boots.

Setup: Ubuntu 26.04.1 (Linux 7.0.0-43), NVIDIA GeForce RTX 2080 Ti (595.99.02), Xeon E5-2699 v3, GCC 15.2.0 Release. Base: main e4caa07950 (it includes #19071). This PR's head fdea400fce merged on top (ce8bc739fd, clean merge), built in a separate tree. Cyberpunk 2077 PPSA03974 02.120.000, intro movie, no input, warm shader caches. Boots alternate base and PR, three each; each number is the mean of the 10 s summary windows from 40 s to 160 s.

boot build presents per 10 s, windows 40 s to 160 s mean
1 base 54 51 52 52 49 50 50 51 51 51 51 51.1
2 this PR 54 52 54 53 51 53 51 52 52 52 53 52.5
3 base 51 51 49 50 48 52 53 52 52 52 53 51.2
4 this PR 50 49 51 50 48 49 49 50 51 50 50 49.7
5 base 52 50 52 53 48 51 51 50 50 51 50 50.7
6 this PR 53 52 53 52 49 52 51 52 49 50 52 51.4
  • Base 51.0 on average (50.7 to 51.2), this PR 51.2 (49.7 to 52.5): +0.4 %, which is noise. The intro may not exercise drawn linear target stores much, so this says little about titles that do.
  • No driver failure, abort or NotImplemented line in any of the six boots.

@domx4q

domx4q commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

NVIDIA Linux run with the Khronos validation layer of the current head fdea400fce; Tested has AMD on Windows and lavapipe, and the NVIDIA Linux run in the thread is a Cyberpunk 2077 timing without the layer.

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

ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer \
ctest --test-dir build -R '^agc_driver_(linear_target|bda_)' -V
main 40206fe50d this PR
Result 25 of 25 passed 25 of 25 passed
Insert instance layer "VK_LAYER_KHRONOS_validation" 28 28
was not found but was requested by env var VK_INSTANCE_LAYERS 0 0
VUID- none none

The pattern is the one from Tested (25 entries on this tree on both sides). Six tests skip on both sides and CTest counts them as passed: the four agc_driver_linear_target_dma_buf_* cases (the device does not select watched dma-buf imports) and the two agc_driver_bda_reads_shadowed_results* cases (the device reports watched host memory written when it imports or reads it). All device tests selected the RTX 4090.

On this machine the new full-width band case runs on write-watched memory, the branch Tested lists as not run:

linear target rectangle bound, full-width band of 128 rows, write-watched memory: 1 stores in 1 copy regions (expected 1 in 1), wrong drawn pixels 0, changed untouched pixels 0

Negative control: the PR build with only the region merge disabled (the append lambda always takes the push_back branch, counters kept) fails agc_driver_linear_target_rectangle_bound with 1 stores in 128 copy regions (expected 1 in 1) and AGC graphics: a drawn linear target's store copied contiguous whole rows in more than one region per copy. The speed claim was not measured here.

No new VUID- errors; all 25 focused tests pass on Ada on both sides, and the new case covers the write-watched branch here.

AI-assisted: yes (Claude Code)

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 perf Performance change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants