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

Merged
leonida/mandy
Taffyyy-ops merged 1 commit from fix/d3d12-trace-sequence-limit into main 2026-11-29 14:37:28 +00:00

Pull request successfully merged and closed

Taffyyy-ops commented 2026-11-24 18:43:43 +00:00

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).
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 approved these changes 2026-11-24 18:48:32 +00:00
abnalstlll-byte left a comment

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.

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

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

**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

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

@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

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

#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

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.

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

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

@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

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.

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 description provided.