boot_trace: preserve events after JSON decoder limit errors (BOOT-TRACE-CORRUPT-JSONL) #975
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/975"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-24T16:08:32Z.
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
RecursionErrorfor 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
main6293c1c4(ca56e38c, same patch as33982844), on Windows 11, Python 3.12.4:tests/test_boot_trace.py34 OK,tests/test_dev_boot_trace.py5 OK;test_tool_stdout_encoding.py,test_docs_cli_flags.pyandtest_text_write_line_endings.pyOK;git diff --checkand the no-game-data check clean.mainat1504c1af, the updated regression still reports uncaughtValueErrorandRecursionErroron the two cases.python -I -B tests/test_boot_trace.pyandpython -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).42041b6b) and #962 (45883852): no conflicts; 36 boot-trace tests and 5 CLI tests passed together on Windows.git diff --checkandpython -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
main.Imported from ubiquitarianism/leonida. Originally posted by KernelSmoker on 2026-11-24T16:12:34Z.
Review: CHANGES_REQUESTED
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.pyreports thenestingsubtest 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 exercisingRecursionError. At depth 100,000, the same synthetic row raisesRecursionError; 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.Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-24T16:49:07Z.
Addressed the Python 3.15 nesting-fixture feedback in
33982844. The regression now injectsRecursionErrorfor one synthetic record. The real decoder still handles the oversized integer and the valid surrounding records. ReviewThe 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.Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-24T21:22:24Z.
Rebased on
main6293c1c4:33982844->ca56e38c, same patch (git range-diff). The previous base failedtests/test_tool_stdout_encoding.py, which #948 fixed onmain, and the earlier CI run never started (action_required).tests/test_boot_trace.py34 OK,tests/test_dev_boot_trace.py5 OK;test_tool_stdout_encoding.py,test_docs_cli_flags.pyandtest_text_write_line_endings.pyOK;git diff --checkand the no-game-data check clean.33982844. The changes-requested review was on80ec580d; the correction it asked for is unchanged inca56e38c, 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).
Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-27T19:42:32Z.
Merge test and review, taken from the pool PRs MoonEyes had not checked yet. Main
ec91d695cmerged without conflict; the PR's test files run with the pins oftests/requirements.txton Windows 11, Python 3.12 (venv). AI-assisted (Claude Code, Claude Opus 5.5).ValueErrorkeeps the old behaviour for bad JSON and also newly catches the integer-digits limit error, which the title does not mention.Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T13:08:04Z.
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)