fix(agc): restore a repeated replay pass from the captured memory #17338
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/17338"
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-08T18:18:17Z.
What
agc_frame_replay --repeatcould not repeat a capture whose frames draw into native multisample depth. On Windows, pass 2 stopped withguest writes over native multisample depth are not implemented. On Linux, pass 2 silently started from the depth pass 1 left. This PR makes every pass start from the captured memory and rewrites only the pages a pass left different from the capture. Three commits:fix(agc): watch the captured ranges the title watched when replaying on Linux. A capture records which ranges the driver watched (FrameRangeKind::Watched). On Linux the replay committed those ranges but never registered them with the guest write watch, which libkernel does for every title mapping, so native multisample depth owners were never eligible for their guards and unmap retirement. The replay now registers every Watched range (widened to whole pages), including one that already sits in a writable mapping, and throws ifGuestWriteWatchCoversdoes not report it covered. The error names the failing part throughGuestWriteWatchUnavailableReason: build headers older than Linux 6.7, the kernel feature, or a registration with its errno. The registration failure is kept per thread, so another thread's registration cannot replace it before it is read. Windows already write-watches the whole arena reservation. Linux therefore needs kernel 6.7 or newer for--repeatof such captures (PAGEMAP_SCANandUFFD_FEATURE_WP_ASYNC); there is no fallback, and the requirement is indocs/dev/debt/libSceAgcDriver.mdanddocs/dev/BUILD.md.fix(agc): restore a repeated replay pass from the captured memory. The whole reset runs in one driver transaction,AgcDriverGuestMemoryTransaction:Driver::WaitIdle), stops other threads from taking pending storage images to store, waits for stores already taken (FlushExclusion), takes the GPU lock and waits for the device to go idle, and holds all of this until the reset ends. The storage-image exclusion counts its holders, so of two overlapping transactions the first to end does not lift it for the other. Nothing is added to the submission path:SubmitandSuspendPointare byte-identical tomain. The caller must quiesce every submitter first.AgcDriverGuestMemoryChangedSince; a block the watch does not cover or could not walk is a candidate whole) plus the pages of every owner whose results live only on the GPU (AgcDriverGpuOwnedRanges).AgcDriverRetireGpuOwners). There is no footprint registry: retirement walks the lists the driver already keeps (multisampled colour targets with colour, FMASK, CMASK, DCC and HTILE; native depth owners; depth surfaces with depth, stencil and HTILE planes). A retired depth surface discards its stale planes instead of storing them, and HTILE clears remembered for a depth surface not yet bound are dropped over those pages, including ones no resident surface owns, so a restored HTILE is not cleared again at the next bind. Pending storage images are stored, not retired (next item). Other images over those pages, sampled textures for example, are not retired: the rewrite is an ordinary guest write, so they reload through the write generations at their next use. Nothing is added to the draw or bind path.AgcDriverFlushGuestMemory). This is needed for correctness: otherwise they land after the restore and overwrite it. Pages the store changed are added to the candidates and their owners retired. Pending storage images are not retired: they are stored over their whole extent, and the compare then rewrites the pages where they differ from the capture. Discarding them instead would need their whole extent marked written so they upload again, which the page compare is there to avoid.Submitthat is still copying guest commands before it counts, and never sees unordered CPU flips (Submission.cpp), which are not counted; the reset comparesGuestAllocationsGenerationbefore and after and fails, and a compare worker can fault on a page unmapped under it before that check.docs/dev/debt/libSceAgcDriver.mdrecords this.rewritten_bytes(of themrewritten_owned_bytesunder GPU owners),compared_bytes,flushed_bytes,range_bytes,reset_ms,verify_ms,reset_workers(threads that compared at least one page; empty pieces are no longer made) and the owners retired (retired_color,retired_depth_owners,retired_depth_surfaces,discarded_depth_planes).--verify-resetruns inside the transaction, so nothing changes between the reset and its check. It finds owners through the driver's resident lists (AgcDriverResidentOwnersOver), not through the reset's inventory, but over the same plane footprints retirement uses: it catches an owner retirement skipped or the inventory left out, not a footprint that is too small. A truly independent route (footprints rebuilt from each image's own create info, or a Vulkan-side allocation list) would need a second implementation of the guest surface layouts, so the footprints are pinned by tests instead (plane ends stated in the tests, and mutants that shrink a footprint). It fails when an owner survived over a candidate, an owner with results only on the GPU is left over a captured range, or guest memory differs from the capture.verify_msis reported apart fromreset_ms.std::exception_ptr; no exception crossesextern "C".New debt entries: on Linux a title's CPU write to a depth plane under a host import is not seen by the depth surface (the reset works around it by retiring, a live title does not); and the transaction's submission and mapping contract above.
fix(agc): restore a rewind group without racing its control words. A bug onmain, which the replay's new timing made frequent:restoreGroupcopied a rewind group with a plainmemcpyover its rewind control words while the queue worker reads them withatomic_refinexecuteRewindTail, and only then stored them with release. It now copies around the held words and writes each of them only with an atomic store, after every chunk of the group is copied:memcpy. The extra cost is at most one atomic store per chunk.SerialProgressunder the driver mutex the completion is published under), so it does not race the tail copy, and it puts back what the capture held there, for example a label the title rewrote after the tail wrote it.agc_driver_frame_replay_rewind_in_orderpins this.memcpywhile the queue parked on it polled it atomically.main'scopySegmentloads each REWIND control atomically and accepts only two-dword REWINDs, so a queue already running towards a gate no queue is parked on (another queue during an early release, or any queue under--no-paceor after a pacing timeout) no longer races the stores either.Under TSan, 31 runs each (old head, run 42502210173, the round-9
restoreGroupwith these tests; this head, run 42502199631):agc_driver_frame_replay_rewind_page_startfailed 31 times on the old head and 0 on this one,_rewind_zero_control30 and 0,_rewind_chained20 and 0 (the race is reported only when the worker copies the second control before the replay thread next takes the driver mutex),_rewindand_rewind_in_order0 and 0. Round 9's counts for_rewind(2 of 31 passing onmain, 5 on the head before this commit, runs 42489170049 and 42489182087) still stand. No other replay path writes a rewind control word while queues run: the snapshot restore and the reset run with the driver idle, and the wait releases write only non-rewind wait words.Tests:
agc_driver_frame_replay_multisample_depthcaptures one frame on a 4x native depth target with an HTILE and replays it with--repeat 1,2and3under--verify-reset, requiring every texel of every sample plane to equal the captured one. Each later pass must rewrite exactly the pages that differ from the snapshot (the test requires some owner pages to match, so an owner retired without a rewrite is exercised) and retire a native depth owner. Four fault runs (APS5_REPLAY_RESET_FAULT_FOR_TEST=owners,omit,bytes,remap) require--verify-resetor the reset to fail a reset that keeps its owners, hides them from the inventory, leaves a wrong byte, or maps memory during it. A submission accepted inside a transaction (from its test hook, after the idle wait) must make the transaction fail.agc_driver_frame_replay(DMA copies) now runs--repeat 3with--verify-reset, so a page the reset misses fails it.agc_driver_frame_replay_rewind_chained,_rewind_page_start,_rewind_zero_controland_rewind_in_order(new, Windows and Linux, need Vulkan) replay small captures the test writes itself, so a memory group can be restored while a queue is still running or parked. Chained: one group releases a parked REWIND whose tail is a second REWIND, already valid, whose tail jumps into another chunk of the group. Page start: a group that starts with a REWIND control (its header ends the page before) is restored while the queue is still running 1,000WRITE_DATApackets in front of it. Zero control: a group rewrites a gate's page with the control still zero, and a later group releases it. In order: the tail of an early-released gate writes a label that the group holds at another value, which must be the value left after the group's in-order restore. Each must write its label; under TSan the first three fail on the oldrestoreGroup(above).agc_driver_frame_replay_rewind_zero_control_parked(new): a group releases a first REWIND whose tail parks on a second one with a zero control, while the capture was read parked on the second. The replay applies the group, waits for the park and applies it again; the test requirespark_restoresto count that. Under ThreadSanitizer the again pass'smemcpyof the zero control is reported againstexecuteRewindTail's atomic load in 3 of 5 runs without the change, and 20 of 20 runs pass with it.agc_driver_frame_replay_multisample_depth(new case): a guest memory transaction entered with the GPU lock held must fail (it does not without the check, RTX 3080).agc_driver_frame_replay_partial_walk(new, Windows and Linux): every write walk of a reset collects the first half of its range with the platform's real collector, then reports failure (on Windows the refused-walk bookkeeping runs for the rest). The reset must compare the range whole, rewrite exactly the two written pages and restore them; the next reset must rewrite exactly the page written since.agc_driver_frame_replay_large_range(new, Windows and Linux): one range of two pieces and a block, all written; the reset must restore it on at least two threads, counted by the pieces each thread took, not by the pool size.agc_driver_frame_replay_untouched_gpu_owner(new, Windows and Linux, needs Vulkan): a 4x colour target over a captured range is drawn through Vulkan alone, soChangedSincereports none of its pages (required). The reset must retire it with no rewrite and the captured bytes unchanged, and the target bound again must resolve to the captured colour (every sample 0 under UNORM, against the drawn 0x40 before the reset). This kills the mutant that leaves the GPU-owned ranges out of the candidates.agc_driver_frame_replay_flushed_owner(Windows and Linux): a depth surface stays resident over a captured page that only the reset's own flush writes; the reset must add that page to the compare, retire the surface and restore the page.agc_driver_frame_replay_sub_page_resets(new, Windows and Linux): two ranges sharing one page; an idle reset compares nothing, each pass compares and rewrites exactly the bytes written, a settled reset compares nothing, a failed write walk compares the ranges whole, and a mapping during the reset throws.agc_graphics_profile_draw(DepthSurfaceReuse, new cases): replacing an interior page of an HTILE outside the watch makes the next view read it again and find its clear; replacing one page of the stencil plane alone retires a single-sample depth/stencil surface, observed through its depth plane and an 8-bit view of its stencil plane.agc_graphics_profile_draw(DepthSurfaceReuse, round 8): an HTILE clear remembered while no depth surface used that HTILE clears the surface bound with it, but not after a page of that HTILE was replaced; a depth/stencil surface is resident over the last byte of its depth, stencil and HTILE planes (sizes written out in the test) and not past them.agc_flush_exclusion(round 8): after the first of two overlapping exclusions ends, another thread still cannot select pending images.agc_driver_frame_replay_sub_page_resets(round 8): an idle reset counts no workers.agc_driver_multisample_retirement(round 8): a target is resident over the last byte of its colour plane and CMASK and not past the CMASK.agc_driver_multisample_retirement(new case): 64 binds of a target leave the owner-walk count unchanged; the reset inventory walks once and lists the target once.agc_driver_frame_replay_single_sample_depth,agc_flush_exclusion,agc_driver_depth_plane_partial_store_*,agc_driver_sample_multisample_target,agc_driver_frame_replay_watched_existing(Linux),agc_driver_msaa_dcc_clear_2/4/8andagc_driver_native_depth_*keep the earlier cases.docs/dev/BUILD.mddescribes the reset, counters and tests;docs/dev/ENVIRONMENT.mdlists the test fault variable.Overlap with #15136 (thuanquang, open draft, frame capture serials and holds): not the same change. It touches the same places in
tools/FrameReplay.cpp(its--repeatloop inrun, where it also callsresetMemory, and the snapshot restore it moves intorestoreSnapshot),Execution/src/Driver/EntryPoints.cpp,tests/FrameReplay.cpp,tests/cmake/agc_driver_frame_replay_tests.cmakeanddocs/dev/BUILD.md, so the two will conflict textually in those hunks. #15136 changes what the replay waits on and when a delta is held, and itsresetMemorystill clears everyRangechunk and restores the whole snapshot. It does not add a retirement call, a page comparison, the transaction, the Linux watch registration or theDepthSurfaceandMultisampleTargetchanges here. Whichever lands second rebases onto the other; the reset in this PR replaces thatresetMemorybody.Overlap with #11436 (Sam-mon7, replay serial tracing): textual only. Both rewrite
tools/FrameReplay.cpp(restoreMemory,resetMemory,run, usage),tests/FrameReplay.cpp, the two frame_replay cmake files, the samedocs/dev/BUILD.mdlines, and both add declarations toDriver.hpp. #11436 only adds tracing and shares no runtime state with the reset, and it already conflicts withmainin the same files, so whichever lands second merges the replay tool by hand.Overlap with #15059 (Sam-mon7, thin-surface sizes): behavioural, small. It changes the bytes stored in
MultisampleTarget.cppguarded()entries toSurfaceGuestBytes.retireGuardedhere uses those bytes for its overlap and containment tests, so a smaller footprint shifts which replaced or unmapped ranges retire an owner. That is right as long asSurfaceGuestBytesis the true guest footprint; after combining, rerunMultisampleRetirementandagc_driver_frame_replay_multisample_depth.Tested
The head
025f5a150emergesmainb7aeb6f406into Dean's0523b51913(his merge ofmain2f8c843691).Texture.hppandTexture.cppconflicted only where both sides added a test hook besideSetPublishHookForTest(this PR'sSetFlushSelectedHookForTestandFlushExclusion,main'sSetPendingHookForTestfrom #18102); both are kept. #18102 makesmarkLayersPendingcollect through the memoized walk; the reset's candidates come fromGuestMemory::ChangedSince, which walks the write tracker itself, so the memo cannot hide a page from it.mainchanged nothing intools/FrameReplay.cppsince2f8c843691.On the merge, Linux (lavapipe):
ctest -R '^(agc_driver_frame_replay.*|agc_flush_exclusion|agc_driver_memo_pending_collect.*|agc_driver_multisample_retirement|agc_driver_sample_multisample_target|agc_driver_native_multisample_depth|agc_driver_depth_plane_partial_store.*)$'67 of 67 pass, none skipped; the same run withANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer(layer 1.4.363.1, sync validation on, no canary) passes 67 of 67 with 63Insert instance layerlines in the test output and 12 in the replay logs, no missing-layer line, 0VUID-and 0SYNC-HAZARDlines. ThreadSanitizer on the merge (-DANYPS5_ENABLE_TSAN=ON, no suppressions):_rewind,_rewind_chained,_rewind_page_start,_rewind_zero_control,_rewind_zero_control_parked,_rewind_in_orderand_rewind_kept_wordspass with no report._concurrent,_rewind_store,_rewind_copy,_rewind_compute,_rewind_release,_rewind_fill,_rewind_split,_wait_label,_fence_reuseand_busy_queuereport races on title labels and gates only:Pm4::WaitSatisfiedUnchecked's plain read against the replay's restores and guest-memory stores (the read #20185 makes atomic), and a guest-memory store against the replay's atomic label access. This PR does not touch those reads or stores. WinLibs GCC 15.2 under Wine (lavapipe through winevulkan): the replay tool and tests link, andagc_driver_frame_replay*plusagc_flush_exclusionpass 51 of 57; the six that fail (_relaunch,_submitstimeout,_single_sample_depthand_rewind_copyand_busy_queuesegfault,_rewind_releasetimeout) fail the same way under Wine on0523b51913, before the merge.Fork CI on
025f5a150e(run 43745440288): Linux 67 of 67 with the validation layer, 0VUID-lines. Windows (MinGW, lavapipe) 64 of 65;agc_driver_frame_replay_cold_pipelinesfails, as it does on base. The ThreadSanitizer results above are local.1713bb271ewasbcfaa35a4dmerged withmain7e3b8f4e82(no conflicts,a3def404ee), plus two commits:71ec91051e: the again pass stores a clear REWIND control atomically (above, withagc_driver_frame_replay_rewind_zero_control_parked).1713bb271e: drops the "REWIND controls copied with plain reads" debt entry, whichmainclosed:copySegmentrequires a two-dword REWIND and loads its control withatomic_ref.Linux (Ubuntu 24.04, lavapipe, Mesa llvmpipe LLVM 20.1.2) on
1713bb271e, before the merges:ctest -R agc_driver_frame_replay: 57 of 57 pass (agc_driver_frame_replay_rewind_copyfailed once under-j3load and passes alone 3 of 3; it fails the same way under load on other branches).ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layerwith layer 1.4.363.1 andVK_KHRONOS_VALIDATION_VALIDATE_SYNC=1,ctest -R '^agc_driver_frame_replay(_rewind.*|_multisample_depth)?$' -V: 15 of 15 pass, 29Insert instance layerlines in the test output and 12 more in the replay logs the tests write, no missing-layer line, 0VUID-and 0SYNC-HAZARDlines in either. No sync canary ran, so this is not a synchronization-validation claim.-DANYPS5_ENABLE_TSAN=ON, no suppressions):_rewind,_rewind_chained,_rewind_page_start,_rewind_zero_control,_rewind_zero_control_parked,_rewind_in_orderand_rewind_kept_wordspass with no report.On this head,
025f5a150e, Windows 11 Pro, NVIDIA GeForce RTX 3080 (driver 621.24), built with #20845 merged locally so the GTA picture is upright onmainafter #16053:ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer,ctest -R '^(agc_driver_frame_replay.*|agc_flush_exclusion|agc_driver_memo_pending_collect.*|agc_driver_multisample_retirement|agc_driver_sample_multisample_target|agc_driver_native_multisample_depth|agc_driver_depth_plane_partial_store.*)$': rc 0, 0VUID-lines in the test output and in the 62 replay subprocess logs.--cold-pipelines --no-synthesize, five normal runs, and--repeat 5 --verify-reset. All seven exit 0 withpixels_identical1.000000, max channel diff 0, 0 pace timeouts, 0 released waits, 0 synthesized and 0VUID-lines. Replay time is 62.3 s cold and 19.6 to 24.4 s warm.The results below are from
3c06fa7a51and were not rerun on this head.Head
3c06fa7a51(commitsb0c0014548,68a50d7b94,3c06fa7a51) on main3e7b406e9c;mainis nowf35f1e5eca, which changes only an unrelated line ofdocs/dev/debt/libSceAgcDriver.mdamong this PR's files and merges cleanly. The Vulkan gate and the mutants of rounds 1 to 8 below ran on68a50d7b94; the third commit changesrestoreGroupintools/FrameReplay.cpp, one check inAgcDriverGuestMemoryTransaction, tests and a debt entry, and on3c06fa7a51the Linux gate, TSan, the localframe_replaytests and rk3 were run again. Windows 11 Pro, NVIDIA GeForce RTX 3080 (driver 621.14), AMD Ryzen 7 5800X.AGENTS.md Vulkan gate, same machine and GPU,
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, one pattern for both (the replay, recorder, depth plane, native depth, multisample, collect and write-tracking tests plus the new ones): main 288/288, this PR 296/296 on68a50d7b94, 0VUID-lines (including the replay subprocess logs) and no missing-layer line in either.Fork CI on lavapipe with the validation layer, same pattern on base and ref, which includes
agc_flush_exclusion,guest_memoryandwindows_write_watch(run 42503822968,3c06fa7a51). Linux: base3e7b406e9c266 passed (16 skipped), PR 279 passed (16 skipped), no VUIDs (replay logs included), no missing-layer line, nothing failing on ref only. Windows (MinGW, Mesa lavapipe, LunarG layer): base 265 passed, PR 275 passed, everyagc_driver_frame_replaytest of this PR andagc_flush_exclusionpass, no new VUIDs;agc_driver_frame_replay_cold_pipelines,agc_driver_msaa_dcc_clear_4,agc_driver_recorderandguest_memoryfail on both sides.agc_driver_native_depth_clearsand_separate_stencilhit the 30 s timeout on the PR side only, on a runner 1.72 times slower than the base one (geometric mean over the 56 tests that passed on both); run alone (run 42508355406) both pass on both sides (base 21.6 s and 28.6 s, PR 18.2 s and 22.8 s), and on the RTX 3080 they take the same time onmainand this PR (1.81 s and 1.83 s, 1.04 s and 1.03 s). TSan, run 42503822968: everyagc_driver_frame_replaytest of this PR passes with no report, the rewind ones included; the failures are the ten that fail under TSan onmain(agc_driver_frame_replay_blocking,_concurrent,agc_driver_pm4,_pm4_replay,_pm4_rewind_trace,_pm4_stall_watchdog,agc_driver_graphics,_graphics_maps_fallback,agc_graphics_profile_draw,agc_driver_recorder),agc_driver_pm4_replay_tool, which does not run becauseagc_driver_pm4_replayfails, and one TSan warning inagc_driver_pm4_stall_prompt_real, which passed 31 of 31 runs under TSan on bothmainand this PR (run 42504682283, run 42504690727). Local RTX 3080,ctest -R frame_replaywith the validation layer on3c06fa7a51: 33/33, 0VUID-lines.Round 10 mutants of
restoreGroup, each built with TSan on fork CI and run 11 times per rewind test, all killed: the release stores moved into the per-chunk loop (_rewind,_rewind_chained,_rewind_in_orderfail 11 of 11; run 42502221691); the first-dword rule dropped (_rewind_page_start11 of 11; run 42502233966); the parked words stored in address order with the rest (_rewind,_rewind_chained,_rewind_in_order11 of 11; run 42502246723); each group restored at most once per pass (_rewind_in_order11 of 11, a wrong label, not a race; run 42502258941). Without TSan, on the local RTX 3080, only the last fails (3 of 3); the other three are races that a plain build does not show.Red first, on the RTX 3080, one line reverted each:
agc_driver_frame_replay_multisample_depthfails ("a guest memory transaction ended without failing although a submission was accepted inside it") without the transaction's accepted-serial check;agc_driver_frame_replay_partial_walkfails when a failed walk is trusted;agc_driver_frame_replay_large_rangefails ("on fewer than two threads") with one worker and with ranges not split into pieces;agc_driver_frame_replayfails with--verify-reset("guest memory at ... differs from the captured contents after the reset") when the written pages are left out of the candidates, and passes with the same mutant without--verify-reset, so the flag is what catches it.Mutants on this head, fork CI on lavapipe, one patch each, same tests (run 42487045268), all 20 built and all 20 killed: no accepted-serial check (
_multisample_depth); no split into pieces and one worker (_large_range); no written pages among the candidates (agc_driver_frame_replayand others); no walk-failure fallback (_sub_page_resets,_partial_walk); no retirement over pages the flush added; no HTILE in a colour footprint; single-sample targets not checking the stencil plane; no mapping check; verifier without the owner checks; rewriting every owner page regardless of equality; skipping inactive depth surfaces; prefix-key HTILE forget; whole-range candidates; and the six round-8 mutants: GPU-owned ranges left out of the candidates (_untouched_gpu_owner); deferred HTILE clears kept over replaced pages (agc_graphics_profile_draw); a single-bool flush exclusion (agc_flush_exclusion); empty pieces kept (_sub_page_resets); a stencil footprint one page short (agc_graphics_profile_draw); a CMASK footprint one byte short (agc_driver_multisample_retirement).The same six round-8 mutants were also killed one at a time on the local RTX 3080 build. The three new red tests also fail on the round-7 code.
GTA V (PPSA04264) capture rk3, 3 frames, 9,364 draws,
--repeat 5 --verify-reseton the RTX 3080, this head3c06fa7a51: rc 0,pixels_identical1.000000, max channel diff 0,delta_mib20169.7 as one907e3d53b.e907e3d53bThe held words added by this round (at most one per chunk, plus every dword after a REWIND header) do not show in the replay time.
The compare now rewrites a differing page from the window it just decoded instead of decoding it again in a second pass. A/B on the same build and capture, back to back, two runs each, passes 3 to 5: round-6 tool (separate compare and restore, 64 MiB pieces) 590 to 678 ms reset; fused with 64 MiB pieces 402 to 438 ms; fused with 16 MiB pieces 426 to 445 ms, with verify 1.19 to 1.26 s against 1.25 to 1.32 s. All six runs rewrote the same bytes with identical pixels; replay passes were 10.19 to 10.56 s in all of them, so the pass time does not depend on either change. The 64 MiB piece is kept.
The product submission path is unchanged:
Submission.cppis identical tomain, so the per-submit cost of round 6 (two sequentially consistent read-modify-writes perSubmitandSuspendPoint) is gone.Not covered: a submission or mapping change during the transaction is only detected afterwards (debt entry).
python3 tools/check_conventions.py --base origin/main: all checks passed.python3 tools/pr_overlap.py --branch fix/replay-repeat-msaa-depth-v3failed closed: no open PR conflicts textually with this branch, and 91 could not be compared because they conflict withmain; the three that overlap in purpose or behaviour are described above. The PRs new since round 6 that share files (15455, 15456, 15529, 15548, 15621, 15806, 15807, 16260) do not touch the transaction or the reset.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 MarcZX10 on 2026-11-16T17:06:33Z.
Review: COMMENTED
Reviewed — comments
The prepared bundle describes a substantial replay reset and rewind race fix; I reviewed only part of the changed source, so a formal approval or change request is not justified.
What I ran
Read the prepared description, commits, manifest, and initial diff excerpt. Read lines 1–200 of
tools/FrameReplay.cppat the pinned head. No tests or commands were run.Results
Findings
Blocking
None verified.
Non-blocking
None.
Not verified
Most of the diff and changed files were not read. The changed files listed in the manifest include
core/libs/prx/libSceAgcDriver/Execution/include/Driver.hpp,core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp,core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp,core/libs/prx/libSceAgcDriver/Execution/src/Driver/EntryPoints.cpp,core/libs/prx/libSceAgcDriver/Execution/src/Driver/Lifecycle.cpp,core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp,core/libs/prx/libSceAgcDriver/Graphics/include/DepthSurface.hpp,core/libs/prx/libSceAgcDriver/Graphics/include/MultisampleTarget.hpp,core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp,core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp,core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp,core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp,core/libs/prx/libSceAgcDriver/tests/DepthSurfaceReuse.cpp,core/libs/prx/libSceAgcDriver/tests/FrameReplay.cpp,core/libs/prx/libSceAgcDriver/tests/FrameReplayState.cpp,core/libs/prx/libSceAgcDriver/tests/Recorder.cpp, the three listed frame replay and recorder CMake files,core/libs/prx/libSceAgcDriver/tests/execution/AlphaToCoverage.cpp,core/libs/prx/libSceAgcDriver/tests/execution/DepthPlanePartialStore.cpp,core/libs/prx/libSceAgcDriver/tests/execution/MultisampleRetirement.cpp,core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp,core/libs/prx/libSceAgcDriver/tests/execution/SampleMultisampleTarget.cpp,core/libs/prx/libSceAgcDriver/tools/FrameReplay.cpp, the listedlibcguest allocation and write-watch headers and sources, and the three listed development documentation files.Texture.cppandRecorder.cppwere excluded from the prepared full-text bundle; neither was read through the reader. Only lines 1–200 oftools/FrameReplay.cppwere read. The repository head is24b9c1bbe126700ca07e3e48fa915d2e0ca65a8f.To get this to a good state
Nothing is required. Optional: complete the targeted source review and run the relevant checks before making a formal decision.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-17T16:04:40Z.
Review: COMMENTED
Replay reset and rewind fixes — no blocking findings
Nothing blocks this; the points below are optional.
What I ran
28e7214eb247bb3aa2c489d4a621f8c2fdcf7ce9, basemain.description.md,commits.md,manifest.json,files.jsonand the fulldiff.patch.files/was not opened.Results
files/not opened; about 12 reader spans and searchesrestoreGroupcallers run undermemoryMutex//comments in added linesExcluded by size in the manifest:
Graphics/src/Texture.cppandtests/Recorder.cpp. Only their hunks were read.Findings
Blocking
None.
Non-blocking
core/libs/prx/libSceAgcDriver/tools/FrameReplay.cpp:444: for each page that differs,restoreDifferingscans the whole owned list withstd::any_ofto addownedBytes. The cost grows with pages times owner ranges. Not measured. A smaller cost: sort the owned runs once and advance a cursor across each window.core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp:1273: the description says single-sample clears are dropped "over every inactive multisampled colour plane it removes from the guarded list". The code adds a removed entry toretiredonly whenmetadataValidis unset. I did not establish whether a removed entry withmetadataValidcan still carry a recorded clear. Either the text or the condition should be made to match.Not verified
FlushExclusion, the depth guard, the surfaces mutex and the HTILE read memo.RetireReplacedDepthtakes the GPU lock, then the surfaces mutex, then the HTILE read mutex. I did not check the other paths that take these.clearedHtiles()in the newerase_ifinRetireReplacedDepth(Graphics/src/DepthSurface.cpp) against its other users. I saw the uses, not their locks.AgcDriverGuestMemoryTransactionwaits for device idle while it holds the GPU lock. I did not check whether any completion path needs that lock.PAGEMAP_SCANand userfaultfd behaviour. Not checked on this machine.To get this to a good state
Nothing is required.
Optional: the two points under Findings.