fix(builder): estimate warm rebuilds from actual work #2687

Merged
HumanBean merged 5 commits from HumanBean/Longshot:fix/builder-warm-eta into main 2026-11-27 20:08:23 +00:00
Owner

Summary

An incremental rebuild can finish in seconds while its ETA still includes several minutes for shaders that the builder will reuse. The overall percentage also used forecasted time for stages that had already finished much faster.

The builder checks the existing shader cache when it plans a rebuild and verifies the cache again after installing the rebuilt files. It calculates overall progress from elapsed time and the remaining forecast. It starts sending a numeric ETA after at least ten seconds and enough evidence for the active stage. The existing JSON Lines format keeps its numeric seconds field, with zero indicating that timing is unavailable.

Testing

Tested: On CachyOS, the game-free build-core and build-driver suites, shared shader preparation integration test, and CLI plan test passed. The regression fixtures failed before the fixes and now cover warm and cold cache plans, estimated progress, and ETA readiness. An isolated real build reported a warm cache and emitted its ETA during compile.

Still to test:

  • Run a complete warm rebuild through game startup on Linux and Windows by hand. The local workstation interrupted the headless build-and-launch checks during compilation.
  • Verify the ETA during a complete cold shader preparation on the launcher screen by hand.

Measurements

In the reported run, a six-minute estimate appeared during a rebuild that completed in 18.9 seconds and reused its shaders. The game-free regression covers the missing cache budget and verifies that it returns when the renderer changes. The timing changes do not change the amount of build work.

Risks

A shader cache that looks reusable at plan time can be invalidated by the rebuilt renderer. The shader stage checks the installed files and restores its forecast when preparation is required.

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.
  • mise run test passes (any failure that also fails on main is named).
  • 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.
  • Docs updated.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Approved in review, every comment answered.
  • CI passes on the head.
## Summary An incremental rebuild can finish in seconds while its ETA still includes several minutes for shaders that the builder will reuse. The overall percentage also used forecasted time for stages that had already finished much faster. The builder checks the existing shader cache when it plans a rebuild and verifies the cache again after installing the rebuilt files. It calculates overall progress from elapsed time and the remaining forecast. It starts sending a numeric ETA after at least ten seconds and enough evidence for the active stage. The existing JSON Lines format keeps its numeric `seconds` field, with zero indicating that timing is unavailable. ## Testing **Tested:** On CachyOS, the game-free build-core and build-driver suites, shared shader preparation integration test, and CLI plan test passed. The regression fixtures failed before the fixes and now cover warm and cold cache plans, estimated progress, and ETA readiness. An isolated real build reported a warm cache and emitted its ETA during compile. **Still to test:** - Run a complete warm rebuild through game startup on Linux and Windows by hand. The local workstation interrupted the headless build-and-launch checks during compilation. - Verify the ETA during a complete cold shader preparation on the launcher screen by hand. ## Measurements In the reported run, a six-minute estimate appeared during a rebuild that completed in 18.9 seconds and reused its shaders. The game-free regression covers the missing cache budget and verifies that it returns when the renderer changes. The timing changes do not change the amount of build work. ## Risks A shader cache that looks reusable at plan time can be invalidated by the rebuilt renderer. The shader stage checks the installed files and restores its forecast when preparation is required. ## 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. - [ ] `mise run test` passes (any failure that also fails on `main` is named). - [ ] 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. - [x] Docs updated. - [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. - [ ] Approved in review, every comment answered. - [ ] CI passes on the head.
fix(builder): publish the ETA only after it has evidence
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
CI / What the change needs (pull_request) Successful in 8s
CI / Third-party parts and guide screenshots (pull_request) Failing after 12s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 1m12s
PR description / Title and description (pull_request_target) Failing after 10s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 2m13s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Failing after 3m58s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Successful in 2m31s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Successful in 3m25s
CI / Website build and checks (pull_request) Successful in 3m27s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Failing after 12m42s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Failing after 26m3s
3ed9aed1ef
Assisted-by: OpenAI Codex
HumanBean changed title from WIP: fix(builder): estimate warm rebuilds from actual work to fix(builder): estimate warm rebuilds from actual work 2026-11-27 20:08:13 +00:00
HumanBean deleted branch fix/builder-warm-eta 2026-11-27 20:08:23 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
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
MagicBeanDev/Longshot!2687
No description provided.