fix(agc): save the guest bytes of results that become pending over a surface that is no longer fully write-watched #7048
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7048"
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 AlxcBTW on 2026-10-17T08:16:59Z.
What
StorageTexture::markLayersPendingsaved the guest bytes of a unit that becomes pending only when the unit had no write generation. A unit last stored or uploaded while its memory was watched keeps a generation. When a block of the surface leaves the write watch while that unit is idle (the flush for the very access that caused the unwatch has just stored it, so the unwatch hook finds nothing pending) and the unit becomes pending again afterwards, it has neither the watch nor saved bytes to tell the CPU's writes from its own results. Its write-back then refuses: "storing storage image results pending over memory outside the write watch without the guest bytes saved before them is not implemented". One such unit makes the whole stored span untracked (ChangedBlocksis all-or-nothing), so every unit of that write-back needs its bytes. The colour mirror of a depth plane is marked pending after every clear dispatch without a lookup (ShaderResources::MarkGpuWrites), which is how an idle unit gets here.fix(agc): save the guest bytes of results that become pending ...: a unit without saved bytes and without a save on its way takes its guest bytes when it becomes pending over a surface that is not fully watched, whatever its generation. The blocks the CPU or the driver wrote since the unit's generation are still told from the stamps while the unit's own blocks are watched, and keep their bytes at the store, exactly as when the unwatch hook saves a pending unit (keepWrittenSince, shared withsaveBeforeUnwatch). Their writes are collected unit by unit, because a collect over a range that holds an unwatched block does nothing. A unit whose own block is unwatched gets its bytes alone.fix(agc): retile into the unit shadow only when the whole stored span is write-watched: with 1. the write-back goes through, and a second loss shows.writeBackWindowsroutes each wholly watched kept range into the unit shadow's slab and marks the pieces shadowed at the generation of a collect over the whole stored span. Over a span with an unwatched block that collect returns 0,MarkShadowedignores generation 0, and the pieces stay in the slab without a record and are never published. Over such a span every piece now goes to the import, since the span already decides the saved bytes of the store.test(agc): store results that become pending after ...:agc_storage_pending_after_unwatch.Review follow-up,
fix(agc): refuse pending results over an unwatched unit whose bytes may differ from its upload(695f8b9d1): the capture in 1. took the current guest bytes as the baseline whatever had happened since the unit's upload. If a block had left the watch and the CPU wrote it after the upload, that write cannot be seen: the image holds the upload's content for texels the GPU does not write, and storing the unit would silently overwrite the CPU's bytes there. The capture now trusts the current guest bytes only while the unit is still write-watched or still equals the bytes it was uploaded from (StorageTexture::guestMatchesUploadagainst the upload snapshot). Otherwise the unit keeps the previous refusal. That covers surfaces above the 1 MiB snapshot limit, and an earlier write-back that made the snapshot stale. Units with a stamped CPU write still go through the kept-block path. The same staleness exists on the older capture for units without a generation, which this PR does not change; I can follow up on it separately.Review follow-up,
fix(agc): compare an unwatched unit of a large surface with a hash of its upload bytes(5cf43e586): the upload snapshot behind 4. exists only for surfaces up to 1 MiB, so on a larger surface (the 32 MiB shadow-atlas mirror that motivated this PR) an unwatched unit went back to the old refusal. Each unit of a larger surface now keeps a 128-bit hash of its upload bytes (ShaderRecompiler::HashByteswith two seeds over 64 KiB chunks, 16 bytes per unit). The hash is taken where the snapshot is, and dropped wherever the GPU content stops being the upload's (alias borrow, fast clear, a write-back of the unit). An unwatched unit whose current bytes hash to the same value takes them as the baseline. A different or missing hash keeps the refusal. Exactness assumes no collision of the 128-bit non-cryptographic hash between two 64 KiB contents of guest memory. The next commit (2dd51172f) hashes through a local buffer instead of athread_localvector, so the library registers no thread_local destructor.Review follow-up, the upload-path hash:
5cf43e586and2dd51172fhashed every settled upload above 1 MiB, which cost 45 to 80 % of the presents on Astro Bot, PPSA02100 and The Pathless. The hash is now taken in the unwatch hook, while the range is still watched, only for an idle unit with a generation, no pending results, no saved bytes and no CPU write since that generation;upload()andrefreshhash nothing. This is boykopovar/AnyPS5#10026 by winstrex (ec6ceece9,f27fcde50,d73e64951,43a9245e8,cfbe00cb4,660cef6fe), merged into this branch unchanged so the two land together. It also covers bothImportWatchedexits that skip the hook, names the cause when a unit has no baseline, and drops the unconditionalRequire(refused, ...)for the largeUnwatchedPartialWritecase intests/Recorder.cpp.Conflict with
maininTexture.cpp(markLayersPendingandsaveBeforeUnwatch): merge730c72177ofmainf8f5b24b7.keepWrittenSincetakes the generation of each 64 KiB block fromunitBlockGeneration(main's per-block completion stamps), so a blockmainstamped at a completion is compared with that stamp and not with the unit's generation, exactly assaveBeforeUnwatchdoes onmainnow.After the merge of
main(base0c6a5bd59, merge commitad54ca800) the build broke on a secondGenerationBaselineBytesconstant inTexture.cppthat the merge left next to the onemainnow has;da9f0ead4(fix(agc): drop the duplicate generation baseline constant left by the merge) removes the two duplicate lines and nothing else.Both fixes only change what happens for a surface that is not fully write-watched; a fully watched surface takes the old path in both places.
Why it is correct: the refusal exists because the write-back needs a baseline to tell the CPU's writes from the GPU's results. The unit now has that baseline from the moment it can no longer get one from the watch, taken at the same point and with the same merge of stamped blocks that the unwatch hook uses for a unit that is pending when the block leaves.
Tested
fe1fa2f98: 516 of 516agc_storage_*,agc_unit_shadow*,agc_driver_*,agc_recorder*,agc_import_watch*,agc_pending*and related tests pass, the new one included. Windows Server runner, Mesa 26.2.4 lavapipe for Windows, fork CI: the 7 storage write-back tests pass, the new one included (it ran there; the surface stayed watched).agc_storage_pending_after_unwatch(tests/Recorder.cpp, also called from the fullagc_driver_recorder_testssequence). An image over watched memory is uploaded (units with a generation, no saved bytes), the last of its 4 blocks leaves the write watch while nothing is pending, the image is cleared on the GPU and marked written again without a lookup, then the store runs three ways: with no CPU write, with a CPU write to block 2 after the results were pending again, and with that write before. The store must succeed, keep the CPU's page and hold the results in every other block, the unwatched one included. Without 1. it fails with the refusal above; with 1. alone it fails on the second defect (units 0 and 1 not stored). Where the image's host import takes the surface out of the write watch (a Windows runner) the test reports that it was not run.2dd51172f(Linux and Windows lavapipe): the same sets pass. The new test now runs a 256x256 and a 1024x1024 (4 MiB, above the snapshot limit) surface, with two more variants each, a CPU write into the unwatched unit followed by a full-coverage clear and by a partial (16x16) GPU write; each must either refuse with the CPU's bytes intact or store exactly the CPU's dword or the GPU result per texel.std::terminateon the driver failure (in the three I checked, after the world had loaded), among them one on plainmain(636b1b93c) and one onmainof 17.10. with a lab switch on. In one row it came from 29 of the 512 units of the 4096x4096 R16 colour mirror of a D16 shadow atlas, each with one write generation and no saved bytes. On our lab stacks that carry the first two commits, 27 rows reached gameplay without it; game rows with the follow-up commit are still to come. Without the fix the rate is a few percent of rows, so these rows are consistent with the fix but do not prove it by themselves; the test reproduces the flow deterministically.main, fork CI on Linux (Ubuntu 24.04, Mesa lavapipe), at the headda9f0ead4: the run at the merge commitad54ca800(run 39677534763, regexagc_|Texture|Storage|Recorder) did not build (the duplicateGenerationBaselineBytes, fixed byda9f0ead4). The run atda9f0ead4(run 39678944715, same regex, plus the CI scaffolding commit): 876 of 877 passed, among themagc_storage_pending_after_unwatch;agc_driver_sgpr_pattern_fill_keysfailed with "the dispatch completed 17 times without a pending write over the keys". That test (tests/execution/SgprPatternFillKeys.cpp) is not touched by this PR; it submits a compute dispatch over a DCC key buffer and polls for the recorder's pending write note, and fails when the dispatch has retired 16 times without the poll seeing it, which is a timing condition of the test. A rerun ofda9f0ead4withsgpr_pattern_fill_keys|storage_pending(run 39683919241): 2 of 2 passed. The test did not fail in any other run I have: it passed in 2 runs ofmain(a6dcea927; runs 39688450938 and 39693413422) and in 9 runs of #7514's and #7449's heads (39677504672, 39683281454, 39677622121, 39688330136, 39688369669, 39688423114, 39693268189, 39693318038, 39693362034). So one failure in 13 runs that held the test, none of the 2 onmain; it is not shown to be flaky onmainand not shown to depend on this PR.python3 tools/check_conventions.py --base upstream/mainpasses on730c72177.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)Neighbours: #6490 (parl0v) also changes
writeBackWindowsand #6960 adds a line next to the changed one inmarkLayersPending; neither implements this, and #6308 runs the unwatch hook for a different exit (an import that leaves the watch). Whichever lands second rebases.Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-17T08:45:16Z.
Hardware run on Windows, where the description's runner reported the new test as not run: here it runs, since on this AMD driver host imports of write-watched memory keep the watch (
[write-watch] host imports of write-watched memory keep the write watch: yes).Windows 11 (26300), Radeon 860M (RDNA 3.5, driver 32.0.13058.8001), WinLibs GCC 15.2.0, Release.
mainadb0e7a8cwith this head merged cleanly.agc_storage_pending_after_unwatch: passes 3 of 3 (exit 0, not the 77 of a skipped run). WithTexture.hppandTexture.cppreverted tomainand the test kept, it fails with the refusal:storing storage image results pending over memory outside the write watch without the guest bytes saved before them is not implemented.main(#6301): with this PR alone it still stops at 4-6 s, 3 of 3, so it takes the other exit, the one #6308 covers. With this PR and #6308 merged together (no conflict), it runs 40 s at 29-32 FPS, 3 of 3, andagc_storage_pending_after_unwatch,agc_import_watchandagc_import_watch_other_familypass.AI-assisted: yes (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by johnmaia on 2026-10-17T08:48:08Z.
Windows run on real GPUs: i7-13700K, RTX 4080 (617.42) and Intel UHD 770 (101.6129), Windows 11, WinLibs GCC 15.2.0, Release,
ANYPS5_REQUIRE_VULKAN=1. Tested this PR merged onto mainadb0e7a8c.ctest -j4 -R "agc_storage|unit_shadow|recorder|import_watch|agc_pending|storage_write_back|storage_cache"(19 tests):agc_import_watchfails ("the Windows import probe failed at the settle queue (0)"), and it fails the same way on plain mainadb0e7a8c, so it doesn't come from this PR.agc_storage_pending_after_unwatchpasses on both GPUs and runs its three stores there ("host imports are compared"). It doesn't report "not run" the way it does on the lavapipe runner, so the unwatched-block path is exercised on NVIDIA and Intel.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by johnmaia on 2026-10-17T09:14:39Z.
In-game regression check on Linux, RX 7600 (RADV NAVI33, Mesa 25.2.8), Ubuntu 24.04, GCC 13.3 Release: Epic Mickey: Rebrushed (PPSA15657, UE 4.27), head
fe1fa2f98, six short runs to the first level, no environment switches.All six reached the level and played to the end of the run: no driver throw, device loss or title fatal error.
This title no longer reaches the throw this PR fixes. It hit it on Windows (RTX 4080) until #5671, and it never did on Linux. So this run only shows that nothing regressed in a UE4 title that keeps storage images pending over its own memory.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-17T12:28:02Z.
@AlxcBTW thanks for
695f8b9d1. Refusing pending results over an unwatched unit closes a real silent-corruption path (stale upload bytes over unwatched CPU writes), and it fails closed, which is the right direction.One gap:
generationBaselineis only kept for surfaces up to 1 MiB (Texture.cpparound lines 2191 and 2207). For a larger surface, an unwatched unit with no saved bytes now goes back to the originalRequire(!unsavedOutsideWatch)terminate, even when the CPU never wrote there. That's the PPSA16064 failure this PR set out to fix. The test fixture is 256 KiB, soagc_storage_pending_after_unwatchcan't show it either way.So before this merges, could you do a PPSA16064 run on
695f8b9d1and post whether the rows that used to end atunsavedOutsideWatchstill terminate? If they do, the PR needs to handle >1 MiB surfaces as well (keep a baseline for them, or refuse rather than terminate there). Full CI is running on the new head.Imported from boykopovar/AnyPS5. Originally posted by AlxcBTW on 2026-10-17T12:43:54Z.
@oneandonlydean good catch, thanks. The shadow-atlas mirror that motivated this is 32 MiB, so it is exactly the case above the snapshot limit. Two things are underway:
unsavedOutsideWatchterminate still fires. One arm runs695f8b9d1as it is, the other adds the change below.I'll post the rows and the commit here when both are done.
Imported from boykopovar/AnyPS5. Originally posted by AlxcBTW on 2026-10-17T16:20:07Z.
@oneandonlydean the PPSA16064 rows you asked for. Six in-world gameplay walks (~180 s each, RTX 5070 Laptop, Windows 11), on a lab stack (our best10 = current
mainplus our other lab changes) carrying this PR, with a counter at the capture inmarkLayersPendingand at the oldRequire(!unsavedOutsideWatch):695f8b9d1(no hash for large surfaces)5cf43e586/2dd51172f(per-unit upload hash above 1 MiB)RequirehitsSo on this title every unit that needed a baseline was still watched when it became pending.
695f8b9d1alone does not bring the terminate back here, and the large-surface branch you pointed at is never reached. The hash commit is still the right behaviour for a title where it is reached; on this one it changes nothing. In every row 6-9k write-backs went over a span with an unwatched block and needed no saved bytes. Without this PR that is the situation where the refusal used to end ~5 % of our rows (7 rows over 15.-17.10.). Counter branch: forklab/pending-save-game.Imported from boykopovar/AnyPS5. Originally posted by huseinnashr on 2026-10-17T17:27:49Z.
Astro Bot (PPSA21564, content 01.018.000) on Windows / RTX 5060 Ti: reaches the intro cutscene with #7048, 3.5–20 fps
With
mainplus PR #7048 the title no longer aborts. It goes through the logos, title, save-slot selection, loading, world map and into the intro cutscene, rendering correctly. Frame rate is the problem: 14–20 fps on the logos and title, 6–11 fps in the world map and intro, and 3.5 fps in the crowd cutscene.Environment
ANYPS5_GPU=NVIDIAselected the 5060 Ti)Build
mainat66702f1cfwith PR #7048 (head2dd51172f, fetched 2026-10-17) merged locally on top. The merge was clean.x86_64-ucrt-posix-seh), CMake 3.31.12, Ninja 1.13.2, Release.relinkerandlibs. Nothing else was needed.relinker --windows --to-intel --sce-module-path <dir> eboot.elf app.exe. The Intel pass reported 14,973 stubs, 0 kept in place.Input preparation
eboot.binwas a decrypted SELF (no segment flagged encrypted or compressed). I unwrapped it to a plain ELF with a small script that copies the blocked segments to their program-header offsets.sce_module/(libc.prx,libSceNpCppWebApi.prx) were SELFs as well and needed the same unwrap, or they get skipped.What happens
v0.1.2 release build (relinker + prx-windows v0.1.2): the engine starts, picks the 5060 Ti, creates the swapchain, then aborts about 8 s after launch:
It reproduces on every run.
APS5_STORE_AT_FLIP=1andAPS5_STORE_AT_LABEL=1do not avoid it. This looks like #7017 / #6301.main+ #7048: no abort in several runs, including a 300 s capture. Levels loaded in order:ps_logo,title_controller_ship,worldmap,intro_next. Save slot 1 selection works and the intro cutscene renders correctly (screenshot attached).Performance (shader cache warm after the first pass)
First run: about 1,750 shader-cache misses and a shader cache of about 1.3 GB. Later windows still show new misses when new content appears.
Excerpts from a window in the world map / intro (
APS5_PROFILE_DRAW=1):Host observations while it ran at 3.5 fps: GPU utilization 89–99% at P0 and 2782 MHz, but only about 57 W (the card is rated around 180 W); about 1.9 CPU threads busy of 28; disk about 0% busy (NVMe); 28 GiB private memory, 22 GiB resident. So the GPU looks busy but is mostly stalled on serialized work. Nearly all of the sync wait is on pending GPU writes.
Not tested
mainwithout #7048 (so I can't say whether the abort is already fixed there).--to-intelagainst an AMD host or against the non-converted instructions.ANYPS5_PRESENT_MODE) orAPS5_TEXTURE_CACHE_MIB.Side note
The web converter fails with
std::bad_allocon this input (255.7 MiB executable plus modules), so the native relinker was needed.AI-assisted: yes (Claude Code did the builds, runs and log analysis; I ran the game and checked the screen).
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-17T23:09:32Z.
Thanks for this. We ran it against two Astro Bot game runs on an RTX 4090 (head
2dd51172f, merged onto main52798f71d, each 450 s against two main runs on the same build). Rendering and checkpoints are fine and Dreaming Sarah passes. But Astro Bot is clearly slower, and both runs show the same pattern:CPU load and clocks match main and GPU load is lower, so the GPU is waiting on the CPU. That fits the one cost the PR adds: every settled re-upload of a surface larger than 1 MiB now does an extra full read and hash pass over its guest bytes (the generation baseline is only kept for surfaces of 1 MiB or less). Full-screen targets are well over 1 MiB, so that pass runs on most frames.
Could you avoid the extra pass for large surfaces? For example, compare only the blocks that hold an unsaved unit, or keep a per-block baseline above 1 MiB, rather than reading and hashing the whole surface. We'll run Astro again on the new head.
Imported from boykopovar/AnyPS5. Originally posted by frankea on 2026-10-18T19:20:14Z.
NHL 26 (PPSA26785, 01.060.000) on NVIDIA Ada, where this refusal was the title's next stop after #7346 (my #7346 comment: frameIndex 423,
TextureCompositeDraw, four 0x870000-byte storage images dropped as "memory no longer registered" right before it).Setup: RTX 4090 (NVIDIA 616.92, Vulkan 1.4.341), Windows 11 26200, Ryzen 7 5800X, MinGW-w64 GCC 15.2.0 r7, Release
libs; treemain376c04029(2026-10-18) + this PR's head2dd51172f, clean merge; #7346 is in thatmain. Same relinkedapp.exeas my earlier runs,ANYPS5_REQUIRE_VULKAN=1, no controller, no input, three runs with a 600 s cap each, captures of the window every 10 to 30 s on the last run. The shader cache was cold for this tree (new source version), so run 1 spent its 600 s compiling; runs 2 and 3 are the result.driver failureof any kind, but it never reached the frames in questionSo on this GPU the PR does for NHL 26 what it did for PPSA16064: the refusal that ended every warm run on
main+ #7346 at frameIndex 423 no longer fires, and the title runs on through the legal screen to its title screen and sits there until the cap. Thesce::Json::Parser::parse: null textabort I saw once after the legal screen on #7346 did not occur in either 600 s run here; I do not know why (the file-open sequences of the runs are identical, that run just died 36 s after the legal screen), so I am not counting it either way.Two notes for the cost discussion above:
WAIT_REG_MEMtimeouts the engine recovers from) are still there: six in run 2 (frames 113 to 162:DeferredGpuProbes,hdriSky,sssConvHorizontal,planarShadowDL,TextureCompositeDraw,TAAPostSharpen), one in run 3 (frame 165,Depth_writeHalfResZ_3d, pipelineShaderProgram_ProceduralSky), all before the first visible frame, none after. Same as on #7346, not this PR's doing.StorageTexture upload submit/donepairs per second (Texture.cpp:2423) for 1176x664 storage images (format 50 / VK 64 at 0x11c04d0000, and in run 2 also format 69 / VK 95 at 0x11c1f70000; about 3 MiB each, so above the 1 MiB snapshot limit), roughly 17 uploads per 12-FPS frame, for the whole 4 to 5 min on that screen (66,690 and 74,844 such pairs in runs 2 and 3; the #7346 runs had 1,303 and 1,721 in total, but they never reached this screen). I have nomainrun of this screen to compare against, so I cannot tell the title's animated background from a cost this PR adds; GPU use stayed around 2.6 GiB. Mentioning it only because of the large-surface re-upload cost @oneandonlydean measured on Astro Bot.Logs in the details blocks (stderr trimmed to the driver lines; per-shader registration notes, missing-file opens and the 10 s counters removed), full logs on request.
run 3, warm cache, title screen until the cap: stderr (14 of 673 lines kept)
run 2, partly cold cache, no stop: stderr (14 of 674 lines kept)
run 3, the title's one breadcrumb report (stdout)
AI-assisted: yes (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-18T21:53:17Z.
Intel and AMD Windows data: with this PR the 56 tests built from
tests/Recorder.cpppass on an Intel UHD 770 and an AMD RX 9070 XT. Without it, the import-settle tests fail on both.Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Release, every execution test built,
ANYPS5_NO_SHADER_CACHE=1, serial CTest. Intel UHD Graphics 770 (8086:a780), driver 32.0.101.7088. AMD Radeon RX 9070 XT (1002:7550), driver 32.0.31041.1004, withVkCacheemptied first. This head2dd51172fmerged intomainf3059421f. "Without" means this PR's test files onmainf3059421f, with none of its other changes.agc_import_watch(the Windows import probe failed at the settle queue (0)), 9 with(9) a scan under a pending write was kept(the import-settle tests,agc_sampled_storage_base_level_usage,agc_driver_host_import_lifetime,agc_driver_host_import_mutation_race), andagc_sample_dumpssegfaultsa signaled batch's read still refuses: the 6 import-settle tests,agc_sampled_storage_base_level_usage,agc_driver_host_import_lifetime,agc_driver_host_import_mutation_raceI also ran full CTest with this PR and the 14 other open AGC PRs I tested in the same batch merged together (#7647, #7641, #7630, #7627, #7603, #7600, #7591, #7579, #7535, #7533, #7474, #7462, #7050, #7650). Neither GPU showed a failure beyond
main's own, except #7650's new test.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by frankea on 2026-10-19T01:14:42Z.
Follow-up to my comment above, same box and tree (
main376c04029+2dd51172f), warm shader cache, no input before the stop: in run 7 of NHL 26 (PPSA26785) on this tree the refusal fired again, 6:15 after launch at about frame 374, before the title screen:The four drops are the same addresses and sizes as in the six runs that went on past them (and as in the
main+ #7346 run that aborted at frameIndex 423), so the saved-bytes path covers the usual case and misses some ordering of the same sequence. One datapoint on the environment:app.exehas a 23 to 24 GiB working set on this title and the 32 GiB box had 160 to 500 MiB of free physical memory around that moment in every run (sampled every 20 s), so paging may be what moves the timing. Logs on request.AI-assisted: yes (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by ionut27001 on 2026-10-19T03:26:29Z.
A second title with the slowdown @oneandonlydean measured on Astro Bot. On Marvel's Wolverine (PPSA03671), adding this PR to #6308 cuts the presents in the first 400 s from 38–40 to 16 and the storage images created in that time by about half.
Setup: Windows 11 Pro 26300, RTX 4080 SUPER 16 GB (NVIDIA 617.42), Ryzen 7 5800X3D, WinLibs GCC 15.2.0 r7, Release, content 01.001.005,
relinker --windows. Base:mainf3059421f+ #6901 (needed to load) + #6308 (48a1d3453). Same scene in every run (the "Sony Interactive Entertainment presents" card, no input), 900 s each, shader cache from earlier runs,APS5_PROFILE_DRAW=1. "~400 s" is the 40th cumulative[textures]report.[dispatch] resources tooklines (over 1 s)2dd51172f)The extra time shows up in the resource phase of the four large image-table dispatches (programs 0x11d0323c00, 0x11d032b100, 0x11d0339900 and 0x11d0349300): with this PR each one is logged over 1 s 54 to 57 times per run, with a median of 2.4 to 2.6 s; without it, 17 to 25 times. I have not profiled inside the build, so I can't say whether it is the full-surface read and hash pass you pointed at.
The abort this PR targets did not occur here with #6308 alone (900 s, no refusal lines); without #6308 it aborted in 11 of 11 runs (details on #6308).
AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by klosixgaming-arch on 2026-10-19T18:41:25Z.
Tested on Windows 11, RTX 5090:
Untracked storage textures over unwatched memory were aborting in Cyberpunk 2077 at frame 5 with \storing storage image results pending over memory outside the write watch without the guest bytes saved before them is not implemented. Saving the guest bytes when marking untracked layers pending allowed the title to cleanly proceed into full 3D rendering and menu presentation.
AI-assisted: yes. Written with AI assistance and reviewed by me.
Imported from boykopovar/AnyPS5. Originally posted by cookie42073-cmd on 2026-10-20T10:19:49Z.
Hey @frankea, thanks for posting the run-7 recurrence. Could you attach the full stdout/stderr you offered for that failed run, plus one passing run on the same
376c04029 + 2dd51172ftree? Those existing logs are useful even before another build.I traced the refusal: the selected write-back span could not be tracked, and at least one selected unit could not be compared with saved guest bytes. The four earlier "memory no longer registered" drops return without storing those results; they don't identify the image/unit that later refuses. They also appear in your passing runs, so I wouldn't attribute this to those addresses or to memory pressure yet. The refusal must stay in place when the baseline is unsafe.
For a fresh run, main at
02fb1ce53now includes #7432 and #8172, which change two ways memory leaves the watch. It also includes #8265's block-tracking revert; please retain the diagnostic'sblockUnits/unit-size fields and anyAPS5_NO_BLOCK_TRACKINGsetting in the result. Once a current, reviewed integration is available, please keep plain main and main + this PR separate, pin the exact commits/local changes, and keep the same warm-cache launch/input/cap. A run that reaches the cap without the error is inconclusive for this intermittent failure.@spiff637's #7604 already has a focused trace to start with:
APS5_TRACE_WATCH=unsavednames offending units and the exclusion/save history without the full trace that hid a race in another title. Its #6308/#7505 dependencies need reconciling with #8172 first, as requested here. Could the existing owners point us to a current diagnostic commit that preserves those semantics and composes with #7048? We should use that rather than create another trace patch.For that capture, the key output is the
[watch] unsaved imagelines and preceding exclusion, failed/skipped-save and forgotten-save lines through the refusal, with the tested revision. No game dump or raw memory payload is needed for this first step.This is source/log analysis, not a local reproduction or a claim that NHL 26 is fixed.
AI-assisted investigation and write-up, independently reviewed.
Imported from boykopovar/AnyPS5. Originally posted by frankea on 2026-10-21T02:40:49Z.
@cookie42073-cmd sorry for the delay. Attached are the full logs of the failed run and of a passing run on the same tree (
main376c04029+2dd51172f, Windows 11, RTX 4090, NVIDIA 616.92, warm shader cache), both started by the same launcher with the same scripted pad input:p7048-a2.*: the failed run 7, which aborted on the refusal 6:15 after launch, before the title screen.p7048-a3.*: the passing run, which reached the title screen, took Cross and ACCEPT, and ran to the 1200 s cap on the quick-settings page..erris stderr,.outis stdout (the per-frame log, 12 MB for the long run) and.txtis the launcher's start and exit record. Both runs log the same four storage images dropping out of the watch; only a2 then hits the refusal.AI-assisted: yes (Claude Code).
2026-10-21-7048-nhl26-run7-logs.zip
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-21T15:50:22Z.
Title reference for this PR (data only, baseline only).
Title: PPSA07426, 600 s through the runner,
ANYPS5_GPU=4080; the.outshowsSelected GPU name=NVIDIA GeForce RTX 4080 SUPER vendor=0x10de device=0x2702 subgroup=32. Windows 10 Pro 10.0.19045, WinLibs GCC 15.2.0, Release. The libs aremain47fa6eecf8plus an unrelated open PR (#9068) merged locally, withAPS5_GPU_CHECKPOINTS=1set.run_173440.err line 242:
followed by
FATAL: abort() (SIGABRT), afterqueue 0x20 WAIT_REG_MEM ... timed out after 1000mslines 206 and 228. That is the refusal inStorageTexture(Texture.cpp) this PR is about.I did not run this PR on the title, so this shows that the title reaches the refusal, not that the PR gets past it. One run; another run of the same title on an earlier
mainended in a device fault instead, and the RX 6400 run ended in a guest null write after the same queue 0x20 timeouts.Not run: this PR's head, its tests, other GPUs for this refusal.
AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-21T17:15:20Z.
@AlxcBTW this PR now conflicts with
mainincore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp(the storage image write-back, wheremainadded theAddedPiecebookkeeping next to yourspanWatched).In case it helps: I rebased your six commits onto
mainas ofcecb540a63without changing them, keeping you as their author, and resolved only that one conflict by keeping both sides (theAddedPiecestruct and vector frommain, yourspanWatchedline): branchxXPBSXx:carry/7048-save-guest-bytes, headd7eedabeeb. You can take it withgit fetch https://github.com/xXPBSXx/AnyPS5 carry/7048-save-guest-bytesandgit reset --hard FETCH_HEAD, or rebase yourself; I will not open a second PR for it.Windows 10 19045, WinLibs GCC 15.2.0, Release,
python tools/check_conventions.py --base upstream/mainpasses, merge-tree againstmainis clean. On the AMD Radeon RX 6400 (the tests logVulkan device: AMD Radeon RX 6400), 3 runs each:agc_storage_pending_after_unwatchandagc_driver_host_import_lifetimepass 3/3; the 22 tests matchingagc_recorder|agc_storage|agc_driver_host_import|agc_driver_recorderpass.Texture.cppandTexture.hpptaken frommain:agc_storage_pending_after_unwatchfails 3/3 withstoring storage image results pending over memory outside the write watch without the guest bytes saved before them is not implemented;agc_driver_host_import_lifetimepasses.Title reference: PPSA07426 on an RTX 4080 SUPER stops on that same message (run_173440.err line 242, 600 s,
Selected GPU name=NVIDIA GeForce RTX 4080 SUPER vendor=0x10de). A run with the rebased branch follows.Not run: other GPUs, the RTX for the tests, other platforms, the full CTest run.
AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by klosixgaming-arch on 2026-10-21T17:24:37Z.
Real-title evidence for PPSA03974 (Cyberpunk 2077 v02.120.000), plus a rebase note.
The stop this PR describes, on a title. Windows 11 (10.0.26200), NVIDIA GeForce RTX 5090, driver 617.42. On a local merge of
main(f90a3f729), #6218 (head 4adf40588) and #9260 (head 1397502db (same tree as the 23e24862a that I built and ran; the commits were re-authored afterwards to fix the author email)), a session stopped about 3 minutes after launch (+148.7 s, still in the intro) with:AGC graphics: storing storage image results pending over memory outside the write watch without the guest bytes saved before them is not implementedIt is intermittent for this title: several earlier sessions of 9 to 20 minutes on
mainplus #6218 did not hit it. Palworld hits the same message (#7017).With this PR merged on top (head
2dd51172f): a session ran 1878 s (31 minutes) through the intro, the menus and character creation and did not hit it. One clean session does not prove the fix for an intermittent stop, so I am only offering it as consistent with the change, not as a proof. The focused tests pass on the merged tree, including the one this PR adds:agc_storage_pending_after_unwatchPassed (1.06 s), together with the 11 other tests that runagc_driver_recorder_tests(agc_resident_direct_remap,agc_resident_present,agc_recorder_*,agc_host_import_unmap,agc_host_import_retirement,agc_host_import_second_mapping,agc_driver_host_import_lifetime,agc_driver_host_import_mutation_race), 12 of 12.Rebase note. Against
mainf90a3f729(also checked on themainI fetched an hour later) this PR no longer merges without a conflict.core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpphas one conflict, inStorageTexturewhere the store spans are collected:mainadded theAddedPiecestruct and thestd::vector<AddedPiece> added;just beforeaddPiece, and this PR addsconst bool spanWatched = GuestMemory::Watched(firstStored, ...)in the same place. The two additions are independent; I kept both (main's block first, thenspanWatched), it compiled, and the tests above pass. The other three files merged without conflict. That is a local merge of mine, not a change to this PR.AI-assisted: yes. Written with AI assistance and reviewed by me.
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-21T17:42:35Z.
Title data point with the rebased branch (data only; follow-up to my earlier baseline note).
Build:
xXPBSXx:carry/7048-save-guest-bytes(headd7eedabeeb, the six commits of this PR rebased onto currentmain, see the hand-off comment), relinker and all libs built from that tree; Windows 10 Pro 10.0.19045, WinLibs GCC 15.2.0, Release.Title: PPSA07426, 600 s through the runner,
ANYPS5_GPU=4080; the.outshowsSelected GPU name=NVIDIA GeForce RTX 4080 SUPER vendor=0x10de device=0x2702 subgroup=32.mainplus an unrelated PR):AGC graphics: storing storage image results pending over memory outside the write watch without the guest bytes saved before them is not implementedat line 242, then SIGABRT.FATALline; it ran to the 600 s limit. It containsqueue 0x20 WAIT_REG_MEM ... timed out after 1000mslines (227, 244, 261), the same pattern as before.One run per state, and runs of this title end differently from one to the next (an earlier run on another build stopped on a device fault; an RX 6400 run stopped on a guest null write), so this shows that the title no longer reaches this refusal in this run, not that it runs clean. I did not look at the picture.
Not run: more runs for a rate, other GPUs for the branch.
AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by Logan1h on 2026-10-21T18:06:04Z.
Retested on a third title: EA Sports UFC 5 (PPSA03541, content version 01.031.000).
Without this PR (main
2f161d4f3+ the PPSA03541 stack #6549, #6604, #8484, #8735, #8672, #8727, WinLibs GCC 15.2.0, Release, Windows 10.0.26300, RTX 4070 SUPER / NVIDIA 617.14) the title renders for ~150 s and then aborts:With this PR applied on the same stack (only conflict was in
pendingAfterLeavingWatchTestsintests/Recorder.cpp, where currentmainhas already rewritten that test; the driver changes applied cleanly) the title ran 41 minutes in the front end (~5 000 presents) and then 9 minutes of an in-game fight (~1 900 presents) with no refusal and no other error. A[gpu] storage image ... destroyed with GPU results pendingline appears at shutdown, as onmain.So this is a third independent title (after Palworld and ProsperoPuzzles) where the change removes the refusal; the UFC 5 abort is gone on the merged tree. Title-side profile of the same run is in #3123.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-22T03:13:47Z.
@AlxcBTW Three titles now stop on this exact refusal (PPSA07426, PPSA03974, PPSA03541), so I would like this on
mainsoon.xXPBSXx:carry/7048-save-guest-bytes(d7eedabeeb) is your six commits rebased ontomainas ofcecb540a63, authorship kept, one conflict resolved. Please take it into this PR. If it isn't here within 24 hours, I'll open the PR from that branch with your authorship kept and you as co-author, and close this one in favour of it.Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-22T04:40:32Z.
@AlxcBTW a merge-order note: #9565 (a draft) adds a
--command-buffer-release-onlymode tomain()intests/Recorder.cpp, next to the cases this PR adds there. Their library changes don't meet: this PR's are inTexture.cpp, #9565's inRecorder::release. So the order shouldn't matter: whichever merges second keeps both sets of tests when it rebases. Does that work for you?Imported from boykopovar/AnyPS5. Originally posted by dantdmdarealguy on 2026-10-22T08:37:16Z.
Cross-test on Stray (PPSA02100) 01.002.000:
maind6eafa54dwith this PR's headda9f0ead4merged (clean), Windows 11 Pro, Intel Core i9-14900K, NVIDIA GeForce RTX 5080 (driver 32.0.16.1742), warm shader cache.maintoo, rarely: 1 of 18 runs (compute shader 0x200e390000 ... without the guest bytes saved before them is not implementedat +26 s, before the menu). With the PR, 0 of 9 runs stopped (6 × 60 s, 1 × 360 s, 2 × 240 s), which at that rate says nothing either way about the fix.main, PR,main, PR (240 s each, no stop in any),[present]counts per 10 s were:mainround 1 / 2[texture] 400 storage images, create 595 ms (main) vs 2254 ms (PR).[resources]imagesphase 5120 ms over 156000 builds (main) vs 10410 ms over 53000 builds (PR), about 6× per build. My guess is the per-unit 128-bit hash of the upload bytes for surfaces above 1 MiB (unitContentHashinuploadand inguestMatchesUpload), but I have not profiled it.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-22T08:41:01Z.
@AlxcBTW a follow-up on the slowdown I reported on 17 Oct. A tester now sees the same pattern on PPSA02100 (presents per 10 s at the autosave 485-551 on main vs 77-78 with this PR; the images phase ~6x slower per build). From the code, the cost is the eager upload hash:
upload()hashes every stamped unit of every settled surface over 1 MiB, on every upload (uploadHash[layer] = unitContentHash(layer, true)), but the hash is only read inguestMatchesUpload, for a unit with a generation, no saved ticket and an unwatched span. That case is rare, so almost all of the hashing is never used.unitContentHashcallsReadCommittedper 64 KiB chunk (one GPU-write flush per chunk), runsHashBytestwice over the same bytes, and allocates a buffer per call.Could you move the cost off the upload path? The cheapest shape I see is to establish the baseline at the unwatch itself. While the block is still watched, a CPU write since the unit's generation is visible, so the unwatch hook could hash (or save) just the idle units with a generation and no saved bytes that weren't written since. Today
SaveBeforeUnwatchonly visits textures with pending results andsaveBeforeUnwatchonly pending units, so it would need to reach idle textures overlapping the range. Is there something that makes that unsafe, or an unwatch path that bypasses the hook?If the hash has to stay at upload: one pass instead of two, one flush per unit rather than per chunk, and no per-call allocation would at least cut it down.
I'll rerun PPSA21564 on the new head against main. Its intro, title and menu are where I measured -45% to -60%. The carry branch from the 24 h notice has the same hash code, so this applies to it too: I won't take either to merge with this cost.
Imported from boykopovar/AnyPS5. Originally posted by zaidhawk on 2026-10-22T08:45:30Z.
Persona 3 Reload (PPSA10872, 01.000.000), thread #9692. Unlike Stray above, this title stops on
mainin every run that gets past its online-features dialog, so it's a reproducible case for this refusal.Setup: Windows 11 Pro 26200, RTX 5090 (NVIDIA 617.42), Ryzen 7 9800X3D, WinLibs GCC 15.2.0 r7, Release.
mainb27924d85, and the same commit with this PR's headda9f0ead4merged (clean). Onlylibs/differs between the two: sameapp.exe,app0/, warm shader cache and scripted pad presses (APS5_PAD_INPUT_FILE, Cross/Options at fixed times).mainmain+ #7048storing storage image results pending over memory outside the write watch without the guest bytes saved before them is not implemented(compute shader 0x2012260000 in one run)The slowdown matches the Stray numbers above and is larger here (about -80% on the logo screens). The title screen and difficulty menu run at ~6 FPS with the PR;
mainnever reaches them. I can rerun this title on a new head.Focused tests on the merged tree, RTX 5090,
ANYPS5_REQUIRE_VULKAN=1: the 75 tests that runagc_driver_recorder_testspass, none skipped, includingagc_storage_pending_after_unwatch(3 of 3, ~0.7 s). The same 74 pass onmain.Unblocks: PPSA10872 #9692
Not covered: audio, anything past the opening movie, the Khronos validation layer (not installed on this machine).
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-23T05:07:47Z.
Review: CHANGES_REQUESTED
I found a substantiated performance blocker in the same-machine, same-scene comparison now reported in dependent PR #10026. On The Pathless (PPSA01825) main menu, the author reports 319–330 presents per 10 seconds on main versus 85–104 with #7048 alone; the combined #7048 + #10026 stack returns to 304–316. That is a roughly threefold slowdown from #7048 alone in a tested title. The author attributes the cost to hashing every large settled upload, and the follow-up moves hashing to the unwatch transition. These are the author's captures, not a local reproduction by me, but the comparison is direct and the regression is material.
I request that #7048 not merge by itself until this performance regression is removed, either through the paired follow-up or an equivalent correction, with the measured comparison retained in the review evidence. This is a behavior-based blocker, not a queue-size concern. The dependent follow-up declares
Depends on: #7048; please coordinate the merge order so users do not receive the slow intermediate behavior. Hosted product jobs are skipped under the current workflow policy, so I am relying on the detailed author-reported traces for this finding.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T08:52:29Z.
Review: CHANGES_REQUESTED
Re-reviewed exact head
730c721773cd3d12422b715c725a2678122e85f7. The current-main merge preview is clean, but the landing/performance blockers remain on this composition:Depends on: noneand does not identify #10026.agc_storage_pending_after_unwatchat both sizes, with full CI. The old eager-head slowdown and fork CI report do not establish performance for head730c721773.I do not have a new source-level correctness finding. The upstream Windows workflow passes, while product Linux and GPU jobs are skipped; I did not run a local GPU build or capture. Please post exact-head results and clarify the single landing composition before requesting another review.
Pull request closed