boot_trace: preserve events after JSON decoder limit errors (BOOT-TRACE-CORRUPT-JSONL) #975

Merged
leonida/mandy
TheGeogeo merged 2 commits from fix/boot-trace-corrupt-jsonl into main 2026-11-28 13:08:09 +00:00

Pull request successfully merged and closed

TheGeogeo commented 2026-11-24 16:08:32 +00:00

Claimed in the coordination issue as: BOOT-TRACE-CORRUPT-JSONL

What and why

A startup trace is a sequence of independent JSON records. A record that hits Python's integer or nesting limit used to abort the entire summary. Count these decoder errors through the existing bad-line path so later valid events remain available. The regression uses a real oversized integer and injects RecursionError for one synthetic row so the test works across different decoder nesting limits. The two surrounding rows use the real decoder.

Tested

After a rebase on main 6293c1c4 (ca56e38c, same patch as 33982844), on Windows 11, Python 3.12.4: tests/test_boot_trace.py 34 OK, tests/test_dev_boot_trace.py 5 OK; test_tool_stdout_encoding.py, test_docs_cli_flags.py and test_text_write_line_endings.py OK; git diff --check and the no-game-data check clean.

  • On main at 1504c1af, the updated regression still reports uncaught ValueError and RecursionError on the two cases.
  • python -I -B tests/test_boot_trace.py and python -I -B tests/test_dev_boot_trace.py: 33 and 5 passed on Windows (Python 3.10.10 and 3.12.4) and Debian WSL (Python 3.11.2).
  • Isolated merge with #498 (42041b6b) and #962 (45883852): no conflicts; 36 boot-trace tests and 5 CLI tests passed together on Windows.
  • git diff --check and python -I -B scripts/check_no_game_data.py tools/boot_trace.py tests/test_boot_trace.py: passed.

GPUs tested: n/a. CPU-only synthetic traces.

AI-assisted: Yes, Codex.

Checklist

  • Based on current main.
  • One topic.
  • No game data, keys, or decryption.
  • Translator contract entry: not applicable.
Claimed in the coordination issue as: [BOOT-TRACE-CORRUPT-JSONL](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7137106338) ### What and why A startup trace is a sequence of independent JSON records. A record that hits Python's integer or nesting limit used to abort the entire summary. Count these decoder errors through the existing bad-line path so later valid events remain available. The regression uses a real oversized integer and injects `RecursionError` for one synthetic row so the test works across different decoder nesting limits. The two surrounding rows use the real decoder. ### Tested After a rebase on `main` `6293c1c4` (`ca56e38c`, same patch as `33982844`), on Windows 11, Python 3.12.4: `tests/test_boot_trace.py` 34 OK, `tests/test_dev_boot_trace.py` 5 OK; `test_tool_stdout_encoding.py`, `test_docs_cli_flags.py` and `test_text_write_line_endings.py` OK; `git diff --check` and the no-game-data check clean. - On `main` at `1504c1af`, the updated regression still reports uncaught `ValueError` and `RecursionError` on the two cases. - `python -I -B tests/test_boot_trace.py` and `python -I -B tests/test_dev_boot_trace.py`: 33 and 5 passed on Windows (Python 3.10.10 and 3.12.4) and Debian WSL (Python 3.11.2). - Isolated merge with #498 (`42041b6b`) and #962 (`45883852`): no conflicts; 36 boot-trace tests and 5 CLI tests passed together on Windows. - `git diff --check` and `python -I -B scripts/check_no_game_data.py tools/boot_trace.py tests/test_boot_trace.py`: passed. GPUs tested: n/a. CPU-only synthetic traces. AI-assisted: Yes, Codex. ### Checklist - [x] Based on current `main`. - [x] One topic. - [x] No game data, keys, or decryption. - Translator contract entry: not applicable.
KernelSmoker reviewed 2026-11-24 16:12:34 +00:00
KernelSmoker left a comment
No description provided.
On the submitted head `80ec580d23a0438d83b1cc5c753195237d9a77ae`, the new regression fails on the project-supported Fedora Python 3.15.2: `python3 -I -B tests/test_boot_trace.py` reports the `nesting` subtest got 3 events instead of 2. Its 10,000 nested arrays are still accepted by this interpreter, so the fixture row is counted as a valid event rather than exercising `RecursionError`. At depth 100,000, the same synthetic row raises `RecursionError`; the changed parser handles it as intended (2 valid events, bad line 2, later exit code 0). Please increase or otherwise adapt the nesting fixture so the decoder-limit test triggers reliably across supported Python versions, then rerun the boot-trace suite.
TheGeogeo commented 2026-11-24 16:49:07 +00:00

Addressed the Python 3.15 nesting-fixture feedback in 33982844. The regression now injects RecursionError for one synthetic record. The real decoder still handles the oversized integer and the valid surrounding records. Review

The boot-trace and CLI suites passed 33 and 5 tests, respectively, on Windows with Python 3.10.10 and 3.12.4 and on Debian WSL with Python 3.11.2. On the original base 1504c1af, the updated regression still fails on both uncaught exceptions.

Addressed the Python 3.15 nesting-fixture feedback in `33982844`. The regression now injects `RecursionError` for one synthetic record. The real decoder still handles the oversized integer and the valid surrounding records. [Review](https://github.com/ubiquitarianism/leonida/pull/975#pullrequestreview-6042994064) The boot-trace and CLI suites passed 33 and 5 tests, respectively, on Windows with Python 3.10.10 and 3.12.4 and on Debian WSL with Python 3.11.2. On the original base `1504c1af`, the updated regression still fails on both uncaught exceptions.
TheGeogeo commented 2026-11-24 21:22:24 +00:00

Rebased on main 6293c1c4: 33982844 -> ca56e38c, same patch (git range-diff). The previous base failed tests/test_tool_stdout_encoding.py, which #948 fixed on main, and the earlier CI run never started (action_required).

  • Windows 11, Python 3.12.4, after the rebase: tests/test_boot_trace.py 34 OK, tests/test_dev_boot_trace.py 5 OK; test_tool_stdout_encoding.py, test_docs_cli_flags.py and test_text_write_line_endings.py OK; git diff --check and the no-game-data check clean.
  • My previous comment was for 33982844. The changes-requested review was on 80ec580d; the correction it asked for is unchanged in ca56e38c, and a new look is welcome. Python 3.15 was not run.

No code change in this rebase. CI on the new head is still queued.

AI-assisted: yes (Claude Code).

Rebased on `main` `6293c1c4`: `33982844` -> `ca56e38c`, same patch (`git range-diff`). The previous base failed `tests/test_tool_stdout_encoding.py`, which #948 fixed on `main`, and the earlier CI run never started (action_required). - Windows 11, Python 3.12.4, after the rebase: `tests/test_boot_trace.py` 34 OK, `tests/test_dev_boot_trace.py` 5 OK; `test_tool_stdout_encoding.py`, `test_docs_cli_flags.py` and `test_text_write_line_endings.py` OK; `git diff --check` and the no-game-data check clean. - My previous comment was for `33982844`. The changes-requested review was on `80ec580d`; the correction it asked for is unchanged in `ca56e38c`, and a new look is welcome. Python 3.15 was not run. No code change in this rebase. CI on the new head is still queued. AI-assisted: yes (Claude Code).
OreoFR commented 2026-11-27 19:42:32 +00:00

Merge test and review, taken from the pool PRs MoonEyes had not checked yet. Main ec91d695c merged without conflict; the PR's test files run with the pins of tests/requirements.txt on Windows 11, Python 3.12 (venv). AI-assisted (Claude Code, Claude Opus 5.5).

  • Tests: with the PR 35 passed; against main: 2 failed. The fix is shown.
  • Nit: catching ValueError keeps the old behaviour for bad JSON and also newly catches the integer-digits limit error, which the title does not mention.
Merge test and review, taken from the pool PRs MoonEyes had not checked yet. Main ec91d695c merged without conflict; the PR's test files run with the pins of `tests/requirements.txt` on Windows 11, Python 3.12 (venv). AI-assisted (Claude Code, Claude Opus 5.5). - **Tests:** with the PR 35 passed; against main: 2 failed. The fix is shown. - Nit: catching `ValueError` keeps the old behaviour for bad JSON and also newly catches the integer-digits limit error, which the title does not mention.
MoonEyes commented 2026-11-28 13:08:04 +00:00

Red/green: tests/test_boot_trace.py 2 failed on main, 35 passed with the PR.
Targeted batch of 30 PRs (their tests, the tests importing the changed modules, the docs tests, the translator suite) on main a997a3c: no new failure, Windows 11 / Python.
AI-assisted (Claude Code, Claude Opus 5.5)

Red/green: tests/test_boot_trace.py 2 failed on main, 35 passed with the PR. Targeted batch of 30 PRs (their tests, the tests importing the changed modules, the docs tests, the translator suite) on main a997a3c: no new failure, Windows 11 / Python. AI-assisted (Claude Code, Claude Opus 5.5)
Sign in to join this conversation.
No description provided.