fix(agc): seed fresh D32 Z64 depth surfaces from guest memory #28292
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/28292"
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-29T19:27:43Z.
What
A new single-sample D32 depth surface in 64KB_Z_X tiling, bound with no HTILE and no owner that hands over its contents, started at
DB_DEPTH_CLEARunless a storage image of a compatible format covered its plane. Without HTILE the depth block reads the plane in memory, so depth the CPU wrote there before the first bind was lost: a draw depth-tested against 1.0 instead of the stored values, and sampling the plane afterwards read the surface, not the guest bytes. A cached storage image of the plane's address and size but an incompatible format (an R8 view, say), or a live owner of another size or format at the same address, also left the surface at the clear value. This PR seeds such a surface from its guest plane (part 2) and, on the way, makes the code that creates, mirrors, uploads and flushes depth and storage images safe against a throw at any allocation (parts 1 and 3 to 9). The failure paths are exercised with the driver's allocation-failure hook added in #28290.c87d1794cd).StorageTexture::noteGpuWritesizes its per-layer GPU write stamps and held-snapshot flags together and only checked the size of the stamps; it resized the stamps first, so a failed allocation of the flags left the stamps right and the flags empty, and every later GPU write set a flag past the end of an empty vector. The flags are now sized first, and the stamps only once the flags hold every tracked layer.ad6f50c6c8).TakeStoragefinds no compatible storage image, the surface is seeded from its guest plane. The seed first stores the GPU-only depth of every surface overlapping the plane throughFlushDepthPlanes, as a CPU read of that range does. The tracker generation is taken before the plane is read and the units are stamped with it, so a CPU write that lands during the seed is collected above that generation and synced on the next bind.ReadCommitted, detiled into a linear buffer and copied into the depth aspect, asDepthPlaneCopyfills a sampled plane. It is not seeded through aStorageTexture, whose upload takes a host import that, where imports are compared rather than write-watched (lavapipe, Windows devices without a settle queue), takes the plane out of write tracking. Without a texture detiler the seed is skipped. WithoutVK_EXT_depth_range_unrestricteda plane whose texels hold a value outside [0, 1], or a NaN, is not copied (it would violateVUID-vkCmdCopyBufferToImage-pRegions-07931, and clamping would change the stored bits), so that surface starts at its clear value with its plane tracked as on main. The check reads the texels the copy consumes, at their tiled offsets with the target's pipe/bank XOR, so values in the padding of the 64 KiB blocks do not stop the seed.DepthSurfaceSeedCount()counts the seeds.FlushDepthPlanesmay have stored their depth, consumed their clears and changed stale tracking, as a CPU read of the plane would; displaced owners are retired after publication, as on main).OwnedImage, and the creating clear, the seed, the storage copy andCopyAspectFrom(which also keeps its source) keep it. The surface's attachment view belongs to itsOwnedImage. The multisample import's sample image is owned before it is created. The surface list grows geometrically before the candidate is made, so publication cannot fail. An owed clear with no fill value counts as handed over: it resolves to the recipient'sDB_DEPTH_CLEAR, which the new image already holds.mirrorResourcenow carries the target's pipe/bank XOR; it was left at zero, so the seed, the mirror sync and stale-plane stores of a target with a nonzero XOR used the wrong addresses.1f1b7d7f12. On Windows the first read of a demand-zero page in write-watched memory is reported as a write, so without that the seed's own read landed above its baseline and the same bind filled the surface twice.WrittenUnits, whose fallback for a partially watched plane collected and checked one page at a time and only then read the tracker generation, so a CPU write to a page it had already checked could be stamped as seen without being synced. The fallback now collects every range first, reads the generation, then checks the ranges, the order the whole-plane path uses. The ranges live in a buffer the surface reuses.VK_EXT_depth_range_unrestricted, detiled on the GPU into a linear device buffer of the surface (7.9 MiB for a 1920x1080 D32 plane, beside an upload of the padded tiled plane) and copied into the depth aspect.DB_DEPTH_CLEAR; the debt fragmentfix-agc-seed-fresh-depth-surface.mdlists them.d8437a866b).TextureDetilerappended the new compute pipeline to its list after creating it; when the append could not grow the list the pipeline leaked (VUID-vkDestroyDevice-device-05137). The list is now grown before the pipeline is created.e9ffcf2c87).ReleaseDeferredKeeps, run by every outermostGpuMutexunlock once a recorder exists, could throw in three places (the per-thread deferred list and byte count, two host thread-locals created on first use on Windows, and the release thread's queue created on the first hand-off); a throw from an unlock during unwinding terminates the process. The list and byte count are now one thread-local state, created only whenfinish()defers a batch, and the hook looks it up with the newHostThreadLocalIfPresent, which never allocates. The queue is looked up inside the hand-off'stry, so a failure destroys the batches on the unlocking thread like any other failed hand-off.~RecorderandBoundKeptBytesuse the same lookup.befc351d05).StorageTexture::FlushPendingtook images out of the pending list, marked them clean and listed them as flushing before storing them; a throw anywhere but the recorder wait left an image clean and unlisted with layers still pending, so its GPU results never reached guest memory. The selection is now two steps: the first only reads the pending list and collects the images (the step that allocates, changing nothing); then the flushing list is reserved, and only then are the images marked clean and taken out of the pending list, which cannot fail. The pending list keeps a held slot for every image taken out, so re-registering it (the reconcile of a failing store, a new GPU write, the flush's guard) takes its slot without allocating. From selection to the end of the stores the guard registers every selected image again from its pending flags on any throw. An image registers itself before it marks itself dirty. The notes of the selected images only narrow the writers the flush waits for; when collecting them fails they are dropped and the flush waits for every writer.dc1da087ae).SyncFromMemorystamped every unit with the tracker generation before creating or refreshing the mirror's storage image and recording the copy, so a throw left the new generation on units whose depth had not been copied and the CPU's write was lost. The depth sync and the stencil sync now stamp after the copy is recorded (the stencil sync also when there is nothing to copy); writes landing after the generation was read are still collected above it. A mirror refresh that throws after the image took the new guest contents as its own now drops the mirror, unless it holds GPU results not yet stored, and the next sync rebuilds it from guest memory.27aa4c2572).copyPlanecopies through the plane's staging buffer when the device neither copies depth to colour directly nor runs the transfer pass, and the batch kept the storage image but not the buffer; dropping the surface's mirror (the bind of a newer overlapping surface) released the buffer while the copy was recorded or running. The batch now keeps the buffer before the first command that names it. The transfer view, the stencil copy's buffer and image belong to the surface, and a retired surface is kept by the batch that retires it, so they need no keep of their own.b625f526f1,9853eee49d).StorageTexture::uploadstamps the units it replaces (layer generations, guest bytes intooriginaland the generation baseline, held) before recording the copy, then allocates; a throw left the image claiming guest contents it never received, so the nextRefreshreported it unchanged and stale texels survived. The body is a function try block whose handler callsforgetUploadand rethrows. For every unit that is not pending,forgetUploadclears the generation and the held copy so the next refresh uploads it again, then recomputes the oldest generation and drops the epoch proof. Pending units keep their generation and results. The normal path runs no added code.borrowUnits, recorded inborrowedFrom,borrowedVersion,borrowedUnits).forgetUploadcleared the generation of borrowed units but kept the record, so the nextRefreshskipped borrowing them and uploaded the stale guest bytes over the alias's pending results.forgetUploadnow forgets the borrowing record of every unit it clears.a122c9415b,a05168045b). An image without a single-pass detile detiles into a linear buffer, moves toTRANSFER_DST_OPTIMAL, copies the buffer in and moves back toGENERAL. The import upload built its copy regions and looked upvkCmdCopyBufferToImageand the secondvkCmdPipelineBarrierbetween the two transitions; a throw there left the batch with the first transition and no second while the driver treated the image asGENERAL.RecordLinearCopyInnow records the sequence for both the import upload and the window upload of block-unit images: it takes the prepared regions and whether the image keeps the content outside them (GENERAL) or not (UNDEFINED), resolves both entry points from the device's table (falling back to a lookup) and builds both barriers before the first is recorded, so between the transitions it records only the copy.1484c22102). The seed stores the GPU results pending in the plane first (FlushDepthPlanes,FlushGpuWrites) and then reads it. When the plane is the memory of a live multisampled color target, that read retires the target: its samples live only in the target's own image, and a later fill over the memory is no longer taken as the target's clear.SeedFromGuestPlanenow returns before it touches the plane whenMultisampleColorTargetOverlapsreports a live multisampled color target over it. A new depth surface whose plane is the memory of a live multisampled color target is not seeded and starts at its clear value, as every new surface did before this PR; this keeps the target state memo's claim contract (agc_driver_color_memo_claim_*).DepthSurfaceSeedsSkippedUnderMultisampleTargetcounts the skips. The debt entry names the skipped case.Known limitation. A seed or sync recorded into a batch that is then discarded (a failed submit) leaves the surface stamped as seeded or synced, so it keeps its old depth until the plane is written again. This is recorded in the debt entry; discard consistency is a separate change.
Tests, in
DepthSurfaceFromStorage.cpp(agc_driver_depth_surface_from_storage, synchronization validation on,SYNC-HAZARD-|VUID-fails each test, 30 s timeout each). The executable takes the part to run as its argument and runs the seeding cases when none is given; each part is its own ctest test.agc_driver_depth_surface_from_storage: the seeding cases, among themGuestPlanePatternCase,SeedRaceCaseandSeedCopyRaceCase(a CPU write while the seed reads),PartialWatchCollectCase,IncompatibleStorageCase,MismatchedOwnerCase,PipeBankXorCase,RawDepthBitsCaseandOutOfRangePlaneCase(planes of -0.0, denormals, values outside [0, 1], with and withoutVK_EXT_depth_range_unrestricted),PaddingOutOfRangeCase,DemandZeroPlaneCase,AllocationFailureCase,MultisampleAbortCaseand the retired-surface and discard cases._flush: fails each allocation of a depth bind's flush in turn (the first flush of a process, whose stores create their detile pipelines, also on a thread of its own), then a bind that fails once the flush selected an older surface's store and retries; the new surface must read 0.25 inside the older surface's extent and the CPU's 0.75 outside it. Two more cases in the same process: three pending storage rows stored by the process's first flush on a thread of its own, failing from each allocation in turn, then checking each row is still pending or already holds what its storage image stored and reaches guest memory through a clean flush; and a flush whose selected hook marks 0 to 16 other storage images pending, leaves no allocation to succeed and throws, then checks the row is still pending and reaches guest memory._sync: a mirrored 64x32 D32 surface, a new CPU depth written before each bind that fails from its n-th allocation on, then a bind with no failure that must leave the new depth in the image; andPendingMirrorSyncFailureCase, which draws 0.25 over a 192x136 D32 surface of four 64 KiB units, fails the store of unit 0 so it stays pending in the mirror, writes a new CPU depth into unit 3, sweeps the failing allocation, and requires unit 3 to hold the CPU's depth, every other texel the drawn 0.25, and a final flush to store 0.25 outside unit 3._batch: held-batch cases (a surface retired into a discarded batch while an earlier batch is held on the GPU; the object must be alive during the hold and released once the held batch finished and the deferred releases ran, in every iteration of the sweep)._staging: direct depth copies and the transfer pass off, a 192x136 mirrored D32 surface flushed, its plane changed on the CPU, bound again so the copy goes through the staging buffer, the batch held; while held the buffer must have an owner besides the mirror, and after the hold a 64x32 surface over the second block drops the mirror and the buffer must be destroyed (DepthMirrorStagingForTest). On a write-watched plane a bind that records no copy fails the case; only an unwatched plane or no active recorder skips it._msaa: the multisample allocation sweep. Each failure index starts from a single-sample D32 owner of the same plane; after a failed bind the candidate must not own the plane, no guard may cover it, and the single-sample owner must still be the only owner; the bind is retried on that state, and every successful bind must make the 4-sample surface the plane's owner, retire the single-sample one and hold the guest plane's samples (marked written, published back through a CPU read that leaves the plane bytes unchanged). A failure after publication is counted separately and the 4-sample surface must then hold the guest plane's samples. It also binds a new mirrored 64x32 D32 surface over the memory of a live 4-sample 64x64 RGBA8 color target and requires no seed, one counted skip, and that a fill over the target is still taken as its clear._upload: a new 64x32 D32 surface over a cached R32F image whose plane the CPU rewrote, and a four-unit 192x136 R32F mirror-shaped image with GPU results pending in unit 0 and a CPU write in unit 3; after every failed bind or refresh the next must give the CPU's texels, keep unit 0 pending with its results, and a final flush must store them._borrow: two four-unit 192x136 R32F images over the same memory, the first with results 0.125 pending in unit 0, the second borrowing them on a refresh of a CPU write to unit 3, then the failing-allocation sweep over the second image's refresh of a new CPU write to unit 3; the first image must stay pending, the second must hold unit 3's new depth and unit 0's borrowed results, and a final flush must store them. Skipped where the memory is not write-watched or cannot be imported._layers: a linear two-layer 128x128 R32F array image through a context without single-pass storage, results 0.125 pending in layer 0; the first refresh must leave a host import over the array and the upload's read noted on the open batch (the case is skipped without a host import); then the failing-allocation sweep over a refresh of a new CPU write to layer 1; after each failure the next refresh must leave layer 0's results and layer 1's CPU depth, and at least one failed refresh must leave layer 0 pending._windows: the pending-unit case of_uploadthrough a context without single-pass storage (192x136 R32F, results 0.125 pending in unit 0, CPU write to unit 3, so each refresh is a partial window upload); the first refresh must leave a host import over unit 3, then the sweep; each next refresh keeps unit 0 pending and gives unit 3 the CPU's depth.agc_driver_recorder_retention_hook: finishes a batch inside a hold so its object is deferred to the unlock, fails the next allocation (the first hand-off of the process, which creates the release queue) and unlocks; the allocation must be reached and the unlock must destroy the deferred object itself.The failed allocations come from the driver's wrapped allocator, which the MinGW and Linux x86-64 test builds link; other platforms run the cases without the allocation sweeps. The sync cases are skipped where the plane is not write-watched, and the sync sweep stops once the mirror's host import has taken the plane out of write tracking (lavapipe on Windows, where the next bind does not see a later CPU write with or without a failure, as on main; that gap is separate).
Tested
Red first, on the parent of each fix:
c87d1794cd): without the change_flushand_msaacrash innoteGpuWriteon the bind after the flags' allocation failed.ad6f50c6c8): the seeding cases read back depth that only the seed provides (on main the surface starts atDB_DEPTH_CLEAR); they were not rerun on main for this head.d8437a866b): without the change_flushdestroyed the device with a pipeline still alive.e9ffcf2c87): without the lookup change the first unlock of the thread of_flush's first case, made by the guard of the failed flush, terminated the process; with the queue looked up outside thetry, thebad_allocleft the unlock andagc_driver_recorder_retention_hookhung until its 30 s timeout.befc351d05): without the change the retried bind read 0.75 where the older surface had drawn, and the two extra_flushcases lost the rows.dc1da087ae): without the change the image kept the previous depth after a failure in the sync (_sync).27aa4c2572): without the keep the mirror was the buffer's only owner while the batch that copies through it was held (_staging).b625f526f1): on the parent,_uploadfails on the RTX 3080 and on lavapipe 26.2.6: a new surface reads 2048 of 2048 stale texels, and unit 3 of the mirror-shaped image keeps 512 of 512 stale texels. Removing the handler'sforgetUploadcall also fails it withAPS5_HOST_IMPORT_MIB=1(CPU upload paths). Removing one line offorgetUploadfails the test: the generation reset on the 3080 and withAPS5_HOST_IMPORT_MIB=1; the held-copy reset on lavapipe and withAPS5_HOST_IMPORT_MIB=1; the oldest-generation recompute on the 3080 and withAPS5_HOST_IMPORT_MIB=1; the pending skip on the 3080 (unit 0 is no longer pending) and on lavapipe (its results are dropped and storing them throws). Removing the epoch-proof reset fails nothing:refreshtakes its epoch proof only on threads that bump the collect epoch, which these tests do not.9853eee49d): without the new line the RTX 3080 fails_borrowfrom a failure at allocation 11 on: all 16384 texels of unit 0 in the second image hold the stale guest bytes instead of the borrowed results. Lavapipe 26.2.6 on Windows (compared imports, plane not write-watched) andAPS5_HOST_IMPORT_MIB=1skip it.580b4cc6f2): withTexture.cppof the parent of the upload fix (b625f526f1), the 3080 failsPendingMirrorSyncFailureCasefrom a failure at allocation 10 on: the 512 texels of unit 3 keep the mirror's old depth. It passes with the fix (31 of 33 binds aborted, each leaving unit 0 pending in the mirror). Lavapipe 26.2.6 on Windows skips it (plane not write-watched).fcbd01f7e2): withSyncFromMemorymade to see no written unit, the case fails on the 3080; the previous version of the case skipped it as not checked and passed.a122c9415b,a05168045b): building the regions after the first transition fails_layerson the RTX 3080 and on lavapipe 26.2.6 withVUID-VkImageMemoryBarrier-oldLayout-01197. An allocation between the two transitions fails both_windowsand_layerson both:_windowswithVUID-vkCmdDraw-None-09600(the image is still inTRANSFER_DST_OPTIMALwhereGENERALis expected),_layerswith the-01197error. Both pass with the change on both, and are skipped withAPS5_HOST_IMPORT_MIB=1. The window upload's previous order passes_windowson both, as its lookups do not allocate.1484c22102): without the skip themsaapart fails on the RTX 3080 and on lavapipe 26.2.6, as do the threeagc_driver_color_memo_claimtests.Local gate (Windows 11, RTX 3080, under a GPU claim) on the A to D integration 901ada780ff: A, B and C merged with D on main
6f6f6c8e6b(the later integration head 1ca50acf71a only changes debt wording). Of the 2411^agc_andwindows_mappings_releasetests on the RTX 3080, none fails (2384 pass, 27 skip). On lavapipe 26.2.6, of the 200 tests in the series' set 169 pass and 28 skip; the other 3 (agc_driver_depth_fewer_samples,agc_driver_native_depth_fill_over_pending_import,agc_driver_recorder) fail on main6f6f6c8e6bas well.Fork CI 46289914386 built and ran the same integration 901ada780ff and main
6f6f6c8e6bside by side, with the same test selection:agc_driver_pipeline_journal,agc_driver_alpha_to_coverage_sample_mask_export,agc_driver_runtime_formatted_store_x1,_x2,_x3_d16) andagc_driver_storage_read_during_idle_store, which has failed on main in earlier runs.agc_linked_code_dependencies_data-hit-verify-stale-datareached its expected verifier abort and then hit its 30 s timeout. All 7 pass 5 of 5 times on lavapipe 26.2.6 locally at this head.agc_driver_host_import_settle_retireskips on lavapipe on both platforms, and the report counts a new test that skips as not passing. It needs the MinGW production device; it passes in the local RTX 3080 gate.python3 tools/check_conventions.py --base origin/mainandpython3 tools/debt_fold.py --checkpass.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-29T19:38:24Z.
Review: COMMENTED
Reviewed — comments
The reviewed portions of head
63926a76a5289a39365e6b04bafd319c27ee9d95show no verified blocking defect, but the review is incomplete and no checks were run.What I ran
No tests or build commands were run. I inspected the prepared description, commit list, manifest and diff, plus selected changed-code hunks.
Results
Findings
Blocking
None found in the portions inspected.
Non-blocking
None.
Not verified
The changed
Texture.cppwas excluded from the review folder because it was too large; I did not inspect it through the reader. The rest of the changed files were listed in the manifest, but I did not read every changed file or all changed hunks. Tests and build results in the PR description are author reported and were not independently verified. The review folder’sdescription.md,commits.md,manifest.jsonand selected sections ofdiff.patchwere read. No repository source files were read in full; only the first line ofRecorder.cppwas read through the pinned reader.To get this to a good state
Nothing is required. Optional: complete review of the uninspected changed code, especially
Texture.cpp, and run the relevant checks before making a formal approval decision.Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-29T19:39:35Z.
Review: COMMENTED
Actionable comments posted: 18
c07e5ec5-623c-4f8c-b6ef-a1f93ba16e74Reviewing files that changed from the base of the PR and between
1f27e2abfaand63926a76a5.core/libs/prx/libSceAgcDriver/Graphics/include/DepthSurface.hppcore/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hppcore/libs/prx/libSceAgcDriver/Graphics/include/Texture.hppcore/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/Graphics/src/TextureDetiler.cppcore/libs/prx/libSceAgcDriver/tests/AllocationCounter.cppcore/libs/prx/libSceAgcDriver/tests/AllocationCounter.hppcore/libs/prx/libSceAgcDriver/tests/RecorderBatchFences.cppcore/libs/prx/libSceAgcDriver/tests/RecorderKeptBytes.cppcore/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_depth_surface_from_storage_tests.cmakecore/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_graphics_tests.cmakecore/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_retention_tests.cmakecore/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_storage_view_cache_tests.cmakecore/libs/prx/libSceAgcDriver/tests/execution/DepthFastClearHarness.hppcore/libs/prx/libSceAgcDriver/tests/execution/DepthSurfaceFromStorage.cppcore/libs/prx/libSceAgcDriver/tests/execution/RecorderRetention.cppcore/libs/prx/libSceAgcDriver/tests/execution/StorageViewCache.cppcore/libs/prx/libc/include/HostThreadLocal.hppdocs/dev/debt/changes/agc-recorder-failed-teardown.mddocs/dev/debt/changes/fix-agc-seed-fresh-depth-surface.mdIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-30T07:17:02Z.
Review: COMMENTED
Reviewed — no blocking findings
The inspected depth-seeding and recorder-lifetime paths show no verified blocking defect, but this review is incomplete, so a formal decision is not justified.
What I ran
3af416d0c951c8148b5e741c47a070549bfce874.repo_read.py.Results
Negative control
Not run; no tests were run.
Findings
Blocking
None verified in the inspected ranges.
Non-blocking
None.
Sources
Reviewed prepared
review/description.md,review/commits.md,review/manifest.json,review/diff.patch; inspected source ranges inDepthSurface.cpp,Recorder.hpp,Recorder.cpp,DeferredDestruction.cppandHostThreadLocal.hppat the pinned head.Not verified
The full content of
VulkanDevice.cppandTexture.cppwas excluded from the review folder and not read through the reader. Most other changed files and hunks were not inspected; no tests or build were run. Therefore, findings are limited to the inspected ranges and no claim is made about unreviewed code.To get this to a good state
Complete review of the excluded files and remaining changed files, then run the relevant checks on this head before making a formal review decision.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-30T07:19:11Z.
Review: COMMENTED
Actionable comments posted: 3
Architecture findings (1)
Advisory architecture findings (1)
ce388d33-e8ff-45e3-9d79-eb8d920c3e7fReviewing files that changed from the base of the PR and between
63926a76a5and3af416d0c9.core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/DeferredDestruction.hppcore/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hppcore/libs/prx/libSceAgcDriver/Graphics/include/Texture.hppcore/libs/prx/libSceAgcDriver/Graphics/src/DeferredDestruction.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Resources.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/tests/DeferredDestruction.cppcore/libs/prx/libSceAgcDriver/tests/RecorderBatchFences.cppcore/libs/prx/libSceAgcDriver/tests/cmake/agc_recorder_batch_fences_tests.cmakecore/libs/prx/libSceAgcDriver/tests/execution/DepthSurfaceFromStorage.cppcore/libs/prx/libSceAgcDriver/tests/execution/RecorderRetention.cppcore/libs/prx/libSceAgcDriver/tests/execution/StorageViewCache.cppcore/libs/prx/libc/include/HostThreadLocal.hppcore/libs/tests/HostThreadLocal.cppcore/libs/tests/HostThreadLocalLibrary.cppdocs/dev/debt/changes/agc-recorder-failed-teardown.mdIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-30T09:59:18Z.
Review: COMMENTED
Reviewed — no blocking findings
The inspected code shows no verified blocking defect, but the full change was not reviewed and no checks were run.
What I ran
17552621678ffb55c96985686051df914faf1316using the prepared diff andrepo_read.pyreader tools.Results
Negative control
Not run.
Findings
Blocking
None verified in the inspected code.
Non-blocking
None.
Sources
The review folder’s description, commits, manifest, and diff; targeted source ranges in
DepthSurface.cpp,Texture.cpp, andVulkanDevice.cppat the pinned head.Not verified
The manifest lists 32 changed files. I inspected selected diff hunks and partial source context, but did not read every added line or fully review every changed file. The full texts of
VulkanDevice.cppandTexture.cppwere excluded from the review folder; only targeted ranges were read through the reader. Tests and author-reported CI results were not independently verified.To get this to a good state
Nothing is required. Optional: complete the review of the remaining changed lines and run the relevant checks before making a formal approval decision.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-30T10:10:20Z.
Review: COMMENTED
Actionable comments posted: 5
Architecture findings (1)
Advisory architecture findings (1)
d9aa1fef-cfa7-42f8-9561-50662ac2f5b4Reviewing files that changed from the base of the PR and between
3af416d0c9and1755262167.core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hppcore/libs/prx/libSceAgcDriver/Graphics/include/Texture.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/tests/RecorderBatchFences.cppcore/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_retention_tests.cmakecore/libs/prx/libSceAgcDriver/tests/execution/DepthSurfaceFromStorage.cppcore/libs/prx/libSceAgcDriver/tests/execution/RecorderRetention.cppcore/libs/prx/libSceAgcDriver/tests/execution/StorageFileWrite.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-30T13:13:30Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this change based on the code inspected; several changed files were excluded for size, so the review is incomplete and does not justify formal approval.
What I ran
899105d77fadf909f23636b5c58c3f04b6f2ec51using the prepared diff andrepo_read.pyat that pinned head.description.md,commits.md,manifest.json,diff.patch, and targeted ranges fromDepthSurface.cpp,Recorder.cpp,Texture.cpp,DeferredDestruction.cpp,HostThreadLocal.hpp, andVulkanDevice.cpp.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
VulkanDevice.cpp,Texture.cpp, andRecorderBatchFences.cppwere excluded from the review folder because they exceeded its size limit. I did not read those full files through the reader. Only targeted ranges ofVulkanDevice.cppandTexture.cppwere inspected;RecorderBatchFences.cppwas not inspected.files.json; the exclusions above were confirmed inmanifest.json.To get this to a good state
Nothing is required. The points above describe the limits of this review.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-30T13:27:15Z.
Review: COMMENTED
Actionable comments posted: 7
Architecture findings (1)
Advisory architecture findings (1)
6673ad6a-c20f-4d03-9f10-c93767b50120Reviewing files that changed from the base of the PR and between
1755262167and899105d77f.core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/DepthSurface.hppcore/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hppcore/libs/prx/libSceAgcDriver/Graphics/include/Texture.hppcore/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppcore/libs/prx/libSceAgcDriver/tests/execution/DepthSurfaceFromStorage.cppcore/libs/prx/libSceAgcDriver/tests/execution/StorageViewCache.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-30T16:22:48Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
Changes are required before merge: the seed records the guest generation as consumed before its GPU work is submitted, so discarding that batch can leave the published depth surface stale indefinitely.
What I ran
Static review at head
5c8b2cba477b60ddae080eadeff1e0cdd2827e8a, using the pinned review reader’s file, range, and search operations. I read the review description, commits, manifest, and selected diff sections; I inspected relevant ranges inDepthSurface.cpp,Recorder.cpp,Texture.cpp,DeferredDestruction.cpp, andVulkanDevice.cpp. No build or tests were run; this review is static only.Results
Negative control
Not run; this was a static review.
Findings
Blocking
core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp:1881stamps every tracked unit with the baseline before recording the seed commands. If the batch is later discarded, the depth image never receives the copy or clear, but the generation remains consumed; a later bind sees no new guest write and does not retry the seed. The recorder has discard callbacks, but I found no seed invalidation callback in the inspectedDepthSurface.cppranges. Commit the generation only after successful completion, or register discard handling that invalidates it so a later bind retries.Non-blocking
None.
Sources
Not verified
Only targeted ranges of the five named production files were read; they were not read in full. The other 28 changed files were not read:
VulkanDevice.hpp,DeferredDestruction.hpp,DepthSurface.hpp,Recorder.hpp,Texture.hpp,Resources.cpp,TextureDetiler.cpp,AllocationCounter.cpp,AllocationCounter.hpp, test filesDeferredDestruction.cpp,Recorder.cpp,RecorderBatchFences.cpp,RecorderKeptBytes.cpp,DepthFastClearHarness.hpp,DepthSurfaceFromStorage.cpp,RecorderRetention.cpp,StorageFileWrite.cpp, andStorageViewCache.cpp; CMake filesagc_driver_depth_surface_from_storage_tests.cmake,agc_driver_graphics_tests.cmake,agc_driver_recorder_retention_tests.cmake,agc_driver_storage_view_cache_tests.cmake, andagc_recorder_batch_fences_tests.cmake;HostThreadLocal.hpp,HostThreadLocal.cpp,HostThreadLocalLibrary.cpp; and debt notesagc-recorder-failed-teardown.mdandfix-agc-seed-fresh-depth-surface.md. Runtime behavior and all uninspected code remain unverified.To get this to a good state
Add discard handling so an unsuccessful seed cannot leave the generation marked consumed, then re-review the new head.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-30T16:31:33Z.
Review: COMMENTED
Reviewed — no blocking findings
The inspected source ranges do not establish a blocking defect, but this review is incomplete because most changed lines and files were not examined.
What I ran
Static review only at head
31cc3f754c287eb1df63d69e44e363a9c3c1b907against basemain. I usedrepo_read.pyto inspect the review bundle and selected ranges inDepthSurface.cpp,Recorder.cpp, andTexture.cpp. No shell commands, builds, or tests were run.Results
Negative control
Could not run a negative control because this was a static-only review.
Findings
Blocking
None established in the inspected ranges.
Non-blocking
None established in the inspected ranges.
Sources
Not verified
Read the review bundle’s
README.md,description.md,commits.md,manifest.json, and the first 400 lines ofdiff.patch. In the changed files, I inspected selected ranges inDepthSurface.cpp,Recorder.cpp, andTexture.cpp; these files were only partially read. The bundle lists 33 changed files. The full text ofVulkanDevice.cpp,Texture.cpp, and testsRecorder.cppwas excluded from the bundle; I read selectedTexture.cppranges through the reader, but did not inspect the other two excluded files. The remaining changed files and changed lines were not verified. No tests or runtime behavior were verified.To get this to a good state
Nothing is required for the inspected ranges. A complete review would require inspecting the remaining changed lines and files and running the PR’s reported tests on this head.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-30T16:32:16Z.
Review: COMMENTED
Actionable comments posted: 3
530e7ad6-fc7b-49ae-9697-292383409a67Reviewing files that changed from the base of the PR and between
899105d77fand5c8b2cba47.core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/tests/execution/DepthSurfaceFromStorage.cppIncluded 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-30T18:43:51Z.
Review: COMMENTED
Reviewed — no blocking findings
This pass inspected selected changed code at head
ea5772d7af054b089f488902043cfd9805ca56ee; the review is incomplete, so it does not support a formal decision.What I ran
Read prepared review materials and targeted source ranges using
repo_read.py. No build or tests were run.Results
Negative control
Not run; no tests were executed.
Findings
Blocking
No verified blocking defect in the portions inspected.
Non-blocking
None.
Not verified
The manifest lists 35 changed files. I read targeted portions of
DepthSurface.cpp,Recorder.cpp,Texture.cpp, andVulkanDevice.cpp, plus selected excerpts from the prepared diff and review files. I did not inspect every changed line or every changed file, including the full changed test files. The prepared folder does not include full text forVulkanDevice.cpp,Texture.cpp, ortests/Recorder.cpp; only targeted source ranges were read throughrepo_read.py. No runtime behavior, build, or test results were verified.To get this to a good state
Nothing is required. For a formal decision, complete review of the remaining changed files and relevant checks.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-01T00:00:12Z.
Review: COMMENTED
Reviewed — comments
The review is incomplete because the pinned repository reader could not read source files in this read-only run.
What I ran
Head:
b1c4c128e293fd419d3cb1b595879aaff00e1f48.Read
description.md,commits.md,manifest.json,files.json, and the beginning and hunk index ofdiff.patch. Attemptedpython3 repo_read.py --helpandpython3 repo_read.py ls core/libs/prx/libSceAgcDriver/Graphics/src; the latter failed because the reader could not write its call log in the read-only run folder. No tests or builds were run.Results
Findings
Blocking
Not assessed; changed source files were not read.
Non-blocking
No source-level findings established from the inspected material.
Sources
The prepared description, commit summary, manifest, and diff excerpt supplied for this run.
Not verified
No changed repository source or test files were read. The manifest lists 32 changed files for review; none were fully read.
files.jsonlists no packaging exclusions. The behavior and correctness claims in the description, including depth seeding, allocation-failure handling, and recorder teardown, remain unverified.To get this to a good state
Nothing is required to the code based on this incomplete inspection. Complete the source review once the pinned reader can be used, then reconsider the verdict.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-01T02:42:21Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this; the points below are optional.
What I ran
Reviewed head
e86859723892250d00b92900849c80a5a328e7ab. Read the prepared description, commits, manifest, and changed-file list; inspected relevant diff hunks and source context usingrepo_read.py. No tests or builds were run.Results
Negative control
Not run.
Findings
Blocking
None observed in the inspected changes.
Non-blocking
None.
Sources
Depth surface seeding at the reviewed head
Not verified
This review is incomplete, so it does not support approval. The diff, manifest, and changed-file list identify 36 reviewed files; only four were inspected in detail:
DepthSurface.cpp,VulkanDevice.cpp,DeferredDestruction.cpp, andResources.cpp. The other 32 changed files were not verified.files.jsonlists no files excluded by its rules.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-01T04:00:21Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this; the points below are optional.
What I ran
Reviewed prepared PR materials and selected source ranges at head
1eeed2aaa66f2b1c81f47c6039e0e5149e7b98ab. Used Python 3 and the pinned repository reader in the supplied Linux environment; no build or tests were run.Results
Negative control
Not run; no tests were executed.
Findings
Blocking
None identified in the inspected ranges.
Non-blocking
No specific code finding raised from the inspected ranges.
Sources
Not verified
This is an incomplete review: source ranges from 5 of the 36 changed files listed under
reviewedwere inspected. The remaining changed files and behavior outside those ranges were not verified.files.jsonlists no files excluded by rule; some full file texts were omitted from the bundle due to size.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-01T14:33:05Z.
Review: COMMENTED
Reviewed — comments
The targeted inspection found no concrete blocking defect, but only selected ranges in 4 of the 36 changed files were read, so this review does not support a merge recommendation.
What I ran
Reviewed head
3f17e32b4b458bcfafe359d5e326be4025d78dfain the read-only review environment. No compiler, build, or test commands were run.Results
Negative control
Not run; no tests were run.
Findings
Blocking
None verified.
Non-blocking
The review is incomplete; the remaining changed files and hunks need inspection before a formal merge decision.
Sources
Not verified
Read selected ranges in
DepthSurface.cpp,Recorder.cpp,Texture.cpp, andVulkanDevice.cpp, plus the prepared review artifacts. The manifest lists 36 changed files; the other 32 were not read.files.jsonreports no rule-excluded files. The full texts ofVulkanDevice.cpp,Texture.cpp, andtests/Recorder.cppwere unavailable infiles/; only selected ranges of the first two were inspected throughrepo_read.py. No test, build, operating-system, hardware, or console behavior was verified.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T15:33:35Z.
Review: COMMENTED
The native depth initial-owner, retirement, and GCN scalar-buffer cases passed on main and the patched tree. The added storage-to-depth flush, writeback, and upload cases passed on the patched tree. I used the same Linux lavapipe device with Vulkan required, shader cache disabled, and validation layer 1.4.369. The logs show layer insertion and contain no missing-layer diagnostic,
VUID-, orSYNC-HAZARD-entry.AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-03T20:46:19Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this; the points below are optional. This review is incomplete because I inspected selected code paths rather than every changed file.
What I ran
Reviewed selected source ranges at head
176971833077b8f35ecceec6b90a24dcdb99b2b3using the pinnedrepo_read.pyreader. No build or tests were run.Results
Negative control
Not run; no tests were executed.
Findings
Blocking
None identified in the inspected ranges.
Non-blocking
None.
Sources
Not verified
files.jsonlists 36 changed files. Only targeted ranges in the three implementation files above were inspected at the pinned head; the other 33 changed files were not individually inspected. No tests, build, platform behavior, or hardware behavior were verified. The reader returned source ranges, but could not append its audit log because the review workspace is read-only.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-04T01:16:53Z.
Review: COMMENTED
Reviewed — comments
Nothing blocks this; the points below are optional.
What I ran
Reviewed PR head
6d94edebffda58c1aa0cf3b40ed251d62d415d16using the prepared review materials andrepo_read.pyfor pinned source context. No build or tests were run.Results
Negative control
Not run.
Findings
Blocking
None identified in the inspected ranges.
Non-blocking
None identified in the inspected ranges.
Not verified
This is an incomplete review: not every added line was inspected. The three changed files excluded from
files/wereVulkanDevice.cpp,Texture.cpp, andtests/Recorder.cpp; their full text was not read. Other changed files and changed ranges were also not fully inspected. No runtime, platform, or hardware behavior was verified.To get this to a good state
Nothing is required.
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.