perf(agc): record Vulkan draw commands on an encoder thread #17943
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/17943"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by chitters2004 on 2026-11-10T00:15:26Z.
What
Moves the Vulkan command recording of each draw off the drawing thread (the committer, with
APS5_DRAW_PIPELINE) onto one encoder thread per device. It is the first step of parallel recording: one ordered planner plus one encoder.Recorder::BeginEncodingtoEndEncoding, from pipeline begin or continue to the last draw call), the device table'svkCmd*entries do not call the driver for the open batch. They copy the call and its arrays into a 64 KiB chunk.live(),SubmitbeforevkEndCommandBuffer, a by-namevkCmdlookup, and a table call on the batch outside the window. The values are all computed on the drawing thread at the same point as before; the encoder reads no driver state.pNextchains, plus copies, updates and clears, wait for the encoder and then call directly. The Recorder's cachedvkCmd*pointers (mesh argument kernel, barriers) are the deferred entries while an encoder exists. A call from another thread into a command buffer whose window is open throws instead of racing on the chunk; other threads' lookups and calls for their own command buffers proceed as before. The GPU checkpoint markers (APS5_GPU_CHECKPOINTS), which use rawdeviceProcpointers inside the window, call the lookup hook first, so the encoder has recorded everything before them.vkCmdlookups never throw.Submit, on any thread, discards a failed batch and throws the original error, or a refusal if it was already reported, so a half-recorded buffer is never submitted and the next batch records normally. Once the pool is warm, storing and posting allocate nothing. The pool fills on first use (16 chunks of 64 KiB). A payload larger than its chunk grows that chunk once, and the chunk keeps that size when it returns to the pool. Window close, the unwind guard,discardand the destructor wait without rethrowing.Submitinside an encoding window throws.APS5_RECORD_INLINE=1keeps inline recording. A device past the four encoder slots records inline too, instead of failing to build.On the rk4 GTA V replay the drawing thread spent 3.64 us per draw on this recording (split timers, passes 2-5). Only about 28 of the 684 direct accesses per pass come within 4 us of a draw's encode; a per-site count found 90% of the waits that remain are the drain before the occlusion segment's
vkCmdBeginQuery; moving queries and copies into the stream is the follow-up.Tested
Windows 11, RTX 3080. Head
7a03091e15(branchperf/agc-record-encoder) is0453a81fd5merged withmain697b66b1e4(e21f21fcfd), thene3ca80f0f6(mesh argument ordering, drain on unwind, worker start order),ad553d367d(the unwind drain runs before the draw's owners are destroyed, foreign producers refused, checkpoint markers settle the encoder),c1feb8dc85(other threads' lookups proceed),65de8f1c01(a raw call after a lookup stays in order),dbaf2fac74(a failed replay is reported to the drawing thread)8e4b102155(debt entry for raw command pointers), themainmergeb057d4f39bwith5e406e8d4a(lookup hook in the pipeline cache allocation test),eca5eb0411(inline fallback past the encoder slots),dbd6ebb48a(the recorder suite records through the encoder),b2eca5c68e(replay failures live in the batch's recording) and7a03091e15(direct calls into a failed recording are dropped; no submit inside a window). The gate ran one21f21fcfd,e3ca80f0f6,65de8f1c01and8e4b102155, the live set one21f21fcfd, the ordering, trace and replay results on0453a81fd5; the oracle and TSan were rerun one3ca80f0f6and the oracle again on65de8f1c01and8e4b102155. A live GTA V boot of8e4b102155with the pipeline env reached the standing window with no encoder exception.Ordering oracle. New
agc_driver_command_encodercompares the recorded calls per command buffer with program order (the inline result). It covers:Its negative control: before the buffer-switch wait was added, it failed on a reordered command.
Stored raw pointers. Every
vkCmd*pointer the driver stores or looks up outside the table (24 sites) was checked for a call inside a window. The Recorder's query pointers run only right afterquiesce()orlive(); presentation, placeholder and dispatch paths use their own command buffers. The checkpoint markers were the one path inside a window (fixed above). Three are not reachable from a window today but would mix raw and deferred calls if one opened there:DepthToStoragePass::Record(DepthSurface.cpp:148),LayeredDepthStorage::Copy(DepthSurface.cpp:2271) andTexture::RefreshDepthCopy(Texture.cpp:1194).copySegmentsandfoldSamplessettle right before their raw query copies, so they stay in order even inside a window. The gap is recorded indocs/dev/debt/libSceAgcDriver.md; the end design routes every command-buffer call through one recording interface.TSan. The same test passes under ThreadSanitizer on WSL Ubuntu (gcc), with and without
APS5_HANDOFF_SPIN_US=0.Command traces. A
VK_LAYER_LUNARG_api_dumptrace of every command buffer'svkCmd*sequence (handles masked) is identical inline and pair for 6 draw tests, plain and pipelined: alpha_to_coverage, depth_bias_per_face, stencil_replay, address_passes, draw_cache_reuse and recorder (1,010 command buffers, 13,586 commands). The one difference seen, a staging copy offset in the pipelined recorder test, also appears between two inline runs (1 in 12).Vulkan validation. Head
e21f21fcfdis0453a81fd5merged withmain697b66b1e4(no conflicts);mainand the change were both built in full from those commits (ccache). The gate ran each withANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, plain and with the pipeline env, same machine and GPU:VUID-in ctest logs / replay subprocess logsmain697b66b1e4e21f21fcfde3ca80f0f665de8f1c018e4b1021557a03091e15, focusedThe
7a03091e15row is the focused set (agc_driver_command_encoder,agc_driver_encoded_mesh_arguments,agc_driver_recorder,agc_driver_recorder_record_inline, the fiveagc_pipeline_cache_allocation_*), same flags, same machine. TSan (WSL, gcc) onagc_driver_command_encoderat7a03091e15: no warnings.The change adds
agc_driver_command_encoderandagc_driver_recorder_record_inline.agc_driver_recorderbuilds its recorder with the device table, so the suite records through the encoder (336 commands) andagc_driver_recorder_record_inlineruns the same suite inline (0). It also fails a replay on another thread and checks the report, the refusal,Submiton another thread and recovery (fails ondbd6ebb48a:a replay failure recorded on another thread reached the next settle of its batch as ''), refusesSubmitinside a window (fails onb2eca5c68e:a batch was submitted inside an encoding window), and checks that a recorder past the encoder slots records and submits inline (fails on5e406e8d4a:every command encoder slot is in use). Also,e3ca80f0f6addsagc_driver_encoded_mesh_arguments(a mesh argument kernel recorded inside a window stays in order; it fails without the fix withbypassed the encoder window).agc_driver_command_encodergainedUnwindingSettlesQueuedRecording(fails without the guard:recorded 0 of 2 commands),OwnersOutliveTheUnwindDrain(fails with the guard declared before the owner:released while the encoder had recorded 0 of 2 commands),ForeignThreadCannotProduceIntoAnOpenWindow(fails without the owner check:was not refused),ForeignLookupWhileAWindowIsOpenProceeds(fails if any foreign lookup is refused:for its own command buffer was refused)RawCallAfterLookupKeepsOrder(fails without the lookup:is 'draw 3 1 0 0', inline records 'draw 1 1 0 0'),FailedReplayStaysWithItsRecording,FinishCarriesAnUnreportedFailure,DirectCallsSkipAFailedRecording(fails onb2eca5c68e:a window recorded 2 direct calls into a recording after a replay into it failed),AppendFailureKeepsTheWindow(segfaults onb2eca5c68e),PostingNeverAllocatesandReplayFailureNeedsNoAllocation(with the encoder compiled into the test on WSL, they fail ondbd6ebb48a:posting chunk 63 allocated memory, and the replay failure terminates onstd::bad_alloc; in the Windows build the encoder is in the driver DLL, which the test'soperator newdoes not replace, so there they do not check it), andDevicesPastTheSlotsRecordInline. Every other test is the same 61 on both.Live GTA V. PPSA04263, save
play1-first-autosave, 3840x2160, standing window anchored onstood_still,APS5_DRAW_PIPELINE=1 APS5_PIPELINED_DRAWS=32 APS5_PIPELINE_DISPATCH=1,APS5_TRACE_SECONDS=235:30, Ryzen 7 5800X, RTX 3080, driver 621.14, after a PC restart. A =main697b66b1e4, B =e21f21fcfd, bothdirty: false, one discarded warm-up per side, then A B B A.B minus A per pair: -8.20 and -8.58 ms mean frame (p50 -8.35 and -8.93), mean -8.39 ms, 95% CI [-10.8, -5.9] (t, 1 df, n=2 pairs). CPU bound on both sides (queue worker busy 94-95%, GPU busy about 33 ms of a 117-128 ms frame). The title submits fewer draw packets per frame with the change (
Driver.Drawper frame in the retained window: 1446 and 1488 on A, 1223 and 1211 on B), so part of the frame-time gain is less work per frame, not lower cost per draw; the fixed-workload replay below is the per-draw measure. Dispatches per frame are unchanged (69). Draws per frame also rise with frame time onmainalone, and a later pair of untimed boots gave 1515 (A) and 1437 (B), so the count tracks timing and the ambient scene. Frames dumped in the standing window of those boots match: the A-B difference (mean 3.9-4.7 per channel) is the same as between consecutive frames of one side (3.5-4.4), static geometry is identical and only animation, foliage and ambient pedestrians and traffic differ. Traces,trace_digest.pysummaries, everyaps5-summary.jsonlline,performance_compare.pyoutput for both pairs, Vulkan gate logs, logs, scripts and the standing-window frames (pr10-fidelity.tar.gz): https://github.com/chitters2004/AnyPS5/releases/tag/pr-record-encoderaps5-summary.jsonllines of the traced window, m1 (main) and c1 (change):Replay. rk4 GTA V replay A/B against the same build without the change, 5 interleaved pairs, split timers, passes 2-5 (pair 1 excluded: it overlapped another job). Drawing-thread time 44.88 -> 41.54 us/draw, paired delta 3.34 us/draw (sd 2.6; 4.21, -0.46, 4.21, 5.42). The recording parts on the drawing thread fell from 3.73 to 2.28 us/draw; the rest is the waits for the encoder inside
recordDrawCommands.pixels_identical1.0 in every run. The encoder recorded about 2.6 us per draw and was waited for 876 times per pass (11 us each).Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Summary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-19T03:13:01Z.
Review: COMMENTED
Reviewed — comments
The review covers the encoder implementation and selected integration points at head
6f18fe2e36378b43ebbe5e5db0ba292de71aec2d; the full change was not verified, so a formal decision is not justified.What I ran
Read the prepared description, commit list, manifest, diff, and selected source ranges through
repo_read.py. No build or tests were run.Results
Findings
Blocking
None identified in the inspected ranges.
Non-blocking
None.
Sources
Inspected the encoder implementation, recorder integration, and device setup at the pinned head. Author-reported validation and performance results in the description were not independently verified.
Not verified
The complete added-line sets were not read. In particular,
core/libs/prx/libSceAgcDriver/tests/Recorder.cppwas excluded from the review folder, and the full text ofExecution/src/VulkanDevice.cppwas also excluded (its listed changed ranges were read). Other changed files and uninspected diff sections were not fully reviewed. No tests, build, sanitizer run, or console behavior were independently checked.To get this to a good state
Nothing is required. Optional: complete the source review and run the relevant build and tests before making a formal decision.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T14:24:56Z.
Review: COMMENTED
Reviewed — no blocking findings
The review covered the prepared diff at head
afc4a9e6715d730a8f745c859fc9a082ae974756; no concrete blocking defect was verified in the inspected encoder and recorder paths.What I ran
No tests or builds were run. I read the prepared description, commit list, manifest, diff, and targeted source sections with the pinned reader.
Results
Findings
Blocking
None identified in the inspected portions.
Non-blocking
None.
Not verified
Execution/src/VulkanDevice.cppandtests/Recorder.cppwere excluded from the bundle and not read. The rest of the changed files were not all read in full; in particular, I did not audit the complete command wrapper coverage, full test changes, or all raw command pointer call sites. The supplied test and performance claims were not independently verified, and no tests were run.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T21:47:16Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this change; the points below are optional.
What I ran
Not run. I could not access the review folder or invoke
repo_read.pyin this environment.Results
Findings
Blocking
None verified.
Non-blocking
None verified.
Not verified
The description, commits, diff, manifest, changed files, and repository source were not read. No technical claims about the change could be checked; this is not a complete review.
To get this to a good state
Provide access to the prepared review materials and pinned reader so the change can be reviewed.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T06:03:26Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
Changes are required before merge: route the changed draw helper’s barriers through the encoder so they retain command order.
What I ran
Reviewed head
a38cd8bba167a6ca4b28b5c73e4b310c444af636. No commands or tests were run; I inspected the prepared diff and targeted head sources withrepo_read.py.Results
Findings
Blocking
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp:1735:recordDrawopens an encoding window around the draw helpers, butRecordMemoryBarrierresolvescmdPipelineBarrierthroughContext::Resolved. For example,recordDrawCommandsImplcallsRecordMemoryBarrierwhile this window is active (the changed draw entry point is atDraw.cpp:1735; the call is atDraw.cpp:2546). Because the encoder patchescontext.functionswhileDeviceDispatch::activemay be switched to the original table for inline recording, this path can call the driver directly instead of queueing the barrier. A direct barrier can therefore be recorded before earlier queued commands, violating command order. Route these window-time barriers through the interposed device-table entry (or settle before calling the resolved function), and cover the indirect draw path with an ordering test.Non-blocking
None.
Not verified
VulkanDevice.cppandtests/Recorder.cpp, which were excluded from the prepared folder as too large. Targeted relevant portions ofVulkanDevice.cppwere read throughrepo_read.py; the fulltests/Recorder.cppwas not read.To get this to a good state
Route draw-window barriers through the encoder and add an ordering regression test for the indirect draw helper. Re-run the affected recorder and command encoder tests on the updated head.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T18:37:50Z.
Review: COMMENTED
Reviewed — comments
The review is incomplete because two changed files were not read, so a formal approval or request for changes is not justified.
What I ran
Reviewed head
dee9cab808c3a78c92975c1ba8be335eb92c8a6ausing the prepared review bundle and pinned reader. No tests or builds were run.Results
Findings
Blocking
None verified in the files read.
Non-blocking
None.
Not verified
Read:
description.md,commits.md,manifest.json,diff.patch; targeted sections ofCommandEncoder.hpp,CommandEncoder.cpp,Recorder.cpp, andVulkanDevice.cpp.Not read: the remainder of the changed source files; in particular
Execution/src/VulkanDevice.cppandtests/Recorder.cppwere excluded from the prepared bundle because they were too large. Tests and builds were not run. The author-reported test and performance results were not independently verified.To get this to a good state
Nothing is required. Optional: complete review of the excluded changed files and run relevant checks before making a formal decision.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T12:27:08Z.
Review: COMMENTED
Reviewed — comments
The prepared description reports extensive validation, but I did not run checks and inspected only selected implementation paths at head
bbd5056d3d46819533e0d92f539bef00d2a8ae8d, so the review is incomplete.What I ran
No commands or tests were run. I read the prepared description, commits, manifest, and selected diff excerpts, then used
repo_read.pyto inspect selected ranges ofCommandEncoder.cppandRecorder.cpp.Results
Findings
Blocking
None verified in the inspected excerpts.
Non-blocking
None.
Not verified
The change is not fully reviewed. I did not read all changed files or all relevant hunks; in particular,
VulkanDevice.cppis excluded from the review folder as too large, and many changed-file contents and diff regions were not inspected. No build, tests, sanitizer runs, Vulkan validation, or console behavior were verified. The description's reported test, trace, and performance results were not independently checked.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-26T17:49:23Z.
Review: COMMENTED
Reviewed — comments
The review inspected the prepared diff and selected encoder and recorder code at head
79219935f7c7854eda2f7a1ad5db15580983d55e; substantial changed code remains unread, so a formal merge decision is not justified.What I ran
No build or tests were run. I inspected the prepared review artifacts and used the repository reader,
repo_read.py, to inspect selected source ranges; no diff was fetched again.Results
Negative control
Not run during this review. The description reports an ordering-oracle negative control, but I did not independently verify it.
Findings
Blocking
None verified in the code inspected.
Non-blocking
The review remains incomplete: the changed
VulkanDevice.cppandtests/Recorder.cppwere excluded from the prepared full-text set, and several included changed files and code ranges were not inspected. No code issue is asserted for those areas.Sources
Reviewed the prepared
review/description.md,review/commits.md,review/manifest.json, andreview/diff.patch, plus selected repository source ranges forCommandEncoder.cpp,Recorder.cpp,CommandEncoder.hpp,Recorder.hpp, andContext.hpp.Not verified
The full changed-file set was not reviewed. In particular,
VulkanDevice.cppandtests/Recorder.cppwere marked too large for the review folder and were not read through the reader. Other included files and uninspected ranges are also not verified. The prepared file listing did not exposefiles.json, so its additional exclusions were not confirmed.To get this to a good state
Nothing is required. Optional: complete review of the unread changed files and ranges before making a formal merge decision.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-26T17:55:47Z.
Review: COMMENTED
Actionable comments posted: 2
55d7a870-0ba0-4b89-8824-77fabe59ee08Reviewing files that changed from the base of the PR and between
9f52918eb0and79219935f7..github/workflows/sanitizers.ymlcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/CommandEncoder.hppcore/libs/prx/libSceAgcDriver/Graphics/include/Context.hppcore/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hppcore/libs/prx/libSceAgcDriver/Graphics/include/RuntimeSwitches.hppcore/libs/prx/libSceAgcDriver/Graphics/src/CommandEncoder.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Resources.cppcore/libs/prx/libSceAgcDriver/Graphics/src/RuntimeSwitches.cppcore/libs/prx/libSceAgcDriver/tests/AllocationFailure.cppcore/libs/prx/libSceAgcDriver/tests/EncoderGuards.cppcore/libs/prx/libSceAgcDriver/tests/PipelineCacheFailures.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppcore/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmakecore/libs/prx/libSceAgcDriver/tests/execution/CommandEncoder.cppcore/libs/prx/libSceAgcDriver/tests/execution/EncodedMeshArguments.cppcore/libs/prx/libSceAgcDriver/tests/test_encoder_bypass_sites.pydocs/dev/ARCHITECTURE.mddocs/dev/ENVIRONMENT.mddocs/dev/debt/libSceAgcDriver.mdIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-26T21:16:00Z.
Review: COMMENTED
Actionable comments posted: 1
2316fd48-ce77-44c8-8ecf-7d618587aa62Reviewing files that changed from the base of the PR and between
79219935f7and8b35080c45.core/libs/prx/libSceAgcDriver/Graphics/include/CommandEncoder.hppcore/libs/prx/libSceAgcDriver/Graphics/src/CommandEncoder.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppcore/libs/prx/libSceAgcDriver/tests/execution/CommandEncoder.cppcore/libs/prx/libSceAgcDriver/tests/execution/EncodedMeshArguments.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-26T21:32:42Z.
Review: COMMENTED
Reviewed — comments
This review covers selected encoder lifecycle and recorder paths at head
8b35080c45f744996e9f0cfcf2fe4aa282d3f20e; the change is substantial and several changed files and checks remain unverified, so a formal approval is not justified.What I ran
repo_read.py.Results
Findings
Blocking
None identified in the inspected paths.
Non-blocking
None.
Not verified
review/description.md,review/commits.md,review/manifest.json,review/diff.patch,core/libs/prx/libSceAgcDriver/Graphics/include/CommandEncoder.hpp,core/libs/prx/libSceAgcDriver/Graphics/src/CommandEncoder.cpp, selected ranges ofcore/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp, and selected diff hunks touchingRecorder, tests, andContext.core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppwas excluded fromfiles/because it was too large, and was not read through the repository reader. Other changed-file bodies and hunks were not fully reviewed.To get this to a good state
Nothing is required. Optional: complete review of all changed files and run the relevant build and test checks before requesting a formal decision.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-26T22:34:04Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the points below are optional.
What I ran
Reviewed head
c1e7b883b24fc45ae5aedfc4198dc20dcfcba0f7from the prepared diff and pinned repository reader. No build or tests were run in this review; the test and performance results in the PR description are author-reported.Results
Findings
Blocking
None.
Non-blocking
APS5_NO_RECORD_ENCODERis available to force inline recording, consider starting with a short probe or an inline-first policy on systems where worker replay is expensive. This is a performance suggestion, not a correctness issue. SeeCommandEncoder.hpp:74andCommandEncoder.cpp:634.VulkanDevice.cppandtests/Recorder.cpp, contain material integration and recovery changes. Their changed hunks were inspected through the reader, but their full files were not read. The encoding, dispatch, and submit call paths inspected did not reveal a verified blocker.Not verified
VulkanDevice.cppandtests/Recorder.cppwas excluded by the review bundle. The files were listed and targeted ranges were read through the pinned reader. Minified, generated, distribution, build, lockfile, and SVG exclusions were not separately inspected; see the prepared bundle’s exclusion rules.To get this to a good state
Nothing is required. Consider reducing the initial adaptive probe cost on slower systems.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-27T01:05:58Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing in the inspected code shows a concrete defect that blocks this change; the remaining uncertainty is due to two changed files excluded from the review bundle and checks not run here.
What I ran
Reviewed head
8cc3c44cc1c997b9dbab8652286370b0531dd69using the prepared diff andrepo_read.pyfor targeted source ranges. No commands or tests were run.Files read:
review/description.md,review/commits.md,review/manifest.json,review/diff.patch;core/libs/prx/libSceAgcDriver/Graphics/src/CommandEncoder.cpp,core/libs/prx/libSceAgcDriver/Graphics/include/CommandEncoder.hpp, and targeted ranges incore/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp. The diff also supplied targeted changed hunks forVulkanDevice.cpp,Resources.cpp,RuntimeSwitches.cpp, build configuration, tests, and documentation.Results
Findings
Blocking
None in the code inspected.
Non-blocking
None.
Not verified
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppandcore/libs/prx/libSceAgcDriver/tests/Recorder.cppwere excluded fromfiles/because they were too large; their changed hunks were available inreview/diff.patch, but their full head contents were not read. No build, test, sanitizer, or console behavior was independently verified. The test and benchmark implementation, all remaining full file contents, and author-reported performance and validation evidence were not independently checked.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-27T18:35:29Z.
Review: COMMENTED
Actionable comments posted: 11
53bdc682-3e16-4610-a24e-1ba63c64ecc3Reviewing files that changed from the base of the PR and between
8cc3c44cc1anda04d294acc.core/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Context.hppcore/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hppcore/libs/prx/libSceAgcDriver/Graphics/src/CommandEncoder.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Resources.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppcore/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmakecore/libs/prx/libSceAgcDriver/tests/execution/CommandEncoder.cppdocs/dev/ENVIRONMENT.mddocs/dev/debt/libSceAgcDriver.mdIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-27T19:59:37Z.
Review: DISMISSED
Reviewed — changes requested
The encoder replay can strand the worker after an exception, preventing later command buffers from being processed and making teardown wait forever.
What I ran
b633b7106a37a238392aabe90c36cc7f344eeb19from the prepared diff and reader output.Results
Findings
Blocking
core/libs/prx/libSceAgcDriver/Graphics/src/CommandEncoder.cpp:861: If executing a chunk throws, the worker stores the exception and marks the recording failed, but never advancesexecutedor notifies waiters for that chunk. A caller inawait()can therefore block indefinitely. The worker then continues withtakenadvanced whileexecutedremains behind; after it drains the posted queue, later callers waiting for posted work also cannot make progress.CommandEncoder::~CommandEncoder()callsQuiesce()before stopping and joining the worker, so teardown can hang as well. Advance completion and notify on both success and replay failure, while preserving the failed recording state.Non-blocking
None.
Not verified
core/libs/prx/libSceAgcDriver/Graphics/tests/Recorder.cppand oversizedcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppwere not read. Other changed files were not audited in full; see the prepared manifest. The PR's reported CI, sanitizer, GPU validation, and performance measurements were not independently verified.To get this to a good state
executedadvances and waiters are notified when replay fails, then run the encoder failure and recovery tests and the relevant sanitizer check.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-28T08:38:41Z.
Review: COMMENTED
Reviewed — no blocking findings
The core encoder lifecycle and recorder integration examined for head
4a817932705b2a3ad4580e06b971423d401d1fd2show no verified blocking defect; the review is incomplete because two large changed files were only selectively inspected and the test suite was not run.What I ran
CommandEncoder.hpp,CommandEncoder.cpp,Context.hpp,Recorder.hpp,Recorder.cpp,Draw.cpp, andVulkanDevice.cpp.Results
Findings
Blocking
None verified in the inspected ranges.
Non-blocking
None.
Not verified
core/libs/prx/libSceAgcDriver/tests/Recorder.cppand the complete changed context incore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppwere not read; only selected ranges were inspected.description.md,commits.md,manifest.json,diff.patch; targeted repository ranges listed above. Excluded by bundle size:VulkanDevice.cppandtests/Recorder.cpp(targeted ranges were read viarepo_read.py).To get this to a good state
Nothing is required. The author-reported checks are optional context and were not repeated on this head.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-28T16:16:09Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this change based on the inspected code; the implementation has extensive ordering, failure, and lifetime coverage, but this review did not read every changed file or run checks.
What I ran
Reviewed head
8679393389b82b6deddb18e7ca4acb06cdb084aeusing the prepared diff andrepo_read.pytargeted reads. No build or tests were run. The author reports Windows/Vulkan validation, ordering oracle, TSan, trace comparison, and live GTA V runs; those results were not independently verified here.Results
Findings
Blocking
None in the code inspected.
Non-blocking
None.
Not verified
I read the description, commits, manifest, and the full prepared diff. Targeted repository reads covered
VulkanDevice.cpplines 730–738. The diff contains substantial changes across 40+ files; I did not read every changed file’s full head text or all touched callers. In particular,VulkanDevice.cppchanges beyond the small targeted range, and many test, documentation, and implementation files, were not independently checked. No tests were run; reported test and performance results remain author-provided.To get this to a good state
Nothing is required. Optional: complete review of the unread changed files and run the relevant checks on this head before relying on the author-reported results.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-29T14:51:26Z.
Review: COMMENTED
Reviewed — comments
The inspected code contains no verified blocking defect, but this review is incomplete because two changed files were excluded and I did not run checks.
What I ran
Reviewed the prepared diff and inspected selected source ranges at head
3efc99dd0410aada556e2f0c0235c71b3ceec12f. No build or tests were run. The commands listed below are reader operations, not test commands.Read:
description.md,commits.md,manifest.json, selected ranges ofdiff.patch, and portions ofCommandEncoder.cpp,CommandEncoder.hpp,Context.hpp,Recorder.cpp,Recorder.hpp,Draw.cpp,VulkanDevice.cpp, andCMakeLists.txt.Results
Findings
Blocking
None verified in the inspected ranges.
Non-blocking
None.
Sources
No external sources used.
Not verified
The full contents of
VulkanDevice.cppandtests/Recorder.cppwere excluded from the review folder and were not read. Other changed files were not fully inspected; consequently, this review cannot establish that every changed path is sound. The PR description reports Windows/Vulkan validation, ordering-oracle, TSan, trace, and replay checks; those results were not independently verified here.To get this to a good state
Nothing is required. Optional: complete inspection of the excluded files and run the relevant checks before making a merge decision.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-01T14:18:59Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this in the code inspected; the point below is optional.
What I ran
Reviewed head
441b64117611974e47faa26ade387ffe42d1e9bd. Read the prepared description, commits, manifest, diff, andfiles.json, plus targeted source ranges throughrepo_read.py.No tests or builds were run. The review environment was read-only.
Results
Negative control
Not run in this review. The description reports author-run negative controls; I did not independently verify them.
Findings
Blocking
None in the inspected source ranges.
Non-blocking
core/libs/prx/libSceAgcDriver/Graphics/src/CommandEncoder.cpp:610resizes the chunk on the producer thread when a command payload exceeds the current chunk capacity. Such payloads can allocate during recording, despite the description's claim that storing and posting allocate nothing. Consider handling oversized payloads through a preallocated or separately managed path. Pinned sourceSources
Behavior claims above are based on targeted ranges of
CommandEncoder.cpp,CommandEncoder.hpp,Context.hpp,Recorder.hpp,Recorder.cpp,Draw.cpp, andVulkanDevice.cppat the reviewed head.Not verified
The manifest lists 31 reviewed paths. Targeted source ranges were read for 7 changed paths; the other 24 changed file texts were not read, so this is not a complete file-by-file audit.
files.jsonlists no rule-excluded files; the manifest marks the full texts ofcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppandcore/libs/prx/libSceAgcDriver/tests/Recorder.cppas not included, and targeted ranges for both were read through the pinned reader. Unread changed paths:.github/workflows/sanitizers.yml,core/libs/prx/libSceAgcDriver/CMakeLists.txt,core/libs/prx/libSceAgcDriver/Graphics/include/Draw.hpp,core/libs/prx/libSceAgcDriver/Graphics/include/RuntimeSwitches.hpp,core/libs/prx/libSceAgcDriver/Graphics/src/Resources.cpp,core/libs/prx/libSceAgcDriver/Graphics/src/RuntimeSwitches.cpp,core/libs/prx/libSceAgcDriver/tests/AllocationCounter.cpp,core/libs/prx/libSceAgcDriver/tests/AllocationCounter.hpp,core/libs/prx/libSceAgcDriver/tests/EncoderGuards.cpp,core/libs/prx/libSceAgcDriver/tests/PipelineCacheFailures.cpp,core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake,core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_sample_order_retention_tests.cmake,core/libs/prx/libSceAgcDriver/tests/execution/CommandEncoder.cpp,core/libs/prx/libSceAgcDriver/tests/execution/EncodedMeshArguments.cpp,core/libs/prx/libSceAgcDriver/tests/execution/EncoderReplayGate.hpp,core/libs/prx/libSceAgcDriver/tests/execution/PipelinedFlushReadOrder.cpp,core/libs/prx/libSceAgcDriver/tests/execution/SampleOrderRetention.cpp,core/libs/prx/libSceAgcDriver/tests/test_encoder_bypass_sites.py,docs/dev/ARCHITECTURE.md,docs/dev/ENVIRONMENT.md,docs/dev/debt/changes/test-agc-kept-vertex-window-cpu-vulkan.md,docs/dev/debt/changes/test-agc-unproven-on-cpu-vulkan.md, anddocs/dev/debt/libSceAgcDriver.md.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T22:35:53Z.
Review: COMMENTED
The trial merge onto
c1601e56d5was clean. A separate composition with exact #18029 conflicts in the encoder, draw, and fixtures. The existing note about cached rawvkCmdpointers matters here because those paths bypass the wait injected byContext::Function. Please retain the delayed encoder and failed replay cases before adding the transfer interception, and compare the threaded and inline routes under the same validation settings. Local paired execution is pending.AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-03T23:10:02Z.
Review: COMMENTED
Reviewed — no blocking findings
No blocking defect was verified in the inspected ranges; this review is incomplete because most changed files and several changed sections were not read.
What I ran
Reviewed head
0b84250ae5ab898887acd18d938c2c4b27b467f6; no base or merged preview was used. No tests, builds, or other checks were run. Author-reported test and performance results were not independently verified.Results
Negative control
Not run; no tests were run.
Findings
Blocking
None verified in the inspected ranges.
Non-blocking
None recorded.
Not verified
The prepared description, commits, manifest, and diff were read, though the diff output was truncated. Source ranges read:
CommandEncoder.cpp470–1003,CommandEncoder.hpp1–220, andRecorder.cpp1435–1495 and 5075–5150. Diff hunks inspected includedVulkanDevice.cpp,Resources.cpp,RuntimeSwitches.cpp,Draw.cpp, andtest_encoder_bypass_sites.py. The remaining changed source and test files, the rest of the changed sections, and the excludedcore/libs/prx/libSceAgcDriver/tests/execution/PixelInterlock.cppwere not reviewed. No tests, CI results, performance claims, or runtime behavior were independently confirmed.To get this to a good state
Nothing is required. Optionally, complete source review for the unread changed files and run relevant non-compiling checks before making a formal decision.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.