fix(m0,docs): fail gamemode on unstarted placements and never overrun the game reserve

The gamemode stage was "ok" when only the normal placement started; a
placement that does not start, or a measurement error inside one, now marks
the stage partial. The design no longer raises the expert budget above the
computed one: it shrinks the game reserve to what the smallest placement
leaves, shows that, and pauses the LLM during games when nothing is left.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
javis-bot
2026-11-10 17:43:26 +09:00
parent 8124451402
commit 8dfab3ab6e
3 changed files with 25 additions and 2 deletions

View File

@@ -513,6 +513,17 @@ def test_a_placement_that_does_not_start_is_recorded_and_the_rest_still_run(tmp_
assert len(started) == len(llm.LEVELS)
row = next(x for x in r["levels"] if x["key"] == "game_experts_4g")
assert row["switch_s"] is None and "decode_tok_s" not in row
# A placement that never started is a gap in the measurement, not a pass.
assert r["status"] == "partial"
assert any("game_experts_4g" in e["where"] for e in r["errors"])
def test_only_the_normal_placement_starting_is_not_ok(tmp_path, monkeypatch, fake_server):
r, _, _ = _run_levels_stage(tmp_path, monkeypatch, fake_server, _vram,
ready=lambda sets: not any(s.startswith("expert-vram=") for s in sets))
assert r["game_choice"] is None
assert r["status"] == "partial"
assert sum(1 for e in r["errors"] if e["where"].startswith("level game_")) == 4
def _row(key, free, tok_s):
@@ -537,3 +548,10 @@ def test_kit_has_a_one_click_runner_for_desktop_and_gamemode():
assert "gamemode" in keys
bat = (Path(m0.KIT) / "run_m0_gamemode.bat").read_text(encoding="utf-8")
assert "-Only desktop,gamemode" in bat and "-Redo" in bat
def test_a_measurement_error_inside_a_placement_marks_the_stage_partial(tmp_path, monkeypatch, fake_server):
monkeypatch.setattr(llm, "quick_bench", lambda c: {"errors": ["decode: TimeoutError"], "decode_tok_s": {"n": 0}})
r, _, _ = _run_levels_stage(tmp_path, monkeypatch, fake_server, _vram)
assert r["status"] == "partial"
assert any(e["error"] == "decode: TimeoutError" for e in r["errors"])