Repository navigation
d3d12: a helper-sized module's stale journal file goes to the helper, not a compile here (RT-JOURNAL-STALE-PROBE) - #2228
Krashgamer wants to merge 4 commits into
Conversation
…ded one kept its data (RT-JOURNAL-SEEDED-REWRITE) A compute pipeline that missed its journal file was rewritten from the cache made from that file. On NVIDIA (RTX 3080, 610.88) that cache came back exactly as loaded, without the pipeline just compiled, so the rewrite gave the same file and the same multi-second miss on every boot. After a seeded miss whose cache is still the loaded size, the pipeline is built once more against an empty cache (15-78 ms: the driver still has it) and that is written. A seeded cache that took the pipeline is rewritten as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…fails Found by ecox982745 in review: a failed second create left an empty cache that finish() still wrote over the old file (36 bytes on NVIDIA). The first pipeline is kept and nothing is published on that path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… not a compile here (RT-JOURNAL-STALE-PROBE) The compile helper is asked only when a compute pipeline has no journal file. A file the driver no longer takes was seeded and compiled in the title's process: 55-84 s for library modules of 3.6-4.7 MB on an RTX 3080 (NVIDIA 610.88), with every submission waiting at the compile gate (up to 83 s, 580 s in a 900 s boot). For a module the helper would build (LEONIDA_COMPILE_HELPER, at least LEONIDA_COMPILE_HELPER_MIN_BYTES) with a journal file, the seeded create now carries VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT. On VK_PIPELINE_COMPILE_REQUIRED (0-16 ms) the file is removed and the build is asked once more without the probe: the no-file way, to the helper. A driver that compiles anyway gives the pipeline as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Not ready, found a limit of this change in a longer boot (t4-n, 1,122 s, same settings as the last row of the table). AI-assisted (Claude Code, Claude Opus 5.5). For library modules of about 4–6 MB, a file the helper writes is itself not taken by the title's process. For example, the helper builds and journals a 4.1 MB module in 63 s. The title's probe then answers What I checked so far, RTX 3080, NVIDIA 610.88:
So for the largest modules, the helper and the title's process apparently don't produce pipelines the other takes. The cause is not found yet. Until it is, this change only moves those builds around. I'll keep it a draft and report back. |
lixonik
left a comment
There was a problem hiding this comment.
The four synthetic compute-journal overlay cases passed at this head on Windows 11 (NVIDIA GeForce RTX 5070, 610.88). They cover ordinary cold and seeded creation. The helper-sized stale-file branch was outside those cases. I found one path through that branch by inspection, below.
AI-assisted.
| if (big_lock.owns_lock()) big_lock.unlock(); | ||
| if (stale_file) { | ||
| std::error_code removed; | ||
| std::filesystem::remove(out.journal_path, removed); |
There was a problem hiding this comment.
[P2] Bypass the rejected external seed on the helper retry.
journal.load(path) can supply data from the read-only seed overlay while out.journal_path still points to the local destination. If that cache returns VK_PIPELINE_COMPILE_REQUIRED and no local file exists, remove(out.journal_path) returns false with no error. The recursive retry logs removal, then loads the same external seed with probing disabled. journal.has_file_data() stays true and skips the helper, so the foreground compile this change is meant to avoid can still happen. Can the retry treat that stale seed as absent and leave the overlay untouched?
There was a problem hiding this comment.
Thanks, @lixonik, that's right: the remove did nothing for a file read from the seed, and the retry loaded the same seed again. Fixed in 7982880. When the refused file came from the seed overlay (EntryFile::from_seed), the overlay now stays untouched, and the retry passes skip_seed so JournalCache::load reads the seed as absent. has_file_data() is then false and the build goes to the helper. The helper reads with ReadRole::materialize_local, which never takes the seed, and its file lands locally. A local stale file is still removed as before.
Built gta6rt on Windows 11 with MSVC 18. I have not run it with a seed overlay yet, so that branch is untested here.
The seed overlay is read-only, so removing out.journal_path did nothing when the probed file came from it: the retry loaded the same seed, skipped the helper and compiled in the title's process. The retry now reads the seed as absent and leaves it untouched; a local file is still removed. Found by lixonik in review. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claimed in the coordination issue as: RT-JOURNAL-STALE-PROBE (#1608 (comment))
Depends on: #2179 (this branch is on top of it; the first two commits are #2179's, the last one is this change)
What and why
build_compute_pipelineasks the compile helper (LEONIDA_COMPILE_HELPER=1) only when a compute pipeline has no journal file. When the file is there but the driver no longer takes it, the cache is seeded from it and the pipeline is compiled in the title's process. For the largest library modules that is a minute or more insidevkCreateComputePipelines, and everyvkQueueSubmitof the title waits at the compile gate meanwhile.On a 900 s boot through the story load (RTX 3080 10 GB, NVIDIA 610.88, helper and async pipelines on), modules of 3.6–4.7 MB were built that way on the dispatch worker, 55–84 s each. The gate held submissions up to 83 s, 580 s in all.
Change: for a module the helper would build, a seeded create carries
VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT. That means a module of at leastLEONIDA_COMPILE_HELPER_MIN_BYTESwith the helper on, andpipelineCreationCacheControlpresent.VK_PIPELINE_COMPILE_REQUIREDthe file is removed and the build is asked once more without the probe. That is the no-file way: a request to the helper, deferred with async pipelines.--precompile-pipelinesprocesses (compile_helper::wantedis false there), nothing changes.Tested
Boots on Windows 11,
boot.ps1withLEONIDA_COMPILE_HELPER=1 LEONIDA_ASYNC_PIPELINES=1 LEONIDA_TITLE_WATCHDOG=0 LEONIDA_CONSOLE_FIX_US=0 LEONIDA_HOST_IMAGE_COPY=0. The tree was main (2026-11-26) + #2138 + #2179 + #1472 + #2195 + #2183 + #2174 + #1914 + #1886 with this change. The scripted pad was used through the first-run pages to the story load.did not build it within 120000 ms; built here)LEONIDA_COMPILE_HELPER_WAIT_MS=0 LEONIDA_COMPILE_HELPER_PENDING_MS=0 LEONIDA_COMPILE_HELPER_IDLE_THREADS=0(t4-m)So the probe takes the stale files out of the title's process. With the default 120 s helper limits, a busy helper (one request thread next to the idle fill, ~80 s a module) still hands some back. I left those limits alone: they are a policy of the helper's design, and the no-limit setting is one environment pair away.
Branch build:
gta6rtandd3d12_compute_journal_testlink (Ninja, MSVC Build Tools 18);d3d12_compute_journal_testpasses on the RTX 3080.GPUs tested: NVIDIA GeForce RTX 3080 10 GB, driver 610.88, Windows 11 Pro 26200 (Intel i7-10700K)
AI-assisted: yes (Claude Code, Claude Opus 5.5)
Checklist
mainand merges cleanly (on top of d3d12: rewrite a missed journal file from an empty cache when the seeded one kept its data (RT-JOURNAL-SEEDED-REWRITE) #2179).docs/design.md, with how it was confirmed. (n/a)Draft while #2179 is open (one open pull request per contributor).
🤖 Generated with Claude Code