[pr-fix][startup][shaders] Preload: a host pipeline library the game will not load no longer counts as made (named DARNER_CACHE_DIR, after #192) #270

Open
iBooM72 wants to merge 4 commits from iboom72/fix/preload-when-library-is-another-builds into main AGit
Contributor

Refs #188

What it changes

  • The problem on main: read from the code only (apps/darner/src/play.rs, needs_pipelines, against made_by_another_build in crates/darner-gpu/src/pipeline/library.rs).

Since #192 the game does not load a host pipeline library that another build's translator made: the folder's host-pipelines.translator has to name this build, or the run starts an empty library. The launcher's check for "are there host pipelines?" was not changed with it: needs_pipelines still counts any non-empty host-pipelines.bin as made and never reads the mark.

On the default cache this does no harm: clear_stale_shaders deletes another translator's library before the check, and a new darner.exe gets its first-start preload anyway. In a cache folder the caller named (DARNER_CACHE_DIR) neither happens. Two builds with different translators that share such a folder then go like this: the second build finds the first one's library, no preload is offered, the game refuses that library, and the run makes its host pipelines during play. Its first save replaces the other build's library, so the builds throw each other's library away at every switch, each time without a preload.

The comments already say what is meant: "A named DARNER_CACHE_DIR (benches, tests) preloads only when its pipelines are missing" (play.rs), and preload_needed names a library "of an earlier translator" as a case to preload.

What this does: a library counts as made only when host-pipelines.translator beside it names this build's translator (compared after trim(), like made_by_another_build). With DARNER_LIBRARY_KEEP_OLD=1 any library counts, because the game then loads it. Where the translator id is not known (not Windows), nothing changes.

With DARNER_LIBRARY_DIR set, the library is looked for in that folder, as the game does (library_dir in library.rs); the pipeline book stays in the cache folder (8b34fd77 by andrewpozdnakov7-jpg, after superhero-520's test).

The file name host-pipelines.translator is written out in play.rs, as is_stale_pipeline_entry there already does for host-pipelines.; the rule itself stays in library.rs.

Not in this change: apps/darner/src/warm.rs (library_there, only with DARNER_WARM_SHARED=1) also tests just for the file. That is a separate problem in an opt-in path and overlaps #153.

How it was tested

  • Tested revision: 8b34fd77
  • Commands and results:
    • cargo test -p darner --locked: passed (149 passed, 1 ignored in the app's unit tests, with the extended a_book_without_made_pipelines_is_preloaded and preload_checks_the_shared_library_and_uses_the_local_book; 2 + 2 + 8 in its three test files).
    • cargo clippy -p darner --all-targets --locked -- -D warnings: passed.
  • Changes a default: yes, for a cache folder named with DARNER_CACHE_DIR that holds another build's library: the start now offers the preload there where it started the game at once (library.rs gives 10 minutes for a preload from no library, from #188; not measured here). Two builds that take turns on one named cache get the offer at every switch. DARNER_FIRST_START_PRELOAD=0 and DARNER_LIBRARY_KEEP_OLD=1 both keep the old behaviour. On the default cache the offer is new only where a library has no mark of this build and the exe is past its first start (a mark that could not be written, for one); the game refuses that library there too.
  • A/B result: none. No speed is claimed; how slow a run without the preload is here was not measured (the driver's own cache may still hold the pipelines).
  • Gates run on that revision (the three in AGENTS.md; there is no CI): cargo clippy --workspace --all-targets --locked -- -D warnings and the same with --all-features: both passed. cargo test --workspace --locked was not run as a whole (only -p darner, above; the change is in apps/darner only).
  • Gameplay, when relevant: not run.
  • Hardware dependence: likely general.
  • Coverage gaps: read in library.rs, not run: every write of the library goes through replace_library, which writes the mark in the same folder, so a finished preload is not offered again. Not run in the game with two builds on one named cache; the case is from reading the code, and the test covers needs_pipelines only (no mark, another build's mark, this build's mark). Not covered before or after: a library made for another card.

Checklist

  • I ran this change in the game, or say below why it can't be (docs, tests only).
  • This PR contains one change based on main.
  • The diff follows docs/asset-policy.md.
  • I recorded this PR's dependencies below.
    • Depends on: none

Not run in the game: it needs two builds with different shader translators and a shared named cache, which I do not have set up.

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches.
  • Related PRs: #192 (merged; the game-side rule this follows). #153 (open) changes preload_needed's neighbourhood in play.rs and keeps needs_pipelines as the deciding check; it does not change the check. #140 (open) mentions preload_needed in a comment only. The other open pull requests found that change apps/darner/src/play.rs (#243, #233, #222, #216, #215, #205, #154, #143, #130, #80, #75, #59, #16, #12, #9) do not touch it.
  • Replaces or overlaps: none found

🤖 Generated with Claude Code

Refs #188 ## What it changes - The problem on main: read from the code only (`apps/darner/src/play.rs`, `needs_pipelines`, against `made_by_another_build` in `crates/darner-gpu/src/pipeline/library.rs`). Since #192 the game does not load a host pipeline library that another build's translator made: the folder's `host-pipelines.translator` has to name this build, or the run starts an empty library. The launcher's check for "are there host pipelines?" was not changed with it: `needs_pipelines` still counts any non-empty `host-pipelines.bin` as made and never reads the mark. On the default cache this does no harm: `clear_stale_shaders` deletes another translator's library before the check, and a new darner.exe gets its first-start preload anyway. In a cache folder the caller named (`DARNER_CACHE_DIR`) neither happens. Two builds with different translators that share such a folder then go like this: the second build finds the first one's library, no preload is offered, the game refuses that library, and the run makes its host pipelines during play. Its first save replaces the other build's library, so the builds throw each other's library away at every switch, each time without a preload. The comments already say what is meant: "A named DARNER_CACHE_DIR (benches, tests) preloads only when its pipelines are missing" (`play.rs`), and `preload_needed` names a library "of an earlier translator" as a case to preload. What this does: a library counts as made only when `host-pipelines.translator` beside it names this build's translator (compared after `trim()`, like `made_by_another_build`). With `DARNER_LIBRARY_KEEP_OLD=1` any library counts, because the game then loads it. Where the translator id is not known (not Windows), nothing changes. With `DARNER_LIBRARY_DIR` set, the library is looked for in that folder, as the game does (`library_dir` in `library.rs`); the pipeline book stays in the cache folder (8b34fd77 by andrewpozdnakov7-jpg, after superhero-520's test). The file name `host-pipelines.translator` is written out in `play.rs`, as `is_stale_pipeline_entry` there already does for `host-pipelines.`; the rule itself stays in `library.rs`. Not in this change: `apps/darner/src/warm.rs` (`library_there`, only with `DARNER_WARM_SHARED=1`) also tests just for the file. That is a separate problem in an opt-in path and overlaps #153. ## How it was tested - Tested revision: 8b34fd77 - Commands and results: - `cargo test -p darner --locked`: passed (149 passed, 1 ignored in the app's unit tests, with the extended `a_book_without_made_pipelines_is_preloaded` and `preload_checks_the_shared_library_and_uses_the_local_book`; 2 + 2 + 8 in its three test files). - `cargo clippy -p darner --all-targets --locked -- -D warnings`: passed. - Changes a default: yes, for a cache folder named with `DARNER_CACHE_DIR` that holds another build's library: the start now offers the preload there where it started the game at once (`library.rs` gives 10 minutes for a preload from no library, from #188; not measured here). Two builds that take turns on one named cache get the offer at every switch. `DARNER_FIRST_START_PRELOAD=0` and `DARNER_LIBRARY_KEEP_OLD=1` both keep the old behaviour. On the default cache the offer is new only where a library has no mark of this build and the exe is past its first start (a mark that could not be written, for one); the game refuses that library there too. - A/B result: none. No speed is claimed; how slow a run without the preload is here was not measured (the driver's own cache may still hold the pipelines). - Gates run on that revision (the three in AGENTS.md; there is no CI): `cargo clippy --workspace --all-targets --locked -- -D warnings` and the same with `--all-features`: both passed. `cargo test --workspace --locked` was not run as a whole (only `-p darner`, above; the change is in `apps/darner` only). - Gameplay, when relevant: not run. - Hardware dependence: likely general. - Coverage gaps: read in `library.rs`, not run: every write of the library goes through `replace_library`, which writes the mark in the same folder, so a finished preload is not offered again. Not run in the game with two builds on one named cache; the case is from reading the code, and the test covers `needs_pipelines` only (no mark, another build's mark, this build's mark). Not covered before or after: a library made for another card. ## Checklist - [ ] I ran this change in the game, or say below why it can't be (docs, tests only). - [x] This PR contains one change based on `main`. - [x] The diff follows `docs/asset-policy.md`. - [x] I recorded this PR's dependencies below. - Depends on: none Not run in the game: it needs two builds with different shader translators and a shared named cache, which I do not have set up. ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. - Related PRs: #192 (merged; the game-side rule this follows). #153 (open) changes `preload_needed`'s neighbourhood in `play.rs` and keeps `needs_pipelines` as the deciding check; it does not change the check. #140 (open) mentions `preload_needed` in a comment only. The other open pull requests found that change `apps/darner/src/play.rs` (#243, #233, #222, #216, #215, #205, #154, #143, #130, #80, #75, #59, #16, #12, #9) do not touch it. - Replaces or overlaps: none found 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Since #192 the game starts an empty host pipeline library when the one in the
cache was made by another build's translator (host-pipelines.translator).
needs_pipelines still counted any non-empty host-pipelines.bin as made. On the
default cache clear_stale_shaders deletes such a library first; in a cache
folder the caller named (DARNER_CACHE_DIR) nothing does, so two builds sharing
one got no preload and made their pipelines during play.

A library now counts only beside a mark that names this build's translator;
with DARNER_LIBRARY_KEEP_OLD=1 any library counts, as the game loads it.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
First-time contributor

Tested the launcher preflight and runtime directory selection on Windows using the functions from main f3840d73 and PR 5799f84a. Each of the nine filesystem cases ran in a fresh process so the cached environment setting was read independently.

One case changes on this PR when both cache paths are set. I put the pipeline book and a library with another translator's marker under DARNER_CACHE_DIR/pipelines, then put a library with this translator's marker under a separate DARNER_LIBRARY_DIR. Main returned false from needs_pipelines; the PR returned true. The runtime selected the shared directory and its made_by_another_build check returned false. The preflight therefore classifies host pipelines as missing even though the selected shared library passes the runtime marker check.

With no shared override, the PR did request preload for a missing or foreign marker and skipped it for a matching one. The opposite path mismatch already exists on main: with a matching local marker and a foreign shared marker, both launcher revisions skip preload while the runtime rejects the shared marker.

A regression test could keep the book in the named cache and vary the local and shared markers independently. These were plain file sentinels and the actual marker and path functions. No driver library was opened and no game was run.

Tested the launcher preflight and runtime directory selection on Windows using the functions from main `f3840d73` and PR `5799f84a`. Each of the nine filesystem cases ran in a fresh process so the cached environment setting was read independently. One case changes on this PR when both cache paths are set. I put the pipeline book and a library with another translator's marker under `DARNER_CACHE_DIR/pipelines`, then put a library with this translator's marker under a separate `DARNER_LIBRARY_DIR`. Main returned false from `needs_pipelines`; the PR returned true. The runtime selected the shared directory and its `made_by_another_build` check returned false. The preflight therefore classifies host pipelines as missing even though the selected shared library passes the runtime marker check. With no shared override, the PR did request preload for a missing or foreign marker and skipped it for a matching one. The opposite path mismatch already exists on main: with a matching local marker and a foreign shared marker, both launcher revisions skip preload while the runtime rejects the shared marker. A regression test could keep the book in the named cache and vary the local and shared markers independently. These were plain file sentinels and the actual marker and path functions. No driver library was opened and no game was run.
First-time contributor

Thanks, @superhero-520. I reproduced the mismatch and prepared a follow-up commit on top of this PR. It reuses the launcher’s existing library-folder selection for DARNER_LIBRARY_DIR and keeps the pipeline book in the local cache. The commit can be cherry-picked onto this branch.

A Windows file fixture ran seven scenarios against 5799f84 and the follow-up. The PR missed three cases involving a shared override. The follow-up passed all seven, including an absent or empty override and DARNER_LIBRARY_KEEP_OLD=1. The focused Cargo type check and asset-policy check passed. No game or driver library was loaded.

Thanks, @superhero-520. I reproduced the mismatch and prepared a [follow-up commit](https://git.gtahub.st/andrewpozdnakov7-jpg/Darner/commit/8b34fd77cd09bd77c84ad97528bc979780ac3446) on top of this PR. It reuses the launcher’s existing library-folder selection for DARNER_LIBRARY_DIR and keeps the pipeline book in the local cache. The commit can be cherry-picked onto this branch. A Windows file fixture ran seven scenarios against 5799f84 and the follow-up. The PR missed three cases involving a shared override. The follow-up passed all seven, including an absent or empty override and DARNER_LIBRARY_KEEP_OLD=1. The focused Cargo type check and asset-policy check passed. No game or driver library was loaded.
Author
Contributor

Follow-up to "How it was tested": the description says cargo test --workspace --locked was not run as a whole. It has now been run, together with five other small pull requests of mine, on one local branch.

  • Tested revision: main f3840d73 with these six commits picked on top, no conflicts: 98a3c911 (#265), 5799f84a (#270), c782a6e2 (#283), e69c0f77 (#284), 1c142d36 (#285), 5eae3d19 (#286). Not run on this pull request's branch alone.
  • cargo clippy --workspace --all-targets --locked -- -D warnings: passed.
  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: passed.
  • cargo test --workspace --locked: one test failed, in darner-shader: emit::waterfall_tests::sampled_marks_restore_early_depth_only_when_safe_in_pixel_shaders ("DXIL validation failed ... Not all elements of output SV_Depth were written"). The same test fails the same way on main f3840d73 without these commits, none of the six changes darner-shader, and #227 (open) fixes it. darner-shader's other tests: 557 passed, 16 ignored.
  • Cargo stops at the first package that fails, so the rest was run with cargo test --workspace --locked --no-fail-fast --exclude darner-shader: passed, all packages and the doc tests (darner-gpu: 1,773 passed, 81 ignored).

Still not run in the game.

Follow-up to "How it was tested": the description says `cargo test --workspace --locked` was not run as a whole. It has now been run, together with five other small pull requests of mine, on one local branch. - Tested revision: `main` f3840d73 with these six commits picked on top, no conflicts: 98a3c911 (#265), 5799f84a (#270), c782a6e2 (#283), e69c0f77 (#284), 1c142d36 (#285), 5eae3d19 (#286). Not run on this pull request's branch alone. - `cargo clippy --workspace --all-targets --locked -- -D warnings`: passed. - `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings`: passed. - `cargo test --workspace --locked`: one test failed, in `darner-shader`: `emit::waterfall_tests::sampled_marks_restore_early_depth_only_when_safe_in_pixel_shaders` ("DXIL validation failed ... Not all elements of output SV_Depth were written"). The same test fails the same way on `main` f3840d73 without these commits, none of the six changes `darner-shader`, and #227 (open) fixes it. `darner-shader`'s other tests: 557 passed, 16 ignored. - Cargo stops at the first package that fails, so the rest was run with `cargo test --workspace --locked --no-fail-fast --exclude darner-shader`: passed, all packages and the doc tests (`darner-gpu`: 1,773 passed, 81 ignored). Still not run in the game.
Keep the pipeline book in the local cache and check the host library in the directory selected by DARNER_LIBRARY_DIR. Reuse the directory selection already used by warm.

https://git.gtahub.st/andrewpozdnakov7-jpg
https://github.com/andrewpozdnakov7-jpg
Author
Contributor

Thanks both. superhero-520's case is right: with DARNER_LIBRARY_DIR set, the check looked in the cache folder while the game takes the library from the shared one, and the description was wrong to call that case unchanged.

I read 8b34fd77 and picked it onto this branch as it is. It uses the same rule as library_dir in library.rs (the shared folder when it is set and not empty, else the cache's pipelines folder) and keeps the pipeline book in the cache folder. On 8b34fd77: cargo test -p darner --locked passed (149 passed, 1 ignored), and both workspace clippy gates passed. Not run in the game. The description is updated.

Thanks both. superhero-520's case is right: with `DARNER_LIBRARY_DIR` set, the check looked in the cache folder while the game takes the library from the shared one, and the description was wrong to call that case unchanged. I read 8b34fd77 and picked it onto this branch as it is. It uses the same rule as `library_dir` in `library.rs` (the shared folder when it is set and not empty, else the cache's `pipelines` folder) and keeps the pipeline book in the cache folder. On 8b34fd77: `cargo test -p darner --locked` passed (149 passed, 1 ignored), and both workspace clippy gates passed. Not run in the game. The description is updated.
Author
Contributor

The gates were run again with 8b34fd77 in, since my earlier comment covered the older commit only.

  • Tested revision: main f3840d73 with seven commits picked on top, no conflicts: both commits of this pull request (5799f84a, 8b34fd77) and 98a3c911 (#265), c782a6e2 (#283), e69c0f77 (#284), 1c142d36 (#285), 5eae3d19 (#286). Not run on this pull request's branch alone.
  • cargo clippy --workspace --all-targets --locked -- -D warnings: passed.
  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: passed.
  • cargo test --workspace --locked --no-fail-fast: one test failed, in darner-shader: emit::waterfall_tests::sampled_marks_restore_early_depth_only_when_safe_in_pixel_shaders. It fails the same way on main f3840d73 without these commits, none of them changes darner-shader, and #227 (open) fixes it. Everything else passed: the app's unit tests (150 passed, 1 ignored, with preload_checks_the_shared_library_and_uses_the_local_book), darner-gpu (1,773 passed, 81 ignored), darner-shader's other tests (557 passed, 16 ignored), the other packages and the doc tests.

Still not run in the game.

The gates were run again with 8b34fd77 in, since my earlier comment covered the older commit only. - Tested revision: `main` f3840d73 with seven commits picked on top, no conflicts: both commits of this pull request (5799f84a, 8b34fd77) and 98a3c911 (#265), c782a6e2 (#283), e69c0f77 (#284), 1c142d36 (#285), 5eae3d19 (#286). Not run on this pull request's branch alone. - `cargo clippy --workspace --all-targets --locked -- -D warnings`: passed. - `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings`: passed. - `cargo test --workspace --locked --no-fail-fast`: one test failed, in `darner-shader`: `emit::waterfall_tests::sampled_marks_restore_early_depth_only_when_safe_in_pixel_shaders`. It fails the same way on `main` f3840d73 without these commits, none of them changes `darner-shader`, and #227 (open) fixes it. Everything else passed: the app's unit tests (150 passed, 1 ignored, with `preload_checks_the_shared_library_and_uses_the_local_book`), `darner-gpu` (1,773 passed, 81 ignored), `darner-shader`'s other tests (557 passed, 16 ignored), the other packages and the doc tests. Still not run in the game.
Author
Contributor

Two things from reading 8b34fd77 again, both in needs_pipelines (apps/darner/src/play.rs). Read from the code only, nothing run. Neither is fixed in this pull request.

1. With DARNER_LIBRARY_DIR set, the check walks the whole folder. made_in goes into every folder below the one it is given. Until 8b34fd77 that was the cache's own pipelines folder. Now it is the folder the user named, so a large or networked folder that holds other things is read through at every start, and a marked host-pipelines.bin anywhere below it counts as made. The game looks in two places only: adapters/<card> and the folder itself (load_cache in library.rs). Looking in the folder and one level below adapters would match that.

2. A library made for another card counts as made. This was so before this pull request, and the description lists it under coverage gaps. made_in takes a marked library in any adapters/<card> folder, while the game reads this card's folder first. On a PC with two cards, or with a named cache copied from another PC, no preload is offered and the pipelines are made during play. Narrowing the walk as in 1 does not fix it: the launcher does not know this card's folder name.

If the maintainer wants 1 in this pull request, I can add it; otherwise it can follow separately.

Two things from reading 8b34fd77 again, both in `needs_pipelines` (`apps/darner/src/play.rs`). Read from the code only, nothing run. Neither is fixed in this pull request. **1. With `DARNER_LIBRARY_DIR` set, the check walks the whole folder.** `made_in` goes into every folder below the one it is given. Until 8b34fd77 that was the cache's own `pipelines` folder. Now it is the folder the user named, so a large or networked folder that holds other things is read through at every start, and a marked `host-pipelines.bin` anywhere below it counts as made. The game looks in two places only: `adapters/<card>` and the folder itself (`load_cache` in `library.rs`). Looking in the folder and one level below `adapters` would match that. **2. A library made for another card counts as made.** This was so before this pull request, and the description lists it under coverage gaps. `made_in` takes a marked library in any `adapters/<card>` folder, while the game reads this card's folder first. On a PC with two cards, or with a named cache copied from another PC, no preload is offered and the pipelines are made during play. Narrowing the walk as in 1 does not fix it: the launcher does not know this card's folder name. If the maintainer wants 1 in this pull request, I can add it; otherwise it can follow separately.
First-time contributor

4932c5a follows your first suggestion if the maintainer wants it in this PR. The launcher checks the library root and direct directories under adapters, using the runtime's two filenames, host-pipelines.bin and host-pipelines.next. The existing translator check still applies. Matching the library to the selected adapter remains a separate decision.

The same ten fixture cases exercise both revisions. Three cases with backups or unrelated subdirectories now offer preload, and two cases with a valid pending library now recognize it. Five controls for the book, primary libraries and translator mismatch behaved as before. Focused app type check, the asset policy and the diff check passed.

If you cherry-pick or rebase this commit, please keep the Git author. If you fold it into your own commit, please add this trailer.

Co-authored-by: andrewpozdnakov7-jpg <[email protected]>

[4932c5a](https://git.gtahub.st/andrewpozdnakov7-jpg/Darner/commit/4932c5ae7e8a2f057fa1223d160cd85bc6c34ec0) follows your first suggestion if the maintainer wants it in this PR. The launcher checks the library root and direct directories under `adapters`, using the runtime's two filenames, `host-pipelines.bin` and `host-pipelines.next`. The existing translator check still applies. Matching the library to the selected adapter remains a separate decision. The same ten fixture cases exercise both revisions. Three cases with backups or unrelated subdirectories now offer preload, and two cases with a valid pending library now recognize it. Five controls for the book, primary libraries and translator mismatch behaved as before. Focused app type check, the asset policy and the diff check passed. If you cherry-pick or rebase this commit, please keep the Git author. If you fold it into your own commit, please add this trailer. `Co-authored-by: andrewpozdnakov7-jpg <296776509+[email protected]>`
Contributor

With the pipeline book present, no adapter-specific library, and a matching legacy-root marker, both #270’s current head 8b34fd77 and andrewpozdnakov7-jpg’s proposed follow-up 4932c5a skip preload when host-pipelines.bin has data and host-pipelines.next is empty. The runtime at f3840d73 selects the empty .next and starts with an empty host pipeline library.

With #275 at 1bc75a3, the runtime falls back to .bin, so skipping preload is correct for this layout. If #270 lands before #275, please have the launcher offer preload in this case until the runtime fallback lands.

With the pipeline book present, no adapter-specific library, and a matching legacy-root marker, both #270’s current head `8b34fd77` and andrewpozdnakov7-jpg’s proposed follow-up `4932c5a` skip preload when `host-pipelines.bin` has data and `host-pipelines.next` is empty. The runtime at `f3840d73` selects the empty `.next` and starts with an empty host pipeline library. With #275 at `1bc75a3`, the runtime falls back to `.bin`, so skipping preload is correct for this layout. If #270 lands before #275, please have the launcher offer preload in this case until the runtime fallback lands.
needs_pipelines went into every folder below the one it was given. Since
8b34fd77 that is the folder named with DARNER_LIBRARY_DIR, so a large folder
that holds other things was read through at every start, and a marked library
anywhere below it counted as made. The game reads a library from a card's
folder under adapters, or from the folder itself (load_cache in library.rs):
the check now looks in those two places only.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Author
Contributor

Pushed 98934a72 for point 1 of my comment above (#270 (comment)).

needs_pipelines now looks for a library in two places only, the ones the game reads (load_cache in library.rs): each card's folder under adapters, and the folder itself. It no longer goes into everything below the folder named with DARNER_LIBRARY_DIR. Point 2 (a library made for another card counts as made) is unchanged.

How it was tested

  • The commit is 8b34fd77 plus this one change in apps/darner/src/play.rs. It was built and tested on a local branch that also holds #265's two commits (98a3c911, 9d3ede12), not on this branch alone. The patch is the same on both.
  • cargo test -p darner --locked: passed (150 passed, 1 ignored in the app's unit tests; 2 + 2 + 8 in its three test files). preload_checks_the_shared_library_and_uses_the_local_book has a new case: a marked library deeper in the shared folder does not count.
  • cargo clippy --workspace --all-targets --locked -- -D warnings and the same with --all-features: both passed.
  • cargo test --workspace --locked was not run again (only -p darner; the change is in apps/darner only).
  • Not run in the game. On my PC the library is in pipelines\adapters\hardware-<card>, which is one of the two places.

The description above still names 8b34fd77 as the tested revision.

Pushed 98934a72 for point 1 of my comment above (https://git.gtahub.st/TrustNo1/Darner/pulls/270#issuecomment-868563). `needs_pipelines` now looks for a library in two places only, the ones the game reads (`load_cache` in `library.rs`): each card's folder under `adapters`, and the folder itself. It no longer goes into everything below the folder named with `DARNER_LIBRARY_DIR`. Point 2 (a library made for another card counts as made) is unchanged. **How it was tested** - The commit is 8b34fd77 plus this one change in `apps/darner/src/play.rs`. It was built and tested on a local branch that also holds #265's two commits (98a3c911, 9d3ede12), not on this branch alone. The patch is the same on both. - `cargo test -p darner --locked`: passed (150 passed, 1 ignored in the app's unit tests; 2 + 2 + 8 in its three test files). `preload_checks_the_shared_library_and_uses_the_local_book` has a new case: a marked library deeper in the shared folder does not count. - `cargo clippy --workspace --all-targets --locked -- -D warnings` and the same with `--all-features`: both passed. - `cargo test --workspace --locked` was not run again (only `-p darner`; the change is in `apps/darner` only). - Not run in the game. On my PC the library is in `pipelines\adapters\hardware-<card>`, which is one of the two places. The description above still names 8b34fd77 as the tested revision.
First-time contributor

Thanks for finding the empty pending case. I agree with merging #275 first. With an empty .next beside a usable .bin, skipping preload is correct only once the runtime can fall back to the primary.

I checked the latest 98934a72. The search now stays in the right directories. It still counts a matching host-pipelines.bin.bak and misses a non-empty host-pipelines.next. 7d33640 checks the two exact runtime names in those same directories. On the same Windows fixture, a backup alone now offers preload, a valid pending file alone skips it, and five controls kept their launcher result. Scoped app type-check, asset policy and diff check passed. The follow-up merges cleanly with #275 at 1bc75a3. No game run was needed for these filename checks.

If you cherry-pick or rebase this commit, please keep the Git author. If you fold it into another commit, please add this trailer.

Co-authored-by: andrewpozdnakov7-jpg <[email protected]>

Thanks for finding the empty pending case. I agree with merging #275 first. With an empty `.next` beside a usable `.bin`, skipping preload is correct only once the runtime can fall back to the primary. I checked the latest `98934a72`. The search now stays in the right directories. It still counts a matching `host-pipelines.bin.bak` and misses a non-empty `host-pipelines.next`. [7d33640](https://git.gtahub.st/andrewpozdnakov7-jpg/Darner/commit/7d336405adc97082d16c49020692c9a3ef78e692) checks the two exact runtime names in those same directories. On the same Windows fixture, a backup alone now offers preload, a valid pending file alone skips it, and five controls kept their launcher result. Scoped app type-check, asset policy and diff check passed. The follow-up merges cleanly with #275 at `1bc75a3`. No game run was needed for these filename checks. If you cherry-pick or rebase this commit, please keep the Git author. If you fold it into another commit, please add this trailer. `Co-authored-by: andrewpozdnakov7-jpg <296776509+[email protected]>`
Author
Contributor

Picked 7d33640 onto this pull request as it is, with its author unchanged. Thanks, @andrewpozdnakov7-jpg.

needs_pipelines now checks the two exact names the game reads, host-pipelines.bin and host-pipelines.next, in the same two places as 98934a72. A host-pipelines.bin.bak alone no longer counts as a made library, and a host-pipelines.next with data alone now does. Both cases behaved the same on main.

I had not read your comment with 4932c5a (16:54 UTC) when I pushed 98934a72 at 18:29. The two make the same change to where the check looks.

How it was tested

  • The pushed commit is 7d33640 itself, on 98934a72. It was built and tested as a pick (same patch) on a local branch that also holds #265's two commits (98a3c911, 9d3ede12), not on this branch alone.
  • cargo test -p darner --locked: passed (150 passed, 1 ignored in the app's unit tests; 2 + 2 + 8 in its three test files). preload_checks_the_shared_library_and_uses_the_local_book holds the new cases.
  • cargo clippy --workspace --all-targets --locked -- -D warnings and the same with --all-features: both passed.
  • cargo test --workspace --locked was not run again (the change is in apps/darner only).
  • Not run in the game.

The empty host-pipelines.next case (@UncommonDLL)

Read from the code, not run: on main the launcher already skips the preload when host-pipelines.bin has data, whatever host-pipelines.next holds. This pull request does not add that case or change it. I have not added a launcher fallback here; #275 fixes it where the game reads the files. The merge order is the maintainer's decision.

The description above still names 8b34fd77 as the tested revision.

Picked 7d33640 onto this pull request as it is, with its author unchanged. Thanks, @andrewpozdnakov7-jpg. `needs_pipelines` now checks the two exact names the game reads, `host-pipelines.bin` and `host-pipelines.next`, in the same two places as 98934a72. A `host-pipelines.bin.bak` alone no longer counts as a made library, and a `host-pipelines.next` with data alone now does. Both cases behaved the same on `main`. I had not read your comment with 4932c5a (16:54 UTC) when I pushed 98934a72 at 18:29. The two make the same change to where the check looks. **How it was tested** - The pushed commit is 7d33640 itself, on 98934a72. It was built and tested as a pick (same patch) on a local branch that also holds #265's two commits (98a3c911, 9d3ede12), not on this branch alone. - `cargo test -p darner --locked`: passed (150 passed, 1 ignored in the app's unit tests; 2 + 2 + 8 in its three test files). `preload_checks_the_shared_library_and_uses_the_local_book` holds the new cases. - `cargo clippy --workspace --all-targets --locked -- -D warnings` and the same with `--all-features`: both passed. - `cargo test --workspace --locked` was not run again (the change is in `apps/darner` only). - Not run in the game. **The empty `host-pipelines.next` case** (@UncommonDLL) Read from the code, not run: on `main` the launcher already skips the preload when `host-pipelines.bin` has data, whatever `host-pipelines.next` holds. This pull request does not add that case or change it. I have not added a launcher fallback here; #275 fixes it where the game reads the files. The merge order is the maintainer's decision. The description above still names 8b34fd77 as the tested revision.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/270/head:iboom72/fix/preload-when-library-is-another-builds'
git switch 'iboom72/fix/preload-when-library-is-another-builds'

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 'iboom72/fix/preload-when-library-is-another-builds'
git switch 'iboom72/fix/preload-when-library-is-another-builds'
git rebase 'main'
git switch 'main'
git merge --ff-only 'iboom72/fix/preload-when-library-is-another-builds'
git switch 'iboom72/fix/preload-when-library-is-another-builds'
git rebase 'main'
git switch 'main'
git merge --no-ff 'iboom72/fix/preload-when-library-is-another-builds'
git switch 'main'
git merge --squash 'iboom72/fix/preload-when-library-is-another-builds'
git switch 'main'
git merge --ff-only 'iboom72/fix/preload-when-library-is-another-builds'
git switch 'main'
git merge 'iboom72/fix/preload-when-library-is-another-builds'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
4 participants
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
TrustNo1/Darner!270
No description provided.