windows-boot: read the precompiled journal beside gta6rt.exe as the boot's seed (BOOT-PRECOMPILED-JOURNAL) #2481

Merged
enlight3d merged 2 commits from upstream-pr/2481 into main 2026-11-27 20:47:32 +00:00
enlight3d commented 2026-11-27 16:36:23 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-11-27T16:36:23Z.


Claimed in the coordination issue as BOOT-PRECOMPILED-JOURNAL: https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7223005887 (not an item of #2464; found in game runs today).

What and why

gta6rt --precompile-pipelines writes its compute journal beside gta6rt.exe (pipeline_cache.d, when it runs without LEONIDA_PIPELINE_CACHE_DIR). scripts/windows-boot/boot.ps1 points the runtime at its own cache folder (<OutDir>\pipeline-cache), so a boot never read that journal and compiled again every pipeline the pre-compile had built.

Now, when pipeline_cache.d exists beside gta6rt.exe and neither the shell nor -SetEnv/KEY=VALUE set LEONIDA_PIPELINE_JOURNAL_SEED_DIR, boot.ps1 passes it as the runtime's read-only seed (the runtime falls back to it for files its writable journal lacks) and lists it in the [boot] env lines. It is not set:

  • when the boot's writable journal is that folder, holds it or sits in it: the runtime turns its journal off for an overlapping seed (resolve_roots in runtime/src/pipeline_cache_journal.h). The two folders are compared through Windows' final paths (GetFinalPathNameByHandle, from the deepest existing parent), so a junction, symbolic link, substituted or mapped drive, 8.3 name or \\?\ / \\.\ prefix counts as the same folder; the spelled paths are the fallback if that helper cannot load;
  • when LEONIDA_PIPELINE_CACHE_DIR is relative (the runtime resolves it against its own working folder) or cannot be resolved (no seed rather than a stop, so -DryRun and -DigestOnly still work).

The README row says how to turn it off (LEONIDA_PIPELINE_JOURNAL_SEED_DIR=), which runtime line shows an overlap if one still slips through, and that on NVIDIA the pre-compile has to use the same LEONIDA_DEVICE_FAULT as the boot (this script sets 1), since the diagnostics config is part of the journal's file names (runtime/shims/d3d12_vulkan_device.cpp, nv-diagnostics-config); OreoFR's agent pointed that one out.

Tested

Windows 11 Pro 26300, Windows PowerShell 5.1:

  • python -I tests/test_windows_boot_journal_seed.py: 17 tests OK (the junction and \\.\ cases added after TheGeogeo's review fail on the commit before). It runs boot.ps1 -DryRun (nothing launched, no game files) against a temporary runtime folder. With main's boot.ps1, the 3 tests that expect a seed fail.
  • Mutation check of the new block: dropping the "seed inside the boot's journal" clause, the Equals clause, the relative-path guard, the try/catch, the shell-location resolution or the \\?\ stripping, or making the comparison case-sensitive, each makes at least one test fail. -DryRun takes about 2.6 s with the final-path helper compiled.
  • boot.ps1 -DryRun on a real port folder lists LEONIDA_PIPELINE_JOURNAL_SEED_DIR=<port>\pipeline_cache.d.
  • Effect, measured earlier today with the seed set by hand (same variable): RTX 3090 24 GB, NVIDIA 621.40, main 2859d0c9b, LEONIDA_DEVICE_FAULT unset: 545 compute pipelines came from the precompiled journal in one boot instead of being compiled.
  • python -I tests/test_ci_registration.py, python -I tests/test_docs_links.py, python -I scripts/check_no_game_data.py on the three files, git diff --check: clean.

GPUs tested: NVIDIA GeForce RTX 3090 24 GB, driver 621.40, Windows 11 26300 (profile L); the test itself needs no GPU.

AI-assisted: yes (Claude Code, Claude Opus 5.5). A second agent reviewed the change twice before it was opened; its findings are applied.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5530016110 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2481). Originally posted by [enlight3d](https://github.com/enlight3d) on 2026-11-27T16:36:23Z. --- Claimed in the coordination issue as BOOT-PRECOMPILED-JOURNAL: https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7223005887 (not an item of #2464; found in game runs today). ### What and why `gta6rt --precompile-pipelines` writes its compute journal beside `gta6rt.exe` (`pipeline_cache.d`, when it runs without `LEONIDA_PIPELINE_CACHE_DIR`). `scripts/windows-boot/boot.ps1` points the runtime at its own cache folder (`<OutDir>\pipeline-cache`), so a boot never read that journal and compiled again every pipeline the pre-compile had built. Now, when `pipeline_cache.d` exists beside `gta6rt.exe` and neither the shell nor `-SetEnv`/`KEY=VALUE` set `LEONIDA_PIPELINE_JOURNAL_SEED_DIR`, `boot.ps1` passes it as the runtime's read-only seed (the runtime falls back to it for files its writable journal lacks) and lists it in the `[boot] env` lines. It is not set: - when the boot's writable journal is that folder, holds it or sits in it: the runtime turns its journal off for an overlapping seed (`resolve_roots` in `runtime/src/pipeline_cache_journal.h`). The two folders are compared through Windows' final paths (`GetFinalPathNameByHandle`, from the deepest existing parent), so a junction, symbolic link, substituted or mapped drive, 8.3 name or `\\?\` / `\\.\` prefix counts as the same folder; the spelled paths are the fallback if that helper cannot load; - when `LEONIDA_PIPELINE_CACHE_DIR` is relative (the runtime resolves it against its own working folder) or cannot be resolved (no seed rather than a stop, so `-DryRun` and `-DigestOnly` still work). The README row says how to turn it off (`LEONIDA_PIPELINE_JOURNAL_SEED_DIR=`), which runtime line shows an overlap if one still slips through, and that on NVIDIA the pre-compile has to use the same `LEONIDA_DEVICE_FAULT` as the boot (this script sets `1`), since the diagnostics config is part of the journal's file names (`runtime/shims/d3d12_vulkan_device.cpp`, `nv-diagnostics-config`); OreoFR's agent pointed that one out. ### Tested Windows 11 Pro 26300, Windows PowerShell 5.1: - `python -I tests/test_windows_boot_journal_seed.py`: 17 tests OK (the junction and `\\.\` cases added after TheGeogeo's review fail on the commit before). It runs `boot.ps1 -DryRun` (nothing launched, no game files) against a temporary runtime folder. With `main`'s `boot.ps1`, the 3 tests that expect a seed fail. - Mutation check of the new block: dropping the "seed inside the boot's journal" clause, the `Equals` clause, the relative-path guard, the `try/catch`, the shell-location resolution or the `\\?\` stripping, or making the comparison case-sensitive, each makes at least one test fail. `-DryRun` takes about 2.6 s with the final-path helper compiled. - `boot.ps1 -DryRun` on a real port folder lists `LEONIDA_PIPELINE_JOURNAL_SEED_DIR=<port>\pipeline_cache.d`. - Effect, measured earlier today with the seed set by hand (same variable): RTX 3090 24 GB, NVIDIA 621.40, `main` 2859d0c9b, `LEONIDA_DEVICE_FAULT` unset: 545 compute pipelines came from the precompiled journal in one boot instead of being compiled. - `python -I tests/test_ci_registration.py`, `python -I tests/test_docs_links.py`, `python -I scripts/check_no_game_data.py` on the three files, `git diff --check`: clean. GPUs tested: NVIDIA GeForce RTX 3090 24 GB, driver 621.40, Windows 11 26300 (profile L); the test itself needs no GPU. AI-assisted: yes (Claude Code, Claude Opus 5.5). A second agent reviewed the change twice before it was opened; its findings are applied. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
enlight3d commented 2026-11-27 17:18:54 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-11-27T17:18:54Z.


CI note: the four failing jobs fail the same way on main and touch nothing this pull request changes (it changes scripts/windows-boot/boot.ps1, its README and adds a Windows-only test).

tests/test_windows_boot_journal_seed.py skips off Windows, and the pull-request CI runs the standard-library tests on Linux only, so its Windows result is the local one in the description (15 tests OK; the 3 seed tests fail with main's boot.ps1).

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7224267982 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/2481#issuecomment-7224267982). Originally posted by [enlight3d](https://github.com/enlight3d) on 2026-11-27T17:18:54Z. --- CI note: the four failing jobs fail the same way on `main` and touch nothing this pull request changes (it changes `scripts/windows-boot/boot.ps1`, its README and adds a Windows-only test). - `macos-python`: `tests/test_calibrated_texture_extra.py` (`test_export_file_replacement_failure_cleans_temporary_file`, "OSError not raised"); `main`'s CI run https://github.com/ubiquitarianism/leonida/actions/runs/46033678995 (c0201a806) has `macos-python` failing too. - Runtime workflow, `linux-gpu-tools` (`vk_null_descriptor_test.cpp`: `LEONIDA_TEST_NULL_DESCRIPTORS_SPV` not declared), `windows` (`vk_xdxr_postbuild_readback`) and `macos` (`vk_bindless_dimensions`): `main`'s Runtime run https://github.com/ubiquitarianism/leonida/actions/runs/46033679044 (c0201a806) fails as well. `tests/test_windows_boot_journal_seed.py` skips off Windows, and the pull-request CI runs the standard-library tests on Linux only, so its Windows result is the local one in the description (15 tests OK; the 3 seed tests fail with `main`'s `boot.ps1`). AI-assisted (Claude Code).
TheGeogeo commented 2026-11-27 17:48:10 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-27T17:48:10Z.


Independent review of ba19ca8adacf791700c115bef5146f076ef3a990, merged with main c0201a806b061120e6cdee9916395275a632367e (merge tree matches daf669bf3ce9f3f9b3059baa53975f45160b61eb).

Finding: scripts/windows-boot/boot.ps1:290–309 compares paths lexically. When the writable cache reaches the same journal through a junction or a \\.\ alias, auto-seeding is enabled, but resolve_roots detects the overlap and disables both journals. In the same setup main retains the writable journal. I reproduced this with dry runs and a direct test of runtime/src/pipeline_cache_journal.h; the README documents alias limitations, but this configuration loses an existing cache. Please consider avoiding the automatic seed for aliases or preserving the writable cache when rejecting it.

Windows 11 build 26300, Windows PowerShell 5.1 and Python 3.12.4; no game files used:

  • test_windows_boot_journal_seed.py: 15/15 pass on the merged PR; 12/15 on main using the PR's test harness, with the three expected new-behavior failures.
  • Five adjacent boot/pipeline suites: 95 passed, 1 skipped on each revision.
  • pipeline_cache_journal_test.cpp: built and passed on both revisions. Eight additional dry runs passed. git diff --check and the no-game-data check on the changed files passed.

The complete project suite was not run. GPU and in-game cache hits or performance were not tested, so the performance gain remains unverified here.

AI-assisted: yes (Codex, GPT-6.2 Sol).

Status: Please address or explicitly accept the alias-related cache regression before merging.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7224802035 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/2481#issuecomment-7224802035). Originally posted by [TheGeogeo](https://github.com/TheGeogeo) on 2026-11-27T17:48:10Z. --- Independent review of `ba19ca8adacf791700c115bef5146f076ef3a990`, merged with `main` `c0201a806b061120e6cdee9916395275a632367e` (merge tree matches `daf669bf3ce9f3f9b3059baa53975f45160b61eb`). **Finding:** `scripts/windows-boot/boot.ps1:290–309` compares paths lexically. When the writable cache reaches the same journal through a junction or a `\\.\` alias, auto-seeding is enabled, but `resolve_roots` detects the overlap and disables both journals. In the same setup `main` retains the writable journal. I reproduced this with dry runs and a direct test of `runtime/src/pipeline_cache_journal.h`; the README documents alias limitations, but this configuration loses an existing cache. Please consider avoiding the automatic seed for aliases or preserving the writable cache when rejecting it. Windows 11 build 26300, Windows PowerShell 5.1 and Python 3.12.4; no game files used: - `test_windows_boot_journal_seed.py`: 15/15 pass on the merged PR; 12/15 on `main` using the PR's test harness, with the three expected new-behavior failures. - Five adjacent boot/pipeline suites: 95 passed, 1 skipped on each revision. - `pipeline_cache_journal_test.cpp`: built and passed on both revisions. Eight additional dry runs passed. `git diff --check` and the no-game-data check on the changed files passed. The complete project suite was not run. GPU and in-game cache hits or performance were not tested, so the performance gain remains unverified here. AI-assisted: yes (Codex, GPT-6.2 Sol). **Status:** Please address or explicitly accept the alias-related cache regression before merging.
enlight3d commented 2026-11-27 17:54:45 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-11-27T17:54:45Z.


@TheGeogeo thanks for the repro. Fixed in 2893fae21: boot.ps1 now compares the boot's journal and the seed by Windows' final paths (GetFinalPathNameByHandle, taken from the deepest existing parent), so a junction, symbolic link, substituted or mapped drive, 8.3 name or the \\?\ / \\.\ prefix counts as the same folder: no seed is set and the writable journal stays on, as on main. The spelled paths remain the fallback if the helper cannot load. The approach was OreoFR's agent's suggestion.

  • New tests test_a_device_path_prefix_names_the_same_folder and test_a_junction_to_the_runtime_folder_is_recognised: both fail on ba19ca8ad and pass now; the file runs 17 tests OK on Windows PowerShell 5.1.
  • Your shape (a runtime folder with a space, a junction to it, and the \\.\ spelling of it as LEONIDA_PIPELINE_CACHE_DIR): no seed in a dry run for each; the plain case still gets its seed on PowerShell 5.1 and 7.
  • -DryRun takes about 2.6 s with the helper compiled.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7224918648 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/2481#issuecomment-7224918648). Originally posted by [enlight3d](https://github.com/enlight3d) on 2026-11-27T17:54:45Z. --- @TheGeogeo thanks for the repro. Fixed in 2893fae21: `boot.ps1` now compares the boot's journal and the seed by Windows' final paths (`GetFinalPathNameByHandle`, taken from the deepest existing parent), so a junction, symbolic link, substituted or mapped drive, 8.3 name or the `\\?\` / `\\.\` prefix counts as the same folder: no seed is set and the writable journal stays on, as on `main`. The spelled paths remain the fallback if the helper cannot load. The approach was OreoFR's agent's suggestion. - New tests `test_a_device_path_prefix_names_the_same_folder` and `test_a_junction_to_the_runtime_folder_is_recognised`: both fail on ba19ca8ad and pass now; the file runs 17 tests OK on Windows PowerShell 5.1. - Your shape (a runtime folder with a space, a junction to it, and the `\\.\` spelling of it as `LEONIDA_PIPELINE_CACHE_DIR`): no seed in a dry run for each; the plain case still gets its seed on PowerShell 5.1 and 7. - `-DryRun` takes about 2.6 s with the helper compiled. AI-assisted (Claude Code).
Andretuta commented 2026-11-27 20:47:29 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Andretuta on 2026-11-27T20:47:29Z.

Review: APPROVED


Verified locally at 2893fae21 merged with main on Windows 10 (PowerShell 5.1):

  • tests/test_windows_boot_journal_seed.py passes 17/17 in DryRun mode (base main fails the 3 seed-selection cases as expected).
  • The earlier junction/symlink same-target finding is addressed via GetFinalPathNameByHandle and covered by junction/prefix tests.
  • Note: live retail boot time was not measured here, only the synthetic DryRun suite. Hosted Runtime failures are the shared base issues.

AI-assisted review.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6093210334 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2481#pullrequestreview-6093210334). Originally posted by [Andretuta](https://github.com/Andretuta) on 2026-11-27T20:47:29Z. **Review:** APPROVED --- Verified locally at `2893fae21` merged with `main` on Windows 10 (PowerShell 5.1): - `tests/test_windows_boot_journal_seed.py` passes **17/17** in `DryRun` mode (base `main` fails the 3 seed-selection cases as expected). - The earlier junction/symlink same-target finding is addressed via `GetFinalPathNameByHandle` and covered by junction/prefix tests. - Note: live retail boot time was not measured here, only the synthetic `DryRun` suite. Hosted Runtime failures are the shared base issues. AI-assisted review.
Sign in to join this conversation.
No reviewers
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
ProjectLeonida/mandy!2481
No description provided.