perf(agc): encode recorder batches on encoder threads from a recorded command stream (APS5_DEFERRED_ENCODE) #18173

Open
Nesyth wants to merge 5 commits from upstream-pr/18173 into main
Nesyth commented 2026-11-10 17:53:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Nesyth on 2026-11-10T17:53:18Z.


What

The draw committer records every Vulkan command of a batch by calling the driver, and submits the batch itself. With the two switches of this PR it does neither, and that time moves to other threads.

  • APS5_ASYNC_SUBMIT: the recorder hands each closed batch to a queue submitter thread, which calls vkQueueSubmit in order. Every other submit, present or wait on that queue drains the submitter first under the queue lock.
  • APS5_DEFERRED_ENCODE (with APS5_ASYNC_SUBMIT): a batch opened while it is set records its commands into a command stream instead of a command buffer. At submit an encoder thread (APS5_ENCODERS, 2 by default, 1 to 3) replays the stream into a command buffer of its own pool, and the submitter waits for that encode before it submits the batch in order.
  • The stream: the device's function resolver is wrapped (RecordCommandStreams, installed next to DeferDestructionToIdle), so every vkCmd* function the driver resolves is one thunk per command. The thunk appends the call, with a copy of what its pointers name, when the command buffer is a stream handle, and calls the driver otherwise. A vkCmd* name without a thunk throws when it is resolved, so a new command cannot hand a stream handle to the driver. 53 commands are recorded.
  • APS5_VERIFY_DEFERRED_ENCODE replays each stream on the submitting thread instead of an encoder thread, to tell stream bugs from threading bugs.
  • Both switches are off by default and APS5_AB can toggle them. With both unset the only change is that vkCmd* lookups return the thunks, which call the driver.
  • The three VK_EXT_descriptor_heap commands are not in the stream: the Vulkan headers on main do not have them yet. They need thunks when #9508 lands.

Five commits: the queue submitter, the command stream, the encoder threads, a fix for reusing a retired batch, and the fix for the two problems the Windows check of ddb00039e0 found (a test target that compiles PipelineCache.cpp alone did not link, and the mock device of agc_recorder_deferred_encode* lacked vkCmdPushConstants). Three targets that compile Resources.cpp alone get a queue access that does nothing (tests/QueueAccessNone.cpp).

Design note: batches encoded and submitted off the drawing thread

Scope once this sits on #17943 and #18029

#17943 defers the vkCmd* calls of a draw's recording window and replays them on one encoder thread per device
while the batch is still open; #18029 adds transfers and occlusion queries to that stream. This PR keeps two
things they do not have and drops everything else:

  1. Encoding per closed batch on a pool of encoder threads. A batch's commands are replayed after the batch
    is closed, by one of APS5_ENCODERS threads (1 to 3, 2 by default), so batches encode side by side.
  2. Submission on a queue submitter thread. vkQueueSubmit runs on one thread per queue, in the order the
    batches were closed; the drawing thread does not wait at Submit.

Both stay opt-in (APS5_ASYNC_SUBMIT, APS5_DEFERRED_ENCODE); with both unset the default vkCmd* path is
the one #17943 leaves.

Threads and ownership

Thread What it does What it may touch
Drawing thread (the committer with APS5_DRAW_PIPELINE, otherwise the queue worker) Records the open batch, closes it, hands it over. The open batch and its command stream, under the GPU mutex. Never an encoder's command pool or buffer.
Encoder threads Each takes one closed stream: begins a command buffer from its own pool, replays the stream in order, ends the buffer, completes the batch's ticket. The closed stream (not written after Close), its own pool and buffers. No Recorder state, no guest memory.
Queue submitter (one per VkQueue) Takes jobs in the order they were enqueued; waits for the job's encode ticket; calls vkQueueSubmit under the queue mutex. The queue, the job's fence and semaphores.
Any other user of the queue (presentation, a direct submit, a wait on the queue) Takes QueueAccess: drains the submitter, then holds the queue mutex. The queue.

What is recorded

A batch opened while APS5_DEFERRED_ENCODE is set has no VkCommandBuffer; its command handle is a stream
handle. Each recorded vkCmd* call is appended with a copy of everything its pointers name, so the stream
holds values only. Objects a command refers to are kept by the batch as they are today and released when the batch
completes, which is after its fence signalled, so after its submit and its encode.

Ordering

  • Inside a batch: one thread appends in program order and one encoder replays in the same order, so the
    command buffer is the one inline recording produces (agc_command_stream, agc_recorder_deferred_encode*
    compare them).
  • Between batches: the drawing thread enqueues the job when it closes the batch; the submitter submits
    strictly in that order. An encode that finishes early waits in its ticket; a late one makes the submitter
    wait (EncodeTicket::Wait), never reorder.
  • Against other users of the queue: QueueAccess drains the submitter before a present, a direct submit or
    a wait, so they see every earlier batch submitted.
  • Completion: a wait for a batch waits for its fence and then for its submit call to have returned
    (WaitSubmitReturned) before the batch's results are read.
  • Lookups: the device's function resolver is wrapped, so every vkCmd* the driver resolves, the
    checkpoint markers and the query commands included, is a thunk that records into the stream; a vkCmd*
    name without a thunk throws when it is resolved, so no path can hand a stream handle to the driver.

Where the drawing thread waits

Never while recording and never at Submit. It waits only where it needs the queue (through QueueAccess) or a
batch's result (through the batch's fence, after its submit returned).

Failure

An exception during a replay fails the ticket. The submitter then submits that batch without commands, so its
fence and semaphores still signal in order, stores the error, and the drawing thread gets it at its next
enqueue (RethrowFailure). A failure of vkQueueSubmit is stored and rethrown the same way.

Fallbacks

  • Switches unset: commands go to the driver as in #17943.
  • APS5_VERIFY_DEFERRED_ENCODE: every stream is replayed on the submitting thread, which separates stream
    errors from threading errors.
  • No encoder available: the stream is replayed inline at submit.

What it adds to #17943, and what it costs

  • Adds: more than one batch encoding at a time; vkQueueSubmit off the drawing thread; no settle point
    while a batch records, because nothing touches a real command buffer before the batch is closed.
  • Costs: a batch reaches the GPU only after it is closed and encoded, where #17943 replays as the batch
    records; the submitter's waits for encodes are counted ([encode] line).
  • Open question for the rebase: whether #17943's chunk format can hold a whole batch until it closes. If it
    can, this PR reuses it and drops its own stream and thunks; if not, the note will say what is missing.

Measured (main 7f96086b4e, an open-world, draw-heavy title, in-run A/B, 10 pairs)

Presents per 10 s 105.04 -> 116.64 (+11.50 +- 0.48 against the neighbouring phases, +11.0%); frame time
95.23 -> 85.76 ms. Traces of main and of the PR from one session are linked in the description.

Tested

Windows 11 Pro 26300, Radeon RX 7900 XTX (AMD Software 26.10.1), Ryzen 7 7800X3D, Release, MinGW-w64 GCC 15.2.

An open-world, draw-heavy title on main 7f96086b4e, the same save and scene in every boot, no other switches.

In-run A/B on the PR build (APS5_AB=30:APS5_ASYNC_SUBMIT+APS5_DEFERRED_ENCODE, phases of 30 s from 190 s after the first present, 10 pairs, read with tools/ab_split.py):

both unset both set difference
presents per 10 s 105.04 116.64 +11.0% (+11.50 +- 0.48 against the neighbouring phases, n 10)
frame ms 95.23 85.76 -9.9% (-9.37 +- 0.36)

Separate boots, 313 s in game each, with APS5_TRACE_SECONDS=300:30:

build switches FPS frame p50 / p90 / p99 ms GPU busy ms per present
main 7f96086b4e none 7.60 136.5 / 144.7 / 156.2 32.7
this PR both set 8.57 120.0 / 125.4 / 130.1 32.3

Two more boots of main without a trace gave 7.46 and 7.78 FPS over 229 s in game. No boot had a fatal error or a lost device. The measured build is 151796f744. The head differs from it in tests and in where the thunks are installed; one more boot of the head with both switches set gave 8.48 FPS over 143 s, again without a fatal error.

Both traces are incomplete: the queue worker and the draw committer filled their buffers inside the 30 s window, as the digests below say. The summary lines are complete.

Traces, both captured on the same machine in one session: main 7f96086b4e, this PR.

Tests: on the head, after a build of every target: agc_command_stream, agc_driver_recorder, agc_driver_recorder_deferred_encode and _verify, agc_recorder_deferred_encode, _one, _three and _verify, agc_submit_progress_deferred_encode and _verify, agc_pipeline_cache_allocation_*, agc_buffer_pool*, agc_command_batch_failure, agc_driver_pooled_buffer_range, agc_deferred_destruction and the runtime switch tests pass (28 of 28).

trace_digest: main 7f96086b4e

seconds 300:30 from present 4191: 219 presents, frame p50 136.5 / p90 144.7 / p99 156.2 / max 193.5 ms, GPU busy 32.7 ms per present
AMD Radeon RX 7900 XTX, AMD proprietary driver 26.10.1 (LLPC), Windows 10.0.26300, 3840x2160, commit 7f96086b4e, dropped: yes

{"commit":"7f96086b4e9f","dirty":false,"env":{"APS5_LOG_TIMESTAMPS":"1","APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"300:30"},"gpu":"AMD Radeon RX 7900 XTX","driver":"AMD proprietary driver 26.10.1 (LLPC)","os":"Windows 10.0.26300","cpu":"AMD Ryzen 7 7800X3D 8-Core Processor","cpu_threads":16,"memory_mib":31860,"title_id":"<withheld>","title":"<withheld>","content_version":"01.011.001","resolution":"3840x2160","window":{"spec":"seconds 300:30","first_present":4191,"ms":30102.174},"presents":219,"frame_ms":{"p50":136.453,"p90":144.67,"p99":156.19,"max":193.475},"gpu_busy_ms_per_present":32.723,"worker_busy_pct":{"queue worker 0x0":97.421},"top_phases_ms_per_frame":{"Driver.Packet":127.279,"Graphics.Draw":101.951,"Driver.Packet.draw":99.611,"Driver.Draw":98.448,"Graphics.Draw.draw_and_resource_release":86.987,"Driver.Draw.shader_compile_and_link":49.714,"Shader.DrawStage":36.081,"Driver.Draw.draw_enqueued":31.328},"owned_draw_counts":{},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":4.989,"events_lost":1312170,"totals_full":false},"draw committer":{"events_full_after_s":10.904,"events_lost":460652,"totals_full":false}},"trace":"aps5-trace-7f96086b4e9f-87472.json.gz"}

Incomplete trace: recorded data was lost. Slice-based timings, waits and batch inventories cover retained events only; missing slices are not idle time. Summary statistics are reported separately.

  • queue worker 0x0: 1312170 events lost; buffer full at 4988.6 ms
  • draw committer: 460652 events lost; buffer full at 10904.0 ms

Slowest frames (largest slices inside each, inclusive)

  • present 4232: 193.5 ms at 5539 ms: Graphics.Draw (draw committer) 135.7, Graphics.Draw.draw_and_resource_release (draw committer) 111.8, batch (gpu) 32.4, VideoOut.Flip (presenter) 7.2
  • present 4368: 163.0 ms at 24275 ms: batch (gpu) 32.6, VideoOut.Flip (presenter) 7.1, VideoOut.Flip.present (presenter) 7.0, Driver.Present (presenter) 7.0
  • present 4241: 156.2 ms at 6844 ms: Graphics.Draw (draw committer) 99.9, Graphics.Draw.draw_and_resource_release (draw committer) 84.0, batch (gpu) 33.2, VideoOut.Flip (presenter) 6.4
  • present 4364: 155.5 ms at 23696 ms: batch (gpu) 30.9, VideoOut.Flip (presenter) 7.9, VideoOut.Flip.present (presenter) 7.8, Driver.Present (presenter) 7.8
  • present 4340: 154.4 ms at 20452 ms: batch (gpu) 32.0, VideoOut.Flip (presenter) 7.2, VideoOut.Flip.present (presenter) 7.1, Driver.Present (presenter) 7.1

Persistent spikes (frame time above the fastest frame that separates it from a longer frame; one entry per stall, not per frame)

  • present 4232: 193.5 ms at 5539 ms, persistence 70.8 ms
  • present 4368: 163.0 ms at 24275 ms, persistence 40.3 ms
  • present 4340: 154.4 ms at 20452 ms, persistence 26.6 ms
  • present 4289: 152.2 ms at 13350 ms, persistence 25.0 ms
  • present 4241: 156.2 ms at 6844 ms, persistence 23.4 ms
  • present 4389: 153.7 ms at 27175 ms, persistence 22.3 ms
  • present 4333: 147.6 ms at 19482 ms, persistence 18.0 ms
  • present 4364: 155.5 ms at 23696 ms, persistence 17.4 ms
  • present 4406: 149.0 ms at 29540 ms, persistence 17.1 ms
  • present 4337: 151.4 ms at 20030 ms, persistence 17.1 ms

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
title 0.0 (0 %) 0.0 (0 %) 137.4 0.0 Shader.ResolveGraphicsStagesAbi 0.0
queue worker 0x0 17.6 (13 %) 0.2 (0 %) 119.7 29.7 Driver.Packet 16.7, Driver.Rewind 0.7
draw committer 33.1 (24 %) 0.1 (0 %) 104.3 17.6 Graphics.Draw 31.1, Recorder.Submit 1.8
title 0.0 (0 %) 0.0 (0 %) 137.4 0.0
presenter 2.4 (2 %) 5.3 (4 %) 129.7 0.1 VideoOut.Flip 7.7, Driver.Present 0.0
gpu 32.7 (24 %) 0.0 (0 %) 104.8 0.0 batch 32.7

Largest slices (ms per frame, inclusive, all threads): batch 32.7, Graphics.Draw 31.1, Graphics.Draw.draw_and_resource_release 25.2, Driver.Packet 16.7, Driver.Packet.draw 13.7, Driver.Draw 13.5, VideoOut.Flip 7.7, Driver.Present 7.6, VideoOut.Flip.present 7.5, Driver.Draw.shader_compile_and_link 4.5

Longest waits

  • Driver.Present.render_fence_wait (presenter) 8.1 ms at 28715 ms, present 4400
  • Vulkan.Acquire.acquire_fence_wait (presenter) 6.8 ms at 27600 ms, present 4392
  • Vulkan.Acquire.acquire_fence_wait (presenter) 6.7 ms at 20030 ms, present 4337
  • Vulkan.Acquire.acquire_fence_wait (presenter) 6.6 ms at 14198 ms, present 4295
  • Vulkan.Acquire.acquire_fence_wait (presenter) 6.4 ms at 13086 ms, present 4287
  • Vulkan.Acquire.acquire_fence_wait (presenter) 6.2 ms at 18100 ms, present 4323
  • Driver.Present.render_fence_wait (presenter) 6.2 ms at 26215 ms, present 4382
  • Vulkan.Acquire.acquire_fence_wait (presenter) 6.1 ms at 27329 ms, present 4390
  • Vulkan.Acquire.acquire_fence_wait (presenter) 6.0 ms at 19630 ms, present 4334
  • Vulkan.Acquire.acquire_fence_wait (presenter) 4.7 ms at 26208 ms, present 4382

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

  • batch 27902: 7.8 ms at 28434 ms, present 4397: GPU no ranges; recorded by no CPU slices
  • batch 18609: 7.3 ms at 18923 ms, present 4328: GPU no ranges; recorded by no CPU slices
  • batch 19154: 7.3 ms at 19481 ms, present 4332: GPU no ranges; recorded by no CPU slices
  • batch 15743: 7.1 ms at 16018 ms, present 4307: GPU no ranges; recorded by no CPU slices
  • batch 15468: 7.1 ms at 15737 ms, present 4305: GPU no ranges; recorded by no CPU slices
trace_digest: this PR, both switches set

seconds 300:30 from present 4494: 250 presents, frame p50 120.0 / p90 125.4 / p99 130.1 / max 131.9 ms, GPU busy 32.3 ms per present
AMD Radeon RX 7900 XTX, AMD proprietary driver 26.10.1 (LLPC), Windows 10.0.26300, 3840x2160, commit 151796f74490, dropped: yes

{"commit":"151796f74490","dirty":false,"env":{"APS5_ASYNC_SUBMIT":"1","APS5_DEFERRED_ENCODE":"1","APS5_LOG_TIMESTAMPS":"1","APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"300:30"},"gpu":"AMD Radeon RX 7900 XTX","driver":"AMD proprietary driver 26.10.1 (LLPC)","os":"Windows 10.0.26300","cpu":"AMD Ryzen 7 7800X3D 8-Core Processor","cpu_threads":16,"memory_mib":31860,"title_id":"<withheld>","title":"<withheld>","content_version":"01.011.001","resolution":"3840x2160","window":{"spec":"seconds 300:30","first_present":4494,"ms":30057.946},"presents":250,"frame_ms":{"p50":119.959,"p90":125.399,"p99":130.079,"max":131.933},"gpu_busy_ms_per_present":32.275,"worker_busy_pct":{"queue worker 0x0":97.347},"top_phases_ms_per_frame":{"Driver.Packet":111.063,"Graphics.Draw":90.681,"Driver.Packet.draw":87.602,"Driver.Draw":86.51,"Graphics.Draw.draw_and_resource_release":77.529,"Driver.Draw.shader_compile_and_link":44.971,"Shader.DrawStage":32.417,"Driver.Draw.draw_enqueued":25.854},"owned_draw_counts":{},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":4.977,"events_lost":1341765,"totals_full":false},"draw committer":{"events_full_after_s":11.236,"events_lost":445009,"totals_full":false}},"trace":"aps5-trace-151796f74490-98812.json.gz"}

Incomplete trace: recorded data was lost. Slice-based timings, waits and batch inventories cover retained events only; missing slices are not idle time. Summary statistics are reported separately.

  • queue worker 0x0: 1341765 events lost; buffer full at 4976.9 ms
  • draw committer: 445009 events lost; buffer full at 11236.3 ms

Slowest frames (largest slices inside each, inclusive)

  • present 4722: 131.9 ms at 27371 ms: batch (gpu) 35.8, VideoOut.Flip (presenter) 7.9, VideoOut.Flip.present (presenter) 7.8, Driver.Present (presenter) 7.8
  • present 4628: 131.3 ms at 16013 ms: batch (gpu) 36.8, VideoOut.Flip (presenter) 12.2, VideoOut.Flip.present (presenter) 12.1, Driver.Present (presenter) 12.1
  • present 4630: 130.1 ms at 16266 ms: batch (gpu) 31.9, VideoOut.Flip (presenter) 8.5, VideoOut.Flip.present (presenter) 8.4, Driver.Present (presenter) 8.4
  • present 4666: 129.4 ms at 20655 ms: batch (gpu) 34.0, VideoOut.Flip (presenter) 7.9, VideoOut.Flip.present (presenter) 7.8, Driver.Present (presenter) 7.8
  • present 4738: 128.3 ms at 29317 ms: batch (gpu) 34.4, VideoOut.Flip (presenter) 8.2, VideoOut.Flip.present (presenter) 8.1, Driver.Present (presenter) 8.1

Persistent spikes (frame time above the fastest frame that separates it from a longer frame; one entry per stall, not per frame)

  • present 4722: 131.9 ms at 27371 ms, persistence 19.3 ms
  • present 4628: 131.3 ms at 16013 ms, persistence 18.4 ms
  • present 4569: 128.2 ms at 8946 ms, persistence 15.5 ms
  • present 4666: 129.4 ms at 20655 ms, persistence 13.5 ms
  • present 4573: 128.0 ms at 9435 ms, persistence 13.3 ms
  • present 4622: 128.0 ms at 15289 ms, persistence 12.6 ms
  • present 4617: 127.1 ms at 14683 ms, persistence 11.8 ms
  • present 4650: 128.1 ms at 18692 ms, persistence 11.8 ms
  • present 4588: 125.4 ms at 11240 ms, persistence 11.7 ms
  • present 4738: 128.3 ms at 29317 ms, persistence 11.6 ms

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
command encoder 2 2.2 (2 %) 0.0 (0 %) 118.0 0.2 Graphics.Encode 2.2
command encoder 2.2 (2 %) 0.0 (0 %) 118.1 0.2 Graphics.Encode 2.2
title 0.0 (0 %) 0.0 (0 %) 120.2 0.0 Shader.ResolveGraphicsStagesAbi 0.0
queue worker 0x0 14.8 (12 %) 0.2 (0 %) 105.3 28.5 Driver.Packet 14.0, Driver.Rewind 0.7
draw committer 28.1 (23 %) 0.1 (0 %) 92.1 18.1 Graphics.Draw 27.9, Recorder.Reap 0.2
presenter 2.7 (2 %) 5.5 (5 %) 112.0 0.1 VideoOut.Flip 8.2, Driver.Present 0.0
gpu 32.3 (27 %) 0.0 (0 %) 88.0 0.0 batch 32.3

Largest slices (ms per frame, inclusive, all threads): batch 32.3, Graphics.Draw 27.9, Graphics.Draw.draw_and_resource_release 22.1, Driver.Packet 14.0, Driver.Packet.draw 11.6, Driver.Draw 11.4, VideoOut.Flip 8.2, Driver.Present 8.1, VideoOut.Flip.present 8.0, Graphics.Encode 4.4

Longest waits

  • Vulkan.Acquire.acquire_fence_wait (presenter) 6.3 ms at 9196 ms, present 4571
  • Driver.Present.render_fence_wait (presenter) 6.1 ms at 13132 ms, present 4604
  • Vulkan.Acquire.acquire_fence_wait (presenter) 5.9 ms at 19566 ms, present 4657
  • Vulkan.Acquire.acquire_fence_wait (presenter) 5.9 ms at 21871 ms, present 4676
  • Vulkan.Acquire.acquire_fence_wait (presenter) 5.8 ms at 29070 ms, present 4736
  • Driver.Present.render_fence_wait (presenter) 5.7 ms at 3318 ms, present 4522
  • Driver.Present.render_fence_wait (presenter) 5.7 ms at 21394 ms, present 4672
  • Vulkan.Acquire.acquire_fence_wait (presenter) 5.6 ms at 4973 ms, present 4536
  • Vulkan.Acquire.acquire_fence_wait (presenter) 5.6 ms at 27979 ms, present 4727
  • Vulkan.Acquire.acquire_fence_wait (presenter) 5.6 ms at 8214 ms, present 4563

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

  • batch 14473: 7.3 ms at 13007 ms, present 4603: GPU no ranges; recorded by Graphics.Encode (command encoder 2) 0.0
  • batch 32209: 7.3 ms at 29071 ms, present 4736: GPU no ranges; recorded by Graphics.Encode (command encoder) 0.0
  • batch 516: 7.2 ms at 482 ms, present 4498: GPU no ranges; recorded by Graphics.Draw (draw committer) 0.6, Graphics.Draw.draw_and_resource_release (draw committer) 0.5, Graphics.Encode (command encoder) 0.0, Recorder.Reap (draw committer) 0.0
  • batch 9819: 6.9 ms at 8818 ms, present 4567: GPU no ranges; recorded by Graphics.Draw (draw committer) 0.3, Graphics.Draw.draw_and_resource_release (draw committer) 0.3, Graphics.Encode (command encoder 2) 0.0
  • batch 11278: 6.8 ms at 10169 ms, present 4578: GPU no ranges; recorded by Graphics.Draw (draw committer) 0.4, Graphics.Draw.draw_and_resource_release (draw committer) 0.3, Graphics.Encode (command encoder) 0.0

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: AMD Radeon RX 7900 XTX, AMD Software 26.10.1, Windows 11 Pro 26300
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5246165127 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18173). Originally posted by [Nesyth](https://github.com/Nesyth) on 2026-11-10T17:53:18Z. --- ### What The draw committer records every Vulkan command of a batch by calling the driver, and submits the batch itself. With the two switches of this PR it does neither, and that time moves to other threads. - `APS5_ASYNC_SUBMIT`: the recorder hands each closed batch to a queue submitter thread, which calls `vkQueueSubmit` in order. Every other submit, present or wait on that queue drains the submitter first under the queue lock. - `APS5_DEFERRED_ENCODE` (with `APS5_ASYNC_SUBMIT`): a batch opened while it is set records its commands into a command stream instead of a command buffer. At submit an encoder thread (`APS5_ENCODERS`, 2 by default, 1 to 3) replays the stream into a command buffer of its own pool, and the submitter waits for that encode before it submits the batch in order. - The stream: the device's function resolver is wrapped (`RecordCommandStreams`, installed next to `DeferDestructionToIdle`), so every `vkCmd*` function the driver resolves is one thunk per command. The thunk appends the call, with a copy of what its pointers name, when the command buffer is a stream handle, and calls the driver otherwise. A `vkCmd*` name without a thunk throws when it is resolved, so a new command cannot hand a stream handle to the driver. 53 commands are recorded. - `APS5_VERIFY_DEFERRED_ENCODE` replays each stream on the submitting thread instead of an encoder thread, to tell stream bugs from threading bugs. - Both switches are off by default and `APS5_AB` can toggle them. With both unset the only change is that `vkCmd*` lookups return the thunks, which call the driver. - The three `VK_EXT_descriptor_heap` commands are not in the stream: the Vulkan headers on main do not have them yet. They need thunks when #9508 lands. Five commits: the queue submitter, the command stream, the encoder threads, a fix for reusing a retired batch, and the fix for the two problems the Windows check of ddb00039e0 found (a test target that compiles `PipelineCache.cpp` alone did not link, and the mock device of `agc_recorder_deferred_encode*` lacked `vkCmdPushConstants`). Three targets that compile `Resources.cpp` alone get a queue access that does nothing (`tests/QueueAccessNone.cpp`). ### Design note: batches encoded and submitted off the drawing thread #### Scope once this sits on #17943 and #18029 #17943 defers the `vkCmd*` calls of a draw's recording window and replays them on one encoder thread per device while the batch is still open; #18029 adds transfers and occlusion queries to that stream. This PR keeps two things they do not have and drops everything else: 1. **Encoding per closed batch on a pool of encoder threads.** A batch's commands are replayed after the batch is closed, by one of `APS5_ENCODERS` threads (1 to 3, 2 by default), so batches encode side by side. 2. **Submission on a queue submitter thread.** `vkQueueSubmit` runs on one thread per queue, in the order the batches were closed; the drawing thread does not wait at `Submit`. Both stay opt-in (`APS5_ASYNC_SUBMIT`, `APS5_DEFERRED_ENCODE`); with both unset the default `vkCmd*` path is the one #17943 leaves. #### Threads and ownership | Thread | What it does | What it may touch | |---|---|---| | Drawing thread (the committer with `APS5_DRAW_PIPELINE`, otherwise the queue worker) | Records the open batch, closes it, hands it over. | The open batch and its command stream, under the GPU mutex. Never an encoder's command pool or buffer. | | Encoder threads | Each takes one closed stream: begins a command buffer from its own pool, replays the stream in order, ends the buffer, completes the batch's ticket. | The closed stream (not written after `Close`), its own pool and buffers. No Recorder state, no guest memory. | | Queue submitter (one per `VkQueue`) | Takes jobs in the order they were enqueued; waits for the job's encode ticket; calls `vkQueueSubmit` under the queue mutex. | The queue, the job's fence and semaphores. | | Any other user of the queue (presentation, a direct submit, a wait on the queue) | Takes `QueueAccess`: drains the submitter, then holds the queue mutex. | The queue. | #### What is recorded A batch opened while `APS5_DEFERRED_ENCODE` is set has no `VkCommandBuffer`; its command handle is a stream handle. Each recorded `vkCmd*` call is appended with a copy of everything its pointers name, so the stream holds values only. Objects a command refers to are kept by the batch as they are today and released when the batch completes, which is after its fence signalled, so after its submit and its encode. #### Ordering - **Inside a batch:** one thread appends in program order and one encoder replays in the same order, so the command buffer is the one inline recording produces (`agc_command_stream`, `agc_recorder_deferred_encode*` compare them). - **Between batches:** the drawing thread enqueues the job when it closes the batch; the submitter submits strictly in that order. An encode that finishes early waits in its ticket; a late one makes the submitter wait (`EncodeTicket::Wait`), never reorder. - **Against other users of the queue:** `QueueAccess` drains the submitter before a present, a direct submit or a wait, so they see every earlier batch submitted. - **Completion:** a wait for a batch waits for its fence and then for its submit call to have returned (`WaitSubmitReturned`) before the batch's results are read. - **Lookups:** the device's function resolver is wrapped, so every `vkCmd*` the driver resolves, the checkpoint markers and the query commands included, is a thunk that records into the stream; a `vkCmd*` name without a thunk throws when it is resolved, so no path can hand a stream handle to the driver. #### Where the drawing thread waits Never while recording and never at `Submit`. It waits only where it needs the queue (through `QueueAccess`) or a batch's result (through the batch's fence, after its submit returned). #### Failure An exception during a replay fails the ticket. The submitter then submits that batch without commands, so its fence and semaphores still signal in order, stores the error, and the drawing thread gets it at its next enqueue (`RethrowFailure`). A failure of `vkQueueSubmit` is stored and rethrown the same way. #### Fallbacks - Switches unset: commands go to the driver as in #17943. - `APS5_VERIFY_DEFERRED_ENCODE`: every stream is replayed on the submitting thread, which separates stream errors from threading errors. - No encoder available: the stream is replayed inline at submit. #### What it adds to #17943, and what it costs - **Adds:** more than one batch encoding at a time; `vkQueueSubmit` off the drawing thread; no settle point while a batch records, because nothing touches a real command buffer before the batch is closed. - **Costs:** a batch reaches the GPU only after it is closed and encoded, where #17943 replays as the batch records; the submitter's waits for encodes are counted (`[encode]` line). - **Open question for the rebase:** whether #17943's chunk format can hold a whole batch until it closes. If it can, this PR reuses it and drops its own stream and thunks; if not, the note will say what is missing. #### Measured (main 7f96086b4e, an open-world, draw-heavy title, in-run A/B, 10 pairs) Presents per 10 s 105.04 -> 116.64 (+11.50 +- 0.48 against the neighbouring phases, +11.0%); frame time 95.23 -> 85.76 ms. Traces of main and of the PR from one session are linked in the description. ### Tested Windows 11 Pro 26300, Radeon RX 7900 XTX (AMD Software 26.10.1), Ryzen 7 7800X3D, Release, MinGW-w64 GCC 15.2. An open-world, draw-heavy title on main 7f96086b4e, the same save and scene in every boot, no other switches. In-run A/B on the PR build (`APS5_AB=30:APS5_ASYNC_SUBMIT+APS5_DEFERRED_ENCODE`, phases of 30 s from 190 s after the first present, 10 pairs, read with `tools/ab_split.py`): | | both unset | both set | difference | |---|---|---|---| | presents per 10 s | 105.04 | 116.64 | +11.0% (+11.50 +- 0.48 against the neighbouring phases, n 10) | | frame ms | 95.23 | 85.76 | -9.9% (-9.37 +- 0.36) | Separate boots, 313 s in game each, with `APS5_TRACE_SECONDS=300:30`: | build | switches | FPS | frame p50 / p90 / p99 ms | GPU busy ms per present | |---|---|---|---|---| | main 7f96086b4e | none | 7.60 | 136.5 / 144.7 / 156.2 | 32.7 | | this PR | both set | 8.57 | 120.0 / 125.4 / 130.1 | 32.3 | Two more boots of main without a trace gave 7.46 and 7.78 FPS over 229 s in game. No boot had a fatal error or a lost device. The measured build is 151796f744. The head differs from it in tests and in where the thunks are installed; one more boot of the head with both switches set gave 8.48 FPS over 143 s, again without a fatal error. Both traces are incomplete: the queue worker and the draw committer filled their buffers inside the 30 s window, as the digests below say. The summary lines are complete. Traces, both captured on the same machine in one session: [main 7f96086b4e](https://github.com/Nesyth/AnyPS5/releases/download/perf-traces/aps5-trace-7f96086b4e9f-87472.json.gz), [this PR](https://github.com/Nesyth/AnyPS5/releases/download/perf-traces/aps5-trace-151796f74490-98812.json.gz). Tests: on the head, after a build of every target: `agc_command_stream`, `agc_driver_recorder`, `agc_driver_recorder_deferred_encode` and `_verify`, `agc_recorder_deferred_encode`, `_one`, `_three` and `_verify`, `agc_submit_progress_deferred_encode` and `_verify`, `agc_pipeline_cache_allocation_*`, `agc_buffer_pool*`, `agc_command_batch_failure`, `agc_driver_pooled_buffer_range`, `agc_deferred_destruction` and the runtime switch tests pass (28 of 28). <details> <summary>trace_digest: main 7f96086b4e</summary> **seconds 300:30** from present 4191: 219 presents, frame p50 136.5 / p90 144.7 / p99 156.2 / max 193.5 ms, GPU busy 32.7 ms per present AMD Radeon RX 7900 XTX, AMD proprietary driver 26.10.1 (LLPC), Windows 10.0.26300, 3840x2160, commit 7f96086b4e9f, dropped: yes ```json {"commit":"7f96086b4e9f","dirty":false,"env":{"APS5_LOG_TIMESTAMPS":"1","APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"300:30"},"gpu":"AMD Radeon RX 7900 XTX","driver":"AMD proprietary driver 26.10.1 (LLPC)","os":"Windows 10.0.26300","cpu":"AMD Ryzen 7 7800X3D 8-Core Processor","cpu_threads":16,"memory_mib":31860,"title_id":"<withheld>","title":"<withheld>","content_version":"01.011.001","resolution":"3840x2160","window":{"spec":"seconds 300:30","first_present":4191,"ms":30102.174},"presents":219,"frame_ms":{"p50":136.453,"p90":144.67,"p99":156.19,"max":193.475},"gpu_busy_ms_per_present":32.723,"worker_busy_pct":{"queue worker 0x0":97.421},"top_phases_ms_per_frame":{"Driver.Packet":127.279,"Graphics.Draw":101.951,"Driver.Packet.draw":99.611,"Driver.Draw":98.448,"Graphics.Draw.draw_and_resource_release":86.987,"Driver.Draw.shader_compile_and_link":49.714,"Shader.DrawStage":36.081,"Driver.Draw.draw_enqueued":31.328},"owned_draw_counts":{},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":4.989,"events_lost":1312170,"totals_full":false},"draw committer":{"events_full_after_s":10.904,"events_lost":460652,"totals_full":false}},"trace":"aps5-trace-7f96086b4e9f-87472.json.gz"} ``` **Incomplete trace:** recorded data was lost. Slice-based timings, waits and batch inventories cover retained events only; missing slices are not idle time. Summary statistics are reported separately. - queue worker 0x0: 1312170 events lost; buffer full at 4988.6 ms - draw committer: 460652 events lost; buffer full at 10904.0 ms **Slowest frames** (largest slices inside each, inclusive) - present 4232: 193.5 ms at 5539 ms: Graphics.Draw (draw committer) 135.7, Graphics.Draw.draw_and_resource_release (draw committer) 111.8, batch (gpu) 32.4, VideoOut.Flip (presenter) 7.2 - present 4368: 163.0 ms at 24275 ms: batch (gpu) 32.6, VideoOut.Flip (presenter) 7.1, VideoOut.Flip.present (presenter) 7.0, Driver.Present (presenter) 7.0 - present 4241: 156.2 ms at 6844 ms: Graphics.Draw (draw committer) 99.9, Graphics.Draw.draw_and_resource_release (draw committer) 84.0, batch (gpu) 33.2, VideoOut.Flip (presenter) 6.4 - present 4364: 155.5 ms at 23696 ms: batch (gpu) 30.9, VideoOut.Flip (presenter) 7.9, VideoOut.Flip.present (presenter) 7.8, Driver.Present (presenter) 7.8 - present 4340: 154.4 ms at 20452 ms: batch (gpu) 32.0, VideoOut.Flip (presenter) 7.2, VideoOut.Flip.present (presenter) 7.1, Driver.Present (presenter) 7.1 **Persistent spikes** (frame time above the fastest frame that separates it from a longer frame; one entry per stall, not per frame) - present 4232: 193.5 ms at 5539 ms, persistence 70.8 ms - present 4368: 163.0 ms at 24275 ms, persistence 40.3 ms - present 4340: 154.4 ms at 20452 ms, persistence 26.6 ms - present 4289: 152.2 ms at 13350 ms, persistence 25.0 ms - present 4241: 156.2 ms at 6844 ms, persistence 23.4 ms - present 4389: 153.7 ms at 27175 ms, persistence 22.3 ms - present 4333: 147.6 ms at 19482 ms, persistence 18.0 ms - present 4364: 155.5 ms at 23696 ms, persistence 17.4 ms - present 4406: 149.0 ms at 29540 ms, persistence 17.1 ms - present 4337: 151.4 ms at 20030 ms, persistence 17.1 ms **Threads** (ms per frame) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | title | 0.0 (0 %) | 0.0 (0 %) | 137.4 | 0.0 | Shader.ResolveGraphicsStagesAbi 0.0 | | queue worker 0x0 | 17.6 (13 %) | 0.2 (0 %) | 119.7 | 29.7 | Driver.Packet 16.7, Driver.Rewind 0.7 | | draw committer | 33.1 (24 %) | 0.1 (0 %) | 104.3 | 17.6 | Graphics.Draw 31.1, Recorder.Submit 1.8 | | title | 0.0 (0 %) | 0.0 (0 %) | 137.4 | 0.0 | | | presenter | 2.4 (2 %) | 5.3 (4 %) | 129.7 | 0.1 | VideoOut.Flip 7.7, Driver.Present 0.0 | | gpu | 32.7 (24 %) | 0.0 (0 %) | 104.8 | 0.0 | batch 32.7 | **Largest slices** (ms per frame, inclusive, all threads): batch 32.7, Graphics.Draw 31.1, Graphics.Draw.draw_and_resource_release 25.2, Driver.Packet 16.7, Driver.Packet.draw 13.7, Driver.Draw 13.5, VideoOut.Flip 7.7, Driver.Present 7.6, VideoOut.Flip.present 7.5, Driver.Draw.shader_compile_and_link 4.5 **Longest waits** - Driver.Present.render_fence_wait (presenter) 8.1 ms at 28715 ms, present 4400 - Vulkan.Acquire.acquire_fence_wait (presenter) 6.8 ms at 27600 ms, present 4392 - Vulkan.Acquire.acquire_fence_wait (presenter) 6.7 ms at 20030 ms, present 4337 - Vulkan.Acquire.acquire_fence_wait (presenter) 6.6 ms at 14198 ms, present 4295 - Vulkan.Acquire.acquire_fence_wait (presenter) 6.4 ms at 13086 ms, present 4287 - Vulkan.Acquire.acquire_fence_wait (presenter) 6.2 ms at 18100 ms, present 4323 - Driver.Present.render_fence_wait (presenter) 6.2 ms at 26215 ms, present 4382 - Vulkan.Acquire.acquire_fence_wait (presenter) 6.1 ms at 27329 ms, present 4390 - Vulkan.Acquire.acquire_fence_wait (presenter) 6.0 ms at 19630 ms, present 4334 - Vulkan.Acquire.acquire_fence_wait (presenter) 4.7 ms at 26208 ms, present 4382 **Largest GPU batches** (GPU ranges inside, and the CPU slices that recorded each, inclusive) - batch 27902: 7.8 ms at 28434 ms, present 4397: GPU no ranges; recorded by no CPU slices - batch 18609: 7.3 ms at 18923 ms, present 4328: GPU no ranges; recorded by no CPU slices - batch 19154: 7.3 ms at 19481 ms, present 4332: GPU no ranges; recorded by no CPU slices - batch 15743: 7.1 ms at 16018 ms, present 4307: GPU no ranges; recorded by no CPU slices - batch 15468: 7.1 ms at 15737 ms, present 4305: GPU no ranges; recorded by no CPU slices </details> <details> <summary>trace_digest: this PR, both switches set</summary> **seconds 300:30** from present 4494: 250 presents, frame p50 120.0 / p90 125.4 / p99 130.1 / max 131.9 ms, GPU busy 32.3 ms per present AMD Radeon RX 7900 XTX, AMD proprietary driver 26.10.1 (LLPC), Windows 10.0.26300, 3840x2160, commit 151796f74490, dropped: yes ```json {"commit":"151796f74490","dirty":false,"env":{"APS5_ASYNC_SUBMIT":"1","APS5_DEFERRED_ENCODE":"1","APS5_LOG_TIMESTAMPS":"1","APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"300:30"},"gpu":"AMD Radeon RX 7900 XTX","driver":"AMD proprietary driver 26.10.1 (LLPC)","os":"Windows 10.0.26300","cpu":"AMD Ryzen 7 7800X3D 8-Core Processor","cpu_threads":16,"memory_mib":31860,"title_id":"<withheld>","title":"<withheld>","content_version":"01.011.001","resolution":"3840x2160","window":{"spec":"seconds 300:30","first_present":4494,"ms":30057.946},"presents":250,"frame_ms":{"p50":119.959,"p90":125.399,"p99":130.079,"max":131.933},"gpu_busy_ms_per_present":32.275,"worker_busy_pct":{"queue worker 0x0":97.347},"top_phases_ms_per_frame":{"Driver.Packet":111.063,"Graphics.Draw":90.681,"Driver.Packet.draw":87.602,"Driver.Draw":86.51,"Graphics.Draw.draw_and_resource_release":77.529,"Driver.Draw.shader_compile_and_link":44.971,"Shader.DrawStage":32.417,"Driver.Draw.draw_enqueued":25.854},"owned_draw_counts":{},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":4.977,"events_lost":1341765,"totals_full":false},"draw committer":{"events_full_after_s":11.236,"events_lost":445009,"totals_full":false}},"trace":"aps5-trace-151796f74490-98812.json.gz"} ``` **Incomplete trace:** recorded data was lost. Slice-based timings, waits and batch inventories cover retained events only; missing slices are not idle time. Summary statistics are reported separately. - queue worker 0x0: 1341765 events lost; buffer full at 4976.9 ms - draw committer: 445009 events lost; buffer full at 11236.3 ms **Slowest frames** (largest slices inside each, inclusive) - present 4722: 131.9 ms at 27371 ms: batch (gpu) 35.8, VideoOut.Flip (presenter) 7.9, VideoOut.Flip.present (presenter) 7.8, Driver.Present (presenter) 7.8 - present 4628: 131.3 ms at 16013 ms: batch (gpu) 36.8, VideoOut.Flip (presenter) 12.2, VideoOut.Flip.present (presenter) 12.1, Driver.Present (presenter) 12.1 - present 4630: 130.1 ms at 16266 ms: batch (gpu) 31.9, VideoOut.Flip (presenter) 8.5, VideoOut.Flip.present (presenter) 8.4, Driver.Present (presenter) 8.4 - present 4666: 129.4 ms at 20655 ms: batch (gpu) 34.0, VideoOut.Flip (presenter) 7.9, VideoOut.Flip.present (presenter) 7.8, Driver.Present (presenter) 7.8 - present 4738: 128.3 ms at 29317 ms: batch (gpu) 34.4, VideoOut.Flip (presenter) 8.2, VideoOut.Flip.present (presenter) 8.1, Driver.Present (presenter) 8.1 **Persistent spikes** (frame time above the fastest frame that separates it from a longer frame; one entry per stall, not per frame) - present 4722: 131.9 ms at 27371 ms, persistence 19.3 ms - present 4628: 131.3 ms at 16013 ms, persistence 18.4 ms - present 4569: 128.2 ms at 8946 ms, persistence 15.5 ms - present 4666: 129.4 ms at 20655 ms, persistence 13.5 ms - present 4573: 128.0 ms at 9435 ms, persistence 13.3 ms - present 4622: 128.0 ms at 15289 ms, persistence 12.6 ms - present 4617: 127.1 ms at 14683 ms, persistence 11.8 ms - present 4650: 128.1 ms at 18692 ms, persistence 11.8 ms - present 4588: 125.4 ms at 11240 ms, persistence 11.7 ms - present 4738: 128.3 ms at 29317 ms, persistence 11.6 ms **Threads** (ms per frame) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | command encoder 2 | 2.2 (2 %) | 0.0 (0 %) | 118.0 | 0.2 | Graphics.Encode 2.2 | | command encoder | 2.2 (2 %) | 0.0 (0 %) | 118.1 | 0.2 | Graphics.Encode 2.2 | | title | 0.0 (0 %) | 0.0 (0 %) | 120.2 | 0.0 | Shader.ResolveGraphicsStagesAbi 0.0 | | queue worker 0x0 | 14.8 (12 %) | 0.2 (0 %) | 105.3 | 28.5 | Driver.Packet 14.0, Driver.Rewind 0.7 | | draw committer | 28.1 (23 %) | 0.1 (0 %) | 92.1 | 18.1 | Graphics.Draw 27.9, Recorder.Reap 0.2 | | presenter | 2.7 (2 %) | 5.5 (5 %) | 112.0 | 0.1 | VideoOut.Flip 8.2, Driver.Present 0.0 | | gpu | 32.3 (27 %) | 0.0 (0 %) | 88.0 | 0.0 | batch 32.3 | **Largest slices** (ms per frame, inclusive, all threads): batch 32.3, Graphics.Draw 27.9, Graphics.Draw.draw_and_resource_release 22.1, Driver.Packet 14.0, Driver.Packet.draw 11.6, Driver.Draw 11.4, VideoOut.Flip 8.2, Driver.Present 8.1, VideoOut.Flip.present 8.0, Graphics.Encode 4.4 **Longest waits** - Vulkan.Acquire.acquire_fence_wait (presenter) 6.3 ms at 9196 ms, present 4571 - Driver.Present.render_fence_wait (presenter) 6.1 ms at 13132 ms, present 4604 - Vulkan.Acquire.acquire_fence_wait (presenter) 5.9 ms at 19566 ms, present 4657 - Vulkan.Acquire.acquire_fence_wait (presenter) 5.9 ms at 21871 ms, present 4676 - Vulkan.Acquire.acquire_fence_wait (presenter) 5.8 ms at 29070 ms, present 4736 - Driver.Present.render_fence_wait (presenter) 5.7 ms at 3318 ms, present 4522 - Driver.Present.render_fence_wait (presenter) 5.7 ms at 21394 ms, present 4672 - Vulkan.Acquire.acquire_fence_wait (presenter) 5.6 ms at 4973 ms, present 4536 - Vulkan.Acquire.acquire_fence_wait (presenter) 5.6 ms at 27979 ms, present 4727 - Vulkan.Acquire.acquire_fence_wait (presenter) 5.6 ms at 8214 ms, present 4563 **Largest GPU batches** (GPU ranges inside, and the CPU slices that recorded each, inclusive) - batch 14473: 7.3 ms at 13007 ms, present 4603: GPU no ranges; recorded by Graphics.Encode (command encoder 2) 0.0 - batch 32209: 7.3 ms at 29071 ms, present 4736: GPU no ranges; recorded by Graphics.Encode (command encoder) 0.0 - batch 516: 7.2 ms at 482 ms, present 4498: GPU no ranges; recorded by Graphics.Draw (draw committer) 0.6, Graphics.Draw.draw_and_resource_release (draw committer) 0.5, Graphics.Encode (command encoder) 0.0, Recorder.Reap (draw committer) 0.0 - batch 9819: 6.9 ms at 8818 ms, present 4567: GPU no ranges; recorded by Graphics.Draw (draw committer) 0.3, Graphics.Draw.draw_and_resource_release (draw committer) 0.3, Graphics.Encode (command encoder 2) 0.0 - batch 11278: 6.8 ms at 10169 ms, present 4578: GPU no ranges; recorded by Graphics.Draw (draw committer) 0.4, Graphics.Draw.draw_and_resource_release (draw committer) 0.3, Graphics.Encode (command encoder) 0.0 </details> ### Checklist - [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: none - [x] GPUs tested: AMD Radeon RX 7900 XTX, AMD Software 26.10.1, Windows 11 Pro 26300 - [x] AI-assisted: yes
MarcZX10 commented 2026-11-16 16:24:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-16T16:24:10Z.

Review: COMMENTED


Reviewed — comments

Changes are opt-in, but I could not verify all changed files or run the claimed checks, so a formal approval is not justified.

What I ran

Reviewed head 6cf4c1a0b5f9dd9f2eb24afc8acbbdd5131cb189 using the prepared diff and repo_read.py reader. No build or tests were run. The description reports author-run Windows tests and performance measurements; these were not independently verified.

Results

Check Result Note
Diff review passed Inspected targeted changes
Build and tests not run Author-reported results only
Full changed-file review not run Many files remain unread

Findings

Blocking

None verified.

Non-blocking

None.

Not verified

I read review/description.md, review/commits.md, review/manifest.json, and targeted ranges of review/diff.patch. I inspected selected queue submission and command stream changes. I did not read every changed file listed in the manifest; several changed files were excluded from the review folder as too large. I did not run tests, builds, or performance measurements. The performance claims and reported test results are not independently verified.

To get this to a good state

Nothing is required. The points below are optional: complete review of the unread changed files and run the checks on this head before treating the review as a full validation.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5923452658 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18173#pullrequestreview-5923452658). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-16T16:24:10Z. **Review:** COMMENTED --- # Reviewed — comments Changes are opt-in, but I could not verify all changed files or run the claimed checks, so a formal approval is not justified. ## What I ran Reviewed head `6cf4c1a0b5f9dd9f2eb24afc8acbbdd5131cb189` using the prepared diff and `repo_read.py` reader. No build or tests were run. The description reports author-run Windows tests and performance measurements; these were not independently verified. ## Results | Check | Result | Note | |---|---|---| | Diff review | passed | Inspected targeted changes | | Build and tests | not run | Author-reported results only | | Full changed-file review | not run | Many files remain unread | ## Findings ### Blocking None verified. ### Non-blocking None. ## Not verified I read `review/description.md`, `review/commits.md`, `review/manifest.json`, and targeted ranges of `review/diff.patch`. I inspected selected queue submission and command stream changes. I did not read every changed file listed in the manifest; several changed files were excluded from the review folder as too large. I did not run tests, builds, or performance measurements. The performance claims and reported test results are not independently verified. ## To get this to a good state Nothing is required. The points below are optional: complete review of the unread changed files and run the checks on this head before treating the review as a full validation.
ligmaSec commented 2026-12-03 22:33:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T22:33:25Z.

Review: COMMENTED


The trial merge onto c1601e56d5 conflicts in the recorder, device, resource, and runtime-switch files. When resolving it, preserve the command-stream ownership tests for nested pNext and supported arrays, as well as the queue-submit tests that keep submission order when encoding finishes out of order. The synchronous verify mode is useful to isolate stream capture, but it does not exercise handoff failure or batch retirement on the threaded path. Re-run both modes and capture paired scene traces before carrying forward a speed result.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6179786500 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18173#pullrequestreview-6179786500). Originally posted by [ligmaSec](https://github.com/ligmaSec) on 2026-12-03T22:33:25Z. **Review:** COMMENTED --- The trial merge onto `c1601e56d5` conflicts in the recorder, device, resource, and runtime-switch files. When resolving it, preserve the command-stream ownership tests for nested `pNext` and supported arrays, as well as the queue-submit tests that keep submission order when encoding finishes out of order. The synchronous verify mode is useful to isolate stream capture, but it does not exercise handoff failure or batch retirement on the threaded path. Re-run both modes and capture paired scene traces before carrying forward a speed result. AI-assisted: yes.
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/18173:upstream-pr/18173'
git switch 'upstream-pr/18173'

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/18173'
git switch 'upstream-pr/18173'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/18173'
git switch 'upstream-pr/18173'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/18173'
git switch 'main'
git merge --squash 'upstream-pr/18173'
git switch 'main'
git merge --ff-only 'upstream-pr/18173'
git switch 'main'
git merge 'upstream-pr/18173'
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!18173
No description provided.