fix(app): the game placement reads the card again and stage retries start over with each new wish

- the game stage reads the card again: other programs as at the last normal placement made with
  no game running, and a reserve of at least what grew since (the game and programs opened after
  that reading); with a game already running at the start (game detection now looks once before
  the LLM starts) it counts what the card holds now and leaves only the room for other programs,
  so it no longer pauses for counting the game twice
- the retry count starts over whenever another stage is wanted, also when the game ends with the
  normal stage already running, so the next game tries again
- the wait before the next try counts from when the failed switch and its way back are over
- the worker client keeps, sends and readies a connection under one lock (llm, then state), so an
  LLM state set while a worker connects is not lost
- a game watch dropped by a start that fails part way stops its thread

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
javis-bot
2026-11-14 10:45:00 +09:00
parent aa6d950af6
commit 4a81b88d41
6 changed files with 243 additions and 33 deletions

View File

@@ -355,21 +355,26 @@ between the normal placement and the game placement as games come and go (not wi
back; `voice_worker.spec.md`, "LLM switches"); the app waits until the brain has written the
answers in progress (at most 2 minutes; the switch is numbered, so an idle report for an earlier
switch that came late does not count), restarts the LLM in the new stage and tells the brain it
is ready (or paused). The worker client keeps that latest state and sends it again on every
connection. A restart that fails brings back the stage that ran before and tells the brain
ready; the failed stage is tried again after 60 s, three times at most, then not until the
wanted stage changes. When the stage before does not come back either, the LLM shows `failed`
is ready (or paused). The worker client keeps that latest state and sends it again first on
every connection; keeping, sending and a connection becoming ready share one lock, so a state set
while a worker connects is never lost. A restart that fails brings back the stage that ran
before and tells the brain ready; the failed stage is tried again 60 s after that is over, three
times at most, and the count starts over whenever another stage is wanted (also when the game
ends and the normal stage already runs), so the next game tries again. When the stage before does not come back either, the LLM shows `failed`
and the brain is told paused (requests fail at once instead of waiting).
- The game stage: context 16,384 (or the settings' smaller one), one request at a time, half the
engine's CPU threads (read from its log at the normal start, else a quarter of the logical CPUs),
and the game placement (`placement.rs`: the reserve beside more than 2 GiB of experts, else
2 GiB, else 0 GiB, else pause), measured once at that context like the normal one. Other
programs' memory is what the card holds after the LLM stopped, less the STT worker's model while
it is loaded (1300 MiB); the normal stage reads it afresh each time (programs opened since
count) and keeps it; the game stage takes the one kept at the latest normal placement, as the
card then also holds the game, which its reserve is for (a game already running when the
services start is counted in it, which only leaves the LLM less). The dashboard shows the stage
that runs, also on a fallback placement without experts.
it is loaded (1300 MiB), read afresh at every placement. A normal placement made with no game
running keeps its reading. The game stage counts other programs as that kept reading and leaves
a reserve of at least what has grown since (the game and any program opened after that
reading), so nothing is counted twice and nothing that grew is missed. When a game already ran
as the services started (game detection looks once before the LLM starts), there is no such
reading: the game stage then counts what the card holds now, the game included, and leaves only
the room for other programs. The dashboard shows the stage that runs, also on a fallback
placement without experts.
- Pause: the LLM stops (`llm` off, "게임 중 일시정지"); the brain answers nothing until the stage
changes.
- The foreground program is a game, in this order: in `notGames`: no; in `games`: yes
@@ -606,11 +611,13 @@ a path with non-ASCII letters) or from a Battle.net game's install folder (a tes
turns game mode on with its name and off once it ends. Performance stages (on every system, with a fake
Strata and card): a game moves the LLM to the game placement (measured once at 16K and one request,
2 GiB on the game PC's numbers, half the 16 engine threads) and back after the wait, pause stops
it, a card with no room for a game pauses, the normal stage counts a program opened since and the
game stage does not count the game twice, a fallback game placement still shows as the game
it, a card with no room for a game pauses, the normal stage counts a program opened since, the game
stage does not count the game twice and counts what grew since the normal reading, a game running
as the services start does not pause the LLM, a fallback game placement still shows as the game
stage, and the stage loop tells the brain switching (with the notice), waits, restarts and tells
it ready, also on the way back; a game stage that cannot start goes back to normal each time and
is tried three times. The worker client ignores a late idle of an earlier switch and sends the
is tried three times; after that a new game tries again, and the next try waits from when the
failed switch was over. The worker client ignores a late idle of an earlier switch and sends the
latest LLM state first when a worker connects again. On every system: game detection's rules
(a borderless game, a maximised program, a browser's full-screen video, exclusive full screen,
launcher folders and their own windows, Battle.net games by install folder and their uninstall