From cde489b96651f4f699aa362b72944959ed682528 Mon Sep 17 00:00:00 2001 From: Niko1221 Date: Tue, 17 Nov 2026 13:27:35 +0100 Subject: [PATCH] Models: the model card tells the person when the engine says Windows' memory limit is close and Strata may stop without a message (#1607) 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. --- apps/host/scripts/make-guic-locales.py | 21 +++++ apps/host/src/components/NativeModels.tsx | 3 + apps/host/src/lib/commit-warning.ts | 17 ++++ apps/host/src/locales/guic-de.json | 4 +- apps/host/src/locales/guic-en.json | 4 +- apps/host/src/locales/guic-es.json | 4 +- apps/host/src/locales/guic-fr.json | 4 +- apps/host/src/locales/guic-he.json | 4 +- apps/host/src/locales/guic-ja.json | 4 +- apps/host/src/locales/guic-ko.json | 4 +- apps/host/src/locales/guic-pt.json | 4 +- apps/host/src/locales/guic-ru.json | 4 +- apps/host/src/locales/guic-zh.json | 4 +- apps/host/src/styles/app.css | 5 ++ apps/host/tests/commit-warning.test.mjs | 42 ++++++++++ serve/commit_limit.py | 29 +++++++ serve/server.py | 8 ++ serve/test_commit_limit.py | 94 +++++++++++++++++++++++ 18 files changed, 249 insertions(+), 10 deletions(-) create mode 100644 apps/host/src/lib/commit-warning.ts create mode 100644 apps/host/tests/commit-warning.test.mjs create mode 100644 serve/commit_limit.py create mode 100644 serve/test_commit_limit.py diff --git a/apps/host/scripts/make-guic-locales.py b/apps/host/scripts/make-guic-locales.py index bf9a89922e..64857e4de2 100644 --- a/apps/host/scripts/make-guic-locales.py +++ b/apps/host/scripts/make-guic-locales.py @@ -498,6 +498,27 @@ add(en="Stopped: it reached the helper time limit.", ko="중지됨: 도우미 시간 제한에 도달했습니다.", fr="Arrêté : la durée maximale a été atteinte.", he="נעצר: הגיע למגבלת הזמן של העוזרים.") +# #1607: the model card's notice when the engine reports that the Windows commit limit (memory plus page file) is close, and its numbers line. English approved by the coordinator 11-17. +add(en="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.", + zh="Windows 的内存上限(内存加页面文件)快要用完了。Strata 可能会在没有任何提示的情况下停止。请增大 Windows 页面文件,或选择较短的上下文。", + ja="Windows のメモリ上限(メモリとページファイル)に近づいています。Strata がメッセージなしで停止することがあります。Windows のページファイルを大きくするか、コンテキストを短くしてください。", + de="Windows nähert sich seiner Speichergrenze (Arbeitsspeicher plus Auslagerungsdatei). Strata kann ohne Meldung stoppen. Vergrößern Sie die Windows-Auslagerungsdatei oder wählen Sie einen kürzeren Kontext.", + es="Windows está cerca de su límite de memoria (memoria más archivo de paginación). Strata puede detenerse sin mostrar ningún mensaje. Aumenta el archivo de paginación de Windows o elige un contexto más corto.", + ru="Windows близка к пределу памяти (память плюс файл подкачки). Strata может остановиться без сообщения. Увеличьте файл подкачки Windows или выберите более короткий контекст.", + pt="O Windows está perto do limite de memória (memória mais arquivo de paginação). O Strata pode parar sem nenhuma mensagem. Aumente o arquivo de paginação do Windows ou escolha um contexto menor.", + ko="Windows가 메모리 한도(메모리와 페이지 파일)에 가까워졌습니다. Strata가 메시지 없이 멈출 수 있습니다. Windows 페이지 파일을 늘리거나 더 짧은 컨텍스트를 선택하세요.", + fr="Windows approche de sa limite de mémoire (mémoire plus fichier d'échange). Strata peut s'arrêter sans aucun message. Agrandissez le fichier d'échange de Windows ou choisissez un contexte plus court.", + he="Windows קרוב למגבלת הזיכרון שלו (זיכרון בתוספת קובץ הדפדוף). ייתכן ש-Strata ייעצר בלי הודעה. הגדילו את קובץ הדפדוף של Windows או בחרו הקשר קצר יותר.") +add(en="{0} GB of {1} GB are left.", + zh="还剩 {0} GB(共 {1} GB)。", + ja="{1} GB のうち残りは {0} GB です。", + de="Noch {0} GB von {1} GB frei.", + es="Quedan {0} GB de {1} GB.", + ru="Осталось {0} GB из {1} GB.", + pt="Restam {0} GB de {1} GB.", + ko="{1} GB 중 {0} GB가 남았습니다.", + fr="Il reste {0} GB sur {1} GB.", + he="נותרו {0} GB מתוך {1} GB.") here = APP / "src" / "locales" NBSP = " " diff --git a/apps/host/src/components/NativeModels.tsx b/apps/host/src/components/NativeModels.tsx index b4d546265f..f8dae280a5 100644 --- a/apps/host/src/components/NativeModels.tsx +++ b/apps/host/src/components/NativeModels.tsx @@ -33,6 +33,7 @@ import { useStore } from '../lib/store'; import { NativePresets } from './NativePresets'; import { NativeTune } from './NativeTune'; import { NativeTuneBadge } from './NativeTuneBadge'; +import { commitWarning } from '../lib/commit-warning'; import { nativeCatalogModels, catalogVersionLabel, fetchesPictures, hasKvChoice } from '../lib/native-catalog'; export function NativeModels({ onOtherModels, onReady, onImport, onConnectEngine }: { onOtherModels: () => void; @@ -92,6 +93,7 @@ export function NativeModels({ onOtherModels, onReady, onImport, onConnectEngine // What a running job works on, by its name in the list: "Qwen3.8-Flash-Next · Gyro · Smallest". const jobLabel = (j: NativeJob) => { const v = allSizes.find(s => s.id === j.model || (s.model === j.model && (!j.family || s.sourceFamily === j.family))); const f = v && families.find(x => x.sizes.includes(v)); return v ? [f?.title, catalogVersionLabel(v)].filter(Boolean).join(' · ') : ''; }; const loadedSelected = native?.instances.find(i => i.model === selectedSize?.id && i.status === 'ready'); + const loadedCommit = commitWarning(loadedSelected?.metrics?.engine); // #1607: the engine says the Windows commit limit is close // What the running model was really started with is what the page shows: after Load the highlight must still be the profile that was applied. useEffect(() => { if (loadedSelected?.resourceProfile) setResourceProfile(loadedSelected.resourceProfile); }, [loadedSelected?.id, loadedSelected?.resourceProfile]); @@ -263,6 +265,7 @@ export function NativeModels({ onOtherModels, onReady, onImport, onConnectEngine {tr(contextIsTight(fitHardware.vram_gb, context, kv, selectedSize?.context_fit) ?

{tr("This much context takes about {0} GB of graphics memory and leaves little room for the model on this card. Strata will try it; if it does not start, choose a shorter context.", [contextCacheGb(context, kv, selectedSize?.context_fit).toFixed(1)])}

: null)} {tr(loadedSelected?.metrics?.engine?.drafting_note ?

{tr(String(loadedSelected.metrics.engine.drafting_note))}

: null)} + {tr(loadedCommit ?

{tr("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.")}

{tr("{0} GB of {1} GB are left.", [loadedCommit.left, loadedCommit.limit])}

: null)} {roleCards.length > 1 ? setRoles(null)} memoryGb={selectedSize ? memoryNeeded(selectedSize) || null : null} ramGb={pcRam} spillGb={selectedSize ? fitOn(selectedSize, fitHardware).spillGb : 0} usedBy={i => usedBy([i])}/> : null} {tr(roleCards.length > 1 && (native?.hardware?.gpus ?? []).length > roleCards.length ?

{tr('Not used: {0} (another make of graphics card than this engine drives).', [(native?.hardware?.gpus ?? []).filter(g => !roleCards.some(r => r.index === g.index && r.vendor === g.vendor)).map(g => g.name).join(', ')])}

: null)} {tr(selectedSize?.images || noReader ? <>
{tr(expert && vision !== 'no' ?