mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-05 15:58:53 +00:00
On Windows the engine compares what a run plans to allocate on the host with the commit that is left (RAM plus page file) and, when it will not fit, writes one warning
line to its log ("strata serve: WARNING the Windows commit limit is 92.8 GiB ... 0.8 GiB of it is left, but this run plans 2.0 GiB ... it can end at the limit with no
message (exit code 0xC0000409, #1607) while RAM is still free"). The page's own plan said "ram: fits", so nobody was told. The engine has no structured field for the
warning (0.2.17: give it one), so serve/commit_limit.py reads the line from this start's log and engine.info["commit_warning"] = {limit_gib, left_gib, planned_gib,
floor_gib} carries the numbers in /metrics `engine` like the other INFO facts (cleared at each start). The loaded model's card on the Models page shows, with a warning sign:
"Windows is close to its memory limit (memory plus page file). Strata may stop without a message. Make the Windows page file larger, or choose a shorter context." and under
it "{0} GB of {1} GB are left." (two strings, guic47 and guic48 in ten languages through make-guic-locales.py, English approved by the coordinator). No host change: the
instance's metrics reach the page as they are. Not done: a warning before Load from the Windows fit check (it needs the planned-allocation arithmetic in Control; 0.2.17).
Tests: serve/test_commit_limit.py (7: the pattern pinned to the engine's exact text, both the Strix start's line from par/soak1117/evidence/engine-log-1304.txt and the engine's
format string in host_limits.hpp, last warning wins, no line no fact, and a real fake-engine process whose log carries the line: engine.info has the numbers, a start without it has
none); apps/host/tests/commit-warning.test.mjs (3). Linux host suite 1935 passed / 0 failed; py-serve 1874 passed / 0 failed and docs on p1004; live: throw-away host with the page's
native state answered with a ready model whose metrics carry commit_warning, headless Chrome (par/guie1117/live-commit2): the notice and the numbers line show, and are absent
without the field.
30 lines
1.8 KiB
Python
30 lines
1.8 KiB
Python
"""serve/commit_limit.py - the engine's Windows commit-limit warning (#1607), as a fact the Monitor and the app can read.
|
|
|
|
On Windows the engine compares what a run plans to allocate on the host with the commit that is left (RAM + page file) and, when it will not fit, writes one line
|
|
to its log: "strata serve: WARNING the Windows commit limit is 92.8 GiB (RAM + page file) and 0.8 GiB of it is left, but this run plans 2.0 GiB of host
|
|
allocations and keeps 4.0 GiB free: it can end at the limit with no message (exit code 0xC0000409, #1607) while RAM is still free. ..." The engine has no
|
|
structured field for it (0.2.17: give it one), so the server reads the line from this start's log and puts the numbers in engine.info["commit_warning"], which /metrics
|
|
carries in `engine` like the other INFO facts. The pattern is pinned to the engine's own text by the unit test (serve/test_commit_limit.py).
|
|
"""
|
|
from __future__ import annotations
|
|
|
|
import re
|
|
|
|
_LINE = re.compile(
|
|
r"WARNING the Windows commit limit is (?P<limit>[0-9]+(?:\.[0-9]+)?) GiB \(RAM \+ page file\) and (?P<left>[0-9]+(?:\.[0-9]+)?) GiB of it is left, "
|
|
r"but this run plans (?P<planned>[0-9]+(?:\.[0-9]+)?) GiB of host allocations and keeps (?P<floor>[0-9]+(?:\.[0-9]+)?) GiB free")
|
|
|
|
|
|
def commit_warning(log_text: str) -> dict | None:
|
|
"""The numbers of the engine's commit-limit warning in this start's log text (the last such line), or None when there is none:
|
|
{"limit_gib", "left_gib", "planned_gib", "floor_gib"}."""
|
|
found = None
|
|
for line in (log_text or "").splitlines():
|
|
m = _LINE.search(line)
|
|
if m:
|
|
found = m
|
|
if found is None:
|
|
return None
|
|
return {"limit_gib": float(found.group("limit")), "left_gib": float(found.group("left")),
|
|
"planned_gib": float(found.group("planned")), "floor_gib": float(found.group("floor"))}
|