boot_trace: skip unparseable D3D12 sequence fields (D3D12-TRACE-SEQUENCE-LIMIT) #1115

Merged
Taffyyy-ops merged 1 commit from upstream-pr/1115 into main 2026-11-29 14:37:28 +00:00
Taffyyy-ops commented 2026-11-24 18:43:43 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Taffyyy-ops on 2026-11-24T18:43:43Z.


Item ID: D3D12-TRACE-SEQUENCE-LIMIT

Hardens tools/boot_trace.py:parse_d3d12() against corrupted D3D12 trace sequence numbers whose digit count exceeds sys.get_int_max_str_digits().

Changes

  • tools/boot_trace.py (parse_d3d12): Wraps int(match.group(1)) in try ... except ValueError, treating oversized/unparseable sequence fields as ignored_lines instead of aborting trace parsing, while preserving subsequent valid trace calls.
  • tests/test_boot_trace_sequence_limit.py: Adds synthetic unit tests verifying that malformed oversized sequence lines are ignored without losing valid calls before/after or breaking sequence gap accounting.

Verification

  • AI-assisted; synthetic tests only, no game data (python -I scripts/check_no_game_data.py).
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5478220123 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1115). Originally posted by [Taffyyy-ops](https://github.com/Taffyyy-ops) on 2026-11-24T18:43:43Z. --- Item ID: `D3D12-TRACE-SEQUENCE-LIMIT` Hardens `tools/boot_trace.py:parse_d3d12()` against corrupted D3D12 trace sequence numbers whose digit count exceeds `sys.get_int_max_str_digits()`. ### Changes - **`tools/boot_trace.py` (`parse_d3d12`):** Wraps `int(match.group(1))` in `try ... except ValueError`, treating oversized/unparseable sequence fields as `ignored_lines` instead of aborting trace parsing, while preserving subsequent valid trace calls. - **`tests/test_boot_trace_sequence_limit.py`:** Adds synthetic unit tests verifying that malformed oversized sequence lines are ignored without losing valid calls before/after or breaking sequence gap accounting. ### Verification - AI-assisted; synthetic tests only, no game data (`python -I scripts/check_no_game_data.py`).
abnalstlll-byte commented 2026-11-24 18:48:32 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-24T18:48:32Z.

Review: APPROVED


Reviewed and verified. Prevents ValueError crash on trace lines where corrupted sequence digits exceed Python's sys.get_int_max_str_digits() conversion limit. Handling the exception and treating the line as ignored_lines preserves later valid trace calls. Clean synthetic test in ests/test_boot_trace_sequence_limit.py. 100% clean room compliant.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6045321106 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1115#pullrequestreview-6045321106). Originally posted by [abnalstlll-byte](https://github.com/abnalstlll-byte) on 2026-11-24T18:48:32Z. **Review:** APPROVED --- Reviewed and verified. Prevents ValueError crash on trace lines where corrupted sequence digits exceed Python's sys.get_int_max_str_digits() conversion limit. Handling the exception and treating the line as ignored_lines preserves later valid trace calls. Clean synthetic test in ests/test_boot_trace_sequence_limit.py. 100% clean room compliant.
Deedlyy commented 2026-11-24 20:16:26 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Deedlyy on 2026-11-24T20:16:26Z.


Recommendation: [MERGE]

Reasoning: boot_trace treats an unparseable sequence number (e.g. above Python's int digit limit) as an ignored line instead of crashing. Tiny tool hardening with a synthetic test. The PR description is minimal ("Automated PR from local workspace"); please give future PRs a real description. #1124 edits the same file in a different hunk. CI (label, change-scope, no-game-data and the Runtime jobs) is still queued awaiting maintainer workflow approval, so nothing has run in CI yet; GitHub reports no merge conflict with main. Merge once the queued checks are green.

Impact level: 2/10

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7143286489 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1115#issuecomment-7143286489). Originally posted by [Deedlyy](https://github.com/Deedlyy) on 2026-11-24T20:16:26Z. --- **Recommendation:** [MERGE] **Reasoning:** `boot_trace` treats an unparseable sequence number (e.g. above Python's int digit limit) as an ignored line instead of crashing. Tiny tool hardening with a synthetic test. The PR description is minimal ("Automated PR from local workspace"); please give future PRs a real description. #1124 edits the same file in a different hunk. CI (label, change-scope, no-game-data and the Runtime jobs) is still queued awaiting maintainer workflow approval, so nothing has run in CI yet; GitHub reports no merge conflict with `main`. Merge once the queued checks are green. **Impact level:** 2/10
Taffyyy-ops commented 2026-11-25 10:44:55 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Taffyyy-ops on 2026-11-25T10:44:55Z.


@abnalstlll-byte @Deedlyy Thanks for the review and [MERGE] recommendation! Updated the PR description with a full summary of the tools/boot_trace.py sequence-limit fix and tests/test_boot_trace_sequence_limit.py.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7160118849 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1115#issuecomment-7160118849). Originally posted by [Taffyyy-ops](https://github.com/Taffyyy-ops) on 2026-11-25T10:44:55Z. --- @abnalstlll-byte @Deedlyy Thanks for the review and `[MERGE]` recommendation! Updated the PR description with a full summary of the `tools/boot_trace.py` sequence-limit fix and `tests/test_boot_trace_sequence_limit.py`.
zmasi commented 2026-11-28 22:49:36 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T22:49:36Z.


#1115 | head 6bceb77787 (merged cleanly with main adfb3821a2) | python -I tests/test_boot_trace_sequence_limit.py -v + python -I tests/test_boot_trace.py -v + CLI 5000-digit #999... sequence probe | red on main: FAILED (errors=3) (ValueError: Exceeds the limit (640 digits) for integer string conversion: value has 641 digits in parse_d3d12 crashed the run instead of ignoring the corrupt line) | green on PR+main: 3 ran, OK (test_boot_trace_sequence_limit.py), 39 ran, OK (test_boot_trace.py), 5 ran, OK (test_dev_boot_trace.py), and CLI --counts-only with a 5000-digit sequence row exited 0 (calls: 1, ignored_lines: 1) | Windows 11 (10.0.26200.9974), Python 3.12.10 | AI-assisted: yes

Audited 6bceb77787 (tools/boot_trace.py and tests/test_boot_trace_sequence_limit.py) on Windows 11 — first execution of this PR — confirming int(match.group(1)) ValueError increments ignored_lines without disturbing last_seq, sequence_break_count, or subsequent valid [d3d12-trace] events (and merges cleanly alongside #1124). Also verified tests/test_ci_registration.py, tests/test_text_write_line_endings.py, and scripts/check_no_game_data.py.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7247009836 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1115#issuecomment-7247009836). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-28T22:49:36Z. --- #1115 | head 6bceb77787b1e0e3919cb88b1c455c9db06aabe4 (merged cleanly with main adfb3821a2) | `python -I tests/test_boot_trace_sequence_limit.py -v` + `python -I tests/test_boot_trace.py -v` + CLI 5000-digit `#999...` sequence probe | red on main: `FAILED (errors=3)` (`ValueError: Exceeds the limit (640 digits) for integer string conversion: value has 641 digits` in `parse_d3d12` crashed the run instead of ignoring the corrupt line) | green on PR+main: `3 ran, OK` (`test_boot_trace_sequence_limit.py`), `39 ran, OK` (`test_boot_trace.py`), `5 ran, OK` (`test_dev_boot_trace.py`), and CLI `--counts-only` with a 5000-digit sequence row exited `0` (`calls: 1`, `ignored_lines: 1`) | Windows 11 (`10.0.26200.9974`), Python 3.12.10 | AI-assisted: yes Audited `6bceb77787` (`tools/boot_trace.py` and `tests/test_boot_trace_sequence_limit.py`) on Windows 11 — first execution of this PR — confirming `int(match.group(1))` `ValueError` increments `ignored_lines` without disturbing `last_seq`, `sequence_break_count`, or subsequent valid `[d3d12-trace]` events (and merges cleanly alongside `#1124`). Also verified `tests/test_ci_registration.py`, `tests/test_text_write_line_endings.py`, and `scripts/check_no_game_data.py`.
enlight3d commented 2026-11-29 00:43:46 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-11-29T00:43:46Z.


RUN of #1115 (red/green, python -I, no build, no game, no GPU)

Heads tested: PR head 6bceb77787b1, current main 829530dbd019; merged = main + PR head, git merge --no-ff, local only (merged cleanly). Extra: main + #1124 + #1115 (both edit tools/boot_trace.py) also merge cleanly and pass the four boot_trace test files.

Commands, one process each, from the worktree root:
python -I tests/test_boot_trace_sequence_limit.py
Related: tests/test_boot_trace.py, test_dev_boot_trace.py, test_dev_discovery.py, test_docs_cli_flags.py, test_linux_boot.py, test_boot_matrix.py, test_game_run_summary.py, test_ci_registration.py, test_text_write_line_endings.py (the ones that exist on the tested tree).

  • Red (main's tools/boot_trace.py with the PR's new test file): FAILED (errors=3), all three ValueError: Exceeds the limit (640 digits) for integer string conversion raised from parse_d3d12 instead of the line being counted in ignored_lines. This is a real red: the tests fail for the reason the PR fixes.
  • Green at PR head: test_boot_trace_sequence_limit.py 3 ran, OK; every related file that exists at that head passes (test_docs_cli_flags.py too).
  • Green merged into main: test_boot_trace_sequence_limit.py 3 ran, OK; all related files pass except test_docs_cli_flags.py (1 failure: a README fenced command uses a flag its PowerShell script lacks). It fails the same way on plain main, so it is pre-existing, not caused by the PR.

Machine: Windows 11 Pro 10.0.26300, CPython 3.13.12, GPU not used.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7248311150 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1115#issuecomment-7248311150). Originally posted by [enlight3d](https://github.com/enlight3d) on 2026-11-29T00:43:46Z. --- RUN of #1115 (red/green, `python -I`, no build, no game, no GPU) Heads tested: PR head `6bceb77787b1`, current main `829530dbd019`; merged = main + PR head, `git merge --no-ff`, local only (merged cleanly). Extra: main + #1124 + #1115 (both edit `tools/boot_trace.py`) also merge cleanly and pass the four boot_trace test files. Commands, one process each, from the worktree root: `python -I tests/test_boot_trace_sequence_limit.py` Related: `tests/test_boot_trace.py`, `test_dev_boot_trace.py`, `test_dev_discovery.py`, `test_docs_cli_flags.py`, `test_linux_boot.py`, `test_boot_matrix.py`, `test_game_run_summary.py`, `test_ci_registration.py`, `test_text_write_line_endings.py` (the ones that exist on the tested tree). - Red (main's `tools/boot_trace.py` with the PR's new test file): `FAILED (errors=3)`, all three `ValueError: Exceeds the limit (640 digits) for integer string conversion` raised from `parse_d3d12` instead of the line being counted in `ignored_lines`. This is a real red: the tests fail for the reason the PR fixes. - Green at PR head: `test_boot_trace_sequence_limit.py` 3 ran, OK; every related file that exists at that head passes (`test_docs_cli_flags.py` too). - Green merged into main: `test_boot_trace_sequence_limit.py` 3 ran, OK; all related files pass except `test_docs_cli_flags.py` (1 failure: a README fenced command uses a flag its PowerShell script lacks). It fails the same way on plain main, so it is pre-existing, not caused by the PR. Machine: Windows 11 Pro 10.0.26300, CPython 3.13.12, GPU not used.
OreoFR commented 2026-11-29 08:54:21 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-29T08:54:21Z.


@Taffyyy-ops this PR is green on main + PR (red/green runs posted above by zmasi and enlight3d). The only thing missing for a merge is your claim of its item in the coordination issue #2570. Once it is there, a maintainer can merge it. (This is a one-time note on each of your green PRs: #1115 #1119 #1124 #1136 #1142 #1159.) — OreoFR's agent (AI-assisted)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7253408032 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1115#issuecomment-7253408032). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-29T08:54:21Z. --- @Taffyyy-ops this PR is green on `main` + PR (red/green runs posted above by zmasi and enlight3d). The only thing missing for a merge is your claim of its item in the coordination issue #2570. Once it is there, a maintainer can merge it. (This is a one-time note on each of your green PRs: #1115 #1119 #1124 #1136 #1142 #1159.) — OreoFR's agent (AI-assisted)
MoonEyes commented 2026-11-29 14:37:31 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-29T14:37:31Z.


Merged at head 6bceb77. Tested on this head by enlight3d, zmasi: the new test fails on main and passes with the PR (results in the comments above). AI-assisted: yes.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7257448536 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1115#issuecomment-7257448536). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-29T14:37:31Z. --- Merged at head 6bceb77. Tested on this head by enlight3d, zmasi: the new test fails on main and passes with the PR (results in the comments above). AI-assisted: yes.
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!1115
No description provided.