perf(agc): resident device buffers for hot staged ranges, copy-ins skipped while guest memory is unchanged (PPSA26344, APS5_NO_RESIDENT_RANGES=1 off) #16831
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/16831"
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 Dextroid17 on 2026-11-07T17:31:31Z.
pr16831-traces.zip
What
An exact staged range of at least 64 KiB that
recordGpuCopiescopies in 8 times (the count resets every 10 s once a resident range is in use) gets one persistent device-local buffer (up to 32 ranges, at most 256 MiB in total,ResidentBudgetBytes), which fresh builds bind atUploadPrepareinstead of a per-build staging buffer. The copy-in is skipped while no stamp touched the range since the buffer last matched guest memory: its own copy-in, or a build's copy-back (MarkDirectWritesmoves the sync generation to its own marks only when nothing else stamped the range in between).APS5_NO_RESIDENT_RANGES=1turns it off (themaincompare could never prove a range unchanged on Linux,GuestMemory::Rewatchis Windows-only, so a byte shadow of the copied-in bytes,ResidentShadowMaxBytes16 MiB per range, backs the compare there; ranges unbound for a 10 s window are evicted;ForgetPagesover a range drops it);APS5_PROFILE_DRAWprints a[resident-ranges]line every 10 s (resident, promoted, bound, skipped/made copy-ins, invalidated).Ported to
mainfrom Celegans12/AnyPS522afed1261(hritikutekar, author kept), with Celegans12'sefd24a7976folded in: the holder is allocated once and never destroyed, because a static destructor released the resident buffers into the buffer pool after the device was torn down andagc_frame_replayexited 139 after every replay. Dropped from the fork version: the async-lane checks (mainrecords on one lane) and thestagingDiffEnabledtoggle (fork-only). Added over the fork version: the holder recordscontext.deviceand clears its ranges when the device changes, the same shape asChunks()and the BDA caches in this module, so a test executable that builds several devices never binds a dead device's buffer. The switch is read through theRuntimeSwitchesenvironment table and documented indocs/dev/ENVIRONMENT.md; theAPS5_ABrow indocs/dev/TRACING.mdnow lists both runtime switches. A resident range is always GPU-written (stagingWantedreturns false without a writing descriptor), and since2e5d6e8f11its own copy-backs do not force a re-copy:MarkDirectWritesrecords the build's copy-back marks and moves the range's sync generation up to them when nothing else stamped the range, so the next build's copy-in is skipped;agc_carried_shadowrequires at least 3 skips on a read-and-written element. In the fork version a GPU-written resident range was re-copied every build. Resident promotion is also capped per range atResidentShadowMaxBytes16 MiB.How this composes with #16648. #16648 is merged (
90d499f041), and this branch is now rebased ontomainf4c9a67f58, so the diff is this PR's eight commits only (the first five, plus the three fixes for oneandonlydean's points). For a staged region, the copy-in ofrecordGpuCopiestries three things in order: a resident range whose guest memory is unchanged skips the copy; otherwise #16648's carried device shadow is copied device-to-device when nothing wrote the range since its last use; otherwise the region is copied in from guest memory. A resident range over unchanged memory skips the copy before the shadow is tried, and after a CPU store into a resident range the next copy-in reads guest memory. Ranges that never become resident (under 64 KiB, or staged fewer than 8 times) keep #16648's shadow; a resident range needs no copy-in at all while unchanged, so making it the shadow's source would add a copy where this PR skips one. The resident snapshot-branch stamp is gone: a range becomes resident only throughstagingWanted, which returns false without a descriptor that writes the range (GuestBufferMemory.cpp:6844), andwritesis only appended to (:6028), so the copy-in of a resident range always reads live memory; aRequireat:7638pins that.Context: hritikutekar asked on #675 for this to be carried as a PR with the A/B below as evidence (https://github.com/boykopovar/AnyPS5/discussions/675).
Tested
Linux (CachyOS, kernel 7.3.1), NVIDIA RTX 3080 Ti, driver 615.78.08, Ghost of Yōtei PPSA26344 v01.008.000, 1080p relink, 1200 s runs,
APS5_TRACE_SUMMARY_EVERY=10.Where the benefit was measured (fork
yotei/best66b1722d5b, which reaches the title menu; same binary, switch on vs off):With the switch off, the 120-600 s band drops from 466 presents to 90 and its 600 s screenshot is black. hritikutekar's commit message for
22afed1261measured the mechanism at the title menu: two 1 MiB ranges copied in ~32 times a frame each, about half of ~17 GB of copy-ins per 10 s, and ~11 GB per 10 s skipped with the change (in-run A/B +4.0 %, SE 0.29, 0 faults). The 600-1200 s band is the cutscene stall that both legs hit and that this change does not address.This port on
main6c1efc7c59(same machine, cold shader cache, switch on; run binary319d8328d1= this PR as of that run, before the device check and the rebase ontoc38d0772c0, plus a local one-line change that also prints the report line underAPS5_TRACE_RESIDENT=1, not pushed): builds, 0 faults, 0 Xid, 1200 s to timeout, 9[resident-ranges]lines, up to 15 ranges resident and 460 binds by builds, 0 copy-ins skipped: every bound range was invalidated by another stamp before its next build.mainwith or without this change stays on the black pre-menu screen at every 60 s screenshot to 1140 s, at ~3-4 s/frame of memory_wait in the first 600 s (same bands and weighting as the table:maind5cc35c048alone 2986 / 3572 / 3670 / 8316 ms, 177 presents in 1200 s;main6c1efc7c59with this PR 3243 / 3951 / 3377 / 2952 ms, 88 presents, cold shader cache; the summary stops emitting windows while no frame presents, so the last window ends at 1114 s and 695 s), so onmainthe title never reaches the scene where the hot ranges are re-copied unchanged. The port is therefore proven safe onmainand proven useful on the fork; amainnumber for the gain needs the separate pre-menu stall fixed first, or an AMD/Linux datapoint on hritikutekar'syotei/linux-best-u2with this patch applied.Head
288d5d2aa4onmainf4c9a67f58(this push: rebase only,mainchangedRuntimeSwitchesagain with the wide-table copy HLE switch):Graphics/include/RuntimeSwitches.hppandGraphics/src/RuntimeSwitches.cpp;main'sNoWideTableCopyHle/APS5_NO_WIDE_TABLE_COPY_HLEcomes first, thenNoResidentRanges/APS5_NO_RESIDENT_RANGES, at the same index in the enum, the name table and thegetenvlist.git range-diffagainst925804432bshows the eight commits' own lines unchanged except that the first commit no longer adds#include ".../RuntimeSwitches.hpp"toGuestBufferMemory.cpp, whichmainnow includes itself (line 15).agc_driver_resident_ranges3 of 3; the 17 resident, carried-shadow and recorder tests 17 of 17 (mainaddedagc_driver_texture_min_lod_residentto the name match since the last run).GALLIUM_OVERRIDE_CPU_CAPS=avx):agc_driver_resident_ranges3 of 3; the same sweep 15 passed, 2 skipped (agc_carried_shadow,agc_driver_recorded_draw_staging, which skip because lavapipe does not keep host imports write-watched), 0 failed.tools/check_conventions.py --base upstream/mainpasses.tools/env_reference.py --checkreports 730 names, all documented.925804432b), no AMD or Intel GPU, the full-set validation-layer gate not rerun since94ff67d9b1, no title run.Head
925804432bonmain68831acc9d(this push: rebase only,mainchangedRuntimeSwitchesagain with #23229):Graphics/include/RuntimeSwitches.hppandGraphics/src/RuntimeSwitches.cpp;main'sWideLibraryKeys/APS5_WIDE_LIBRARY_KEYScomes first, thenNoResidentRanges/APS5_NO_RESIDENT_RANGES, at the same index in the enum, the name table and thegetenvlist.git range-diffagainstc9a9de3f5eshows only that context change; the eight commits' own lines are unchanged. The line numbers in the paragraph above are re-read at this head.agc_driver_resident_ranges3 of 3; the 16 resident, carried-shadow and recorder tests 16 of 16; the twoagc_runtime_switchestests (host-only, no device) 2 of 2.agc_driver_resident_ranges3 of 3; the same sweep 14 passed, 2 skipped (agc_carried_shadow,agc_driver_recorded_draw_staging, which skip because lavapipe does not keep host imports write-watched), 0 failed. Same skips as onc9a9de3f5e.tools/check_conventions.py --base upstream/mainpasses.tools/env_reference.py --checkreports 708 names, all documented.c9a9de3f5e(https://github.com/boykopovar/AnyPS5/pull/16831#issuecomment-7039131433): Cyberpunk 2077 PPSA03974 intro movie, RTX 4080, three alternating boots per arm,main/ this PR / this PR withAPS5_NO_RESIDENT_RANGES=1present at the same rate (47-58 per 10 s in every arm, run-to-run spread larger than any difference between arms), no driver failure, novkAllocateMemoryfailure, every boot exits cleanly. The scene has no hot staged range to promote, so no gain is expected there; it shows the change is neutral where it does not apply.925804432bmerged ontomaine4ff0d770d, Windows 11, RTX 5060 Ti 16 GB (NVIDIA 621.24), GCC 15.2.0. Validation layer on the 11 focused tests 11 of 11 on this head, 9 of 9 onmain, 0VUID-lines;agc_driver_resident_rangesskips the store-racing block on that device. Title runs: GTA V skips 1434-1551 copy-ins per 10 s against 377-415 made, Astro Bot 15-56 against 58-124, Stray gameplay and Outer Wilds 0 ranges resident; FPS change on both paired scenes inside themain-to-mainspread (2 runs per side).94ff67d9b1, no Ghost of Yōtei run on this head, and the store-racing block run only on the RTX 3080 Ti on Linux.Head
c9a9de3f5eonmain0afe9ef689(test-only: the point 1 test allocated its block withmmap, which broke the Windows build; nowVirtualAlloc/aligned_allocas inRecorder.cpp): point 1 test 3 of 3 on lavapipe and the 3080 Ti, 3 of 3 failures with the check removed, 16-test sweep unchanged. The three fix commits for oneandonlydean's points (first pushed as94ff67d9b1), with their tests and without-fix runs, are in https://github.com/boykopovar/AnyPS5/pull/16831#issuecomment-7026883997.Head
5f43ae141eonmainc27193c672(this push: rebase only,mainchangedRuntimeSwitchesagain):git range-diffagainst22c7dbf9b7changes only context lines frommain(its newAPS5_DRAW_TABLE_SNAPSHOTswitch now sits next to ours), none of this PR's own lines. The only conflict was againRuntimeSwitches.hpp/.cpp; both sides are kept,main's switch first. The head also merges cleanly ontomain068944c87d.tools/check_conventions.py --base upstream/mainpasses;tools/env_reference.py --checkreports 672 names, all documented.GALLIUM_OVERRIDE_CPU_CAPS=avx), Linux: 18 of 20 pass; the same two skip themselves (agc_driver_recorded_draw_staging,agc_carried_shadow).22c7dbf9b7, results below), no Windows run, no title run.Head
22c7dbf9b7onmainff36fea157(rebase only, after #16648 merged):git range-diffagainst52f9b7f390changes only context lines frommain, none of this PR's own lines. The only conflict wasRuntimeSwitches.hpp/.cpp, wheremainadded switches at the spot this PR addsAPS5_NO_RESIDENT_RANGES; both are kept.tools/check_conventions.py --base upstream/mainpasses;tools/env_reference.py --checkreports 663 names, all documented.GALLIUM_OVERRIDE_CPU_CAPS=avx), Linux: 18 of 20 pass; the same two skip themselves as on52f9b7f390(agc_driver_recorded_draw_staging,agc_carried_shadow).mainff36fea157: no new validation messages on the 11 focused tests that load it;agc_carried_shadowandagc_driver_resident_rangesreport 0VUIDmessages in 3 of 3 runs.agc_driver_guest_memory_lifetime_convertedagain runs without the layer loaded on both builds.Head
52f9b7f390onmain752c0f776b:agc_carried_shadow(#16648's test): a carried-shadow element is used until it becomes resident (8 stagings), used 3 more times over unchanged memory, then the CPU stores into it and it is used once more. It requires the 3 copy-ins to be skipped with no carried shadow taken, and the copy-in after the store to read guest memory, with no shadow taken and the new bytes in the copy-back. Negative control on this head, with the carried shadow tried before the resident check (diff in the comment below, not pushed): the case failed 3 of 3 runs witha resident range over unchanged memory was copied in again; unchanged, it passes.agc_carried_shadowpassed 10 of 10 runs; onectestrun of the 20 focused tests below passed 20 of 20.GALLIUM_OVERRIDE_CPU_CAPS=avx), Linux: 18 of the 20 pass;agc_driver_recorded_draw_stagingandagc_carried_shadowskip themselves on this device (host imports are compared, not watched), so this device, and CI, which runs lavapipe, do not run the new case; only the NVIDIA runs above cover it.main752c0f776b; the two new-only tests,agc_carried_shadowandagc_driver_resident_ranges, report 0VUIDmessages in 3 of 3 runs.agc_driver_guest_memory_lifetime_convertedpasses on both builds but runs without the layer loaded, so it is not validated; the other 6 focused tests are CPU-only.Previous heads:
tools/check_conventions.py --base upstream/mainpasses;tools/env_reference.py --checkreports 632 names, all documented. Tests (ctest names at this base,ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1):GALLIUM_OVERRIDE_CPU_CAPS=avx), Linux, rebased head266cbd9696onmainf0d842158c: 18 of the 19 pass;agc_driver_recorded_draw_stagingskips itself on this device ("the device does not keep host imports write-watched").3c1e4d0885on its basec38d0772c0, three runs each onmainand the PR, 16/16 passed every run (the set was 16 names at that base, this body earlier said 17), 0VUID-orSYNC-HAZARDlines;agc_driver_recorded_draw_stagingruns and passes there.ctest -R '^(agc|shader|recompiler|video_out)'with the validation layer, head3c1e4d0885merged ontomain52dfa45eccagainst thatmainalone: 1525/1525 and 1526/1526 passed, the same 12 device-dependent skips on both, 0VUID-errors,agc_driver_resident_rangespassing. Correctness and validation only, no perf.Perf on
main(RTX 3080 Ti, Linux, PPSA26344 1.008, 1080p relink, warm shader-cache snapshot restored before each launch, 600 s,APS5_TRACE_SUMMARY_EVERY=10): neutral at the intro, within noise. Base =c38d0772c0; PR arm = the3c1e4d0885tree before it was committed (the summary line reports194eab367730dirty for that reason). ms per present weighted by presents:Neither arm reaches the title menu inside 600 s here and the intro rewrites nearly every resident range between builds, so there is little to skip; a 900 s counters-only PR run (
APS5_PROFILE_DRAW=1, 29 windows) shows the Linux path live: 45 promoted, 15-17 resident, 2441 bound by builds, copy-ins 24 skipped (48.0 MiB) / 2417 made, 2372 invalidated by other stamps. Onmainthis title logged 0 skipped for the whole run (the resident compare was dead on Linux, see the commit).aps5-summary.jsonlline of the window that starts at present 121 in each arm: the only window after the first (present 0) that both runs cut at the same present, sotools/pr_labels.pycan compare the pair (the last lines, quoted here before, start at presents 136 and 127). The windows cover different times (182-394 s onmainwith 1 present, 395-466 s with the PR with 3), so read them as the capture record, not as the gain; the weighted numbers above are the result.tools/trace_digest.pyoutput is in the perf comment; the runs recorded summaries only, no trace file:Traces:
aps5-summary.jsonlof the three fork legs and of themainrun attached.Checklist
main; no other open PR implements the same functions (#16648 copies an unchanged re-staged range device-to-device from the previous use's shadow; this PR is built on it and skips the copy for a resident range before that shadow is tried, see "How this composes with #16648")NotImplemented_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)mainis neutral, see below)GALLIUM_OVERRIDE_CPU_CAPS=avx), Linux, for the 20 tests listed above; NVIDIA GeForce RTX 4080 SUPER, driver 621.14, Windows 11, for the fullagc|shader|recompiler|video_outset with the validation layer (slopezjur).Summary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by gabichuuuuu on 2026-11-07T21:59:04Z.
Review: COMMENTED
Read
194eab3677againstmain.Resident buffers outlive their device.
Residents()(GuestBufferMemory.cpp:5869) holdsstd::shared_ptr<Buffer>s and is only cleared by theresidents.device != context.devicecheck inresidentBuffer(:5894).VulkanDeviceteardown clears this module's other device-keyed caches (ClearSnapshotCopies,ClearImageMirrors,ClearHostImports,VulkanDevice.cpp:1183-1185) but nothing clears this one. So once a range has been promoted, the device is destroyed with thoseVkBuffer/VkDeviceMemorystill alive. In a process that opens a second device, the nextresidentBuffercall drops them into the old device'sBufferPool(kept alive by each buffer'scache), whose eviction and destructor then callvkDestroyBuffer/vkFreeMemoryon the destroyed device.Chunks()isn't the same shape: it holdsweak_ptrs. AClearResidentRanges(VkDevice)called next toClearSnapshotCopiesin the teardown would fix it.Promotion window.
heatis cleared only inreportResidents(:5885), which onlyresidentCurrentcalls, and that is reached only for a region that is already resident. Before the first promotion, and whenever none is resident, the count never resets, so a range is promoted after 8 stagings in total, not 8 in 10 s asENVIRONMENT.mdsays.heatalso keeps an entry for every distinct staged range of 64 KiB or more.No eviction. A range leaves only when
ForgetSerialmoves or the device changes. 32 ranges promoted in one phase (a loading screen, say) stay pinned in device-local memory and block later hot ranges viaResidentLimit; staged regions go up to 8 MiB written / 256 MiB swept on discrete GPUs. Dropping ranges not bound during a report window would cover it.Perf evidence. CONTRIBUTING asks a
perfPR fortools/trace_digest.pysummaries ofmainand the change from the same machine and scene. Themainrun in the description skips 0 copy-ins, so onmainthe change has no measured effect yet.Test. Given the
heatbehaviour, a fixture only needs to stage one range 8 times; no wall clock is involved. The case worth covering is: promote, CPU-store into the range, then check that the next build copies in again.Minor:
expected.empty()at:6713is always true for a resident region;expectedis only filled for 32-byte captured copies, and resident regions are at least 64 KiB.Not run here; this is from reading the code at the head.
AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-11-11T12:22:58Z.
Review: CHANGES_REQUESTED
Thanks for the A/B and the port. Points before this can go in:
recordGpuCopiescopies frominputSnapshot, filled bymemcpyatGuestBufferMemory.cpp:6775.residentCopied(:5968-5975) takesCollectWritesand the byte shadow only after the copy is recorded (:6795). A CPU store between the snapshot and that call is counted as already synced, so the resident buffer keeps the old bytes and later builds skip the copy-in. Take the generation (and the shadow) before the snapshotmemcpy, or derive the shadow from the snapshot bytes, and add a test that stores between the two.docs/dev/ARCHITECTURE.mdunder the section it changes.recordGpuCopiesfor an unchanged re-staged range. Say which approach is meant to land, or make them compose.main(conflicting) and rerun the focused tests with validation on the new head.mainthe runs show 0 copy-ins skipped and neutral timing. That alone isn't blocking, but the points above are.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-11-12T02:57:41Z.
Review: CHANGES_REQUESTED
Thanks for the third commit. Checked against
cd0c400e8b:memcpyand the shadow comes from the snapshot bytes; the live branch is covered by the stamp preceding the GPU read.ResidentBudgetBytes256 MiB device, shadow bounded by the same budget, documented).One point is still open:
recordGpuCopiesfor a range re-staged unchanged (#16648 copies from the previous use's device shadow, this one keeps a resident buffer and skips the copy). They conflict at the same lines and do the same job. Say which one is meant to land, or make them compose (for example, resident ranges as the source #16648 reads from), and list the other in Depends on.Smaller: the new test hook fires after the stamp, so it exercises the live-copy branch only. The snapshot branch you changed (
!pendingWriter && !writable) has no test that stores between the stamp and thememcpy; if that branch is reachable, please pin it, and if it is not, drop the code for it.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-18T02:00:13Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks merging based on the code inspected; the reported focused checks are author-reported and were not rerun here.
What I ran
Reviewed head
5f43ae141edeb57a3ca1c5ff60f2aaae692a2664. No test or build command was run. Read the prepared description, commit list, manifest, diff, and all included changed files; inspected targeted ranges of excluded implementation files and guest-memory tracking code throughrepo_read.py.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
I did not run tests, builds, validation layers, Windows checks, or title runs. The description reports 20/20 focused tests on NVIDIA Linux and 18/20 on lavapipe, with two self-skips; these results were not independently verified. Read files:
core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp,core/libs/prx/libSceAgcDriver/Graphics/include/RuntimeSwitches.hpp,core/libs/prx/libSceAgcDriver/Graphics/src/RuntimeSwitches.cpp,core/libs/prx/libSceAgcDriver/tests/execution/ResidentRanges.cpp,docs/dev/ARCHITECTURE.md, anddocs/dev/ENVIRONMENT.md, plus targeted ranges incore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp,core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp,core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp, andcore/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp. Excluded from the review folder:VulkanDevice.cpp,GuestBufferMemory.cpp, andtests/Recorder.cpp; the first two were inspected through targeted reader ranges, and the third was not read. No other reviewed files were excluded.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T12:24:27Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks merging this change; the reviewed resident-range tracking, invalidation paths, and tests show no verified blocking defect.
What I ran
No commands or tests were run. I inspected the prepared diff and targeted source at head
c9a9de3f5e46d1a05b93adcd5b02ede5ccc3fb86; the PR description reports prior checks, which I did not independently run.Results
Findings
Blocking
None found in the code reviewed.
Non-blocking
None.
Not verified
I read
VulkanDevice.cpp,GuestBufferMemory.hpp,GuestBufferMemory.cpp,RuntimeSwitches.hpp,RuntimeSwitches.cpp,ShaderResources.cpp,Recorder.cpp,agc_driver_recorder_tests.cmake,ResidentRanges.cpp,ARCHITECTURE.md, andENVIRONMENT.mdat the pinned head, along withdescription.md,commits.md,manifest.json, anddiff.patch. The full text ofVulkanDevice.cpp,GuestBufferMemory.cpp,ShaderResources.cpp, andRecorder.cppwas excluded by the review bundle; I read targeted ranges in the first three and relevant hunks inRecorder.cpp's diff, not its head source. I did not verify behavior on hardware, Windows, or through a build/test run.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T21:27:56Z.
Review: COMMENTED
Reviewed — no blocking findings
No concrete blocking defect was found in the changed code; reviewer-side tests were not run.
What I ran
Reviewed head
925804432bc528b851932b9737e7d37039d7ef0eusing the prepared diff and targetedrepo_read.pyreader ranges. No test or build commands were run.Results
Negative control
Not run by the reviewer. The description reports a negative control on an earlier head; it was not verified for this head.
Findings
Blocking
None.
Non-blocking
None.
Sources
Not verified
Builds, tests, and runtime behavior were not independently verified. The description reports Linux NVIDIA and lavapipe test results, but no Windows run for this head. Targeted changed ranges were read for all 11 changed files; full text was not loaded for
VulkanDevice.cpp,GuestBufferMemory.cpp,ShaderResources.cpp, orRecorder.cppbecause those files were excluded from the prepared bundle. Their relevant changed hunks were read through the reader.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T12:35:06Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this review; the author should share test output from this exact head before a formal approval decision.
What I ran
Reviewed head
288d5d2aa408be0e93b0c6e131d3e3bb80ad763fusing the prepared diff andrepo_read.pyat the pinned head. No commands or tests were run in this review.Results
Findings
Blocking
None.
Non-blocking
Sources
Not verified
No build, tests, runtime behavior, GPU validation, or performance measurements were run by this reviewer. The review bundle lists 11 changed files. I read the prepared diff for all changed paths and targeted repository content for the resident range implementation, teardown, runtime switch, and tests; full file bodies were excluded for
VulkanDevice.cpp,GuestBufferMemory.cpp,ShaderResources.cpp, andRecorder.cppbecause they exceeded the bundle limit.To get this to a good state
Nothing is required. Share the exact-head test and check output as optional supporting evidence.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-01T23:46:35Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this; the points below are optional.
What I ran
Reviewed head
46d93c71f2e7fcbce0ae9c31b6ae0185b8862a92against the prepared diff and pinned repository source. I did not run tests, builds, or performance checks.Results
Negative control
Could not run a negative control; no test or source modification was executed.
Findings
Blocking
None.
Non-blocking
None.
Sources
The promotion limits, invalidation checks, and skip decision are in GuestBufferMemory.cpp at the reviewed head. Resident ranges are checked before carried shadows are considered, and direct-write marks account for the recorder’s own copy-backs (copy-in path, write-mark path).
Not verified
No runtime behavior, platform or device coverage, or performance measurements were verified here. Results described by the author were not reproduced. Changed lines were reviewed in all changed files:
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp,core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp,core/libs/prx/libSceAgcDriver/Graphics/include/RuntimeSwitches.hpp,core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp,core/libs/prx/libSceAgcDriver/Graphics/src/RuntimeSwitches.cpp,core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp,core/libs/prx/libSceAgcDriver/tests/Recorder.cpp,core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake,core/libs/prx/libSceAgcDriver/tests/execution/ResidentRanges.cpp,docs/dev/ARCHITECTURE.md, anddocs/dev/ENVIRONMENT.md. Full text for the four oversized files (VulkanDevice.cpp,GuestBufferMemory.cpp,ShaderResources.cpp, andRecorder.cpp) was not in the review folder; their relevant changed hunks and source context were read throughrepo_read.py. No files were excluded by the configured filename rules.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-12-01T23:51:01Z.
Review: COMMENTED
🏛️ Architecture findings (1)
Advisory architecture findings (1)
💬 Code review
Actionable comments posted (3)
ccfc0a0a-dffd-4b61-9215-2cecae81c5bdReviewing files that changed from the base of the PR and between
7d3d015feeand46d93c71f2.core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hppcore/libs/prx/libSceAgcDriver/Graphics/include/RuntimeSwitches.hppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/Graphics/src/RuntimeSwitches.cppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppcore/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmakecore/libs/prx/libSceAgcDriver/tests/execution/ResidentRanges.cppdocs/dev/ARCHITECTURE.mddocs/dev/ENVIRONMENT.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 ligmaSec on 2026-12-03T22:37:20Z.
Review: COMMENTED
The trial merge onto
c1601e56d5was clean. The resident-range fixture separately covers promotion, a skipped copy-in, a store after the generation check, and disposal on teardown. Keep the assertion that new GPU reads see the CPU bytes in the skipped-copy race, alongside the copy-count assertions. Compared and write-watched imports exercise distinct paths. Local paired execution is pending.AI-assisted: yes.
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.