launcher: Copy info for a bug report #3320

Merged
MoonEyes merged 5 commits from upstream-pr/3320 into main 2026-12-03 11:31:31 +00:00
MoonEyes commented 2026-12-03 10:51:12 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-03T10:51:12Z.


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

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5624984802 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3320). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-03T10:51:12Z. --- 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)
merzleckeier commented 2026-12-03 10:54:22 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-03T10:54:22Z.


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7375939182 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3320#issuecomment-7375939182). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-03T10:54:22Z. --- 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 commented 2026-12-03 11:34:02 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-03T11:34:02Z.


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7376877300 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3320#issuecomment-7376877300). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-03T11:34:02Z. --- 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.
fiestorra commented 2026-12-03 12:36:58 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-03T12:36:58Z.


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7378578073 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3320#issuecomment-7378578073). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-12-03T12:36:58Z. --- ## 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.**
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!3320
No description provided.