feat(agc): keep driver pipeline caches and costly compute pipeline binaries across updates #13931
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/13931"
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 liskeee on 2026-10-31T13:06:48Z.
What
A large compute pipeline can take many minutes to build in the driver (#13538 reports 13 minutes on an RTX 4090), and today every AnyPS5 update throws that work away. Two changes keep it, with review fixes on top:
1.
fix(agc): preserve driver pipeline caches across source updates(+fix(agc): skip unchanged periodic pipeline cache snapshots). The driver blob moves out of the source-version directory, which every AnyPS5 update replaces with a new one (the old one is removed after 14 unused days), and a compatible legacy blob is imported once.SaveNowand the final save now write a content change of equal size (it was skipped before), while the 10-second background save keeps its cheap size-and-header check and copies nothing while the cache is unchanged. An incomplete snapshot no longer replaces the previous file.2.
feat(agc): persist costly compute pipeline binaries(+fix(agc): retain driver cache fallback after binary capture failuresandfix(agc): disable pipeline binaries with outdated wrapping layers). Costly compute pipelines are stored withVK_KHR_pipeline_binaryand restored without a rebuild:Anything missing, corrupt, rejected or mismatched falls back to a normal build.
APS5_NO_PIPELINE_BINARIESturns the store off. The store also stays off when an enabledVK_LAYER_KHRONOS_validationorVK_LAYER_LUNARG_gfxreconstructis older than Vulkan 1.3.294, because such a layer wraps handles but does not know the extension's commands. A marker never replaces a captured binary. Lowering the time threshold retries a recipe that was below it, but not one whose capture failed; a driver update retries both, because the key holds the driver fingerprint.Rollback: reverting the PR restores today's behaviour. At run time,
APS5_NO_PIPELINE_BINARIESturns the binary store off (the driver cache stays in its new place), and deleting the cache directory resets both caches. Blast radius: compute pipeline creation and disk use. Nothing is evicted yet; the debt entry and USAGE.md say so first.Overlap: #9508 replaces the compute creation call this touches, #11435 adds a pipeline-cache option beside the new store, and #7622 edits PipelineCache.cpp's includes. The pr-overlap bot also lists open PRs that touch neighbouring lines in VulkanDevice.cpp, Recorder.cpp, USAGE.md and the debt file. These are textual neighbours, not duplicates; I am happy to rebase on whichever lands first.
Tested
Windows 11 Pro 25H2 (build 26200), NVIDIA GeForce RTX 4080, driver 610.88.
[pipeline-binary] built key=bb77041da96ad820 words=1988739), and the next run restored it from the store instead of building it again. This PR makes no frame-time claim, so there are noaps5-summary.jsonllines;maincannot reach that pipeline in this title.VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1), selectionagc_(pipeline_cache|pipeline_binary|pipeline_journal|driver_recorder|driver_pipeline_journal):mainb8f0a6b20214/14, this branch 19/19; zeroVUID-and zero missing-layer messages in both.agc_driver_recorder_tests,agc_pipeline_binary_store_testsandagc_pipeline_cache_allocation_testspass 3 of 3 runs with the validation layer, no VUIDs.guest_wide_formatting(cp1250 zone name, #10987); none of them touches these files.tools/check_conventions.py --base origin/main: all checks passed.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-31T13:12:38Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
The PR claims a pipeline-creation speed improvement but does not include the matched performance captures required by the repository contribution rules.
What I ran
Reviewed head
8727a380d7a8ff14a8a65b40c31ba3ef83a85864against basecd087bd12c258cf6dbb82e203bafd20d9fe2596c; the precheck reports a clean merge preview. Environment: Linux x86_64, Python 3.11.2, GCC 12.2.0. No build or C++ tests were run locally.Results
git diff --checkmainatcd087bd12c258cf6dbb82e203bafd20d9fe2596cUnedited precheck output
git diff --checkproduced no output. The precheck report records both head and base unchanged at completion.Findings
Blocking
The PR description claims that a 1,988,739-word pipeline took about 32 minutes to build and 202.7 ms to restore. The repository requires a speed claim to include
aps5-summary.jsonllines formainand the change from the same machine and scene, the corresponding traces, and the performance-report evidence. The PR currently provides driver log timings but no matched summary lines, trace attachments, ortrace_digest.pyoutput. Please add the required matched artifacts, or remove the unsupported speed claim and describe the measured scope accurately.Non-blocking
None identified in this source review.
Sources
Not verified
I did not build or run the new C++ tests locally. The author-reported test results are not independently confirmed here; other GPUs and console behavior were not tested by me.
To get this to a good state
Add the matched
main/PR summaries, traces, and digest output required for the speed claim, or revise the claim to match the evidence provided. I will rerun the relevant checks on the updated head.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-31T13:59:55Z.
Review: CHANGES_REQUESTED
Re-checked — new head, changes requested
The prior performance-report gap has been addressed, but the periodic saver now copies the full Vulkan cache under an exclusive lock every ten seconds even when nothing changed.
What I ran
Reviewed head
8727a380d7a8ff14a8a65b40c31ba3ef83a85864against basecd087bd12c258cf6dbb82e203bafd20d9fe2596c; the live dependency/mergeability check passed and the PR head and base stayed unchanged during the precheck. Environment: Linux x86_64, Python 3.11.2, Git 2.39.5. No C++ compiler or build was run.Results
Precheck output
The precheck's overall
checks failedstatus is from its inability to find the optional localpr_abi_audit.pyandpr_test_quality.pyhelpers in its isolated checkout; the diff, conventions, and live mergeability checks passed.Findings
Blocking
PipelineCache::save(false, false)runs on the 10-second saver thread. The new path removes the previous unchanged-size/unchanged-header fast return, then takesPipelineCacheSynchronization::SnapshotLockand copies the entireVkPipelineCachepayload withvkGetPipelineCacheDatabefore comparing its hash with the settled header. That exclusive lock blocksLockForPipelineUse, so an unchanged large cache can stall pipeline creation on every saver tick. The later equality check avoids rewriting the file, but it occurs only after the full snapshot copy. Please restore a cheap unchanged check for periodicSaveUnlessBusysaves while retaining full-content comparison for explicit/final saves where same-size changes must be detected.Non-blocking
None.
Sources
Not verified
To get this to a good state
Keep periodic saves from taking a full exclusive snapshot when both the cached size and on-disk header are unchanged, while preserving the same-size-change check for explicit/final saves. I will rerun the same checks on the updated head.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-31T16:53:21Z.
Review: APPROVED
Re-checked — new head, looks good
The updated head fixes the periodic cache snapshot regression and retains the driver-cache fallback when pipeline-binary capture fails.
What I ran
Reviewed head
e65ab33664a8351420b0e7bf890e87d9c7abee12against the PR basecd087bd12c258cf6dbb82e203bafd20d9fe2596c; the live merge preview is clean against currentmainat474030e58424fefdb65e5df9f3820810fbb4553c. Environment: Linux x86_64, Python 3.11.2, Git 2.39.5. I did not invoke a compiler or build locally.I also inspected the complete PR diff and update discussion, including the periodic-save logic, binary-capture failure markers, active-layer check, and added tests. The precheck ran its live dependency/mergeability check against current
main.Results
mainat474030e58424fefdb65e5df9f3820810fbb4553cconventionsandlabelspassed on the exact head; no upstream build/test job is present in this check rollupmain(b8f0a6b202) and 19/19 on this head using an RTX 4080 with validation enabled and no VUIDs.mainbaseline and one is unstable there), plus 51 skips. Its run merged the PR head onto oldermain73f4f7e; it is useful corroborating evidence, not a current-main run.Unedited precheck command output
Conventions stdout:
ABI helper stderr:
Test-quality helper stderr:
The precheck's recorded conclusions were
diff_check: passed,conventions_and_pr_template: passed, andlive_dependency_and_mergeability_check: passed. These are report statuses; the successful diff check produced no output.Findings
Blocking
None found in the updated head.
Non-blocking
Sources
Not verified