AGC: on NVIDIA 615.78.08 (Linux) a saved vk-pipelines file serves another process only the pipelines its writer stored first; with an empty driver shader cache one title recompiles 13 compute pipelines of 1.0-3.7 M words on every warm boot #11106

Open
opened 2026-10-25 17:43:19 +00:00 by SleglJan · 0 comments
SleglJan commented 2026-10-25 17:43:19 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-25T17:43:19Z.


On an RTX 3080 with NVIDIA 615.78.08 on Linux, the vk-pipelines file AnyPS5 saves serves the next process only the pipelines the writing process stored first. In one title (147 MB file, 754 entries, written by one run), nine warm runs with the driver's shader disk cache empty each report a creation-feedback miss on the same 13 compute pipelines of 1.0-3.7 M SPIR-V words. The runs started from that file or from the 757-entry files that two of them saved.

Setup

  • RTX 3080 (10 GB), NVIDIA 615.78.08, Linux 7.2.10 (CachyOS), X11 window through XWayland, Vulkan 1.1 instance, Release builds.
  • Trees: main 5357acd697 plus #5372 at 30868735e8 with its 662a50bf7e reverted, plus local logging; four of item 1's nine runs also carry a local per-pipeline cache file store. Every environment variable, the local diagnostics and the tools: details below.
  • Title PPSA11386 (007 First Light), scripted input, its two feedback-wait limits widened as in #6172 (local only); a local bubblewrap sandbox (read-only root, fresh tmpfs HOME, no network) leaves the driver's shader disk cache empty. "On mode" is the driver's default, "off mode" is __GL_SHADER_DISK_CACHE=0.
  • Each warm run starts from the files a first run saved.

What the title runs show

  1. Nine warm runs from on-mode files (three files): the 13 modules (8 in the journal replay at boot, 5 on the dispatch path) miss exactly once each per run; the dispatch path is served the same four of its nine pipelines over 1 M words (31-537 ms), the first four over 1 M words the 754-entry file's writer compiled (at boot, before the other five dispatch-path ones and, much later, the eight replay modules). Size queries read +0 B on every line in 8 of 9 runs; item 3's three runs built their five dispatch-path misses from per-pipeline files instead. A hit flag alone is not "served" (8-19 hit-flagged replay creations per run take 10-106 s); served below means hit-flagged and created in under 1 s.
  2. One run: a file a local journal-replay tool wrote in off mode (395 pipelines, 16 threads, largest modules first, 65,397.7 KiB), read in on mode, served the two modules that process compiled first (241-256 ms) and missed the six it compiled after them (29-73 s); the cache grew after every miss.
  3. Three runs: per-pipeline cache files written by the title process; the 11 creations per run that met a module not yet compiled all missed (0.98-101.8 s). 51 of the 56 files carry a dictionary entry, the 11 behind those misses among them; the 5 without one were the writer's first 5.
  4. One pair: both runs loaded the 754-entry file; the first filled a driver shader disk cache kept outside the sandbox, and the second's replay took 1,994 ms instead of the first's 185,374 ms, its title screen 160 s instead of 534 s.
  5. One pair, off mode on both sides: the writer replayed the 395-pipeline journal from the start (it began from the files of the run that wrote the 754-entry file, without that file; that run itself had started with no journal). Its 757-entry file served one of the eight replay modules (1,098,412 words, 24 ms), the first pipeline over 1 M words it stored, and none of the nine dispatch-path ones (all missed, 17-123 s).

Not tested: another GPU or driver version, Windows, the driver disk cache at its default size, a single-threaded replay (which would attribute each replay variant to its own entry).

Options we see, none proposed here: keeping the driver's shader disk cache persistent (documented variables); per-pipeline files from short-lived helper processes that reach the X display (single-entry files imported in every synthetic test and in the journal replays up to 1.1 M words, one of the 13 above among them; untested inside the title process and for the other 12).

Related: #9836 (journal keeps its newest pipelines), #8309 (journal cap recompiles), #10632 (replay priority, Windows only). None reports this import behaviour.

Trees, environment and logging

Every title run: APS5_WRITTEN_SHADOW_MAX_KIB=2048, APS5_PROFILE_DRAW=1, APS5_TRACE_SUMMARY_EVERY=60, SDL_VIDEODRIVER=x11, pad input from a file. The 754-entry file's writer also had APS5_PIPELINE_JOURNAL_MAX_MIB=2048; its 1,777 MiB journal is over the default 1 GiB cap, so every later run rewrote it (#9836). Trees: main 5357acd697 plus #5372 at 30868735e8 with its 662a50bf7e reverted, plus one env-gated local diagnostic (unset). The runs in items 1-3 and 5 add local logging: creation feedback (VK_EXT_pipeline_creation_feedback) and the driver's duration on compute creations over 100 K words, and vkGetPipelineCacheData size queries around creations over 1 M words. Item 3's runs, and the run that wrote their files, add a per-pipeline cache file store (its own cache per creation, one repeat creation per export). The 754-entry file's writer and item 4's two runs used the tree without the feedback and size diagnostics. Item 2's file was written by a local test binary added with the local logging that replays the journal into an empty cache (local ANYPS5_PRIME_PIPELINE_CACHE=1, local ANYPS5_DIAG_JOURNAL_ORDER=largest, APS5_PIPELINE_JOURNAL_THREADS=16, APS5_PROFILE_DRAW=1, __GL_SHADER_DISK_CACHE=0, X display reachable). Item 2's title run started from the files of the run that wrote the 754-entry file, with only the vk-pipelines file replaced by this one. The journal replays below ran the same binary from the per-pipeline-store tree with local ANYPS5_PRIME_PIPELINE_CACHE=1, APS5_PIPELINE_JOURNAL_THREADS=16, APS5_PROFILE_DRAW=1 and local APS5_PIPELINE_BLOBS=1, in the journal's own order, in on mode, with the X display reachable and no vk-pipelines file. Between 5357acd697 and upstream main 7a25f87620, PipelineCache.cpp is unchanged and PipelineJournal.cpp has only #10632 (Windows) and a static_assert.

Per-run numbers
  • The 13 modules: replay 1,028,799 / 1,098,412 / 1,145,918 / 1,834,087 / 1,858,679 / 2,197,745 / 3,574,686 / 3,650,995 words (misses 23-135 s); dispatch path 1,098,690 / 1,146,196 / 2,198,367 / 3,575,308 / 3,651,617 (misses 21-102 s). The four served on the dispatch path: 3,632,042 / 1,834,303 / 1,029,077 / 1,858,957 words.
  • Nine on-mode warm runs: title screen 523 / 533 / 534 / 534 / 543 / 544 / 545 / 545 / 576 s; replay 150-163 s for 176-187 pipelines and 184-186 s for 395 (the journal rotates between runs, #9836, so the runs' journals differ).
  • The 754-entry file (147,490,382 B of driver data) was written by one run from no file. Two later runs loaded it, recompiled the 13 pipelines and saved 757 entries each (3 new entries: 67-106 KB in one, 82 KB-1.6 MB in the other). In the run that added 82 KB-1.6 MB, size queries grew on 11 of 207 lines (20.7 MB), yet its saved file grew by 1.9 MB.
  • Item 2: the two served modules are 3,574,686 and 3,650,995 words (22 pipelines); 15 of 15 miss lines (6 replay, 9 dispatch) grew the cache, 56.7 MB in all; per-line deltas overlap on 16 threads.
  • Item 3: the files are 0.24-6.6 MB; the creations that were not misses took at most 56 ms and were variants of modules the run had already compiled; the three runs without such files are served the same creations in 4-37 ms.
  • Item 4: __GL_SHADER_DISK_CACHE=1, __GL_SHADER_DISK_CACHE_PATH outside the sandbox, __GL_SHADER_DISK_CACHE_SIZE=17179869184, __GL_SHADER_DISK_CACHE_SKIP_CLEANUP=1; the filled cache was 148.8 MB in 2 files; only compute creations over 100 K words are logged (longest 633 ms in the second run).
  • Item 5: replay 132,103 ms for 191 pipelines (the writer's run: 187,654 ms for 395; its journal rotated); title screen 772 s (the writer's run 803 s). With the driver's cache off for every shader these are not comparable with the on-mode runs.
Synthetic tests (no title data; a 460-line Vulkan program and a GLSL generator, each step a fresh process)
  • A single pipeline's cache data imports and serves in another process: 2 ms against 820 ms cold (208 K words), 11 ms against 5.1 s (1.0 M words), 26 ms against 23.5 s (2.7 M words, 2.7 MB of cache data). The fresh cache's data after the compile and an empty cache's data after a repeat creation behave the same. Unchanged with a required subgroup size of 32, REQUIRE_FULL_SUBGROUPS, update-after-bind storage buffers, push constants, two descriptor sets, eight specialization constants, eight threads compiling meanwhile, a 25 MB foreign cache imported first, the driver's disk cache off on both sides, off for the writer and on for the reader, or on for both.
  • A 25 MB cache of 200 variants written by one process with __GL_SHADER_DISK_CACHE=0: another off-mode process is served every probed variant (6 probes, 0 to 199). An on-mode process is served the probed variants 0, 20, 50 and 80 and misses 100, 130, 150, 180 and 199.
  • A process that has compiled 150 variants (24.5 MB of cache data) still imports a single-pipeline file written by a process that compiled only that pipeline (24 ms with the disk cache off, 71 ms on) and the first variant of the 25 MB cache (2-4 ms).
Replays of the title's journal in a separate process (sandboxed, 395 pipelines, 16 threads, on mode; one run each)
  • A process with an empty per-pipeline store wrote its first 16 pipelines that took 1 s or more as single-entry files (199 KB-1.7 MB) and the next 31 as two-entry files (3.5-6.6 MB; the other entry is a dictionary entry, below).
  • A second process replaying the same journal was served those 16 (40-219 ms). Of the 31 two-entry files, none served a module the process had not compiled yet (7 misses at 29-130 s, 13 hit-flagged creations at 3-87 s). Replay 157 s against 175 s without files.
  • With the title's own 56 files, a replaying process loaded 45. The 5 single-entry files served (46-49 ms) and none of the 40 two-entry ones did (one hit-flagged creation at 1,006 ms, the rest 4-122 s); replay 173 s.
Cache data format and our reading

vkGetPipelineCacheData on this driver returns the 32-byte Vulkan header, an entry count, then entries of a 16-byte key, a 4-byte size, a 40-byte header and the data. In every file we parsed, the entries are in ascending order of one 32-bit header field that is equal for the same key in files from different processes. So an entry's position follows its key, not when it was written; the three entries a later run added to the 754-entry file sit at indices 42, 143 and 151. A cache that has held enough data has one entry whose key ends in _NVDICT_ (2,097,152 B in the title's caches, 960,701 B in the synthetic one); its content differs between caches filled by different processes, and a file AnyPS5 saves keeps the dictionary entry of the process that first wrote it (the two 757-entry files of item 1, saved from a live cache created from the 754-entry file, carry that file's; item 5's, whose writer started without a vk-pipelines file and merged its later saves into its own earlier file, carries its own). In the synthetic 200-variant cache, 97 entries are 240-242 KB (a single-variant export is 240 KB) and 103 are 7.6-35 KB. We read this as: from some point a process compresses the entries it writes with that dictionary, and another process with the driver's disk cache on uses only the entries written before that point. The format is undocumented, the point is not a fixed size (the writer in item 2 added its dictionary entry between 5.3 and 12.8 MB of cache data; the synthetic writer holds 97 full-size entries, about 23 MB), and the reading does not explain why an off-mode reader was served every probed variant of the synthetic cache but, from the off-mode title file, only the first compute pipeline over 1 M words its writer stored. For a helper-process design: on this driver pipelineCacheUUID's last 8 bytes differ for a process that cannot reach the X display, so a headless helper writes data under a pipelineCacheUUID the windowed title's device does not report.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:6027366165 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/11106). Originally posted by [SleglJan](https://github.com/SleglJan) on 2026-10-25T17:43:19Z. --- On an RTX 3080 with NVIDIA 615.78.08 on Linux, the vk-pipelines file AnyPS5 saves serves the next process only the pipelines the writing process stored first. In one title (147 MB file, 754 entries, written by one run), nine warm runs with the driver's shader disk cache empty each report a creation-feedback miss on the same 13 compute pipelines of 1.0-3.7 M SPIR-V words. The runs started from that file or from the 757-entry files that two of them saved. ## Setup - RTX 3080 (10 GB), NVIDIA 615.78.08, Linux 7.2.10 (CachyOS), X11 window through XWayland, Vulkan 1.1 instance, Release builds. - Trees: `main` 5357acd697 plus #5372 at 30868735e8 with its 662a50bf7e reverted, plus local logging; four of item 1's nine runs also carry a local per-pipeline cache file store. Every environment variable, the local diagnostics and the tools: details below. - Title PPSA11386 (007 First Light), scripted input, its two feedback-wait limits widened as in #6172 (local only); a local bubblewrap sandbox (read-only root, fresh tmpfs HOME, no network) leaves the driver's shader disk cache empty. "On mode" is the driver's default, "off mode" is `__GL_SHADER_DISK_CACHE=0`. - Each warm run starts from the files a first run saved. ## What the title runs show 1. **Nine warm runs from on-mode files (three files):** the 13 modules (8 in the journal replay at boot, 5 on the dispatch path) miss exactly once each per run; the dispatch path is served the same four of its nine pipelines over 1 M words (31-537 ms), the first four over 1 M words the 754-entry file's writer compiled (at boot, before the other five dispatch-path ones and, much later, the eight replay modules). Size queries read +0 B on every line in 8 of 9 runs; item 3's three runs built their five dispatch-path misses from per-pipeline files instead. A hit flag alone is not "served" (8-19 hit-flagged replay creations per run take 10-106 s); served below means hit-flagged and created in under 1 s. 2. **One run:** a file a local journal-replay tool wrote in off mode (395 pipelines, 16 threads, largest modules first, 65,397.7 KiB), read in on mode, served the two modules that process compiled first (241-256 ms) and missed the six it compiled after them (29-73 s); the cache grew after every miss. 3. **Three runs:** per-pipeline cache files written by the title process; the 11 creations per run that met a module not yet compiled all missed (0.98-101.8 s). 51 of the 56 files carry a dictionary entry, the 11 behind those misses among them; the 5 without one were the writer's first 5. 4. **One pair:** both runs loaded the 754-entry file; the first filled a driver shader disk cache kept outside the sandbox, and the second's replay took 1,994 ms instead of the first's 185,374 ms, its title screen 160 s instead of 534 s. 5. **One pair, off mode on both sides:** the writer replayed the 395-pipeline journal from the start (it began from the files of the run that wrote the 754-entry file, without that file; that run itself had started with no journal). Its 757-entry file served one of the eight replay modules (1,098,412 words, 24 ms), the first pipeline over 1 M words it stored, and none of the nine dispatch-path ones (all missed, 17-123 s). Not tested: another GPU or driver version, Windows, the driver disk cache at its default size, a single-threaded replay (which would attribute each replay variant to its own entry). Options we see, none proposed here: keeping the driver's shader disk cache persistent (documented variables); per-pipeline files from short-lived helper processes that reach the X display (single-entry files imported in every synthetic test and in the journal replays up to 1.1 M words, one of the 13 above among them; untested inside the title process and for the other 12). Related: #9836 (journal keeps its newest pipelines), #8309 (journal cap recompiles), #10632 (replay priority, Windows only). None reports this import behaviour. <details><summary>Trees, environment and logging</summary> Every title run: `APS5_WRITTEN_SHADOW_MAX_KIB=2048`, `APS5_PROFILE_DRAW=1`, `APS5_TRACE_SUMMARY_EVERY=60`, `SDL_VIDEODRIVER=x11`, pad input from a file. The 754-entry file's writer also had `APS5_PIPELINE_JOURNAL_MAX_MIB=2048`; its 1,777 MiB journal is over the default 1 GiB cap, so every later run rewrote it (#9836). Trees: `main` 5357acd697 plus #5372 at 30868735e8 with its 662a50bf7e reverted, plus one env-gated local diagnostic (unset). The runs in items 1-3 and 5 add local logging: creation feedback (VK_EXT_pipeline_creation_feedback) and the driver's duration on compute creations over 100 K words, and `vkGetPipelineCacheData` size queries around creations over 1 M words. Item 3's runs, and the run that wrote their files, add a per-pipeline cache file store (its own cache per creation, one repeat creation per export). The 754-entry file's writer and item 4's two runs used the tree without the feedback and size diagnostics. Item 2's file was written by a local test binary added with the local logging that replays the journal into an empty cache (local `ANYPS5_PRIME_PIPELINE_CACHE=1`, local `ANYPS5_DIAG_JOURNAL_ORDER=largest`, `APS5_PIPELINE_JOURNAL_THREADS=16`, `APS5_PROFILE_DRAW=1`, `__GL_SHADER_DISK_CACHE=0`, X display reachable). Item 2's title run started from the files of the run that wrote the 754-entry file, with only the vk-pipelines file replaced by this one. The journal replays below ran the same binary from the per-pipeline-store tree with local `ANYPS5_PRIME_PIPELINE_CACHE=1`, `APS5_PIPELINE_JOURNAL_THREADS=16`, `APS5_PROFILE_DRAW=1` and local `APS5_PIPELINE_BLOBS=1`, in the journal's own order, in on mode, with the X display reachable and no vk-pipelines file. Between 5357acd697 and upstream `main` 7a25f87620, PipelineCache.cpp is unchanged and PipelineJournal.cpp has only #10632 (Windows) and a static_assert. </details> <details><summary>Per-run numbers</summary> - The 13 modules: replay 1,028,799 / 1,098,412 / 1,145,918 / 1,834,087 / 1,858,679 / 2,197,745 / 3,574,686 / 3,650,995 words (misses 23-135 s); dispatch path 1,098,690 / 1,146,196 / 2,198,367 / 3,575,308 / 3,651,617 (misses 21-102 s). The four served on the dispatch path: 3,632,042 / 1,834,303 / 1,029,077 / 1,858,957 words. - Nine on-mode warm runs: title screen 523 / 533 / 534 / 534 / 543 / 544 / 545 / 545 / 576 s; replay 150-163 s for 176-187 pipelines and 184-186 s for 395 (the journal rotates between runs, #9836, so the runs' journals differ). - The 754-entry file (147,490,382 B of driver data) was written by one run from no file. Two later runs loaded it, recompiled the 13 pipelines and saved 757 entries each (3 new entries: 67-106 KB in one, 82 KB-1.6 MB in the other). In the run that added 82 KB-1.6 MB, size queries grew on 11 of 207 lines (20.7 MB), yet its saved file grew by 1.9 MB. - Item 2: the two served modules are 3,574,686 and 3,650,995 words (22 pipelines); 15 of 15 miss lines (6 replay, 9 dispatch) grew the cache, 56.7 MB in all; per-line deltas overlap on 16 threads. - Item 3: the files are 0.24-6.6 MB; the creations that were not misses took at most 56 ms and were variants of modules the run had already compiled; the three runs without such files are served the same creations in 4-37 ms. - Item 4: `__GL_SHADER_DISK_CACHE=1`, `__GL_SHADER_DISK_CACHE_PATH` outside the sandbox, `__GL_SHADER_DISK_CACHE_SIZE=17179869184`, `__GL_SHADER_DISK_CACHE_SKIP_CLEANUP=1`; the filled cache was 148.8 MB in 2 files; only compute creations over 100 K words are logged (longest 633 ms in the second run). - Item 5: replay 132,103 ms for 191 pipelines (the writer's run: 187,654 ms for 395; its journal rotated); title screen 772 s (the writer's run 803 s). With the driver's cache off for every shader these are not comparable with the on-mode runs. </details> <details><summary>Synthetic tests (no title data; a 460-line Vulkan program and a GLSL generator, each step a fresh process)</summary> - A single pipeline's cache data imports and serves in another process: 2 ms against 820 ms cold (208 K words), 11 ms against 5.1 s (1.0 M words), 26 ms against 23.5 s (2.7 M words, 2.7 MB of cache data). The fresh cache's data after the compile and an empty cache's data after a repeat creation behave the same. Unchanged with a required subgroup size of 32, REQUIRE_FULL_SUBGROUPS, update-after-bind storage buffers, push constants, two descriptor sets, eight specialization constants, eight threads compiling meanwhile, a 25 MB foreign cache imported first, the driver's disk cache off on both sides, off for the writer and on for the reader, or on for both. - A 25 MB cache of 200 variants written by one process with `__GL_SHADER_DISK_CACHE=0`: another off-mode process is served every probed variant (6 probes, 0 to 199). An on-mode process is served the probed variants 0, 20, 50 and 80 and misses 100, 130, 150, 180 and 199. - A process that has compiled 150 variants (24.5 MB of cache data) still imports a single-pipeline file written by a process that compiled only that pipeline (24 ms with the disk cache off, 71 ms on) and the first variant of the 25 MB cache (2-4 ms). </details> <details><summary>Replays of the title's journal in a separate process (sandboxed, 395 pipelines, 16 threads, on mode; one run each)</summary> - A process with an empty per-pipeline store wrote its first 16 pipelines that took 1 s or more as single-entry files (199 KB-1.7 MB) and the next 31 as two-entry files (3.5-6.6 MB; the other entry is a dictionary entry, below). - A second process replaying the same journal was served those 16 (40-219 ms). Of the 31 two-entry files, none served a module the process had not compiled yet (7 misses at 29-130 s, 13 hit-flagged creations at 3-87 s). Replay 157 s against 175 s without files. - With the title's own 56 files, a replaying process loaded 45. The 5 single-entry files served (46-49 ms) and none of the 40 two-entry ones did (one hit-flagged creation at 1,006 ms, the rest 4-122 s); replay 173 s. </details> <details><summary>Cache data format and our reading</summary> `vkGetPipelineCacheData` on this driver returns the 32-byte Vulkan header, an entry count, then entries of a 16-byte key, a 4-byte size, a 40-byte header and the data. In every file we parsed, the entries are in ascending order of one 32-bit header field that is equal for the same key in files from different processes. So an entry's position follows its key, not when it was written; the three entries a later run added to the 754-entry file sit at indices 42, 143 and 151. A cache that has held enough data has one entry whose key ends in `_NVDICT_` (2,097,152 B in the title's caches, 960,701 B in the synthetic one); its content differs between caches filled by different processes, and a file AnyPS5 saves keeps the dictionary entry of the process that first wrote it (the two 757-entry files of item 1, saved from a live cache created from the 754-entry file, carry that file's; item 5's, whose writer started without a vk-pipelines file and merged its later saves into its own earlier file, carries its own). In the synthetic 200-variant cache, 97 entries are 240-242 KB (a single-variant export is 240 KB) and 103 are 7.6-35 KB. We read this as: from some point a process compresses the entries it writes with that dictionary, and another process with the driver's disk cache on uses only the entries written before that point. The format is undocumented, the point is not a fixed size (the writer in item 2 added its dictionary entry between 5.3 and 12.8 MB of cache data; the synthetic writer holds 97 full-size entries, about 23 MB), and the reading does not explain why an off-mode reader was served every probed variant of the synthetic cache but, from the off-mode title file, only the first compute pipeline over 1 M words its writer stored. For a helper-process design: on this driver `pipelineCacheUUID`'s last 8 bytes differ for a process that cannot reach the X display, so a headless helper writes data under a pipelineCacheUUID the windowed title's device does not report. </details> AI-assisted: yes (Claude Code)
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5#11106
No description provided.