Repository navigation
fix(agc): reapply pipeline cache persistence with guarded key queries - #15169
Conversation
…naries across updates Re-apply boykopovar#13931, reverted in boykopovar#14839, including the maintainer's architecture notes and pipeline-binary skip message. Preserve main's Recorder TestConfigurationError handling while restoring the binaryTest constructor argument. Retain main's debt entries. Link the binary-store test against libSceAgcDriver after main moved DeviceProcLookups out of the header. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On an NVIDIA Linux driver, device creation crashed right after the global pipeline-binary key query returned VK_SUCCESS, so boykopovar#13931 was reverted in boykopovar#14839. The cause is not established. Key queries now write into a guarded scratch output, and the store is enabled only when the result, sType, pNext, key size and guard are all valid; otherwise it stays disabled with one log line and the driver pipeline cache is used. This catches bounded output overruns and malformed keys, not a driver that corrupts registers. agc_driver_pipeline_binary_startup creates the production device with the shader cache enabled and requires the store to be ready where the device has VK_KHR_pipeline_binary. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolve the descriptor-layout conflict in VulkanDevice.cpp: keep main's scratch pool layouts and let the binary key tell 0, 1 or 2 extra sets apart, so keys of layouts without a scratch pool stay the same. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019xuZ6BonuXDhiVUjiuoLx2
|
@oneandonlydean I merged AI-assisted: yes (Claude Code) |
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
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.
|
|
Hi @liskeee, Ran your command on the affected RTX 4090 machine (NVIDIA driver 610.57.04, Linux), at head
So |
Resolve two conflicts with main 6773f91. VulkanDevice.cpp: keep main's APS5_HEADLESS_PIPELINE_CACHE loading condition and the binary store creation. tests/Recorder.cpp: keep main's portability-subset features next to maintenance5, pipeline binaries and the internal cache control, both in the device feature chain. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@oneandonlydean Thank you for running it on the RTX 4090. 28/28 with and without the validation layer and I merged I'm marking it ready for review. AI-assisted: yes (Claude Code) |
|
Checked the key-query guards, the fallback paths (rejected key, missing/corrupt/rejected binary, capture failure), the device extension list, the legacy cache import and the docs against the diff. @oneandonlydean's RTX 4090 run (28/28 with and without validation, |
This reverts merge commit 7259cce, reversing the changes made to 3cd86e6. Main crashes at boot with SIGSEGV in PipelineBinaryStore::queryKey (PipelineBinaryStore.cpp:42), called from the PipelineBinaryStore constructor in VulkanDevice::VulkanDevice during Driver::AttachWindow. Two-point check on one title (PPSA31246), RTX 4090, NVIDIA proprietary driver, 10 alternating 25 s boots per build: - 3cd86e6 (main just before the merge): 0 of 10 crashed - 7259cce (the merge): 6 of 10 crashed at 2.1-2.5 s, before any present The crash is intermittent, so one clean boot proves nothing. The root cause in queryKey is not investigated here; this is an exact inverse of the merge so the change can come back once it is fixed.
revert(agc): revert #15169 pipeline binary store reland
|
Hi @liskeee, Thanks for the reland. We've had to revert it in #17982 for now: main started crashing at boot, and a bisect points at this merge. What we saw (RTX 4090, NVIDIA proprietary driver, Linux, one title, 10 alternating 25-second boots per build):
Every crash has the same stack: It is intermittent, so a single clean boot doesn't rule it out. We haven't dug into why The revert is an exact inverse, so the change can come straight back. A reland with a fix for |
|
The cause of the Setup: Linux, RTX 4090, NVIDIA 620.70.06 ( Reproduces without a title. With no Vulkan layers (
Registers around the call, from gdb on
Where it faults. In the Release build, Why it is intermittent. After the call,
Titles, start-up sweep on
Driver versions. This is a known NVIDIA driver bug, not a new one.
For a reland: those projects avoid the call on this driver. unicorn_overlord_pc leaves Edited 2026-11-10: the "Driver versions" paragraph said the bug was new in 620 (610 OK, 620 broken, 615 untested). That was wrong. It is a known NVIDIA bug, present since at least 610.47, so the earlier 610 passes were luck. I added the NVIDIA forum report, the other projects that hit it, and their workaround, and updated the reland suggestion to match. The measurements above are unchanged. Tested and written by Claude (AI assistant) on a contributor's machine. |
|
Thank you, @oneandonlydean, for the crash report and the revert, and @Tamalero for the register trace. I opened #18082 to re-land the store with AI-assisted: yes |
…s off With an active validation or gfxreconstruct layer older than 1.3.294 on a driver that is not gated, the device leaves VK_KHR_pipeline_binary off on purpose, and the test failed its check that an allowed driver enables the extension. It skips there again, as boykopovar#15169 did. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What
I reapply #13931, reverted in #14839: driver pipeline caches survive source updates, and eligible compute pipelines are captured and restored with
VK_KHR_pipeline_binary, with ordinary driver-cache fallback. Against mergedmain6773f91a7eI keep main's recorder error handling, debt entries,APS5_HEADLESS_PIPELINE_CACHEloading condition and portability-subset test features, and link the store test againstlibSceAgcDriverbecauseDeviceProcLookupsmoved out of the header. The binary layout key also tells main's scratch-pool layouts apart (0, 1 or 2 additional descriptor sets); layouts without a scratch pool keep the same contribution to the key.New in this PR: global and per-pipeline key queries write into separate, 64-byte-aligned heap scratch followed by a 64-byte guard filled with
0xa5, and a key is accepted only afterVK_SUCCESS, an intact guard, the expectedsType, a nullpNextand a size from 1 toVK_MAX_PIPELINE_BINARY_KEY_SIZE_KHR.A rejected per-pipeline key falls back to an ordinary build for that pipeline. I have not found the cause of the NVIDIA Linux startup crash in the code: the call uses the Khronos function-pointer type from the device resolver, the output structure is initialised, and the feature is enabled before the call. These checks detect malformed keys and writes that reach the guard; they cannot contain arbitrary driver corruption or clobbered registers, and they cannot stop a crash inside the call.
APS5_NO_PIPELINE_BINARIESstill turns the store off before the call.Tested
Windows, NVIDIA GeForce RTX 4080, driver 610.88, and the affected Linux RTX 4090 (run by @oneandonlydean). No title or performance claim.
c8244e0269merged with themainof that day and reports 28/28 passing withVK_LAYER_KHRONOS_validationand 28/28 without it, noVUID-line and no crash, with the startup test reportingstore readyon that device. I treat this as startup and store coverage, not a full game boot.ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,ctest -j 1 -V, the 139 existing tests registered in the files this PR touches (pipeline cache, recorder and Vulkan test-device tests):main6773f91a7e139/139, this PR1202ace37c139/139 (the laterbe14e4c25echanges only the debt entry's coverage sentence). The validation layer loaded in both logs, neither reports a missing requested layer, and neither has aVUID-orSYNC-HAZARD-line.sTypeor non-nullpNextfor global and per-pipeline keys, a corrupted guard and the fallback after a rejected global key. The new tests require the added scratch type andIsReady. With the startup test,agc_pipeline_binary_vulkanand threeagc_pipeline_cache_allocationmodes, all 17 tests this PR adds pass under the settings above.agc_driver_pipeline_binary_startup(new): creates the production device with the shader cache enabled in a temporary directory and requires the store to be ready when the device hasVK_KHR_pipeline_binary(exit 77 withskipped, the device lacks VK_KHR_pipeline_binaryotherwise). On the RTX 4080 it printspipeline binary startup: global-key query completed successfully; store ready; device=NVIDIA GeForce RTX 4080; driver=NVIDIA 610.88.ANYPS5_NO_SHADER_CACHEnorAPS5_NO_PIPELINE_BINARIESset, validation layer loaded), RTX 4080: 103/103 pass: the startup test, the binary-store and pipeline-cache tests,agc_driver_small_copy_sync, bothagc_driver_address_passestests, the otheragc_drivertests that do not disable the cache, and the automatically addedagc_driver_pm4_replayfixture (which disables the shader cache itself). NoVUID-line.agc_pipeline_binary_vulkansaves binary records for two pipelines and restores both in the next process. Onmain6773f91a7e, the 85 of these tests that exist there, plus the fixture, pass 86/86. The binary round-trip test uses trivial shaders and an empty layout, so it does not test scratch-pool layouts.Checklist
main; no other open PR implements the same functionsMerged with
main6773f91a7e, without a force-push.tools/pr_overlap.py --branchon 11-09: of the 295 open PRs that share files or exports with this branch, none of those it could compare has conflicting lines; 94 conflict withmainthemselves, so it could not compare them and failed closed (mostlyVulkanDevice.cpp,Recorder.cpp,CMakeLists.txt,ENVIRONMENT.mdand the debt file). A GitHub search found no open PR implementing driver pipeline caches or pipeline binaries.NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt fileNo unimplemented exports or silent stubs are added.
.mdfiles or images added to the repository (attach them to this PR)No third-party code is added.
🤖 Generated with Claude Code