[PR #4254] [Other] setup: an interrupted engine update is tried again instead of skipped for good (#2159) #4973

Open
opened 2026-11-07 16:31:43 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/4254
Author: @ByteJuggler
Created: 10/26/2026
Status: 🔄 Open

Base: main ← Head: pr/engine-update-resume


📝 Commits (1)

  • 729baff fix(setup): an interrupted engine update is tried again instead of skipped for good (#2159)

📊 Changes

2 files changed (+26 additions, -0 deletions)

View changed files

📝 setup.py (+7 -0)
📝 tools/test_setup_stale_stamp.py (+19 -0)

📄 Description

Problem and result

Fixes #2159. Replaces #2161, which was closed in the 0.2.0-beta tracker reset; its branch was rebased on current main, so GitHub cannot reopen it.

get_prebuilt moves BUILD.json to BUILD.json.prev before it downloads, and only puts it back when the process lives long enough to do so. After a crash, a reboot or a closed window during an engine update, engine/ keeps the old strata.exe but has no BUILD.json. From then on update_installed_engine returns early on the missing BUILD.json, without a message, so UPDATE.bat / START-HERE.bat never update that engine again.

With this change, when BUILD.json is missing but BUILD.json.prev and the exe are there, the stamp is put back, setup warns "an earlier engine update did not finish: trying it again", and the update runs again.

#2159 (the bug report). Focused fix, no change to defaults.

Approach

The repair runs at the start of update_installed_engine, before the existing early return, and only when all three conditions hold (no BUILD.json, a BUILD.json.prev, the exe). In every other case setup behaves exactly as before. Setup-only change (setup.py and one test); no engine code.

Validation

Passed:

  • python tools/test_setup_stale_stamp.py on 830c6693 (rebased on main 5e8a4cca, 0.2.7), Windows 11, Python 3.12: OK. The new test test_an_interrupted_update_is_tried_again fails on main 5e8a4cca without the change (FAILED, failures=1) and passes with it.
  • All 54 tools/test_setup_*.py on 830c6693 and on main 5e8a4cca: the same result for every file on both (no new failures).

Failed:

  • tools/test_setup_download.py (2 failures), tools/test_setup_unsloth.py (4 failures) and tools/test_setup_download_length.py (no summary line) fail the same way on main 5e8a4cca without this change.

Not run:

  • A real interrupted engine download on 0.2.7. The original case (an update cut off part way through, then a silent skip on every later UPDATE.bat) was seen on an RX 6900 XT / Windows 11 install before the tracker reset; on 0.2.7 only the tests above were run.
  • CUDA, HIP, SYCL and Metal builds: no engine code changed.

Limits

This only repairs the state the interrupted update leaves behind. It does not make the download itself resumable.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/4254 **Author:** [@ByteJuggler](https://github.com/ByteJuggler) **Created:** 10/26/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `pr/engine-update-resume` --- ### 📝 Commits (1) - [`729baff`](https://github.com/Niko1221/Strata/commit/729baffd491cf2dc9cffd7ab92f301f5f4e4c058) fix(setup): an interrupted engine update is tried again instead of skipped for good (#2159) ### 📊 Changes **2 files changed** (+26 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `setup.py` (+7 -0) 📝 `tools/test_setup_stale_stamp.py` (+19 -0) </details> ### 📄 Description ## Problem and result Fixes #2159. Replaces #2161, which was closed in the 0.2.0-beta tracker reset; its branch was rebased on current `main`, so GitHub cannot reopen it. `get_prebuilt` moves `BUILD.json` to `BUILD.json.prev` before it downloads, and only puts it back when the process lives long enough to do so. After a crash, a reboot or a closed window during an engine update, `engine/` keeps the old `strata.exe` but has no `BUILD.json`. From then on `update_installed_engine` returns early on the missing `BUILD.json`, without a message, so `UPDATE.bat` / `START-HERE.bat` never update that engine again. With this change, when `BUILD.json` is missing but `BUILD.json.prev` and the exe are there, the stamp is put back, setup warns "an earlier engine update did not finish: trying it again", and the update runs again. ## Related discussion #2159 (the bug report). Focused fix, no change to defaults. ## Approach The repair runs at the start of `update_installed_engine`, before the existing early return, and only when all three conditions hold (no `BUILD.json`, a `BUILD.json.prev`, the exe). In every other case setup behaves exactly as before. Setup-only change (`setup.py` and one test); no engine code. ## Validation **Passed:** - `python tools/test_setup_stale_stamp.py` on 830c6693 (rebased on `main` 5e8a4cca, 0.2.7), Windows 11, Python 3.12: OK. The new test `test_an_interrupted_update_is_tried_again` fails on `main` 5e8a4cca without the change (FAILED, failures=1) and passes with it. - All 54 `tools/test_setup_*.py` on 830c6693 and on `main` 5e8a4cca: the same result for every file on both (no new failures). **Failed:** - `tools/test_setup_download.py` (2 failures), `tools/test_setup_unsloth.py` (4 failures) and `tools/test_setup_download_length.py` (no summary line) fail the same way on `main` 5e8a4cca without this change. **Not run:** - A real interrupted engine download on 0.2.7. The original case (an update cut off part way through, then a silent skip on every later `UPDATE.bat`) was seen on an RX 6900 XT / Windows 11 install before the tracker reset; on 0.2.7 only the tests above were run. - CUDA, HIP, SYCL and Metal builds: no engine code changed. ## Limits This only repairs the state the interrupted update leaves behind. It does not make the download itself resumable. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
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
Niko1221/Strata#4973
No description provided.