boot_trace: summarize Vulkan pipeline waits and compilation #2369

Open
github-bot wants to merge 1 commit from github-bot/gh-2369 into main AGit
Owner

@⁠plamea on GitHub · 2026-11-26 16:14 UTC · original
plamea:boot-trace-pipeline-timing → main · +102 −2 · 3 files · 1 commits · open

Claimed as BOOT-TRACE-PIPELINE-TIMING in the coordination issue.

Summary

  • Read the existing pipeline diagnostics when LEONIDA_TRACE_PIPELINE_COMPILE=1 is used in a D3D12 trace.
  • Report separate maxima for Vulkan compilation and caller waits. Match starts to completions by worker, trigger, variant and key so overlapping jobs can be counted independently.
  • Include numeric totals in --counts-only without pipeline keys or shader names. Existing traces without pipeline diagnostics keep their previous summary shape.

Verification

  • 35 boot-trace tests and five dev-wrapper tests passed. The regression fixture covers overlapping jobs, incomplete traces, non-success results and the counts-only output.
  • Eight targeted runtime tests passed on native Windows 11, NVIDIA RTX 3050 Laptop GPU (4 GiB), driver 621.24. A Vulkan translated-draw fixture independently compared all 4,096 pixels and produced a trace with one completed cache-hit pipeline build and one recorded caller wait. The parser matched the timing fields in that trace.
  • Translator regression suite: 500 files, 6,365 tests, 0 failed files.
  • Game-data check passed for the three changed files.

AI-assisted with Codex. The traces used to verify this change came from synthetic tests.

**@⁠plamea** on GitHub · 2026-11-26 16:14 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2369) `plamea:boot-trace-pipeline-timing` → `main` · +102 −2 · 3 files · 1 commits · open Claimed as BOOT-TRACE-PIPELINE-TIMING in the [coordination issue](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/1608). ## Summary - Read the existing pipeline diagnostics when `LEONIDA_TRACE_PIPELINE_COMPILE=1` is used in a D3D12 trace. - Report separate maxima for Vulkan compilation and caller waits. Match starts to completions by worker, trigger, variant and key so overlapping jobs can be counted independently. - Include numeric totals in `--counts-only` without pipeline keys or shader names. Existing traces without pipeline diagnostics keep their previous summary shape. ## Verification - 35 boot-trace tests and five dev-wrapper tests passed. The regression fixture covers overlapping jobs, incomplete traces, non-success results and the counts-only output. - Eight targeted runtime tests passed on native Windows 11, NVIDIA RTX 3050 Laptop GPU (4 GiB), driver 621.24. A Vulkan translated-draw fixture independently compared all 4,096 pixels and produced a trace with one completed cache-hit pipeline build and one recorded caller wait. The parser matched the timing fields in that trace. - Translator regression suite: 500 files, 6,365 tests, 0 failed files. - Game-data check passed for the three changed files. AI-assisted with Codex. The traces used to verify this change came from synthetic tests.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 16:17:37 +00:00
Author
Owner

@⁠KushGene on GitHub · 2026-11-26 16:17 UTC · original

Independent verification on Linux (Ubuntu/Fedora host, Python 3.15.2, CPU only, no game files), tested in a clean detached worktree at main 246791612 with PR #2369 head d04d24796:

  • Clean apply: git apply --check / git apply applied cleanly with zero conflicts.
  • Before fix (new test on unpatched main): python3 -I tests/test_boot_trace.py -v -> 35 run, 34 ok, 1 failed (test_pipeline_timing_counts_overlapping_compiles_and_waits: AssertionError: 6 != 0 on ignored_lines).
  • After fix:
    • python3 -I tests/test_boot_trace.py -v -> 35/35 passed.
    • python3 -I tests/test_docs_links.py -> 17/17 passed.
    • python3 -I tests/test_ci_registration.py -> 16/16 passed.
    • python3 -I tests/test_text_write_line_endings.py -> 3/3 passed.
    • python3 -m compileall -q make_game.py tools tests -> exit 0.
    • python3 -I scripts/check_no_game_data.py docs/first_run_ui.md tests/test_boot_trace.py tools/boot_trace.py -> exit 0.
    • git diff --check -> clean.

Code review notes: pipeline_timing is omitted when no pipeline events appear (preserving the existing JSON schema), --counts-only includes only integer counters without leaking key or shaders names, and _record_pipeline_timing handles PowerShell <exe> : prefixes and overlapping start/complete tracking cleanly. No issues found.

AI-assisted: yes (Antigravity)

**@⁠KushGene** on GitHub · 2026-11-26 16:17 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2369#issuecomment-7197444799) Independent verification on Linux (Ubuntu/Fedora host, Python 3.15.2, CPU only, no game files), tested in a clean detached worktree at `main` `246791612` with PR #2369 head `d04d24796`: - **Clean apply:** `git apply --check` / `git apply` applied cleanly with zero conflicts. - **Before fix (new test on unpatched `main`):** `python3 -I tests/test_boot_trace.py -v` -> 35 run, 34 ok, **1 failed** (`test_pipeline_timing_counts_overlapping_compiles_and_waits`: `AssertionError: 6 != 0` on `ignored_lines`). - **After fix:** - `python3 -I tests/test_boot_trace.py -v` -> **35/35 passed**. - `python3 -I tests/test_docs_links.py` -> **17/17 passed**. - `python3 -I tests/test_ci_registration.py` -> **16/16 passed**. - `python3 -I tests/test_text_write_line_endings.py` -> **3/3 passed**. - `python3 -m compileall -q make_game.py tools tests` -> exit 0. - `python3 -I scripts/check_no_game_data.py docs/first_run_ui.md tests/test_boot_trace.py tools/boot_trace.py` -> exit 0. - `git diff --check` -> clean. Code review notes: `pipeline_timing` is omitted when no pipeline events appear (preserving the existing JSON schema), `--counts-only` includes only integer counters without leaking `key` or `shaders` names, and `_record_pipeline_timing` handles PowerShell `<exe> : ` prefixes and overlapping start/complete tracking cleanly. No issues found. AI-assisted: yes (Antigravity)
Author
Owner

@⁠lixonik on GitHub · 2026-11-26 18:02 UTC · original · reviewed

Windows 11: all 35 boot trace tests passed, including pipeline wait and compiler output summaries. Synthetic logs only. No findings.

AI-assisted.

**@⁠lixonik** on GitHub · 2026-11-26 18:02 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2369#pullrequestreview-6078730757) · **reviewed** Windows 11: all 35 boot trace tests passed, including pipeline wait and compiler output summaries. Synthetic logs only. No findings. AI-assisted.
Author
Owner

@⁠wavehs on GitHub · 2026-11-26 18:40 UTC · original · reviewed

macOS arm64 check of #2369 (pipeline waits in boot_trace). A Python log parser plus its test; no GPU needed.

Tested head d04d24796 with its diff applied to a copy of main bdbc7e923 (branch 17 commits behind; git apply / git merge-tree clean).

Environment: Apple M3 Pro, arm64, macOS 27.2.1, CPython 3.15.2.

Result

  • python -I tests/test_boot_trace.py: 35 tests, OK.
  • Negative control (new test kept, tools/boot_trace.py put back to main's): 1 failure, test_pipeline_timing_counts_overlapping_compiles_and_waits - the parser ignores the [rt] pipeline-* lines, so the summary has no pipeline_timing. The other 34 tests stay green, so the change does not disturb the D3D12/startup parsing.
  • python -I scripts/run_semantic_tests.py tests/semantic: 500 files / 6,367 tests / 0 failed, same as main.

Format cross-check
The three regexes match the producer in runtime/shims/d3d12_pipeline_compile.h field for field:

  • pipeline-use (line 79): trigger tid us ready end_ms;
  • pipeline-compile-begin (line 97): trigger tid bytes variant begin_ms key shaders;
  • pipeline-compile (line 122): trigger tid start_us us hit bytes variant result end_ms key shaders.
    The optional (?:.+ : )? prefix matches the PowerShell error-record wrapping the file already handles. Good.

Review

  • Overlapping compiles with the same (tid, trigger, variant, key) are counted with a stack (active[key] += 1 on begin, decrement on end), and a completion with no begin is counted separately instead of being paired with an unrelated start; the test covers overlapping compiles.
  • starts_without_completion is computed from the live map at EOF, so a truncated log reports the open builds; the if started or completed or logged_waits guard keeps pipeline_timing out of logs that never enabled the trace, which preserves the existing text report for those.
  • counts_only() copies the timing dict, and the text report prints it only when present; the other [rt] diagnostics are not summarized wording is now accurate.

One observation, not a defect: the runtime prints pipeline-use only when elapsed >= 1000 µs (d3d12_pipeline_compile.h:78), so logged_waits is a subset of the waits; the report's "logged" wording is right, but a reader could take "longest wait" as the longest wait overall. A parenthetical "(only uses over 1 ms are logged)" in the text line or the docs would prevent that.

No game files. AI-assisted.

**@⁠wavehs** on GitHub · 2026-11-26 18:40 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2369#pullrequestreview-6079095140) · **reviewed** **macOS arm64 check of #2369** (pipeline waits in boot_trace). A Python log parser plus its test; no GPU needed. Tested head `d04d24796` with its diff applied to a copy of `main` `bdbc7e923` (branch 17 commits behind; `git apply` / `git merge-tree` clean). Environment: Apple M3 Pro, arm64, macOS 27.2.1, CPython 3.15.2. **Result** - `python -I tests/test_boot_trace.py`: 35 tests, OK. - Negative control (new test kept, `tools/boot_trace.py` put back to `main`'s): 1 failure, `test_pipeline_timing_counts_overlapping_compiles_and_waits` - the parser ignores the `[rt] pipeline-*` lines, so the summary has no `pipeline_timing`. The other 34 tests stay green, so the change does not disturb the D3D12/startup parsing. - `python -I scripts/run_semantic_tests.py tests/semantic`: 500 files / 6,367 tests / 0 failed, same as `main`. **Format cross-check** The three regexes match the producer in `runtime/shims/d3d12_pipeline_compile.h` field for field: - `pipeline-use` (line 79): `trigger tid us ready end_ms`; - `pipeline-compile-begin` (line 97): `trigger tid bytes variant begin_ms key shaders`; - `pipeline-compile` (line 122): `trigger tid start_us us hit bytes variant result end_ms key shaders`. The optional `(?:.+ : )?` prefix matches the PowerShell error-record wrapping the file already handles. Good. **Review** - Overlapping compiles with the same `(tid, trigger, variant, key)` are counted with a stack (`active[key] += 1` on begin, decrement on end), and a completion with no begin is counted separately instead of being paired with an unrelated start; the test covers overlapping compiles. - `starts_without_completion` is computed from the live map at EOF, so a truncated log reports the open builds; the `if started or completed or logged_waits` guard keeps `pipeline_timing` out of logs that never enabled the trace, which preserves the existing text report for those. - `counts_only()` copies the timing dict, and the text report prints it only when present; the `other [rt] diagnostics are not summarized` wording is now accurate. One observation, not a defect: the runtime prints `pipeline-use` only when `elapsed >= 1000` µs (`d3d12_pipeline_compile.h:78`), so `logged_waits` is a subset of the waits; the report's "logged" wording is right, but a reader could take "longest wait" as the longest wait overall. A parenthetical "(only uses over 1 ms are logged)" in the text line or the docs would prevent that. No game files. AI-assisted.
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/2369/head:github-bot/gh-2369'
git switch 'github-bot/gh-2369'

Merge

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