fix(agc): hash an idle unit when its range leaves the write watch instead of at every upload #10026
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10026"
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 winstrex on 2026-10-23T05:03:40Z.
This PR's own commits, without #7048's below them: ec6ceece9, f27fcde50 and d73e64951.
What
#7048 stores results that land in a unit over memory that has left the write watch, as long as the unit's bytes still match what was uploaded. For surfaces over 1 MiB it checks this against a per-unit hash, which
upload()takes on every settled upload. That pass reads and hashes the whole surface each time. On The Pathless (PPSA01825) menu it costs about 70 % of the presents, with 89 % of the draw committer's samples inStorageTexture::upload. The hash is only read inmarkLayersPending, for a unit with a write generation, no saved bytes and a range that is no longer watched.This PR takes that hash once, when it can be trusted and is about to be needed: when the unit's range leaves the watch. This is the shape @oneandonlydean described in #7048. The first commits here are #7048's own, followed by a merge with
mainthat resolves #7048's conflict with it (described below). This PR's change is the next commit,ec6ceece9. A second merge withmainon top of it adapts that change tomain's tracker lock,f27fcde50makes the refusal name its cause,d73e64951corrects the debt entry, and a third merge withmain(2853a75c1) resolves a conflict with #9159 (all below).StorageTexture::SaveBeforeUnwatch) also visits the live textures over 1 MiB that overlap the range. For each unit there with a write generation, no pending results and no saved bytes, it collects the range's writes. If the watch shows no write since that generation, it records a 128-bit hash of the unit's bytes together with that generation.upload()andrefreshno longer hash anything.markLayersPendingcaptures such a unit only while its bytes still match the hash and the hash's generation is still the unit's. With no hash, or a mismatch, it refuses, as it does now. Surfaces of 1 MiB or less keep comparing with the copy taken at the upload, so the hook doesn't visit them.ImportWatchednow runs the hook over the two spans of an import that stays watched which left the watch without it: a span whose page walk fails before the import (the hook runs before the import) and one whose walk fails after it. These are the spans #7505 covers. Whichever of the two lands second drops itsGuestMemory.cpphunk.MarkWritten(UnwatchWritesProven). A unit there has no baseline, and its capture is refused, as before.GuestWriteWatchUnregistercalled from libkernel on Linux when a mapping is aliased, unmapped or replaced. On Windows there are none: the host regions are fixed when the guest arena is reserved, the commit generation only decides when a later commit restores the watch, and every path that takes a range out of the watch runs the hook (d73e64951drops the Windows case I had listed). Taking the Linux case through the hook touches libkernel and is left for a separate PR. The new debt entry "Units without a baseline outside the write watch" lists them. A unit there has no hash, so results that land in it outside the watch throw when they are stored, as onmain.SetImportWalkFailureForTestlets the tests fail either walk on both platforms.The refusal names its cause (
f27fcde50, after @zaidhawk's Persona 3 Reload run below). What is captured and what is refused don't change. The refusal now ends with the first unit refused and why it has no baseline, for example(unit 63 of 64: its range left the watch through the unwatch hook without its CPU writes proven (a failed collect or import page walk)). The causes:The hook records why it didn't hash a unit next to the hash, with the generation it applies to. To record the unproven case it now also visits the live textures over 1 MiB when the CPU writes aren't proven. That path takes
GpuMutexwhen one of them overlaps, and it only runs after a failed collect or a failed import page walk.A wait I found and fixed while measuring. In the first version, the hook took
GuestMemory::GpuMutexwhenever the range overlapped any live texture. Onmainit only takes it when a texture with pending results overlaps. During The Pathless's menu that happened hundreds of times, and the thread doing the unwatch waited for the draw committer to release the mutex: 296–316 presents per 10 s againstmain's 315–336. The hook's own code didn't show in the samples, because the cost was the wait. The hook now visits only textures over 1 MiB, the same limit as #7048's hash. Those are the only ones a hash is ever taken for, so in The Pathless it takes the mutex no more often thanmaindoes.What the hook costs. A local counter that is not part of this PR, over the menu of each title:
ImportWatchedexits were never reached.Merge with
main. Sincec0dbd1871c(perf(agc): draw finisher pipeline), #7048 conflicts withmaininStorageTexture::markLayersPending:mainreworked the loop that #7048 changes. Until #7048 is rebased, this branch carries a merge of #7048's headda9f0ead4withmaine3d03fbae6(93c878b36):main's structure (unsavedstarts empty, theCommitTrims()prefilter, thenassignand the full loop), with #7048's condition in the full loop. The prefilter checksnoBaseline && (layerGeneration == 0 || savedTicket == 0), which every unit #7048's condition selects passes, soAPS5_DRAW_PIPELINEdoesn't change which units are captured, and the byte comparison still runs only in the full loop. The merge also keepsGenerationBaselineByteswhere #7048 moved it;maindeclared it a second time next to its newSingleKeyColorFor.guestMatchesUploadtoguestMatchesBaseline, on the line of the full loop that #7048 changes.main9d164f0d87(df1b2d5e9): #6169 (answer a collect memo hit with the generation of the last finished tracker update) madelockTracker()returnTrackerLock, which has nounlock()/lock(). This conflict is entirely in this PR's part.markWrittenand theleavelambda inImportWatchednow release the tracker aroundbeforeUnwatchUnprovenwithSuspend()andResume(). Git merged theImportWatchedlambda without a conflict, but it no longer compiled.TrackerLock::Unlock()is not used here, because it publishes the generation, and both paths stamp blocks again after relocking; #6169 releasesmarkWrittenthe same way. @eliasbruno124-dev reached the same adaptation and tested it on an RTX 3060 Laptop GPU (comment).maincf528e78c6(2853a75c1): #9159 (keep a rewatched import's memory compared once it is shared) marks each span ofImportWatchedwhose page walk succeeds as compared once it is shared, on Windows, in the loop where this PR takes a span whose walk failed out of the watch through the hook. Both are kept: a span whose walk fails goes throughleaveand is skipped, and a span whose walk succeeds is marked withGuestArenaCompareResidentWhenShared, as onmain. #9159 doesn't add a way out of the watch without the hook. Marking a page compared stops arming its shared aliases but leaves the range covered, and a walk that is refused because of compared pages now stamps them and records them as refused, whichUnchangedSincereports as changed. For this PR that can only turn a hash into the "watch saw CPU writes" skip, never bypass the hook. I counted the hook's decisions with local counters that aren't part of the PR. In the write-watch, storage image and import tests, #9159's included, onlyagc_storage_pending_after_unwatchreaches a hook decision, and none of its decisions came from a refused walk; its one CPU-writes skip is the case it makes on purpose. In a run of The Pathless's menu the hook decided for no unit at all.main4017310678(b61555e17): the only conflict was indocs/dev/debt/libSceAgcDriver.md, where #9275 added an entry under the one this PR rewrites. Both are kept: this PR's two entries, then #9275's unchanged.mainf55190f7e3(90be5898c), for the conflict with #9685 (store resident linear color targets at completion points, limited to their drawn rectangles) inTexture.cpp. #9685 gives a pending unit a generation per 64 KiB block (unitBlockGeneration), raised where a completion store wrote, and no longer refuses a unit without a baseline in a target with drawn rectangles. Both are kept:markLayersPending: this PR's capture with its baseline causes stays where it is, and #9685's loop that clears the blocks' completion generations replaces the one that marks the units pending.saveBeforeUnwatch: this PR moved the written-block check intokeepWrittenSince, whichcaptureGuestBytesalso calls. #9685's per-block generations are now inkeepWrittenSince. Its other caller runs before the units are marked pending, whereunitBlockGenerationreturns the unit's generation, as before.unknown && !drawn.rect), with this PR's cause inside it. The units #9685 no longer refuses need no cause.agc_driver_linear_target_cpu_writes: the target's memory leaves the watch after the draw that records its rectangle, so the hook runs over the pending rectangle before the completion store, and the store must still keep the drawn half and the CPU's later stores to the other half.main27ad7244d2(339783405), for the conflict with #7505 (run the unwatch hook before an import whose range leaves the write watch whatever the import does), which runs the hook for every range that leaves the watch, as this PR does:ImportWatched: this PR's version is kept. #7505 runs the hook of a span whose window walk fails inside the loop over the window walks, with the tracker lock suspended, so another thread can collect a later span before its window walk. That is the race @ahmadmuj found in this PR'sb61555e17, now onmain. Here every window walk finishes before the failed spans' hooks run under one suspension, andCheckImportWalkHookKeepsLaterWindowsreproduces the race. The rest ofmain's changes to the file, such as #10369'simportMayWriteGuest, merged without a conflict.tests/WriteTracking.cpp: both sides are kept.main()runs this PR'sCheckImportWalkUnwatchHooksandCheckImportWalkHookKeepsLaterWindowsand #7505'sCheckUnwatchHooks, which passes on this head.docs/dev/debt/libSceAgcDriver.md: this PR's first entry, with #7505's "or whose page walk fails" in its parenthesis, and its second entry unchanged. #7505's last two sentences are dropped: the second entry covers the units without saved bytes that they describe.maincda9c9bedf(bfe0e86a3), for the conflict with #10655 (hash the pages of an import window on several threads) inImportWatched.main's hashing is kept (CheckRangeover the spans, thenHashPages), still under the tracker lock and before the first page walks, and so are this PR'sfailsWalkandleave. #7505'ssaveBytesstays out, as in the sixth merge. #10655's tests are inagc_write_tracking.Tested
Windows 11 (10.0.26300), NVIDIA GeForce RTX 5070 Ti, driver 591.86, WinLibs GCC 15.2.0 r7, Release, with Overwolf's implicit Vulkan layers disabled. All three builds are on
main83462cc57:mainitself,mainmerged with #7048's headda9f0ead4(e2c1fe440), andmainmerged with this PR's head (4989cab12). The merges are local and clean.The Pathless (PPSA01825), main menu:
main319–326 presents per 10 s,main+ #7048 85–105,main+ #7048 + this PR 307–316. TwoAPS5_TRACE_SECONDS=120:10captures per build, alternated, noAPS5_PROFILE_*.Measurements
mainmainGraphics.Drawper frame (ms)Isolation: #7048 with its upload hash turned off locally and without this PR's hook (
hashUnits = false, a dirty local tree, alternated with two moremainruns) gives 314 and 316 presents on average (windows 316 and 328), against 321 and 322 formain(windows 319 and 319). So the 2–4 % left betweenmainand the two PRs together comes from the rest of #7048, not from the hook.APS5_PLAYGO_UNLISTED_CHUNKS=absent, warm caches,APS5_TRACE_EVENTS=1048576so no thread dropped events, andAPS5_TRACE_SUMMARY_EVERY=10. The traces are inpathless-traces-main-83462cc57.zip,pathless-traces-main-7048-e2c1fe440.zip,pathless-traces-pr-4989cab12.zipandpathless-traces-isolation-7048-no-upload-hash.zip.aps5-summary.jsonl,main,main+ #7048, thenmain+ #7048 + this PR:tools/trace_digest.py,main:p99 ms :%@::::--------- 0-228.4
gpu ms ._@@@@@@@@@@@@@@ 0-18.1
tools/trace_digest.py,main+ #7048:p99 ms _.@::::::::::: 0-488.5
gpu ms ..@%%%%%%%%%%% 0-20.4
tools/trace_digest.py,main+ #7048 + this PR:p99 ms :@%------------ 0-191.5
gpu ms ..@%@%@@@@@@@@@ 0-19.2
#7017's refusal on The Pathless: 60 s runs, alternated.
mainstopped onstoring storage image results pending over memory outside the write watch without the guest bytes saved before them is not implementedin 3 of 8 runs, 8 to 10 s in.main+ #7048 + this PR stopped in none: 0 of 7 runs with the hook's first version (before the 1 MiB limit) and 0 of 6 with this head.LEGO Horizon Adventures (PPSA14632) and Hades (PPSA03355): one run per side,
mainagainstmain+ #7048 + this PR. LEGO's loading screen gives 57–65 presents per 10 s against 63–65, and its menu 29–33 against 30–32. Hades gameplay gives 295–330 against 296–336. No refusal in any run. These two ran with the hook's first version; the 1 MiB limit only narrows the textures it visits.Persona 3 Reload (PPSA10872): I don't have it. @zaidhawk ran
df1b2d5e9on an RTX 5090 (comment): the start-up screens and the opening animation are back atmain's rate (596–600 presents per 10 s, against 117–122 with #7048 alone), but 1 of 5 runs stopped on the refusal, which #7048 alone didn't in 5. Its log doesn't say which case it was;f27fcde50adds that to the message. They rand73e64951again with 120 s runs (comment): 0 of 10 runs stopped on the refusal, against 2 of 5 onmain9d164f0d8and 0 of 5 withmain+ #7048, so there is no cause line yet. Over both sessions this PR stopped in 1 of 15 runs, #7048 alone in 0 of 10 andmainin 4 of 10. The start-up screens stayed at 594–596 presents per 10 s with this PR, against 120–122 with #7048.Tests:
agc_storage_pending_after_unwatchchecks the cause named in every refusal, with three new cases: the last block leaves the watch without the hook (refused at 1024×1024 for having no hash; stored at 256×256, which compares with the upload copy), the same while the results are pending (refused in both sizes), and a failed collect, on Windows (refused at 1024×1024 as unproven; stored at 256×256). Recording the wrong cause in the hook makes it fail.agc_storage_pending_after_unwatchpasses in both sizes (256×256 through the upload copy, 1024×1024 through the hash). New case: a CPU write into the last block while it is still watched, before it leaves the watch. The unit then has no baseline, and the capture is refused in both sizes with the CPU's bytes kept. The existing case with a CPU write after the unwatch, which is after the baseline, is still refused at 1024×1024.agc_write_tracking:CheckImportWalkUnwatchHooksreaches bothImportWatchedexits throughSetImportWalkFailureForTest. It checks that each runs the hook once while its block is still watched, before the import for the first exit and after it for the second, and with the CPU writes reported as not proven. It also checks thatUnwatchreports them as proven.CheckFailedCollectUnwatchnow also checks that a failed collect reports them as not proven.CheckImportWalkHookKeepsLaterWindowsfails the walk of only the first of two spans after the import, and its unwatch hook collects the second span while the lock is suspended, as another thread could. It checks that a page the import touched there without changing it still reads as unchanged, with its window walk's possible CPU touch. It fails onb61555e17and passes from43a9245e8.baselineMiss. A unit whose content changes through this emulator either has its hash forgotten (write-back, clear, alias borrow) or no longer matches it, so that check only refuses earlier.agc_storage_pending_after_unwatchno longer requires any case to be refused, so an implementation that stores these units safely still passes. It checks the cause named in a refusal, that a refused write-back leaves the CPU's bytes as they were, and that a store merges the GPU's texels with the CPU's bytes. Four new cases write the CPU's bytes into the last unit after GPU results that cover part of it were written: into the hashed unit, before the unwatch, after an unwatch without the hook, and before an unwatch through a failed collect. Accepting any of them would store the image's older bytes over the CPU's, and the byte checks catch it. Ignoring the hash or the upload copy, hashing a unit the watch saw written, or taking a missing hash for a baseline now fails on the bytes. Hashing after a failed collect is caught by the cause instead: the next collect still sees the CPU's write, so the hook refuses the unit for that write. A write the failed collect loses for good, which the test can't produce, is the case where it would store the wrong bytes.Validation layer: the write-watch, storage image, import, draw, recorder and VideoOut tests pass on
main83462cc57(59) and onmain+ #7048 + this PR (60,agc_storage_pending_after_unwatchincluded), with noVUID-messages on either side. They ran withVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,ANYPS5_NO_SHADER_CACHE=1andANYPS5_REQUIRE_VULKAN=1, and neither log haswas not found but was requested by env var VK_INSTANCE_LAYERS. The set isctest -V -R '^(agc_write_tracking.*|agc_storage_.*|agc_import_.*|agc_driver_store_over_untracked.*|agc_unit_shadow|agc_metadata_pass|agc_slice_dirty|agc_resident_present|agc_tiled_resolve|agc_queued_write_groups|agc_driver_graphics|agc_draw_.*|agc_recorder_.*|agc_driver_flip.*|video_out_flip_.*)$'.After the merge with
maine3d03fbae6, atec6ceece9, with NVIDIA driver 610.88:maine3d03fbae6(59) and on this head (60), withAPS5_DRAW_PIPELINEunset and set, with noVUID-messages on either side.APS5_TRACE_SECONDS=120:10control run per side: the menu's 10 s intervals give 327–330 presents onmainand 324–329 on this head.After the second merge, with
main9d164f0d87, atdf1b2d5e9, with NVIDIA driver 610.88:main9d164f0d87(59) and on this head (60), withAPS5_DRAW_PIPELINEunset and set, with noVUID-messages on either side.APS5_TRACE_SECONDS=120:10control runs per side, in alternated order: the menu's 10 s intervals give 303–313 and 299–318 presents onmain, and 293–307 and 302–320 on this head.After
f27fcde50, with NVIDIA driver 610.88 (d73e64951above it only changes the debt entry):f27fcde50(60) withAPS5_DRAW_PIPELINEunset and set, with noVUID-messages;main9d164f0d87passes its 59 the same way (above).APS5_TRACE_SECONDS=120:10control runs per side, alternated withmain9d164f0d87: the menu's 10 s intervals give 290–305 and 287–321 presents atf27fcde50(one interval of 260 in the second run), and 289–313 and 281–304 onmain. No refusal in any run.After the third merge, with
maincf528e78c6, at2853a75c1, with NVIDIA driver 610.88:agc_rewatched_.*,agc_compared_.*,agc_driver_compared_.*andagc_driver_partially_resident.*), passes onmain(70) and on this head (71), withAPS5_DRAW_PIPELINEunset and set, with noVUID-messages on either side.APS5_TRACE_SECONDS=120:10control runs alternated withmaincf528e78c6: the menu's 10 s intervals from 20 s on give 332–345 and 308–360 presents on this head, and 342–358 and 351–363 onmain.mainstopped on the refusal in 1 of its 3 runs, and this head in none of its 3, nor in the one below. One more run of this head ran at 171–179 from start to end, withDriver.Packetat 54 ms per frame against 29 in the others; the same build gave 332–345 in its next run, so I've left that run out.ctestsuite with the GPU (--parallel 4 --timeout 120): 2278 of 2289 pass and 7 are skipped. The other 4 (log_macros,log_macros_timestamps,agc_host_import_cut_lifetimeandagc_driver_depth_plane_partial_store) fail the same way onmaincf528e78c6.After the fourth merge, with
main4017310678, atb61555e17, with NVIDIA driver 610.88:main(72) and on this head (73), withAPS5_DRAW_PIPELINEunset and set, with noVUID-messages on either side and the layer loaded.2853a75c1.After the fix for the import walk hooks, at
43a9245e8, with NVIDIA driver 610.88:main4017310678(72) and on this head (73), withAPS5_DRAW_PIPELINEunset and set, with noVUID-messages on either side and the layer loaded. In one run,mainwithAPS5_DRAW_PIPELINE=1failedagc_write_tracking_metadata_commit(an untouched leaf has a write stamp); it passed 5 of 5 reruns on each side, and this branch doesn't change what it tests.2853a75c1.After the fifth merge, with
mainf55190f7e3, atcfbe00cb4, with NVIDIA driver 610.88:main(72) and on this head (73), and #9685'sagc_driver_linear_target_*andagc_driver_address_passes_*tests pass on both (13), withAPS5_DRAW_PIPELINEunset and set, with noVUID-messages on either side and the layer loaded. The new case passes seeded and unseeded.ctestsuite with the GPU (--parallel 4 --timeout 120): 2363 of 2375 pass on this head and 7 are skipped. The other 5 (guest_wide_formatting,log_macros,log_macros_timestamps,agc_host_import_cut_lifetimeandagc_driver_depth_plane_partial_store) fail the same way onmainf55190f7e3.public_headerstimed out at 120 s on both sides, leaving its 64 compile tests not run; rerun on their own with--timeout 1800, all 65 pass on both, in 53 s.video_out_flip_overlayfailed onmainonly, with an overlay's implicit Vulkan layer loaded, and passed when rerun with that layer disabled.APS5_TRACE_SECONDS=120:10control run per side at 3840x2160, because #9685 changes how render targets are stored: the menu's 10 s intervals from 30 s on give 359–374 presents onmainand 375–401 on this head. No refusal in either run.43a9245e8, before this merge; the import walk change it covers is unchanged.After the sixth merge, with
main27ad7244d2, at339783405, with NVIDIA driver 621.01:agc_driver_linear_target_*andagc_driver_address_passes_*tests without the one that flips, passes onmain(66) and on this head (67), withAPS5_DRAW_PIPELINEunset and set, with noVUID-messages on either side and the layer loaded. That includes #7505'sCheckUnwatchHooksinagc_write_tracking.After the seventh merge, at
bfe0e86a3, with NVIDIA driver 621.01, againstmainad622fc18d:agc_copy_guest_bytes, passes onmain(72) and on this head (73), withAPS5_DRAW_PIPELINEunset and set, with noVUID-messages on either side and the layer loaded.Full
ctestsuite atf27fcde50(--parallel 4 --timeout 120): 2026 of 2036 pass and 5 are skipped. The other 5 (log_macros,log_macros_timestamps,agc_driver_sample_order,agc_driver_sample_order_grid_referenceandagc_driver_sample_order_recipe_depth_locations) fail the same way onmain9d164f0d87.The fork's CI wasn't run: its runner has no Vulkan device and skips the GPU tests.
tools/check_conventions.pypasses againstmain.tools/pr_overlap.py: #7505 and #9159 touchImportWatched; #7505 is described above, and #9159 only neighbours its lines. The other entries (#6108, #6848, #6946, #7642, #9275, #9508, #9565, #9898) come from #7048's own changes, which this branch carries. #10886 builds on this PR (Depends on: #10026) and keeps itsmarkLayersPendingscan inside itsAllInguard.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)main, 0 of 13 with both) and its menu runs at 307–316 presents per 10 s instead of #7048's 85–105 (main: 319–326)pathless-traces-isolation-7048-no-upload-hash.zip
pathless-traces-main-7048-e2c1fe440.zip
pathless-traces-main-83462cc57.zip
pathless-traces-pr-4989cab12.zip
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-23T05:09:07Z.
Review: APPROVED
Reviewed the stacked diff through d6138938c, including the declared dependency #7048. The follow-up replaces the per-upload hash with a hash captured at a proven write-watch transition, gates it by the write generation, and invalidates it on writes/refreshes; the focused tests cover the tested import-walk failure paths and pending-result behavior. The PR reports same-machine Pathless measurements in which #7048 alone regresses from 319–330 to 85–104 presents/10s and the combined stack returns to 304–316; those are the author’s Windows captures, not a local reproduction. Local diff whitespace, conventions, and test-registration checks pass. I could not run the focused AGC executable here: the available pre-existing binary aborts before test startup because this host lacks LZCNT, BMI1, BMI2, MOVBE, and AVX2. Hosted product jobs are skipped by the current workflow policy. Please preserve the dependency/merge order so #7048 is not delivered without its performance correction.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-23T06:06:35Z.
Review: CHANGES_REQUESTED
I reviewed exact head
d6138938c99c24a21b6dce947cf6cb31e0d9a89e. The change is correctly declared as depending on open #7048, and its author-provided test/performance report is unusually detailed. Localgit diff --checkandpython3 tools/check_conventions.py --base upstream/mainpass. The hosted eligibility, intake, conventions, labels, and report checks pass; hosted Linux and Windows product builds are skipped by repository policy. I could not run this Windows/GPU test suite locally.I am requesting changes because the branch no longer merges cleanly into current
main.python3 tools/check_main_sync.py --base upstream/mainreports 9 commits ahead / 1,079 behind and a merge conflict incore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp; it also identifies eight changed files modified on both sides since the merge base. The repository's build guidance requires current-main builds and a clean merge before review/merge, so the reported tests and performance comparison against83462cc57do not validate the current merge result.Please rebase onto current
main, resolve theTexture.cppconflict while preserving intervening changes, then rerun the focused write-watch/storage-image tests and the same-scenemainversus rebased-PR comparison. Please include the exact tested heads and refresh the trace summaries/digests if the rebase changes the tested result. This request is for the concrete merge conflict and stale validation base; it is not about queue size.Imported from boykopovar/AnyPS5. Originally posted by ahmadmuj on 2026-10-25T14:38:40Z.
Review: COMMENTED
Reviewed head
b61555e17merged locally onto main3a2c51afd(clean). I ran it on Linux: WSL2 Ubuntu 24.04, GCC 13.3, lavapipe (Mesa 25.2.8), with the Khronos validation layer loaded. As far as I can see, this is the first Linux run of this stack.What I ran:
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1andAPS5_DRAW_PIPELINEunset and=1. The merge passes 56/56 and main 55/55, both ways. Both sides skip the same 18 tests: thevideo_out_flip_*ones,agc_import_settle_initial_dcc,agc_storage_clear_hand_overandagc_unit_shadow. The only VUID on either side isVUID-VkDeviceCreateInfo-pNext-pNext, which comes from my older local layer.agc_storage_pending_after_unwatchreally runs on lavapipe. Host imports are on, so it doesn't skip. It passed 3/3 alone with the layer. On Linux it runs 16 cases, becauseUnprovenUnwatchis Windows-only.Recorder.cppand CMake entry over main's production code. It fails on the first case with #7017's refusal.tools/check_conventions.py --base 4017310678passes.hashBeforeUnwatch, I checked whether a CPU write that lands betweenUnchangedSinceand the hash read could get lost. I injected such a write locally and stored a 16x16 partial result. The CPU's bytes survive, so I see no issue there.One thing in
ImportWatched(Execution/src/GuestMemory.cpp):On main, the tracker lock stays held from the import through every second walk. Nothing else can collect a span before its
WindowCopywalk. Hereleave(L1845) suspends and resumes the lock, and L1862 calls it inside the post-import loop. So if span A's second walk fails, the lock drops while a later span B still waits for its window walk. If another thread runsCollectWritesover B at that moment, it walks B without the window. Every page the import touched in B then gets a CPU-write stamp. The "Pages under an import window" debt entry describes that case for NVIDIA, andCheckImportWindowOtherThreadguards against it.A possible fix: inside the loop, only do the walks and note the spans that fail. Then suspend once, run the hooks for those spans, resume, and do the
unwatchLockedpass. The pre-importleaveloop at L1856 runs before the import, so it looks fine to me.Limits: I couldn't trigger this here. lavapipe's import doesn't mark pages (the startup probe reports 0 after the import), and the race needs a second thread collecting while the hook runs. So this comes from reading the code, not from a repro. I have no NVIDIA, AMD or Windows runs.
Imported from boykopovar/AnyPS5. Originally posted by ahmadmuj on 2026-10-25T15:34:04Z.
Review: APPROVED
Re-checked head
43a9245e8merged locally onto maind2b3ee3bc(clean). Same Linux setup as before: WSL2 Ubuntu 24.04, GCC 13.3, lavapipe (Mesa 25.2.8), Khronos validation layer loaded.43a9245fixes theImportWatchedpoint from my earlier review: every post-import window walk now finishes before the failed spans' hooks run under oneSuspension, and that happens before anyunwatchLocked.What I ran:
CheckImportWalkHookKeepsLaterWindowsruns on Linux (agc_write_tracking, rc 0, not the 77 skip) and passes 3/3.b61555eorder, and kept your new span selector so the test still builds. It fails with "a collect run by the unwatch hook of an earlier span counted a page the import touched without changing it as a CPU write". With the change restored it passes again.APS5_DRAW_PIPELINEunset and=1: the merge passes 56/56 and maind2b3ee3bc55/55, both ways. Both sides skip the same 18 tests, and the only VUID on either side is the old-layerVkDeviceCreateInfo-pNext-pNext.agc_storage_pending_after_unwatchalone with the layer passes 3/3.tools/check_conventions.pypasses.Limits: lavapipe only. I have no Windows or NVIDIA runs and didn't redo the Pathless or Persona numbers. This approval covers the Linux side of this head, and my point is resolved. #7048 still has to land first.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T19:55:26Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
The current head does not merge cleanly with live
main:GuestBufferMemory.cppandTexture.cppconflict, so this exact change cannot be validated against the required current-base tree.What I ran
53c3cd4eee3b15cd6408cd78a8934c9fcfb1a8ec.main420b6a064eadaa7c5e50b080c7fad59c41150b4b.git merge-tree --write-tree upstream/main refs/remotes/upstream/pr-10026— conflicts inGuestBufferMemory.cppandTexture.cpp.Results
GuestBufferMemory.cppandTexture.cpp.agc_driver_recorder_testsbuildgit diff --checkagainst the PR base53c3cd4.agc_unwatch_hook_lock_orderCTest--unwatch-lock-order-onlyrunUnedited command output
Negative control
Findings
Blocking
maininGuestBufferMemory.cppandTexture.cpp. The repository's contribution instructions require rebasing a PR that no longer merges cleanly. Resolve both conflicts while preserving the currentmainchanges and this PR's lock-order fix.Non-blocking
Sources
Not verified
No actual write-watch/unwatch scenario ran on this host, and no PS5-console behavior was tested. The latest NVIDIA report predates commit
53c3cd4; its results do not validate this new lock-order change. Full Linux/Windows PR builds and tests are not automatic under the repository's current workflow.To get this to a good state
Rebase onto
420b6a064eadaa7c5e50b080c7fad59c41150b4b, resolve both conflicts, then run the focusedagc_unwatch_hook_lock_ordertest on a supported host where the write-watch path executes. PerAGENTS.md, compare the same focused test on that host'smainand updated head with Vulkan validation enabled. I will rerun the merge preview, conventions, and available focused checks on the new head.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T23:06:04Z.
Review: CHANGES_REQUESTED
Re-checked — new head, changes requested
The new lock-order assertion is present, but head
8b14bde3ca1c256413582b8ec2d7d88889d560cdstill conflicts with currentmaininGuestBufferMemory.cppandTexture.cpp, and the available GPU report predates this head.What I ran
Reviewed head
8b14bde3ca1c256413582b8ec2d7d88889d560cdagainst PR basecda9c9bedf143010185aa17cf04e221389dd78b5; currentmainisdc38224141e0b6096007b876b4c42fc9144d11b8. The merge preview is conflicted. Local checks ran in Linux; no compiler or build was invoked.Results
GuestBufferMemory.cppandTexture.cpp660cef6fe9ada0979f22ed2dd9c76419ae36306b, not this head; it cannot verify the new lock-order assertionUnedited local check output
Findings
Blocking
main, so the required current-base validation cannot be completed. Please rebase ontodc38224141e0b6096007b876b4c42fc9144d11b8and preserve bothmain's changes and this PR's lock-order fix.8b14bde3is not covered by the posted NVIDIA report, which tested660cef6fe. After resolving the conflicts, run the focused unwatch-lock-order test on the new exact head and a same-machinemainbaseline with Vulkan validation, as required by the AGC test guidance.Non-blocking
The conventions check passes against the PR base. I did not find another new source-level blocker in the added assertion, but its GPU path is not verified by the existing report.
Sources
Not verified
No current-main merged build, focused GPU test on this head, or console run was performed. The latest NVIDIA test report is on an older commit.
To get this to a good state
Please resolve the two current-main conflicts, then run the focused lock-order test on the updated head and same-machine
mainbaseline with Vulkan validation. I will rerun the merge preview, diff check, conventions, and review the new test evidence on that exact head.