Pipeline cache persistence uses full-size temporary heap buffers #2623

Closed
opened 2026-11-12 02:53:19 +00:00 by Arkex-ai · 0 comments
Arkex-ai commented 2026-11-12 02:53:19 +00:00 (Migrated from github.com)

Pipeline-cache persistence still allocates temporary vectors as large as the cache: pcache_file_read, play_file_write and full base-cache saves on main 55b976c0. That private allocation overlaps the driver's retained cache. #2206 provides a useful opt-out, but keeping the warm application cache should not require another complete heap buffer.

Local reproduction:

  • Authored 128 MiB input, Windows: the extracted reader added 128.25 MiB of private commit; a read-only file view added 0.25 MiB, with equal complete-input checksum. Rejecting allocations above 32 MiB rejected only the vector reader.
  • RTX 5070 Ti, Windows, warm reverse-order preparation pair: both paths prepared 17,955 graphics pipelines and saved identical cache bytes. The file-backed candidate had a 607 MiB lower sampled process-private peak (100 ms sampling). This is one local preparation comparison, not a cold-driver or FPS claim. Both runs retain one known failed shader from the input program set.
  • Two candidate processes loaded the same Kokiri checkpoint and exited normally using the persisted cache. These runs use an ef81aee7 host with byte-identical renderer API18 and the candidate renderer based on 55b976c0; they are not a full current-host build.

The scoped implementation keeps the cache format, generation retention, thresholds and existing switches. Reads validate the header first; Linux uses an owned private file snapshot. Writes use an owned sibling temporary and atomic publication of the actual returned length. Incomplete driver copies and I/O failures retain the old cache; a failed read must not delete a valid generation.

Linux snapshots need temporary disk space and extra I/O. Mapped pages still use RAM, and mapped media faults remain native faults. Driver-owned cache memory is not removed. Linux file tests pass; actual Linux Vulkan, AMD and Intel runtime validation are still missing.

Coordination: investigation claim, #2456 scope question. Preserve #2456's Intel synchronization, #2430's hardened opens/limits and #2317's path migration. #882's sandbox will need an intentional temporary-file policy; no in-place overwrite fallback is proposed.

Priority: S3 (1) × provisional reach 0.01 × reproduced confidence 1.0 = 0.01. Reach is an unmeasured planning assumption for large-cache installations, not an installed-base statistic or a claim to fix reported OOM crashes.

Pipeline-cache persistence still allocates temporary vectors as large as the cache: `pcache_file_read`, `play_file_write` and full base-cache saves on main `55b976c0`. That private allocation overlaps the driver's retained cache. #2206 provides a useful opt-out, but keeping the warm application cache should not require another complete heap buffer. Local reproduction: - Authored 128 MiB input, Windows: the extracted reader added 128.25 MiB of private commit; a read-only file view added 0.25 MiB, with equal complete-input checksum. Rejecting allocations above 32 MiB rejected only the vector reader. - RTX 5070 Ti, Windows, warm reverse-order preparation pair: both paths prepared 17,955 graphics pipelines and saved identical cache bytes. The file-backed candidate had a 607 MiB lower sampled process-private peak (100 ms sampling). This is one local preparation comparison, not a cold-driver or FPS claim. Both runs retain one known failed shader from the input program set. - Two candidate processes loaded the same Kokiri checkpoint and exited normally using the persisted cache. These runs use an `ef81aee7` host with byte-identical renderer API18 and the candidate renderer based on `55b976c0`; they are not a full current-host build. The scoped implementation keeps the cache format, generation retention, thresholds and existing switches. Reads validate the header first; Linux uses an owned private file snapshot. Writes use an owned sibling temporary and atomic publication of the actual returned length. Incomplete driver copies and I/O failures retain the old cache; a failed read must not delete a valid generation. Linux snapshots need temporary disk space and extra I/O. Mapped pages still use RAM, and mapped media faults remain native faults. Driver-owned cache memory is not removed. Linux file tests pass; actual Linux Vulkan, AMD and Intel runtime validation are still missing. Coordination: [investigation claim](https://discord.com/channels/1568810484818378804/1570103281856806962/1570255465806565520), [#2456 scope question](https://git.magicbean.dev/MagicBeanDev/Hookshot/pulls/2456). Preserve #2456's Intel synchronization, #2430's hardened opens/limits and #2317's path migration. #882's sandbox will need an intentional temporary-file policy; no in-place overwrite fallback is proposed. Priority: S3 (1) × provisional reach 0.01 × reproduced confidence 1.0 = 0.01. Reach is an unmeasured planning assumption for large-cache installations, not an installed-base statistic or a claim to fix reported OOM crashes.
Commenting is not possible because the repository is archived.
No milestone
No assignees
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Hookshot#2623
No description provided.