test(agc): settle the padding block's import before the write-back route checks #23751
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/23751"
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 Luis-0508 on 2026-11-19T15:48:23Z.
What
agc_storage_write_back_host_retilefails on Windows with NVIDIA Turing with(watched) linear 200x150: the linear write-back went through its scratch instead of retiling into the importor the same line forlinear 240x135, 2 mips(#23708). The test is wrong, not the write-back.On Windows a private writable host import smaller than
settleFloorBytes(1 MiB) is not settled at creation:importWatchingleaves it unwatched and it is registered for a deferred settle (GuestBufferMemory.cpp,importWatching,ImportWatched(..., false)), whichrewatchSettledImportscompletes later from aHostImportForpoll once the settle batch's fence has signalled. The two small linear cases allocate 0x40000 bytes, so their import starts unwatched; the larger linear cases are over 1 MiB and are settled synchronously.StorageTexture::WriteBackdecides on the watch state at the time it runs: a stored range that is not watched getssaveUnits(prepareStoredSave), and the direct import retile requiressaveUnits.empty(), so it saves through its scratch. That is intended: without the watch the next store needs the saved bytes. The test evaluatedGuestMemory::Watched(address, surfaceBytes)only afterSubmit,WaitQueueandSync, when the deferred settle had usually completed, and expected the direct retile from that later state. Whether the settle completed before the write-back's own poll is a matter of fence timing, so which of the two small cases failed varied between runs.The test now settles the block's import with
WatchedAfterSettle(under the GPU mutex, as the settle tests do) before the image is created, and the slab, padding-seed and import-retile expectations use that state. The small linear cases then reach the write-back watched and the direct-retile check runs for all four linear cases instead of depending on timing. On Linux and macOSimportWatchingdecides the watch once at import creation andWatchedAfterSettleonly returnsGuestMemory::Watched, so the expectations there are unchanged.No driver change.
Tested
Windows 11 Pro 26200, NVIDIA GeForce RTX 2080 (Turing), driver 621.14 (32.0.16.2114), Vulkan 1.4.357, WinLibs GCC 16.2.0 (x86_64-ucrt-posix-seh), Release,
BUILD_TESTING=ON, Ryzen 5 7500F.agc_storage_write_back_host_retilerun alone,ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1:VK_LAYER_KHRONOS_validationb40a0d6dc7After rebasing onto main
0b1e9644e9: this PR 20 of 20 passed,agc_storage_write_backpassed.Under the validation layer main passes, which fits the timing explanation: the slower submissions let the deferred settle finish before the write-back polls.
A temporary print (not committed) of the per-case state confirmed that with the change all four watched linear cases have the import watched before the write-back, expect the direct retile and take it (
LinearImportRetiles+1), in each of 3 runs. Before the change the small cases read unwatched beforeWriteBackand watched afterSync.All 144 tests that run
agc_driver_recorder_tests(fromtests/cmake/agc_driver_recorder_tests.cmake), on main and on this PR,ctest -j6 -VwithANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,VK_LOADER_DEBUG=layer, Khronos validation layer 1.4.368 (Vulkan-ValidationLayers nightly 2026-11-19, loaded withVK_ADD_LAYER_PATH):Insert instance layer "VK_LAYER_KHRONOS_validation"(141 times each) and neither containswas not found but was requested by env var VK_INSTANCE_LAYERS.VUID-line.python tools/check_conventions.py --base upstream/main: passed.tools/pr_overlap.py --branch: no shared lines with comparable pull requests; of those it could not compare (conflicting with main), none changes the lines touched here.Not run on Linux, macOS or another GPU vendor. Not run on a PS5.
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-19T17:00:39Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the targeted code supports settling the import before checking write-back routing, and I found no verified defect.
What I ran
Reviewed head
c6e40657a0a358a1244b8856516289a554488bae. Read the prepared description, commit summary, manifest and diff, then read the changed function and theWatchedAfterSettleimplementation and an existing test using it. No tests or builds were run.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The only changed file,
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp, was not included in the prepared full-text bundle, so I read its relevant ranges throughrepo_read.py; the full file was not read. No test execution was performed. Linux, macOS, other GPU vendors, and PS5 behavior were not verified. The reported test results and environment in the PR description are author-reported, not independently confirmed.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by throny on 2026-11-22T02:52:07Z.
Review: APPROVED
Approving on the RTX 4080 run above (0 of 30 failed with this change, 4 of 30 on
main).AI-assisted review (Claude Code)