[PR #2228] d3d12: a helper-sized module's stale journal file goes to the helper, not a compile here (RT-JOURNAL-STALE-PROBE) #2232

Open
opened 2026-11-26 21:20:30 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/2228
Author: @Krashgamer
Created: 11/26/2026
Status: 🔄 Open

Base: main ← Head: fix/journal-stale-probe


📝 Commits (4)

  • abbc1a4 d3d12: rewrite a missed journal file from an empty cache when the seeded one kept its data (RT-JOURNAL-SEEDED-REWRITE)
  • 4212cf5 d3d12: keep the journal file when the create against the empty cache fails
  • 807c3a5 d3d12: a helper-sized module's stale journal file goes to the helper, not a compile here (RT-JOURNAL-STALE-PROBE)
  • 7982880 d3d12: a refused seed-overlay file is read as absent on the helper retry

📊 Changes

1 file changed (+80 additions, -5 deletions)

View changed files

📝 runtime/shims/d3d12_vulkan_device.cpp (+80 -5)

📄 Description

Claimed in the coordination issue as: RT-JOURNAL-STALE-PROBE (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7186300903)

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_pipeline asks 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 inside vkCreateComputePipelines, and every vkQueueSubmit of 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 least LEONIDA_COMPILE_HELPER_MIN_BYTES with the helper on, and pipelineCreationCacheControl present.

  • On VK_PIPELINE_COMPILE_REQUIRED the 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.
  • A file the driver takes is a hit as before, in milliseconds.
  • A driver that compiles anyway instead of answering gives the pipeline as before.
  • A file that can't be removed is seeded and compiled here as before. The retry does not probe again, so the recursion is bounded at one.
  • Without the helper, and in the helper and --precompile-pipelines processes (compile_helper::wanted is false there), nothing changes.

Tested

Boots on Windows 11, boot.ps1 with LEONIDA_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.

boot stale files caught modules built in the title process longest gate wait gate wait in all
before (t4-i) – yes, 4.5 MB module at 857 s and still in the driver at the end 37 s and counting –
this change (t4-l) 27, answered in 0–16 ms 12, after the helper's 120 s limit (did not build it within 120000 ms; built here) 83 s 580 s
this change + LEONIDA_COMPILE_HELPER_WAIT_MS=0 LEONIDA_COMPILE_HELPER_PENDING_MS=0 LEONIDA_COMPILE_HELPER_IDLE_THREADS=0 (t4-m) 8 none (the 85–116 s builds ran in the helper) 0.455 s 25 s

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: gta6rt and d3d12_compute_journal_test link (Ninja, MSVC Build Tools 18); d3d12_compute_journal_test passes 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

  • Based on current main and merges cleanly (on top of #2179).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of 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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/2228 **Author:** [@Krashgamer](https://github.com/Krashgamer) **Created:** 11/26/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/journal-stale-probe` --- ### 📝 Commits (4) - [`abbc1a4`](https://github.com/ubiquitarianism/leonida/commit/abbc1a4f8276c1dd84b5885ace81aa5e7e577592) d3d12: rewrite a missed journal file from an empty cache when the seeded one kept its data (RT-JOURNAL-SEEDED-REWRITE) - [`4212cf5`](https://github.com/ubiquitarianism/leonida/commit/4212cf5ab3b133375af0f7baa723c38ea5896b17) d3d12: keep the journal file when the create against the empty cache fails - [`807c3a5`](https://github.com/ubiquitarianism/leonida/commit/807c3a50cd9649d6dd98d83cfa3690426866c63b) d3d12: a helper-sized module's stale journal file goes to the helper, not a compile here (RT-JOURNAL-STALE-PROBE) - [`7982880`](https://github.com/ubiquitarianism/leonida/commit/7982880cb15d8ce03743dee6c1ca2d7a303cee54) d3d12: a refused seed-overlay file is read as absent on the helper retry ### 📊 Changes **1 file changed** (+80 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `runtime/shims/d3d12_vulkan_device.cpp` (+80 -5) </details> ### 📄 Description Claimed in the coordination issue as: RT-JOURNAL-STALE-PROBE (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7186300903) 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_pipeline` asks 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 inside `vkCreateComputePipelines`, and every `vkQueueSubmit` of 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 least `LEONIDA_COMPILE_HELPER_MIN_BYTES` with the helper on, and `pipelineCreationCacheControl` present. - On `VK_PIPELINE_COMPILE_REQUIRED` the 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. - A file the driver takes is a hit as before, in milliseconds. - A driver that compiles anyway instead of answering gives the pipeline as before. - A file that can't be removed is seeded and compiled here as before. The retry does not probe again, so the recursion is bounded at one. - Without the helper, and in the helper and `--precompile-pipelines` processes (`compile_helper::wanted` is false there), nothing changes. ### Tested Boots on Windows 11, `boot.ps1` with `LEONIDA_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. | boot | stale files caught | modules built in the title process | longest gate wait | gate wait in all | |---|---|---|---|---| | before (t4-i) | – | yes, 4.5 MB module at 857 s and still in the driver at the end | 37 s and counting | – | | this change (t4-l) | 27, answered in 0–16 ms | 12, after the helper's 120 s limit (`did not build it within 120000 ms; built here`) | 83 s | 580 s | | this change + `LEONIDA_COMPILE_HELPER_WAIT_MS=0 LEONIDA_COMPILE_HELPER_PENDING_MS=0 LEONIDA_COMPILE_HELPER_IDLE_THREADS=0` (t4-m) | 8 | none (the 85–116 s builds ran in the helper) | 0.455 s | 25 s | 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: `gta6rt` and `d3d12_compute_journal_test` link (Ninja, MSVC Build Tools 18); `d3d12_compute_journal_test` passes 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 - [x] Based on current `main` and merges cleanly (on top of #2179). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `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](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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.

Dependencies

No dependencies set

Reference
starred/leonida#2232
No description provided.