Skip to content

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

Open
XiaoBinGan wants to merge 1 commit into
Niko1221:mainfrom
XiaoBinGan:fix/vision-reader-follows-update
Open

XiaoBinGan wants to merge 1 commit into
Niko1221:mainfrom
XiaoBinGan:fix/vision-reader-follows-update

Conversation

@XiaoBinGan

Copy link
Copy Markdown
Contributor

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

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:

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.

@XiaoBinGan
XiaoBinGan force-pushed the fix/vision-reader-follows-update branch from 4f92a44 to 29cde2f Compare October 31, 2026 05:07
…he old folder is still there

with_current_reader() replaced a run config's vision.exe only when the absolute path was gone. `strata update`
keeps the old engine folder, so the old reader still existed and the server kept starting it: the picture
reader never followed the engine to 0.1.54, with nothing warning about it.

A reader that sits in another engine package folder is now replaced as well, and the same holds for cpu_exe. A
reader outside components/engine/ is the person's own file and is left exactly as it is, and the missing-path
case behaves as before.
@XiaoBinGan
XiaoBinGan force-pushed the fix/vision-reader-follows-update branch from 29cde2f to ecbb1a0 Compare October 31, 2026 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant