diff options
| author | Aslan2142 <jan.trencansky@protonmail.com> | 2026-11-26 13:52:02 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-11-26 13:52:02 +0100 |
| commit | 73516a2902a9872e4d21d1bdbbde4e26059497c5 (patch) | |
| tree | e80650b51385d94ea153cd8df97034383b0bcc03 /runtime/src | |
| parent | a73a57e1339be072baf5522351c8ec7f1482b56b (diff) | |
| parent | 66e96ccea6ad25043f681f0a6485267280bc8070 (diff) | |
Merge pull request #1886 from DadaCap/session-cache-limit
Tested on main a73a57e13: Wine suite (clang-cl + xwin, RDNA2 iGPU, RADV) 412 pass / 22 fail / 39 skip on main and on main + #1886, 0 changes; Linux portable ctest 108/108; the new over_save_limit cases fail on main and pass here. Review points addressed in 66e96ccea. Windows CI cancelled; linux-gpu-tools CI failed at Build (log not available yet; the same job also fails on #1914, and it builds locally). AI-assisted (Claude Code, Claude Opus 5.5 review, Claude Fable 5.2).
Diffstat (limited to 'runtime/src')
| -rw-r--r-- | runtime/src/pipeline_cache_store.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/runtime/src/pipeline_cache_store.h b/runtime/src/pipeline_cache_store.h index 6d519d99b..5b93d93f0 100644 --- a/runtime/src/pipeline_cache_store.h +++ b/runtime/src/pipeline_cache_store.h | |||
| @@ -23,11 +23,18 @@ | |||
| 23 | 23 | ||
| 24 | namespace leonida::pipeline_cache_store { | 24 | namespace leonida::pipeline_cache_store { |
| 25 | 25 | ||
| 26 | // A session cache normally holds what one boot compiled (a few MB to a few hundred MB). The cap is what keeps a | 26 | // A session cache holds what the boots so far compiled: 1.28 GB after a few world frames on NVIDIA and still growing, |
| 27 | // cache seeded from the multi-GB corpus file -- whose data comes back as the whole union -- from being rewritten | 27 | // where a 256 MiB cap kept every later build from being saved. The limit applies to what the session adds: a cache |
| 28 | // at every exit. Past it the previous session file is left alone; raise the limit with | 28 | // seeded from the offline corpus file comes back from the driver as the whole union, so the seed's size is not |
| 29 | // LEONIDA_PIPELINE_CACHE_BYTES when a session really compiles that much. | 29 | // counted (over_save_limit), and a 9.7 GB seed plus a few hundred MB of new builds is still saved. Past the limit the |
| 30 | inline constexpr std::size_t default_save_limit = std::size_t{256} << 20; // 256 MiB | 30 | // previous session file is left alone; raise it with LEONIDA_PIPELINE_CACHE_BYTES when a session really compiles that |
| 31 | // much. | ||
| 32 | inline constexpr std::size_t default_save_limit = std::size_t{4096} << 20; // 4 GiB | ||
| 33 | |||
| 34 | // Whether a cache of `size` bytes, created from an offline seed of `seed` bytes (0: none), adds more than `limit`. | ||
| 35 | inline bool over_save_limit(std::size_t size, std::size_t seed, std::size_t limit) { | ||
| 36 | return size - (seed < size ? seed : size) > limit; | ||
| 37 | } | ||
| 31 | 38 | ||
| 32 | struct SaveLimit { | 39 | struct SaveLimit { |
| 33 | std::size_t bytes = default_save_limit; | 40 | std::size_t bytes = default_save_limit; |