test(agc): measure pipeline cache hits against the bytes a pipeline adds #7676
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7676"
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 DavidAmsellem on 2026-10-18T21:44:25Z.
What
agc_pipeline_cache_filedecides whether a pipeline is already in a cache by creating it andchecking that
vkGetPipelineCacheDatareturns the same size as before. That size is not stable on adriver that really stores pipelines.
Measured on an AMD Radeon RX 7900 XT (RADV NAVI31, Mesa 25.2.8), with
VkPipelineCreationFeedbackas the reference for whether a create hit the cache:A hit moves the serialized size by +8 or -8 bytes, so the exact comparison reports a hit as a miss
and the test fails on hardware with
the cache file lost the pipeline of the object that saved first. The driver keeps both pipelines:vkMergePipelineCachesand the round trip throughvkGetPipelineCacheDatawere checked separately and report a hit for both pipelines in everycombination.
lavapipe never stores anything in a pipeline cache (every size stays at 32 bytes), so the probe at
the start reads that as a device that does not keep pipelines and the whole test skips. That is why
CI has not seen this: on the only driver it runs, the test never executes.
This sizes each pipeline in an empty cache first and counts a change below half that as a hit, which
separates the 8 byte noise from the ~1348 bytes a real miss adds, with no fixed constant. The skip
now asks the same question directly: a device where a pipeline adds nothing to an empty cache does
not keep pipelines. lavapipe still skips, unchanged.
Open PRs #6958 and #6771 add further
holdscalls to this test; they do not touch these lines andthis change makes those assertions work on hardware too.
Tested
Linux (Ubuntu 24.04, GCC 13.3), full build, no CI run.
agc_pipeline_cache_fileon RADV NAVI31: fails 3 of 3 onmain, passes with this change.agc_pipeline_cache_fileon lavapipe: skips before and after.ctestwithANYPS5_REQUIRE_VULKAN=1: 1479 of 1480. The one failure isagc_driver_guest_memory_lifetime_direct, which needs read-write access to/dev/udmabufand isunrelated to this change.
python3 tools/check_conventions.py --base origin/mainpasses.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-10-18T21:46:00Z.
The current conventions check fails because the PR template sections
What,Tested, andChecklistare empty. The problem summary above is useful, but please move or repeat the implementation summary underWhat, report the local/CI validation underTested(or sayNot tested), and complete the checklist so the change can proceed through intake.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-18T22:08:25Z.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
core/libs/prx/libSceAgcDriver/tests/Recorder.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppImported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-18T22:33:45Z.
Windows and AMD's proprietary driver, since the description covers Linux and RADV. Radeon 860M (RDNA 3.5, driver 32.0.13058.8001), Windows 11 26300, WinLibs GCC 15.2.0 r7, Release,
BUILD_TESTING=ON. Build:main8a456334fwith #7677, #7673, #7671, #7666, #7676, #7675, #7672, #7668, #7664 and #7658 merged together (each merge clean, built once).agc_pipeline_cache_fileandagc_driver_guest_memory_lifetime_directpass 3 runs of 3. The test saves, merges and reloads the pipeline cache file under%TEMP%as expected.AI-assisted
Imported from boykopovar/AnyPS5. Originally posted by DavidAmsellem on 2026-10-18T22:36:22Z.
Thanks @LeandroLP23. One more data point would settle the scope of this: does
agc_pipeline_cache_filefail onmainwithout this PR on that driver?Your run has this PR merged in, so it shows the change is good there, but not whether AMD's
proprietary driver hits the same problem RADV does. On RADV the test fails on plain
mainbecause acache hit moves the
vkGetPipelineCacheDatasize by 8 bytes, which the exact size comparison readsas a miss (measured with
VkPipelineCreationFeedback: the driver reports a hit while the sizechanges, and a loaded blob can even shrink by 8 bytes after a hit).
If it already fails on
mainthere, this is AMD-wide rather than RADV-only. If it passes onmainthere, the proprietary driver keeps the size stable and only RADV moves it, which is worth recording
either way.
AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-19T00:27:50Z.
Review: COMMENTED
An NVIDIA data point for the scope question: on an RTX 3070
agc_pipeline_cache_filepasses onmaintoo, so the exact-size comparison does not misread a hit on this driver. With this PR it still runs (no skip) and passes.Machine: Ubuntu 26.04, i7-8700, GCC 15.2, Release,
BUILD_TESTING=ON. NVIDIA GeForce RTX 3070 (driver 595.99.02) and lavapipe (Mesa 26.0.3, LLVM 21.1.8) on the same host. PR merged ontomain84c1a4d9a(clean).ANYPS5_NO_SHADER_CACHE=1,-j1 --timeout 30.agc_pipeline_cache_filemain84c1a4d9a-V)the device does not keep pipelines in a pipeline cacheeccc81b50The
-Voutput is the same onmainand with the PR: the cache file is saved and reloaded at 6.3, 6.5 or 12.8 KiB, so a second pipeline adds roughly 6 KiB. Since the exact-size comparison onmainpasses, a hit doesn't move thevkGetPipelineCacheDatasize on this driver, and the RADV +8/-8 byte drift doesn't show up here. With a miss around 6 KiB, the half-pipeline threshold gives the same verdicts on NVIDIA.Not run: Windows, AMD, Intel.
GPUs tested: NVIDIA GeForce RTX 3070 (595.99.02) and lavapipe (Mesa 26.0.3), Ubuntu 26.04
Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
Imported from boykopovar/AnyPS5. Originally posted by MaxLikesCode on 2026-10-19T03:51:10Z.
Another driver that really stores pipelines: NVIDIA GeForce RTX 4090, driver 617.42, Windows 11 Pro 26200, WinLibs GCC 15.2.0 r7, Release,
BUILD_TESTING=ON. This head (eccc81b50) merged intomainad502d717.agc_pipeline_cacheagc_pipeline_cache_filemainSo the exact size comparison holds on NVIDIA, and the +/-8-byte movement looks specific to RADV. The new check passes here too. All 250 tests
tools/select_tests.pyselects for this change pass.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by thuanquang on 2026-10-19T07:37:35Z.
@DavidAmsellem for the scope question, on AMD's proprietary driver without this PR: RX 6700 XT (gfx1031, RDNA 2), driver 32.0.21045.5002, Windows 11 26200, plain
main7f596df48, WinLibs GCC 15.2.0 r7, Release.agc_pipeline_cacheandagc_pipeline_cache_filepass 3 of 3, and the file test really runs here (it doesn't take the 77 skip): it saves the 2.2 KiB cache, merges it to 4.4 KiB with the second object's pipeline, reloads it, and printsPipeline cache file merge tests passed. It also passed in three earlier full-suite runs on this machine (main505767380,6685795f7and023106ae4). So the exact size comparison holds on this AMD Windows driver, as on NVIDIA; the ±8-byte movement looks RADV-specific.