fix(agc): settle small private color target imports #22550
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/22550"
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 Scramblrrrr on 2026-11-17T20:15:17Z.
What
Allow a Windows
ColorTargethost-import request to settle writable private memory below the normal 1 MiB floor when the existing driver probe confirms that settling preserves write watching. Ordinary import requests retain their current threshold; unsupported devices retain the watched-target refusal.Currently a watched 64 KiB private resident allocation fails the color-target gate even on a device that supports watched private imports. A later ordinary import can unwatch it, preventing resident-target recording. Pass the explicit watch requirement through both the eligibility check and actual import creation. No renderer guard, import budget, allocation size or heap limit is relaxed.
Add a Windows regression using a private 64 KiB guest-arena allocation. It checks watched import coverage and reuse, every word of a GPU fill, neighboring bytes, subsequent CPU-store detection and clearing/reimport. If the hardware probe cannot preserve write watching, the same case verifies safe refusal instead. There is no title-specific path and no dependency on descriptor heaps.
This was found while cross-testing #9508: https://github.com/boykopovar/AnyPS5/pull/9508#issuecomment-6959521789 . That stack's passing results are separate from the current-main qualification below. This PR makes no gameplay or FPS claim.
Overlap review:
tools/pr_overlap.py --branch codex/watch-small-color-importschecked 1,777 open heads, found 49 shared-file comparisons, and could not complete 24 whose branches already conflict with main. Those 24 current heads were manually compared in the shared files: #4448, #5372, #6186, #6197, #6481, #7642, #9508, #9852, #10193, #10442, #10443, #12157, #12944, #13148, #13863, #13920, #13928, #13929, #15296, #15570, #15621, #16831, #18173 and #20315. No duplicate explicit ColorTarget watch requirement was found. This is not a globally clean overlap claim.#10443 changes the same threshold expression for a different purpose: its default is 65,537 bytes, explicitly leaving 64 KiB imports deferred. When combining, preserve its threshold on the ordinary-request arm and this PR's explicit watch requirement. #10442 concerns deferred import-at-map behavior and the existing first-use fixture; this change retains both. The remaining shared patches concern import lifetime, proofs, command tracking, storage views or accounting. #21155 and #22438 were also checked and address different cases.
Tested
Base main
2e22ad2062c556ee906ade70925d86dbfecd0e12; fixture-only controlce3cc43bf11e22b1c8c40caea6b96214189b7d30; candidate61ae32d9ec9174f9961ee55a0a70e40b58e1730f. Windows 11 Pro 26200, RTX 5070 Ti, NVIDIA 617.42; WinLibs GCC 15.2 r7, Release, SPIRV Tools OFF. Native comparison used the same independent Vulkan-Headers 1.4.340 checkout and Khronos validation 1.4.363 in both arms.Built the explicit
libSceAgcDriverandagc_driver_host_import_windows_teststargets. Compared the same byte-identical fixture EXE (SHA256B0327226A89337A3C652F743849165300E401093ADEDE97BFBCE7BD9B6A9BAEA) and baseline shared test dependencies, replacing onlylibSceAgcDriver.prxfor the candidate:watch-preserving small color import was refusedANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,ANYPS5_GPU=NVIDIA,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,VK_LOADER_DEBUG=layer; serial verbose CTest with regex^agc_driver_(host_import_windows|host_import_alias_failure|partial_resident_alias|small_color_import_watch)$. Each baseline control run has seven actual layer insertions; the expected-failing regression has one; each four-case candidate run has eight. No selected test was skipped, disabled, missing or not run. No VUID or SYNC-HAZARD identifiers and no missing requested Khronos layer message in either arm. Candidate four-case runs took 2.79, 2.73 and 2.77 seconds total.Conventions, whitespace and main-sync checks pass. Linux/macOS, other GPUs, the full suite and title gameplay are not qualified by this PR.
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)Summary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-23T03:43:35Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the inspected code supports the narrow Windows import change, and the reported Windows regression results are consistent with its intended behavior.
What I ran
Reviewed head
61ae32d9ec9174f9961ee55a0a70e40b58e1730fusingrepo_read.pyto inspect the prepared diff and targeted source ranges. No tests were run in this review. The Windows test results below are reported by the author.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The full
GuestBufferMemory.cpptext was excluded because it was too large for the review folder; I inspected the changed hunks and their surrounding functions through the pinned reader. The full test source beyond the relevant ranges, title gameplay, Linux/macOS behavior, other GPUs, and the full test suite were not verified. The report indescription.mdsaysfiles.jsonlisted exclusions, but that file was not available through the review reader; the manifest and review-folder listing identify the excluded source file.Files read:
description.md,commits.md,manifest.json,diff.patch,GuestBufferMemory.cpplines 1570–1680,HostImportWindows.cpplines 1–260, andagc_driver_host_import_windows_tests.cmakelines 1–16. Excluded from full-text review:GuestBufferMemory.cpp.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-29T23:42:42Z.
Review: COMMENTED
Actionable comments posted: 1
Architecture findings (1)
Advisory architecture findings (1)
c5149731-e64b-47e2-89d2-4181977c186bReviewing files that changed from the base of the PR and between
1f27e2abfaand1ea6c67133.core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_host_import_windows_tests.cmakecore/libs/prx/libSceAgcDriver/tests/execution/HostImportWindows.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-29T23:43:23Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the optional points below may help clarify the Windows regression’s behavior.
What I ran
Reviewed head
1ea6c6713380af40760204cc36d9586cca346471using the prepared diff andrepo_read.pyfor targeted source ranges. I did not run tests or fetch the diff again.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
Read:
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp(targeted ranges),core/libs/prx/libSceAgcDriver/tests/execution/HostImportWindows.cpp(targeted ranges),review/description.md,review/commits.md,review/manifest.json, andreview/diff.patch. The full text of the test CMake file is listed as included in the manifest, but was not read. The implementation file is excluded from the prepared full-text bundle due to size; its relevant functions were read through the pinned reader.review/files.jsonwas unavailable. No tests were run; Windows test results in the description are author-reported. Linux/macOS, other GPUs, the full suite, and title behavior were not verified.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T22:09:41Z.
Review: COMMENTED
The watch-preserving requirement is now passed to both admission and import creation. The new Windows fixture accepts a successful import and a safe refusal as separate outcomes. Please report which GPUs reached the successful branch, since a green result on a device that refuses the import cannot verify the regression. The paired Linux control is queued. It does not exercise the Windows-only branch.
AI-assisted: yes.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.