vulkan: with LEONIDA_DEVICE_FAULT_ROOTS a dispatch checkpoint names its own dispatch (RT-FAULT-CHECKPOINT-DISPATCH) #1934

Open
github-bot wants to merge 4 commits from github-bot/gh-1934 into main AGit
Owner

@⁠kawaii-shakal on GitHub · 2026-11-25 16:10 UTC · original
kawaii-shakal:fault-roots-submission → main · +84 −24 · 4 files · 4 commits · open

Claimed in the coordination issue as RT-FAULT-CHECKPOINT-DISPATCH: #1608

Problem

The device-fault report lists the last 64 dispatches submitted across all queues. In the world-start losses of 1.0.2.1 on an RTX 5070 Ti, all 64 belonged to one late submission. That pushed out the dispatch that the NVIDIA checkpoint pointed at, which sat in an earlier submission: in one boot, execute #4605 had replaced the entries for the checkpoints of #4598, #4599 and #4601. The checkpoint gave the list and command but no groups, indirect arguments or root words.

Change

With LEONIDA_DEVICE_FAULT_ROOTS=1:

  • Each submission keeps its dispatches. Each of the 64 recent submissions keeps its own dispatch history (DeviceFaultDiagnostics::publish no longer clears it in this mode). Without the variable it is cleared as before, so the default costs nothing more.
  • The checkpoint names its dispatch. A dispatch checkpoint the driver reports is followed by checkpoint dispatch, with the dispatch at exactly that submission, list and command: groups or indirect arguments, and the 32 root words. When it isn't there, the line says so.
  • One print function. print_dispatch now prints both these lines and the global history lines, which look as they did.

docs/d3d12_vulkan.md 4.11 describes the mode.

Tested

  • vulkan_device_fault_roots (new, mode on):
    • a checkpoint at a submission's last dispatch, an indirect one with root word 5 = 42;
    • a later submission of 64 dispatches then pushes every entry of it out of the global history;
    • the report still finds and prints the dispatch.
  • Old clearing fails it: the same test fails (exit 10) with the old clearing put back.
  • vulkan_device_fault (mode off): unchanged, it passes and finds nothing extra.
  • Platform: Windows 11 Pro 26300, VS 2026 RelWithDebInfo; the test uses mocked device-fault and checkpoint entry points, no GPU.

Credit

Prototype and diagnosis by Codex (OpenAI), working with me on the same boots. I ported it to current main, which has gained the Aftermath hook and the stall checkpoints since, and added the CTest case.

🤖 Generated with Claude Code

**@⁠kawaii-shakal** on GitHub · 2026-11-25 16:10 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1934) `kawaii-shakal:fault-roots-submission` → `main` · +84 −24 · 4 files · 4 commits · open Claimed in the coordination issue as RT-FAULT-CHECKPOINT-DISPATCH: https://git.gtahub.st/github/ubiquitarianism--leonida/issues/1608 ### Problem The device-fault report lists the last 64 dispatches submitted across all queues. In the world-start losses of 1.0.2.1 on an RTX 5070 Ti, all 64 belonged to one late submission. That pushed out the dispatch that the NVIDIA checkpoint pointed at, which sat in an earlier submission: in one boot, execute #4605 had replaced the entries for the checkpoints of #4598, #4599 and #4601. The checkpoint gave the list and command but no groups, indirect arguments or root words. ### Change With `LEONIDA_DEVICE_FAULT_ROOTS=1`: - **Each submission keeps its dispatches.** Each of the 64 recent submissions keeps its own dispatch history (`DeviceFaultDiagnostics::publish` no longer clears it in this mode). Without the variable it is cleared as before, so the default costs nothing more. - **The checkpoint names its dispatch.** A dispatch checkpoint the driver reports is followed by `checkpoint dispatch`, with the dispatch at exactly that submission, list and command: groups or indirect arguments, and the 32 root words. When it isn't there, the line says so. - **One print function.** `print_dispatch` now prints both these lines and the global history lines, which look as they did. `docs/d3d12_vulkan.md` 4.11 describes the mode. ### Tested - **`vulkan_device_fault_roots` (new, mode on):** - a checkpoint at a submission's last dispatch, an indirect one with root word 5 = 42; - a later submission of 64 dispatches then pushes every entry of it out of the global history; - the report still finds and prints the dispatch. - **Old clearing fails it:** the same test fails (exit 10) with the old clearing put back. - **`vulkan_device_fault` (mode off):** unchanged, it passes and finds nothing extra. - **Platform:** Windows 11 Pro 26300, VS 2026 RelWithDebInfo; the test uses mocked device-fault and checkpoint entry points, no GPU. ### Credit Prototype and diagnosis by Codex (OpenAI), working with me on the same boots. I ported it to current main, which has gained the Aftermath hook and the stall checkpoints since, and added the CTest case. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The device-fault report lists the last 64 dispatches across queues. In the world-start losses of 1.0.2.1 all
64 belonged to one late submission, so the dispatch at the NVIDIA checkpoint, in an earlier submission, was
gone. In one boot, execute #4605 had replaced the entries for the checkpoints of #4598, #4599 and #4601.

With LEONIDA_DEVICE_FAULT_ROOTS=1 each of the 64 recent submissions now keeps its own dispatches, and a
dispatch checkpoint is followed by a "checkpoint dispatch" line with the exact dispatch: groups or indirect
arguments and the root words. vulkan_device_fault_roots runs the test with the mode on: a checkpoint at a
submission's last dispatch, pushed out of the global history by a later submission of 64 dispatches, is
still found. The same test fails with the old clearing.

Prototype and diagnosis by Codex (OpenAI); ported to current main and tested
here.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Keep per-submission dispatch roots alongside AMD marker numbering and hang reports.

Conflict resolution assisted by Codex.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:11:45 +00:00
Author
Owner

@⁠MoonEyes on GitHub · 2026-11-25 18:22 UTC · original · reviewed

LGTM

Setup: Windows 11 Pro 26300, MSVC 19.44.35230.0 (VS 2022), CMake 3.31.6 + Ninja, RelWithDebInfo, -DLEONIDA_REQUIRE_VULKAN=ON, Vulkan SDK 1.4.363.0. main = b9320a118. Only vulkan_device_fault_test was built and run (ctest -R "^vulkan_device_fault": vulkan_device_fault, and the new vulkan_device_fault_roots with LEONIDA_DEVICE_FAULT_ROOTS=1). Not run: the whole ctest set, any game boot.

Head f6448b05b.

  • PR head: 2/2 Passed.
  • main: vulkan_device_fault Passed (1/1; the _roots test does not exist there).
  • PR merged into main locally (runtime/CMakeLists.txt auto-merged): 2/2 Passed.
  • Mutant A (PR test and CMake lines, runtime/src/vulkan_device_fault.h of main): does not build, error C2039: 'checkpoint_dispatches_found' is not a member of leonida::DeviceFaultDiagnostics (test line 164). This only shows the test needs the new accessor.
  • Mutant B (PR header with the one line if (!include_roots_) submission.dispatches.clear(); changed back to the unconditional submission.dispatches.clear();): vulkan_device_fault Passed, vulkan_device_fault_roots Failed; the executable returns 10 with the variable set and 0 without. This confirms the description's "fails (exit 10) with the old clearing put back".

The test uses mocked device-fault and checkpoint entry points, so the result does not depend on the GPU. The printed checkpoint dispatch line itself is not asserted, only the count of found dispatches.

AI-assisted: yes (Claude Code built and ran the tests)

**@⁠MoonEyes** on GitHub · 2026-11-25 18:22 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1934#pullrequestreview-6062814911) · **reviewed** **LGTM** Setup: Windows 11 Pro 26300, MSVC 19.44.35230.0 (VS 2022), CMake 3.31.6 + Ninja, RelWithDebInfo, `-DLEONIDA_REQUIRE_VULKAN=ON`, Vulkan SDK 1.4.363.0. `main` = `b9320a118`. Only `vulkan_device_fault_test` was built and run (`ctest -R "^vulkan_device_fault"`: `vulkan_device_fault`, and the new `vulkan_device_fault_roots` with `LEONIDA_DEVICE_FAULT_ROOTS=1`). Not run: the whole `ctest` set, any game boot. Head `f6448b05b`. - PR head: 2/2 Passed. - `main`: `vulkan_device_fault` Passed (1/1; the `_roots` test does not exist there). - PR merged into `main` locally (`runtime/CMakeLists.txt` auto-merged): 2/2 Passed. - Mutant A (PR test and CMake lines, `runtime/src/vulkan_device_fault.h` of `main`): does not build, `error C2039: 'checkpoint_dispatches_found'` is not a member of `leonida::DeviceFaultDiagnostics` (test line 164). This only shows the test needs the new accessor. - Mutant B (PR header with the one line `if (!include_roots_) submission.dispatches.clear();` changed back to the unconditional `submission.dispatches.clear();`): `vulkan_device_fault` Passed, `vulkan_device_fault_roots` Failed; the executable returns 10 with the variable set and 0 without. This confirms the description's "fails (exit 10) with the old clearing put back". The test uses mocked device-fault and checkpoint entry points, so the result does not depend on the GPU. The printed `checkpoint dispatch` line itself is not asserted, only the count of found dispatches. AI-assisted: yes (Claude Code built and ran the tests)
Author
Owner

@⁠djrolfes on GitHub · 2026-11-26 06:40 UTC · original

Independent real-fault exercise of ac16dbe (not current headd05321a8), local f448c712a Linux/Wine11.22/RTX3070Ti/NVIDIA620.73.04: GPU loss at474.73s with ROOTS=1. Three compute checkpoint submissions recover their exact dispatch root records; another compute checkpoint says its dispatch is not in that submission history. A direct-queue draw checkpoint remains outside this dispatch-only feature. No attribution to the last shader label.

The missing compute record has a specific bounded-history explanation: that submission contains many later dispatches, so its early checkpoint is outside CheckpointSubmission::dispatch_limit=64 (vulkan_device_fault.h:175-180), even though retaining the submission fixes cross-submission eviction.

CPU-only reduction with the exact existing vulkan_device_fault_test: original mocked checkpoint at command70 passes with ROOTS=1. Changing only the reported checkpoint to command0 (already evicted by that same71-dispatch submission) gives the missing-history line and expected test exit10. Both compiled/reran natively with Clang23 C++20 ASan+UBSan; no sanitizer report. This is a diagnostic coverage limit, NOT a reproduction of the GPU fault. I am not implementing a second history scheme or treating your current bounded behavior as an undocumented promise violation.

Please consider retaining early checkpoint-selectable dispatches or explicitly documenting this within-submission limit in your existing ownership. All raw retail content stays local. AI-assisted (OpenAI GPT-6.1 Sol).

**@⁠djrolfes** on GitHub · 2026-11-26 06:40 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1934#issuecomment-7184671999) Independent real-fault exercise of ac16dbe (not current headd05321a8), local f448c712a Linux/Wine11.22/RTX3070Ti/NVIDIA620.73.04: GPU loss at474.73s with ROOTS=1. Three compute checkpoint submissions recover their exact dispatch root records; another compute checkpoint says its dispatch is not in that submission history. A direct-queue draw checkpoint remains outside this dispatch-only feature. No attribution to the last shader label. The missing compute record has a specific bounded-history explanation: that submission contains many later dispatches, so its early checkpoint is outside CheckpointSubmission::dispatch_limit=64 (vulkan_device_fault.h:175-180), even though retaining the submission fixes cross-submission eviction. CPU-only reduction with the exact existing vulkan_device_fault_test: original mocked checkpoint at command70 passes with ROOTS=1. Changing only the reported checkpoint to command0 (already evicted by that same71-dispatch submission) gives the missing-history line and expected test exit10. Both compiled/reran natively with Clang23 C++20 ASan+UBSan; no sanitizer report. This is a diagnostic coverage limit, NOT a reproduction of the GPU fault. I am not implementing a second history scheme or treating your current bounded behavior as an undocumented promise violation. Please consider retaining early checkpoint-selectable dispatches or explicitly documenting this within-submission limit in your existing ownership. All raw retail content stays local. AI-assisted (OpenAI GPT-6.1 Sol).
Review of RT-FAULT-CHECKPOINT-DISPATCH (djrolfes): a real loss reported a compute
checkpoint whose dispatch was not in its submission's history. That submission had
71 dispatches and the per-submission ring kept the last 64, so an early checkpoint
fell out of it.

- In this mode a submission keeps up to roots_dispatch_limit (1,024) dispatches
  (CheckpointSubmission::keep); without it, the last 64 as before. The global
  history still takes only a submission's last 64.
- Past the limit the report says how many dispatches the submission recorded and
  how many it kept, so the limit shows in the log. Documented in d3d12_vulkan.md.
- vulkan_device_fault_test now puts the checkpoint at command 3 of 71, the case
  from the report. With the old limit vulkan_device_fault_roots fails (exit 7).

Changes made by Claude Code (AI-assisted).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JPqXc6svM4pbBagTsVEYA3
Author
Owner

@⁠kawaii-shakal on GitHub · 2026-11-26 12:08 UTC · original

@⁠djrolfes thanks for the real-fault run. The missing line was the 64-dispatch per-submission ring, as you found.
Claude Code (AI-assisted) changed this in bf1fce7f: I went with keeping the dispatches rather than only documenting
the limit.

  • With LEONIDA_DEVICE_FAULT_ROOTS=1 a submission now keeps up to its last 1,024 dispatches
    (CheckpointSubmission::roots_dispatch_limit). Without the flag it keeps 64 as before, and the global history
    still takes only each submission's last 64. At about 250 bytes a dispatch this is at most 16 MiB over the 64 recent
    submissions, and only in this mode.
  • Past the limit, the report says how many dispatches the submission recorded and how many it kept, so the limit
    shows in the log. It is also documented in docs/d3d12_vulkan.md.
  • vulkan_device_fault_test now puts the checkpoint at command 3 of a 71-dispatch submission, the case from your
    log. With the old limit, vulkan_device_fault_roots fails (exit 7). With the change, both vulkan_device_fault
    and vulkan_device_fault_roots pass.

Tested: vulkan_device_fault, vulkan_device_fault_roots, vulkan_device_markers and vk_device_markers, on
Linux with Mesa lavapipe. Not built on Windows. If you can re-run your 474 s loss on this head, the compute checkpoint
in that 71-dispatch submission should now print its checkpoint dispatch line.


Generated by Claude Code

**@⁠kawaii-shakal** on GitHub · 2026-11-26 12:08 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1934#issuecomment-7191624252) @⁠djrolfes thanks for the real-fault run. The missing line was the 64-dispatch per-submission ring, as you found. Claude Code (AI-assisted) changed this in bf1fce7f: I went with keeping the dispatches rather than only documenting the limit. - With `LEONIDA_DEVICE_FAULT_ROOTS=1` a submission now keeps up to its last 1,024 dispatches (`CheckpointSubmission::roots_dispatch_limit`). Without the flag it keeps 64 as before, and the global history still takes only each submission's last 64. At about 250 bytes a dispatch this is at most 16 MiB over the 64 recent submissions, and only in this mode. - Past the limit, the report says how many dispatches the submission recorded and how many it kept, so the limit shows in the log. It is also documented in `docs/d3d12_vulkan.md`. - `vulkan_device_fault_test` now puts the checkpoint at command 3 of a 71-dispatch submission, the case from your log. With the old limit, `vulkan_device_fault_roots` fails (exit 7). With the change, both `vulkan_device_fault` and `vulkan_device_fault_roots` pass. Tested: `vulkan_device_fault`, `vulkan_device_fault_roots`, `vulkan_device_markers` and `vk_device_markers`, on Linux with Mesa lavapipe. Not built on Windows. If you can re-run your 474 s loss on this head, the compute checkpoint in that 71-dispatch submission should now print its `checkpoint dispatch` line. --- _Generated by [Claude Code](https://claude.ai/code)_
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/1934/head:github-bot/gh-1934'
git switch 'github-bot/gh-1934'

Merge

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