Keep the pipeline cache files under their limit when writing them, and set the limit from the RAM.

The limit was only checked when a file was read, all or nothing, so a run could write a file the next start then
dropped whole. On an RTX 5080 (0.9.2) pipeline-cache-play.bin reached 524.9 MB in one session and the next start began
empty; pipeline-cache.bin grows 14-28 MB at each fold and crosses 512 MB within a few sessions. Now a fold is made only
when its result fits, and a cache past the limit is not saved again, so the file keeps its last save under the limit.
Unset, the limit is the RAM / 32 between 512 and 4096 MB (512 on 16 GB as before, 2048 on 64 GB), which on that PC
took boot hits from 14 to 84 % and left no pipeline to background builds.

Taken into the 0.10.0 line with its conflicts resolved: the line had raised the limit to 1024 MB and says why in
the comment above cache_data_read, in nx2navi.ini.example and in AUDIT.md; those texts keep that reason and give the
RAM-based default, whose floor the next commit raises to match.
This commit is contained in:
Leyukaka
2026-11-13 00:10:02 +01:00
committed by chrg6
parent 70c9935789
commit fe5bff8328
5 changed files with 113 additions and 14 deletions

View File

@@ -209,10 +209,12 @@
# build_reserve_mb = 64
# 1: the log says how many pipelines came from pipeline-cache.bin; 2 also logs every compute pipeline built. 0: off.
# pipe_feedback = 1
# pipeline-cache.bin larger than this (MB) starts empty and is rewritten (0: no limit). With the pipeline list of
# 0.9.1 and later a full cache is about 550 MB on an NVIDIA card, so the limit has to stay well above that: under
# it the cache is thrown away at every start and the pipelines are built again each time. Default: 1024.
# pipeline_cache_max_mb = 1024
# The limit of pipeline-cache.bin and of pipeline-cache-play.bin, each, in MB (0: no limit). A file larger than
# this starts empty, so the game never writes one past it: once a cache reaches the limit, pipelines compiled after
# that are compiled again at the next start. With the pipeline list of 0.9.1 and later a full cache is about 550 MB
# on an NVIDIA card, so the limit has to stay well above that. Default: your RAM / 32, between 1024 and 4096 (2048
# with 64 GB).
# pipeline_cache_max_mb = 2048
# 1: the pipelines a run compiles go into pipeline-cache-play.bin, a small file of its own, so pipeline-cache.bin
# (hundreds of MB) is not written again while you play; the small file is folded into the large one at a start once
# it has grown. 0: one file, written whole whenever a run made a new pipeline.