[PR #4782] [CLOSED] [Engine] the picture reader follows an engine update when the old folder is still there (Fix #4658) #5177

Closed
opened 2026-11-07 16:33:16 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/4782
Author: @XiaoBinGan
Created: 10/31/2026
Status: ❌ Closed

Base: main ← Head: fix/vision-reader-follows-update


📝 Commits (1)

  • ecbb1a0 Fix #4658: the picture reader follows an engine update when the old folder is still there

📊 Changes

2 files changed (+73 additions, -15 deletions)

View changed files

📝 serve/server.py (+30 -15)
📝 serve/test_server.py (+43 -0)

📄 Description

Problem and result

After strata update moved the engine from 0.1.52 to 0.1.54, the model kept launching the old picture reader,
components/engine/0.1.52-.../strata-vision.exe, with no warning (#4658). The run config names the engine as a
component but the picture reader as an absolute path into one engine folder, and with_current_reader() only replaced
that path when it was gone — which it is not, because an update keeps the old engine folder.

After the change the reader follows the engine, the way strata.exe does:

[strata] the picture reader C:\...\components\engine\0.1.52-windows-x86_64-cuda-cuda13\strata-vision.exe
belongs to an engine that is no longer the one in use; using C:\...\components\engine\0.1.54-windows-x86_64-cuda-cuda13\strata-vision.exe
from the engine package in use

#4658 — the report, with the run config excerpt and the cause. No separate scope agreement was asked for: this is a bug
in the existing "use the reader of the package in use" path, not a new feature.

Approach

with_current_reader(cfg, package) had one condition — not os.path.exists(old). It now also remaps when the path sits
in another engine package folder:

def _in_another_engine_package(path: str, package: Path) -> bool:
    if "components" not in [part.lower() for part in Path(path).parent.parts] or \
            "engine" not in [part.lower() for part in Path(path).parent.parts]:
        return False
    try:
        return Path(path).parent != package
    except (OSError, ValueError):
        return False
  • Only the components/engine/<version>/ layout counts. A reader the person put somewhere else (the Q8_0 encoder
    docs describe pointing at one) is left untouched, so no custom setup is rewritten.
  • The current package's own reader is left alone; nothing changes when nothing is stale.
  • The missing-path case keeps its old message and behaviour.
  • cpu_exe goes through the same loop, so it follows too.

Validation

Passed: python -m pytest serve/test_server.py -q on this checkout (Python 3.11.16, Windows): 358 passed, 3
skipped, 516 subtests passed
. The four new cases in CurrentReader pass: a reader in an old engine package is
replaced even though it still exists; a missing reader is still replaced; a reader outside components/engine/ is left
alone (same object returned); the current package's reader is left alone.

Passed: the A/B — with serve/server.py reverted to main, the new case fails with
AssertionError (serve/test_server.py:6308), so the tests pin the change rather than passing by themselves.

Failed: none.

Not run: a real strata update across two engine versions on this machine. The report's evidence is the run config
it quotes; the change is the path decision it describes, and the tests drive that decision with real directories. I did
not reproduce the full update flow.

Limits

  • The remap is by file name inside the current package (strata-vision, or strata-vision-hip from cpu_exe). If a
    future engine package ships the reader under a different name, the remap finds no file and leaves the old path, as
    today.
  • Only exe and cpu_exe are considered, the two keys the run config carries for the reader.
  • strata update itself still does not rewrite run configs; this fixes the read side, which is where every start goes
    through. A config left stale on disk is corrected in memory each time, not written back.

🔄 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/4782 **Author:** [@XiaoBinGan](https://github.com/XiaoBinGan) **Created:** 10/31/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/vision-reader-follows-update` --- ### 📝 Commits (1) - [`ecbb1a0`](https://github.com/Niko1221/Strata/commit/ecbb1a0113851bd0affba89fc6079662927f6da4) Fix #4658: the picture reader follows an engine update when the old folder is still there ### 📊 Changes **2 files changed** (+73 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `serve/server.py` (+30 -15) 📝 `serve/test_server.py` (+43 -0) </details> ### 📄 Description ## Problem and result After `strata update` moved the engine from 0.1.52 to 0.1.54, the model kept launching the **old** picture reader, `components/engine/0.1.52-.../strata-vision.exe`, with no warning (#4658). The run config names the engine as a component but the picture reader as an absolute path into one engine folder, and `with_current_reader()` only replaced that path when it was **gone** — which it is not, because an update keeps the old engine folder. After the change the reader follows the engine, the way `strata.exe` does: ```text [strata] the picture reader C:\...\components\engine\0.1.52-windows-x86_64-cuda-cuda13\strata-vision.exe belongs to an engine that is no longer the one in use; using C:\...\components\engine\0.1.54-windows-x86_64-cuda-cuda13\strata-vision.exe from the engine package in use ``` ## Related discussion #4658 — the report, with the run config excerpt and the cause. No separate scope agreement was asked for: this is a bug in the existing "use the reader of the package in use" path, not a new feature. ## Approach `with_current_reader(cfg, package)` had one condition — `not os.path.exists(old)`. It now also remaps when the path sits in **another** engine package folder: ```python def _in_another_engine_package(path: str, package: Path) -> bool: if "components" not in [part.lower() for part in Path(path).parent.parts] or \ "engine" not in [part.lower() for part in Path(path).parent.parts]: return False try: return Path(path).parent != package except (OSError, ValueError): return False ``` - Only the `components/engine/<version>/` layout counts. A reader the person put somewhere else (the Q8_0 encoder docs describe pointing at one) is left untouched, so no custom setup is rewritten. - The current package's own reader is left alone; nothing changes when nothing is stale. - The missing-path case keeps its old message and behaviour. - `cpu_exe` goes through the same loop, so it follows too. ## Validation **Passed:** `python -m pytest serve/test_server.py -q` on this checkout (Python 3.11.16, Windows): **358 passed, 3 skipped, 516 subtests passed**. The four new cases in `CurrentReader` pass: a reader in an old engine package is replaced even though it still exists; a missing reader is still replaced; a reader outside `components/engine/` is left alone (same object returned); the current package's reader is left alone. **Passed:** the A/B — with `serve/server.py` reverted to `main`, the new case fails with `AssertionError` (`serve/test_server.py:6308`), so the tests pin the change rather than passing by themselves. **Failed:** none. **Not run:** a real `strata update` across two engine versions on this machine. The report's evidence is the run config it quotes; the change is the path decision it describes, and the tests drive that decision with real directories. I did not reproduce the full update flow. ## Limits - The remap is by file name inside the current package (`strata-vision`, or `strata-vision-hip` from `cpu_exe`). If a future engine package ships the reader under a different name, the remap finds no file and leaves the old path, as today. - Only `exe` and `cpu_exe` are considered, the two keys the run config carries for the reader. - `strata update` itself still does not rewrite run configs; this fixes the read side, which is where every start goes through. A config left stale on disk is corrected in memory each time, not written back. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 16:33:16 +07:00
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#5177
No description provided.