launcher: Copy info for a bug report #3320

Manually merged
github merged 5 commits from github-bot/gh-3320 into main 2026-12-03 11:35:30 +00:00 AGit
Owner

@⁠MoonEyes on GitHub · 2026-12-03 10:51 UTC · original
MoonEyes:feat/launcher-copy-report-py → main · +647 −4 · 8 files · 5 commits · merged 2026-12-03 11:31 UTC

Claim: LAUNCHER-COPY-REPORT in #3312.

Players' crash reports often lack the GPU, the driver and the settings they played with. This adds a Copy info for a bug report button next to Copy my info in the Play page's Output card (also a row in the Tools list) of the launcher Launcher.bat opens (tools/leonida_launcher.py). It puts a short block on the clipboard, at most 25 lines, to paste in Discord or in an issue:

  • Leonida version, Windows version;
  • GPU name and video memory, read from the newest play-*.log the D3D12 runtime wrote (the card="..." field of the first indirect execution, leonida-gpu/src/indirect.rs, or the adapter=... memory_mb=... line when LEONIDA_ADAPTER is set, host.rs); "not in the log" when absent;
  • console profile, resolution, upscaler, frame generation and the LEONIDA_* values the launcher passes;
  • up to 10 error lines of that log (error, panic, device lost or removed, exception, 0xC0000…), repeated lines kept once.

Every log line goes through scrub_line (tools/bug_report_info.py): the home folder becomes %USERPROFILE%, values of program=/shader=/pipeline=/pso=/hash= and hex-like names after a stage word are removed, 0x values and runs of 8+ hex digits are removed except Windows status and error codes (0xC0000409, 0x887A0005), and lines are cut at 200 characters. Variable values that look like paths show as <path>. No game data leaves through the button.

Not done here

  • The runtime never logs the driver version, and logs video memory only with LEONIDA_ADAPTER; the block says "not in the log" for them. A one-line log at device creation in leonida-gpu/src/host.rs would fill both; posted as a finding in #3312.
  • The French, Spanish, Portuguese and German strings are machine-written and not reviewed by a native speaker.

Tested

  • tests/test_bug_report_info.py: 27 OK (log parsing in both field orders, the 10-line cap, every scrub rule, status codes kept and addresses removed, missing or unreadable log).
  • tests/test_leonida_launcher.py 144 OK, test_launcher_serve 12 OK, test_win_launchers 12 OK, test_ci_registration and test_text_write_line_endings OK; python -m compileall -q tools tests clean; scripts/check_no_game_data.py clean on the new files.
  • Not clicked in a real window: the Tk handlers run in the launcher test suite but nothing presses the button. No game run needed (the launcher only reads a log).

AI-assisted (Claude Code, Claude Opus 5.5). Independent review: a separate Claude Opus 5.5 agent before merge.

🤖 Generated with Claude Code

**@⁠MoonEyes** on GitHub · 2026-12-03 10:51 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/3320) `MoonEyes:feat/launcher-copy-report-py` → `main` · +647 −4 · 8 files · 5 commits · merged 2026-12-03 11:31 UTC Claim: `LAUNCHER-COPY-REPORT` in #3312. Players' crash reports often lack the GPU, the driver and the settings they played with. This adds a **Copy info for a bug report** button next to **Copy my info** in the Play page's Output card (also a row in the Tools list) of the launcher `Launcher.bat` opens (`tools/leonida_launcher.py`). It puts a short block on the clipboard, at most 25 lines, to paste in Discord or in an issue: - Leonida version, Windows version; - GPU name and video memory, read from the newest `play-*.log` the D3D12 runtime wrote (the `card="..."` field of the first indirect execution, `leonida-gpu/src/indirect.rs`, or the `adapter=... memory_mb=...` line when `LEONIDA_ADAPTER` is set, `host.rs`); "not in the log" when absent; - console profile, resolution, upscaler, frame generation and the `LEONIDA_*` values the launcher passes; - up to 10 error lines of that log (error, panic, device lost or removed, exception, `0xC0000…`), repeated lines kept once. Every log line goes through `scrub_line` (`tools/bug_report_info.py`): the home folder becomes `%USERPROFILE%`, values of `program=`/`shader=`/`pipeline=`/`pso=`/`hash=` and hex-like names after a stage word are removed, `0x` values and runs of 8+ hex digits are removed except Windows status and error codes (`0xC0000409`, `0x887A0005`), and lines are cut at 200 characters. Variable values that look like paths show as `<path>`. No game data leaves through the button. ## Not done here - The runtime never logs the driver version, and logs video memory only with `LEONIDA_ADAPTER`; the block says "not in the log" for them. A one-line log at device creation in `leonida-gpu/src/host.rs` would fill both; posted as a finding in #3312. - The French, Spanish, Portuguese and German strings are machine-written and not reviewed by a native speaker. ## Tested - `tests/test_bug_report_info.py`: 27 OK (log parsing in both field orders, the 10-line cap, every scrub rule, status codes kept and addresses removed, missing or unreadable log). - `tests/test_leonida_launcher.py` 144 OK, `test_launcher_serve` 12 OK, `test_win_launchers` 12 OK, `test_ci_registration` and `test_text_write_line_endings` OK; `python -m compileall -q tools tests` clean; `scripts/check_no_game_data.py` clean on the new files. - Not clicked in a real window: the Tk handlers run in the launcher test suite but nothing presses the button. No game run needed (the launcher only reads a log). AI-assisted (Claude Code, Claude Opus 5.5). Independent review: a separate Claude Opus 5.5 agent before merge. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Puts a short plain-text block (25 lines at most) on the clipboard: the
Leonida commit, Windows version, the card the newest d3d12 play log names,
the play settings in effect and up to 10 scrubbed error lines of that log.
The block builder and the scrub (home folder, hex runs, 0x values, hex-like
names after shader stage words, program/shader/pipeline/pso/hash values,
200-character cut) are pure functions in tools/bug_report_info.py. The
driver version and, mostly, the video memory are not in the runtime's log
and read "not in the log". No game data, no paths.

Claim: LAUNCHER-COPY-REPORT (#3312)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
They say what went wrong (the crash or device-removed code players are asked for) and hold nothing of the game or
the user. Addresses (longer, or not starting with C0 or 8) are still removed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-03 10:51:29 +00:00
Author
Owner

@⁠merzleckeier on GitHub · 2026-12-03 10:54 UTC · original

Review of e9cc6e92 on bfd03e7f. The 27 report tests passed, and the launcher suite ran 144 tests with 3 skips.

  • Remove absolute paths from shareable log lines. scrub_line() masks the username portion of conventional home folders. Absolute paths elsewhere remain intact. A synthetic ERROR reading D:\Example Projects\Local Only\title.exe line survives the full bug_report_text() path and would be copied for publication. The runtime can produce this shape at d3d12/apps/leonida/src/run.rs:56, where its startup error includes exe.display(). Please redact the full path, including paths outside home folders, or make the raw log excerpt separately opt-in. The clipboard fallback should avoid copying raw exception text for the same reason.
  • Distinguish current settings from the log's run. With one fixed play-*.log, changing the settings from Series S to Series X changes the copied Console profile while the error line stays the same. The resulting report gives no indication that these settings are for the next launch. Please label them as current launcher settings and label the errors as from the newest log, or read the settings recorded for that run.

I used synthetic logs and did not open a game or interact with the clipboard. AI-assisted review with OpenAI Codex.

**@⁠merzleckeier** on GitHub · 2026-12-03 10:54 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/3320#issuecomment-7375939182) Review of `e9cc6e92` on `bfd03e7f`. The 27 report tests passed, and the launcher suite ran 144 tests with 3 skips. - **Remove absolute paths from shareable log lines.** `scrub_line()` masks the username portion of conventional home folders. Absolute paths elsewhere remain intact. A synthetic `ERROR reading D:\Example Projects\Local Only\title.exe` line survives the full `bug_report_text()` path and would be copied for publication. The runtime can produce this shape at `d3d12/apps/leonida/src/run.rs:56`, where its startup error includes `exe.display()`. Please redact the full path, including paths outside home folders, or make the raw log excerpt separately opt-in. The clipboard fallback should avoid copying raw exception text for the same reason. - **Distinguish current settings from the log's run.** With one fixed `play-*.log`, changing the settings from Series S to Series X changes the copied `Console profile` while the error line stays the same. The resulting report gives no indication that these settings are for the next launch. Please label them as current launcher settings and label the errors as from the newest log, or read the settings recorded for that run. I used synthetic logs and did not open a game or interact with the clipboard. AI-assisted review with OpenAI Codex.
The blocklist missed what the runtime really logs: pipeline/host.rs logs the title's program names as
names=["PS_..."], capture.rs logs path=D:\..., and paths outside the home folder or quoted file names passed.
Now every word of an error line is kept only if it is a plain word, a number, a timestamp, the logging module or a
Windows status code; a field keeps its value only if it is a number, true/false or a status code; a word made of
6+ hex letters (deadbeef) is dropped; removed words in a row become one <removed>. The exception text of a failed
read is scrubbed too. The scrub tests now assert that nothing leaks, with the reviewer's real runtime lines.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Variable values showed lists of the title's program hashes (LEONIDA_PAIRED_FOR and the like), program names and
URLs. A value is now shown as it is only when it is a number, true/false or a short word; a list shows its count
(<44 entries>), anything else <set>. Windows, the card, the profile, the upscaler and frame generation go word by
word through an allowlist (short words, numbers, model numbers such as A770, the (R)/(TM) marks); the resolution
must look like 1080 or 2560x1080. Tests cover the reviewer's probes and that real card names stay.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github manually merged commit b053a1813c into main 2026-12-03 11:35:30 +00:00
Author
Owner

@⁠merzleckeier on GitHub · 2026-12-03 11:34 UTC · original

Post-merge verification on b053a181: the report button’s fallback fails before it can notify the window. In Launcher.copy_report, the worker’s except handler uses info.scrub_line(...), but info only exists as a local in bug_report_text().

I exercised the real copy_report() and queue pump() with a mocked clipboard. A synthetic FileNotFoundError from _bug_report_module() produced a NameError on the worker, no queued report, and no clipboard update. Replacing the exception formatting with a fixed message (The report data could not be read.) delivered the fallback to the clipboard without copying the exception path. The success path still delivered its report. All 32 report tests and the launcher suite (144 run, 2 skipped) passed locally with that change.

AI-assisted with OpenAI Codex.

**@⁠merzleckeier** on GitHub · 2026-12-03 11:34 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/3320#issuecomment-7376877300) Post-merge verification on `b053a181`: the report button’s fallback fails before it can notify the window. In `Launcher.copy_report`, the worker’s `except` handler uses `info.scrub_line(...)`, but `info` only exists as a local in `bug_report_text()`. I exercised the real `copy_report()` and queue `pump()` with a mocked clipboard. A synthetic `FileNotFoundError` from `_bug_report_module()` produced a `NameError` on the worker, no queued report, and no clipboard update. Replacing the exception formatting with a fixed message (`The report data could not be read.`) delivered the fallback to the clipboard without copying the exception path. The success path still delivered its report. All 32 report tests and the launcher suite (144 run, 2 skipped) passed locally with that change. AI-assisted with OpenAI Codex.
Author
Owner

@⁠fiestorra on GitHub · 2026-12-03 12:36 UTC · original

VERIFY-3320 — aplica limpia sobre d9b618f10 y las cuatro suites pasan, con mi guarda de i18n puesta encima

5 commits nuevos (los dos suyos + los de #3314 y #3313, que aún no están en main)
cherry-pick del rango sobre d9b618f10:   exit 0, sin conflicto

tests/test_bug_report_info.py    27 passed, 45 subtests   (0,4 s)
tests/test_leonida_launcher.py  144 passed                (9,3 s)
tests/test_win_launchers.py      12 passed, 6 subtests    (19 s)
tests/test_d3d12_switches.py     20 passed                (10 s)
tests/test_launcher_i18n.py     (la mía) Ran 3 — OK       (0,006 s)

Y las dos cosas que quería comprobar de una PR que toca los cuatro idiomas:

  • test_leonida_launcher.py sigue en 144, que es el número de main — o sea que la PR no añade un test al launcher, pero tampoco lo rompe (y 144 es el número bueno aquí: el 145 de #3289 es de aquella rama, no de esta);
  • mi guarda de i18n pasa: los cuatro ficheros de idioma siguen con las mismas claves. Es la segunda PR real contra la que la pruebo (la primera fue #3310), y las dos veces ha dicho lo mismo: cuadran.

Y un detalle de la PR que vale la pena señalar: el commit dice «keep Windows status and error codes (0xC0000409, 0x887A0005)» — dos códigos concretos, uno de stack buffer overrun y otro de device removed. Un informe de fallo que se lleve esos dos números es la diferencia entre «se cerró» y «se cerró por esto». El test cubre el formato (45 subtests), no que el juego produzca esos códigos — eso es de quien lo vea cerrarse.

Lo que no he verificado: el botón en la ventana (Tkinter, sin escritorio) y el Bug report de verdad contra un cierre real.

**@⁠fiestorra** on GitHub · 2026-12-03 12:36 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/3320#issuecomment-7378578073) ## VERIFY-3320 — **aplica limpia sobre `d9b618f10` y las cuatro suites pasan**, con mi guarda de i18n puesta encima ``` 5 commits nuevos (los dos suyos + los de #3314 y #3313, que aún no están en main) cherry-pick del rango sobre d9b618f10: exit 0, sin conflicto tests/test_bug_report_info.py 27 passed, 45 subtests (0,4 s) tests/test_leonida_launcher.py 144 passed (9,3 s) tests/test_win_launchers.py 12 passed, 6 subtests (19 s) tests/test_d3d12_switches.py 20 passed (10 s) tests/test_launcher_i18n.py (la mía) Ran 3 — OK (0,006 s) ``` **Y las dos cosas que quería comprobar de una PR que toca los cuatro idiomas**: - **`test_leonida_launcher.py` sigue en `144`**, **que es el número de `main`** — **o sea que la PR no añade un test al launcher, pero tampoco lo rompe** (**y `144` es el número bueno aquí: el `145` de `#3289` es de aquella rama, no de esta**); - **mi guarda de i18n pasa**: **los cuatro ficheros de idioma siguen con las mismas claves.** **Es la segunda PR real contra la que la pruebo** (**la primera fue `#3310`**), **y las dos veces ha dicho lo mismo: cuadran.** **Y un detalle de la PR que vale la pena señalar**: **el commit dice «keep Windows status and error codes (0xC0000409, 0x887A0005)»** — **dos códigos concretos, uno de *stack buffer overrun* y otro de *device removed***. **Un informe de fallo que se lleve esos dos números es la diferencia entre «se cerró» y «se cerró por esto».** **El test cubre el formato (`45 subtests`), no que el juego produzca esos códigos** — **eso es de quien lo vea cerrarse.** **Lo que no he verificado**: **el botón en la ventana** (**Tkinter, sin escritorio**) **y el `Bug report` de verdad contra un cierre real.**
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/ubiquitarianism--leonida!3320
No description provided.