perf(agc): bound vertex-indexed guest buffers by the draw's vertex range #9897

Open
savvaniss wants to merge 19 commits from upstream-pr/9897 into main
savvaniss commented 2026-10-22 20:49:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-22T20:49:48Z.


What

Get-fix/AnyPS5#8, moved upstream. It needs nothing from the PS4 parts, so it goes straight on main, as Get-fix suggested.

A PS4 vertex shader reads its vertices through a fetch subroutine that it calls with s_swappc. #9431 links that subroutine into the program (LinkUserDataCallees), so its loads stay ordinary guest-buffer loads indexed by v0, not vertex attributes. Their V#s describe the title's whole vertex ring, so each draw binds the ring whole. When the draw cache reuses a draw at a moved base, PrepareDrawBindings snapshots the ring whole as well. In Monopoly Plus that is 0x27ffff0 bytes per draw, about 870 times per frame.

This PR bounds such buffers by the draw's vertex range, as lifted vertex attributes already are (VertexBufferReadSize):

  • The resource tracker proves, for each buffer resource, that every access is an IDXEN load whose index is the VertexIndex builtin and whose VGPR offset and SOFFSET are immediates. It records how far past index * stride the loads read, with 16 bytes for a formatted load. The value reaches the driver as DescriptorBinding::bufferVertexExtent (shader disk cache format 51).
  • For a direct draw on the vertex path with no mesh or tessellation stage, a read-only element with that proof is bound and alias-checked only up to maxIndex * stride + extent. The same limit applies when its V# moves and it is snapshotted. The size is rounded up to 16 bytes and never exceeds the V#'s own size. A range that then ends less than a stride past the render target's start is cut at the target, as main does for any read-only element (BytesUpToTarget). maxIndex is the one the vertex attributes already use: the highest index plus the base vertex, or the last vertex of an auto draw.
  • A draw recipe whose template was bound for another vertex range is a miss (DrawRecipeMiss::VertexRange), and the draw then takes the template-hit path.
  • Everything unproven keeps today's whole range: indirect draws, mesh, tessellation and geometry paths, written elements, swizzled or ADD_TID V#s, and any element with another kind of access.

Nothing in it depends on the title. The proof also applies to PS5 vertex shaders that read a buffer by v5.

Since this was written, main gained DescriptorBinding::bufferExtent (#6486), the dispatch move proof and the prepare/record split of Graphics::Draw (#8992). Both extents now travel side by side:

  • addGuestBuffer keeps #6486's extent and takes the vertex bound as a separate argument;
  • guestBufferBytes starts from the smaller of the V# size and that bound;
  • MovedDispatchBuffers keeps its sizes, since a dispatch has no vertex range;
  • the draw's maxVertex is taken in the prepare step.

Merge of 30 Oct. main at b7488e1ff5 is merged in (de4912048e), with no rebase and no force-push. Six files conflicted. They are resolved as XairRrR's review spells out:

  • MovedReadOnlyBuffers takes main's const ColorTarget* target and this PR's maxVertex. It sizes an element BytesUpToTarget(address, VertexBoundBytes(binding, element, maxVertex), descriptor.Stride(), written ? nullptr : target), and Draw.cpp's template-hit call passes &state.color and maxVertex.
  • CheckBufferAliases gives BytesUpToTarget the vertex-bounded size.
  • agc_shader_vertex_index_extents joins main's longer set_tests_properties list.
  • The disk cache keeps main's fieldCount<ImageResource>() == 46 and this PR's fieldCount<BufferResource>() == 13.

Two more commits follow from that review:

  • 6c9873072f updates the Linux-only size checks in ShaderDiskCache.cpp: sizeof(DescriptorBinding) is 680 and sizeof(BufferResource) is 36. It also adds bufferVertexExtent to the result memo's byte count (descriptorBindingBytes), which sums every vector of a binding.
  • c9092458db fixes XairRrR's non-blocking finding. addGuestBuffer stores a read-only element after the target trim, but BindsVertexRange compared against the untrimmed size, so every replay of a vertex-indexed element ending within a stride past the target's start was a vertex range miss. BindsVertexRange now takes the draw's target and applies the same trim. A recipe built at another target misses and takes the template-hit path.

Cache format. FormatVersion is 51, main's 50 plus one at merge time. main took 48, 49 and 50 for other layouts while this PR was open, so this PR's earlier 48 is gone. As MarcZX10 asked in https://github.com/boykopovar/AnyPS5/pull/9897#issuecomment-6357420210, the number has to stay unique to one layout. If another schema change lands on main first, this branch merges main again and takes the next free number.

Tested

Windows 11 Pro 26300, WinLibs GCC 15.2.0, Release, AMD Radeon RX 9070 XT (driver 32.0.31041.1004, AMD proprietary 26.8.1 LLPC), ANYPS5_GPU=AMD. Retested on 30 Oct after the merge: main at b7488e1ff5, and this branch at c9092458db, which is that main with this change.
Head 04db012394 (30 Oct, test-only, no merge): TechLevelZero's NVIDIA run showed agc_driver_recorded_kept_bytes failing, and it fails the same way on the RX 9070 XT at c9092458db, which the earlier set above did not include: this PR's bound cut the test's three-vertex draw to 48 bytes of its 65536-byte V#. The test's draw now reads every vertex the V# declares. Rerun on the RX 9070 XT with validation: agc_driver_recorded_kept_bytes, agc_driver_vertex_indexed_ring, agc_driver_vertex_range_bindings and agc_shader_vertex_index_extents, 4 of 4, no VUID- line. agc_driver_recorded_kept_bytes still reports draw snapshots not tested on this GPU, also with the bound switched off. The rest of the set above and NVIDIA were not rerun at this head.

  • agc_shader_vertex_index_extents (new) compiles RDNA vertex shaders that read by the vertex index (v5) and checks the extent reported for each:

    • buffer_load_format_xyzw by the vertex index: 16;
    • buffer_load_dwordx2 at offset 8 with SOFFSET 4: 20;
    • a load by the vertex index plus one: 0;
    • a V# read both ways: 0.
  • agc_driver_vertex_range_bindings (new, mock device) checks the bound size and that each unproven case keeps the whole V#. It moves the V# through MovedReadOnlyBuffers and PrepareDrawBindings, and checks BindsVertexRange. With the target:

    • a V# running through the target, whose draw reaches 8 bytes into it, binds up to the target;
    • it is not moved at the same words, range and target, and BindsVertexRange accepts it there;
    • BindsVertexRange refuses it without that target or for eight vertices;
    • moved to reach 4 bytes in, it is listed up to the target; moved to reach a whole stride in, it isn't cut;
    • built whole, or for eight vertices, it still fails with "aliases the render target".
  • agc_driver_vertex_indexed_ring (new, Vulkan) reads a 64 KiB ring by the vertex index and checks every value, for auto draws from vertex 0 and 5 and for an indexed draw with base vertex 20. It also draws a V# that runs through a resident color target, with its first three vertices ending at the target's start and 8 bytes past it. It builds the draw, replays its recipe through DrawWithRecipe and repeats it through the template-hit path.

  • agc_shader_disk_cache round-trips DescriptorBinding::bufferVertexExtent and BufferResource::vertexExtent.

  • Each part removed on its own fails a test. Retested one part at a time on c9092458db, each built and run on the RX 9070 XT with the validation layer:

    part removed failure
    ResourceTracker.cpp as on main agc_shader_vertex_index_extents: "buffer_load_format_xyzw indexed by the vertex index: vertex extent 0, expected 16"; agc_driver_vertex_indexed_ring: "auto draw from vertex 5: the ring read by the vertex index has no vertex extent"
    no cut in VertexBoundBytes agc_driver_vertex_range_bindings: "a read-only element indexed by the vertex index was not cut to the draw's last vertex"; agc_driver_vertex_indexed_ring: "shader buffer aliases the render target"
    BindsVertexRange always true agc_driver_vertex_range_bindings: "a template bound for another vertex range served a draw of eight vertices"
    BindsVertexRange without the target trim agc_driver_vertex_range_bindings: "a template bound up to the render target was refused for the same vertex range and target"; agc_driver_vertex_indexed_ring: "a ring whose first three vertices reach 8 bytes into the target: the draw did not replay its recipe: vertex range"
    MovedReadOnlyBuffers sized by GetSize agc_driver_vertex_range_bindings: "a vertex-indexed element at the same base and range was listed as moved"
    MovedReadOnlyBuffers without the target trim agc_driver_vertex_range_bindings: "a vertex-indexed element bound up to the render target was listed as moved for the same words, range and target"
    CheckBufferAliases sized by GetSize agc_driver_vertex_indexed_ring: "shader buffer aliases the render target"
    CheckBufferAliases without the target trim agc_driver_vertex_indexed_ring: "shader buffer aliases the render target"
    the build given no vertex range agc_driver_vertex_range_bindings: "a vertex-indexed element was bound past the draw's vertices"; agc_driver_vertex_indexed_ring: "shader buffer aliases the render target"
    the reach without + extent agc_driver_vertex_indexed_ring: "auto draw from vertex 5: vertex 7 component 0 is 0, expected 18612252"; agc_driver_vertex_range_bindings: "a read-only element indexed by the vertex index was not cut to the draw's last vertex"
    bufferVertexExtent left out of the disk cache's binding encoder and decoder agc_shader_disk_cache: "result round trip: bindings differ"
    BufferResource::vertexExtent left out of the disk cache's info encoder and decoder agc_shader_disk_cache: "entry round trip: shader info differs"

    With every part back, the four tests pass again. The descriptorBindingBytes line has no such test: the memo budget tests pass with and without it, since they measure budgets, not one field's bytes.

  • Validation layer, with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1 and VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation: agc_driver, agc_driver_graphics, agc_shader_memory, agc_shader_disk_cache and the 104 recorder tests on main, and the same 108 plus the three new tests on this branch.

    • Results. main passes 108 of 108 and this branch 111 of 111. agc_shader_result_memo_budget* also passes on this branch. agc_host_import_cut_lifetime, which failed on both sides at the last merge, passes on both now.
    • Logs. Neither log has a VUID- line or was not found but was requested by env var VK_INSTANCE_LAYERS. Every Vulkan device: and Selected GPU line names the RX 9070 XT.
    • Later main. tools/check_main_sync.py reports a clean merge with fe4bf3037c. That main is still at format 50 and its 23 newer merges change nothing under core/shader or libSceAgcDriver.
  • Linux. WSL Ubuntu, g++ 15.2.0 with libstdc++, on the Linux filesystem, with sources identical to c9092458db apart from line endings. That copy has one local change: SDL's XRandR and audio checks in the top CMakeLists.txt became warnings, because the development packages aren't installed there. FFmpeg's headers came through FFMPEG_PREBUILT_DIR.

    • Built: Release, Unix Makefiles, -j 4: libSceAgcDriver, agc_shader_memory_tests, agc_driver_graphics_tests, agc_shader_disk_cache_tests and agc_driver_vertex_indexed_ring_tests. The __linux__ size checks are evaluated. Before 6c9873072f, the merged ShaderDiskCache.cpp failed with (680 == 656) and (36 == 32), reproducing XairRrR's report.
    • Run on llvmpipe, without the validation layer: agc_shader_vertex_index_extents, agc_shader_memory, agc_shader_disk_cache, agc_driver_graphics, agc_driver_vertex_indexed_ring and agc_driver_vertex_range_bindings. All 6 pass.
    • The recipe replay runs there. With BindsVertexRange's trim removed, agc_driver_vertex_indexed_ring fails on llvmpipe with the same "did not replay its recipe: vertex range" as on the RX 9070 XT, and passes again with it restored.
    • Not run on Linux: agc_driver, the recorder tests, and any hardware GPU.

Performance: Monopoly Plus (CUSA03312), language-select screen. This is an alternated A/B from 26 Oct: base, change, change, base.

  • What it measured. The A/B measured this change as first written (9c5c8619f7) on the published stack below. It predates this merge, which reconciled the change with main's render target trim, and no new capture was taken. The trim returns its input unless a read-only range starts before the target and ends less than a stride past the target's start. On the A/B's base, the same V#s bound whole passed the alias check, so a prefix of one can cross a target's start only if it reaches that V#'s last record, and the cut is then under one stride.
  • Setup: RX 9070 XT, AMD driver 26.8.1 (LLPC), Windows 11 26300. The settings were APS5_RESIDENT_LINEAR=1, APS5_TRACE_SECONDS=240:15 and APS5_TRACE_SUMMARY_EVERY=15, with no input, and each build had its own warm shader cache (ANYPS5_SHADER_CACHE_DIR).
  • Commits. The title doesn't run on main without #9431 and #9432, so the pair is on #6977's ps4/limbo-gpu, under the exception oneandonlydean gave on #6977 (https://github.com/boykopovar/AnyPS5/pull/6977#issuecomment-6347967400).
    • The stack is ps4/limbo-gpu at 93eeee0141 (#6977's head then), plus the 65 commits the title needs: our PS4 changes, now upstream as #9889 to #9899, a port of #9385, and local stand-ins. Both builds are published so the pair can be reproduced.
    • Change ad706fa0fd (savvaniss:ps4-stack/9897-change) carries this PR's change as commit 9c5c8619f7, as first written. The PR's later commits merge main into it.
    • Base eda8041c07 (savvaniss:ps4-stack/9897-base) is the same stack with 9c5c8619f7 reverted.
  • Scene. Both builds sit on the language-select screen in the measured window; screenshots were taken at 230 s. The base reaches that screen about 180 s after start and the change about 30 s after. The 240 s window comes after both.
build run presents in 15 s fps frame p50 / p90 / p99 ms GPU busy ms/present Driver.Packet.device_lock ms/frame
base eda8041c07 1 70 4.6 214.6 / 223.9 / 240.0 16.1 158.3
change ad706fa0fd 1 402 26.8 36.9 / 39.7 / 42.0 13.7 6.7
change ad706fa0fd 2 403 26.8 36.9 / 39.6 / 42.1 14.7 6.6
base eda8041c07 2 65 4.3 228.1 / 250.8 / 266.1 14.6 173.9
  • Reading: most of the base's frame is Driver.Packet.device_lock, 158 and 174 ms per frame. With the change it is under 7 ms, and the frame p50 falls from 215 to 228 ms to 36.9 ms. GPU busy time per present stays at 14 to 16 ms.
  • Dropped events: in both change traces, the queue worker's event buffer filled 3.7 s into the 15 s window (trace_dropped). The base traces dropped nothing.
  • Traces: aps5-trace-eda8041c07be-41464.json.gz, aps5-trace-ad706fa0fd58-30724.json.gz, aps5-trace-ad706fa0fd58-19928.json.gz and aps5-trace-eda8041c07be-39440.json.gz. They are attached in a comment.

Summary lines of run 1. Paths are replaced by <path>:

Base (eda8041c07):

{"commit":"eda8041c07be","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_RESIDENT_LINEAR":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"240:15","APS5_TRACE_SUMMARY_EVERY":"15"},"gpu":"AMD Radeon RX 9070 XT","driver":"AMD proprietary driver 26.8.1 (LLPC)","os":"Windows 10.0.26300","resolution":"1920x1080","window":{"spec":"seconds 240:15","first_present":1813,"ms":15070.456},"presents":70,"frame_ms":{"p50":214.602,"p90":223.889,"p99":239.988,"max":239.988},"gpu_busy_ms_per_present":16.076,"worker_busy_pct":{"queue worker 0x0":99.316},"top_phases_ms_per_frame":{"Driver.Packet":213.697,"Driver.Packet.device_lock":158.279,"Driver.Packet.draw":50.057,"Driver.Draw":49.698,"Driver.Draw.draw_enqueued":27.805,"Driver.Draw.shader_compile_and_link":16.851,"Shader.DrawStage":15.258,"Shader.DrawStage.capture_resources":7.357},"trace_dropped":false,"trace":"aps5-trace-eda8041c07be-41464.json.gz"}

Change (ad706fa0fd):

{"commit":"ad706fa0fd58","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_RESIDENT_LINEAR":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"240:15","APS5_TRACE_SUMMARY_EVERY":"15"},"gpu":"AMD Radeon RX 9070 XT","driver":"AMD proprietary driver 26.8.1 (LLPC)","os":"Windows 10.0.26300","resolution":"1920x1080","window":{"spec":"seconds 240:15","first_present":7038,"ms":15001.338},"presents":402,"frame_ms":{"p50":36.907,"p90":39.688,"p99":41.962,"max":42.377},"gpu_busy_ms_per_present":13.699,"worker_busy_pct":{"queue worker 0x0":96.24},"top_phases_ms_per_frame":{"Driver.Packet":35.808,"Driver.Packet.draw":24.39,"Driver.Draw":24.067,"Driver.Draw.shader_compile_and_link":16.638,"Shader.DrawStage":15.034,"Shader.DrawStage.capture_resources":7.142,"Driver.Packet.device_lock":6.656,"Shader.DrawStage.materialize":5.614},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":3.724,"events_lost":796105,"totals_full":false}},"trace":"aps5-trace-ad706fa0fd58-30724.json.gz"}
Summary lines of run 2

Change (ad706fa0fd):

{"commit":"ad706fa0fd58","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_RESIDENT_LINEAR":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"240:15","APS5_TRACE_SUMMARY_EVERY":"15"},"gpu":"AMD Radeon RX 9070 XT","driver":"AMD proprietary driver 26.8.1 (LLPC)","os":"Windows 10.0.26300","resolution":"1920x1080","window":{"spec":"seconds 240:15","first_present":6995,"ms":15017.27},"presents":403,"frame_ms":{"p50":36.929,"p90":39.594,"p99":42.102,"max":42.624},"gpu_busy_ms_per_present":14.665,"worker_busy_pct":{"queue worker 0x0":96.209},"top_phases_ms_per_frame":{"Driver.Packet":35.747,"Driver.Packet.draw":24.38,"Driver.Draw":24.054,"Driver.Draw.shader_compile_and_link":16.712,"Shader.DrawStage":15.128,"Shader.DrawStage.capture_resources":7.214,"Driver.Packet.device_lock":6.596,"Shader.DrawStage.materialize":5.618},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":3.717,"events_lost":794385,"totals_full":false}},"trace":"aps5-trace-ad706fa0fd58-19928.json.gz"}

Base (eda8041c07):

{"commit":"eda8041c07be","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_RESIDENT_LINEAR":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"240:15","APS5_TRACE_SUMMARY_EVERY":"15"},"gpu":"AMD Radeon RX 9070 XT","driver":"AMD proprietary driver 26.8.1 (LLPC)","os":"Windows 10.0.26300","resolution":"1920x1080","window":{"spec":"seconds 240:15","first_present":1738,"ms":15063.029},"presents":65,"frame_ms":{"p50":228.065,"p90":250.821,"p99":266.06,"max":266.06},"gpu_busy_ms_per_present":14.561,"worker_busy_pct":{"queue worker 0x0":99.355},"top_phases_ms_per_frame":{"Driver.Packet":230.12,"Driver.Packet.device_lock":173.934,"Driver.Packet.draw":50.703,"Driver.Draw":50.345,"Driver.Draw.draw_enqueued":27.663,"Driver.Draw.shader_compile_and_link":17.522,"Shader.DrawStage":15.85,"Shader.DrawStage.capture_resources":7.6},"trace_dropped":false,"trace":"aps5-trace-eda8041c07be-39440.json.gz"}
tools/trace_digest.py of the four traces

Base, run 1, aps5-trace-eda8041c07be-41464:

seconds 240:15 from present 1813: 70 presents, frame p50 214.6 / p90 223.9 / p99 240.0 / max 240.0 ms, GPU busy 16.1 ms per present
AMD Radeon RX 9070 XT, AMD proprietary driver 26.8.1 (LLPC), Windows 10.0.26300, 1920x1080, commit eda8041c07be, dropped: no

{"commit":"eda8041c07be","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_RESIDENT_LINEAR":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"240:15","APS5_TRACE_SUMMARY_EVERY":"15"},"gpu":"AMD Radeon RX 9070 XT","driver":"AMD proprietary driver 26.8.1 (LLPC)","os":"Windows 10.0.26300","resolution":"1920x1080","window":{"spec":"seconds 240:15","first_present":1813,"ms":15070.456},"presents":70,"frame_ms":{"p50":214.602,"p90":223.889,"p99":239.988,"max":239.988},"gpu_busy_ms_per_present":16.076,"worker_busy_pct":{"queue worker 0x0":99.316},"top_phases_ms_per_frame":{"Driver.Packet":213.697,"Driver.Packet.device_lock":158.279,"Driver.Packet.draw":50.057,"Driver.Draw":49.698,"Driver.Draw.draw_enqueued":27.805,"Driver.Draw.shader_compile_and_link":16.851,"Shader.DrawStage":15.258,"Shader.DrawStage.capture_resources":7.357},"trace_dropped":false,"trace":"aps5-trace-eda8041c07be-41464.json.gz"}

Slowest frames (largest slices inside each, inclusive)

  • present 1869: 240.0 ms at 12031 ms: Driver.Packet (queue worker 0x0) 230.2, Driver.Packet.device_lock (queue worker 0x0) 173.9, Driver.Packet.draw (queue worker 0x0) 54.2, Driver.Draw (queue worker 0x0) 53.8
  • present 1863: 229.6 ms at 10731 ms: Driver.Packet (queue worker 0x0) 219.5, Driver.Packet.device_lock (queue worker 0x0) 165.7, Driver.Packet.draw (queue worker 0x0) 51.7, Driver.Draw (queue worker 0x0) 51.2
  • present 1827: 229.3 ms at 3003 ms: Driver.Packet (queue worker 0x0) 218.9, Driver.Packet.device_lock (queue worker 0x0) 171.8, Driver.Packet.draw (queue worker 0x0) 44.8, Driver.Draw (queue worker 0x0) 44.3

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
queue worker 0x0 205.1 (95 %) 0.3 (0 %) 9.9 59.6 Driver.Packet 205.3, Driver.EndSubmission 0.1
presenter 0.3 (0 %) 0.1 (0 %) 214.9 0.0 Driver.Present 0.4
gpu 16.1 (7 %) 0.0 (0 %) 199.2 0.0 batch 16.1

Largest slices (ms per frame, inclusive, all threads): Driver.Packet 205.3, Driver.Packet.device_lock 157.4, Driver.Packet.draw 45.8, Driver.Draw 45.3, Driver.Draw.draw_enqueued 25.9, batch 16.1, Driver.Draw.shader_compile_and_link 11.0, Shader.DrawStage 3.2

Longest waits

  • Driver.Packet.memory_wait (queue worker 0x0) 1.2 ms at 216 ms, present 1814
  • Driver.Present.render_fence_wait (presenter) 0.9 ms at 216 ms, present 1814
  • Driver.Packet.memory_wait (queue worker 0x0) 0.6 ms at 10521 ms, present 1862
  • Driver.Packet.memory_wait (queue worker 0x0) 0.5 ms at 11606 ms, present 1867
  • Driver.Packet.memory_wait (queue worker 0x0) 0.5 ms at 3445 ms, present 1829
  • Driver.Packet.memory_wait (queue worker 0x0) 0.4 ms at 4082 ms, present 1832
  • Driver.Packet.memory_wait (queue worker 0x0) 0.4 ms at 442 ms, present 1815
  • Driver.Packet.memory_wait (queue worker 0x0) 0.4 ms at 2159 ms, present 1823

Largest GPU batches (GPU ranges inside, and the CPU slices that recorded each, inclusive)

  • batch 38387: 3.4 ms at 6489 ms, present 1843: GPU no ranges; recorded by no CPU slices
  • batch 37076: 3.4 ms at 280 ms, present 1814: GPU no ranges; recorded by no CPU slices
  • batch 38433: 3.4 ms at 6697 ms, present 1844: GPU no ranges; recorded by no CPU slices

Change, run 1, aps5-trace-ad706fa0fd58-30724:

seconds 240:15 from present 7038: 402 presents, frame p50 36.9 / p90 39.7 / p99 42.0 / max 42.4 ms, GPU busy 13.7 ms per present
AMD Radeon RX 9070 XT, AMD proprietary driver 26.8.1 (LLPC), Windows 10.0.26300, 1920x1080, commit ad706fa0fd58, dropped: yes

{"commit":"ad706fa0fd58","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_RESIDENT_LINEAR":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"240:15","APS5_TRACE_SUMMARY_EVERY":"15"},"gpu":"AMD Radeon RX 9070 XT","driver":"AMD proprietary driver 26.8.1 (LLPC)","os":"Windows 10.0.26300","resolution":"1920x1080","window":{"spec":"seconds 240:15","first_present":7038,"ms":15001.338},"presents":402,"frame_ms":{"p50":36.907,"p90":39.688,"p99":41.962,"max":42.377},"gpu_busy_ms_per_present":13.699,"worker_busy_pct":{"queue worker 0x0":96.24},"top_phases_ms_per_frame":{"Driver.Packet":35.808,"Driver.Packet.draw":24.39,"Driver.Draw":24.067,"Driver.Draw.shader_compile_and_link":16.638,"Shader.DrawStage":15.034,"Shader.DrawStage.capture_resources":7.142,"Driver.Packet.device_lock":6.656,"Shader.DrawStage.materialize":5.614},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":3.724,"events_lost":796105,"totals_full":false}},"trace":"aps5-trace-ad706fa0fd58-30724.json.gz"}

Slowest frames (largest slices inside each, inclusive)

  • present 7141: 42.4 ms at 3872 ms: batch (gpu) 13.9, Driver.Present (presenter) 0.3, Driver.Present.acquire_image (presenter) 0.1, Vulkan.Acquire (presenter) 0.1
  • present 7063: 42.4 ms at 945 ms: Driver.Packet (queue worker 0x0) 33.0, Driver.Packet.draw (queue worker 0x0) 23.5, Driver.Draw (queue worker 0x0) 23.1, batch (gpu) 14.2
  • present 7087: 42.2 ms at 1844 ms: Driver.Packet (queue worker 0x0) 33.4, Driver.Packet.draw (queue worker 0x0) 24.1, Driver.Draw (queue worker 0x0) 23.6, batch (gpu) 13.8

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
queue worker 0x0 7.0 (19 %) 0.1 (0 %) 30.3 14.0 Driver.Packet 7.0, Driver.EndSubmission 0.0
presenter 0.3 (1 %) 0.1 (0 %) 37.0 0.0 Driver.Present 0.4
gpu 13.7 (37 %) 0.0 (0 %) 23.6 0.0 batch 13.7

Largest slices (ms per frame, inclusive, all threads): batch 13.7, Driver.Packet 7.0, Driver.Packet.draw 5.2, Driver.Draw 5.1, Driver.Draw.shader_compile_and_link 2.8, Driver.Packet.device_lock 1.5, Shader.DrawStage 0.7, Driver.Present 0.4

Longest waits

  • Driver.Packet.memory_wait (queue worker 0x0) 0.7 ms at 1026 ms, present 7065
  • Driver.Packet.memory_wait (queue worker 0x0) 0.6 ms at 597 ms, present 7054
  • Driver.Packet.memory_wait (queue worker 0x0) 0.6 ms at 709 ms, present 7057
  • Driver.Packet.memory_wait (queue worker 0x0) 0.5 ms at 1653 ms, present 7082
  • Driver.Packet.memory_wait (queue worker 0x0) 0.5 ms at 2708 ms, present 7110
  • Driver.Packet.memory_wait (queue worker 0x0) 0.5 ms at 1805 ms, present 7086
  • Driver.Packet.memory_wait (queue worker 0x0) 0.4 ms at 3689 ms, present 7136
  • Driver.Packet.memory_wait (queue worker 0x0) 0.4 ms at 945 ms, present 7063

Largest GPU batches (GPU ranges inside, and the CPU slices that recorded each, inclusive)

  • batch 146451: 2.8 ms at 12287 ms, present 7366: GPU no ranges; recorded by no CPU slices
  • batch 148116: 2.7 ms at 14983 ms, present 7439: GPU no ranges; recorded by no CPU slices
  • batch 148000: 2.7 ms at 14792 ms, present 7434: GPU no ranges; recorded by no CPU slices

Change, run 2, aps5-trace-ad706fa0fd58-19928:

seconds 240:15 from present 6995: 403 presents, frame p50 36.9 / p90 39.6 / p99 42.1 / max 42.6 ms, GPU busy 14.7 ms per present
AMD Radeon RX 9070 XT, AMD proprietary driver 26.8.1 (LLPC), Windows 10.0.26300, 1920x1080, commit ad706fa0fd58, dropped: yes

{"commit":"ad706fa0fd58","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_RESIDENT_LINEAR":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"240:15","APS5_TRACE_SUMMARY_EVERY":"15"},"gpu":"AMD Radeon RX 9070 XT","driver":"AMD proprietary driver 26.8.1 (LLPC)","os":"Windows 10.0.26300","resolution":"1920x1080","window":{"spec":"seconds 240:15","first_present":6995,"ms":15017.27},"presents":403,"frame_ms":{"p50":36.929,"p90":39.594,"p99":42.102,"max":42.624},"gpu_busy_ms_per_present":14.665,"worker_busy_pct":{"queue worker 0x0":96.209},"top_phases_ms_per_frame":{"Driver.Packet":35.747,"Driver.Packet.draw":24.38,"Driver.Draw":24.054,"Driver.Draw.shader_compile_and_link":16.712,"Shader.DrawStage":15.128,"Shader.DrawStage.capture_resources":7.214,"Driver.Packet.device_lock":6.596,"Shader.DrawStage.materialize":5.618},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":3.717,"events_lost":794385,"totals_full":false}},"trace":"aps5-trace-ad706fa0fd58-19928.json.gz"}

Slowest frames (largest slices inside each, inclusive)

  • present 7181: 42.6 ms at 6945 ms: batch (gpu) 14.7, Driver.Present (presenter) 0.3, Driver.Present.acquire_image (presenter) 0.2, Vulkan.Acquire (presenter) 0.2
  • present 7342: 42.6 ms at 12936 ms: batch (gpu) 14.7, Driver.Present (presenter) 0.5, Driver.Present.acquire_image (presenter) 0.2, Vulkan.Acquire (presenter) 0.2
  • present 7373: 42.3 ms at 14088 ms: batch (gpu) 14.8, Driver.Present (presenter) 0.4, Driver.Present.acquire_image (presenter) 0.2, Vulkan.Acquire (presenter) 0.2

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
queue worker 0x0 6.9 (19 %) 0.1 (0 %) 30.3 14.2 Driver.Packet 7.0, Driver.EndSubmission 0.0
presenter 0.3 (1 %) 0.1 (0 %) 36.9 0.0 Driver.Present 0.4
gpu 14.7 (39 %) 0.0 (0 %) 22.6 0.0 batch 14.7

Largest slices (ms per frame, inclusive, all threads): batch 14.7, Driver.Packet 7.0, Driver.Packet.draw 5.2, Driver.Draw 5.1, Driver.Draw.shader_compile_and_link 2.8, Driver.Packet.device_lock 1.4, Shader.DrawStage 0.7, Driver.Present 0.4

Longest waits

  • Driver.Packet.memory_wait (queue worker 0x0) 0.8 ms at 183 ms, present 7000
  • Driver.Packet.memory_wait (queue worker 0x0) 0.7 ms at 2552 ms, present 7063
  • Driver.Packet.memory_wait (queue worker 0x0) 0.5 ms at 2073 ms, present 7050
  • Driver.Packet.memory_wait (queue worker 0x0) 0.5 ms at 1993 ms, present 7048
  • Driver.Packet.memory_wait (queue worker 0x0) 0.5 ms at 1645 ms, present 7039
  • Driver.Packet.memory_wait (queue worker 0x0) 0.4 ms at 2890 ms, present 7072
  • Driver.Packet.memory_wait (queue worker 0x0) 0.4 ms at 296 ms, present 7003
  • Driver.Packet.memory_wait (queue worker 0x0) 0.4 ms at 859 ms, present 7018

Largest GPU batches (GPU ranges inside, and the CPU slices that recorded each, inclusive)

  • batch 146665: 3.0 ms at 13472 ms, present 7356: GPU no ranges; recorded by no CPU slices
  • batch 146094: 2.9 ms at 12560 ms, present 7331: GPU no ranges; recorded by no CPU slices
  • batch 143748: 2.9 ms at 8754 ms, present 7229: GPU no ranges; recorded by no CPU slices

Base, run 2, aps5-trace-eda8041c07be-39440:

seconds 240:15 from present 1738: 65 presents, frame p50 228.1 / p90 250.8 / p99 266.1 / max 266.1 ms, GPU busy 14.6 ms per present
AMD Radeon RX 9070 XT, AMD proprietary driver 26.8.1 (LLPC), Windows 10.0.26300, 1920x1080, commit eda8041c07be, dropped: no

{"commit":"eda8041c07be","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_RESIDENT_LINEAR":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"240:15","APS5_TRACE_SUMMARY_EVERY":"15"},"gpu":"AMD Radeon RX 9070 XT","driver":"AMD proprietary driver 26.8.1 (LLPC)","os":"Windows 10.0.26300","resolution":"1920x1080","window":{"spec":"seconds 240:15","first_present":1738,"ms":15063.029},"presents":65,"frame_ms":{"p50":228.065,"p90":250.821,"p99":266.06,"max":266.06},"gpu_busy_ms_per_present":14.561,"worker_busy_pct":{"queue worker 0x0":99.355},"top_phases_ms_per_frame":{"Driver.Packet":230.12,"Driver.Packet.device_lock":173.934,"Driver.Packet.draw":50.703,"Driver.Draw":50.345,"Driver.Draw.draw_enqueued":27.663,"Driver.Draw.shader_compile_and_link":17.522,"Shader.DrawStage":15.85,"Shader.DrawStage.capture_resources":7.6},"trace_dropped":false,"trace":"aps5-trace-eda8041c07be-39440.json.gz"}

Slowest frames (largest slices inside each, inclusive)

  • present 1741: 266.1 ms at 733 ms: Driver.Packet (queue worker 0x0) 256.4, Driver.Packet.device_lock (queue worker 0x0) 204.2, Driver.Packet.draw (queue worker 0x0) 49.9, Driver.Draw (queue worker 0x0) 49.5
  • present 1742: 258.9 ms at 999 ms: Driver.Packet (queue worker 0x0) 249.7, Driver.Packet.device_lock (queue worker 0x0) 192.8, Driver.Packet.draw (queue worker 0x0) 54.5, Driver.Draw (queue worker 0x0) 54.0
  • present 1738: 258.3 ms at 0 ms: Driver.Packet (queue worker 0x0) 248.5, Driver.Packet.device_lock (queue worker 0x0) 195.6, Driver.Packet.draw (queue worker 0x0) 50.7, Driver.Draw (queue worker 0x0) 50.2

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
queue worker 0x0 221.7 (96 %) 0.3 (0 %) 9.7 59.2 Driver.Packet 221.9, Driver.EndSubmission 0.1
presenter 0.3 (0 %) 0.1 (0 %) 231.4 0.0 Driver.Present 0.4
gpu 14.6 (6 %) 0.0 (0 %) 217.1 0.0 batch 14.6

Largest slices (ms per frame, inclusive, all threads): Driver.Packet 221.9, Driver.Packet.device_lock 173.0, Driver.Packet.draw 46.8, Driver.Draw 46.3, Driver.Draw.draw_enqueued 25.8, batch 14.6, Driver.Draw.shader_compile_and_link 12.1, Shader.DrawStage 3.6

Longest waits

  • Driver.Packet.memory_wait (queue worker 0x0) 0.5 ms at 4536 ms, present 1757
  • Driver.Packet.memory_wait (queue worker 0x0) 0.5 ms at 733 ms, present 1741
  • Driver.Packet.memory_wait (queue worker 0x0) 0.4 ms at 2442 ms, present 1748
  • Driver.Packet.memory_wait (queue worker 0x0) 0.4 ms at 6826 ms, present 1767
  • Driver.Packet.memory_wait (queue worker 0x0) 0.4 ms at 8421 ms, present 1774
  • Driver.Packet.memory_wait (queue worker 0x0) 0.4 ms at 14810 ms, present 1802
  • Driver.Packet.memory_wait (queue worker 0x0) 0.4 ms at 7728 ms, present 1771
  • Driver.Packet.memory_wait (queue worker 0x0) 0.4 ms at 11611 ms, present 1788

Largest GPU batches (GPU ranges inside, and the CPU slices that recorded each, inclusive)

  • batch 36021: 3.4 ms at 5967 ms, present 1763: GPU no ranges; recorded by no CPU slices
  • batch 36472: 3.4 ms at 8268 ms, present 1773: GPU no ranges; recorded by no CPU slices
  • batch 36607: 3.4 ms at 8924 ms, present 1776: GPU no ranges; recorded by no CPU slices
  • History only. The 20 Oct pair below does not meet the current performance-report format, so it is not evidence for this PR:
    • its base and change commits belong to a local stack that isn't published;
    • the base build was dirty;
    • its summary lines predate trace, trace_dropped and window;
    • the change's trace dropped events.
20 Oct pair (history; not the current format)

These numbers come from ps4/limbo-gpu at 93eeee0141 (#6977's head then), with and without the change. They ran on the local stack the title needed to start: Get-fix/AnyPS5#1, #2 and #5, plus local stand-ins for sceGnmDrawInitDefaultHardwareState200 and sceGnmUpdate*Shader. Pair: base 02fc0a86a4, change 9c5c8619f7. The base also carried the closed #8243, which changed nothing there. Base and change alternated on the same machine and scene, the language screen. The base's draws snapshotted the +0x27ffff0 ring 400 times in the log's first 400 entries; the change logs none.

build fps frame p50 device_lock ms/frame capture_resources ms/frame
base 2.79, 2.86, 2.91 339 to 348 ms 151 to 163 115 to 117
change 6.01, 6.14, 6.16 161 to 167 ms not in the top eight 111 to 114

Base: {"commit":"02fc0a86a4fe","dirty":true,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_RESIDENT_LINEAR":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"240:15","APS5_TRACE_SUMMARY_EVERY":"15"},"gpu":"AMD Radeon RX 9070 XT","driver":"AMD proprietary driver 26.8.1 (LLPC)","os":"Windows 10.0.26300","resolution":"1920x1080","presents":42,"frame_ms":{"p50":339.4,"p90":433.2,"p99":520.4},"gpu_busy_ms_per_present":98.1,"top_phases_ms_per_frame":{"Driver.Packet":357.2,"Driver.Packet.draw":201.7,"Driver.Packet.device_lock":150.6,"Driver.Draw.shader_compile_and_link":148.1,"Shader.DrawStage.capture_resources":117.1}}. The base is dirty because that prx was built with the experiment's extent logging uncommitted.
Change: {"commit":"9c5c8619f7ab","dirty":false,"env":{...same...},"gpu":"AMD Radeon RX 9070 XT","driver":"AMD proprietary driver 26.8.1 (LLPC)","presents":91,"frame_ms":{"p50":166.6,"p90":168.6,"p99":170.6},"gpu_busy_ms_per_present":97.4,"top_phases_ms_per_frame":{"Driver.Packet":164.7,"Driver.Packet.draw":153.0,"Driver.Draw.shader_compile_and_link":143.7,"Shader.DrawStage.capture_resources":113.6},"trace_dropped":true}. The worker's slice buffer filled after 8.4 s, but its totals are complete (totals_full false).

  • oneandonlydean also suggested a PS5 pair with the count of vertex range recipe misses. That is not measured, and MarcZX10 doesn't treat it as a blocker.
  • tools/check_conventions.py --base origin/main passes on c9092458db, and git diff --check origin/main... is clean.
  • tools/pr_overlap.py --branch on c9092458db lists the PRs below. None implements the same thing:
    • #9508 (GPU descriptor heap) changes the addGuestBuffer call in buildPrepare, which this PR gives the vertex bound, the make_shared<ShaderResources> lines in Draw.cpp, and the disk cache's size checks.
    • #10678 (resource-cache key before the committer), #10351 (stencil export), #13021 and #13023 (native multisample D32S8) change neighbouring lines of Draw.cpp's prepare and recipe paths.
    • #11551 (depth bounds in the pixel program) changes neighbouring lines of the disk cache's size checks.
    • #10556 and #12132 change neighbouring lines of tests/ShaderMemory.cpp.

Merge of main cc26ab4438, 1 Nov. Head 837e2b0fcf. The only conflict was libSceAgcDriver/CMakeLists.txt: main moved the AGC test registrations into tests/cmake, and tools/agc_test_split.py resolve moved this branch's two tests to the agc_shader_memory_tests and agc_driver_graphics_tests fragments. agc_shader_vertex_index_extents, agc_driver_vertex_range_bindings, agc_driver_recorded_kept_bytes, agc_driver_vertex_indexed_ring, agc_shader_memory and agc_driver_graphics pass, 3 of 3 on the RX 9070 XT under the validation layer, no VUID- line. Not rerun: the other tests, Linux, games.

Merge of main a4eca2a056, 2 Nov. Head 5a7da3c59f. The only conflict was the Linux-only guard block in ShaderDiskCache.cpp: main's __cpp_lib_atomic_shared_ptr guard around RecompileResult and its ImageResource (sizeof 108, 49 fields) are kept with this branch's DescriptorBinding 680 and BufferResource (36, 13 fields); the three sizes were measured with a probe built by MinGW GCC 15.2. FormatVersion is 52 (both sides had 51). Run on the RX 9070 XT (ANYPS5_GPU=AMD, ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation): agc_shader_disk_cache and its 4 option runs, agc_driver_vertex_indexed_ring, agc_driver_recorded_kept_bytes: 7 of 7 pass, no VUID- line, both Selected GPU lines name the RX 9070 XT. Not rerun: agc_driver_graphics, agc_shader_memory, Linux (the guards were not compiled there), the Monopoly scene. check_conventions.py passes.

Merge of main 4f41f4c375, 3 Nov. Head c2a1b50412. Conflicts: tests/ShaderMemory.cpp, where this branch's verifyVertexIndexExtents and main's new verifyUnsetFormatImageMaterialization and descriptor web tests were added at the same place (all kept, each called as before; checked that no test function is lost or defined twice), and the Windows PATH list in agc_shader_memory_tests.cmake (main's agc_shader_sampler_limits and this branch's agc_shader_vertex_index_extents both kept). Main moved FormatVersion to 52, the value this branch used, so it is now 53; main changed no Linux sizeof or field-count guard. Windows, WinLibs GCC, Release, RX 9070 XT, validation layer, ANYPS5_NO_SHADER_CACHE=1: agc_shader_vertex_index_extents, agc_driver_vertex_range_bindings, agc_driver_vertex_indexed_ring, agc_driver_recorded_kept_bytes, agc_shader_disk_cache, agc_shader_memory, agc_shader_sampler_limits and agc_driver_graphics pass, 3 of 3 runs, no VUID- line, no skip. Not rerun: the negative controls, the paired performance capture, Linux, games.

Merge of main 5b1d381d5a, 4 Nov. Head 152ad564a0. Conflicts: FormatVersion, which main moved to 56, so it is now 57; the field-count guards, which keep this branch's BufferResource count (13) and main's ImageResource count (50, for volumeGather); prepareDraw and DrawWithRecipe in Draw.cpp, which keep this branch's vertex bound and BindsVertexRange check and add main's NoteDepthSurfaceWrite calls after them; and tests/ShaderMemory.cpp, which keeps this branch's verifyVertexIndexExtents and main's verifyAllocationChurnSnapshot (each defined once, called as before). Linux: ShaderDiskCache.cpp compiles with -fsyntax-only on WSL Ubuntu g++ 15.2 (x86-64, libstdc++), so its sizeof guards hold; nothing was linked or run there. Windows, WinLibs GCC, Release, RX 9070 XT, validation layer, ANYPS5_NO_SHADER_CACHE=1, ANYPS5_REQUIRE_VULKAN=1: agc_driver_vertex_indexed_ring, agc_driver_recorded_kept_bytes, the 5 agc_shader_disk_cache* tests, the 37 agc_shader_memory_tests tests (including agc_shader_vertex_index_extents) and the 40 agc_driver_graphics_tests tests (including agc_driver_vertex_range_bindings) pass, 84 of 84, one run, no VUID- line; both Selected GPU lines name the RX 9070 XT. Not rerun: agc_driver, the recorder tests, the negative controls, the paired performance capture, Linux tests, games.

Merge of main b11c7bf84f, 4 Nov. Head 9cd9bd5d9f.

  • Conflicts. ShaderResources.hpp, ShaderResources.cpp and Draw.cpp, where main added a patchedData out-parameter to MovedReadOnlyBuffers, DrawUse, and the APS5_VERIFY_ADDRESS_DRAW_REUSE check.
    • MovedReadOnlyBuffers now takes both this branch's maxVertex and main's patchedData.
    • verifyServedSpace builds its fresh ShaderResources with the same maxVertex as the served one.
    • The rebuild after a moved hit keeps main's ReleaseSpace and this branch's vertex bound.
    • FormatVersion stays 57, since main is still at 56, and main changed no Linux size guard.
  • One of main's tests changed. RingRefusals in agc_driver_address_draw_space_reuse filled 16 bytes at byte 64 of a moved vertex buffer and expected the reuse to be refused.
    • This branch binds a vertex-indexed V# only up to the draw's last vertex, which is 48 bytes for that triangle. The fill no longer overlaps what the draw reads, so the hit was served ("counted reused 1"), both there and in _verify.
    • Commit 9cd9bd5d9f keeps the fill at byte 64 and expects a reuse there. It adds a fill over the first vertex, which expects the refusal. That fill writes the vertex's own bytes, so the image doesn't change.
  • Each check fails without its part, 2 of 2 runs each:
    • With MovedReadOnlyBuffers sizing the element without the vertex bound, the new reuse check fails ("counted moved GuestBuffers element 1, expected one reuse"), and _transitions fails as well ("built its resources again").
    • With its pending-write overlap refusal removed, the refusal check fails ("counted reused 1, expected one refusal").
  • Runs. Windows, WinLibs GCC, Release, RX 9070 XT, with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1 and the validation layer.
    • This head: 29 tests, 29 of 29 in each of 2 runs.
      • The 5 agc_driver_address_draw_space_reuse* tests.
      • The 12 agc_driver_draw_cache_* tests, the 4 agc_driver_draw_data_hit_user_words* tests and agc_driver_mesh_draw_relocation.
      • agc_driver_graphics, agc_driver_recorded_kept_bytes, agc_shader_disk_cache and agc_shader_memory.
      • This branch's three: agc_shader_vertex_index_extents, agc_driver_vertex_range_bindings and agc_driver_vertex_indexed_ring.
    • main b11c7bf84f: the same tests without this branch's three pass, 26 of 26 in 1 run.
    • Logs: neither has a VUID- line or was not found but was requested, and every Selected GPU line names the RX 9070 XT.
    • Not rerun: agc_driver, the recorder tests, the earlier negative controls, the paired performance capture, Linux and games. check_conventions.py passes.

Merge of main 4180951e90, 5 Nov. Head 18dfd99c18.

  • Conflicts. Main added a deviceStaging flag to the draw ShaderResources constructor, at the same position as this branch's maxVertex, and passes recordable && drawStagingEnabled() for new draw builds.
    • The constructor now takes snapshots, then deviceStaging, then maxVertex, and sets both. A std::optional can't convert to the bool, so a call left in the old order fails to compile. This branch's four test calls that pass a bound as an integer now pass false before it.
    • resolveDrawResources passes main's staging choice and the bound.
    • verifyServedSpace and the rebuild after a moved or staged hit build without staging, as on main, and with the bound.
  • Runs. Windows, WinLibs GCC, Release, RX 9070 XT, with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1 and the validation layer.
    • This head: 37 tests, 37 of 37 in each of 2 runs. That is the 29 listed for the 4 Nov merge, plus main's staging tests: agc_adaptive_staging, agc_bda_staging, agc_buffer_pool_small_device_no_staging, agc_driver_overlap_staged_copies, agc_driver_recorded_draw_staging, agc_driver_staged_clear_sampled_read (plain and _draw_pipeline) and agc_read_written_staging.
    • main 4180951e90: the same tests without this branch's three pass, 34 of 34 in 1 run.
    • Logs: neither has a VUID- line or was not found but was requested, and every Selected GPU line names the RX 9070 XT.
    • Not rerun: the mutation checks, agc_driver, the recorder tests, Linux and games. check_conventions.py passes.

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: CUSA03312 #7198
  • GPUs tested: AMD Radeon RX 9070 XT, driver 32.0.31041.1004, Windows 11 Pro 26300
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4973931160 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9897). Originally posted by [savvaniss](https://github.com/savvaniss) on 2026-10-22T20:49:48Z. --- ### What Get-fix/AnyPS5#8, moved upstream. It needs nothing from the PS4 parts, so it goes straight on `main`, as Get-fix suggested. A PS4 vertex shader reads its vertices through a fetch subroutine that it calls with `s_swappc`. #9431 links that subroutine into the program (`LinkUserDataCallees`), so its loads stay ordinary guest-buffer loads indexed by `v0`, not vertex attributes. Their V#s describe the title's whole vertex ring, so each draw binds the ring whole. When the draw cache reuses a draw at a moved base, `PrepareDrawBindings` snapshots the ring whole as well. In Monopoly Plus that is 0x27ffff0 bytes per draw, about 870 times per frame. This PR bounds such buffers by the draw's vertex range, as lifted vertex attributes already are (`VertexBufferReadSize`): - The resource tracker proves, for each buffer resource, that every access is an `IDXEN` load whose index is the `VertexIndex` builtin and whose VGPR offset and `SOFFSET` are immediates. It records how far past `index * stride` the loads read, with 16 bytes for a formatted load. The value reaches the driver as `DescriptorBinding::bufferVertexExtent` (shader disk cache format 51). - For a direct draw on the vertex path with no mesh or tessellation stage, a read-only element with that proof is bound and alias-checked only up to `maxIndex * stride + extent`. The same limit applies when its V# moves and it is snapshotted. The size is rounded up to 16 bytes and never exceeds the V#'s own size. A range that then ends less than a stride past the render target's start is cut at the target, as `main` does for any read-only element (`BytesUpToTarget`). `maxIndex` is the one the vertex attributes already use: the highest index plus the base vertex, or the last vertex of an auto draw. - A draw recipe whose template was bound for another vertex range is a miss (`DrawRecipeMiss::VertexRange`), and the draw then takes the template-hit path. - Everything unproven keeps today's whole range: indirect draws, mesh, tessellation and geometry paths, written elements, swizzled or `ADD_TID` V#s, and any element with another kind of access. Nothing in it depends on the title. The proof also applies to PS5 vertex shaders that read a buffer by `v5`. Since this was written, `main` gained `DescriptorBinding::bufferExtent` (#6486), the dispatch move proof and the prepare/record split of `Graphics::Draw` (#8992). Both extents now travel side by side: - `addGuestBuffer` keeps #6486's `extent` and takes the vertex bound as a separate argument; - `guestBufferBytes` starts from the smaller of the V# size and that bound; - `MovedDispatchBuffers` keeps its sizes, since a dispatch has no vertex range; - the draw's `maxVertex` is taken in the prepare step. **Merge of 30 Oct.** `main` at `b7488e1ff5` is merged in (`de4912048e`), with no rebase and no force-push. Six files conflicted. They are resolved as XairRrR's review spells out: - `MovedReadOnlyBuffers` takes `main`'s `const ColorTarget* target` and this PR's `maxVertex`. It sizes an element `BytesUpToTarget(address, VertexBoundBytes(binding, element, maxVertex), descriptor.Stride(), written ? nullptr : target)`, and `Draw.cpp`'s template-hit call passes `&state.color` and `maxVertex`. - `CheckBufferAliases` gives `BytesUpToTarget` the vertex-bounded size. - `agc_shader_vertex_index_extents` joins `main`'s longer `set_tests_properties` list. - The disk cache keeps `main`'s `fieldCount<ImageResource>() == 46` and this PR's `fieldCount<BufferResource>() == 13`. Two more commits follow from that review: - `6c9873072f` updates the Linux-only size checks in `ShaderDiskCache.cpp`: `sizeof(DescriptorBinding)` is 680 and `sizeof(BufferResource)` is 36. It also adds `bufferVertexExtent` to the result memo's byte count (`descriptorBindingBytes`), which sums every vector of a binding. - `c9092458db` fixes XairRrR's non-blocking finding. `addGuestBuffer` stores a read-only element after the target trim, but `BindsVertexRange` compared against the untrimmed size, so every replay of a vertex-indexed element ending within a stride past the target's start was a `vertex range` miss. `BindsVertexRange` now takes the draw's target and applies the same trim. A recipe built at another target misses and takes the template-hit path. **Cache format.** `FormatVersion` is 51, `main`'s 50 plus one at merge time. `main` took 48, 49 and 50 for other layouts while this PR was open, so this PR's earlier 48 is gone. As MarcZX10 asked in https://github.com/boykopovar/AnyPS5/pull/9897#issuecomment-6357420210, the number has to stay unique to one layout. If another schema change lands on `main` first, this branch merges `main` again and takes the next free number. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Windows 11 Pro 26300, WinLibs GCC 15.2.0, Release, AMD Radeon RX 9070 XT (driver 32.0.31041.1004, AMD proprietary 26.8.1 LLPC), `ANYPS5_GPU=AMD`. Retested on 30 Oct after the merge: `main` at `b7488e1ff5`, and this branch at `c9092458db`, which is that `main` with this change. Head `04db012394` (30 Oct, test-only, no merge): TechLevelZero's NVIDIA run showed `agc_driver_recorded_kept_bytes` failing, and it fails the same way on the RX 9070 XT at `c9092458db`, which the earlier set above did not include: this PR's bound cut the test's three-vertex draw to 48 bytes of its 65536-byte V#. The test's draw now reads every vertex the V# declares. Rerun on the RX 9070 XT with validation: `agc_driver_recorded_kept_bytes`, `agc_driver_vertex_indexed_ring`, `agc_driver_vertex_range_bindings` and `agc_shader_vertex_index_extents`, 4 of 4, no `VUID-` line. `agc_driver_recorded_kept_bytes` still reports `draw snapshots not tested` on this GPU, also with the bound switched off. The rest of the set above and NVIDIA were not rerun at this head. - `agc_shader_vertex_index_extents` (new) compiles RDNA vertex shaders that read by the vertex index (`v5`) and checks the extent reported for each: - `buffer_load_format_xyzw` by the vertex index: 16; - `buffer_load_dwordx2` at offset 8 with `SOFFSET` 4: 20; - a load by the vertex index plus one: 0; - a V# read both ways: 0. - `agc_driver_vertex_range_bindings` (new, mock device) checks the bound size and that each unproven case keeps the whole V#. It moves the V# through `MovedReadOnlyBuffers` and `PrepareDrawBindings`, and checks `BindsVertexRange`. With the target: - a V# running through the target, whose draw reaches 8 bytes into it, binds up to the target; - it is not moved at the same words, range and target, and `BindsVertexRange` accepts it there; - `BindsVertexRange` refuses it without that target or for eight vertices; - moved to reach 4 bytes in, it is listed up to the target; moved to reach a whole stride in, it isn't cut; - built whole, or for eight vertices, it still fails with "aliases the render target". - `agc_driver_vertex_indexed_ring` (new, Vulkan) reads a 64 KiB ring by the vertex index and checks every value, for auto draws from vertex 0 and 5 and for an indexed draw with base vertex 20. It also draws a V# that runs through a resident color target, with its first three vertices ending at the target's start and 8 bytes past it. It builds the draw, replays its recipe through `DrawWithRecipe` and repeats it through the template-hit path. - `agc_shader_disk_cache` round-trips `DescriptorBinding::bufferVertexExtent` and `BufferResource::vertexExtent`. - Each part removed on its own fails a test. Retested one part at a time on `c9092458db`, each built and run on the RX 9070 XT with the validation layer: | part removed | failure | |---|---| | `ResourceTracker.cpp` as on `main` | `agc_shader_vertex_index_extents`: "buffer_load_format_xyzw indexed by the vertex index: vertex extent 0, expected 16"; `agc_driver_vertex_indexed_ring`: "auto draw from vertex 5: the ring read by the vertex index has no vertex extent" | | no cut in `VertexBoundBytes` | `agc_driver_vertex_range_bindings`: "a read-only element indexed by the vertex index was not cut to the draw's last vertex"; `agc_driver_vertex_indexed_ring`: "shader buffer aliases the render target" | | `BindsVertexRange` always true | `agc_driver_vertex_range_bindings`: "a template bound for another vertex range served a draw of eight vertices" | | `BindsVertexRange` without the target trim | `agc_driver_vertex_range_bindings`: "a template bound up to the render target was refused for the same vertex range and target"; `agc_driver_vertex_indexed_ring`: "a ring whose first three vertices reach 8 bytes into the target: the draw did not replay its recipe: vertex range" | | `MovedReadOnlyBuffers` sized by `GetSize` | `agc_driver_vertex_range_bindings`: "a vertex-indexed element at the same base and range was listed as moved" | | `MovedReadOnlyBuffers` without the target trim | `agc_driver_vertex_range_bindings`: "a vertex-indexed element bound up to the render target was listed as moved for the same words, range and target" | | `CheckBufferAliases` sized by `GetSize` | `agc_driver_vertex_indexed_ring`: "shader buffer aliases the render target" | | `CheckBufferAliases` without the target trim | `agc_driver_vertex_indexed_ring`: "shader buffer aliases the render target" | | the build given no vertex range | `agc_driver_vertex_range_bindings`: "a vertex-indexed element was bound past the draw's vertices"; `agc_driver_vertex_indexed_ring`: "shader buffer aliases the render target" | | the reach without `+ extent` | `agc_driver_vertex_indexed_ring`: "auto draw from vertex 5: vertex 7 component 0 is 0, expected 18612252"; `agc_driver_vertex_range_bindings`: "a read-only element indexed by the vertex index was not cut to the draw's last vertex" | | `bufferVertexExtent` left out of the disk cache's binding encoder and decoder | `agc_shader_disk_cache`: "result round trip: bindings differ" | | `BufferResource::vertexExtent` left out of the disk cache's info encoder and decoder | `agc_shader_disk_cache`: "entry round trip: shader info differs" | With every part back, the four tests pass again. The `descriptorBindingBytes` line has no such test: the memo budget tests pass with and without it, since they measure budgets, not one field's bytes. - Validation layer, with `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1` and `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`: `agc_driver`, `agc_driver_graphics`, `agc_shader_memory`, `agc_shader_disk_cache` and the 104 recorder tests on `main`, and the same 108 plus the three new tests on this branch. - **Results.** `main` passes 108 of 108 and this branch 111 of 111. `agc_shader_result_memo_budget*` also passes on this branch. `agc_host_import_cut_lifetime`, which failed on both sides at the last merge, passes on both now. - **Logs.** Neither log has a `VUID-` line or `was not found but was requested by env var VK_INSTANCE_LAYERS`. Every `Vulkan device:` and `Selected GPU` line names the RX 9070 XT. - **Later `main`.** `tools/check_main_sync.py` reports a clean merge with `fe4bf3037c`. That `main` is still at format 50 and its 23 newer merges change nothing under `core/shader` or `libSceAgcDriver`. - **Linux.** WSL Ubuntu, g++ 15.2.0 with libstdc++, on the Linux filesystem, with sources identical to `c9092458db` apart from line endings. That copy has one local change: SDL's XRandR and audio checks in the top `CMakeLists.txt` became warnings, because the development packages aren't installed there. FFmpeg's headers came through `FFMPEG_PREBUILT_DIR`. - **Built:** Release, Unix Makefiles, `-j 4`: `libSceAgcDriver`, `agc_shader_memory_tests`, `agc_driver_graphics_tests`, `agc_shader_disk_cache_tests` and `agc_driver_vertex_indexed_ring_tests`. The `__linux__` size checks are evaluated. Before `6c9873072f`, the merged `ShaderDiskCache.cpp` failed with `(680 == 656)` and `(36 == 32)`, reproducing XairRrR's report. - **Run on llvmpipe, without the validation layer:** `agc_shader_vertex_index_extents`, `agc_shader_memory`, `agc_shader_disk_cache`, `agc_driver_graphics`, `agc_driver_vertex_indexed_ring` and `agc_driver_vertex_range_bindings`. All 6 pass. - **The recipe replay runs there.** With `BindsVertexRange`'s trim removed, `agc_driver_vertex_indexed_ring` fails on llvmpipe with the same "did not replay its recipe: vertex range" as on the RX 9070 XT, and passes again with it restored. - **Not run on Linux:** `agc_driver`, the recorder tests, and any hardware GPU. **Performance: Monopoly Plus (CUSA03312), language-select screen.** This is an alternated A/B from 26 Oct: base, change, change, base. - **What it measured.** The A/B measured this change as first written (`9c5c8619f7`) on the published stack below. It predates this merge, which reconciled the change with `main`'s render target trim, and no new capture was taken. The trim returns its input unless a read-only range starts before the target and ends less than a stride past the target's start. On the A/B's base, the same V#s bound whole passed the alias check, so a prefix of one can cross a target's start only if it reaches that V#'s last record, and the cut is then under one stride. - **Setup:** RX 9070 XT, AMD driver 26.8.1 (LLPC), Windows 11 26300. The settings were `APS5_RESIDENT_LINEAR=1`, `APS5_TRACE_SECONDS=240:15` and `APS5_TRACE_SUMMARY_EVERY=15`, with no input, and each build had its own warm shader cache (`ANYPS5_SHADER_CACHE_DIR`). - **Commits.** The title doesn't run on `main` without #9431 and #9432, so the pair is on #6977's `ps4/limbo-gpu`, under the exception oneandonlydean gave on #6977 (https://github.com/boykopovar/AnyPS5/pull/6977#issuecomment-6347967400). - The stack is `ps4/limbo-gpu` at `93eeee0141` (#6977's head then), plus the 65 commits the title needs: our PS4 changes, now upstream as #9889 to #9899, a port of #9385, and local stand-ins. Both builds are published so the pair can be reproduced. - **Change** `ad706fa0fd` (`savvaniss:ps4-stack/9897-change`) carries this PR's change as commit `9c5c8619f7`, as first written. The PR's later commits merge `main` into it. - **Base** `eda8041c07` (`savvaniss:ps4-stack/9897-base`) is the same stack with `9c5c8619f7` reverted. - **Scene.** Both builds sit on the language-select screen in the measured window; screenshots were taken at 230 s. The base reaches that screen about 180 s after start and the change about 30 s after. The 240 s window comes after both. | build | run | presents in 15 s | fps | frame p50 / p90 / p99 ms | GPU busy ms/present | `Driver.Packet.device_lock` ms/frame | |---|---|---|---|---|---|---| | base `eda8041c07` | 1 | 70 | 4.6 | 214.6 / 223.9 / 240.0 | 16.1 | 158.3 | | change `ad706fa0fd` | 1 | 402 | 26.8 | 36.9 / 39.7 / 42.0 | 13.7 | 6.7 | | change `ad706fa0fd` | 2 | 403 | 26.8 | 36.9 / 39.6 / 42.1 | 14.7 | 6.6 | | base `eda8041c07` | 2 | 65 | 4.3 | 228.1 / 250.8 / 266.1 | 14.6 | 173.9 | - **Reading:** most of the base's frame is `Driver.Packet.device_lock`, 158 and 174 ms per frame. With the change it is under 7 ms, and the frame p50 falls from 215 to 228 ms to 36.9 ms. GPU busy time per present stays at 14 to 16 ms. - **Dropped events:** in both change traces, the queue worker's event buffer filled 3.7 s into the 15 s window (`trace_dropped`). The base traces dropped nothing. - **Traces:** `aps5-trace-eda8041c07be-41464.json.gz`, `aps5-trace-ad706fa0fd58-30724.json.gz`, `aps5-trace-ad706fa0fd58-19928.json.gz` and `aps5-trace-eda8041c07be-39440.json.gz`. They are attached in a comment. Summary lines of run 1. Paths are replaced by `<path>`: Base (`eda8041c07`): ```json {"commit":"eda8041c07be","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_RESIDENT_LINEAR":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"240:15","APS5_TRACE_SUMMARY_EVERY":"15"},"gpu":"AMD Radeon RX 9070 XT","driver":"AMD proprietary driver 26.8.1 (LLPC)","os":"Windows 10.0.26300","resolution":"1920x1080","window":{"spec":"seconds 240:15","first_present":1813,"ms":15070.456},"presents":70,"frame_ms":{"p50":214.602,"p90":223.889,"p99":239.988,"max":239.988},"gpu_busy_ms_per_present":16.076,"worker_busy_pct":{"queue worker 0x0":99.316},"top_phases_ms_per_frame":{"Driver.Packet":213.697,"Driver.Packet.device_lock":158.279,"Driver.Packet.draw":50.057,"Driver.Draw":49.698,"Driver.Draw.draw_enqueued":27.805,"Driver.Draw.shader_compile_and_link":16.851,"Shader.DrawStage":15.258,"Shader.DrawStage.capture_resources":7.357},"trace_dropped":false,"trace":"aps5-trace-eda8041c07be-41464.json.gz"} ``` Change (`ad706fa0fd`): ```json {"commit":"ad706fa0fd58","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_RESIDENT_LINEAR":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"240:15","APS5_TRACE_SUMMARY_EVERY":"15"},"gpu":"AMD Radeon RX 9070 XT","driver":"AMD proprietary driver 26.8.1 (LLPC)","os":"Windows 10.0.26300","resolution":"1920x1080","window":{"spec":"seconds 240:15","first_present":7038,"ms":15001.338},"presents":402,"frame_ms":{"p50":36.907,"p90":39.688,"p99":41.962,"max":42.377},"gpu_busy_ms_per_present":13.699,"worker_busy_pct":{"queue worker 0x0":96.24},"top_phases_ms_per_frame":{"Driver.Packet":35.808,"Driver.Packet.draw":24.39,"Driver.Draw":24.067,"Driver.Draw.shader_compile_and_link":16.638,"Shader.DrawStage":15.034,"Shader.DrawStage.capture_resources":7.142,"Driver.Packet.device_lock":6.656,"Shader.DrawStage.materialize":5.614},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":3.724,"events_lost":796105,"totals_full":false}},"trace":"aps5-trace-ad706fa0fd58-30724.json.gz"} ``` <details><summary>Summary lines of run 2</summary> Change (`ad706fa0fd`): ```json {"commit":"ad706fa0fd58","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_RESIDENT_LINEAR":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"240:15","APS5_TRACE_SUMMARY_EVERY":"15"},"gpu":"AMD Radeon RX 9070 XT","driver":"AMD proprietary driver 26.8.1 (LLPC)","os":"Windows 10.0.26300","resolution":"1920x1080","window":{"spec":"seconds 240:15","first_present":6995,"ms":15017.27},"presents":403,"frame_ms":{"p50":36.929,"p90":39.594,"p99":42.102,"max":42.624},"gpu_busy_ms_per_present":14.665,"worker_busy_pct":{"queue worker 0x0":96.209},"top_phases_ms_per_frame":{"Driver.Packet":35.747,"Driver.Packet.draw":24.38,"Driver.Draw":24.054,"Driver.Draw.shader_compile_and_link":16.712,"Shader.DrawStage":15.128,"Shader.DrawStage.capture_resources":7.214,"Driver.Packet.device_lock":6.596,"Shader.DrawStage.materialize":5.618},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":3.717,"events_lost":794385,"totals_full":false}},"trace":"aps5-trace-ad706fa0fd58-19928.json.gz"} ``` Base (`eda8041c07`): ```json {"commit":"eda8041c07be","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_RESIDENT_LINEAR":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"240:15","APS5_TRACE_SUMMARY_EVERY":"15"},"gpu":"AMD Radeon RX 9070 XT","driver":"AMD proprietary driver 26.8.1 (LLPC)","os":"Windows 10.0.26300","resolution":"1920x1080","window":{"spec":"seconds 240:15","first_present":1738,"ms":15063.029},"presents":65,"frame_ms":{"p50":228.065,"p90":250.821,"p99":266.06,"max":266.06},"gpu_busy_ms_per_present":14.561,"worker_busy_pct":{"queue worker 0x0":99.355},"top_phases_ms_per_frame":{"Driver.Packet":230.12,"Driver.Packet.device_lock":173.934,"Driver.Packet.draw":50.703,"Driver.Draw":50.345,"Driver.Draw.draw_enqueued":27.663,"Driver.Draw.shader_compile_and_link":17.522,"Shader.DrawStage":15.85,"Shader.DrawStage.capture_resources":7.6},"trace_dropped":false,"trace":"aps5-trace-eda8041c07be-39440.json.gz"} ``` </details> <details><summary><code>tools/trace_digest.py</code> of the four traces</summary> Base, run 1, `aps5-trace-eda8041c07be-41464`: **seconds 240:15** from present 1813: 70 presents, frame p50 214.6 / p90 223.9 / p99 240.0 / max 240.0 ms, GPU busy 16.1 ms per present AMD Radeon RX 9070 XT, AMD proprietary driver 26.8.1 (LLPC), Windows 10.0.26300, 1920x1080, commit eda8041c07be, dropped: no ```json {"commit":"eda8041c07be","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_RESIDENT_LINEAR":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"240:15","APS5_TRACE_SUMMARY_EVERY":"15"},"gpu":"AMD Radeon RX 9070 XT","driver":"AMD proprietary driver 26.8.1 (LLPC)","os":"Windows 10.0.26300","resolution":"1920x1080","window":{"spec":"seconds 240:15","first_present":1813,"ms":15070.456},"presents":70,"frame_ms":{"p50":214.602,"p90":223.889,"p99":239.988,"max":239.988},"gpu_busy_ms_per_present":16.076,"worker_busy_pct":{"queue worker 0x0":99.316},"top_phases_ms_per_frame":{"Driver.Packet":213.697,"Driver.Packet.device_lock":158.279,"Driver.Packet.draw":50.057,"Driver.Draw":49.698,"Driver.Draw.draw_enqueued":27.805,"Driver.Draw.shader_compile_and_link":16.851,"Shader.DrawStage":15.258,"Shader.DrawStage.capture_resources":7.357},"trace_dropped":false,"trace":"aps5-trace-eda8041c07be-41464.json.gz"} ``` **Slowest frames** (largest slices inside each, inclusive) - present 1869: 240.0 ms at 12031 ms: Driver.Packet (queue worker 0x0) 230.2, Driver.Packet.device_lock (queue worker 0x0) 173.9, Driver.Packet.draw (queue worker 0x0) 54.2, Driver.Draw (queue worker 0x0) 53.8 - present 1863: 229.6 ms at 10731 ms: Driver.Packet (queue worker 0x0) 219.5, Driver.Packet.device_lock (queue worker 0x0) 165.7, Driver.Packet.draw (queue worker 0x0) 51.7, Driver.Draw (queue worker 0x0) 51.2 - present 1827: 229.3 ms at 3003 ms: Driver.Packet (queue worker 0x0) 218.9, Driver.Packet.device_lock (queue worker 0x0) 171.8, Driver.Packet.draw (queue worker 0x0) 44.8, Driver.Draw (queue worker 0x0) 44.3 **Threads** (ms per frame) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | queue worker 0x0 | 205.1 (95 %) | 0.3 (0 %) | 9.9 | 59.6 | Driver.Packet 205.3, Driver.EndSubmission 0.1 | | presenter | 0.3 (0 %) | 0.1 (0 %) | 214.9 | 0.0 | Driver.Present 0.4 | | gpu | 16.1 (7 %) | 0.0 (0 %) | 199.2 | 0.0 | batch 16.1 | **Largest slices** (ms per frame, inclusive, all threads): Driver.Packet 205.3, Driver.Packet.device_lock 157.4, Driver.Packet.draw 45.8, Driver.Draw 45.3, Driver.Draw.draw_enqueued 25.9, batch 16.1, Driver.Draw.shader_compile_and_link 11.0, Shader.DrawStage 3.2 **Longest waits** - Driver.Packet.memory_wait (queue worker 0x0) 1.2 ms at 216 ms, present 1814 - Driver.Present.render_fence_wait (presenter) 0.9 ms at 216 ms, present 1814 - Driver.Packet.memory_wait (queue worker 0x0) 0.6 ms at 10521 ms, present 1862 - Driver.Packet.memory_wait (queue worker 0x0) 0.5 ms at 11606 ms, present 1867 - Driver.Packet.memory_wait (queue worker 0x0) 0.5 ms at 3445 ms, present 1829 - Driver.Packet.memory_wait (queue worker 0x0) 0.4 ms at 4082 ms, present 1832 - Driver.Packet.memory_wait (queue worker 0x0) 0.4 ms at 442 ms, present 1815 - Driver.Packet.memory_wait (queue worker 0x0) 0.4 ms at 2159 ms, present 1823 **Largest GPU batches** (GPU ranges inside, and the CPU slices that recorded each, inclusive) - batch 38387: 3.4 ms at 6489 ms, present 1843: GPU no ranges; recorded by no CPU slices - batch 37076: 3.4 ms at 280 ms, present 1814: GPU no ranges; recorded by no CPU slices - batch 38433: 3.4 ms at 6697 ms, present 1844: GPU no ranges; recorded by no CPU slices Change, run 1, `aps5-trace-ad706fa0fd58-30724`: **seconds 240:15** from present 7038: 402 presents, frame p50 36.9 / p90 39.7 / p99 42.0 / max 42.4 ms, GPU busy 13.7 ms per present AMD Radeon RX 9070 XT, AMD proprietary driver 26.8.1 (LLPC), Windows 10.0.26300, 1920x1080, commit ad706fa0fd58, dropped: yes ```json {"commit":"ad706fa0fd58","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_RESIDENT_LINEAR":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"240:15","APS5_TRACE_SUMMARY_EVERY":"15"},"gpu":"AMD Radeon RX 9070 XT","driver":"AMD proprietary driver 26.8.1 (LLPC)","os":"Windows 10.0.26300","resolution":"1920x1080","window":{"spec":"seconds 240:15","first_present":7038,"ms":15001.338},"presents":402,"frame_ms":{"p50":36.907,"p90":39.688,"p99":41.962,"max":42.377},"gpu_busy_ms_per_present":13.699,"worker_busy_pct":{"queue worker 0x0":96.24},"top_phases_ms_per_frame":{"Driver.Packet":35.808,"Driver.Packet.draw":24.39,"Driver.Draw":24.067,"Driver.Draw.shader_compile_and_link":16.638,"Shader.DrawStage":15.034,"Shader.DrawStage.capture_resources":7.142,"Driver.Packet.device_lock":6.656,"Shader.DrawStage.materialize":5.614},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":3.724,"events_lost":796105,"totals_full":false}},"trace":"aps5-trace-ad706fa0fd58-30724.json.gz"} ``` **Slowest frames** (largest slices inside each, inclusive) - present 7141: 42.4 ms at 3872 ms: batch (gpu) 13.9, Driver.Present (presenter) 0.3, Driver.Present.acquire_image (presenter) 0.1, Vulkan.Acquire (presenter) 0.1 - present 7063: 42.4 ms at 945 ms: Driver.Packet (queue worker 0x0) 33.0, Driver.Packet.draw (queue worker 0x0) 23.5, Driver.Draw (queue worker 0x0) 23.1, batch (gpu) 14.2 - present 7087: 42.2 ms at 1844 ms: Driver.Packet (queue worker 0x0) 33.4, Driver.Packet.draw (queue worker 0x0) 24.1, Driver.Draw (queue worker 0x0) 23.6, batch (gpu) 13.8 **Threads** (ms per frame) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | queue worker 0x0 | 7.0 (19 %) | 0.1 (0 %) | 30.3 | 14.0 | Driver.Packet 7.0, Driver.EndSubmission 0.0 | | presenter | 0.3 (1 %) | 0.1 (0 %) | 37.0 | 0.0 | Driver.Present 0.4 | | gpu | 13.7 (37 %) | 0.0 (0 %) | 23.6 | 0.0 | batch 13.7 | **Largest slices** (ms per frame, inclusive, all threads): batch 13.7, Driver.Packet 7.0, Driver.Packet.draw 5.2, Driver.Draw 5.1, Driver.Draw.shader_compile_and_link 2.8, Driver.Packet.device_lock 1.5, Shader.DrawStage 0.7, Driver.Present 0.4 **Longest waits** - Driver.Packet.memory_wait (queue worker 0x0) 0.7 ms at 1026 ms, present 7065 - Driver.Packet.memory_wait (queue worker 0x0) 0.6 ms at 597 ms, present 7054 - Driver.Packet.memory_wait (queue worker 0x0) 0.6 ms at 709 ms, present 7057 - Driver.Packet.memory_wait (queue worker 0x0) 0.5 ms at 1653 ms, present 7082 - Driver.Packet.memory_wait (queue worker 0x0) 0.5 ms at 2708 ms, present 7110 - Driver.Packet.memory_wait (queue worker 0x0) 0.5 ms at 1805 ms, present 7086 - Driver.Packet.memory_wait (queue worker 0x0) 0.4 ms at 3689 ms, present 7136 - Driver.Packet.memory_wait (queue worker 0x0) 0.4 ms at 945 ms, present 7063 **Largest GPU batches** (GPU ranges inside, and the CPU slices that recorded each, inclusive) - batch 146451: 2.8 ms at 12287 ms, present 7366: GPU no ranges; recorded by no CPU slices - batch 148116: 2.7 ms at 14983 ms, present 7439: GPU no ranges; recorded by no CPU slices - batch 148000: 2.7 ms at 14792 ms, present 7434: GPU no ranges; recorded by no CPU slices Change, run 2, `aps5-trace-ad706fa0fd58-19928`: **seconds 240:15** from present 6995: 403 presents, frame p50 36.9 / p90 39.6 / p99 42.1 / max 42.6 ms, GPU busy 14.7 ms per present AMD Radeon RX 9070 XT, AMD proprietary driver 26.8.1 (LLPC), Windows 10.0.26300, 1920x1080, commit ad706fa0fd58, dropped: yes ```json {"commit":"ad706fa0fd58","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_RESIDENT_LINEAR":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"240:15","APS5_TRACE_SUMMARY_EVERY":"15"},"gpu":"AMD Radeon RX 9070 XT","driver":"AMD proprietary driver 26.8.1 (LLPC)","os":"Windows 10.0.26300","resolution":"1920x1080","window":{"spec":"seconds 240:15","first_present":6995,"ms":15017.27},"presents":403,"frame_ms":{"p50":36.929,"p90":39.594,"p99":42.102,"max":42.624},"gpu_busy_ms_per_present":14.665,"worker_busy_pct":{"queue worker 0x0":96.209},"top_phases_ms_per_frame":{"Driver.Packet":35.747,"Driver.Packet.draw":24.38,"Driver.Draw":24.054,"Driver.Draw.shader_compile_and_link":16.712,"Shader.DrawStage":15.128,"Shader.DrawStage.capture_resources":7.214,"Driver.Packet.device_lock":6.596,"Shader.DrawStage.materialize":5.618},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":3.717,"events_lost":794385,"totals_full":false}},"trace":"aps5-trace-ad706fa0fd58-19928.json.gz"} ``` **Slowest frames** (largest slices inside each, inclusive) - present 7181: 42.6 ms at 6945 ms: batch (gpu) 14.7, Driver.Present (presenter) 0.3, Driver.Present.acquire_image (presenter) 0.2, Vulkan.Acquire (presenter) 0.2 - present 7342: 42.6 ms at 12936 ms: batch (gpu) 14.7, Driver.Present (presenter) 0.5, Driver.Present.acquire_image (presenter) 0.2, Vulkan.Acquire (presenter) 0.2 - present 7373: 42.3 ms at 14088 ms: batch (gpu) 14.8, Driver.Present (presenter) 0.4, Driver.Present.acquire_image (presenter) 0.2, Vulkan.Acquire (presenter) 0.2 **Threads** (ms per frame) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | queue worker 0x0 | 6.9 (19 %) | 0.1 (0 %) | 30.3 | 14.2 | Driver.Packet 7.0, Driver.EndSubmission 0.0 | | presenter | 0.3 (1 %) | 0.1 (0 %) | 36.9 | 0.0 | Driver.Present 0.4 | | gpu | 14.7 (39 %) | 0.0 (0 %) | 22.6 | 0.0 | batch 14.7 | **Largest slices** (ms per frame, inclusive, all threads): batch 14.7, Driver.Packet 7.0, Driver.Packet.draw 5.2, Driver.Draw 5.1, Driver.Draw.shader_compile_and_link 2.8, Driver.Packet.device_lock 1.4, Shader.DrawStage 0.7, Driver.Present 0.4 **Longest waits** - Driver.Packet.memory_wait (queue worker 0x0) 0.8 ms at 183 ms, present 7000 - Driver.Packet.memory_wait (queue worker 0x0) 0.7 ms at 2552 ms, present 7063 - Driver.Packet.memory_wait (queue worker 0x0) 0.5 ms at 2073 ms, present 7050 - Driver.Packet.memory_wait (queue worker 0x0) 0.5 ms at 1993 ms, present 7048 - Driver.Packet.memory_wait (queue worker 0x0) 0.5 ms at 1645 ms, present 7039 - Driver.Packet.memory_wait (queue worker 0x0) 0.4 ms at 2890 ms, present 7072 - Driver.Packet.memory_wait (queue worker 0x0) 0.4 ms at 296 ms, present 7003 - Driver.Packet.memory_wait (queue worker 0x0) 0.4 ms at 859 ms, present 7018 **Largest GPU batches** (GPU ranges inside, and the CPU slices that recorded each, inclusive) - batch 146665: 3.0 ms at 13472 ms, present 7356: GPU no ranges; recorded by no CPU slices - batch 146094: 2.9 ms at 12560 ms, present 7331: GPU no ranges; recorded by no CPU slices - batch 143748: 2.9 ms at 8754 ms, present 7229: GPU no ranges; recorded by no CPU slices Base, run 2, `aps5-trace-eda8041c07be-39440`: **seconds 240:15** from present 1738: 65 presents, frame p50 228.1 / p90 250.8 / p99 266.1 / max 266.1 ms, GPU busy 14.6 ms per present AMD Radeon RX 9070 XT, AMD proprietary driver 26.8.1 (LLPC), Windows 10.0.26300, 1920x1080, commit eda8041c07be, dropped: no ```json {"commit":"eda8041c07be","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_RESIDENT_LINEAR":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"240:15","APS5_TRACE_SUMMARY_EVERY":"15"},"gpu":"AMD Radeon RX 9070 XT","driver":"AMD proprietary driver 26.8.1 (LLPC)","os":"Windows 10.0.26300","resolution":"1920x1080","window":{"spec":"seconds 240:15","first_present":1738,"ms":15063.029},"presents":65,"frame_ms":{"p50":228.065,"p90":250.821,"p99":266.06,"max":266.06},"gpu_busy_ms_per_present":14.561,"worker_busy_pct":{"queue worker 0x0":99.355},"top_phases_ms_per_frame":{"Driver.Packet":230.12,"Driver.Packet.device_lock":173.934,"Driver.Packet.draw":50.703,"Driver.Draw":50.345,"Driver.Draw.draw_enqueued":27.663,"Driver.Draw.shader_compile_and_link":17.522,"Shader.DrawStage":15.85,"Shader.DrawStage.capture_resources":7.6},"trace_dropped":false,"trace":"aps5-trace-eda8041c07be-39440.json.gz"} ``` **Slowest frames** (largest slices inside each, inclusive) - present 1741: 266.1 ms at 733 ms: Driver.Packet (queue worker 0x0) 256.4, Driver.Packet.device_lock (queue worker 0x0) 204.2, Driver.Packet.draw (queue worker 0x0) 49.9, Driver.Draw (queue worker 0x0) 49.5 - present 1742: 258.9 ms at 999 ms: Driver.Packet (queue worker 0x0) 249.7, Driver.Packet.device_lock (queue worker 0x0) 192.8, Driver.Packet.draw (queue worker 0x0) 54.5, Driver.Draw (queue worker 0x0) 54.0 - present 1738: 258.3 ms at 0 ms: Driver.Packet (queue worker 0x0) 248.5, Driver.Packet.device_lock (queue worker 0x0) 195.6, Driver.Packet.draw (queue worker 0x0) 50.7, Driver.Draw (queue worker 0x0) 50.2 **Threads** (ms per frame) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | queue worker 0x0 | 221.7 (96 %) | 0.3 (0 %) | 9.7 | 59.2 | Driver.Packet 221.9, Driver.EndSubmission 0.1 | | presenter | 0.3 (0 %) | 0.1 (0 %) | 231.4 | 0.0 | Driver.Present 0.4 | | gpu | 14.6 (6 %) | 0.0 (0 %) | 217.1 | 0.0 | batch 14.6 | **Largest slices** (ms per frame, inclusive, all threads): Driver.Packet 221.9, Driver.Packet.device_lock 173.0, Driver.Packet.draw 46.8, Driver.Draw 46.3, Driver.Draw.draw_enqueued 25.8, batch 14.6, Driver.Draw.shader_compile_and_link 12.1, Shader.DrawStage 3.6 **Longest waits** - Driver.Packet.memory_wait (queue worker 0x0) 0.5 ms at 4536 ms, present 1757 - Driver.Packet.memory_wait (queue worker 0x0) 0.5 ms at 733 ms, present 1741 - Driver.Packet.memory_wait (queue worker 0x0) 0.4 ms at 2442 ms, present 1748 - Driver.Packet.memory_wait (queue worker 0x0) 0.4 ms at 6826 ms, present 1767 - Driver.Packet.memory_wait (queue worker 0x0) 0.4 ms at 8421 ms, present 1774 - Driver.Packet.memory_wait (queue worker 0x0) 0.4 ms at 14810 ms, present 1802 - Driver.Packet.memory_wait (queue worker 0x0) 0.4 ms at 7728 ms, present 1771 - Driver.Packet.memory_wait (queue worker 0x0) 0.4 ms at 11611 ms, present 1788 **Largest GPU batches** (GPU ranges inside, and the CPU slices that recorded each, inclusive) - batch 36021: 3.4 ms at 5967 ms, present 1763: GPU no ranges; recorded by no CPU slices - batch 36472: 3.4 ms at 8268 ms, present 1773: GPU no ranges; recorded by no CPU slices - batch 36607: 3.4 ms at 8924 ms, present 1776: GPU no ranges; recorded by no CPU slices </details> - **History only.** The 20 Oct pair below does not meet the current performance-report format, so it is not evidence for this PR: - its base and change commits belong to a local stack that isn't published; - the base build was dirty; - its summary lines predate `trace`, `trace_dropped` and `window`; - the change's trace dropped events. <details><summary>20 Oct pair (history; not the current format)</summary> These numbers come from `ps4/limbo-gpu` at `93eeee0141` (#6977's head then), with and without the change. They ran on the local stack the title needed to start: Get-fix/AnyPS5#1, #2 and #5, plus local stand-ins for `sceGnmDrawInitDefaultHardwareState200` and `sceGnmUpdate*Shader`. Pair: base `02fc0a86a4`, change `9c5c8619f7`. The base also carried the closed #8243, which changed nothing there. Base and change alternated on the same machine and scene, the language screen. The base's draws snapshotted the `+0x27ffff0` ring 400 times in the log's first 400 entries; the change logs none. | build | fps | frame p50 | `device_lock` ms/frame | `capture_resources` ms/frame | |---|---|---|---|---| | base | 2.79, 2.86, 2.91 | 339 to 348 ms | 151 to 163 | 115 to 117 | | change | 6.01, 6.14, 6.16 | 161 to 167 ms | not in the top eight | 111 to 114 | Base: `{"commit":"02fc0a86a4fe","dirty":true,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_RESIDENT_LINEAR":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"240:15","APS5_TRACE_SUMMARY_EVERY":"15"},"gpu":"AMD Radeon RX 9070 XT","driver":"AMD proprietary driver 26.8.1 (LLPC)","os":"Windows 10.0.26300","resolution":"1920x1080","presents":42,"frame_ms":{"p50":339.4,"p90":433.2,"p99":520.4},"gpu_busy_ms_per_present":98.1,"top_phases_ms_per_frame":{"Driver.Packet":357.2,"Driver.Packet.draw":201.7,"Driver.Packet.device_lock":150.6,"Driver.Draw.shader_compile_and_link":148.1,"Shader.DrawStage.capture_resources":117.1}}`. The base is dirty because that prx was built with the experiment's extent logging uncommitted. Change: `{"commit":"9c5c8619f7ab","dirty":false,"env":{...same...},"gpu":"AMD Radeon RX 9070 XT","driver":"AMD proprietary driver 26.8.1 (LLPC)","presents":91,"frame_ms":{"p50":166.6,"p90":168.6,"p99":170.6},"gpu_busy_ms_per_present":97.4,"top_phases_ms_per_frame":{"Driver.Packet":164.7,"Driver.Packet.draw":153.0,"Driver.Draw.shader_compile_and_link":143.7,"Shader.DrawStage.capture_resources":113.6},"trace_dropped":true}`. The worker's slice buffer filled after 8.4 s, but its totals are complete (`totals_full` false). </details> - oneandonlydean also suggested a PS5 pair with the count of `vertex range` recipe misses. That is not measured, and MarcZX10 doesn't treat it as a blocker. - `tools/check_conventions.py --base origin/main` passes on `c9092458db`, and `git diff --check origin/main...` is clean. - `tools/pr_overlap.py --branch` on `c9092458db` lists the PRs below. None implements the same thing: - #9508 (GPU descriptor heap) changes the `addGuestBuffer` call in `buildPrepare`, which this PR gives the vertex bound, the `make_shared<ShaderResources>` lines in `Draw.cpp`, and the disk cache's size checks. - #10678 (resource-cache key before the committer), #10351 (stencil export), #13021 and #13023 (native multisample D32S8) change neighbouring lines of `Draw.cpp`'s prepare and recipe paths. - #11551 (depth bounds in the pixel program) changes neighbouring lines of the disk cache's size checks. - #10556 and #12132 change neighbouring lines of `tests/ShaderMemory.cpp`. **Merge of `main` `cc26ab4438`, 1 Nov.** Head `837e2b0fcf`. The only conflict was `libSceAgcDriver/CMakeLists.txt`: `main` moved the AGC test registrations into `tests/cmake`, and `tools/agc_test_split.py resolve` moved this branch's two tests to the `agc_shader_memory_tests` and `agc_driver_graphics_tests` fragments. `agc_shader_vertex_index_extents`, `agc_driver_vertex_range_bindings`, `agc_driver_recorded_kept_bytes`, `agc_driver_vertex_indexed_ring`, `agc_shader_memory` and `agc_driver_graphics` pass, 3 of 3 on the RX 9070 XT under the validation layer, no `VUID-` line. Not rerun: the other tests, Linux, games. **Merge of `main` `a4eca2a056`, 2 Nov.** Head `5a7da3c59f`. The only conflict was the Linux-only guard block in `ShaderDiskCache.cpp`: main's `__cpp_lib_atomic_shared_ptr` guard around `RecompileResult` and its `ImageResource` (`sizeof` 108, 49 fields) are kept with this branch's `DescriptorBinding` 680 and `BufferResource` (36, 13 fields); the three sizes were measured with a probe built by MinGW GCC 15.2. `FormatVersion` is 52 (both sides had 51). Run on the RX 9070 XT (`ANYPS5_GPU=AMD`, `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1`, `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`): `agc_shader_disk_cache` and its 4 option runs, `agc_driver_vertex_indexed_ring`, `agc_driver_recorded_kept_bytes`: 7 of 7 pass, no `VUID-` line, both `Selected GPU` lines name the RX 9070 XT. Not rerun: `agc_driver_graphics`, `agc_shader_memory`, Linux (the guards were not compiled there), the Monopoly scene. `check_conventions.py` passes. **Merge of `main` `4f41f4c375`, 3 Nov.** Head `c2a1b50412`. Conflicts: `tests/ShaderMemory.cpp`, where this branch's `verifyVertexIndexExtents` and main's new `verifyUnsetFormatImageMaterialization` and descriptor web tests were added at the same place (all kept, each called as before; checked that no test function is lost or defined twice), and the Windows `PATH` list in `agc_shader_memory_tests.cmake` (main's `agc_shader_sampler_limits` and this branch's `agc_shader_vertex_index_extents` both kept). Main moved `FormatVersion` to 52, the value this branch used, so it is now 53; main changed no Linux `sizeof` or field-count guard. Windows, WinLibs GCC, Release, RX 9070 XT, validation layer, `ANYPS5_NO_SHADER_CACHE=1`: `agc_shader_vertex_index_extents`, `agc_driver_vertex_range_bindings`, `agc_driver_vertex_indexed_ring`, `agc_driver_recorded_kept_bytes`, `agc_shader_disk_cache`, `agc_shader_memory`, `agc_shader_sampler_limits` and `agc_driver_graphics` pass, 3 of 3 runs, no `VUID-` line, no skip. Not rerun: the negative controls, the paired performance capture, Linux, games. **Merge of `main` `5b1d381d5a`, 4 Nov.** Head `152ad564a0`. Conflicts: `FormatVersion`, which main moved to 56, so it is now 57; the field-count guards, which keep this branch's `BufferResource` count (13) and main's `ImageResource` count (50, for `volumeGather`); `prepareDraw` and `DrawWithRecipe` in `Draw.cpp`, which keep this branch's vertex bound and `BindsVertexRange` check and add main's `NoteDepthSurfaceWrite` calls after them; and `tests/ShaderMemory.cpp`, which keeps this branch's `verifyVertexIndexExtents` and main's `verifyAllocationChurnSnapshot` (each defined once, called as before). Linux: `ShaderDiskCache.cpp` compiles with `-fsyntax-only` on WSL Ubuntu g++ 15.2 (x86-64, libstdc++), so its `sizeof` guards hold; nothing was linked or run there. Windows, WinLibs GCC, Release, RX 9070 XT, validation layer, `ANYPS5_NO_SHADER_CACHE=1`, `ANYPS5_REQUIRE_VULKAN=1`: `agc_driver_vertex_indexed_ring`, `agc_driver_recorded_kept_bytes`, the 5 `agc_shader_disk_cache*` tests, the 37 `agc_shader_memory_tests` tests (including `agc_shader_vertex_index_extents`) and the 40 `agc_driver_graphics_tests` tests (including `agc_driver_vertex_range_bindings`) pass, 84 of 84, one run, no `VUID-` line; both `Selected GPU` lines name the RX 9070 XT. Not rerun: `agc_driver`, the recorder tests, the negative controls, the paired performance capture, Linux tests, games. **Merge of `main` `b11c7bf84f`, 4 Nov.** Head `9cd9bd5d9f`. - **Conflicts.** `ShaderResources.hpp`, `ShaderResources.cpp` and `Draw.cpp`, where main added a `patchedData` out-parameter to `MovedReadOnlyBuffers`, `DrawUse`, and the `APS5_VERIFY_ADDRESS_DRAW_REUSE` check. - `MovedReadOnlyBuffers` now takes both this branch's `maxVertex` and main's `patchedData`. - `verifyServedSpace` builds its fresh `ShaderResources` with the same `maxVertex` as the served one. - The rebuild after a moved hit keeps main's `ReleaseSpace` and this branch's vertex bound. - `FormatVersion` stays 57, since main is still at 56, and main changed no Linux size guard. - **One of main's tests changed.** `RingRefusals` in `agc_driver_address_draw_space_reuse` filled 16 bytes at byte 64 of a moved vertex buffer and expected the reuse to be refused. - This branch binds a vertex-indexed V# only up to the draw's last vertex, which is 48 bytes for that triangle. The fill no longer overlaps what the draw reads, so the hit was served ("counted reused 1"), both there and in `_verify`. - Commit `9cd9bd5d9f` keeps the fill at byte 64 and expects a reuse there. It adds a fill over the first vertex, which expects the refusal. That fill writes the vertex's own bytes, so the image doesn't change. - **Each check fails without its part,** 2 of 2 runs each: - With `MovedReadOnlyBuffers` sizing the element without the vertex bound, the new reuse check fails ("counted moved GuestBuffers element 1, expected one reuse"), and `_transitions` fails as well ("built its resources again"). - With its pending-write overlap refusal removed, the refusal check fails ("counted reused 1, expected one refusal"). - **Runs.** Windows, WinLibs GCC, Release, RX 9070 XT, with `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1` and the validation layer. - **This head: 29 tests, 29 of 29 in each of 2 runs.** - The 5 `agc_driver_address_draw_space_reuse*` tests. - The 12 `agc_driver_draw_cache_*` tests, the 4 `agc_driver_draw_data_hit_user_words*` tests and `agc_driver_mesh_draw_relocation`. - `agc_driver_graphics`, `agc_driver_recorded_kept_bytes`, `agc_shader_disk_cache` and `agc_shader_memory`. - This branch's three: `agc_shader_vertex_index_extents`, `agc_driver_vertex_range_bindings` and `agc_driver_vertex_indexed_ring`. - **`main` `b11c7bf84f`:** the same tests without this branch's three pass, 26 of 26 in 1 run. - **Logs:** neither has a `VUID-` line or `was not found but was requested`, and every `Selected GPU` line names the RX 9070 XT. - **Not rerun:** `agc_driver`, the recorder tests, the earlier negative controls, the paired performance capture, Linux and games. `check_conventions.py` passes. **Merge of `main` `4180951e90`, 5 Nov.** Head `18dfd99c18`. - **Conflicts.** Main added a `deviceStaging` flag to the draw `ShaderResources` constructor, at the same position as this branch's `maxVertex`, and passes `recordable && drawStagingEnabled()` for new draw builds. - The constructor now takes `snapshots`, then `deviceStaging`, then `maxVertex`, and sets both. A `std::optional` can't convert to the `bool`, so a call left in the old order fails to compile. This branch's four test calls that pass a bound as an integer now pass `false` before it. - `resolveDrawResources` passes main's staging choice and the bound. - `verifyServedSpace` and the rebuild after a moved or staged hit build without staging, as on main, and with the bound. - **Runs.** Windows, WinLibs GCC, Release, RX 9070 XT, with `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1` and the validation layer. - **This head: 37 tests, 37 of 37 in each of 2 runs.** That is the 29 listed for the 4 Nov merge, plus main's staging tests: `agc_adaptive_staging`, `agc_bda_staging`, `agc_buffer_pool_small_device_no_staging`, `agc_driver_overlap_staged_copies`, `agc_driver_recorded_draw_staging`, `agc_driver_staged_clear_sampled_read` (plain and `_draw_pipeline`) and `agc_read_written_staging`. - **`main` `4180951e90`:** the same tests without this branch's three pass, 34 of 34 in 1 run. - **Logs:** neither has a `VUID-` line or `was not found but was requested`, and every `Selected GPU` line names the RX 9070 XT. - **Not rerun:** the mutation checks, `agc_driver`, the recorder tests, Linux and games. `check_conventions.py` passes. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: CUSA03312 #7198 - [x] GPUs tested: AMD Radeon RX 9070 XT, driver 32.0.31041.1004, Windows 11 Pro 26300 - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
MarcZX10 commented 2026-10-23 05:51:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-23T05:51:40Z.

Review: CHANGES_REQUESTED


The vertex-range proof and the reported focused GPU/regression coverage are detailed. I cannot approve this revision yet for two repository-specific reasons:

  1. The perf report still has no usable current-format main/change pair. The listed base and change commits belong to an unpublished local PS4 stack; the summary lines predate the current format, and the changed run reports trace_dropped: true. Please reproduce with the current performance-report format using a reproducible base/change pair and attach both traces with tools/trace_digest.py output, including any dropped-event caveat. If the local stack cannot be published or reproduced, please qualify or remove the numerical performance claim. The PR’s own existing comments explain the required fields and same-machine/same-scene comparison.

  2. tools/check_main_sync.py --base upstream/main --head refs/review/9897 reports a conflict in core/shader/recompiler/ShaderDiskCache.cpp; the branch is 411 commits behind and shares 10 changed files with current main. Please rebase/refresh against current main, preserve its intervening changes, and rerun the focused tests. Recheck the cache format version at that point: this PR, #9889, and #7831 currently set v45, while #9852 changes serialized fields without a bump. The schema-changing revisions need coordinated ordering and unique version increments.

Local checks on the exact head d66bdd579741d174171c27174d674c673c16e68a: tools/check_conventions.py --base upstream/main passed; git diff --check upstream/main...refs/review/9897 passed. I did not run the GPU tests here; the reported Windows RX 9070 XT validation-layer results are author-provided evidence, not locally reproduced.

AI-assisted review.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5624442059 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9897#pullrequestreview-5624442059). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-23T05:51:40Z. **Review:** CHANGES_REQUESTED --- The vertex-range proof and the reported focused GPU/regression coverage are detailed. I cannot approve this revision yet for two repository-specific reasons: 1. The `perf` report still has no usable current-format `main`/change pair. The listed base and change commits belong to an unpublished local PS4 stack; the summary lines predate the current format, and the changed run reports `trace_dropped: true`. Please reproduce with the current performance-report format using a reproducible base/change pair and attach both traces with `tools/trace_digest.py` output, including any dropped-event caveat. If the local stack cannot be published or reproduced, please qualify or remove the numerical performance claim. The PR’s own existing comments explain the required fields and same-machine/same-scene comparison. 2. `tools/check_main_sync.py --base upstream/main --head refs/review/9897` reports a conflict in `core/shader/recompiler/ShaderDiskCache.cpp`; the branch is 411 commits behind and shares 10 changed files with current `main`. Please rebase/refresh against current `main`, preserve its intervening changes, and rerun the focused tests. Recheck the cache format version at that point: this PR, #9889, and #7831 currently set v45, while #9852 changes serialized fields without a bump. The schema-changing revisions need coordinated ordering and unique version increments. Local checks on the exact head `d66bdd579741d174171c27174d674c673c16e68a`: `tools/check_conventions.py --base upstream/main` passed; `git diff --check upstream/main...refs/review/9897` passed. I did not run the GPU tests here; the reported Windows RX 9070 XT validation-layer results are author-provided evidence, not locally reproduced. AI-assisted review.
XairRrR commented 2026-10-29 03:23:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-10-29T03:23:27Z.

Review: CHANGES_REQUESTED


Reviewed — changes requested

The vertex-range bound works as described on the PR head, and its tests catch a broken tracker. But the head does not compile on Linux/GCC, it conflicts with current main in six files, and its disk-cache format number 48 is already taken on main.

What I ran

  • PR head: 7ecf14ef124094e993240cb2fa04ae26ea4c34cf
  • main: 3a2b91981651569163768854a1fcdc7193b6667b
  • Arch Linux 7.2.11-zen, GCC 16.2.1, Release, Ninja, Intel Core i9-14900KF, NVIDIA GeForce RTX 4070 Ti SUPER (driver 615.78.08), in a clean worktree.
git fetch origin main pull/9897/head:refs/review/9897
git checkout --detach origin/main
git merge --no-ff --no-edit refs/review/9897        # conflicts, aborted
git checkout --detach refs/review/9897
git diff --check origin/main...refs/review/9897
python3 tools/check_conventions.py --base origin/main
cmake --build build -j10 --target agc_shader_memory_tests agc_driver_graphics_tests agc_shader_disk_cache_tests
# local only, to get past the compile error: DescriptorBinding 656 -> 680, BufferResource 32 -> 36
cmake --build build -j10 --target agc_shader_memory_tests agc_driver_graphics_tests agc_shader_disk_cache_tests agc_driver_vertex_indexed_ring_tests
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \
  ctest --test-dir build -j4 -V --output-on-failure \
  -R '^(agc_shader_vertex_index_extents|agc_shader_memory|agc_shader_disk_cache|agc_driver_graphics|agc_driver_vertex_indexed_ring|agc_driver_vertex_range_bindings)$'
# negative control
git checkout 366dd4e6b7 -- core/shader/recompiler/Optimization/src/ResourceTracker.cpp
cmake --build build -j10 --target agc_shader_memory_tests agc_driver_vertex_indexed_ring_tests
ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build --output-on-failure -R '^(agc_shader_vertex_index_extents|agc_driver_vertex_indexed_ring)$'

Results

Check Result
Merge into current main Conflicts in 6 files (listed below)
git diff --check clean
tools/check_conventions.py --base origin/main passed
Build of the PR head as pushed (Linux, GCC 16.2.1) fails: ShaderDiskCache.cpp:91 and :97 static asserts
Build with only those two size constants changed locally OK
agc_shader_vertex_index_extents, agc_driver_vertex_range_bindings, agc_driver_vertex_indexed_ring (new) passed
agc_shader_memory, agc_shader_disk_cache, agc_driver_graphics passed
VUID- lines in the validation-layer log 0
was not found but was requested by env var VK_INSTANCE_LAYERS absent; loader inserted VK_LAYER_KHRONOS_validation; GPU was the RTX 4070 Ti SUPER
Merge conflicts with main 3a2b919816
CONFLICT (content): core/libs/prx/libSceAgcDriver/CMakeLists.txt
CONFLICT (content): core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
CONFLICT (content): core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
CONFLICT (content): core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
CONFLICT (content): core/shader/recompiler/ShaderDiskCache.cpp
CONFLICT (content): core/shader/recompiler/ShaderDiskCache.hpp

The main hunks:

  • ShaderDiskCache.hpp: main has FormatVersion = 49, the PR has 48.
  • ShaderDiskCache.cpp: main has fieldCount<ImageResource>() == 45, the PR has 43.
  • ShaderResources.hpp/.cpp and Draw.cpp: main (f65fda5c3d) changed MovedReadOnlyBuffers to take const ColorTarget* target and added BytesUpToTarget. The PR changes the same signature to take maxVertex and replaces the same descriptor.GetSize() line with VertexBoundBytes(...).
Compile error on the PR head (Linux, libstdc++)
core/shader/recompiler/ShaderDiskCache.cpp:91:41: error: static assertion failed: DescriptorBinding changed: update the binding encoder
  • the comparison reduces to '(680 == 656)'
core/shader/recompiler/ShaderDiskCache.cpp:97:38: error: static assertion failed: BufferResource changed: update the info encoder
  • the comparison reduces to '(36 == 32)'
ninja: build stopped: subcommand failed.
Focused tests (with the two constants patched locally)
1/6 Test  #632: agc_shader_vertex_index_extents ....   Passed    0.01 sec
2/6 Test  #644: agc_shader_memory ..................   Passed    0.27 sec
3/6 Test #1245: agc_driver_vertex_range_bindings ...   Passed    0.01 sec
4/6 Test #1146: agc_driver_vertex_indexed_ring .....   Passed    0.55 sec
5/6 Test  #659: agc_shader_disk_cache ..............   Passed    1.23 sec
6/6 Test  #666: agc_driver_graphics ................   Passed    4.86 sec
100% tests passed out of 6

Negative control

The new tests call new APIs (VertexBoundBytes, bufferVertexExtent), so they cannot be built against fully reverted production files. Instead I reverted only core/shader/recompiler/Optimization/src/ResourceTracker.cpp to the merge base 366dd4e6b7 and rebuilt. Both tests failed, with the messages given in the description:

agc_shader_vertex_index_extents ...***Failed
vertex index extents: buffer_load_format_xyzw indexed by the vertex index: vertex extent 0, expected 16
agc_driver_vertex_indexed_ring ....***Failed
AGC graphics: auto draw from vertex 5: the ring read by the vertex index has no vertex extent

I did not repeat the other single-part removals from the description.

Findings

Blocking

  1. The head does not compile on Linux x86-64 with libstdc++. core/shader/recompiler/ShaderDiskCache.cpp:91 and :97 keep sizeof(DescriptorBinding) == 656 and sizeof(BufferResource) == 32. The PR adds bufferVertexExtent and vertexExtent, which make them 680 and 36. These asserts sit under #if defined(__linux__) && defined(__x86_64__) && defined(__GLIBCXX__), so the Windows/WinLibs build in the description never evaluates them. This confirms babyhuey's report, and it fails on the PR head on its own, not only after a merge. Fix: update both constants. The encoder and decoder already handle the new fields.

  2. Conflicts with current main in the six files listed above. Resolving them takes more than picking a side:

    • main's MovedReadOnlyBuffers(..., const ColorTarget* target) and the PR's MovedReadOnlyBuffers(..., maxVertex) need to become one function that takes both. Its size should be BytesUpToTarget(address, VertexBoundBytes(binding, element, maxVertex), descriptor.Stride(), written ? nullptr : target). Draw.cpp's template-hit call then passes &state.color and maxVertex.
    • CheckBufferAliases on main now calls BytesUpToTarget. It should take the vertex-bounded size as its input.
    • CMakeLists.txt: add agc_shader_vertex_index_extents to main's longer set_tests_properties list (it now includes the agc_shader_result_memo_budget* tests).
    • ShaderDiskCache.cpp: keep main's fieldCount<ImageResource>() == 45 and the PR's fieldCount<BufferResource>() == 13.
  3. Disk-cache format 48 is already used on main for another layout. core/shader/recompiler/ShaderDiskCache.hpp:16 sets FormatVersion = 48. main took 48 in 787b6a6720 (cube descriptors, 2026-10-26) and is now at 49 (b9f4f65904). Entries written by a main build between those two commits would have format 48 but a different layout from this branch's. The description already says the number moves when main takes it. It needs to be 50, or whatever is next free when this merges.

Non-blocking

  1. BindsVertexRange can miss a recipe that should hit. At core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp:5618, the check item.size != guestBufferBytes(words, VertexBoundBytes(...)) compares against the untrimmed size. But addGuestBuffer (ShaderResources.cpp:4390) stores item.size after trimming a read-only element at the render target. Take a vertex-indexed element whose bounded range still ends less than one stride past target.address: every recipe replay for it is a VertexRange miss, even at the same vertex range. This costs performance only, because the miss falls back to the template-hit path. When resolving finding 2, apply the same BytesUpToTarget(..., target) here, so the comparison matches what the build stored.

I am not repeating the performance-evidence discussion. MarcZX10 and oneandonlydean are handling it, and the PS5 pair with the vertex range miss count is still listed as open.

Not verified

  • The merged tree: it conflicts, so the conflict resolution is untested.
  • The PR head exactly as pushed, beyond the compile failure: I ran every test with the two size constants patched locally.
  • A validation-layer run of the same tests on main for comparison. The patched PR head logged no VUID- lines for the six tests, so these tests cannot show the change adding validation errors over main. The three new tests do not exist on main.
  • The other single-part removals in the description's table. I ran only the ResourceTracker.cpp one.
  • Any title. I launched no game, so I did not check the Monopoly Plus numbers.
  • AMD hardware. I tested on NVIDIA only.

To get this to a good state

  1. Merge current main and resolve the six conflicts. Compose BytesUpToTarget with the vertex bound in MovedReadOnlyBuffers and CheckBufferAliases, and ideally in BindsVertexRange as well.
  2. Update sizeof(DescriptorBinding) and sizeof(BufferResource) in ShaderDiskCache.cpp. Build once on Linux/GCC (or the anyps5-build CI image), since the Windows build never evaluates these asserts.
  3. Move FormatVersion to the next unused number after main's 49.
  4. Rerun the four focused tests and the validation-layer comparison on the merged result.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5692477247 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9897#pullrequestreview-5692477247). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-10-29T03:23:27Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested The vertex-range bound works as described on the PR head, and its tests catch a broken tracker. But the head does not compile on Linux/GCC, it conflicts with current `main` in six files, and its disk-cache format number 48 is already taken on `main`. ## What I ran - PR head: `7ecf14ef124094e993240cb2fa04ae26ea4c34cf` - `main`: `3a2b91981651569163768854a1fcdc7193b6667b` - Arch Linux 7.2.11-zen, GCC 16.2.1, Release, Ninja, Intel Core i9-14900KF, NVIDIA GeForce RTX 4070 Ti SUPER (driver 615.78.08), in a clean worktree. ```sh git fetch origin main pull/9897/head:refs/review/9897 git checkout --detach origin/main git merge --no-ff --no-edit refs/review/9897 # conflicts, aborted git checkout --detach refs/review/9897 git diff --check origin/main...refs/review/9897 python3 tools/check_conventions.py --base origin/main cmake --build build -j10 --target agc_shader_memory_tests agc_driver_graphics_tests agc_shader_disk_cache_tests # local only, to get past the compile error: DescriptorBinding 656 -> 680, BufferResource 32 -> 36 cmake --build build -j10 --target agc_shader_memory_tests agc_driver_graphics_tests agc_shader_disk_cache_tests agc_driver_vertex_indexed_ring_tests VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \ ctest --test-dir build -j4 -V --output-on-failure \ -R '^(agc_shader_vertex_index_extents|agc_shader_memory|agc_shader_disk_cache|agc_driver_graphics|agc_driver_vertex_indexed_ring|agc_driver_vertex_range_bindings)$' # negative control git checkout 366dd4e6b7 -- core/shader/recompiler/Optimization/src/ResourceTracker.cpp cmake --build build -j10 --target agc_shader_memory_tests agc_driver_vertex_indexed_ring_tests ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build --output-on-failure -R '^(agc_shader_vertex_index_extents|agc_driver_vertex_indexed_ring)$' ``` ## Results | Check | Result | |---|---| | Merge into current `main` | **Conflicts** in 6 files (listed below) | | `git diff --check` | clean | | `tools/check_conventions.py --base origin/main` | passed | | Build of the PR head as pushed (Linux, GCC 16.2.1) | **fails**: `ShaderDiskCache.cpp:91` and `:97` static asserts | | Build with only those two size constants changed locally | OK | | `agc_shader_vertex_index_extents`, `agc_driver_vertex_range_bindings`, `agc_driver_vertex_indexed_ring` (new) | passed | | `agc_shader_memory`, `agc_shader_disk_cache`, `agc_driver_graphics` | passed | | `VUID-` lines in the validation-layer log | 0 | | `was not found but was requested by env var VK_INSTANCE_LAYERS` | absent; loader inserted `VK_LAYER_KHRONOS_validation`; GPU was the RTX 4070 Ti SUPER | <details><summary>Merge conflicts with main 3a2b919816</summary> ```text CONFLICT (content): core/libs/prx/libSceAgcDriver/CMakeLists.txt CONFLICT (content): core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp CONFLICT (content): core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp CONFLICT (content): core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp CONFLICT (content): core/shader/recompiler/ShaderDiskCache.cpp CONFLICT (content): core/shader/recompiler/ShaderDiskCache.hpp ``` The main hunks: - `ShaderDiskCache.hpp`: `main` has `FormatVersion = 49`, the PR has `48`. - `ShaderDiskCache.cpp`: `main` has `fieldCount<ImageResource>() == 45`, the PR has `43`. - `ShaderResources.hpp/.cpp` and `Draw.cpp`: `main` (f65fda5c3d) changed `MovedReadOnlyBuffers` to take `const ColorTarget* target` and added `BytesUpToTarget`. The PR changes the same signature to take `maxVertex` and replaces the same `descriptor.GetSize()` line with `VertexBoundBytes(...)`. </details> <details><summary>Compile error on the PR head (Linux, libstdc++)</summary> ```text core/shader/recompiler/ShaderDiskCache.cpp:91:41: error: static assertion failed: DescriptorBinding changed: update the binding encoder • the comparison reduces to '(680 == 656)' core/shader/recompiler/ShaderDiskCache.cpp:97:38: error: static assertion failed: BufferResource changed: update the info encoder • the comparison reduces to '(36 == 32)' ninja: build stopped: subcommand failed. ``` </details> <details><summary>Focused tests (with the two constants patched locally)</summary> ```text 1/6 Test #632: agc_shader_vertex_index_extents .... Passed 0.01 sec 2/6 Test #644: agc_shader_memory .................. Passed 0.27 sec 3/6 Test #1245: agc_driver_vertex_range_bindings ... Passed 0.01 sec 4/6 Test #1146: agc_driver_vertex_indexed_ring ..... Passed 0.55 sec 5/6 Test #659: agc_shader_disk_cache .............. Passed 1.23 sec 6/6 Test #666: agc_driver_graphics ................ Passed 4.86 sec 100% tests passed out of 6 ``` </details> ## Negative control The new tests call new APIs (`VertexBoundBytes`, `bufferVertexExtent`), so they cannot be built against fully reverted production files. Instead I reverted only `core/shader/recompiler/Optimization/src/ResourceTracker.cpp` to the merge base `366dd4e6b7` and rebuilt. Both tests failed, with the messages given in the description: ```text agc_shader_vertex_index_extents ...***Failed vertex index extents: buffer_load_format_xyzw indexed by the vertex index: vertex extent 0, expected 16 agc_driver_vertex_indexed_ring ....***Failed AGC graphics: auto draw from vertex 5: the ring read by the vertex index has no vertex extent ``` I did not repeat the other single-part removals from the description. ## Findings ### Blocking 1. **The head does not compile on Linux x86-64 with libstdc++.** `core/shader/recompiler/ShaderDiskCache.cpp:91` and `:97` keep `sizeof(DescriptorBinding) == 656` and `sizeof(BufferResource) == 32`. The PR adds `bufferVertexExtent` and `vertexExtent`, which make them 680 and 36. These asserts sit under `#if defined(__linux__) && defined(__x86_64__) && defined(__GLIBCXX__)`, so the Windows/WinLibs build in the description never evaluates them. This confirms babyhuey's report, and it fails on the PR head on its own, not only after a merge. Fix: update both constants. The encoder and decoder already handle the new fields. 2. **Conflicts with current `main`** in the six files listed above. Resolving them takes more than picking a side: - `main`'s `MovedReadOnlyBuffers(..., const ColorTarget* target)` and the PR's `MovedReadOnlyBuffers(..., maxVertex)` need to become one function that takes both. Its size should be `BytesUpToTarget(address, VertexBoundBytes(binding, element, maxVertex), descriptor.Stride(), written ? nullptr : target)`. `Draw.cpp`'s template-hit call then passes `&state.color` and `maxVertex`. - `CheckBufferAliases` on `main` now calls `BytesUpToTarget`. It should take the vertex-bounded size as its input. - `CMakeLists.txt`: add `agc_shader_vertex_index_extents` to `main`'s longer `set_tests_properties` list (it now includes the `agc_shader_result_memo_budget*` tests). - `ShaderDiskCache.cpp`: keep `main`'s `fieldCount<ImageResource>() == 45` and the PR's `fieldCount<BufferResource>() == 13`. 3. **Disk-cache format 48 is already used on `main` for another layout.** `core/shader/recompiler/ShaderDiskCache.hpp:16` sets `FormatVersion = 48`. `main` took 48 in 787b6a6720 (cube descriptors, 2026-10-26) and is now at 49 (b9f4f65904). Entries written by a `main` build between those two commits would have format 48 but a different layout from this branch's. The description already says the number moves when `main` takes it. It needs to be 50, or whatever is next free when this merges. ### Non-blocking 1. **`BindsVertexRange` can miss a recipe that should hit.** At `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp:5618`, the check `item.size != guestBufferBytes(words, VertexBoundBytes(...))` compares against the untrimmed size. But `addGuestBuffer` (`ShaderResources.cpp:4390`) stores `item.size` after trimming a read-only element at the render target. Take a vertex-indexed element whose bounded range still ends less than one stride past `target.address`: every recipe replay for it is a `VertexRange` miss, even at the same vertex range. This costs performance only, because the miss falls back to the template-hit path. When resolving finding 2, apply the same `BytesUpToTarget(..., target)` here, so the comparison matches what the build stored. I am not repeating the performance-evidence discussion. MarcZX10 and oneandonlydean are handling it, and the PS5 pair with the `vertex range` miss count is still listed as open. ## Not verified - The merged tree: it conflicts, so the conflict resolution is untested. - The PR head exactly as pushed, beyond the compile failure: I ran every test with the two size constants patched locally. - A validation-layer run of the same tests on `main` for comparison. The patched PR head logged no `VUID-` lines for the six tests, so these tests cannot show the change adding validation errors over `main`. The three new tests do not exist on `main`. - The other single-part removals in the description's table. I ran only the `ResourceTracker.cpp` one. - Any title. I launched no game, so I did not check the Monopoly Plus numbers. - AMD hardware. I tested on NVIDIA only. ## To get this to a good state 1. Merge current `main` and resolve the six conflicts. Compose `BytesUpToTarget` with the vertex bound in `MovedReadOnlyBuffers` and `CheckBufferAliases`, and ideally in `BindsVertexRange` as well. 2. Update `sizeof(DescriptorBinding)` and `sizeof(BufferResource)` in `ShaderDiskCache.cpp`. Build once on Linux/GCC (or the `anyps5-build` CI image), since the Windows build never evaluates these asserts. 3. Move `FormatVersion` to the next unused number after `main`'s 49. 4. Rerun the four focused tests and the validation-layer comparison on the merged result.
MarcZX10 commented 2026-10-29 09:56:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T09:56:32Z.

Review: CHANGES_REQUESTED


Re-check — changes requested

Thanks for replacing the earlier local-stack numbers with a reproducible, current-format A/B: the same title/scene/machine, published base and change commits, four trace attachments, summary lines, and digest output are now present. The report also clearly discloses that both change traces dropped events and that this is a PS4 title running on a documented stack exception. I consider the earlier performance-form finding addressed; I am not treating the optional PS5 frame-time suggestion as a blocker.

The branch still needs integration against the current upstream base. I refreshed main to f7e84c4cf1609cc10bac95a44cd431805e5ebc8a and checked head 7ecf14ef124094e993240cb2fa04ae26ea4c34cf:

  • tools/check_conventions.py passes and git diff --check is clean.
  • tools/check_main_sync.py reports the branch is 2 commits ahead and 4,070 behind, with conflicts in six files: AGC CMakeLists.txt, ShaderResources.hpp/.cpp, Draw.cpp, and ShaderDiskCache.cpp/.hpp. Fourteen touched paths changed on both sides since merge base 366dd4e6b7.
  • The existing GPU and validation runs are on the earlier 366dd4e6b7 integration. They do not validate the current-main conflict resolution or its combined cache/draw behavior.

Please reconcile those current-main changes while preserving the vertex-range proof, moved-buffer bounds, cache serialization/versioning, and tests. Then rerun the focused shader-extent, draw-binding, indexed-ring and cache tests (including the validation-layer run where available) on the integrated head. If the integration changes the measured path, refresh the paired performance capture as well. I did not run GPU tests locally.

The previous approval/findings apply only to their stated heads. No approval is warranted for this stale, conflicted integration point.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5695852443 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9897#pullrequestreview-5695852443). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-29T09:56:32Z. **Review:** CHANGES_REQUESTED --- # Re-check — changes requested Thanks for replacing the earlier local-stack numbers with a reproducible, current-format A/B: the same title/scene/machine, published base and change commits, four trace attachments, summary lines, and digest output are now present. The report also clearly discloses that both change traces dropped events and that this is a PS4 title running on a documented stack exception. I consider the earlier performance-form finding addressed; I am not treating the optional PS5 frame-time suggestion as a blocker. The branch still needs integration against the current upstream base. I refreshed `main` to `f7e84c4cf1609cc10bac95a44cd431805e5ebc8a` and checked head `7ecf14ef124094e993240cb2fa04ae26ea4c34cf`: - `tools/check_conventions.py` passes and `git diff --check` is clean. - `tools/check_main_sync.py` reports the branch is 2 commits ahead and 4,070 behind, with conflicts in six files: AGC `CMakeLists.txt`, `ShaderResources.hpp/.cpp`, `Draw.cpp`, and `ShaderDiskCache.cpp/.hpp`. Fourteen touched paths changed on both sides since merge base `366dd4e6b7`. - The existing GPU and validation runs are on the earlier `366dd4e6b7` integration. They do not validate the current-main conflict resolution or its combined cache/draw behavior. Please reconcile those current-main changes while preserving the vertex-range proof, moved-buffer bounds, cache serialization/versioning, and tests. Then rerun the focused shader-extent, draw-binding, indexed-ring and cache tests (including the validation-layer run where available) on the integrated head. If the integration changes the measured path, refresh the paired performance capture as well. I did not run GPU tests locally. The previous approval/findings apply only to their stated heads. No approval is warranted for this stale, conflicted integration point.
XairRrR commented 2026-11-02 19:30:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-02T19:30:22Z.

Review: APPROVED


Re-checked — approved

Since my review of 7ecf14ef12, main was merged in three more times. There are also three fixes: the Linux sizeof constants plus the memo byte count, the target trim in BindsVertexRange, and the kept-bytes test. The tree builds with GCC on Linux, the focused tests pass, and removing either the vertex bound or the new trim makes the tests fail.

What changed since my last review

  • 6c9873072f: ShaderDiskCache.cpp asserts sizeof(DescriptorBinding) == 680 and sizeof(BufferResource) == 36. descriptorBindingBytes in Recompiler.cpp now counts bufferVertexExtent.
  • de4912048e, 837e2b0fcf and 5a7da3c59f merge main (most recently a4eca2a056). The resolutions:
    • MovedReadOnlyBuffers and CheckBufferAliases apply BytesUpToTarget to the vertex-bounded size.
    • The test registrations moved into the tests/cmake fragments.
    • FormatVersion is 52.
  • c9092458db: BindsVertexRange takes the draw's target and applies the same trim as addGuestBuffer.
  • 04db012394: the draw in RecordedKeptBytes.cpp now reads every vertex of its 64 KiB V#. TechLevelZero's NVIDIA run caught the earlier version of this test failing.

What I ran

PR head 5a7da3c59f858a887346748c3f18109e6781eaea, main a4eca2a056bf3bbbec98ab42e9d28163e4ea9cb8, merged with --no-ff in a clean worktree. Debian 13 VM, GCC 14.2.0, Release, Ninja, lavapipe (Mesa 26.1.6).

git diff --check a4eca2a056bf3bbbec98ab42e9d28163e4ea9cb8...5a7da3c59f858a887346748c3f18109e6781eaea
python3 tools/check_conventions.py --base a4eca2a056bf3bbbec98ab42e9d28163e4ea9cb8
ctest --test-dir build -j8 --test-load 32 --output-on-failure \
  -R '^(agc_shader_vertex_index_extents|agc_driver_vertex_range_bindings|agc_driver_vertex_indexed_ring|agc_driver_recorded_kept_bytes|agc_shader_disk_cache|agc_shader_memory|agc_driver_graphics)$'
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \
  ctest --test-dir build -j4 -V \
  -R '^(agc_shader_vertex_index_extents|agc_driver_vertex_range_bindings|agc_driver_vertex_indexed_ring|agc_driver_recorded_kept_bytes)$'
# negative control 1: BindsVertexRange compares item.size with the untrimmed bytes
ninja -C build agc_driver_graphics_tests agc_driver_vertex_indexed_ring_tests
ctest --test-dir build --output-on-failure -R '^(agc_driver_vertex_range_bindings|agc_driver_vertex_indexed_ring)$'
# negative control 2: VertexBoundBytes always returns the V#'s whole size
ninja -C build agc_driver_graphics_tests agc_driver_vertex_indexed_ring_tests
ctest --test-dir build --output-on-failure -R '^(agc_driver_vertex_range_bindings|agc_driver_vertex_indexed_ring)$'
# restore the merged ShaderResources.cpp, rebuild, rerun, git status --porcelain (empty)
Check Result
Merge into main a4eca2a056 clean
git diff --check clean
check_conventions.py passed
Build, Linux/GCC (the __linux__ size asserts are evaluated) OK
Script's test run (2140 tests the change reaches) 0 new failures, 0 timeouts; 7 known failures on main
7 focused tests 7/7 passed
4 new or changed tests under the validation layer 4/4 passed; layer inserted; 0 VUID- lines; no was not found but was requested line
Focused tests
1/7 Test #1589: agc_driver_vertex_range_bindings ...   Passed    0.02 sec
2/7 Test #1984: agc_shader_vertex_index_extents ....   Passed    0.14 sec
3/7 Test #1271: agc_driver_recorded_kept_bytes .....   Passed    0.29 sec
4/7 Test #1380: agc_driver_vertex_indexed_ring .....   Passed    0.61 sec
5/7 Test #1968: agc_shader_disk_cache ..............   Passed    4.03 sec
6/7 Test #1994: agc_shader_memory ..................   Passed    7.99 sec
7/7 Test #1585: agc_driver_graphics ................   Passed   34.24 sec

agc_driver_graphics takes over 30 s here. That is not this PR: its new case runs only under --vertex-range-bindings (agc_driver_vertex_range_bindings, 0.02 s). TechLevelZero's NVIDIA runs also show agc_driver_graphics at 30–33 s.

Negative control

The new tests call new APIs, so I disabled single parts of the change instead of restoring whole files.

  • BindsVertexRange compares against the untrimmed size (the state before c9092458db). Both tests fail:
    • agc_driver_vertex_indexed_ring: "a ring whose first three vertices reach 8 bytes into the target: the draw did not replay its recipe: vertex range"
    • agc_driver_vertex_range_bindings: "a template bound up to the render target was refused for the same vertex range and target"
  • VertexBoundBytes always returns the V#'s whole size. Both tests fail:
    • agc_driver_vertex_indexed_ring: "shader buffer aliases the render target"
    • agc_driver_vertex_range_bindings: "a read-only element indexed by the vertex index was not cut to the draw's last vertex"

Afterwards I restored the merged file and rebuilt. Both tests pass again, and git status --porcelain is empty.

Previous findings

  1. Blocking, Linux compile: Resolved. core/shader/recompiler/ShaderDiskCache.cpp:93 and :99 now assert 680 and 36, and the tree compiles with GCC 14.2 / libstdc++ on x86-64, where these asserts are evaluated.
  2. Blocking, conflicts with main: Resolved. The head merges cleanly into a4eca2a056.
    • MovedReadOnlyBuffers sizes an element with BytesUpToTarget(address, VertexBoundBytes(...), stride, written ? nullptr : target).
    • CheckBufferAliases passes the vertex-bounded size to BytesUpToTarget.
    • The template-hit call passes &state.color and maxVertex.
  3. Blocking, format number: Resolved. core/shader/recompiler/ShaderDiskCache.hpp:16 is 52; main is at 51.
  4. Non-blocking, BindsVertexRange ignored the target trim: Resolved. core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp:5855 now applies BytesUpToTarget with the draw's target before it compares item.size. Negative control 1 shows the tests catch it.

New findings

Blocking

None.

Non-blocking

None.

Not verified

  • Validation comparison with main. The script skipped it because the baseline of main has no validation run yet. I ran only the four new or changed tests under the layer (0 VUID- lines); three of them do not exist on main.
  • Hardware GPUs. I tested on lavapipe only. The RX 9070 XT runs are author-reported; the NVIDIA results come from TechLevelZero's runs at 04db012394 and 837e2b0fcf.
  • Performance. I did not run the Monopoly Plus A/B. It measured the change as first written (9c5c8619f7), before the target-trim reconciliation. The author argues that the trim cannot change the measured path; that argument is plausible, but I did not check it on a title.
  • Other removals. I did not repeat the description's remaining single-part removals (tracker, disk-cache fields, CheckBufferAliases).
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5742180412 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9897#pullrequestreview-5742180412). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-02T19:30:22Z. **Review:** APPROVED --- # Re-checked — approved Since my review of `7ecf14ef12`, `main` was merged in three more times. There are also three fixes: the Linux `sizeof` constants plus the memo byte count, the target trim in `BindsVertexRange`, and the kept-bytes test. The tree builds with GCC on Linux, the focused tests pass, and removing either the vertex bound or the new trim makes the tests fail. ## What changed since my last review - `6c9873072f`: `ShaderDiskCache.cpp` asserts `sizeof(DescriptorBinding) == 680` and `sizeof(BufferResource) == 36`. `descriptorBindingBytes` in `Recompiler.cpp` now counts `bufferVertexExtent`. - `de4912048e`, `837e2b0fcf` and `5a7da3c59f` merge `main` (most recently `a4eca2a056`). The resolutions: - `MovedReadOnlyBuffers` and `CheckBufferAliases` apply `BytesUpToTarget` to the vertex-bounded size. - The test registrations moved into the `tests/cmake` fragments. - `FormatVersion` is 52. - `c9092458db`: `BindsVertexRange` takes the draw's target and applies the same trim as `addGuestBuffer`. - `04db012394`: the draw in `RecordedKeptBytes.cpp` now reads every vertex of its 64 KiB V#. TechLevelZero's NVIDIA run caught the earlier version of this test failing. ## What I ran PR head `5a7da3c59f858a887346748c3f18109e6781eaea`, `main` `a4eca2a056bf3bbbec98ab42e9d28163e4ea9cb8`, merged with `--no-ff` in a clean worktree. Debian 13 VM, GCC 14.2.0, Release, Ninja, lavapipe (Mesa 26.1.6). ```sh git diff --check a4eca2a056bf3bbbec98ab42e9d28163e4ea9cb8...5a7da3c59f858a887346748c3f18109e6781eaea python3 tools/check_conventions.py --base a4eca2a056bf3bbbec98ab42e9d28163e4ea9cb8 ctest --test-dir build -j8 --test-load 32 --output-on-failure \ -R '^(agc_shader_vertex_index_extents|agc_driver_vertex_range_bindings|agc_driver_vertex_indexed_ring|agc_driver_recorded_kept_bytes|agc_shader_disk_cache|agc_shader_memory|agc_driver_graphics)$' VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \ ctest --test-dir build -j4 -V \ -R '^(agc_shader_vertex_index_extents|agc_driver_vertex_range_bindings|agc_driver_vertex_indexed_ring|agc_driver_recorded_kept_bytes)$' # negative control 1: BindsVertexRange compares item.size with the untrimmed bytes ninja -C build agc_driver_graphics_tests agc_driver_vertex_indexed_ring_tests ctest --test-dir build --output-on-failure -R '^(agc_driver_vertex_range_bindings|agc_driver_vertex_indexed_ring)$' # negative control 2: VertexBoundBytes always returns the V#'s whole size ninja -C build agc_driver_graphics_tests agc_driver_vertex_indexed_ring_tests ctest --test-dir build --output-on-failure -R '^(agc_driver_vertex_range_bindings|agc_driver_vertex_indexed_ring)$' # restore the merged ShaderResources.cpp, rebuild, rerun, git status --porcelain (empty) ``` | Check | Result | |---|---| | Merge into `main` `a4eca2a056` | clean | | `git diff --check` | clean | | `check_conventions.py` | passed | | Build, Linux/GCC (the `__linux__` size asserts are evaluated) | OK | | Script's test run (2140 tests the change reaches) | 0 new failures, 0 timeouts; 7 known failures on `main` | | 7 focused tests | 7/7 passed | | 4 new or changed tests under the validation layer | 4/4 passed; layer inserted; 0 `VUID-` lines; no `was not found but was requested` line | <details><summary>Focused tests</summary> ```text 1/7 Test #1589: agc_driver_vertex_range_bindings ... Passed 0.02 sec 2/7 Test #1984: agc_shader_vertex_index_extents .... Passed 0.14 sec 3/7 Test #1271: agc_driver_recorded_kept_bytes ..... Passed 0.29 sec 4/7 Test #1380: agc_driver_vertex_indexed_ring ..... Passed 0.61 sec 5/7 Test #1968: agc_shader_disk_cache .............. Passed 4.03 sec 6/7 Test #1994: agc_shader_memory .................. Passed 7.99 sec 7/7 Test #1585: agc_driver_graphics ................ Passed 34.24 sec ``` `agc_driver_graphics` takes over 30 s here. That is not this PR: its new case runs only under `--vertex-range-bindings` (`agc_driver_vertex_range_bindings`, 0.02 s). TechLevelZero's NVIDIA runs also show `agc_driver_graphics` at 30–33 s. </details> ## Negative control The new tests call new APIs, so I disabled single parts of the change instead of restoring whole files. - **`BindsVertexRange` compares against the untrimmed size** (the state before `c9092458db`). Both tests fail: - `agc_driver_vertex_indexed_ring`: "a ring whose first three vertices reach 8 bytes into the target: the draw did not replay its recipe: vertex range" - `agc_driver_vertex_range_bindings`: "a template bound up to the render target was refused for the same vertex range and target" - **`VertexBoundBytes` always returns the V#'s whole size.** Both tests fail: - `agc_driver_vertex_indexed_ring`: "shader buffer aliases the render target" - `agc_driver_vertex_range_bindings`: "a read-only element indexed by the vertex index was not cut to the draw's last vertex" Afterwards I restored the merged file and rebuilt. Both tests pass again, and `git status --porcelain` is empty. ## Previous findings 1. **Blocking, Linux compile: Resolved.** `core/shader/recompiler/ShaderDiskCache.cpp:93` and `:99` now assert 680 and 36, and the tree compiles with GCC 14.2 / libstdc++ on x86-64, where these asserts are evaluated. 2. **Blocking, conflicts with `main`: Resolved.** The head merges cleanly into `a4eca2a056`. - `MovedReadOnlyBuffers` sizes an element with `BytesUpToTarget(address, VertexBoundBytes(...), stride, written ? nullptr : target)`. - `CheckBufferAliases` passes the vertex-bounded size to `BytesUpToTarget`. - The template-hit call passes `&state.color` and `maxVertex`. 3. **Blocking, format number: Resolved.** `core/shader/recompiler/ShaderDiskCache.hpp:16` is 52; `main` is at 51. 4. **Non-blocking, `BindsVertexRange` ignored the target trim: Resolved.** `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp:5855` now applies `BytesUpToTarget` with the draw's target before it compares `item.size`. Negative control 1 shows the tests catch it. ## New findings ### Blocking None. ### Non-blocking None. ## Not verified - **Validation comparison with `main`.** The script skipped it because the baseline of `main` has no validation run yet. I ran only the four new or changed tests under the layer (0 `VUID-` lines); three of them do not exist on `main`. - **Hardware GPUs.** I tested on lavapipe only. The RX 9070 XT runs are author-reported; the NVIDIA results come from TechLevelZero's runs at `04db012394` and `837e2b0fcf`. - **Performance.** I did not run the Monopoly Plus A/B. It measured the change as first written (`9c5c8619f7`), before the target-trim reconciliation. The author argues that the trim cannot change the measured path; that argument is plausible, but I did not check it on a title. - **Other removals.** I did not repeat the description's remaining single-part removals (tracker, disk-cache fields, `CheckBufferAliases`). <!-- anyps5-bots job=2225 head=5a7da3c59f858a887346748c3f18109e6781eaea -->
XairRrR commented 2026-11-03 16:00:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T16:00:44Z.

Review: APPROVED


Re-checked — approved

The only new commit, c2a1b50412, merges main 4f41f4c375. It resolves the conflicts in tests/ShaderMemory.cpp and agc_shader_memory_tests.cmake correctly and moves FormatVersion to 53. The focused tests pass, with and without the validation layer, and the shader-extent test still fails without the tracker change.

What changed since my last review

  • The PR's own four commits are unchanged (delta.patch: d66bdd5797, 6c9873072f, c9092458db and 04db012394 are identical).
  • New merge commit c2a1b50412 (parents 5a7da3c59f and 4f41f4c375):
    • tests/ShaderMemory.cpp:
      • verifyVertexIndexExtents (line 2369) sits next to main's new verifyUnsetFormatImageMaterialization (line 2415).
      • Each function is defined once.
      • verifyVertexIndexExtents is called from the --vertex-index-extents branch (line 11140) and from the default run (line 11265).
    • tests/cmake/agc_shader_memory_tests.cmake:75: the Windows PATH list keeps both main's agc_shader_sampler_limits and this PR's agc_shader_vertex_index_extents.
    • core/shader/recompiler/ShaderDiskCache.hpp:16: FormatVersion is 53, because main is now at 52.
    • Against main, the Linux size and field-count guards differ only by this PR's own two values: DescriptorBinding 680 and BufferResource 36 / 13 fields. main changed none of them.
  • The description has a new "Merge of main 4f41f4c375" paragraph. It matches what I see in the tree.

What I ran

PR head c2a1b504124505f0eb1dbe2891ad7de73cb6ca97, main 4f41f4c375f5abb487dbd184fbc150f31994d762, merged with --no-ff (tree 1bbc670209e63787042edbf553334eeaedf722e3) in a clean worktree. Debian 13 VM, GCC 14.2.0, Release, Ninja, lavapipe (Mesa 26.1.6).

git diff --check 4f41f4c375f5abb487dbd184fbc150f31994d762...c2a1b504124505f0eb1dbe2891ad7de73cb6ca97
python3 tools/check_conventions.py --base 4f41f4c375f5abb487dbd184fbc150f31994d762
git diff 4f41f4c375f5abb487dbd184fbc150f31994d762 c2a1b504124505f0eb1dbe2891ad7de73cb6ca97 -- \
  core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp \
  core/libs/prx/libSceAgcDriver/tests/cmake/agc_shader_memory_tests.cmake \
  core/shader/recompiler/ShaderDiskCache.hpp core/shader/recompiler/ShaderDiskCache.cpp
ctest --test-dir build -j8 --test-load 32 --output-on-failure \
  -R '^(agc_shader_vertex_index_extents|agc_driver_vertex_range_bindings|agc_driver_vertex_indexed_ring|agc_driver_recorded_kept_bytes|agc_shader_disk_cache|agc_shader_memory|agc_shader_sampler_limits|agc_driver_graphics)$'
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \
  ctest --test-dir build -j4 -V \
  -R '^(agc_shader_vertex_index_extents|agc_driver_vertex_range_bindings|agc_driver_vertex_indexed_ring|agc_driver_recorded_kept_bytes)$'
# negative control: ResourceTracker.cpp from main
git show 4f41f4c375f5abb487dbd184fbc150f31994d762:core/shader/recompiler/Optimization/src/ResourceTracker.cpp > core/shader/recompiler/Optimization/src/ResourceTracker.cpp
ninja -C build -j32 -l32 agc_shader_memory_tests
ctest --test-dir build --output-on-failure -R '^agc_shader_vertex_index_extents$'
git show 1bbc670209e63787042edbf553334eeaedf722e3:core/shader/recompiler/Optimization/src/ResourceTracker.cpp > core/shader/recompiler/Optimization/src/ResourceTracker.cpp
ninja -C build -j32 -l32 agc_shader_memory_tests
ctest --test-dir build -R '^agc_shader_vertex_index_extents$'
git status --porcelain
Check Result
Merge into main 4f41f4c375 clean
git diff --check clean
check_conventions.py passed
Build (Linux/GCC, __linux__ size asserts evaluated) OK
Script's test run (2218 tests the change reaches) 0 new failures, 0 timeouts; 7 known failures on main; agc_driver_alpha_to_coverage_sample_mask_export passed on rerun
Script's validation comparison with main (771 tests, layer loaded in 770, none missing) 0 tests with new VUID- lines
8 focused tests 8/8 passed
4 new or changed tests under the validation layer 4/4 passed; 0 VUID- lines; no was not found but was requested line; layer inserted in the 2 Vulkan tests
Negative control fails as expected; passes again after restore; git status --porcelain empty
Focused tests
2/8 Test #1437: agc_driver_recorded_kept_bytes .....   Passed    0.34 sec
3/8 Test #1764: agc_driver_vertex_range_bindings ...   Passed    0.03 sec
4/8 Test #2168: agc_shader_vertex_index_extents ....   Passed    0.15 sec
5/8 Test #1547: agc_driver_vertex_indexed_ring .....   Passed    0.71 sec
6/8 Test #2178: agc_shader_memory ..................   Passed    9.76 sec
7/8 Test #2159: agc_shader_sampler_limits ..........   Passed   16.39 sec
8/8 Test #1760: agc_driver_graphics ................   Passed   35.87 sec
100% tests passed, 0 tests failed out of 8

As in my last review, agc_driver_graphics runs over 30 s on this machine. This PR's case in that executable runs only under --vertex-range-bindings (0.03 s).

Negative control output
1/1 Test #2168: agc_shader_vertex_index_extents ...***Failed    0.06 sec
vertex index extents: buffer_load_format_xyzw indexed by the vertex index: vertex extent 0, expected 16

Previous findings

My previous review (of 5a7da3c59f) had no open findings. The earlier ones (Linux sizeof constants, conflicts, format number, BindsVertexRange trim) stay resolved: the PR commits that fixed them are unchanged, and this merge keeps them. The format number is now 53, above main's 52.

New findings

Blocking

None.

Non-blocking

None.

Not verified

  • Hardware GPUs. I tested on lavapipe only. The RX 9070 XT runs at this head are author-reported. TechLevelZero's NVIDIA and AMD RADV runs are at 5a7da3c59f, not at this head.
  • Other negative controls. I did not repeat the BindsVertexRange and VertexBoundBytes controls at this head, because the merge does not touch those files. I did repeat the tracker control, since the merge touched ShaderMemory.cpp.
  • Performance. I did not rerun the Monopoly Plus A/B. As before, it measured the change as first written (9c5c8619f7).
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5755414783 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9897#pullrequestreview-5755414783). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-03T16:00:44Z. **Review:** APPROVED --- # Re-checked — approved The only new commit, `c2a1b50412`, merges `main` `4f41f4c375`. It resolves the conflicts in `tests/ShaderMemory.cpp` and `agc_shader_memory_tests.cmake` correctly and moves `FormatVersion` to 53. The focused tests pass, with and without the validation layer, and the shader-extent test still fails without the tracker change. ## What changed since my last review - The PR's own four commits are unchanged (delta.patch: `d66bdd5797`, `6c9873072f`, `c9092458db` and `04db012394` are identical). - New merge commit `c2a1b50412` (parents `5a7da3c59f` and `4f41f4c375`): - `tests/ShaderMemory.cpp`: - `verifyVertexIndexExtents` (line 2369) sits next to `main`'s new `verifyUnsetFormatImageMaterialization` (line 2415). - Each function is defined once. - `verifyVertexIndexExtents` is called from the `--vertex-index-extents` branch (line 11140) and from the default run (line 11265). - `tests/cmake/agc_shader_memory_tests.cmake:75`: the Windows `PATH` list keeps both `main`'s `agc_shader_sampler_limits` and this PR's `agc_shader_vertex_index_extents`. - `core/shader/recompiler/ShaderDiskCache.hpp:16`: `FormatVersion` is 53, because `main` is now at 52. - Against `main`, the Linux size and field-count guards differ only by this PR's own two values: `DescriptorBinding` 680 and `BufferResource` 36 / 13 fields. `main` changed none of them. - The description has a new "Merge of `main` `4f41f4c375`" paragraph. It matches what I see in the tree. ## What I ran PR head `c2a1b504124505f0eb1dbe2891ad7de73cb6ca97`, `main` `4f41f4c375f5abb487dbd184fbc150f31994d762`, merged with `--no-ff` (tree `1bbc670209e63787042edbf553334eeaedf722e3`) in a clean worktree. Debian 13 VM, GCC 14.2.0, Release, Ninja, lavapipe (Mesa 26.1.6). ```sh git diff --check 4f41f4c375f5abb487dbd184fbc150f31994d762...c2a1b504124505f0eb1dbe2891ad7de73cb6ca97 python3 tools/check_conventions.py --base 4f41f4c375f5abb487dbd184fbc150f31994d762 git diff 4f41f4c375f5abb487dbd184fbc150f31994d762 c2a1b504124505f0eb1dbe2891ad7de73cb6ca97 -- \ core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp \ core/libs/prx/libSceAgcDriver/tests/cmake/agc_shader_memory_tests.cmake \ core/shader/recompiler/ShaderDiskCache.hpp core/shader/recompiler/ShaderDiskCache.cpp ctest --test-dir build -j8 --test-load 32 --output-on-failure \ -R '^(agc_shader_vertex_index_extents|agc_driver_vertex_range_bindings|agc_driver_vertex_indexed_ring|agc_driver_recorded_kept_bytes|agc_shader_disk_cache|agc_shader_memory|agc_shader_sampler_limits|agc_driver_graphics)$' VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \ ctest --test-dir build -j4 -V \ -R '^(agc_shader_vertex_index_extents|agc_driver_vertex_range_bindings|agc_driver_vertex_indexed_ring|agc_driver_recorded_kept_bytes)$' # negative control: ResourceTracker.cpp from main git show 4f41f4c375f5abb487dbd184fbc150f31994d762:core/shader/recompiler/Optimization/src/ResourceTracker.cpp > core/shader/recompiler/Optimization/src/ResourceTracker.cpp ninja -C build -j32 -l32 agc_shader_memory_tests ctest --test-dir build --output-on-failure -R '^agc_shader_vertex_index_extents$' git show 1bbc670209e63787042edbf553334eeaedf722e3:core/shader/recompiler/Optimization/src/ResourceTracker.cpp > core/shader/recompiler/Optimization/src/ResourceTracker.cpp ninja -C build -j32 -l32 agc_shader_memory_tests ctest --test-dir build -R '^agc_shader_vertex_index_extents$' git status --porcelain ``` | Check | Result | |---|---| | Merge into `main` `4f41f4c375` | clean | | `git diff --check` | clean | | `check_conventions.py` | passed | | Build (Linux/GCC, `__linux__` size asserts evaluated) | OK | | Script's test run (2218 tests the change reaches) | 0 new failures, 0 timeouts; 7 known failures on `main`; `agc_driver_alpha_to_coverage_sample_mask_export` passed on rerun | | Script's validation comparison with `main` (771 tests, layer loaded in 770, none missing) | 0 tests with new `VUID-` lines | | 8 focused tests | 8/8 passed | | 4 new or changed tests under the validation layer | 4/4 passed; 0 `VUID-` lines; no `was not found but was requested` line; layer inserted in the 2 Vulkan tests | | Negative control | fails as expected; passes again after restore; `git status --porcelain` empty | <details><summary>Focused tests</summary> ```text 2/8 Test #1437: agc_driver_recorded_kept_bytes ..... Passed 0.34 sec 3/8 Test #1764: agc_driver_vertex_range_bindings ... Passed 0.03 sec 4/8 Test #2168: agc_shader_vertex_index_extents .... Passed 0.15 sec 5/8 Test #1547: agc_driver_vertex_indexed_ring ..... Passed 0.71 sec 6/8 Test #2178: agc_shader_memory .................. Passed 9.76 sec 7/8 Test #2159: agc_shader_sampler_limits .......... Passed 16.39 sec 8/8 Test #1760: agc_driver_graphics ................ Passed 35.87 sec 100% tests passed, 0 tests failed out of 8 ``` As in my last review, `agc_driver_graphics` runs over 30 s on this machine. This PR's case in that executable runs only under `--vertex-range-bindings` (0.03 s). </details> <details><summary>Negative control output</summary> ```text 1/1 Test #2168: agc_shader_vertex_index_extents ...***Failed 0.06 sec vertex index extents: buffer_load_format_xyzw indexed by the vertex index: vertex extent 0, expected 16 ``` </details> ## Previous findings My previous review (of `5a7da3c59f`) had no open findings. The earlier ones (Linux `sizeof` constants, conflicts, format number, `BindsVertexRange` trim) stay resolved: the PR commits that fixed them are unchanged, and this merge keeps them. The format number is now 53, above `main`'s 52. ## New findings ### Blocking None. ### Non-blocking None. ## Not verified - **Hardware GPUs.** I tested on lavapipe only. The RX 9070 XT runs at this head are author-reported. TechLevelZero's NVIDIA and AMD RADV runs are at `5a7da3c59f`, not at this head. - **Other negative controls.** I did not repeat the `BindsVertexRange` and `VertexBoundBytes` controls at this head, because the merge does not touch those files. I did repeat the tracker control, since the merge touched `ShaderMemory.cpp`. - **Performance.** I did not rerun the Monopoly Plus A/B. As before, it measured the change as first written (`9c5c8619f7`). <!-- anyps5-bots job=3432 head=c2a1b504124505f0eb1dbe2891ad7de73cb6ca97 -->
BunnyFl commented 2026-11-04 15:20:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by BunnyFl on 2026-11-04T15:20:05Z.

Review: COMMENTED


@savvaniss I looked at the point you raised, and the RingRefusals change reads right to me. With this PR the triangle binds the vertex-indexed V# only up to its last vertex, 48 bytes (your description above). A fill at byte 64 no longer overlaps what the draw reads, and serving the hit is then correct. The new fill over the first vertex keeps a refusal case in the test. On my machine, though, the PR's new ring test fails at this head.

What I ran: head 9cd9bd5d9f, which already contains main b11c7bf84f, Windows 11, WinLibs GCC, Release, AMD Radeon RX 9070 XT, driver 32.0.32015.12012, with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1 and VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation. The same set on main b11c7bf84f for comparison:

Test main this head
agc_driver_address_draw_space_reuse and its _off, _transitions, _verify, _held variants 5 pass 5 pass
agc_driver_vertex_range_bindings not on main pass
agc_shader_vertex_index_extents not on main pass
agc_driver_vertex_indexed_ring not on main fails, 3 of 3 runs
agc_driver_recorded_kept_bytes crashes with 0xc0000374 (heap corruption), 3 of 3 runs fails, 3 of 3 runs

Neither log has a VUID- or SYNC-HAZARD line, and neither reports a missing layer. Without the validation layer, both tests still fail on this head.

  • agc_driver_vertex_indexed_ring stops with AGC graphics: dual-source blending needs a float4 second color at location 0 index 1. That is main's check at core/libs/prx/libSceAgcDriver/Graphics/src/ShaderValidation.cpp:742. The test's TargetState (tests/execution/VertexIndexedRing.cpp:116-133) value-initialises the State, so dualSourceBlend and reversedBlend start false and 0 (Graphics/include/State.hpp:150-151). I haven't traced where they become set on this path. Your description lists this test among the 29 of 29 for this head on an RX 9070 XT. Its GPUs tested line names driver 32.0.31041.1004, and mine is 32.0.32015.12012. Was your 4 Nov run on that older driver? A run of this test on a 32.0.32015 driver, or its log from your run, would show whether the driver is the difference.
  • agc_driver_recorded_kept_bytes fails with a dispatch writing a copied 65536 bytes buffer left 0 bytes in its batch's kept bytes. On main the same test crashes before it gets that far (table above). This machine can't separate the PR's effect from main's crash. I'm not counting it against the PR, but your 04db012394 change to it isn't confirmed here either.

I'll re-check once the ring test passes here, or once you can explain why it differs on this driver.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5770827597 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9897#pullrequestreview-5770827597). Originally posted by [BunnyFl](https://github.com/BunnyFl) on 2026-11-04T15:20:05Z. **Review:** COMMENTED --- @savvaniss I looked at the point you raised, and the `RingRefusals` change reads right to me. With this PR the triangle binds the vertex-indexed V# only up to its last vertex, 48 bytes (your description above). A fill at byte 64 no longer overlaps what the draw reads, and serving the hit is then correct. The new fill over the first vertex keeps a refusal case in the test. On my machine, though, the PR's new ring test fails at this head. **What I ran:** head `9cd9bd5d9f`, which already contains `main` `b11c7bf84f`, Windows 11, WinLibs GCC, Release, AMD Radeon RX 9070 XT, driver 32.0.32015.12012, with `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1` and `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`. The same set on `main` `b11c7bf84f` for comparison: | Test | `main` | this head | |---|---|---| | `agc_driver_address_draw_space_reuse` and its `_off`, `_transitions`, `_verify`, `_held` variants | 5 pass | 5 pass | | `agc_driver_vertex_range_bindings` | not on `main` | pass | | `agc_shader_vertex_index_extents` | not on `main` | pass | | `agc_driver_vertex_indexed_ring` | not on `main` | **fails, 3 of 3 runs** | | `agc_driver_recorded_kept_bytes` | crashes with `0xc0000374` (heap corruption), 3 of 3 runs | **fails, 3 of 3 runs** | Neither log has a `VUID-` or `SYNC-HAZARD` line, and neither reports a missing layer. Without the validation layer, both tests still fail on this head. - `agc_driver_vertex_indexed_ring` stops with `AGC graphics: dual-source blending needs a float4 second color at location 0 index 1`. That is `main`'s check at `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderValidation.cpp:742`. The test's `TargetState` (`tests/execution/VertexIndexedRing.cpp:116-133`) value-initialises the `State`, so `dualSourceBlend` and `reversedBlend` start false and 0 (`Graphics/include/State.hpp:150-151`). I haven't traced where they become set on this path. Your description lists this test among the 29 of 29 for this head on an RX 9070 XT. Its `GPUs tested` line names driver 32.0.31041.1004, and mine is 32.0.32015.12012. Was your 4 Nov run on that older driver? A run of this test on a 32.0.32015 driver, or its log from your run, would show whether the driver is the difference. - `agc_driver_recorded_kept_bytes` fails with `a dispatch writing a copied 65536 bytes buffer left 0 bytes in its batch's kept bytes`. On `main` the same test crashes before it gets that far (table above). This machine can't separate the PR's effect from `main`'s crash. I'm not counting it against the PR, but your `04db012394` change to it isn't confirmed here either. I'll re-check once the ring test passes here, or once you can explain why it differs on this driver.
MarcZX10 commented 2026-11-14 09:53:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-14T09:53:02Z.

Review: COMMENTED


Reviewed — no blocking findings

The inspected implementation and tests support the stated vertex range bound; I did not run the reported checks, and one changed implementation file was not available in the prepared review folder.

What I ran

Reviewed head 3815a2d372303f53366172e2eb8daa33e4be10e2 using the prepared diff and pinned repository reader. No build or test commands were run.

Results

Check Result Note
Diff and targeted source review passed Changed logic and key callers inspected
Build and tests not run Results in the description are author reported

Findings

Blocking

None.

Non-blocking

None.

Not verified

ShaderResources.cpp was excluded from the prepared full-text files because it exceeded the review folder limit; I read its changed functions through the pinned reader. I did not read every changed file listed in the manifest, including some test and cache changes, so this review is incomplete. The build, tests, reported performance captures, and behavior on physical console hardware were not independently verified.

To get this to a good state

Nothing is required. Optional: complete review of the remaining changed files and run the relevant checks on this head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5903551520 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9897#pullrequestreview-5903551520). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-14T09:53:02Z. **Review:** COMMENTED --- # Reviewed — no blocking findings The inspected implementation and tests support the stated vertex range bound; I did not run the reported checks, and one changed implementation file was not available in the prepared review folder. ## What I ran Reviewed head `3815a2d372303f53366172e2eb8daa33e4be10e2` using the prepared diff and pinned repository reader. No build or test commands were run. ## Results | Check | Result | Note | |---|---|---| | Diff and targeted source review | passed | Changed logic and key callers inspected | | Build and tests | not run | Results in the description are author reported | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified `ShaderResources.cpp` was excluded from the prepared full-text files because it exceeded the review folder limit; I read its changed functions through the pinned reader. I did not read every changed file listed in the manifest, including some test and cache changes, so this review is incomplete. The build, tests, reported performance captures, and behavior on physical console hardware were not independently verified. ## To get this to a good state Nothing is required. Optional: complete review of the remaining changed files and run the relevant checks on this head.
MarcZX10 commented 2026-11-15 18:25:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-15T18:25:16Z.

Review: COMMENTED


Reviewed — no blocking findings

The reviewed portions show no verified blocking defect, but the full review is incomplete because some changed files were excluded and checks were not run here.

What I ran

Reviewed head 4c80f37e58ec2990d0ca706ac85a900b6030f7d0 against the prepared diff; no build or tests were run. The author reports Windows and Linux test runs in description.md.

Files read: description.md, commits.md, manifest.json, diff.patch; changed source ranges in Draw.cpp, ShaderResources.cpp, ResourceTracker.cpp, ShaderDiskCache.cpp, and Graphics.cpp.

Excluded by the prepared bundle as too large: full text for ShaderResources.cpp, Graphics.cpp, and VertexIndexedRing.cpp. Other changed files were not read in full.

Results

Check Result Note
Static review not run Targeted source ranges inspected
Build and tests not run Author reports results in the description

Findings

Blocking

None verified in the portions inspected.

Non-blocking

None.

Not verified

The full contents of ShaderResources.cpp, Graphics.cpp, and VertexIndexedRing.cpp were not reviewed. Several other changed files were not read; only the changed ranges needed for targeted context were inspected. No build, test suite, GPU run, or performance capture was performed by this review. The reported test and performance results are author-supplied.

To get this to a good state

Nothing is required. Optional: complete review of the excluded file contents and run the relevant checks on this head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5912170203 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9897#pullrequestreview-5912170203). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-15T18:25:16Z. **Review:** COMMENTED --- # Reviewed — no blocking findings The reviewed portions show no verified blocking defect, but the full review is incomplete because some changed files were excluded and checks were not run here. ## What I ran Reviewed head `4c80f37e58ec2990d0ca706ac85a900b6030f7d0` against the prepared diff; no build or tests were run. The author reports Windows and Linux test runs in `description.md`. Files read: `description.md`, `commits.md`, `manifest.json`, `diff.patch`; changed source ranges in `Draw.cpp`, `ShaderResources.cpp`, `ResourceTracker.cpp`, `ShaderDiskCache.cpp`, and `Graphics.cpp`. Excluded by the prepared bundle as too large: full text for `ShaderResources.cpp`, `Graphics.cpp`, and `VertexIndexedRing.cpp`. Other changed files were not read in full. ## Results | Check | Result | Note | |---|---|---| | Static review | not run | Targeted source ranges inspected | | Build and tests | not run | Author reports results in the description | ## Findings ### Blocking None verified in the portions inspected. ### Non-blocking None. ## Not verified The full contents of `ShaderResources.cpp`, `Graphics.cpp`, and `VertexIndexedRing.cpp` were not reviewed. Several other changed files were not read; only the changed ranges needed for targeted context were inspected. No build, test suite, GPU run, or performance capture was performed by this review. The reported test and performance results are author-supplied. ## To get this to a good state Nothing is required. Optional: complete review of the excluded file contents and run the relevant checks on this head.
MarcZX10 commented 2026-11-17 10:16:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-17T10:16:23Z.

Review: COMMENTED


Partly reviewed — no blocking findings in the parts read

Nothing blocks this in the parts read; the points below are optional, and the review is not complete, so this is a comment, not an approval.

What I ran

  • Head 11995f8283438450ccf7f3056b6a2e51fa813127, base main. No merged-preview check and no build; the initial checks in this run do not build.
  • Read the prepared description.md, commits.md, manifest.json, files.json and diff.patch: lines 1–400 and 915–1096 in full, and the ResourceTracker.cpp hunk at 939–1013.
  • Reader searches only (repo_read.py search) for GetSize, FormatVersion and SourceVersion at the head.

Results

Check Result Note
Build and unit tests not run No builds in this review
Reader checks passed Buffer size type and cache version checked at the head
Description FormatVersion failed Description says 51 or 57; head has 88
Test files not run Eight test files not read

Findings

Blocking

None found in the code read.

Non-blocking

  • The description's cache format numbers are out of date. It says FormatVersion is 51, then 57. At the head it is 88 (core/shader/recompiler/ShaderDiskCache.hpp:16). The disk cache directory is keyed by the generated SourceVersion, so a stale layout is still rejected. The PR does not need a version change of its own, but the description should be corrected.
  • ShaderDiskCache.cpp adds vertexExtent to BufferResource and bufferVertexExtent to DescriptorBinding, and updates the size guards and field counts to match (core/shader/recompiler/ShaderDiskCache.cpp:95, :101, :147). The buffer decode minimum goes from 27 to 31 (:887). I checked that the numbers agree with the diff; I did not compile them.

Not verified

  • Eight test files: tests/Graphics.cpp, tests/ShaderDiskCache.cpp, tests/ShaderMemory.cpp, tests/cmake/agc_driver_graphics_tests.cmake, tests/cmake/agc_shader_memory_tests.cmake, tests/execution/AddressDrawSpaceReuse.cpp, tests/execution/RecordedKeptBytes.cpp, tests/execution/VertexIndexedRing.cpp. Their hunks are in diff.patch lines 401–914 and were not read.
  • The full text of ShaderResources.cpp and Draw.cpp around the hunks, including the template-reuse path in resolveDrawResources and the callers of BindsVertexRange, VertexBoundBytes and MovedReadOnlyBuffers.
  • The claim that every access of a vertex-indexed element is proven (vertexIndexedExtent, ResourceTracker.cpp). The code looks conservative, but the IR cases were not checked.
  • The performance figures and the test results in the description. Not run and not checked here.
  • Linux and GPU behaviour.

To get this to a good state

Nothing is required. Optional: correct the FormatVersion numbers in the description.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5936597502 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9897#pullrequestreview-5936597502). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-17T10:16:23Z. **Review:** COMMENTED --- # Partly reviewed — no blocking findings in the parts read Nothing blocks this in the parts read; the points below are optional, and the review is not complete, so this is a comment, not an approval. ## What I ran - Head `11995f8283438450ccf7f3056b6a2e51fa813127`, base `main`. No merged-preview check and no build; the initial checks in this run do not build. - Read the prepared `description.md`, `commits.md`, `manifest.json`, `files.json` and `diff.patch`: lines 1–400 and 915–1096 in full, and the `ResourceTracker.cpp` hunk at 939–1013. - Reader searches only (`repo_read.py search`) for `GetSize`, `FormatVersion` and `SourceVersion` at the head. ## Results | Check | Result | Note | |---|---|---| | Build and unit tests | not run | No builds in this review | | Reader checks | passed | Buffer size type and cache version checked at the head | | Description FormatVersion | failed | Description says 51 or 57; head has 88 | | Test files | not run | Eight test files not read | ## Findings **Blocking** None found in the code read. **Non-blocking** - The description's cache format numbers are out of date. It says `FormatVersion` is 51, then 57. At the head it is 88 (`core/shader/recompiler/ShaderDiskCache.hpp:16`). The disk cache directory is keyed by the generated `SourceVersion`, so a stale layout is still rejected. The PR does not need a version change of its own, but the description should be corrected. - `ShaderDiskCache.cpp` adds `vertexExtent` to `BufferResource` and `bufferVertexExtent` to `DescriptorBinding`, and updates the size guards and field counts to match (`core/shader/recompiler/ShaderDiskCache.cpp:95`, `:101`, `:147`). The buffer decode minimum goes from 27 to 31 (`:887`). I checked that the numbers agree with the diff; I did not compile them. ## Not verified - Eight test files: `tests/Graphics.cpp`, `tests/ShaderDiskCache.cpp`, `tests/ShaderMemory.cpp`, `tests/cmake/agc_driver_graphics_tests.cmake`, `tests/cmake/agc_shader_memory_tests.cmake`, `tests/execution/AddressDrawSpaceReuse.cpp`, `tests/execution/RecordedKeptBytes.cpp`, `tests/execution/VertexIndexedRing.cpp`. Their hunks are in `diff.patch` lines 401–914 and were not read. - The full text of `ShaderResources.cpp` and `Draw.cpp` around the hunks, including the template-reuse path in `resolveDrawResources` and the callers of `BindsVertexRange`, `VertexBoundBytes` and `MovedReadOnlyBuffers`. - The claim that every access of a vertex-indexed element is proven (`vertexIndexedExtent`, `ResourceTracker.cpp`). The code looks conservative, but the IR cases were not checked. - The performance figures and the test results in the description. Not run and not checked here. - Linux and GPU behaviour. ## To get this to a good state Nothing is required. Optional: correct the `FormatVersion` numbers in the description.
MarcZX10 commented 2026-11-21 05:47:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T05:47:57Z.

Review: COMMENTED


Reviewed — no blocking findings

Nothing blocks this; the points below are optional.

What I ran

Reviewed head 3d3efe5fc54a4e29a198a8def68a8013fb4be313. No commands or tests were run; repo_read.py was used to inspect the prepared review bundle and targeted repository source.

Results

Check Result Note
Diff and change description passed Reviewed prepared bundle
Targeted source review passed Core bound and extent logic inspected
Automated checks not run No test execution performed

Findings

Blocking

None found in the code inspected.

Non-blocking

None.

Not verified

The review was limited to targeted sections, not every changed file. Full text was not read for Graphics/src/Draw.cpp, Graphics/src/ShaderResources.cpp, tests/Graphics.cpp, tests/ShaderMemory.cpp, and Optimization/src/ResourceTracker.cpp; targeted sections of the last two driver files and ResourceTracker.cpp were inspected through repo_read.py. The changed test, cache, build, and other recompiler files were not read. The review bundle’s files.json was unavailable, so the exact reviewed versus excluded inventory could not be confirmed; manifest.json marks ShaderResources.cpp and Graphics.cpp as excluded from bundled full text. Tests, builds, and reported performance measurements were not independently verified.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6003277433 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9897#pullrequestreview-6003277433). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-21T05:47:57Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing blocks this; the points below are optional. ## What I ran Reviewed head `3d3efe5fc54a4e29a198a8def68a8013fb4be313`. No commands or tests were run; `repo_read.py` was used to inspect the prepared review bundle and targeted repository source. ## Results | Check | Result | Note | |---|---|---| | Diff and change description | passed | Reviewed prepared bundle | | Targeted source review | passed | Core bound and extent logic inspected | | Automated checks | not run | No test execution performed | ## Findings ### Blocking None found in the code inspected. ### Non-blocking None. ## Not verified The review was limited to targeted sections, not every changed file. Full text was not read for `Graphics/src/Draw.cpp`, `Graphics/src/ShaderResources.cpp`, `tests/Graphics.cpp`, `tests/ShaderMemory.cpp`, and `Optimization/src/ResourceTracker.cpp`; targeted sections of the last two driver files and `ResourceTracker.cpp` were inspected through `repo_read.py`. The changed test, cache, build, and other recompiler files were not read. The review bundle’s `files.json` was unavailable, so the exact `reviewed` versus excluded inventory could not be confirmed; `manifest.json` marks `ShaderResources.cpp` and `Graphics.cpp` as excluded from bundled full text. Tests, builds, and reported performance measurements were not independently verified. ## To get this to a good state Nothing is required.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/9897:upstream-pr/9897'
git switch 'upstream-pr/9897'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/9897'
git switch 'upstream-pr/9897'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/9897'
git switch 'upstream-pr/9897'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/9897'
git switch 'main'
git merge --squash 'upstream-pr/9897'
git switch 'main'
git merge --ff-only 'upstream-pr/9897'
git switch 'main'
git merge 'upstream-pr/9897'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!9897
No description provided.