fix(agc): publish unit shadows before address-space reuse #19351
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/19351"
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 lgqdaxia on 2026-11-13T05:05:09Z.
What
A cached address-draw space can read old imported bytes after a GPU write leaves newer data in a UnitShadow.
RetakeSpaceskips the shadow publication performed by a freshUploadFinish, and space-only reuse bypasses ordinary direct-region revalidation.Publish shadows over the reused space's bounds before refreshing its mirrors, using the existing fresh-build operation. Add a regression that verifies an actual cache hit, a later CPU-overwrite control, and a fresh-build control.
Tested
Windows 11 Pro 10.0.26300, MinGW UCRT64 GCC 15.2.0, NVIDIA GeForce RTX 3080 Laptop GPU / 621.14; validation layer 1.4.366.
a6fbf9ce9632and the fix: 6/8 → 8/8 passed, zero skips. Main reads 40 instead of 210 in the shadow-publish case and default suite; both pass with the fix. The later CPU write remains 90 on both sides.ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validationandVK_LOADER_DEBUG=error,warn,layer. Layer insertion confirmed; zero VUIDs on either side.Exact comparison and overlap check
2026-11-13: tested candidate
62cd42a97356. The control restored onlyGuestBufferMemory.cppto maina6fbf9ce9632, retaining the same regression executable. Test command:ctest --test-dir build -R '^agc_driver_address_draw_space_reuse($|_)' -V.Rebased onto
441fa651195eon 2026-11-23, including the AudioOut2 revert in #25143. The AGC fix and its regression tests carry over unchanged from the previous PR revision.pr_overlap.pyand manual comparison of its 27 shared-file candidates found no equivalent fix. #9508 shares a test-header insertion; its production change only factors mirror refresh into a helper. #17796 publishes storage images into resident heap mirrors, a different path from existing UnitShadow publication into host imports. Neither is a dependency.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)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-23T02:28:59Z.
Review: COMMENTED
Reviewed — no blocking findings
The inspected changes address the stale-shadow reuse path, but I could not run the checks or inspect the full production source file, so a formal approval is not justified.
What I ran
Reviewed head
4068918813d7767fcb8c6f7a2c2a947a000f1d69using the pinnedrepo_read.pyreader. No tests or build commands were run. The author reports GPU regression and convention checks in the PR description; these were not independently run.Results
Findings
Blocking
None found in the inspected code.
Non-blocking
None.
Not verified
The remainder of
GuestBufferMemory.cppwas not read; the manifest marks its full text as excluded for size. No build, test, or GPU validation was run in this review. The PR description reports successful GPU tests and conventions checks, but those results are author-reported.Files read:
GuestBufferMemory.cpprelevant ranges aroundRetakeSpaceandUploadFinish;Texture.cpprelevant publication ranges; the complete changed CMake test-registration file; and the relevant changed and test-dispatch ranges inAddressDrawSpaceReuse.cpp. Excluded from the review bundle: full text ofGuestBufferMemory.cpp.To get this to a good state
Nothing is required. Optional: independently run the focused regression suite and build on the pinned head.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-23T02:45:35Z.
Review: APPROVED
Reviewed — looks good
The changed code and all files marked reviewed were inspected at head
cdc376ea15fc34ce3f59705d4b6b56139940b5b5; no verified defect blocks merging.What I ran
No test commands were run. Review was based on the prepared diff and targeted reads through
repo_read.py.Results
Negative control
Not run; no test environment was available in this review session.
Findings
Blocking
None.
Non-blocking
None.
Sources
Behavior claims were checked against the prepared change and the implementation of
PublishShadowsOnlyat the reviewed head.Not verified
Tests and runtime behavior were not independently verified. The full text for
GuestBufferMemory.cppwas excluded from the review folder because it was too large; the changed function and adjacent relevant code were read throughrepo_read.py. All three changed files listed in the manifest were reviewed, including the two test files in full and the changed production hunk with surrounding code.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by malekaifa on 2026-11-23T03:15:54Z.
Review: APPROVED
Reviewed exact head
cdc376ea15fc34ce3f59705d4b6b56139940b5b5. I verified all three PR-file blobs are byte-identical to the prior head4068918813d7767fcb8c6f7a2c2a947a000f1d69that I independently tested on Windows/NVIDIA, where the address-space-reuse regressions passed 8/8 with validation enabled and failed on main with the PR fixtures. This rebase brings in the unrelated AudioOut2 revert I requested; its Windows job now fails onlyguest_sleep_wake, outside the three changed AGC files. MarcZX10 also approved this exact head. No blocking AGC finding from me. AI-assisted: yesImported from boykopovar/AnyPS5. Originally posted by Plyxen on 2026-12-03T10:41:05Z.
Review: APPROVED
I read the diff at
cdc376ea15. Windows 11, GCC 15.2, merged intomainatb97867d3ce6together with other open PRs (so not an isolated build), withANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1andVK_LAYER_KHRONOS_validationon an RTX 5080 (621.24) and a Radeon iGPU (26.11.2).agc_driver_address_draw_space_reusetests: pass on both GPUs. The loader log shows the layer inserted and no "was not found" line, and neither run has aVUID-orSYNC-HAZARDline.main's):agc_driver_address_draw_space_reuseand_shadow_publishfail on both GPUs: "a draw after a unit-shadow write read 40 instead of 210". The other eight pass.The red check is
guest_sleep_wake, which this PR does not touch; it passes here.Not checked: a title.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T22:17:08Z.
Review: COMMENTED
I trial-merged this head cleanly onto
a1b75b0947.RetakeSpacenow publishes shadows before reading the epoch and proof used to refresh the mirrors, which matches the fresh-build ordering. The regression explicitly checks a cache hit and covers the CPU-overwrite and fresh-build controls. Please retain the cache-hit assertion if the fixture changes, since a forced rebuild would otherwise let an old reuse path pass. Local paired validation is pending.AI-assisted: yes.