fix(builder): a shaders-only reason prepares the shaders alone, and a removed copy keys as the same path #2766

Merged
HumanBean merged 1 commit from HumanBean/Longshot:fix/builder-ensure-built-followup into main 2026-11-28 22:20:25 +00:00
Owner

Summary

Follow-up to #2762. Its own tests found three bugs after it merged:

  • A shaders-only rebuild ran a whole update. build-driver/src/play.rs ensure_built never set BuildOptions::shaders_only. When the only reason to rebuild was the shaders, the builder ran a full update. It now sets o.shaders_only = why == RebuildReason::Shaders and prepares the shaders alone. This is one cause of players seeing the game "always compiling".
  • A removed copy was reported as a profile change. In play.rs stable_path, when the .nup is gone, the key fell back to another spelling of the path, with .. kept. A removed copy was therefore reported as a profile change instead of a game change. It now canonicalises the parent folder and joins the file name.
  • A dev command without dev gave the wrong error. In longshot-builder/src/main.rs parse, image --game g --work w without dev failed on the dev-only --work flag before saying it is a developer's command. Developer commands other than build now get that message first.

Read first: ensure_built and stable_path in play.rs.

Testing

Tested: cargo test --locked for the builder workspace passes: all 71 test groups, run in the queue in build mode. A smoke test on Linux with an RTX 3090 (driver 620.70.06):

  • build --profile took 93.9 s. A second build took 0.01 s: fast check: current, with no compile and no shader prep.
  • Two play --profile runs went straight to game_ready with no rebuild and closed cleanly.

These game runs happened while the fixes were being made, so they may predate the last of them.

Still to test:

  • Linux and Windows: play with an up-to-date game, then delete only the prepared-shader receipt and play again. Expect shader preparation alone, with no compile (by hand).
  • Windows: the same no-op second build (by hand).

Measurements

Nothing to measure: these fix what triggers a rebuild, not how fast one runs. The smoke timings are under Testing.

Risks

  • A shaders-only reason now skips the update step. If shaders change, and so does something the fast check misses, the game keeps the old build until the next real reason to rebuild. A revert is enough.
  • After updating, players notice nothing, apart from fewer needless rebuilds.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says. Unticked: the game runs may predate the final fix commit.
  • mise run test passes (any failure that also fails on main is named). Unticked: only the builder's cargo test ran, not the whole mise run test.
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A fix: a game-free test that fails on main and passes here. These are #2762's own cargo test cases.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers").
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.

🤖 Generated with Claude Code

## Summary Follow-up to [#2762](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2762). Its own tests found three bugs after it merged: - **A shaders-only rebuild ran a whole update.** `build-driver/src/play.rs` `ensure_built` never set `BuildOptions::shaders_only`. When the only reason to rebuild was the shaders, the builder ran a full update. It now sets `o.shaders_only = why == RebuildReason::Shaders` and prepares the shaders alone. This is one cause of players seeing the game "always compiling". - **A removed copy was reported as a profile change.** In `play.rs` `stable_path`, when the .nup is gone, the key fell back to another spelling of the path, with `..` kept. A removed copy was therefore reported as a profile change instead of a game change. It now canonicalises the parent folder and joins the file name. - **A dev command without `dev` gave the wrong error.** In `longshot-builder/src/main.rs` `parse`, `image --game g --work w` without `dev` failed on the dev-only `--work` flag before saying it is a developer's command. Developer commands other than `build` now get that message first. Read first: `ensure_built` and `stable_path` in `play.rs`. ## Testing **Tested:** `cargo test --locked` for the builder workspace passes: all 71 test groups, run in the queue in build mode. A smoke test on Linux with an RTX 3090 (driver 620.70.06): - `build --profile` took 93.9 s. A second `build` took 0.01 s: `fast check: current`, with no compile and no shader prep. - Two `play --profile` runs went straight to `game_ready` with no rebuild and closed cleanly. These game runs happened while the fixes were being made, so they may predate the last of them. **Still to test:** - Linux and Windows: `play` with an up-to-date game, then delete only the prepared-shader receipt and `play` again. Expect shader preparation alone, with no compile (by hand). - Windows: the same no-op second `build` (by hand). ## Measurements Nothing to measure: these fix what triggers a rebuild, not how fast one runs. The smoke timings are under Testing. ## Risks - A shaders-only reason now skips the update step. If shaders change, and so does something the fast check misses, the game keeps the old build until the next real reason to rebuild. A revert is enough. - After updating, players notice nothing, apart from fewer needless rebuilds. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [ ] Tested on my own PC, in the game for a change the game runs, as Testing says. Unticked: the game runs may predate the final fix commit. - [ ] `mise run test` passes (any failure that also fails on `main` is named). Unticked: only the builder's `cargo test` ran, not the whole `mise run test`. - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] A fix: a game-free test that fails on `main` and passes here. These are #2762's own `cargo test` cases. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(builder): a shaders-only reason prepares the shaders alone; a removed copy keys as the same path; a dev command without dev says so
Some checks failed
CI / What the change needs (pull_request) Successful in 12s
CI / Third-party parts and guide screenshots (pull_request) Failing after 15s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 27s
PR description / Title and description (pull_request_target) Failing after 7s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 3m23s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Failing after 4m28s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Successful in 5m53s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Successful in 6m4s
CI / Website build and checks (pull_request) Failing after 44s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Failing after 23m7s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Failing after 43m2s
1e92f4a985
ensure_built never set BuildOptions::shaders_only, so RebuildReason::Shaders ran a full update. stable_path keyed a
.nup that is gone by its absolute spelling (with any ..), so its removal read as a profile change, not the game's.
A developer's command without dev (image --game g --work w) stopped on its first dev-only flag before the message
naming dev.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Member

Possibly related, for context:

  • PR #737 feat(vk): one shader cache store for every game folder, so a build whose translation is unchanged prepares nothing — Open shader-cache preparation work in build/runtime paths overlaps this builder change.
Possibly related, for context: - PR #737 feat(vk): one shader cache store for every game folder, so a build whose translation is unchanged prepares nothing — Open shader-cache preparation work in build/runtime paths overlaps this builder change.
HumanBean changed title from WIP: fix(builder): a shaders-only reason prepares the shaders alone, and a removed copy keys as the same path to fix(builder): a shaders-only reason prepares the shaders alone, and a removed copy keys as the same path 2026-11-28 22:20:19 +00:00
HumanBean deleted branch fix/builder-ensure-built-followup 2026-11-28 22:20:26 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 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
MagicBeanDev/Longshot!2766
No description provided.