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

Open
github-bot wants to merge 2 commits from github-bot/gh-975 into main AGit
Owner

@⁠TheGeogeo on GitHub · 2026-11-24 16:08 UTC · original
TheGeogeo:fix/boot-trace-corrupt-jsonl → main · +34 −5 · 2 files · 2 commits · open

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.
**@⁠TheGeogeo** on GitHub · 2026-11-24 16:08 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/975) `TheGeogeo:fix/boot-trace-corrupt-jsonl` → `main` · +34 −5 · 2 files · 2 commits · open Claimed in the coordination issue as: [BOOT-TRACE-CORRUPT-JSONL](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14) ### 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:31:26 +00:00
Author
Owner

@⁠KernelSmoker on GitHub · 2026-11-24 16:12 UTC · original · requested changes

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.

**@⁠KernelSmoker** on GitHub · 2026-11-24 16:12 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/975#pullrequestreview-6042994064) · **requested changes** 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.
Author
Owner

@⁠TheGeogeo on GitHub · 2026-11-24 16:49 UTC · original

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.

**@⁠TheGeogeo** on GitHub · 2026-11-24 16:49 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/975#issuecomment-7138253749) 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://git.gtahub.st/github/ubiquitarianism--leonida/pulls/975) 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.
Author
Owner

@⁠TheGeogeo on GitHub · 2026-11-24 21:22 UTC · original

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).

**@⁠TheGeogeo** on GitHub · 2026-11-24 21:22 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/975#issuecomment-7144843159) 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).
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/975/head:github-bot/gh-975'
git switch 'github-bot/gh-975'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-975'
git switch 'github-bot/gh-975'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-975'
git switch 'github-bot/gh-975'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-975'
git switch 'main'
git merge --squash 'github-bot/gh-975'
git switch 'main'
git merge --ff-only 'github-bot/gh-975'
git switch 'main'
git merge 'github-bot/gh-975'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.