perf(recompiler): keep runtime-specialized shader modules in the shader disk cache #6924
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6924"
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 moong15 on 2026-10-16T18:56:06Z.
What
Runtime-specialized shader modules and their binding plans were rebuilt on every launch, even with a warm shader disk cache. They are built on the queue worker when a draw or dispatch first needs them, so the rebuild lands on the critical path while a title loads.
They are now stored in the shader disk cache next to their base artifact, keyed by the base artifact's digest plus the exact specialization inputs, and loaded on a warm start. A missing, differently keyed or damaged record is rebuilt. The disk cache format goes to 70.
APS5_NO_SPECIALIZED_DISK_CACHE=1turns it off. The[shader-disk-cache]line reports specialized module and binding plan hits, misses and writes.The specialized records are bounded.
APS5_SPECIALIZED_DISK_CACHE_ENTRIES(default 65536) andAPS5_SPECIALIZED_DISK_CACHE_MAX_MIB(default 2048) cap them together, and the least recently used specialized record is deleted when either limit is exceeded: after each specialized write, after a load that finds a record grown, and once at start. A record rewritten at another size moves the byte total by the difference. Base artifacts and resource plans are never evicted.0keeps none, the same asAPS5_NO_SPECIALIZED_DISK_CACHE=1. Both switches are neutral to the cache key and documented indocs/user/USAGE.mdanddocs/dev/ENVIRONMENT.md; the defaults are guesses, recorded indocs/dev/debt/shader.md. The start-up[shader-disk-cache]line prints the specialized entry count and size on disk, and the 10 s line reports evictions.A variant compiled without going through
findOrCompileVariant(useCache=false:recompileOnce, andRecompileImplwithout a cache or capture source) has no disk key.CompiledVariant::artifactIdentityis empty for such a variant, andspecializedDiskCachereturns false unless the identity has the full artifact-identity length. Those compiles neither read nor write specialized entries.The binding plan identity covers every input of
DescriptorBindingBuilder::Prepare: the buffer fields go throughBufferSpecializationFieldswith the substitutes, so a null V# is keyed by the substitute its slot learned, andfragmentDescriptorSetandshaderImageMinLodare key words. A specialized module loaded from disk carries the same fields as a built one (interned SPIR-V, hash, bindings, push data, specialization constants),artifactIdentityis set next toattachSubstituteson the disk-cache paths only, anduserDataRegisterReadsis computed inmaterializeResultwhether the plan was built or loaded. With draw and dispatch shaders prepared off the submit thread, each specialized lookup still runs inside onematerializeResultcall on the thread that makes it, and the shared LRU list and index change only under the specialized mutex.Tested
Windows 11 Pro 10.0.26300, MinGW GCC 15.2 Release build, AMD Radeon RX 9070 XT, AMD proprietary driver 26.10.1 (LLPC), 3840x2160. Stellar Blade (PPSA13197, 01.014.001). Builds:
main80fa4d510eand this branch on it (747f25ffe8); the branch also merges cleanly withmaine74dd5b992. I measured on80fa4d510ebecause one74dd5b992Stellar Blade stops at start-up with "guest sampler descriptor uses point preclamping which is not implemented". Both builds were staged as whole library sets and swapped between runs, the title was relinked once with themainrelinker, and the embedded commit was checked in each summary line (dirtyfalse in all). Warm shader and pipeline caches (each build ran the title before), same scene and settings, one session, noAPS5_PROFILE_*switch.APS5_TRACE_EVENTS=4194304is set because the default 262144 events per thread fill in about 11 s on the busiest queue worker of this title; stdout and stderr were written to files.Loading: first 90 s from the first present (
APS5_TRACE_SECONDS=0:90): main menu, save load and story start. Order: main, main, main, PR, PR, PR, main, main, PR, PR; the first launch after each swap is not counted. The first PR launch after a swap reads the specialized records from a cold disk: in an earlier set it took 15.7 s of specialized time against 8.1 s for the next PR launch. Specialized time is the sum ofShader.DrawStage.materialize,Driver.Draw.shader_compile_and_linkandDriver.Dispatch.materializeinphase_totals_msof each summary line.Driver.Dispatch.materializesRuns 5 and 6 reached the playable story start inside the window and the first four did not, so 5 and 6 are compared with each other. With the specialized records read from disk, specialized time falls from 10.3-10.6 s to 7.3-7.8 s in runs 1-4 and from 11.4 s to 9.6 s in runs 5-6, with
Driver.Dispatch.materializeabout halved; the longest loading frame falls from 6.7-8.4 s to 5.9-6.1 s and from 9.5 s to 8.0 s. Presents and p50 do not move beyond noise.trace_droppedis false in all six. Each PR launch read 1076-1114 specialized modules and 1435-1647 binding plans from disk and still missed 177-205 modules and 1349-2649 binding plans, which it built and stored: the binding plan identity carries image descriptor words that differ from launch to launch. The specialized entries on disk grew from 26874 entries and 492 MiB at the start of run 3 to 33025 entries and 590 MiB at the start of run 6, under the 65536-entry and 2048 MiB limits; no eviction happened.Steady play (
APS5_TRACE_SECONDS=400:90, interleaved main, PR, PR, main): presents 879 and 1012 onmain, 977 and 972 here. No regression; the spread between the twomainruns is larger than the difference.Summary lines (runs 1 and 3):
Traces,
trace_digest.pyoutput and summary lines of all captures: https://github.com/moong15/AnyPS5/releases/tag/pr6924-evidence-20261115 (archive SHA-256e492ce6e7c9eec7b3c058fd0af8825d4a00e8b241a726ad8bccca321af1f7059)Tests, all on the same machine and GPU,
ctest -V -j1 -R '^agc_(shader_disk_cache|float16_conversion|denormal_flush_elimination|shader_control_flow|wave_control_decode|driver_f16_denormal_flush|driver_f32_denormal_flush)'withANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validationandVK_LOADER_DEBUG=layer, onmain80fa4d510eand on this branch: 14/14 pass on both. The validation layer is 1.4.335, built fromVulkan-ValidationLayerstagvulkan-sdk-1.4.335.0and found throughVK_ADD_LAYER_PATH. Both logs showInsert instance layer "VK_LAYER_KHRONOS_validation"(inagc_driver_f16_denormal_flushandagc_driver_f32_denormal_flush, the two tests that create an instance); neither log reportswas not found but was requested by env var VK_INSTANCE_LAYERS; neither log has aVUID-line.agc_shader_disk_cacheruns two child processes for a record rewritten at another size, with a 1 MiB cap. In the first, a 256 KiB module is rewritten at 640 KiB and another 640 KiB module is stored: the directory must stay within the cap with one eviction. In the second, a 640 KiB module is rewritten at 256 KiB and two more 256 KiB modules are stored: all three must remain, with no eviction. With the size change left out of the byte total, the first fails with "a module rewritten larger was counted at its old size, so the entries on disk exceed APS5_SPECIALIZED_DISK_CACHE_MAX_MIB=1 (1311130 bytes)".bindingPlanIdentitypassing no substitutes toBufferSpecializationFields, the second process fails with "a null V# with no substitute learned was served the binding plan stored for a learned substitute" and the third with "a null V# did not specialize with the substitute this process learned".shaderImageMinLodon a fixture that samples an image: the second loads the plan and module stored without the flag, then compiles with the flag and must miss both and get a different module.shaderImageMinLodis part of the request key the base artifact's identity is built from, so one artifact never sees both values and the key word alone cannot be shown to matter; the test shows that a request with the other value is not served the stored entries.--uncached-specialized) that compiles twice withuseCache=falsefor a device with and one withoutRoundingModeRTEagainst one cache directory, and requires no specialized or binding-plan hit, miss or write and no stored entry.APS5_NO_SPECIALIZED_DISK_CACHE=1, the entry cap (an evicted record misses and is rebuilt, a recently used one survives), the byte cap, a malformed and a zero cap value, a base artifact that changes under the same specialization inputs, and theDescriptorBindingand specialized module round trips includingspecialization.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)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-10-16T22:09:56Z.
Review: COMMENTED
The idea is sound (rebuilding specialized modules and binding plans on every launch lands on the queue worker during loading), and the key test covers each input. The evidence does not yet show the gain, and the cache has no bound.
Driver.Packet343 ms per frame; cache off 783 presents, p90 42 ms, p99 1368 ms,Driver.Packet186 ms per frame. The description explains that the windows cover different parts of loading, which is the problem: they can't be compared. The "119 s against 138 s to the menu" is one pair read off the 10 s intervals, and the earlier runs it cites (83-112 s on, 105-159 s off) overlap. The cache-on trace also lost 344,091 worker events after 35 s (trace_dropped: true). Please post a pair that covers the same stretch (start the window at the same title milestone, e.g. the first menu present, and run to a fixed time after it), a second pair to show the spread, and traces that are whole (APS5_TRACE_EVENTS).SrtUserDataUse) and by JJenkx's refresh of it, and #6947 uses 38. Whoever lands second has to renumber; say which this PR expects to follow.Imported from boykopovar/AnyPS5. Originally posted by moong15 on 2026-10-17T05:07:41Z.
Bound on the entries. Added. Specialized module and binding-plan entries are capped by
APS5_SPECIALIZED_DISK_CACHE_ENTRIES(default 65536) andAPS5_SPECIALIZED_DISK_CACHE_MAX_MIB(default 2048), read likeAPS5_PIPELINE_STORE_ENTRIESandAPS5_PIPELINE_JOURNAL_MAX_MIBand neutral to the cache key. When either limit is exceeded the least recently used specialized entry is deleted (after each specialized write and once at start). Base artifacts and resource plans are never evicted, since only files with thespecialized-prefix are candidates.0turns the feature off. Both defaults are guesses and are recorded indocs/dev/debt/shader.md. Start-up now prints the entry count and size on disk, and the 10 s[shader-disk-cache]line reports evictions:Tests:
--specialized-cap-entries(the cap is enforced, an evicted entry misses and is rebuilt, a recently used one survives),--specialized-cap-bytes,--specialized-cap-invalid,--specialized-cap-off.A base artifact that changes under the same specialization inputs. Added
--load-specialized-artifact-changed. It changes one code word of a stored fixture's base artifact and requires one module miss and write, one plan miss and write, and the other 15 fixtures still hitting. The entry damage test also requiresKeyMismatchwhen an entry is decoded under another base digest with the same inputs.Format number. It stays 37 for now. If #5656 lands first, this PR moves to 38, or to 39 if #6947 also lands. The only literal is
ShaderDiskCache.hpp:17.Tests:
agc_shader_disk_cachepasses; full ctest 1346/1351, and the 5 failures also fail on main or depend on the environment.Imported from boykopovar/AnyPS5. Originally posted by Sam-mon7 on 2026-10-17T09:47:55Z.
From reading the diff: the disk load and store wrap
buildSpecializedModuleinsidespecializeModule, and the binding plan build insidepreparedBindingPlan. On main, neither function sits inside#if ANYPS5_ENABLE_SPIRV_TOOLS, and the diff adds no tools check, so this should also cover tools-off builds (the CMake default).That is the case raised in the Demon's Souls discussion #1283: 351 specialized modules rebuilt on every launch, about 60 s on Linux NVIDIA with the tools off, where the persistent cache in another branch only covered the tools-on path. A cold and a warm tools-off launch of that title would confirm it. I haven't measured it yet.
AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by moong15 on 2026-10-17T14:22:29Z.
Rebased onto
main47a266cf9. Two conflicts, both from codemainadded next to this PR's:runningWritersnext tobuildSpecializedKeyHeaderinShaderDiskCache.cpp, andremoveCacheDirectorynext to the new test helpers in the test file. I kept both sides of each.agc_shader_disk_cache(all modes, including the cap and changed-artifact cases) and the shutdown thread testsmainadded pass on the rebased head, andcheck_conventions.pypasses.The disk cache format stays at 37. #5656 and #6947 are still open, so the renumbering plan from my earlier comment still applies.
@Sam-mon7, correct. Neither
specializeModulenorpreparedBindingPlansits inside anANYPS5_ENABLE_SPIRV_TOOLSblock, and the cache adds no tools check. The Stellar Blade numbers in the description also came from a tools-off build (ANYPS5_ENABLE_SPIRV_TOOLS=OFF, the CMake default), so tools-off is the case that was measured. I haven't run Demon's Souls.@CnRJay, the matched pairs you asked for are still to come: two pairs of cache on and off, each starting at the first menu present and running a fixed time after it, with whole traces. I'll post them in a separate comment. The code is ready for review in the meantime.
Imported from boykopovar/AnyPS5. Originally posted by simonbronk on 2026-10-17T22:08:29Z.
Tested on Onimusha's menu: no measurable change in this scene.
Setup: Onimusha: Way of the Sword (PPSA27836), boot to the language menu with no input,
APS5_TRACE_SECONDS=60:30, warm cache. Windows 11 26200, RTX 5070 (617.42), 3840x2160. Basemain84b0d2f24+ #6557 #6727 #6762 (5c521efea), 6 runs (3 before and 3 after the PR runs). The PR is merged on top of it (clean merge), 3 runs.This scene may simply not exercise the path this PR speeds up. Summary lines and traces available on request. AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by moong15 on 2026-10-18T09:42:29Z.
Rebased onto
main09127eada. A correction to my earlier comments about the format number: neither #5656 nor #6947 landed first. #6095 took 37 onmain, so this PR now moves the disk cache format to 38 (ShaderDiskCache.hpp:17, still the only literal). #6947 also uses 38, so whichever of the two lands second renumbers.The only conflict was that line.
agc_shader_disk_cacheandagc_shader_disk_cache_large_filepass on the rebased head, andcheck_conventions.pypasses.@simonbronk, thanks for the Onimusha numbers. A language menu right after boot probably compiles few specialized modules, so no change there is expected. The gain shows up when a title loads its scenes on a second launch.
@CnRJay, the matched pairs follow in a separate comment.
Imported from boykopovar/AnyPS5. Originally posted by moong15 on 2026-10-18T10:31:49Z.
@CnRJay, matched runs of this branch at 3483ed283 (rebased onto
main09127eada, format 38), Stellar Blade, same scene: boot, start the story, idle in the opening cutscene. All four used the same warm cache directory (07a088e75f6aaf46, warmed by three earlier runs),APS5_TRACE_SECONDS=0:240,APS5_TRACE_EVENTS=4194304,APS5_PREBUILD_THREADS=16. Order ABBA: on, off, off, on; off isAPS5_NO_SPECIALIZED_DISK_CACHE=1.The first 60 s after the first present are a loading stretch whose frame count swings in both settings (1204, 640, 710 and 663 presents), so the comparison below is 60–240 s from the first present, where all four runs show the same scenes in the same order. Numbers are from the present events and slices in the traces.
Driver.Draw.shader_compile_and_link, 60–200 stotals_full: false).FAsyncLoadingThread, with the same call chain as an intermittent load crash I have seen with both settings. It wrote no trace and was repeated as run 2.The four traces and their
tools/trace_digest.pysummaries are available on request.Windows 11, AMD Radeon RX 9070 XT, AMD 26.8.1 (LLPC), 3840×2160.
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-19T01:50:15Z.
This pull request is labeled
perf, so it needs the summary line of a capture onmainand one with the change, from the same title, scene and machine, as the Performance report form asks. Please paste bothaps5-summary.jsonllines, attach the two traces and add the output oftools/trace_digest.py.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-19T12:38:59Z.
Review: CHANGES_REQUESTED
The specialized disk cache is keyed by
variant.artifactIdentity, but that identity is only filled infindOrCompileVariant. TheuseCache=falsepaths (Recompiler.cpprecompileOnce, andRecompileImplwith!request.useCache || capture.source == nullptr) callcompileVariantdirectly, so the identity stays all zeros.specializedDiskCache()(Recompiler.cpp:864) only checks that the span is 16 bytes long, so every such compile reads and writes the same zero-identity entries (module + binding plan) regardless of shader or target.Reproduces on current main + this PR:
agc_float16_conversion_testsfails with an empty cache directory (ANYPS5_SHADER_CACHE_DIR=<empty dir>): "a device without RoundingModeRTE for 16-bit floats got native f16 conversion" (the second compile gets the module stored by the first, which had RoundingModeRTE).agc_denormal_flush_elimination_testsfails ("0 f32 exponent masks, expected 1") onceshader_cachecontainsspecialized-8674b91093f318397fbd82aac7213630.bin, whichagc_shader_control_flow_testsandagc_wave_control_decode_testsalso write.APS5_NO_SPECIALIZED_DISK_CACHE=1, and withANYPS5_NO_SHADER_CACHE=1.To fix: treat an unset identity as "no specialized disk cache" (e.g. carry an explicit
hasIdentity/empty span instead of a zero-filled array, and makespecializedDiskCachereturn false for it), and check no other path builds aCompiledVariantwithout going throughfindOrCompileVariant. A test that compiles twice withuseCache=falseand different targets against the same cache directory would pin it.Also needed after rebasing on main:
FormatVersion41 (main is 40),DescriptorBindingfield-count assert 24, andimageAtomic64in thesameBindinground-trip test.Imported from boykopovar/AnyPS5. Originally posted by moong15 on 2026-10-19T16:49:32Z.
Thanks, you were right: a variant compiled through the
useCache=falsepaths never got a disk key, itsartifactIdentitystayed zero-filled, andspecializedDiskCacheaccepted it because it only checked the length, so every such compile shared the same zero-keyed module and binding plan.Fixed in e822824b8, rebased on main
95d901b93:CompiledVariant::artifactIdentityis now a vector that is only filled insidefindOrCompileVariantwhen the disk cache is used (BuildKey+BuildArtifactIdentity); every other path leaves it empty.specializedDiskCachereturns false unless it holds exactlyArtifactIdentityBytes, so these compiles neither read nor write specialized entries. No other path builds aCompiledVariantwith an identity.agc_shader_disk_cacheruns a child process (--uncached-specialized) that compiles twice withuseCache=false, for a device with and one withoutRoundingModeRTE, against one cache directory, and requires no specialized or binding-plan hit, miss or write and no stored entry. With the fix reverted it fails with "...was served the module compiled for a device with it (specialized hits 1, misses 1, writes 1; binding plan hits 1, misses 1, writes 1 ...)".agc_float16_conversion_testsinto an empty directory, and control_flow, then wave_control_decode, then denormal_flush_elimination into one directory, with the specialized cache on and withAPS5_NO_SPECIALIZED_DISK_CACHE=1; nospecialized-*file is written.FormatVersion41, theDescriptorBindingfield-count assert at 24, andimageAtomic64in thesameBindinground trip.The focused tests pass 7/7 on main and on this branch with the validation layer and
ANYPS5_NO_SHADER_CACHE=1, with noVUID-lines in either log. I also replaced the performance section: the earlier numbers compared the cache on and off in one build with dropped traces, so the description now has main against this branch, three runs each, with whole traces.Imported from boykopovar/AnyPS5. Originally posted by eliasbruno124-dev on 2026-10-20T15:39:51Z.
I tested d36ab7db8 on GTA III, PPSA03527/01.003.000, and found repeated specialization misses that may be worth fixing here.
After warming the cache, a separate diagnostic launch reported 57 specialized-module hits and 9 misses/writes, with no load or write failures. All nine newly written records already had an older record with the same base-artifact identity and every other specialized-key field, except
planIdentity. Each new payload was byte-identical to its older alternatives. Across the retained starts there are 92 module records but only 66 groups when that field is excluded; all nine duplicate groups have identical payloads.buildSpecializedModuleconsumes the artifact, vertex classes, constants and target.specializeModulealso shares results in memory by artifact variant and constants. The disk key additionally includes the binding-plan identity, so a different descriptor snapshot can rebuild the same module on the next process. Could the specialized-module key omit that extra identity while retaining it for the separately cached binding plan? A cross-process test should vary the descriptor snapshot without changing specialization inputs, require a module hit, and still check the resulting bindings against an uncached compile. At the time of this initial report I had not changed the runtime key. No competing PR has been published.The existing cache does work. The same eight focused test cases pass on both sides. The candidate also passes its cache round trips, changed-base-artifact, corruption, bounds and uncached different-target regressions. The real Khronos validation layer was loaded for the GPU case, with no new errors or skips. Host: RTX 3060 Laptop, NVIDIA 617.42, Windows 10.0.26300, i5-11400H, 32 GiB RAM.
The two alternating pairs of complete 20-second automatic-startup traces do not establish an overall speedup. Baseline maximum frame intervals were 4263/4314 ms; with this PR, 4065/4745 ms. All four traces had no dropped events and 61 verified loaded PRXs. Both sides used main
7526640c3plus the same deferred-settle correction from #8527; only this PR differed. These are opening-startup observations, not gameplay or a claim that the initial long interval is a shader stall.Update after a local regression and original-title check: changing only the guarded-image descriptor snapshot in a second process reproduces 16 module hits and 1 unnecessary miss/write on the unchanged implementation, although the result matches an uncached compile. Removing
planIdentityonly from the specialized-module key gives 17 hits and zero misses/writes; the changed binding plan still misses and is rebuilt, with output matching the uncached control. Artifact/target identity, module words, vertex classes, constants and registration defaults remain in the key. The new encoding uses a new format version.The same original GTA III startup, after warming the new cache normally, now reports 66 specialized hits, zero misses and zero new module records, versus 57 hits/9 misses before. All 66 module payloads match payloads already produced by the previous build. Both runs verified 61 loaded PRXs and unchanged original files. The corrected build passes the same eight native cases with the real Khronos layer, no validation errors or skips, plus the new cross-process regression. This proves removal of redundant specialization, not a loading-time or FPS gain. The focused local patch and failing/passing regression are ready for coordination here.
Prepared with AI assistance.
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-11-08T03:23:40Z.
Review: CHANGES_REQUESTED
mainmoved again (disk cacheFormatVersionis 57, so this PR would be 58) and the head no longer merges: conflicts inRecompiler.cpp(8 hunks),CompiledVariant.hpp,ShaderDiskCache.cpp,ShaderDiskCache.hpp,tests/ShaderDiskCache.cppanddocs/dev/debt/shader.md. The textual conflicts are the easy part; these need a decision when rebasing:preparedBindingPlanandDescriptorBindingBuilder::Preparenow also takesubstitutes(BufferSubstitute) andshaderImageMinLod. The disk key and stored plan for a binding plan must cover every input ofPrepare, including these two; a missing one serves a plan prepared for other inputs from disk. Please add a test that changes each of them under the same artifact and requires a miss.specializeModulenow returnsSpecializedSpirvand the registration module path usesSharedSpirv; the load/store of a specialized record has to produce and persist the same fields, not justspirv/bindings/pushData.attachSubstitutes(variant)runs on loaded and compiled variants; keepartifactIdentityset only on the disk-cache path, next to it.userDataRegisterReads(set inmaterializeResultonmain) must still be computed on a plan loaded from disk.FormatVersionto 58 and keep theagc_shader_disk_cacherun on the rebased head withANYPS5_REQUIRE_VULKAN=1and the validation layer, as in the template.The rest (the
useCache=falseidentity fix, LRU bounds, docs) looked fine on the previous head. If you can't get to it, say so here and we will do the rebase.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-23T02:52:15Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
Changes are required before merge: reject or safely clamp out-of-range decimal values for
APS5_SPECIALIZED_DISK_CACHE_ENTRIESso the advertised cache bound is enforced.What I ran
Reviewed head
77f6d9eb873a3caf22609893946f04f99cf984a9; no build or tests were run. Read the prepared description, commits, manifest and diff, plus targeted code in the four implementation files listed below. Also read the changed documentation files. All eight changed files were markedincluded: truein the manifest; no exclusions were listed there.files.jsonwas unavailable through the reader.Results
Findings
Blocking
core/shader/recompiler/ShaderDiskCache.cpp:1589: the parser accepts any string of decimal digits, butstrtoullreturnsULLONG_MAXon overflow and the return value is used without checkingerrno. For example, an entry limit larger thanuint64_tsilently becomes the maximum limit instead of falling back to the documented default. The cache can then retain far more entries than the configured limit. Check conversion overflow and use the documented fallback (or safely clamp) before computing the bounds.Non-blocking
None.
Not verified
No build, automated tests, or runtime measurements were performed. The reported Windows title measurements and test results in the description were author supplied, not independently confirmed.
files.jsoncould not be read; exclusions therefore were not verified independently.To get this to a good state
Handle decimal conversion overflow for the entry-count setting, then rerun the cache tests and build on the new head.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.