d3d12: save a rolling timeline after a frame stalls (D3D12-STALL-TRACE) #2623

Manually merged
github merged 1 commit from github-bot/gh-2623 into gh-pr/2623/base 2026-11-30 16:05:45 +00:00 AGit
Owner

@⁠hardly-relevant on GitHub · 2026-11-29 18:47 UTC · original
hardly-relevant:feat/d3d12-stall-trace → main · +3262 −113 · 6 files · 1 commits · merged 2026-11-30 15:58 UTC

Claimed as D3D12-STALL-TRACE.

What and why

  • Add an opt-in, bounded rolling history to the native Rust D3D12 timeline. The first qualifying gap between title presents saves a Chrome trace and text summary when the game recovers.
  • Save waits, wakeups and CPU-side submissions with coverage and drop counts. Freeze and write on the background thread after the present closes the producer gate.
  • Keep the existing timed recorder available. Stall captures reserve fresh output files.

Tested

  • Windows: cargo test --locked -p leonida-gpu --features diagnostics passed 619 unit tests plus replay. cargo test --locked -p leonida-gpu passed 544 unit tests. All 17 focused timeline tests passed.
  • Deliberately reintroducing a blocking lock in a temporary checkout caused the contention regression to fail at its timeout in 2.01 s.
  • Two Windows game runs with the feature on base 4364a4fa6 wrote readable capture pairs. The recorded title-present gaps were 1.56 s and 1.06 s. The respective gaps between recorded CPU-side submissions were 1.47 s and 0.965 s.
  • Windows 11, NVIDIA GeForce RTX 4080 Laptop GPU, driver 621.40.

Checklist

  • Based on current main when tested.
  • One topic.
  • Game-data and private-path checks passed.
**@⁠hardly-relevant** on GitHub · 2026-11-29 18:47 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2623) `hardly-relevant:feat/d3d12-stall-trace` → `main` · +3262 −113 · 6 files · 1 commits · merged 2026-11-30 15:58 UTC Claimed as [D3D12-STALL-TRACE](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/2570). ### What and why - Add an opt-in, bounded rolling history to the native Rust D3D12 timeline. The first qualifying gap between title presents saves a Chrome trace and text summary when the game recovers. - Save waits, wakeups and CPU-side submissions with coverage and drop counts. Freeze and write on the background thread after the present closes the producer gate. - Keep the existing timed recorder available. Stall captures reserve fresh output files. ### Tested - Windows: `cargo test --locked -p leonida-gpu --features diagnostics` passed 619 unit tests plus replay. `cargo test --locked -p leonida-gpu` passed 544 unit tests. All 17 focused timeline tests passed. - Deliberately reintroducing a blocking lock in a temporary checkout caused the contention regression to fail at its timeout in 2.01 s. - Two Windows game runs with the feature on base `4364a4fa6` wrote readable capture pairs. The recorded title-present gaps were 1.56 s and 1.06 s. The respective gaps between recorded CPU-side submissions were 1.47 s and 0.965 s. - Windows 11, NVIDIA GeForce RTX 4080 Laptop GPU, driver 621.40. ### Checklist - [x] Based on current main when tested. - [x] One topic. - [x] Game-data and private-path checks passed.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 18:47:50 +00:00
Author
Owner

@⁠merzleckeier on GitHub · 2026-11-29 19:09 UTC · original

Independent end-to-end check of 37d2d73d merged onto bcbbd9a9 (tree b07e175e), Windows x64 diagnostics cross-build on CachyOS / Wine 11.22. A test-only emitter called the production environment parser and presented() using synthetic frame boundaries, spans, fence waits, wakeups and CPU submissions.

  • With LEONIDA_TIMELINE_AT=0 and LEONIDA_TIMELINE_STALL_MS=200, three short gaps left the files absent. One qualifying gap wrote valid JSON and the sibling text file at a Unicode path. A second qualifying gap left both files byte-identical. Chrome metadata gives 259.442 ms in the short run and 268.668 ms in the wrapped run.
  • The wrapped run retained exactly 65,536 ring events, counted 52 overwrites, and still emitted both trigger boundaries. The trace includes CPU-side submission timing for fence 703 and labels GPU execution timing unavailable.
  • The existing timed setting produced its own JSON and text pair. The invalid zero threshold left the recorder off and wrote no files.

All four production-path probes passed. The unmodified timeline suite reported 16/17 under Wine with a UTF-8 locale and matching symbols adjacent. The remaining stack-symbol-name assertion also fails on plain bcbbd9a9 in the same environment. The other 16 tests pass with exit 0 when that one case is excluded. Synthetic inputs only. AI-assisted with OpenAI Codex.

**@⁠merzleckeier** on GitHub · 2026-11-29 19:09 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2623#issuecomment-7261048692) Independent end-to-end check of `37d2d73d` merged onto `bcbbd9a9` (tree `b07e175e`), Windows x64 diagnostics cross-build on CachyOS / Wine 11.22. A test-only emitter called the production environment parser and `presented()` using synthetic frame boundaries, spans, fence waits, wakeups and CPU submissions. - With `LEONIDA_TIMELINE_AT=0` and `LEONIDA_TIMELINE_STALL_MS=200`, three short gaps left the files absent. One qualifying gap wrote valid JSON and the sibling text file at a Unicode path. A second qualifying gap left both files byte-identical. Chrome metadata gives 259.442 ms in the short run and 268.668 ms in the wrapped run. - The wrapped run retained exactly 65,536 ring events, counted 52 overwrites, and still emitted both trigger boundaries. The trace includes CPU-side submission timing for fence 703 and labels GPU execution timing unavailable. - The existing timed setting produced its own JSON and text pair. The invalid zero threshold left the recorder off and wrote no files. All four production-path probes passed. The unmodified timeline suite reported 16/17 under Wine with a UTF-8 locale and matching symbols adjacent. The remaining stack-symbol-name assertion also fails on plain `bcbbd9a9` in the same environment. The other 16 tests pass with exit 0 when that one case is excluded. Synthetic inputs only. AI-assisted with OpenAI Codex.
Author
Owner

@⁠bobcatchris on GitHub · 2026-11-29 20:06 UTC · original

Independent verification on native Windows 11 Pro (10.0.26200) + AMD Radeon RX 7900 XTX (gfx1100, driver 32.0.32029.2010, Rust 1.98):

  • Merged PR head 37d2d73dc cleanly onto main (720bd3b4e) — zero conflicts.
  • cargo test -p leonida-gpu --lib -- --test-threads=4 — 549 passed; 0 failed; 47 ignored (13.91s), including the new timeline/stall-trace unit tests.
  • python -I scripts/check_no_game_data.py on all 6 touched files — PASS.

AI-assisted: Antigravity (Gemini 4 Neon)

**@⁠bobcatchris** on GitHub · 2026-11-29 20:06 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2623#issuecomment-7261812385) Independent verification on native Windows 11 Pro (`10.0.26200`) + **AMD Radeon RX 7900 XTX** (`gfx1100`, driver `32.0.32029.2010`, Rust `1.98`): - Merged PR head `37d2d73dc` cleanly onto `main` (`720bd3b4e`) — zero conflicts. - `cargo test -p leonida-gpu --lib -- --test-threads=4` — **`549 passed; 0 failed; 47 ignored`** (`13.91s`), including the new timeline/stall-trace unit tests. - `python -I scripts/check_no_game_data.py` on all 6 touched files — **PASS**. AI-assisted: Antigravity (Gemini 4 Neon)
github-bot changed target branch from main to gh-pr/2623/base 2026-11-30 16:04:40 +00:00
github manually merged commit 37d2d73dcd into gh-pr/2623/base 2026-11-30 16:04:41 +00:00
Author
Owner

@⁠MoonEyes on GitHub · 2026-11-30 15:58 UTC · original

Verified: merged cleanly in independent Windows and Linux checks, including 549 leonida-gpu tests passing with 0 failures and the no-game-data check passing. Ready for merge.

**@⁠MoonEyes** on GitHub · 2026-11-30 15:58 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2623#issuecomment-7283903141) Verified: merged cleanly in independent Windows and Linux checks, including 549 leonida-gpu tests passing with 0 failures and the no-game-data check passing. Ready for merge.
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/ubiquitarianism--leonida!2623
No description provided.