Files
Strata/strata_cli
Niko1221 888c0db159 update: no model test load when memory is short; an unproven engine falls back by itself (#5400)
An engine update loaded the model "for testing" while other programs held
the memory, and the PC ran out of memory (RTX 5080 16 GB, 64 GB RAM).

- The test start reads the memory free now against what its test load
  needs, from the run config's own plan: the expert arena in the normal mode
  (setup's arena_gb), N GiB under --resident-budget-gib, nothing under
  --mmap-experts / --resident-experts, the PLE table only when it stays in
  RAM, plus the engine's own 5.3 GB and 4 GB headroom. Not enough: the model
  is not loaded, the engine gets the check an install without a model gets
  (it runs and answers --version), the update goes on and says: "Only <X> GB
  of memory is free right now and <model> needs about <Y> GB, so the new
  engine was checked without loading the model. It loads your model the next
  time it starts." Unknown memory: the full test as before.
- Such an engine is "unproven" (state.json engine.unproven). A start that
  reaches ready proves it. If its first real start fails because of the
  engine (not a refusal: no memory for the model, a busy port), runtime.start
  switches back to engine.previous by itself, once, and starts again within
  the same wait; the result carries engine_fallback and the line "The new
  engine <new> could not start your model, so Strata went back to engine
  <old>. Your settings are unchanged; the update will be offered again."
  (strata launch shows it; the app's `strata runtime start --output json`
  gets it). That version is held back (failed-before, `strata update --force`
  to use it again; then unproven again); with memory still short its next
  offer waits with the reason. An engine the person chose is never unproven.
- The light test arguments read the PLE table from the file (--ple-io
  direct, STRATA_PLE_AUTO_RAM=0 for the engine's own residency choice).

Measured on l620 (IQ3_S, released 0.2.14 engine, the test's light args):
before, engine peak 84.4 GB (the PLE table 28.8 GB locked in RAM); now the
normal mode peaks at 55.7 GB with system memory in use +53.8 GB, estimate
59.6 GB; with setup's own flags for a 46 GiB / 12 GB-card PC (--mmap-experts)
and 12 GB of the card usable, in use +5.7 GB, estimate 9.3 GB.

packaging/UPDATES.md says it. Tests: tests/terminal/test_update_low_memory.py
(enough / short / unknown memory, no model, the fallback once and no loop,
ready proves, a chosen engine, refusals, the second start inside the first
wait, the app's runtime start JSON, the estimate and the light args).
2026-11-16 18:34:22 +01:00
..