Report launcher-only exits in the game gate #3218

Merged
merzleckeier merged 1 commit from upstream-pr/3218 into main 2026-12-03 16:10:21 +00:00
merzleckeier commented 2026-12-02 20:09:02 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-02T20:09:02Z.


Claimed in the coordination issue as D3D12-GAME-GATE-LAUNCHER-EXIT.

Depends on: #3210 for the launcher event producer. Also tested together with #3213, which expands the set of recognized device-loss exit codes.

What and why

  • Record the exit time and code from launcher_exited when the game gate has no game_exited event.
  • Keep a recorded game exit authoritative. An ordinary launcher failure still reports ERROR / not_started. A recognized device-loss code reports FAIL / device_lost and keeps its original 32-bit value.

Tested

  • With the new tests and the source from main, the ordinary exit lost its time and both signed and unsigned device-loss cases reported ERROR. The game-exit precedence test passed on both versions.
  • Linux: 38 game-gate tests (including PowerShell stop logic), 17 game-run-summary tests, 57 documentation checks, and the no-game-data and whitespace checks passed.
  • Windows CPython 3.12.10 under Wine 11.22: 36 game-gate tests passed, including the three new tests. The two tests requiring PowerShell were skipped in that environment.
  • A clean local merge with #3210 at 917cb9e32 and #3213 at 9a9966901 passed 39 game-gate tests. The summary CLI wrote the expected code, time and failure verdict for all six signed/unsigned cases across 0x887A0005, 0x887A0006 and 0x887A0007.

GPUs tested: n/a (synthetic event logs).

AI-assisted: OpenAI GPT-6.2 through Codex. GPT-6.2 Sol independently reviewed the change read-only and reproduced red and green.

Checklist

  • Based on upstream main at b41763227 and merges cleanly.
  • One topic.
  • Synthetic fixtures only.
  • Translator rule: n/a.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5613856494 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3218). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-02T20:09:02Z. --- Claimed in the coordination issue as [D3D12-GAME-GATE-LAUNCHER-EXIT](https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7357181720). Depends on: #3210 for the launcher event producer. Also tested together with #3213, which expands the set of recognized device-loss exit codes. ### What and why - Record the exit time and code from `launcher_exited` when the game gate has no `game_exited` event. - Keep a recorded game exit authoritative. An ordinary launcher failure still reports `ERROR` / `not_started`. A recognized device-loss code reports `FAIL` / `device_lost` and keeps its original 32-bit value. ### Tested - With the new tests and the source from `main`, the ordinary exit lost its time and both signed and unsigned device-loss cases reported `ERROR`. The game-exit precedence test passed on both versions. - Linux: 38 game-gate tests (including PowerShell stop logic), 17 game-run-summary tests, 57 documentation checks, and the no-game-data and whitespace checks passed. - Windows CPython 3.12.10 under Wine 11.22: 36 game-gate tests passed, including the three new tests. The two tests requiring PowerShell were skipped in that environment. - A clean local merge with #3210 at `917cb9e32` and #3213 at `9a9966901` passed 39 game-gate tests. The `summary` CLI wrote the expected code, time and failure verdict for all six signed/unsigned cases across `0x887A0005`, `0x887A0006` and `0x887A0007`. GPUs tested: n/a (synthetic event logs). AI-assisted: OpenAI GPT-6.2 through Codex. GPT-6.2 Sol independently reviewed the change read-only and reproduced red and green. ### Checklist - [x] Based on upstream `main` at `b41763227` and merges cleanly. - [x] One topic. - [x] Synthetic fixtures only. - Translator rule: n/a.
fiestorra commented 2026-12-02 20:32:40 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-02T20:32:40Z.


VERIFY-3218 — Windows nativo: red then green (y el orden de fusión importa)

Head (this PR)
Merge base b41763227 = current main
Merged onto main b41763227 — clean, no overlap

Ran (native Windows, CPython 3.13)

python -I tests/test_game_gate.py     Ran 38 tests in 6.67s — OK

Negative control (tools/game_gate.py reverted to main, the PR's tests kept):

FAIL: test_a_launcher_only_device_loss_fails_with_the_same_signed_or_unsigned_code   (both signed and unsigned)
FAIL: test_a_launcher_only_exit_keeps_the_startup_error_and_records_the_code
FAILED (failures=3)     of 38

The change itself is two lines and reads right: exited = game_exit or run.event("launcher_exited") — the recorded game exit stays authoritative, the launcher's exit is the fallback — while exited_before_stop now looks at game_exit only, so a launcher exit before the stop request cannot be mistaken for the game having exited. The docs row for times.exit_at_s matches that.

Merge order

Depends on: #3210, which is still OPEN (#3213 too, BLOCKED) — the launcher_exited event only arrives with #3210. On main alone this PR is harmless (the fallback simply never fires) but it is inert until #3210 lands; landing #3218 after it is the order the body already gives, and I would keep it.

What I could not test

  • A real launcher-only exit: the tests build synthetic event logs; no play-*.ps1 run produced the event here.
  • The 17 game-run-summary and 57 documentation checks the author ran on Linux: I ran only the game-gate suite.

Verdict: red then green on native Windows.

Written with an AI assistant.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7357906607 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3218#issuecomment-7357906607). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-12-02T20:32:40Z. --- ## VERIFY-3218 — Windows nativo: `red then green` (y el orden de fusión importa) | | | |---|---| | Head | `(this PR)` | | Merge base | `b41763227` = current `main` | | Merged onto | `main` `b41763227` — clean, no overlap | **Ran (native Windows, CPython 3.13)** ``` python -I tests/test_game_gate.py Ran 38 tests in 6.67s — OK ``` **Negative control** (`tools/game_gate.py` reverted to `main`, the PR's tests kept): ``` FAIL: test_a_launcher_only_device_loss_fails_with_the_same_signed_or_unsigned_code (both signed and unsigned) FAIL: test_a_launcher_only_exit_keeps_the_startup_error_and_records_the_code FAILED (failures=3) of 38 ``` **The change itself is two lines and reads right**: `exited = game_exit or run.event("launcher_exited")` — the recorded game exit stays authoritative, the launcher's exit is the fallback — while `exited_before_stop` now looks at `game_exit` only, so a launcher exit before the stop request cannot be mistaken for the game having exited. The docs row for `times.exit_at_s` matches that. ## Merge order **`Depends on: #3210`, which is still OPEN (#3213 too, BLOCKED)** — the `launcher_exited` event only arrives with #3210. On `main` alone this PR is harmless (the fallback simply never fires) but it is inert until #3210 lands; landing #3218 after it is the order the body already gives, and I would keep it. ## What I could not test - **A real launcher-only exit**: the tests build synthetic event logs; no `play-*.ps1` run produced the event here. - **The 17 game-run-summary and 57 documentation checks the author ran on Linux**: I ran only the game-gate suite. Verdict: **red then green** on native Windows. Written with an AI assistant.
ecox982745 commented 2026-12-02 21:04:24 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by ecox982745 on 2026-12-02T21:04:24Z.


Native Windows integration after #3210 merged. I ran the unmodified PowerShell 7 gate and Play scripts from main 8a9235d0 in an isolated checkout with a synthetic runtime and mocked process discovery. Only the summary tool differed between main and the clean merge with #3218 head 62e365ea. In both arms, the supervisor itself wrote launcher_exited from the child status. The fixture provided no game_exited event.

Synthetic runtime status Main summary Main + #3218
23 ERROR, no exit code or time ERROR, 0x00000017 and recorded exit time
Signed 0x887A0005 ERROR, no exit code or time FAIL / device lost, 0x887A0005 and recorded exit time

Gate process statuses were 2 and 1 for ERROR and FAIL respectively. This checks event production and consumption together without game files or GPU work. AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7358749660 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3218#issuecomment-7358749660). Originally posted by [ecox982745](https://github.com/ecox982745) on 2026-12-02T21:04:24Z. --- Native Windows integration after #3210 merged. I ran the unmodified PowerShell 7 gate and Play scripts from main `8a9235d0` in an isolated checkout with a synthetic runtime and mocked process discovery. Only the summary tool differed between main and the clean merge with #3218 head `62e365ea`. In both arms, the supervisor itself wrote `launcher_exited` from the child status. The fixture provided no `game_exited` event. | Synthetic runtime status | Main summary | Main + #3218 | | --- | --- | --- | | 23 | ERROR, no exit code or time | ERROR, `0x00000017` and recorded exit time | | Signed `0x887A0005` | ERROR, no exit code or time | FAIL / device lost, `0x887A0005` and recorded exit time | Gate process statuses were 2 and 1 for ERROR and FAIL respectively. This checks event production and consumption together without game files or GPU work. AI-assisted.
lixonik commented 2026-12-02 22:47:49 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by lixonik on 2026-12-02T22:47:49Z.


Windows native verification (red -> green) -- PASS on head 62e365eae (merged cleanly via git merge --no-ff onto main 16243cd6e).

Checks (Windows 10 x64, Python 3.12)

  • python -I scripts/check_no_game_data.py -> PASS
  • Green (python -I tests/test_game_gate.py -v on merged head 62e365eae): Ran 38 tests in 6.390s / OK (skipped=2)
  • Red (reverted tools/game_gate.py to main 16243cd6e, keeping the PR's tests/test_game_gate.py): Ran 38 tests in 6.223s / FAILED (failures=3, skipped=2)

AI-assisted: yes (Antigravity -- Gemini 4 Neon).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7361172093 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3218#issuecomment-7361172093). Originally posted by [lixonik](https://github.com/lixonik) on 2026-12-02T22:47:49Z. --- **Windows native verification (`red -> green`) -- PASS** on head `62e365eae` (merged cleanly via `git merge --no-ff` onto `main` `16243cd6e`). ### Checks (Windows 10 x64, Python 3.12) - `python -I scripts/check_no_game_data.py` -> **PASS** - **Green** (`python -I tests/test_game_gate.py -v` on merged head `62e365eae`): **Ran 38 tests in 6.390s / OK (skipped=2)** - **Red** (reverted `tools/game_gate.py` to `main` `16243cd6e`, keeping the PR's `tests/test_game_gate.py`): **Ran 38 tests in 6.223s / FAILED (failures=3, skipped=2)** AI-assisted: yes (Antigravity -- Gemini 4 Neon).
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!3218
No description provided.