make_game: a run without the LEONIDA board still writes <work>/logs/<stage>.log (MAKE-GAME-PLAIN-LOG) #1378

Merged
Diegobecker07 merged 2 commits from upstream-pr/1378 into main 2026-11-29 18:27:43 +00:00
Diegobecker07 commented 2026-11-24 22:56:28 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Diegobecker07 on 2026-11-24T22:56:28Z.


Claimed in the coordination issue as: MAKE-GAME-PLAIN-LOG (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7146425751)

What and why

Only the LEONIDA board wrote the stage logs (make_game.py, the LeonidaBoard(build_stages, log_dir) branch of main()), so a build with --no-tui, or with stdout redirected, left nothing in <work>/logs to read afterwards. With a multi-hour build that is the run you most want a log of.

PlainStageLogs (in make_game.py) is active while the build stages run without the board:

  • log() and fail() lines go to the console as before, and to the running stage's <work>/logs/<stage>.log, the files the board writes (opened in append mode, as there).
  • A command run() starts for a build stage has its stdout and stderr through one pipe. Every byte goes on to the console as it arrives (read1, so a \r progress line still redraws in place), and every \r- or \n-ended piece to the stage's log, with the same split as leonida_tui.pump_process.
  • The child keeps the console (no CREATE_NO_WINDOW), so Ctrl+C reaches it as before. On Ctrl+C it gets 0.25 s to stop and is then killed, as subprocess.run does.
  • A caller that sets its own pipes, and a command outside a build stage (check, preflight), keep subprocess.run unchanged.
  • A stage's file is opened with its first line. An unwritable folder gives one note on stderr, and the build goes on without the logs (tests/test_make_game_paths.py builds into a work folder on a volume that does not exist).

tools/leonida_tui.py is not touched: the class reuses its StageConsole, so this does not overlap #1305.

What changes on the console in plain mode: a child now writes to a pipe instead of the console, as it already does under the board. Ninja, for example, prints its status one line per step instead of redrawing one line. A tool that writes straight to the console handle (WriteConsole) still shows there but is not in the log.

The module docstring, the --no-tui help and the README say where the logs are in both modes.

Tested

  • tests/test_make_game_plain_logs.py (new, 9 tests, real child processes, 4 runs): log()/fail() lines per stage, bytes mirrored unchanged (a \r progress line, a \r\n, stderr after stdout, an unended last piece) and the pieces logged, a failing command's exit code and its ERROR: line, caller pipes and unlogged stages kept on subprocess.run, cwd/env reaching the child, Ctrl+C stopping the child, an unwritable log folder, append across two runs, nothing written without a build stage.
  • All 24 tests/test_make_game_*.py, tests/test_leonida_tui.py, tests/test_text_write_line_endings.py: OK. test_make_game_paths.py caught the first version, which created the folder up front.
  • python -m compileall -q make_game.py tools tests, python -I make_game.py --help, scripts/check_no_game_data.py on the changed files: OK.
  • End to end on Windows: make_game.py --stages runtime --runtime-build <a built runtime> --no-tui into a scratch --out/--work: exit 0, the console unchanged, and work/logs/runtime.log holds the stage's lines.

GPUs tested: n/a (no GPU code)

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a: no translator change)
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5481722851 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1378). Originally posted by [Diegobecker07](https://github.com/Diegobecker07) on 2026-11-24T22:56:28Z. --- Claimed in the coordination issue as: MAKE-GAME-PLAIN-LOG (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7146425751) ### What and why Only the LEONIDA board wrote the stage logs (`make_game.py`, the `LeonidaBoard(build_stages, log_dir)` branch of `main()`), so a build with `--no-tui`, or with stdout redirected, left nothing in `<work>/logs` to read afterwards. With a multi-hour build that is the run you most want a log of. `PlainStageLogs` (in `make_game.py`) is active while the build stages run without the board: - `log()` and `fail()` lines go to the console as before, and to the running stage's `<work>/logs/<stage>.log`, the files the board writes (opened in append mode, as there). - A command `run()` starts for a build stage has its stdout and stderr through one pipe. Every byte goes on to the console as it arrives (`read1`, so a `\r` progress line still redraws in place), and every `\r`- or `\n`-ended piece to the stage's log, with the same split as `leonida_tui.pump_process`. - The child keeps the console (no `CREATE_NO_WINDOW`), so Ctrl+C reaches it as before. On Ctrl+C it gets 0.25 s to stop and is then killed, as `subprocess.run` does. - A caller that sets its own pipes, and a command outside a build stage (`check`, preflight), keep `subprocess.run` unchanged. - A stage's file is opened with its first line. An unwritable folder gives one note on stderr, and the build goes on without the logs (`tests/test_make_game_paths.py` builds into a work folder on a volume that does not exist). `tools/leonida_tui.py` is not touched: the class reuses its `StageConsole`, so this does not overlap #1305. What changes on the console in plain mode: a child now writes to a pipe instead of the console, as it already does under the board. Ninja, for example, prints its status one line per step instead of redrawing one line. A tool that writes straight to the console handle (`WriteConsole`) still shows there but is not in the log. The module docstring, the `--no-tui` help and the README say where the logs are in both modes. ### Tested - `tests/test_make_game_plain_logs.py` (new, 9 tests, real child processes, 4 runs): `log()`/`fail()` lines per stage, bytes mirrored unchanged (a `\r` progress line, a `\r\n`, stderr after stdout, an unended last piece) and the pieces logged, a failing command's exit code and its `ERROR:` line, caller pipes and unlogged stages kept on `subprocess.run`, `cwd`/`env` reaching the child, Ctrl+C stopping the child, an unwritable log folder, append across two runs, nothing written without a build stage. - All 24 `tests/test_make_game_*.py`, `tests/test_leonida_tui.py`, `tests/test_text_write_line_endings.py`: OK. `test_make_game_paths.py` caught the first version, which created the folder up front. - `python -m compileall -q make_game.py tools tests`, `python -I make_game.py --help`, `scripts/check_no_game_data.py` on the changed files: OK. - End to end on Windows: `make_game.py --stages runtime --runtime-build <a built runtime> --no-tui` into a scratch `--out`/`--work`: exit 0, the console unchanged, and `work/logs/runtime.log` holds the stage's lines. GPUs tested: n/a (no GPU code) AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a: no translator change)
Diegobecker07 commented 2026-11-25 13:13:37 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Diegobecker07 on 2026-11-25T13:13:37Z.


Re-checked against current main (0d80bc5df). Main changed make_game.py and README.md in other places and the PR still merges cleanly, so I did not rebase it. On the merged tree, all 25 tests/test_make_game_*.py files pass (including this PR's test_make_game_plain_logs.py), along with test_text_write_line_endings.py, compileall and make_game.py --help.

The three open PRs that touch make_game.py (#1013, #1378, #1407) also merge with each other without conflicts. The same tests pass with all three merged on main (27 files).

CI is waiting for workflow approval (first-time contributor).

AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7163470403 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1378#issuecomment-7163470403). Originally posted by [Diegobecker07](https://github.com/Diegobecker07) on 2026-11-25T13:13:37Z. --- Re-checked against current main (0d80bc5df). Main changed `make_game.py` and `README.md` in other places and the PR still merges cleanly, so I did not rebase it. On the merged tree, all 25 `tests/test_make_game_*.py` files pass (including this PR's `test_make_game_plain_logs.py`), along with `test_text_write_line_endings.py`, `compileall` and `make_game.py --help`. The three open PRs that touch `make_game.py` (#1013, #1378, #1407) also merge with each other without conflicts. The same tests pass with all three merged on main (27 files). CI is waiting for workflow approval (first-time contributor). AI-assisted.
PierreEbele commented 2026-11-25 15:13:01 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by PierreEbele on 2026-11-25T15:13:01Z.


Reviewed 16f3831a5: ran tests/test_make_game_plain_logs.py on the PR (9/9 OK) and on main with the test copied in (9 errors, PlainStageLogs absent, so the test covers the new code); also ran dry_run/interrupt/argparse/resume/progress/preflight/bvh_shaders_stage/translate_cleanup (all OK) and compared test_make_game_platform against main (same pre-existing environment failures on both, no regression). A separate probe verified chunk-boundary splitting (\r, \r\n, UTF-8 split across chunks, unterminated tail), 60 000-line volume, two concurrent stages with children, and the failing-child path: no discrepancies. None of the tests that need a GPU, Windows, MSVC or game files were run. Two non-blocking notes: input=/timeout= kwargs would now raise TypeError on the plain pump (same as the board path; no caller uses them today), and on Windows the plain pump deliberately leaves the child its console handle, so cmake/ninja/MSBuild WriteConsole output may reach the screen but not the stage log; worth a Windows check before relying on the logs there.

AI-assisted review.

Recommendation: Merge

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7166487240 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1378#issuecomment-7166487240). Originally posted by [PierreEbele](https://github.com/PierreEbele) on 2026-11-25T15:13:01Z. --- Reviewed 16f3831a5: ran `tests/test_make_game_plain_logs.py` on the PR (9/9 OK) and on main with the test copied in (9 errors, `PlainStageLogs` absent, so the test covers the new code); also ran dry_run/interrupt/argparse/resume/progress/preflight/bvh_shaders_stage/translate_cleanup (all OK) and compared `test_make_game_platform` against main (same pre-existing environment failures on both, no regression). A separate probe verified chunk-boundary splitting (`\r`, `\r\n`, UTF-8 split across chunks, unterminated tail), 60 000-line volume, two concurrent stages with children, and the failing-child path: no discrepancies. None of the tests that need a GPU, Windows, MSVC or game files were run. Two non-blocking notes: `input=`/`timeout=` kwargs would now raise `TypeError` on the plain pump (same as the board path; no caller uses them today), and on Windows the plain pump deliberately leaves the child its console handle, so cmake/ninja/MSBuild `WriteConsole` output may reach the screen but not the stage log; worth a Windows check before relying on the logs there. AI-assisted review. **Recommendation:** Merge
Diegobecker07 commented 2026-11-25 16:28:44 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Diegobecker07 on 2026-11-25T16:28:44Z.


Thanks for the review. I checked the Windows console-handle note on this PR's head (16f3831a5) in a real console: cmd in Windows Terminal running python -I make_game.py --game <pkg> --out <scratch> --work <scratch> --stages runtime --jobs 12 --no-tui. make_game's stdout was the console, so the children inherited it (Windows 11 Pro 26300, MSVC 19.44, CMake 3.31 + Ninja from VS Build Tools).

  • The log has the whole build. work/logs/runtime.log has 911 lines:
    • the CMake configure, from The CXX compiler identification to Build files have been written;
    • all 757 ninja steps, [1/757] through [757/757], including vk_pipeline_check.exe;
    • built ...\gta6rt.exe and make_game's own lines.
  • The console matches the log. The last screen of the console matches the end of the log line for line. The only lines that are on screen but not in the log are make_game's closing summary (build: 100% · runtime done, stage logs in …, finished in 4 min), which is printed after the stage ends.
  • Why nothing bypasses the pipe on Windows: the toolchain never sees the console.
    • scripts/build_runtime.ps1 starts cmd/cmake/ninja with -WindowStyle Hidden, redirects their stdout and stderr to _build.stdout.log and _build.stderr.log, and re-emits each line with Write-Output, which goes into this PR's pipe.
    • build_pipeline_check() runs CMake directly only when os.name != "nt". On Windows the pipelines stage uses the vk_pipeline_check.exe that the runtime stage builds.

So the note doesn't affect the build stages on Windows today. A tool that opened CONOUT$ itself would still bypass the pipe, but that is equally true with the board.

AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7168045436 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1378#issuecomment-7168045436). Originally posted by [Diegobecker07](https://github.com/Diegobecker07) on 2026-11-25T16:28:44Z. --- Thanks for the review. I checked the Windows console-handle note on this PR's head (16f3831a5) in a real console: cmd in Windows Terminal running `python -I make_game.py --game <pkg> --out <scratch> --work <scratch> --stages runtime --jobs 12 --no-tui`. make_game's stdout was the console, so the children inherited it (Windows 11 Pro 26300, MSVC 19.44, CMake 3.31 + Ninja from VS Build Tools). - **The log has the whole build.** `work/logs/runtime.log` has 911 lines: - the CMake configure, from `The CXX compiler identification` to `Build files have been written`; - all 757 ninja steps, `[1/757]` through `[757/757]`, including `vk_pipeline_check.exe`; - `built ...\gta6rt.exe` and make_game's own lines. - **The console matches the log.** The last screen of the console matches the end of the log line for line. The only lines that are on screen but not in the log are make_game's closing summary (`build: 100% · runtime done`, `stage logs in …`, `finished in 4 min`), which is printed after the stage ends. - **Why nothing bypasses the pipe on Windows:** the toolchain never sees the console. - `scripts/build_runtime.ps1` starts cmd/cmake/ninja with `-WindowStyle Hidden`, redirects their stdout and stderr to `_build.stdout.log` and `_build.stderr.log`, and re-emits each line with `Write-Output`, which goes into this PR's pipe. - `build_pipeline_check()` runs CMake directly only when `os.name != "nt"`. On Windows the pipelines stage uses the `vk_pipeline_check.exe` that the runtime stage builds. So the note doesn't affect the build stages on Windows today. A tool that opened `CONOUT$` itself would still bypass the pipe, but that is equally true with the board. AI-assisted.
OreoFR commented 2026-11-29 01:20:22 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-29T01:20:22Z.


Verified by OreoFR

  • Base: main 48bae6cad + PR head 16f3831a5 (tested as a merge)
  • Test: none (git merge --no-ff stops)
  • Red on main: -
  • Green with the PR: -
  • Verdict: CONFLICT in README.md (on 48bae6cad and again on 5825b02ff); needs a rebase, not fixed here
  • Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11

AI-assisted (Claude Code, Claude Opus 5.5).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7248717227 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1378#issuecomment-7248717227). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-29T01:20:22Z. --- **Verified by OreoFR** - Base: main `48bae6cad` + PR head `16f3831a5` (tested as a merge) - Test: none (`git merge --no-ff` stops) - Red on main: - - Green with the PR: - - Verdict: CONFLICT in `README.md` (on `48bae6cad` and again on `5825b02ff`); needs a rebase, not fixed here - Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11 AI-assisted (Claude Code, Claude Opus 5.5).
Diegobecker07 commented 2026-11-29 13:59:40 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Diegobecker07 on 2026-11-29T13:59:40Z.


@OreoFR thanks for flagging the conflict. Rebased onto current main (3535eb5c4), new head 24d89be17; it also merges cleanly with 51d343b86, in case you want to re-run your check.

  • Conflicts: README.md: main's README rewrite (a9e247cd6) removed the build section this PR edited, so that hunk is dropped. The stage logs are now described in the make_game.py module docstring and the --no-tui help, which this PR updates. make_game.py: one hunk, where PlainStageLogs now wraps main's run_build_stages(..., sdl3=not a.no_sdl3). The commit message no longer mentions the README. tools/leonida_tui.py is unchanged since the old base, and make_game.py has no new board-capture site (10 before and after).
  • Red/green (MEASURED): tests/test_make_game_plain_logs.py against main's make_game.py gives 9 of 9 errors (AttributeError: no PlainStageLogs). With this PR, 9 of 9 pass.
  • Related tests, one python -I process each: the 59 test files that mention make_game (58 on main), plus compileall and make_game.py --help. All of them pass except test_text_encoding, which fails the same way on plain main 3535eb5c4 (same single offender, under scripts/windows-boot/).
  • End to end (MEASURED, one run): make_game.py --stages runtime --jobs 12 --no-tui, with stdout redirected to a file. <work>/logs/runtime.log has the CMake configure, the ninja steps up to [1269/1270] and built ...gta6rt.exe. The run then went on to main's DirectStorage history step, which was still fitting after 22 minutes when my 30-minute limit on the whole run stopped it. That exercised the failure path too: ERROR: python.exe exited with 143 is the last line of both the console and runtime.log, and the console then prints stage logs in <work>\logs. After trimming whitespace, every console line from the stage is also in the log, and the log has no line the console lacks. Only make_game's three lines before the stage (check, building into) and that closing note are console-only, as intended.
  • Encoding: MSVC's localized warnings come down the pipe in the OEM code page and are decoded with the ANSI one, so their accented characters are garbled in the log. The board's pipe (text=True in leonida_tui.capture_popen_kwargs) decodes them the same way, so this PR matches the board and does not change that.
  • check_no_game_data.py on the 2 changed files: clean.

Tested on: Windows 11 Pro 26300, Python 3.14, Ryzen 9 5900X; the runtime build in the end-to-end run was on an RTX 5070 Ti 16 GB (desktop), driver 621.40. No GPU is needed for the tests themselves.

AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7256957153 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1378#issuecomment-7256957153). Originally posted by [Diegobecker07](https://github.com/Diegobecker07) on 2026-11-29T13:59:40Z. --- @OreoFR thanks for flagging the conflict. Rebased onto current `main` (3535eb5c4), new head 24d89be17; it also merges cleanly with 51d343b86, in case you want to re-run your check. - Conflicts: `README.md`: main's README rewrite (a9e247cd6) removed the build section this PR edited, so that hunk is dropped. The stage logs are now described in the `make_game.py` module docstring and the `--no-tui` help, which this PR updates. `make_game.py`: one hunk, where `PlainStageLogs` now wraps main's `run_build_stages(..., sdl3=not a.no_sdl3)`. The commit message no longer mentions the README. `tools/leonida_tui.py` is unchanged since the old base, and `make_game.py` has no new board-capture site (10 before and after). - Red/green (MEASURED): `tests/test_make_game_plain_logs.py` against main's `make_game.py` gives 9 of 9 errors (`AttributeError`: no `PlainStageLogs`). With this PR, 9 of 9 pass. - Related tests, one `python -I` process each: the 59 test files that mention `make_game` (58 on main), plus `compileall` and `make_game.py --help`. All of them pass except `test_text_encoding`, which fails the same way on plain `main` 3535eb5c4 (same single offender, under `scripts/windows-boot/`). - End to end (MEASURED, one run): `make_game.py --stages runtime --jobs 12 --no-tui`, with stdout redirected to a file. `<work>/logs/runtime.log` has the CMake configure, the ninja steps up to `[1269/1270]` and `built ...gta6rt.exe`. The run then went on to main's DirectStorage history step, which was still fitting after 22 minutes when my 30-minute limit on the whole run stopped it. That exercised the failure path too: `ERROR: python.exe exited with 143` is the last line of both the console and `runtime.log`, and the console then prints `stage logs in <work>\logs`. After trimming whitespace, every console line from the stage is also in the log, and the log has no line the console lacks. Only make_game's three lines before the stage (check, building into) and that closing note are console-only, as intended. - Encoding: MSVC's localized warnings come down the pipe in the OEM code page and are decoded with the ANSI one, so their accented characters are garbled in the log. The board's pipe (`text=True` in `leonida_tui.capture_popen_kwargs`) decodes them the same way, so this PR matches the board and does not change that. - `check_no_game_data.py` on the 2 changed files: clean. Tested on: Windows 11 Pro 26300, Python 3.14, Ryzen 9 5900X; the runtime build in the end-to-end run was on an RTX 5070 Ti 16 GB (desktop), driver 621.40. No GPU is needed for the tests themselves. AI-assisted.
OreoFR commented 2026-11-29 14:47:46 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-29T14:47:46Z.


TAKEN by OreoFR (Windows, RTX 4070 8 GB)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7257582151 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1378#issuecomment-7257582151). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-29T14:47:46Z. --- TAKEN by OreoFR (Windows, RTX 4070 8 GB)
Diegobecker07 commented 2026-11-29 15:32:25 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Diegobecker07 on 2026-11-29T15:32:25Z.


Pushed 48ca87fa2 on top. It fixes a regression of this PR that I measured after the rebase (correction in #2570).

  • Before: PlainStageLogs passed a command's raw bytes to sys.stdout.buffer, which takes UTF-8 on a Windows console. Non-ASCII text that a command wrote in its own code page showed up as U+FFFD on screen. On main, --no-tui shows it right, because the command inherits the console. MEASURED in a hidden console (OEM 850 / ANSI 1252), one run: a child writing cp850 n\xc6o par\x83metro showed n�o par�metro.
  • Now: run() decodes the output once as it comes in. It uses an incremental decoder, so a character split between two reads stays whole. The same text goes to the console, encoded for sys.stdout with errors="replace", and to the log. The encoding is the one the caller names with run(..., encoding=); otherwise it is what a text-mode pipe decodes with, as on the board. Same probe, MEASURED: with no encoding named, the screen shows what the log and the board show (nÆo parƒmetro for that cp850 child, no U+FFFD). With encoding="cp850", the screen and the log both show não parâmetro.
  • Tests: three new ones in tests/test_make_game_plain_logs.py: the caller's encoding on the console and in the log, a UTF-8 character split between reads, and a character the console's code page lacks. All 12 tests pass (3 runs); the three new ones fail on the previous head 24d89be17. The 59 test files that mention make_game, plus compileall and --help, give the same results as before: only test_text_encoding fails, and it is red on main too.
  • Related: MAKE-GAME-RUNTIME-LOG-UTF8 (claim, branch; its pull request waits for a free slot under the open-PR limit) makes build_runtime.ps1 write UTF-8 and names that encoding. With both in, the runtime build's text is right on the board and with --no-tui, and the two merge cleanly in either order. Until it lands, --no-tui shows the runtime build's accented MSVC text the way the board does.

AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7258169697 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1378#issuecomment-7258169697). Originally posted by [Diegobecker07](https://github.com/Diegobecker07) on 2026-11-29T15:32:25Z. --- Pushed 48ca87fa2 on top. It fixes a regression of this PR that I measured after the rebase ([correction in #2570](https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7257216236)). - Before: `PlainStageLogs` passed a command's raw bytes to `sys.stdout.buffer`, which takes UTF-8 on a Windows console. Non-ASCII text that a command wrote in its own code page showed up as U+FFFD on screen. On `main`, `--no-tui` shows it right, because the command inherits the console. MEASURED in a hidden console (OEM 850 / ANSI 1252), one run: a child writing cp850 `n\xc6o par\x83metro` showed `n�o par�metro`. - Now: `run()` decodes the output once as it comes in. It uses an incremental decoder, so a character split between two reads stays whole. The same text goes to the console, encoded for `sys.stdout` with `errors="replace"`, and to the log. The encoding is the one the caller names with `run(..., encoding=)`; otherwise it is what a text-mode pipe decodes with, as on the board. Same probe, MEASURED: with no encoding named, the screen shows what the log and the board show (`nÆo parƒmetro` for that cp850 child, no U+FFFD). With `encoding="cp850"`, the screen and the log both show `não parâmetro`. - Tests: three new ones in `tests/test_make_game_plain_logs.py`: the caller's encoding on the console and in the log, a UTF-8 character split between reads, and a character the console's code page lacks. All 12 tests pass (3 runs); the three new ones fail on the previous head 24d89be17. The 59 test files that mention `make_game`, plus `compileall` and `--help`, give the same results as before: only `test_text_encoding` fails, and it is red on `main` too. - Related: MAKE-GAME-RUNTIME-LOG-UTF8 ([claim](https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7257218055), [branch](https://github.com/Diegobecker07/leonida/tree/make-game-runtime-log-utf8); its pull request waits for a free slot under the open-PR limit) makes `build_runtime.ps1` write UTF-8 and names that encoding. With both in, the runtime build's text is right on the board and with `--no-tui`, and the two merge cleanly in either order. Until it lands, `--no-tui` shows the runtime build's accented MSVC text the way the board does. AI-assisted.
OreoFR commented 2026-11-29 15:47:45 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-29T15:47:45Z.


Verified by OreoFR — READY

  • Base: main bd643e46e + this PR (head 48ca87fa2, the rebase 24d89be17 plus the decoded-text commit) merged with --no-ff, no conflict. The earlier README.md conflict is gone.
  • Red (the PR's test copied onto main): python -I tests/test_make_game_plain_logs.py gives 12/12 errors (AttributeError, no PlainStageLogs).
  • Green (merge): 12/12 OK.
  • Related, one python -I process each, merge vs main: the 28 tests/test_make_game_*.py files plus test_text_write_line_endings.py, compileall and make_game.py --help. Same result on both: everything passes except test_make_game_preflight.py, which hit my 600 s timeout on main as well (shared, busy CPU). test_make_game_translation_completeness.py failed once on the merge while the disk was full, then passed 5/5 on a rerun on both.
  • Diff read: no issue. Only build-stage commands without their own pipes go through PlainStageLogs.run. The board path and check/preflight are unchanged. One leftover from the earlier review: input=/timeout= would reach Popen and raise TypeError, but no caller passes them.
  • Not run: an end-to-end --no-tui build (no game package used here).
  • Machine: Windows 11, Intel Core Ultra 7 155H, RTX 4070 Laptop 8 GB, NVIDIA 621.40, Python 3.12.10, MSVC 19.44

AI-assisted (Claude Code, Claude Opus 5.5), run for OreoFR.

Ready to merge per the maintainers' plan (green, no conflict, tested).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7258373791 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1378#issuecomment-7258373791). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-29T15:47:45Z. --- **Verified by OreoFR** — READY - Base: main bd643e46e + this PR (head 48ca87fa2, the rebase 24d89be17 plus the decoded-text commit) merged with --no-ff, no conflict. The earlier README.md conflict is gone. - Red (the PR's test copied onto main): `python -I tests/test_make_game_plain_logs.py` gives 12/12 errors (`AttributeError`, no `PlainStageLogs`). - Green (merge): 12/12 OK. - Related, one `python -I` process each, merge vs main: the 28 `tests/test_make_game_*.py` files plus `test_text_write_line_endings.py`, `compileall` and `make_game.py --help`. Same result on both: everything passes except `test_make_game_preflight.py`, which hit my 600 s timeout on main as well (shared, busy CPU). `test_make_game_translation_completeness.py` failed once on the merge while the disk was full, then passed 5/5 on a rerun on both. - Diff read: no issue. Only build-stage commands without their own pipes go through `PlainStageLogs.run`. The board path and `check`/preflight are unchanged. One leftover from the earlier review: `input=`/`timeout=` would reach `Popen` and raise `TypeError`, but no caller passes them. - Not run: an end-to-end `--no-tui` build (no game package used here). - Machine: Windows 11, Intel Core Ultra 7 155H, RTX 4070 Laptop 8 GB, NVIDIA 621.40, Python 3.12.10, MSVC 19.44 AI-assisted (Claude Code, Claude Opus 5.5), run for OreoFR. Ready to merge per the maintainers' plan (green, no conflict, tested).
DadaCap commented 2026-11-29 18:27:45 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by DadaCap on 2026-11-29T18:27:45Z.


Thank you! Merged into main with a merge commit. It was verified ready on its current head (48ca87fa2) by OreoFR's Windows agent (RTX 4070, Windows 11); see the verification comment above. (AI-assisted, posted for DadaCap.)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7260501583 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1378#issuecomment-7260501583). Originally posted by [DadaCap](https://github.com/DadaCap) on 2026-11-29T18:27:45Z. --- Thank you! Merged into `main` with a merge commit. It was verified ready on its current head (48ca87fa2) by OreoFR's Windows agent (RTX 4070, Windows 11); see the verification comment above. (AI-assisted, posted for DadaCap.)
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!1378
No description provided.