fix(agc): save the guest bytes of units without a write generation when results land outside the write watch #5679
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5679"
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 moong15 on 2026-10-14T06:06:06Z.
What
Stellar Blade (PPSA13197 v01.141) stops on Windows
maina few minutes after start withfollowed by
GameThread timed out waiting for RenderThread after 120.00 secs. #5657 does not cover it: every unit of the failing image has no write generation, which its debt entry lists as still throwing. The memory is likely outside the watch since #5596 (direct imports of singly mapped direct memory leave the watch, as #5657 describes); the title passed this point onmainbefore #5596. I have not confirmed this by reverting #5596.Sequence, traced on a 256x256x6 cube map (
format=71, 11 block units) over memory outside the watch:Createuploads it while the range is not watched:layerOriginaltrue,layerGeneration0.forgetStored(). Over unwatched memorysettleleaves the generation at 0, so the units now have neither saved bytes nor a generation.tracked == falseandcompared == falseand throws (Texture.cpp, host-import store).Log excerpt (temporary diagnostics, not part of this change)
createandpendingare logged afterCreate's upload and on entry tomarkLayersPending; theTextureline is the title sampling the cube between the two writes (steps 3 and 4).markLayersPendingnow saves the guest bytes (captureGuestBytes) of units that become pending with no saved bytes and no generation while the image's range is not watched, as the clear and fill paths already do for memory outside the watch. The store then compares against those bytes and leaves the blocks the CPU changed since to the CPU.The debt entry is narrowed: a unit without a generation whose range leaves the watch while its results are pending still throws, as do ranges that leave the watch through a failed collect.
Tested
Windows 11 Pro 26200, MinGW GCC 15.2, Release,
BUILD_TESTING=ON, onmaina94675fb1:ctest -R "store|storage|write_watch|guest_memory|untracked": 38 of 38 pass.tools/check_conventions.py --base origin/mainpasses.mainplus #5631 and other local AGC changes the title needs that are not inmain(they changeGuestBufferMemory.cppand libc'sWindowsMappings.hpp, but not the write watch orTexture.cpp): without this change the error above appears in every run (6 runs, before and after #5657) at the same point of loading and the title stops. With this change it does not appear in 3 runs; the title reached the main menu.No new test case: a second store through the
StoreOverUntrackedfixture re-uploads the image at its next dispatch (captureGuestBytesfrom the upload), so the units never reach step 4 there and the case passes with and without this change. The title takes the second results without a re-upload after sampling the image; I have not isolated which path does that.Unrelated, seen later in the same title and not addressed here:
vertex fetch exceeds descriptor record countafter the main menu.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 github-actions[bot] on 2026-10-14T06:32:16Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppL3033docs/dev/debt/libSceAgcDriver.mdL54core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppL3033docs/dev/debt/libSceAgcDriver.mdL54Imported from boykopovar/AnyPS5. Originally posted by simonbronk on 2026-10-14T08:59:27Z.
AMD and NVIDIA runs for this PR at head
f05086278. Windows 11 Pro 26200, WinLibs GCC 15.2.0 (MinGW-w64), Release, one machine with two GPUs, each picked withANYPS5_GPU:1002:13c0, RDNA 2), driver 32.0.21036.18ctest -R "agc|shader|video_out" -j 8(517 tests, including the ones this PR adds or changes):agc_driver_lds_mixed_width_atomics,agc_driver_pixel_interlockandagc_driver_layered_volume_vertex_no_gpl. These three fail the same way on currentmain(872f52320) on this GPU and pass there on the RTX 5070; they are the three of #5271, so not caused by this PR.No title run. AI-assisted: yes (Claude Code ran the builds and tests).