leonida warm: make the pipelines folder on a first run (RT-WARM-FIRST-RUN-DIR) #2774
Open
github-bot
wants to merge 2 commits from
github-bot/gh-2774 into main
AGit
pull from: github-bot/gh-2774
merge into: github:main
github:main
github:perf/darner-title-priority-ceiling
github:gh-readonly-queue/main/pr-3311-b5c45b663dbc5a9c3532bb3f307e5f81b32faefa
github:gh-readonly-queue/main/pr-3088-af22e7847ff5808f72d1a1881c24be2fafd20b54
github:gh-readonly-queue/main/pr-3123-7f3fa026a94c6646e89244f28e1ce22290361867
github:gh-readonly-queue/main/pr-3354-637baa0b77ba47222e7280b17c1a59c6a1781d57
github:gh-readonly-queue/main/pr-3365-d7a0e0196a43834813014b4bd3aa5502a8263b14
github:gh-readonly-queue/main/pr-3361-5dfe8bbd05ed12fb2f2e1718d9af77a7c5f46fd8
github:gh-readonly-queue/main/pr-3366-8da9148204e9d12c585efa9ac2b7cc1ab08c7682
github:fix/runtime-test-conservative-fixtures
github:ci/shard-semantic-linux
github:docs/fg-limit-fps-switch
github:fix/runtime-test-fixture-paths
github:fix/runtime-test-fixture-readers
github:fix/read-file-hard-link
github:fix/book-slot-heap-never-read
github:fix/depth-resolve-spv-path
github:fix/indirect-unused-batched
github:gh-pr/3358/base
github:fix/xmem-refusal-diagnostics
github:gh-pr/3357/base
github:ci/shorten-ci-time
github:fix/alias-later-queued-submissions
github:claude/gallant-sagan-aamatr
github:gh-pr/3342/base
github:gh-pr/3341/base
github:d3d12/agility-sdk-621
github:gh-pr/3293/base
github:gh-pr/3319/base
github:gh-pr/3318/base
github:gh-pr/3315/base
github:gh-pr/3313/base
github:gh-pr/3314/base
github:claude/fervent-curie-m19lnr
github:gh-pr/3216/base
github:gh-pr/3272/base
github:gh-pr/3276/base
github:gh-pr/3279/base
github:gh-pr/3257/base
github:gh-pr/3258/base
github:gh-pr/3271/base
github:codex/skip-no-hit-ray-passes
github:gh-pr/3230/base
github:gh-pr/3266/base
github:gh-pr/3247/base
github:gh-pr/3246/base
github:gh-pr/3244/base
github:claude/sharp-sagan-1jqnp3
github:t3/preserve-fsr-sdk-restart-path
github:t3/propagate-host-failure-hresult
github:t3/launcher-custom-parameters
github:t3/series-x-2160-startup
github:codex/d3d12-uncapped-simulation
github:ci/less-to-run
github:perf/native-compute-shader-forms
github:claude/blissful-franklin-ukp7ag
github:codex/full-precompile-default
github:gh-pr/3166/base
github:gh-pr/3148/base
github:gh-pr/3138/base
github:gh-pr/3106/base
github:gh-pr/3057/base
github:gh-pr/2756/base
github:gh-pr/2812/base
github:gh-pr/3032/base
github:gh-pr/2992/base
github:notes/card-time-and-plant-flicker
github:gh-pr/2986/base
github:gh-pr/3000/base
github:gh-pr/2966/base
github:gh-pr/2924/base
github:gh-pr/726/base
github:gh-pr/2761/base
github:gh-pr/2663/base
github:gh-pr/2861/base
github:gh-pr/2862/base
github:gh-pr/2820/base
github:gh-pr/2811/base
github:gh-pr/2803/base
github:rt-call-trace
github:gh-pr/2802/base
github:gh-pr/2766/base
github:perf/ahead-split
github:gh-pr/2589/base
github:gh-pr/2699/base
github:gh-pr/2696/base
github:docs/readme-runtime-proposal
github:gh-pr/1346/base
github:codex/coord-claim-check-20261124-7e48
No reviewers
Labels
Clear labels
accessibility
Barrier affecting people with disabilities
area: ci
.github/ workflows and settings
area: d3d12
The D3D12 runtime in d3d12/ (Rust: leonida.exe and its crates)
area: docs
Documentation
area: launcher
The launcher (launcher/)
area: runtime (legacy)
The earlier Vulkan runtime in runtime/
area: shader translator
The shader translator (leonida-shader, tools/rdna2spirv) and its tests
area: tools
tools/ and scripts/
area: viewer
The map viewer (viewer/)
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
duplicate
This issue or pull request already exists
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
invalid
This doesn't seem right
missing claim
Needs a claim in #14
needs in-game run
Changes the code a frame runs through: needs the 300 s in-game gate (docs/game_gate.md)
needs rebase
Conflicts with the base branch: rebase it on main
needs-triage
Needs maintainer evaluation before the next triage state
question
Further information is requested
ready-for-agent
Fully specified and ready for an AFK agent
submodules
Pull requests that update submodules code
wontfix
This will not be worked on
No labels
accessibility
area: ci
area: d3d12
area: docs
area: launcher
area: runtime (legacy)
area: shader translator
area: tools
area: viewer
bug
dependencies
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs in-game run
needs rebase
needs-triage
question
ready-for-agent
submodules
wontfix
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
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
github/ubiquitarianism--leonida!2774
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2774"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@lerapeurdu62280-debug on GitHub · 2026-11-30 18:08 UTC · original
lerapeurdu62280-debug:fix/warm-first-run-pipelines-dir→main· +29 −1 · 1 files · 2 commits · openClaimed in the coordination issue as:
RT-WARM-FIRST-RUN-DIR(done line)What and why
On a first start the cache has no
pipelinesfolder yet (the game makes it later).leonida warm --used, run byscripts\play-d3d12.ps1before the game, openswarm-done.txt,slow-pipelines.txtandwarm-bad.txtin that folder and stops with:The play script prints it as a
NativeCommandErrorand 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,mimallocLEONIDA_CACHE_DIR:leonida warm --usedexits 1 with os error 3 onmain(afb511541), and 0 with this change, withwarm-done.txt,warm-bad.txtandslow-pipelines.txtwritten in the newpipelinesfolder.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
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a)Contribution : EI S.O.S INFO LUDO
@KelboLive on GitHub · 2026-11-30 18:14 UTC · original
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 warmrun; 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 on GitHub · 2026-11-30 18:28 UTC · original
Tests run since opening:
cargo test --locked -p leonidaonfc32118f7: 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 on GitHub · 2026-12-01 05:48 UTC · original · reviewed
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 aspipeline/library.rs:658— created withcreate_dir_allbeforeknown::keysand the threeOpenOptionsopens, so a first run now writes its three files (head: exit 0, folder besideshaders) instead of dying atwarm-done.txt(base: exit 1,os error 3). Idempotent for child processes and for an existing folder.Two things to fix:
pipelinesexisting as a file the run exits 1 withCannot create a file when that file already exists. (os error 183)and no path, unlikeConfig::subdir'screating <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.cargo test -p leonida(39 + 2 + 2 here) never toucheswarm, so deleting the line keeps the suite green; your evidence is a manual run. A smallensure_folder(&Path)helper tested with a tempLEONIDA_CACHE_DIRfor 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 on GitHub · 2026-12-01 11:27 UTC · original
Both done in
a554e4c15:ensure_folder, with.with_context(|| format!("creating {}", dir.display()))likeConfig::subdir.warm::tests::ensure_folder_makes_keeps_and_names_the_pathcovers 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 thanLEONIDA_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 --usedon an AMD Radeon RX 6600 (Windows 11):LEONIDA_CACHE_DIRpipelines/withwarm-done.txt,warm-bad.txt,slow-pipelines.txtpipelinesis a fileError: 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
a554e4c155to6d93e12d056d93e12d05to0dea1a13f6@MoonEyes on GitHub · 2026-12-02 12:24 UTC · original
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:mainSHA it was merged onto;mainalone 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 on GitHub · 2026-12-02 15:09 UTC · original
RUN (in game, batch of six render-path pull requests), each head merged with
git merge --no-ffonto mainf45165e15, in one build: #29524df667e42, #2969535c14094, #2877f98e8ccf9, #2965c62d57344, #27740dea1a13f, #28155ac7975c6. 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.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 on GitHub · 2026-12-02 15:17 UTC · original · reviewed
I ran the actual
leonida warm --used --jobs 1entry point on0dea1a13merged ontomain83046a71, using an MSVC-target build under Wine 11.22 and temporary synthetic caches.mainexited 1 withPath not foundon the empty cache. This head createdpipelinesand all three receipt files, and a second invocation preserved a pre-existing receipt. With a file atpipelines, it exited 1, named the obstructing path, and left its contents unchanged.Git reports an overlap in
warm.rswith #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 currentmain. 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 on GitHub · 2026-12-02 15:56 UTC · original
RUN (independent run on Windows, #2774 head
0dea1a13f, merged locally intomainf45165e15withgit 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.rswith the new test kept does not compile:unresolved import super::ensure_folder. Weakened versions of the function fail the test:create_dir_alltocreate_dirfails at the "parents included" step; droppingwith_context("creating ...")fails the last assertion (the error must name the path).Green (whole batch, one tree, Windows 11, debug profile as
d3d12.ymlruns 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.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, andmainf45165e15alone failed the alias_cast test in 2 of 3 runs.Mutations:
create_dir: killed.ensure_folder(&dir)?;inrun(): survives. The test calls the helper directly, so it pins the helper, not thatrunuses it. Moving the call after thethesebranch would bring the bug back for--theseand is equally unpinned (reasoned, not run).Review: no defect.
create_dir_allis idempotent and leaves an existing folder and its files alone (the test checkswarm-done.txtsurvives). A race with the game making the same folder is harmless. The test usestemp_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 (needsLEONIDA_CACHE_DIRand the wholewarmcommand; 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 on GitHub · 2026-12-02 18:03 UTC · original
Code review only, not built (Windows-only
leonidaapp). Ready.0dea1a13f, merge basea917c54d6, 184 behind currentmain45dc41f95. A trial merge is clean.action_required).run()is not").Review of
d3d12/apps/leonida/src/warm.rs:ensure_folder(&dir)?runs right afterfolder(), before both thetheseearly 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, andleonida warmcan run first.create_dir_allkeeps an existing folder untouched. The error names the path throughwith_context.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
@fiestorra on GitHub · 2026-12-03 03:14 UTC · original
VERIFY-2774 — Windows nativo:
ensure_foldery su test pasanUn fichero, 29 líneas, once días abierto:
El cambio: una función de tres líneas —
— 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, nocreate_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 warmen una máquina dondetarget/diag/pipelinesno 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 --librespondeno library targets found—leonidaes un binario, y sus tests son de binario; la forma escargo test -p leonida, sin--lib. Lo tenía en mis notas y aun así lo intenté con--libprimero.@merzleckeier on GitHub · 2026-12-03 03:44 UTC · original · reviewed
Follow-up on the cold-cache run. I combined
0dea1a13with #3284 atf9c58876on currentmain(516c9eaa), using a Windows MSVC build under Wine 11.22. The patches merge cleanly.leonida warm --used --jobs 1command exited 0 and createdpipelineswithwarm-done.txt,warm-bad.txtandslow-pipelines.txt. Removing onlyensure_folder(&dir)?made that command fail with Win32 error 3 again.pipelines, the command failed, named the obstructing path, and preserved the file.warm --used --limit 0counted 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.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.