leonida warm: make the pipelines folder on a first run (RT-WARM-FIRST-RUN-DIR) #2774

Open
lerapeurdu62280-debug wants to merge 2 commits from upstream-pr/2774 into main
lerapeurdu62280-debug commented 2026-11-30 18:08:40 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by lerapeurdu62280-debug on 2026-11-30T18:08:40Z.


Claimed in the coordination issue as: RT-WARM-FIRST-RUN-DIR (done line)

What and why

On a first start the cache has no pipelines folder yet (the game makes it later). leonida warm --used, run by scripts\play-d3d12.ps1 before the game, opens warm-done.txt, slow-pipelines.txt and warm-bad.txt in that folder and stops with:

0 pipelines known, 0 made before (…), 0 bad; 0 to make, 8 processes
Error: The system cannot find the path specified. (os error 3)

The play script prints it as a NativeCommandError and carries on, so the game starts, but every first run shows an error. The fix makes the folder (create_dir_all) right after it is resolved.

Tested

  • cargo build --locked --profile diag -p leonida --features diagnostics,mimalloc
  • With an empty LEONIDA_CACHE_DIR: leonida warm --used exits 1 with os error 3 on main (afb511541), and 0 with this change, with warm-done.txt, warm-bad.txt and slow-pipelines.txt written in the new pipelines folder.
  • Not run: cargo test, the Python suite.

GPUs tested: AMD Radeon RX 6600 (driver 32.0.21045.29003), Ryzen 5 3600, Windows 11 26300

AI-assisted: yes (Claude Opus 5.5)

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • 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)

Contribution : EI S.O.S INFO LUDO

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5570972590 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2774). Originally posted by [lerapeurdu62280-debug](https://github.com/lerapeurdu62280-debug) on 2026-11-30T18:08:40Z. --- Claimed in the coordination issue as: `RT-WARM-FIRST-RUN-DIR` ([done line](https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7287442387)) ### What and why On a first start the cache has no `pipelines` folder yet (the game makes it later). `leonida warm --used`, run by `scripts\play-d3d12.ps1` before the game, opens `warm-done.txt`, `slow-pipelines.txt` and `warm-bad.txt` in that folder and stops with: ``` 0 pipelines known, 0 made before (…), 0 bad; 0 to make, 8 processes Error: The system cannot find the path specified. (os error 3) ``` The play script prints it as a `NativeCommandError` and carries on, so the game starts, but every first run shows an error. The fix makes the folder (`create_dir_all`) right after it is resolved. ### Tested - `cargo build --locked --profile diag -p leonida --features diagnostics,mimalloc` - With an empty `LEONIDA_CACHE_DIR`: `leonida warm --used` exits 1 with os error 3 on `main` (`afb511541`), and 0 with this change, with `warm-done.txt`, `warm-bad.txt` and `slow-pipelines.txt` written in the new `pipelines` folder. - Not run: `cargo test`, the Python suite. GPUs tested: AMD Radeon RX 6600 (driver 32.0.21045.29003), Ryzen 5 3600, Windows 11 26300 AI-assisted: yes (Claude Opus 5.5) ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [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) Contribution : EI S.O.S INFO LUDO
KelboLive commented 2026-11-30 18:14:47 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by KelboLive on 2026-11-30T18:14:47Z.


Independent check on Windows (not the author), at fc32118f7.

  • cargo build --locked --profile diag -p leonida --features diagnostics,mimalloc: succeeded in 1m 18s.

The warm-first-run behaviour itself needs a game/leonida warm run; this confirms the app builds with the change.

Environment: Ryzen 9 7950X3D, Windows 11 Pro 10.0.26200.9711, Rust 1.98.1 pinned.

AI-assisted: yes (opencode).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7287561990 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2774#issuecomment-7287561990). Originally posted by [KelboLive](https://github.com/KelboLive) on 2026-11-30T18:14:47Z. --- Independent check on Windows (not the author), at `fc32118f7`. - `cargo build --locked --profile diag -p leonida --features diagnostics,mimalloc`: **succeeded** in 1m 18s. The warm-first-run behaviour itself needs a game/`leonida warm` run; this confirms the app builds with the change. Environment: Ryzen 9 7950X3D, Windows 11 Pro 10.0.26200.9711, Rust 1.98.1 pinned. AI-assisted: yes (opencode).
lerapeurdu62280-debug commented 2026-11-30 18:28:04 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by lerapeurdu62280-debug on 2026-11-30T18:28:04Z.


Tests run since opening: cargo test --locked -p leonida on fc32118f7: 39 + 2 + 2 passed, 0 failed (Windows 11 26300, RX 6600, Rust 1.98.1). Thanks @KelboLive for the independent build.

Contribution : EI S.O.S INFO LUDO

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7287892225 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2774#issuecomment-7287892225). Originally posted by [lerapeurdu62280-debug](https://github.com/lerapeurdu62280-debug) on 2026-11-30T18:28:04Z. --- Tests run since opening: `cargo test --locked -p leonida` on `fc32118f7`: 39 + 2 + 2 passed, 0 failed (Windows 11 26300, RX 6600, Rust 1.98.1). Thanks @KelboLive for the independent build. Contribution : EI S.O.S INFO LUDO
KelboLive commented 2026-12-01 05:48:32 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by KelboLive on 2026-12-01T05:48:32Z.

Review: COMMENTED


The path is right and both directions reproduce: folder() is <cache>/pipelines — the same sibling the runtime itself uses (d3d12/hle/src/modules/d3d12x.rs:75, with_file_name("pipelines")), and the game creates it as pipeline/library.rs:658 — created with create_dir_all before known::keys and the three OpenOptions opens, so a first run now writes its three files (head: exit 0, folder beside shaders) instead of dying at warm-done.txt (base: exit 1, os error 3). Idempotent for child processes and for an existing folder.

Two things to fix:

  1. The new failure is bare. With pipelines existing as a file the run exits 1 with Cannot create a file when that file already exists. (os error 183) and no path, unlike Config::subdir's creating <path> context (config.rs:130-135). Add .with_context(|| format!("creating {}", dir.display())) — one line, and this is the one error a first-run user is most likely to hit on a mangled cache directory.
  2. No test covers it. cargo test -p leonida (39 + 2 + 2 here) never touches warm, so deleting the line keeps the suite green; your evidence is a manual run. A small ensure_folder(&Path) helper tested with a temp LEONIDA_CACHE_DIR for fresh, existing-directory and file-in-the-way would pin both behaviours without dragging host/GPU initialisation into the test.

Not this line's problem, but worth knowing: a read-only cache still fails earlier in cache_subdir("shaders") with the pre-existing misleading "already exists" wording, so that case will not be improved by this PR.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6125824021 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2774#pullrequestreview-6125824021). Originally posted by [KelboLive](https://github.com/KelboLive) on 2026-12-01T05:48:32Z. **Review:** COMMENTED --- The path is right and both directions reproduce: `folder()` is `<cache>/pipelines` — the same sibling the runtime itself uses (`d3d12/hle/src/modules/d3d12x.rs:75`, `with_file_name("pipelines")`), and the game creates it as `pipeline/library.rs:658` — created with `create_dir_all` before `known::keys` and the three `OpenOptions` opens, so a first run now writes its three files (head: exit 0, folder beside `shaders`) instead of dying at `warm-done.txt` (base: exit 1, `os error 3`). Idempotent for child processes and for an existing folder. Two things to fix: 1. **The new failure is bare.** With `pipelines` existing as a *file* the run exits 1 with `Cannot create a file when that file already exists. (os error 183)` and no path, unlike `Config::subdir`'s `creating <path>` context (`config.rs:130-135`). Add `.with_context(|| format!("creating {}", dir.display()))` — one line, and this is the one error a first-run user is most likely to hit on a mangled cache directory. 2. **No test covers it.** `cargo test -p leonida` (39 + 2 + 2 here) never touches `warm`, so deleting the line keeps the suite green; your evidence is a manual run. A small `ensure_folder(&Path)` helper tested with a temp `LEONIDA_CACHE_DIR` for fresh, existing-directory and file-in-the-way would pin both behaviours without dragging host/GPU initialisation into the test. Not this line's problem, but worth knowing: a read-only cache still fails earlier in `cache_subdir("shaders")` with the pre-existing misleading "already exists" wording, so that case will not be improved by this PR.
lerapeurdu62280-debug commented 2026-12-01 11:27:27 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by lerapeurdu62280-debug on 2026-12-01T11:27:27Z.


Both done in a554e4c15:

  1. The folder is now made by ensure_folder, with .with_context(|| format!("creating {}", dir.display())) like Config::subdir.
  2. warm::tests::ensure_folder_makes_keeps_and_names_the_path covers a fresh folder, an existing one (its files are kept) and a file in the way (the error names the path). It uses a temp dir directly rather than LEONIDA_CACHE_DIR, so it does not touch the environment of tests running in parallel. cargo test -p leonida: 40 + 2 + 2 passed.

Run by hand with leonida warm --used on an AMD Radeon RX 6600 (Windows 11):

Cache Result
empty LEONIDA_CACHE_DIR exit 0, pipelines/ with warm-done.txt, warm-bad.txt, slow-pipelines.txt
pipelines is a file exit 1, Error: creating <cache>\pipelines / Caused by: ... (os error 183)

The read-only cache case you mentioned (earlier, in cache_subdir("shaders")) is left as it is: it is outside this PR.

AI-assisted (Claude Opus 5.5). Contribution : EI S.O.S INFO LUDO

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7309668562 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2774#issuecomment-7309668562). Originally posted by [lerapeurdu62280-debug](https://github.com/lerapeurdu62280-debug) on 2026-12-01T11:27:27Z. --- Both done in a554e4c15: 1. The folder is now made by `ensure_folder`, with `.with_context(|| format!("creating {}", dir.display()))` like `Config::subdir`. 2. `warm::tests::ensure_folder_makes_keeps_and_names_the_path` covers a fresh folder, an existing one (its files are kept) and a file in the way (the error names the path). It uses a temp dir directly rather than `LEONIDA_CACHE_DIR`, so it does not touch the environment of tests running in parallel. `cargo test -p leonida`: 40 + 2 + 2 passed. Run by hand with `leonida warm --used` on an AMD Radeon RX 6600 (Windows 11): | Cache | Result | |---|---| | empty `LEONIDA_CACHE_DIR` | exit 0, `pipelines/` with `warm-done.txt`, `warm-bad.txt`, `slow-pipelines.txt` | | `pipelines` is a file | exit 1, `Error: creating <cache>\pipelines` / `Caused by: ... (os error 183)` | The read-only cache case you mentioned (earlier, in `cache_subdir("shaders")`) is left as it is: it is outside this PR. AI-assisted (Claude Opus 5.5). Contribution : EI S.O.S INFO LUDO
MoonEyes commented 2026-12-02 12:24:58 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T12:24:58Z.


This pull request touches the render path, so it needs an in-game run before it can be merged: unit tests and CI do not catch rendering regressions (a device loss after an earlier merge is why this gate exists).

Could you, or anyone with a working setup, post a run report on the current head merged onto current main:

  • the head SHA and the main SHA it was merged onto;
  • GPU, driver and OS;
  • at least 300 s in the world after loading;
  • device lost / crashes (count), and rendered fps (median) if you have them;
  • the same run on main alone for comparison, if you can.

Please do not attach logs or screenshots that show game content. If a run on this exact head is already posted, a link to it in a reply is enough.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7345305026 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2774#issuecomment-7345305026). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T12:24:58Z. --- This pull request touches the render path, so it needs an in-game run before it can be merged: unit tests and CI do not catch rendering regressions (a device loss after an earlier merge is why this gate exists). Could you, or anyone with a working setup, post a run report on the **current head** merged onto current `main`: - the head SHA and the `main` SHA it was merged onto; - GPU, driver and OS; - at least 300 s in the world after loading; - device lost / crashes (count), and rendered fps (median) if you have them; - the same run on `main` alone for comparison, if you can. Please do not attach logs or screenshots that show game content. If a run on this exact head is already posted, a link to it in a reply is enough. AI-assisted (Claude Code).
MoonEyes commented 2026-12-02 15:09:19 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T15:09:19Z.


RUN (in game, batch of six render-path pull requests), each head merged with git merge --no-ff onto main f45165e15, in one build: #2952 4df667e42, #2969 535c14094, #2877 f98e8ccf9, #2965 c62d57344, #2774 0dea1a13f, #2815 5ac7975c6. RTX 4060 8 GB, driver 610.88, Windows 11. Series S, -Resolution 1080, frame generation 2x, the same walking route as the other runs on this machine, 330 s after reaching the world.

What Result
Device lost / device removed 0
Exceptions, panics, hang watchdog, GPU stall, title suspended 0
Process alive at the end yes, stopped by the time limit
Rendered fps, last 240 s (48 samples) median 14.9, mean 14.2
Rendered fps, last 120 s median 14.6

For reference, the same machine and route rendered 13.3 to 15.2 fps today on main with single pull requests. A Rust build ran beside the game for part of the run, so the fps are a check that nothing fell over, not a measurement of a gain.

Verdict: PASS for the in-game gate (300 s or more in the world, no device loss) for this batch. If one of these pull requests changes its head, this run no longer covers it.

Limits: one run; free system memory was low (median 1.1 GB); arrival in the world was driven by keys and not checked on pictures. An earlier attempt of the same batch stopped at once because the game window lost focus ("title suspended"); it is not counted.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7349823066 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2774#issuecomment-7349823066). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T15:09:19Z. --- RUN (in game, batch of six render-path pull requests), each head merged with `git merge --no-ff` onto main `f45165e15`, in one build: #2952 `4df667e42`, #2969 `535c14094`, #2877 `f98e8ccf9`, #2965 `c62d57344`, #2774 `0dea1a13f`, #2815 `5ac7975c6`. RTX 4060 8 GB, driver 610.88, Windows 11. Series S, `-Resolution 1080`, frame generation 2x, the same walking route as the other runs on this machine, 330 s after reaching the world. | What | Result | |---|---| | Device lost / device removed | 0 | | Exceptions, panics, hang watchdog, GPU stall, title suspended | 0 | | Process alive at the end | yes, stopped by the time limit | | Rendered fps, last 240 s (48 samples) | median 14.9, mean 14.2 | | Rendered fps, last 120 s | median 14.6 | For reference, the same machine and route rendered 13.3 to 15.2 fps today on main with single pull requests. A Rust build ran beside the game for part of the run, so the fps are a check that nothing fell over, not a measurement of a gain. Verdict: PASS for the in-game gate (300 s or more in the world, no device loss) for this batch. If one of these pull requests changes its head, this run no longer covers it. Limits: one run; free system memory was low (median 1.1 GB); arrival in the world was driven by keys and not checked on pictures. An earlier attempt of the same batch stopped at once because the game window lost focus ("title suspended"); it is not counted. AI-assisted (Claude Code).
merzleckeier commented 2026-12-02 15:17:47 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-02T15:17:47Z.

Review: COMMENTED


I ran the actual leonida warm --used --jobs 1 entry point on 0dea1a13 merged onto main 83046a71, using an MSVC-target build under Wine 11.22 and temporary synthetic caches. main exited 1 with Path not found on the empty cache. This head created pipelines and all three receipt files, and a second invocation preserved a pre-existing receipt. With a file at pipelines, it exited 1, named the obstructing path, and left its contents unchanged.

Git reports an overlap in warm.rs with #3071 and #3143 individually. #3150 merges cleanly with this head. I also added the folder check before the parent/child split in the already tested local combination of #3071, #3143 and #3150 on current main. With this PR included, that combination passed 60 CLI unit tests, both cold-cache/obstructed-path tests, and both library-first fallback integration tests. Synthetic CLI coverage only. AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6153682495 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2774#pullrequestreview-6153682495). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-02T15:17:47Z. **Review:** COMMENTED --- I ran the actual `leonida warm --used --jobs 1` entry point on `0dea1a13` merged onto `main` `83046a71`, using an MSVC-target build under Wine 11.22 and temporary synthetic caches. `main` exited 1 with `Path not found` on the empty cache. This head created `pipelines` and all three receipt files, and a second invocation preserved a pre-existing receipt. With a file at `pipelines`, it exited 1, named the obstructing path, and left its contents unchanged. Git reports an overlap in `warm.rs` with #3071 and #3143 individually. #3150 merges cleanly with this head. I also added the folder check before the parent/child split in the already tested local combination of #3071, #3143 and #3150 on current `main`. With this PR included, that combination passed 60 CLI unit tests, both cold-cache/obstructed-path tests, and both library-first fallback integration tests. Synthetic CLI coverage only. AI-assisted with OpenAI Codex.
MoonEyes commented 2026-12-02 15:56:52 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T15:56:52Z.


RUN (independent run on Windows, #2774 head 0dea1a13f, merged locally into main f45165e15 with git merge --no-ff, as part of a batch of six)

The in-game run of the batch is already posted on this pull request; this comment is the test side only (no game data, no game files).

Red: main's warm.rs with the new test kept does not compile: unresolved import super::ensure_folder. Weakened versions of the function fail the test: create_dir_all to create_dir fails at the "parents included" step; dropping with_context("creating ...") fails the last assertion (the error must name the path).

Green (whole batch, one tree, Windows 11, debug profile as d3d12.yml runs it):

  • cargo test --workspace --exclude xtask --locked: 1708 passed, 0 failed, 75 ignored (leonida-gpu lib 691 / 59 ignored, leonida-shader lib 248 / 2 ignored, leonida app 44 incl. warm::tests::ensure_folder_makes_keeps_and_names_the_path, leonida-formats 47, leonida-menu 48, leonida-pe 36).
  • cargo test -p leonida-gpu --features diagnostics --test replay --locked: 1 passed.
  • cargo test -p xtask --locked: 7 passed.
  • Caveat, not from this batch: the leonida-gpu lib fails one test intermittently (3 different ones over 3 full runs of this tree: texture::alias_cast_tests::committed_and_placed_r32_uint_textures_cast_to_r9g9b9e5_under_legacy_barriers, watch::tests::a_write_opens_the_view_it_goes_through, pipeline::make::tests::overlapping_waits_cost_the_frame_its_budget_once); each passes alone, a later full run was 691/0, and main f45165e15 alone failed the alias_cast test in 2 of 3 runs.

Mutations:

  • create_dir: killed.
  • No context on the error: killed.
  • Deleting ensure_folder(&dir)?; in run(): survives. The test calls the helper directly, so it pins the helper, not that run uses it. Moving the call after the these branch would bring the bug back for --these and is equally unpinned (reasoned, not run).

Review: no defect. create_dir_all is idempotent and leaves an existing folder and its files alone (the test checks warm-done.txt survives). A race with the game making the same folder is harmless. The test uses temp_dir()/leonida-warm-folder-test-<pid> and cleans up; antivirus on temp can block it like the other temp-dir tests.

Not covered: that run() calls it before the three files are opened (needs LEONIDA_CACHE_DIR and the whole warm command; the author ran it by hand, see the PR body).

Verdict: PASS. The helper is pinned; the one line in run() is not.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7351194249 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2774#issuecomment-7351194249). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T15:56:52Z. --- RUN (independent run on Windows, #2774 head 0dea1a13f, merged locally into `main` f45165e15 with `git merge --no-ff`, as part of a batch of six) The in-game run of the batch is already posted on this pull request; this comment is the test side only (no game data, no game files). **Red:** main's `warm.rs` with the new test kept does not compile: `unresolved import super::ensure_folder`. Weakened versions of the function fail the test: `create_dir_all` to `create_dir` fails at the "parents included" step; dropping `with_context("creating ...")` fails the last assertion (the error must name the path). **Green** (whole batch, one tree, Windows 11, debug profile as `d3d12.yml` runs it): - `cargo test --workspace --exclude xtask --locked`: 1708 passed, 0 failed, 75 ignored (leonida-gpu lib 691 / 59 ignored, leonida-shader lib 248 / 2 ignored, leonida app 44 incl. `warm::tests::ensure_folder_makes_keeps_and_names_the_path`, leonida-formats 47, leonida-menu 48, leonida-pe 36). - `cargo test -p leonida-gpu --features diagnostics --test replay --locked`: 1 passed. - `cargo test -p xtask --locked`: 7 passed. - Caveat, not from this batch: the leonida-gpu lib fails one test intermittently (3 different ones over 3 full runs of this tree: `texture::alias_cast_tests::committed_and_placed_r32_uint_textures_cast_to_r9g9b9e5_under_legacy_barriers`, `watch::tests::a_write_opens_the_view_it_goes_through`, `pipeline::make::tests::overlapping_waits_cost_the_frame_its_budget_once`); each passes alone, a later full run was 691/0, and `main` f45165e15 alone failed the alias_cast test in 2 of 3 runs. **Mutations:** - `create_dir`: killed. - No context on the error: killed. - Deleting `ensure_folder(&dir)?;` in `run()`: survives. The test calls the helper directly, so it pins the helper, not that `run` uses it. Moving the call after the `these` branch would bring the bug back for `--these` and is equally unpinned (reasoned, not run). **Review:** no defect. `create_dir_all` is idempotent and leaves an existing folder and its files alone (the test checks `warm-done.txt` survives). A race with the game making the same folder is harmless. The test uses `temp_dir()/leonida-warm-folder-test-<pid>` and cleans up; antivirus on temp can block it like the other temp-dir tests. **Not covered:** that `run()` calls it before the three files are opened (needs `LEONIDA_CACHE_DIR` and the whole `warm` command; the author ran it by hand, see the PR body). **Verdict: PASS.** The helper is pinned; the one line in `run()` is not. AI-assisted (Claude Code).
MoonEyes commented 2026-12-02 18:03:19 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T18:03:19Z.


Code review only, not built (Windows-only leonida app). Ready.

  • Head: 0dea1a13f, merge base a917c54d6, 184 behind current main 45dc41f95. A trial merge is clean.
  • CI: the runs on this head are waiting for maintainer approval (action_required).
  • Already verified on this head: MoonEyes in-game batch (15:09, 0 device lost, PASS) and an independent run (15:56, PASS: "the helper is pinned; the one line in run() is not").

Review of d3d12/apps/leonida/src/warm.rs:

  • ensure_folder(&dir)? runs right after folder(), before both the these early return and the main path. Every later open in the pipelines folder now finds it on a first run. That is the root cause: the folder is normally made by the game, and leonida warm can run first.
  • create_dir_all keeps an existing folder untouched. The error names the path through with_context.
  • The test covers a fresh path with parents, an existing folder with its contents kept, and a file in the way with the path in the error.
  • Minor: the test cleans up only when it succeeds. A failing assertion leaves leonida-warm-folder-test-<pid> in %TEMP%. A drop guard, as #3144's tests use, would tidy that. Not blocking.

Verdict: ready.

AI-assisted verification: Claude Opus (Claude Code), separate agent per batch.


Generated by Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7353898666 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2774#issuecomment-7353898666). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T18:03:19Z. --- **Code review only, not built (Windows-only `leonida` app). Ready.** - Head: `0dea1a13f`, merge base `a917c54d6`, 184 behind current `main` `45dc41f95`. A trial merge is clean. - CI: the runs on this head are waiting for maintainer approval (`action_required`). - Already verified on this head: MoonEyes in-game batch (15:09, 0 device lost, PASS) and an independent run (15:56, PASS: "the helper is pinned; the one line in `run()` is not"). **Review of `d3d12/apps/leonida/src/warm.rs`:** - `ensure_folder(&dir)?` runs right after `folder()`, before both the `these` early return and the main path. Every later open in the pipelines folder now finds it on a first run. That is the root cause: the folder is normally made by the game, and `leonida warm` can run first. - `create_dir_all` keeps an existing folder untouched. The error names the path through `with_context`. - The test covers a fresh path with parents, an existing folder with its contents kept, and a file in the way with the path in the error. - Minor: the test cleans up only when it succeeds. A failing assertion leaves `leonida-warm-folder-test-<pid>` in `%TEMP%`. A drop guard, as #3144's tests use, would tidy that. Not blocking. Verdict: **ready**. AI-assisted verification: Claude Opus (Claude Code), separate agent per batch. --- _Generated by [Claude Code](https://claude.ai/code)_
fiestorra commented 2026-12-03 03:14:49 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-03T03:14:49Z.


VERIFY-2774 — Windows nativo: ensure_folder y su test pasan

Un fichero, 29 líneas, once días abierto:

cargo test -p leonida        2 passed + 1 passed
  warm::tests::ensure_folder_makes_keeps_and_names_the_path

El cambio: una función de tres líneas —

fn ensure_folder(dir: &Path) -> Result<()> {
    std::fs::create_dir_all(dir).with_context(|| format!("creating {}", dir.display()))
}

— y un test que comprueba las tres cosas que el nombre promete: que crea la carpeta, que no falla si ya existe (create_dir_all, no create_dir), y que el error nombra la ruta.

Y el nombre del test es la documentación: ensure_folder_makes_keeps_and_names_the_path — «makes», «keeps», «names», tres verbos para las tres obligaciones de una función de tres líneas. No he visto un nombre de test mejor esta noche.

Lo que no probé: la primera ejecución del warm-up de verdad (el caso que motiva el cambio: leonida warm en una máquina donde target/diag/pipelines no existe todavía) — el test usa un directorio temporal, que es el mismo caso sin el juego.

Y una nota de método, porque me costó dos intentos: cargo test -p leonida --lib responde no library targets found — leonida es un binario, y sus tests son de binario; la forma es cargo test -p leonida, sin --lib. Lo tenía en mis notas y aun así lo intenté con --lib primero.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7366359060 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2774#issuecomment-7366359060). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-12-03T03:14:49Z. --- ## VERIFY-2774 — Windows nativo: `ensure_folder` y su test pasan **Un fichero, 29 líneas, once días abierto**: ``` cargo test -p leonida 2 passed + 1 passed warm::tests::ensure_folder_makes_keeps_and_names_the_path ``` **El cambio**: **una función de tres líneas** — ```rust fn ensure_folder(dir: &Path) -> Result<()> { std::fs::create_dir_all(dir).with_context(|| format!("creating {}", dir.display())) } ``` **— y un test que comprueba las tres cosas que el nombre promete**: **que crea la carpeta, que no falla si ya existe (`create_dir_all`, no `create_dir`), y que el error nombra la ruta.** **Y el nombre del test es la documentación**: **`ensure_folder_makes_keeps_and_names_the_path`** — **«makes», «keeps», «names»**, **tres verbos para las tres obligaciones de una función de tres líneas.** **No he visto un nombre de test mejor esta noche.** **Lo que no probé**: **la primera ejecución del warm-up de verdad** (**el caso que motiva el cambio: `leonida warm` en una máquina donde `target/diag/pipelines` no existe todavía**) — **el test usa un directorio temporal, que es el mismo caso sin el juego.** **Y una nota de método, porque me costó dos intentos**: **`cargo test -p leonida --lib` responde `no library targets found`** — **`leonida` es un *binario*, y sus tests son de binario**; **la forma es `cargo test -p leonida`, sin `--lib`.** **Lo tenía en mis notas y aun así lo intenté con `--lib` primero.**
merzleckeier commented 2026-12-03 03:44:59 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-03T03:44:59Z.

Review: COMMENTED


Follow-up on the cold-cache run. I combined 0dea1a13 with #3284 at f9c58876 on current main (516c9eaa), using a Windows MSVC build under Wine 11.22. The patches merge cleanly.

  • On a fresh cache, the public leonida warm --used --jobs 1 command exited 0 and created pipelines with warm-done.txt, warm-bad.txt and slow-pipelines.txt. Removing only ensure_folder(&dir)? made that command fail with Win32 error 3 again.
  • With a regular file at pipelines, the command failed, named the obstructing path, and preserved the file.
  • With the synthetic format-variant record from the #3284 round trip, warm --used --limit 0 counted one known pipeline and left both book files byte-identical. That run covers reading the persisted record. GPU pipeline compilation and timing are outside this fixture.

AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6163355027 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2774#pullrequestreview-6163355027). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-03T03:44:59Z. **Review:** COMMENTED --- Follow-up on the cold-cache run. I combined `0dea1a13` with #3284 at `f9c58876` on current `main` (`516c9eaa`), using a Windows MSVC build under Wine 11.22. The patches merge cleanly. - On a fresh cache, the public `leonida warm --used --jobs 1` command exited 0 and created `pipelines` with `warm-done.txt`, `warm-bad.txt` and `slow-pipelines.txt`. Removing only `ensure_folder(&dir)?` made that command fail with Win32 error 3 again. - With a regular file at `pipelines`, the command failed, named the obstructing path, and preserved the file. - With the synthetic format-variant record from the [#3284 round trip](https://github.com/ProjectLeonida/mandy/pull/3284#pullrequestreview-6163145211), `warm --used --limit 0` counted one known pipeline and left both book files byte-identical. That run covers reading the persisted record. GPU pipeline compilation and timing are outside this fixture. AI-assisted with OpenAI Codex.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/2774:upstream-pr/2774'
git switch 'upstream-pr/2774'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/2774'
git switch 'upstream-pr/2774'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2774'
git switch 'upstream-pr/2774'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2774'
git switch 'main'
git merge --squash 'upstream-pr/2774'
git switch 'main'
git merge --ff-only 'upstream-pr/2774'
git switch 'main'
git merge 'upstream-pr/2774'
git push origin 'main'
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!2774
No description provided.