perf(agc): remove fixed per-draw clock reads, owner copies and allocations #16753
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/16753"
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-07T15:14:09Z.
What
Every recorded draw paid fixed costs that do not depend on what it draws: clock reads with profiling off, owner copies, and host allocations for its own bookkeeping. This change removes them from the common draw and dispatch.
Clock reads with draw profiling off.
DrawTimer,refreshResidentTarget,ShaderResources::buildPrepareandbuildComplete,Driver::dispatch,Driver::resolveGroupAheadand the CPU reads of indirect draw records each calledstd::chrono::steady_clock::now()even when the result was only used for profiling. They now read the clock only when the profile that reports them is on: the draw profile for the draw, dispatch and indirect sites, and the shader build profile (BuildProfiled()) forbuildPrepareandbuildComplete. The indirect read times are counted only then. The committer's per-commit clock reads inDrawPipeline.cppfollowAPS5_PROFILE_DRAWorAPS5_PIPELINE_STATS, the switches that print its per-commit times; they are environment switches, and the build profile does not turn them on.Owner copies during recording.
RecordedDrawholds the draw'sShaderResourcesby reference instead of copying itsshared_ptr, andshapePipelinepasses the cached pipeline on without copying it.Pipeline::AcquireFramebuffercompared each cached owner by locking itsweak_ptr; it now keeps the owner's address beside theweak_ptrand compares the address and the control block (owner_beforeboth ways), so a lookup takes no reference. An owner whose address is reused by a different object still misses.Host allocations per draw.
keepRecordedDrawno longer allocates aKeptobject per draw.Recorder::Retainadds the draw's resources, pipeline, framebuffer, index and vertex buffers and resident targets to the batch's kept list, skipping an owner the batch already holds (an open-addressing table keyed by the owner's address and control block, reset by an epoch when a batch opens).Recorder::ReserveRetentionsizes the list and table once per draw. The owners live until the batch completes, as before.InlineList<T, N>keeps up to N items in place and moves them to a vector only past N. It holds the dynamic rendering color attachments (8), the pass attachments (16), the store flags, target slices and resident targets (8), and the color export slots thatDecodeStateandDrawRejectioncompute (8).PrepareDrawBindingsallocates itsDrawBindingsonly when the draw keeps a snapshot, or when its object has re-bound a texture after a cache eviction (rebound): the object's own descriptor set then no longer matches its textures, so every later draw of it writes fresh sets. The first form of this commit missed the second case and dereferenced a nullDrawBindingson such a draw;21419394cbcreates it, and thereboundcase ofagc_driver_table_index_validationcovers it.ShaderResources::StorageImages(out)fills a thread-owned vector instead of returning a new one per draw.Driver::dispatchreserves its user data and snapshot lists, and keeps its one or two shader memory regions in a fixed array.refreshResidentTargettakes its lookup as a template parameter instead of astd::function.Keptobject (Draw.cpp,Pipeline.cpp) are removed.No behaviour changes.
Overlap, checked on 2026-11-07 against
main46552cb461withtools/pr_overlap.pyand by hand: the tool reports four open pull requests that change lines this branch changes (#7369, #9508, #16115, #16413) and 84 more that conflict withmainand share files with it (57 of the 88 have a commit since 2026-10-24; I read the hunks of 17). #14051 (labelled needs rebase) also makes the clock reads ofDrawTimerand its newplanDrawdepend on profiling, the same idea as the clock commit here, as part of a larger split ofprepareDraw; whichever lands second keeps one form of theDrawTimerlines. Nothing else implements the same thing. #16115 addspassGenerationbeside the retention members ofRecorderand changes the start ofRecorder::ensureOpen, where the retention reset is at the end; its attachment memo copies color target vectors on a miss, so the allocation census should run on top of it once both are in. #7369 and #9508 change other lines ofDrawWithRecipe,prepareDrawandrecordPreparedDraw; #13863, #13920 and the device image table stack (#7642, #10193, #13928, #13929) changekeepRecordedDraw,Recorder::ensureOpenandDriver::dispatchand will rebase ontoRecorder::Retain. Rechecked against4977f64052: the tool now confirms #7369, #10920, #16115, #16413 and #16572 (Draw.cpp, beside the attachment and pipeline-key code); none implements the same thing.Tested
Reviewed head
eb92a8c70d9. The replay, GTA and census-by-commit numbers below were measured on656c08e951. The census limits were re-derived onb7f0ab6e98f(section below). Since656c08e951, the driver code changed only bymainmerges,21419394cb(draw bindings on a re-bind) and two review commits with no runtime change:b7f0ab6e98fdrops a no-opstd::move, andeb92a8c70d9makes the draw record a non-copyableBorrowedDraw.Head
656c08e951onmain4977f64052; the merges since, up tofcee5cb0b8, bringmainin and add21419394cb(draw bindings on a re-bind) and its test.Retention test after the
mainmerge.main's #16760 creates draw-input copies withTRANSFER_SRCas well as their vertex or index usage, and the buffer pool hands a buffer back only under its exact usage.agc_driver_recorded_draw_retentionprobed the pool with plain vertex and index usage, so on Windows it reported that recorded vertices survived completion, and its checks before completion could not have found the buffer either way. The test now reads each recorded input's usage from itsvkCreateBuffer, requires it to carry the bound role, and probes with that usage before and after completion; the driver change is untouched. Fork CI on head6479bab223(run 43750013318): Linux 8 of 8; Windows 5 pass, includingagc_driver_recorded_draw_retention, and the three draw allocation tests skip as they do on Windows on the earlier head; 0VUID-lines.Review follow-up (census per-site bound, cleared target in the rebound test; test files only). Linux, GCC 13, Release, Mesa lavapipe 25.2.8, Khronos validation layer 1.4.363.1 with synchronization validation on (
VK_KHRONOS_VALIDATION_VALIDATE_SYNC=1),ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer:ctest -R '^(agc_driver_table_index_validation|agc_driver_draw_allocations|agc_driver_draw_allocations_draw_pipeline|agc_driver_draw_allocations_plan_verify)$' -Vonfcee5cb0b8and on the follow-up, same machine: 4 of 4 passed on both; the loader inserts the layer foragc_driver_table_index_validation(the census tests unsetVK_INSTANCE_LAYERSby design); noVUID-orSYNC-HAZARDline and nowas not found but was requested by env var VK_INSTANCE_LAYERSin either log. Mutants: a draw that is skipped after the re-bind passes the earlier rebound test (the target still holds the settle draws' key texel) and fails the new one; one restored per-draw allocation is above.Refreshed onto
main4977f64052. Head656c08e951;git range-diffagainst the same patches on46552cb461shows them unchanged (11 commits,=). Local RTX 3080 gate on both, same environment as below (ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation), built one after the other in one build tree, with the focused AGC set of all five pull requests of this series (237 tests on this head, 232 onmain): both 100 % passed, noVUID-line in either log or in replay subprocess logs, and neither log containswas not found but was requested by env var VK_INSTANCE_LAYERS. Fork CI on the rebased head against4977f64052: run 42374111231: Linux 40 of 43 passed, 3 skipped; Windows 38 of 44 passed, 5 skipped, andagc_driver_recorderfailed, as it does onmain. The newagc_driver_draw_allocationstests pass on Linux and skip on Windows by design: the driver allocates through its ownoperator newin a DLL the census cannot interpose. NoVUID-line on either side, conventions check passed. The measurements and full runs below were on the previous base46552cb461; the code they measured is unchanged.Vulkan validation. RTX 3080,
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,ctest --test-dir build -R 'agc|write_tracking|guest|indirect_draw|draw_finisher|depth_bias|draw_pipeline' -Von this branch's patches on46552cb461, the same patches as656c08e951(3204 tests), and onmain46552cb461(3199 tests). Every test failing in either full run was then rerun alone on both builds, one build at a time with nothing else on the GPU, usingctest -Rwith the union of the 16 names and the same environment: on both, 15 of 16 passed and onlyagc_driver_direct_write_completionfailed, which fails onmaintoo (#15547); the other failures of the full runs were timeouts and0xc0000409exits under load from concurrent gates and did not reproduce alone. Both full logs hold the same 18VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605lines and no otherVUID-; neither containswas not found but was requested by env var VK_INSTANCE_LAYERS. The change adds no validation error.Fork CI (GitHub runners, Mesa lavapipe with the Khronos validation layer, head against
main): run 42337669902 (48 tests on each OS, this branch's patches on46552cb461against46552cb461): Linux 48 of 48 passed with the validation layer; Windows 45 passed, the two allocation census tests reported themselves skipped (they need the driver'soperator new, see below), andagc_driver_recorderfailed, as it does onmainon the same runner. run 42338181178 for the retention tests: Linux 10 of 10 and Windows 11 of 11. NoVUID-line in any of them, conventions check passed.Tests.
agc_driver_draw_allocations,_draw_pipelineand_plan_verify(new, Linux; on Windows the driver allocates through its ownoperator newin a DLL the test cannot interpose, so they report themselves skipped): the test replacesoperator newand counts, per shape (recipe auto draw, indexed draw with guest indices, indexed draw with image indices, compute dispatch), what warmed draws allocate beyond a baseline, both in total and per call site on every draw. The measurement and the ceilings were redone on the current head; see Draw allocation census: measurement and limits below. Restoring one per-draw allocation inkeepRecordedDraw(amake_sharedper draw, as the removedKeptwas) fails the every-draw bound. Both tests unsetVK_INSTANCE_LAYERS, because under the validation layer the replacedoperator newalso counts the layer's own allocations. The variables that select shapes and override the ceilings are indocs/dev/ENVIRONMENT.md.agc_driver_recorded_draw_retention(new): a recorded draw's indices, vertices, pipeline, framebuffer, resources, resident targets and GPU indirect scratch stay alive until its batch completes, also after their cache entries are evicted and when a recipe hit in the next batch uses them again, and are released when the last batch that used them completes.agc_driver_vertex_target_range_copiedand_imported(extended): a recorded draw's resident target survives a cleared resource cache until completion and is released after it, and with imported vertices the GPU indirect scratch is not recycled before completion. They now run withAPS5_RELEASE_UNDER_LOCK=1, the new_release_threadvariants run them with the release thread, and all four fail on anyVUID-orInvalidCommandBufferline.agc_recorder_kept_bytes(RecorderKeptBytes.cpp, extended): 100 owners retained twice each through a growing lookup, mixed withKeep, are each held once until completion and released after it; a batch whose submit fails releases its owners, and the batch that replaces it retains a live owner again exactly once and holds it until its fence.agc_driver_host_allocator(HostAllocator.cpp, extended, Windows): anInlineListkeeps order and ownership across its inline bound, does not duplicate an owner when it spills, releases its owners when destroyed, and works with no inline slots.agc_driver_table_index_validationreboundcase (new): textures leave the cache under an object built withAPS5_DRAW_SNAPSHOT_MAX_MIB=0, so the next draw re-binds them with no snapshot kept; the target is cleared before each checked draw, so a re-bound draw that draws nothing fails.agc_driver_graphicsrunsframebufferOwnerTests: a live owner reuses its framebuffer, the same address with a different owner does not, and a replaced owner gets a distinct framebuffer. The clock and reference changes have no behaviour of their own to test; the existing draw, dispatch and indirect tests in the gate above run through every changed site with profiling off, and theAPS5_PROFILE_DRAWtests with it on.Draw allocation census: measurement and limits (sync head
b7f0ab6e98)Why it changed. The census used to count one 256-draw batch. Whether earlier draws' pool slots and draw-use records were free again depended on how far the GPU had got, so the count moved with machine load: up to 1 failure in 20 per variant on a loaded Linux machine.
How it measures now.
The census is Linux-only. On Windows the driver allocates through its own operator new in the DLL, which the census cannot interpose, so the tests skip there.
Limits. These were this PR's own constants, set against an older main and the old measurement. They are re-derived from Linux fork CI run 44098566795: three runs plain, six pipelined (draw_pipeline and plan_verify).
The margin is the same for every shape:
The byte margin absorbs a one-off pool growth; the largest seen added 316 per draw. The count limits still catch any new allocation, and the every-draw count catches a new call site.
What main added. I ran the same measurement on this branch's previous base (
03afc904a1) and on the sync:DrawTailnow holdsuserPatches, from #19267;BufferembedsContext, which grew with #20368, #19373 and #18842.The commit-cost work on the driver's per-draw allocations (the finisher queue nodes, the second
DrawWriteRanges,BeginDrawUserecords, BufferPool slots) is how these numbers come back down.Proof. 30/30 runs of all three variants passed locally under a parallel ctest -j16 load, at load average 15 on 4 cores. Fork CI on
b7f0ab6e98: run 44114467966, Linux gate green; on Windows the three census tests report themselves skipped, as described above.Host allocations per operation, from the census on the GitHub Linux runner (fork CI
censusjob, Mesa lavapipe, no validation layer). Each column is one commit with the census test applied:mainis46552cb461plus the census test, the next adds the clock and owner commits, the next the retention, inline list, draw binding and storage image commits (an earlier form of this branch, with the same driver code asb172d695d9here and the census test in its earlier form), and the last is this head with the two dispatch and color export commits. Count per draw or dispatch, requested bytes in brackets.main+ census testa997ef0a52)b172d695d9)656c08e951)agc_driver_draw_allocationsagc_driver_draw_allocationsagc_driver_draw_allocationsagc_driver_draw_allocationsagc_driver_draw_allocations_draw_pipelineagc_driver_draw_allocations_draw_pipelineagc_driver_draw_allocations_draw_pipelineagc_driver_draw_allocations_draw_pipelineThe plain recipe auto draw falls from 49.78 to 42.72 allocations per draw (-14.2 %), the pipelined one from 52.98 to 45.93, and a compute dispatch from 17.94 to 10.94. Census runs: 42338046309, 42338087047, 42335669341, 42337669902.
Clock reads removed per draw with profiling off: one in
DrawTimer, one per resident color target lookup, one in each ofbuildPrepareandbuildCompletewhen the draw builds its resources, and one or two per indirect draw whose records the CPU reads; one per dispatch and one per dispatch resolved ahead. On Windows each read is aQueryPerformanceCountercall. In a 60 s stack sample of the draw committer in the GTA V scene below onmain(3,843 samples), the clock path (ntdll.dll+0x8b29dandclock_settimein winpthreads) is 3.4 % of its self time; part of it comes from other callers. Per recorded draw, oneshared_ptrcopy and release fewer (two atomic operations), and oneweak_ptr::lockand release fewer per owner on each framebuffer cache lookup.Per-draw cost, replay. Identical frames, so the change is the only difference. A 3-frame capture of the scene below (
APS5_FRAME_CAPTURE, 9,364 draws) is replayed withagc_frame_replay --repeat 5through the real submit path, with the same pipelined-draw settings as the boots; passes 2 to 5 count. Base46552cb461and each build alternate run by run. Every pass of every run drew exactly 9,364 draws and every run matched the base pixels exactly (pixels_identical1.0). The metric is committer wall time per commit, per draw; base is about 53.2 µs per draw. The replay tool ismain'stools/FrameReplay.cppwith #12565, #12567, #12568, #11435 and #13984 merged and a local retire of resident images before each memory restore so--repeatworks; it is local and not part of this pull request (per-build summaries and binary provenance attached).656c08e95146552cb461f62ea7bd080e323b1bdcThe calibration build reads its injected 1.0 µs, so the replay resolves per-draw costs below 1 µs; base against base reads +0.10 ± 0.37. The two null controls stay within noise. The three changes add up: -1.35, -0.81 and -0.44 sum to -2.60, inside the merged build's -2.99 ± 0.44. Thread CPU columns are attached but not used: Windows thread times tick in 15.6 ms steps, too coarse for 1 µs per draw. The replay cannot show contention with the title's own threads, frame pacing, or GPU-bound time.
Frame time, stacked boots.
main46552cb461against the three changes merged on it, one warm-up boot each, then two ABBA pairs in the scene below on the current host: mean ms/frame 147.0 to 136.0 (-7.5 %) and 136.7 to 131.3 (-4.0 %); p99 168.8 to 181.9 and 192.6 to 188.7. These are not attributed to the change: the merged build drew 13 % fewer draws per present in those boots (1,497 and 1,611 against 1,783 and 1,801), and draw count varies from boot to boot with the scene, which is why the per-draw figure above comes from the replay. The older per-pull-request pairs below were taken on this branch before its rebase and on the host state before the changes listed under Host; the counts are per pull request and stay.Performance, older per-PR pairs. GTA V (PPSA04263, content 01.011.001), standing scene, 3840x2160, default in-game settings. Two interleaved pairs,
mainthen this change, twice, after one warm-up boot of each build that is not a sample. Each capture is the 30 s trace window from 235 s after launch, about 30 s after the player stands still (202 to 206 s in every capture), with pipelined draws (APS5_DRAW_PIPELINE=1,APS5_PIPELINED_DRAWS=32,APS5_PIPELINE_DISPATCH=1).mainwas7383be1a19; the change wasce6b71c04a, this branch before its rebase onto46552cb461and before two commits were added:ce6b71c04aholds the clock, owner, retention, inline list, draw binding and storage image commits, andgit range-diffshows the same patches for those. The dispatch vector and color export commits were not timed on their own; they cut allocations only (table above).7383be1a19c7ce6b71c04ac67383be1a19c7ce6b71c04ac6Change minus main, mean ms/frame: pair 1 -6.87, pair 2 -1.37, mean -4.12 (-3.0 %); p50 -5.9 and -0.8; p99 -5.6 and -24.0.
Frame time is within noise, with a small gain that two pairs cannot confirm. Both pairs are faster with the change, by 6.9 and 1.4 ms, a mean of 4.1 ms (3.0 %). Twelve
maincaptures of this scene across six blocks give a mean of 137.6 ms per frame with a standard deviation of 1.85 ms (1.35 %), so the mean of two pair deltas resolves about 2 ms; but the pair-1maincapture (141.4 ms) is the slowest of those twelve, and without it the gain is the 1.4 ms of pair 2.Why frame time barely moves: the scene is CPU-bound and the draw committer is its critical path. In a 60 s stack sample of
mainin this scene (1 ms sampling, 3,843 samples per thread, digests attached),finishDraw/commitDrawis 79.8 % of the committer's samples inclusive,Graphics::Draw76.1 %,prepareDraw53.4 %,recordPreparedDraw21.8 % andcollectWrites12.2 %; about half the sampled stacks are cut at 64 frames, so inclusive shares are lower bounds. The queue worker shows 95 % busy in every capture, but 53 % of its samples areDrawFinisher::Drainreadingsteady_clock::nowwhile it waits, so that figure overstates its load. GPU busy is 33.8 ms of a 137 ms frame. This change acts onprepareDrawandrecordPreparedDrawon the committer and on the clock path.In separate counter boots of the same scene (
APS5_PROFILE_DRAW=1, which turns off the draw finisher handoff), the driver's own[draw]phase means were 35.0 us per draw packet onmain(two boots, 3.0 % apart) and 36.8 us with the change, but those boots drew 2,827 to 2,853 draws per present onmainand 3,167 with the change, so they are no evidence either way.Summary lines (
tools/trace_digest.pyJSON summary, one per capture, in the order of the table):Traces: main, pair 1 aps5-trace-7383be1a19c7-26956.json.gz, change, pair 1 aps5-trace-ce6b71c04ac6-4748.json.gz, main, pair 2 aps5-trace-7383be1a19c7-16268.json.gz, change, pair 2 aps5-trace-ce6b71c04ac6-4316.json.gz.
tools/performance_compare.pyoutput per pair: pair 1, pair 2.tools/trace_digest.pyoutput per capture: main, pair 1, change, pair 1, main, pair 2, change, pair 2.Deviations from the Performance report form, the same in every capture (deviations.txt, environment per capture in the
*-env.txtfiles):APS5_ADDRESS_COPY_MAX_MIB=512,APS5_NO_PAD_INPUT=1,APS5_LOG_TIMESTAMPS=1andAPS5_TRACE_SUMMARY_EVERY=10.APS5_DUMP_FRAMES=80,APS5_DUMP_FRAMES_EVERY=300) let the script see the menus and check the view; the log is redirected to a file the script reads.ANYPS5_SHADER_CACHE_DIR,__GL_SHADER_DISK_CACHE_PATH).trace_dropped), so slice counts are partial; the summary totals are complete.Host: AMD Ryzen 7 5800X (16 threads), 32 GB, NVIDIA GeForce RTX 3080 (driver 621.14, Vulkan 1.4.357), Windows 10.0.26220, desktop on AC power with the High performance scheme, display 2560x1440 at 179 Hz; the title renders 3840x2160 (host-report.txt). That is the host of the older pairs and the counter boots above. Since then Resizable BAR is on (BAR1 16384 MiB, VBIOS 94.02.27.00.09), Windows is build 26320 and Defender excludes the build, tool and capture folders; the driver is still 621.14. The replay measurement and the stacked boots ran on that host.
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
Imported from boykopovar/AnyPS5. Originally posted by gabichuuuuu on 2026-11-07T20:46:13Z.
Review: COMMENTED
Windows check of head
656c08e951on the NVIDIA laptop GPU (driver 610) and the Intel iGPU in the same machine, the two cells the description doesn't have. Merged ontomain6b733c4ef2(clean), withmainfrom the same build directory as the control. Windows 11 x64, WinLibs GCC 15.2.0 r7, Release,ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 ctest -R '^agc_driver_(recorded_draw_retention|draw_allocations|vertex_target_range|host_allocator)', 3 runs per GPU.main(3 tests)recorded_draw_retention,host_allocator,vertex_target_range_copied,vertex_target_range_imported, and the new_copied_release_threadand_imported_release_thread.agc_driver_draw_allocationsandagc_driver_draw_allocations_draw_pipelineskip on Windows by design (draw allocations: skipped, the driver allocates through its own operator new in a DLL that this census cannot interpose), so this run says nothing about the allocation counts, which are the core of the perf claim. Only the Linux runs cover that.VK_LAYER_KHRONOS_validation.AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-17T15:12:18Z.
Review: COMMENTED
Reviewed the full diff — no blocking findings
Nothing blocks this; the points below are optional.
What I ran
81b14d6d07b21fdc7b4abf9d6218e29e0d7a8d31. Base:main. No merged preview.repo_read.py):Results
diff.patchreadFindings
Blocking
None.
Non-blocking
core/libs/prx/libSceAgcDriver/tests/DrawPipelineProfile.cpp:107: the message says "a timed commit did not read the clock exactly twice", but the check compares against 4. Either the message or the number is wrong. A failure would print a misleading reason.core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp:4963:RecordedDraw record{resources, std::move(pipeline), std::move(framebuffer)};nothing is moved. The members are nowconst&, so thestd::movecalls only suggest a move that does not happen. Dropping them would match what the code does.core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_host_allocator_tests.cmake:12:agc_driver_draw_allocationsis a draw test, registered in the host allocator's cmake file. Moving it next to the other draw test registrations would make it easier to find.Not verified
VUID-scans, the allocation census figures, and the frame-time and replay numbers are the author's. I did not reproduce them.656c08e951and fork CI on6479bab223. The pinned head here is81b14d6d07. By the description's own wording, those results do not cover this head.Graphics/src/ShaderResources.cpp,Graphics/src/Texture.cpp,tests/Graphics.cppandtests/Recorder.cpp. Only their diff hunks were read. The rest of each file was not read.profileatExecution/src/Driver/Draw/Draw.cpp:567(CountEmptyIndirectDrawgated on it) was not confirmed. Compilation would settle it.81b14d6d07was not inspected.tests/execution/DrawAllocations.cppandTableIndexValidation.cppwere read in the diff only. Their behaviour against the lavapipe and Windows environments was not checked.To get this to a good state
Nothing is required. Optional: the three non-blocking points above. Rerun the test set on the current head and cite that head in the description.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-17T18:46:02Z.
Review: COMMENTED
Reviewed the diff — no blocking findings
Nothing blocks this; the points below are optional.
What I ran
b7f0ab6e98f5(PR #16753, basemain). Repository files were read only throughrepo_read.py.description.md,commits.md,manifest.json,diff.patch(all 1,894 lines), and the house-rule sections "Readable reviews", "Standard PR response format" and "Accuracy and evidence".Results
APS5_PROFILE_DRAWphase()returns early withoutBuildProfiled()Findings
Blocking
None.
Non-blocking
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_pipeline_profile_tests.cmake:10: the newagc_driver_pipeline_untimedsets onlyAPS5_PIPELINED_DRAWS=8.timedincore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawPipeline.cpp:478readsAPS5_PROFILE_DRAWandAPS5_PIPELINE_STATSonce per process, so the test fails with "the committer read the clock" when either is exported in the runner or a developer's shell. Clear both in the test, as the other cases do withENVIRONMENT_MODIFICATION ... =unset:.core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp:2650:RecordedDrawnow holds references to the caller'sresources,pipelineandframebuffer, where it used to own copies. Both construction sites (recordPreparedDraw,DrawWithRecipe) keep those locals alive throughrecordDraw, so nothing is wrong today. ARecordedDrawcopied or kept past its caller would dangle, and nothing in the type says so.core/libs/prx/libSceAgcDriver/tests/RecorderKeptBytes.cpp:360:FailedSubmissionnow splitsKeep(kept, Budget)intoRetain(kept)andKeepBytes(kept.get(), Budget). The byte-budgetedKeepoverload is no longer exercised on a failed batch;RetentionAfterFailedSubmissionis the only failed-batch case for retained owners.Not verified
diff.patchand the reader ranges above, not whole files. The four files too large for the folder (ShaderResources.cpp,Texture.cpp,tests/Graphics.cpp,tests/Recorder.cpp) were read only as hunks.files.json: not read, so itsreviewedlist was not checked against this review.Recorder::Retain(core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp:218): the dedupe readsopen->kept[index]from a stored index. The check compares the owner it finds, so a stale index causes a repeat retain rather than a miss. I did not confirm that nothing shrinksopen->keptwhile a batch is open, which would make that read out of range.recordDraw(core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp, new lines around 2903–2906):passImagesnow comes from thread-owned storage. I did not confirm thatrecordDrawcannot re-enter on the same thread while the span is in use.agc_driver_host_allocatortests and the census tests that skip on Windows.656c08e951(same patches as on46552cb461), not on headb7f0ab6e98f5. The census limits were re-derived onb7f0ab6e98f5, and only run 44114467966 covers that head.To get this to a good state
Nothing is required. The non-blocking points above are optional.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-17T19:28:02Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this; the points below are optional.
What I ran
Head
eb92a8c70d9444798109552922d4c49f65ecceda, basemain. No merged-preview check. No build and no test run: this was a read-only review through the reader and the review folder.Results
diff.patchFindings
Blocking
None.
Non-blocking
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawPipeline.cpp:478— the committer's clock gate reads only two environment variables (APS5_PROFILE_DRAW,APS5_PIPELINE_STATS). The description says the reads are skipped unless profiling is on, "APS5_PROFILE_DRAWor the build profile". I found no build-profile switch in this gate. If one exists, a build-profile run getsspent == 0atDrawPipeline.cpp:508, andcommitNsthen reads zero for the per-commit figure. Either add the same switch or narrow the description.Not verified
agc_add_draw_pipeline_testthat creates the_draw_pipelineand_plan_verifyvariants, and theENVIRONMENT_MODIFICATIONedits were not checked against CMake.656c08e951andb7f0ab6e98, not the reviewed headeb92a8c70d.BorrowedDrawinDrawWithRecipeandrecordPreparedDrawnow holds references to the caller'sresources,pipelineandframebufferinstead of moving them. I did not read the code afterrecordDrawinDrawWithRecipeto confirm that nothing depends on those locals being empty afterwards.recordDrawgivesPassAccessa span intoShaderRecompiler::ThreadOwnedstorage forpassImages.PassAccessis a struct of spans (PassHazards.hpp:19-27). I did not readLeaveRenderPassOpento confirm it does not keep those spans afterrecordDrawreturns.ShaderResources.cpp,Texture.cpp,tests/Graphics.cppandtests/Recorder.cppare too large for the review folder. For these, I read only the changed hunks indiff.patchplus the reader snippets above. The rest of those files was not read.InlineListandHostAllocatorchanges was not checked.Recorder::openis assigned only inensureOpen(Recorder.cpp:2244), so the retention epoch is at least 1 before any slot is read.Sources
github.com/boykopovar/AnyPS5@eb92a8c70d/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawPipeline.cpp (L478-L508)To get this to a good state
Nothing is required.
Optional:
timedinDrawPipeline.cppon the same switch as the draw profile, or say in the description that the committer statistics are environment-only.On a new head I would re-check the
DrawPipeline.cppgate and theBorrowedDrawlifetimes first.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-19T18:07:09Z.
Review: COMMENTED
Reviewed — no blocking findings
The reviewed changes at
a8494f2612f643a031c9838550b7f4876417be0bshow no verified blocking defect in the inspected code; review coverage is incomplete, so approval is not justified.What I ran
No commands were run; repository source was inspected through
repo_read.pyat the pinned head. I readdescription.md,commits.md,manifest.json, and the first 900 lines ofdiff.patch. The preparedfiles.jsonwas not available through the reader interface.Results
Findings
Blocking
None verified in the inspected code.
Non-blocking
No findings from the inspected code.
Not verified
I did not read the complete diff, all changed source files, or all tests. In particular, full contents of
ShaderResources.cpp,Texture.cpp,Graphics.cpp, andRecorder.cppwere not reviewed. I also did not verify test results reported in the PR description or run checks locally. The manifest shows 27 changed files; only selected sections of the diff and source were inspected, so behavior outside those sections is not verified.To get this to a good state
Nothing is required. The optional next step is to complete review of the remaining changed files and diff sections before making a formal approval decision.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-19T18:18:35Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the available source and test evidence supports merging, though some changed files were not fully inspected.
What I ran
Reviewed head
ba3289b7dccfdf1e14f427d4cd257933b8e404dcusing the prepared bundle and pinned reader. No tests or build commands were run.Results
Findings
Blocking
None identified in the code inspected.
Non-blocking
None.
Not verified
The review bundle listed 27 changed repository files. I read
DrawPipeline.hpp,Driver.hpp,Dispatch.cpp,DispatchAhead.cpp,Draw.cpp,DrawPipeline.cpp,ShaderRegistry.cpp,InlineList.hpp,Pipeline.hpp,Recorder.hpp,ShaderResources.hpp,Graphics/src/Draw.cpp,Graphics/src/Pipeline.cpp,Graphics/src/Recorder.cpp, targeted changed ranges ofGraphics/src/ShaderResources.cppandGraphics/src/Texture.cpp,DrawPipelineProfile.cpp, targeted changed ranges oftests/Graphics.cppandtests/Recorder.cpp,HostAllocator.cpp,RecorderKeptBytes.cpp,agc_driver_draw_allocations_tests.cmake,agc_driver_graphics_tests.cmake,agc_driver_host_allocator_tests.cmake,agc_driver_pipeline_profile_tests.cmake,agc_driver_recorder_tests.cmake,tests/execution/DrawAllocations.cpp,tests/execution/TableIndexValidation.cpp, anddocs/dev/ENVIRONMENT.md.Graphics/src/ShaderResources.cppandGraphics/src/Texture.cppwere read only around changed hunks;tests/Graphics.cppandtests/Recorder.cppwere checked only for their changed hunks via the diff and not read in full. No other changed files were excluded by the bundle. Behavior outside the inspected ranges, compilation, and test results at this exact head were not independently verified. The description reports successful focused tests and CI, but those are author-reported results.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T03:09:32Z.
Review: COMMENTED
Reviewed — comments
Nothing blocks this review, but the measurement and source review are incomplete, so a formal approval is not justified.
What I ran
Reviewed head
f0af97547b8b17791aae289513c1a880bc98298c. I read the prepared description, commit list, diff, manifest, and all added lines in 24 of the 29 changed files marked included. I also read targeted source ranges in the two excluded implementation files,ShaderResources.cppandTexture.cpp, and several changed implementation files through the pinned reader. No tests or builds were run; CI and measurements in the description are author-reported.Results
Findings
Blocking
None identified in the code inspected.
Non-blocking
Graphics.cpp,Recorder.cpp(tests),DrawAllocations.cpp,TableIndexValidation.cpp, anddocs/dev/ENVIRONMENT.md. Completing those reads would make the review evidence stronger.Not verified
To get this to a good state
Nothing is required. Optional: complete the five remaining changed-file reads and run the focused tests on this head before seeking formal approval.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T13:00:08Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this; the points below are optional.
What I ran
Reviewed head
4e46571a866081eff3ddd7b93677c7144a783421from the prepared diff and pinned repository reader. I did not run commands or tests; the test runs described in the PR are author-reported.Results
Negative control
Not run by me. The PR reports allocation mutants and rebinding checks; those reports were not independently verified here.
Findings
Blocking
None.
Non-blocking
None.
Sources
Behavior claims were checked against the prepared diff and source files at the pinned head; no permalink was generated by the available reader.
Not verified
Full text and hunks for
Graphics/src/ShaderResources.cpp,Graphics/src/Texture.cpp,tests/Graphics.cpp, andtests/Recorder.cppwere inspected only at relevant changed ranges through the reader; other portions were not read. The prepared folder marked those four changed files as excluded from its full-text files. No build, test command, or physical-console behavior was verified.To get this to a good state
Nothing is required.