feat(m0): measure the one model's game placements and fix desktop app matching
Add a gamemode stage that restarts Qwen3.6-35B-A3B with a smaller routed expert VRAM budget (6, 4, 2 GiB, and 2 GiB with half the CPU workers), then the normal placement again, and records switch time, free VRAM, output speed, first spoken sentence and 8K-context first token for each. It names the fastest placement that leaves the game its 8 GB reserve. Strata 0.1.59's qwen36 engine cannot shrink VRAM while running, so each placement is a restart. The desktop stage now matches running apps by the process image name Windows lists (Discord.exe) and closes the calculator it launched by image name when close-app cannot find a UWP app. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -55,6 +55,9 @@ INPUT_NAME = "jarvis-m0-input"
|
||||
INPUT_TEXT = "자비스 입력 테스트 15"
|
||||
|
||||
READ_APPS = ["Discord", "explorer"]
|
||||
# close-app only knows window-owning processes; a UWP app such as the
|
||||
# calculator is owned by ApplicationFrameHost, so it is closed by image name.
|
||||
FORCE_CLOSE = ["taskkill", "/F", "/IM"]
|
||||
REPEAT = 5
|
||||
|
||||
|
||||
@@ -201,7 +204,23 @@ def check_calculator(desk: Desk, wait_s: float = 15) -> dict[str, Any]:
|
||||
out["error"] = "display does not show the sum"
|
||||
return out
|
||||
finally:
|
||||
out["close_error"] = code(desk("close-app", app))
|
||||
close_launched(desk, app, out)
|
||||
|
||||
|
||||
def close_launched(desk: Desk, app: str, out: dict[str, Any]) -> None:
|
||||
"""Close the calculator this stage started (never one the user had open)."""
|
||||
out["close_error"] = code(desk("close-app", app))
|
||||
if out["close_error"] is not None:
|
||||
try:
|
||||
subprocess.run([*FORCE_CLOSE, app], capture_output=True, timeout=30)
|
||||
except (OSError, subprocess.SubprocessError):
|
||||
pass
|
||||
out["closed"] = _calculator_app(desk, 0) is None
|
||||
|
||||
|
||||
def _image_stem(name: str) -> str:
|
||||
n = name.lower()
|
||||
return n[:-4] if n.endswith(".exe") else n
|
||||
|
||||
|
||||
def _page(page_dir: Path) -> Path:
|
||||
@@ -258,15 +277,18 @@ def check_text_input(desk: Desk, open_page: Callable[[Path, str], Any], page_dir
|
||||
|
||||
def check_apps(desk: Desk) -> dict[str, Any]:
|
||||
env = desk("list-apps")
|
||||
running = {str(a.get("name") or "").lower() for a in ((env.get("data") or {}).get("apps") or [])} \
|
||||
if env.get("ok") else set()
|
||||
# Windows lists process image names ("Discord.exe"); snapshot wants that exact name.
|
||||
listed = [str(a.get("name") or "") for a in ((env.get("data") or {}).get("apps") or [])] \
|
||||
if env.get("ok") else []
|
||||
by_stem = {_image_stem(n): n for n in listed}
|
||||
out: dict[str, Any] = {}
|
||||
for app in READ_APPS:
|
||||
if app.lower() not in running:
|
||||
name = by_stem.get(_image_stem(app))
|
||||
if name is None:
|
||||
out[app] = {"running": False}
|
||||
continue
|
||||
t0 = time.perf_counter()
|
||||
snap = desk("snapshot", "--app", app, "-i", "--compact", "--timeout-ms", "8000")
|
||||
snap = desk("snapshot", "--app", name, "-i", "--compact", "--timeout-ms", "8000")
|
||||
d = snap.get("data") or {} if snap.get("ok") else {}
|
||||
out[app] = {"running": True, "ok": bool(snap.get("ok")), "error": code(snap),
|
||||
"ref_count": d.get("ref_count"), "complete": d.get("complete"),
|
||||
|
||||
Reference in New Issue
Block a user