test(agc): skip the draw input mirror cases on devices whose memory is all device-local #20831
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/20831"
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 peacocksir on 2026-11-15T16:24:01Z.
What
#16760 added device-local mirrors for reused vertex and index snapshots. Three of its tests fail on devices whose memory is all device-local:
agc_draw_input_mirrors,agc_draw_input_reuseandagc_driver_recorder:a reused draw input came back without its device-local mirror(drawInputMirrorTests)an unchanged draw input was copied again(drawInputReuseTests, whichagc_driver_recorderalso runs)The driver behaves as intended.
Recorder::mirrorDrawInputmakes no mirror whencontext.HostMemoryType(~0u)finds no memory type outside a device-local heap, because a mirror wouldn't move the bytes anywhere faster. The tests setmirrors = Recorder::DrawInputMirrors(), which only readsAPS5_NO_INPUT_MIRRORS, so on these devices they expect a mirror the driver never makes.Since #23093 and #23442,
mainskips these tests on CPU Vulkan devices (llvmpipe, lavapipe), so they no longer fail there. They still fail onmainon GPUs whose memory is all device-local:mainadbc1273c5(table below).agc_driver_recorder).#25537, opened on 2026-11-22, made the same
mirrorsandvertexWindowMirrorTestschanges to the same file. Its author agreed that this pull request could go first (https://github.com/boykopovar/AnyPS5/pull/25537#issuecomment-7093992905) and closed #25537 on 2026-11-23.This PR changes only
tests/Recorder.cpp:drawInputMirrorTestsanddrawInputReuseTestssetmirrorstoRecorder::DrawInputMirrors() && context.HostMemoryType(~0u), the driver's own condition. On a device where it's false, they check the no-mirror path: the host snapshot is returned and no mirror bytes are counted.vertexWindowMirrorTestsreturns early on the same condition, as it already does when mirrors are off.main's CPU Vulkan skip stays on the next line.--draw-input-mirrors-onlyexits 77 withskipped, the device has no memory type outside its device-local heaps, so draw inputs get no device-local mirrorwhen mirrors are on but the device can't make them. Without the skip,agc_draw_input_mirrorswould pass there by printingDraw input mirror tests passed with mirrors on, although no mirror was made. (An earlier version of this description said it could not pass; that was wrong, becausemain()prints the line from the environment variable alone.) The no-mirror path still runs there inagc_driver_recorderandagc_draw_input_reusewith mirrors on, and inagc_draw_input_mirrors_off.!mirrorsfailure message now names both reasons for taking that path.On a device with a host heap (discrete GPUs), the gate is true and every mirror case still runs. The driver's other refusal paths (mirror budget,
WithinDeviceLocalHeadroom) are unchanged and already covered by the existing cases.Tested
Head
8a4d66ec07onmainadbc1273c5, rebased after #23442 merged. The one conflict was the guard line ofvertexWindowMirrorTests, where #23442 addedSkipOnCpuVulkan; both lines are kept, this PR's memory-type return first.python3 tools/rebase_verify.py 4294e0c3d2 8a4d66ec07 --onto origin/mainreports that all added and deleted lines are kept.All A/B runs used the same command and environment on both sides:
ctest --test-dir build -R '^(agc_driver_recorder|agc_draw_input_reuse|agc_draw_input_mirrors|agc_draw_input_mirrors_off)$' -V, 3 times per side and GPU, withANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation. Themainside isadbc1273c5; the PR side isadbc1273c5with this commit applied.Windows 10 22H2 (19045), WinLibs GCC 15.2.0 r7 UCRT, Release, Vulkan SDK 1.4.363.1 validation layer, implicit layers disabled (
VK_LOADER_LAYERS_DISABLE=~implicit~),VK_LOADER_DEBUG=layer. One PC with both GPUs, each selected withANYPS5_GPU. Every log shows the loader insertingVK_LAYER_KHRONOS_validation, none haswas not found but was requested by env var VK_INSTANCE_LAYERS, and none has aVUID-line.mainadbc1273c58a4d66ec07agc_draw_input_mirrorsfails (no device-local mirror),agc_draw_input_reuseandagc_driver_recorderfail (copied again);_offpassesagc_draw_input_mirrorsskips with the message above, the other three passwith mirrors onwith mirrors on, no skipThe RTX 4060 rows show the gate keeps the mirror cases running on a GPU with a host heap.
Ubuntu 24.04, GCC 13.3.0, Release, lavapipe (Mesa 25.2.8, LLVM 20.1.2), Khronos validation layer 1.4.335 built from source,
/dev/udmabufaccessible. NoVUID-line in any log. I did not log the loader for these runs, so they don't show the layer being inserted.mainadbc1273c58a4d66ec07agc_driver_recorderagc_draw_input_mirrorsagc_draw_input_mirrors_offagc_draw_input_reuseOn lavapipe both sides now avoid the failure, so the fail-on-
main/ pass-on-PR evidence at this head is the UHD 770 table. Before #23093,maine4caa07950failed all three tests 3/3 on lavapipe here and this PR passed or skipped them; that run is in the earlier version of this description and in my comments.Other checks:
python3 tools/check_conventions.py --base origin/mainpasses.tools/check_skips.py's device-limitation pattern accepted it.tools/pr_overlap.py --branchat this head, run on 2026-11-21 before #25537 was opened, reported no overlap; it could not compare 28 open pull requests that touchtests/Recorder.cppand conflict withmain. I searched each one's diff for changed lines that nameDrawInputMirrors,HostMemoryType(~0u),drawInputMirrorTests,drawInputReuseTests,vertexWindowMirrorTests,APS5_NO_INPUT_MIRRORSor the mirror failure message. None has any.Not tested by me: AMD, Linux on a real GPU, and macOS / MoltenVK. Others' runs at earlier heads are in the comments: Linux and Windows lavapipe CI by chitters2004; RTX 4090 and lavapipe by domx4q; Linux with an Intel HD Graphics 630 (Mesa 25.2.8 ANV), llvmpipe and a GTX 1050 Ti by GiannisG1; and macOS 27.2 on an Apple M4 with MoltenVK 1.4.2 by kurexw (
agc_driver_recorderfails 3/3 onmain3b17977ba6and passes 3/3 with this PR). At the current head: macOS 27.3 on an Apple M5 Pro with MoltenVK by Gonic0 (agc_driver_recorderfails 3/3 onmainea07e039a9and passes 3/3 with this PR; the two mirror tests skip on both sides because/dev/udmabufcannot be opened).Checklist
main; no other open PR implements the same functions (true when opened on 2026-11-15; #25537, opened on 2026-11-22 and closed by its author on 2026-11-23, made the same test changes, see What)NotImplemented_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 MarcZX10 on 2026-11-16T19:15:30Z.
Review: APPROVED
Reviewed — looks good
The reviewed change at head
4294e0c3d27faf14ba7d59a3a4d1ba8427469b10aligns mirror tests and skip behavior with the driver's host-memory condition; no blocking defect was found in the inspected code.What I ran
No tests or build commands were run. I inspected the prepared diff and targeted source ranges using
repo_read.pyreader tools.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
I did not run tests, build the change, or independently verify the test results in the description. The changed file’s full text was excluded from the review bundle; I read the changed functions and relevant driver and CTest context through
repo_read.py. No other changed files were listed.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by kurexw on 2026-11-16T23:01:58Z.
Review: COMMENTED
Tested on macOS 27.2 / Apple M4 with MoltenVK 1.4.2 (LunarG Vulkan SDK 1.4.363.1, validation layer 1.4.363), x86-64 build under Rosetta. This is the only GPU I tested.
Head
4294e0c3d2merged alone onto main3b17977ba6, compared with3b17977ba6itself. I ran the 29 AGC tests that fail on main on this Mac, withANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validationandVK_LOADER_DEBUG=layer, throughctest --test-dir build -R <those 29> -V, three runs per side. Every Vulkan test loggedInsert instance layer "VK_LAYER_KHRONOS_validation"and none loggedwas not found but was requested by env var VK_INSTANCE_LAYERS.agc_driver_recorderThe other 27 tests gave the same result on both sides.
agc_driver_label_after_import_copyis flaky on main as well: main Failed, Passed, Passed, this PR Passed, Passed, Passed. Every failure on either side is the same timing check ("round N: a CPU read after the label that followed the copy found K of 262144 destination bytes not yet copied"), and it varied the same way across the other PRs I tested in the same session, so I don't attribute it to this change.VUID-lines: identical per test on both sides (30 on main, 30 with this PR, over the three runs). TheVUID-lines on both sides are main's existingVUID-VkDeviceCreateInfo-sType-unique(a duplicatedVkPhysicalDevicePortabilitySubsetFeaturesKHRin the device pNext chain) andVUID-VkSamplerCreateInfo-samplerMipLodBias-04467; this PR adds none.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T02:28:42Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the targeted tests and guards align with the driver's device-local mirror condition.
What I ran
Reviewed head
8a4d66ec076f2ec61fd38b5289370f99ac83fff3. Read the prepared description, commit summary, manifest, diff, and the changed functions and test entry point throughrepo_read.py. No commands or tests were run in this review.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The full text of
core/libs/prx/libSceAgcDriver/tests/Recorder.cppwas excluded from the review folder due to size; the relevant changed hunks, surrounding functions, and test entry point were read through the pinned reader. No tests were run by the reviewer. The author reports that the full ctest suite was not rerun at this head and that AMD, Linux on real GPUs, and macOS/MoltenVK were not tested by them.To get this to a good state
Nothing is required.