feat(m0): measure the game's own frame times and try yielding by priority instead of a GPU cap

The 95 % GPU cap is gone: it did not lower utilisation, slowed the LLM and
a YouTube video did not stutter without it. What it was meant to protect
is now measured directly in a game. The new on-demand game_frames stage
records the game's frame times with PresentMon (pinned by hash, game
process only, CSV deleted after reading) with Jarvis off, idle and busy in
the game placement, and busy while Jarvis yields: its processes at
below-normal CPU and GPU scheduling priority, read back to confirm, then
restored. Busy rows run A B B A. The design docs record the candidate and
the pre-registered rule for adopting it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
javis-bot
2026-11-11 09:05:55 +09:00
parent 726fca3377
commit dff18c5c7e
9 changed files with 717 additions and 11 deletions

View File

@@ -15,6 +15,8 @@ Options (--opt key=value):
while the LLM answers, and both with Jarvis capped at 95 % of the GPU
only=video a YouTube video's dropped frames with Jarvis off, idle and busy (the
normal placement), busy also with the 95 % GPU cap (video.py)
only=frames the user's game's frame times with Jarvis off, idle and busy (the game
placement), busy also yielding to the game by priority (frames.py)
stt_python=PATH the Python of the stt venv (m0.py passes it)
"""
@@ -663,7 +665,7 @@ def measure_external(r: StageResult, url: str, context: int, only: str = "") ->
if only == "tools":
tools_only(r, c)
return
if only in LEVEL_SETS or only == "video":
if only in LEVEL_SETS or only in ("video", "frames"):
r.note("placements need Strata; not measured against an external server")
return
with GpuSampler() as g:
@@ -682,7 +684,7 @@ def measure_strata(r: StageResult, work: Path, which: str, context: int, only: s
return
r["plan"] = s.plan(preset, context)
r.save()
if only in LEVEL_SETS or only == "video":
if only in LEVEL_SETS or only in ("video", "frames"):
s.stop()
if port_in_use(PORT):
r.error("port", f"다른 프로그램이 {PORT} 포트를 쓰고 있습니다. 그 프로그램을 끄고 다시 실행해 주세요.")
@@ -694,6 +696,10 @@ def measure_strata(r: StageResult, work: Path, which: str, context: int, only: s
from m0lib import video
video.measure(r, s, preset, context, stt_python)
return
if only == "frames":
from m0lib import frames
frames.measure(r, s, preset, context, stt_python)
return
if only == "live":
if not ask_for_a_game():
r["skipped"] = "no game started"
@@ -778,7 +784,8 @@ def main() -> int:
context = int(opts.get("context", "32768"))
only = opts.get("only", "")
name = {"tools": f"tools_{which}", "levels": "gamemode", "together": "gamemode_stt",
"live": "gamemode_live", "tune": "gamemode_tune", "video": "video_drops"}.get(only, f"llm_{which}")
"live": "gamemode_live", "tune": "gamemode_tune", "video": "video_drops",
"frames": "game_frames"}.get(only, f"llm_{which}")
r = StageResult(name, out)
try:
if opts.get("url"):