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

@@ -1150,7 +1150,7 @@ back.
| 115 | Pipeline layouts, set layouts, update templates | `P.lock` | None found | Shutdown |
| 116 | Stage libraries `libs[1024]` chained; failed builds cached as null | `P.lock` | None found | Shutdown (`libs_destroy`) |
| 117 | Library and pipeline job queues | `P.lock` | None found | When built; dropped at shutdown |
| 118 | `VkPipelineCache` in memory and `pipeline-cache.bin` | `cache_rw`, `save_lock` | File > `NX2NAVI_PIPELINE_CACHE_MAX_MB` (1024) starts empty; in memory: the driver's, none found | Saved by "pipe autosave" at most every 20 s and at exit (waits ≤ 5 s) |
| 118 | `VkPipelineCache` in memory and `pipeline-cache.bin` | `cache_rw`, `save_lock` | Each file > `NX2NAVI_PIPELINE_CACHE_MAX_MB` (RAM / 32, 1024 to 4096 MB) starts empty, and no cache past it is written; in memory: the driver's, none found | Saved by "pipe autosave" at most every 20 s and at exit (waits ≤ 5 s) |
| 119 | Pipeline binaries `pipeline-binaries.bin` | `PB.lock` | `NX2NAVI_PIPE_BINARIES_MAX_MB` 1024; `NX2NAVI_PIPE_BINARIES` default 0 | — |
| 120 | `pipeline-keys.bin` and its `seen` set | `K.io` | None found (append-only) | Never |
| 121 | `compute-used.bin` | `cu_io` | `NX2NAVI_COMPUTE_KEEP` 512 | — |