d3d12_xs: name the group counts of each Dispatch in the TOMBOX_DRED=2 report #273

Closed
github-bot wants to merge 1 commit from gh-pr/273/head into gh-pr/273/base
Owner

@⁠GDAgent on GitHub · 2026-11-23 10:39 UTC · original
GDAgent:fix/d3d12-dred-dispatch-groups → main · +69 −6 · 2 files · 1 commits · closed without merging

Library / area: d3d12_xs (dred_marks.rs, two log strings in dred.rs)

Exports changed (exports.txt rows): none

Why: with TOMBOX_DRED=2, a device-removal report names the PSO (the Xbox shader hashes) of every op around the first unfinished one, but not the size of a dispatch. When a compute shader hangs the GPU, the group count is the first thing needed to tell a runaway loop from a dispatch that is simply too large. This came up while chasing a DXGI_ERROR_DEVICE_HUNG in a Niagara compute shader in The Matrix Awakens, where the report showed which dispatch hung but not how big it was.

Changes:

  • With PSO markers on (TOMBOX_DRED=2), Dispatch (Xbox slot 14) and DispatchX (slot 78) also write a SetMarker tbdispatch XxYxZ before forwarding to the previous slot entry. They chain like the other hooks on those slots (for example TOMBOX_PASSCAP).
  • The removal report appends groups=XxYxZ to a DISPATCH op when the latest dispatch marker before it has no other draw or dispatch in between. Dispatch markers are not shown as title markers and do not count as PSO markers.
  • The TOMBOX_DRED log lines say that mode 2 also adds Dispatch markers.
  • Without TOMBOX_DRED=2 nothing changes: no hook is installed.

Tests:

  • dred_marks::tests::dispatch_markers_give_the_group_counts_of_the_dispatch_they_precede: done, first-unfinished and queued dispatches get their own counts; a dispatch with no marker since the previous work op gets none; a draw never does; marker text format.
  • cargo test -p d3d12_xs --lib -- --test-threads=1 (with TOMBOX_REMOVED_EXIT_MS=off): 660 passed, 4 failed, 71 ignored; the same 4 fail on main here (alias::tests::msaa_depth_with_a_larger_pc_layout_never_overlaps_the_next_title_placement, placed_offset::tests::uneven_views_get_exact_helpers_and_msaa_shares_the_alias_heap, title_shadow::tests::buffer_then_texture_migrates_to_one_local_heap_and_keeps_bytes, xs_exports::console_fixed_tests::fixed_result_dxgix_exports_match_every_console_d3d12_xs).
  • Native Windows 11; not run under Proton.

Not verified in a title: the markers were added on a test branch for the Matrix hang above, but no removal has been captured with them yet, so a real report with groups= has not been seen.

  • Tests pass
  • No game or console files and no binaries included
  • No fake success; anything not possible is left missing with a note
**@⁠GDAgent** on GitHub · 2026-11-23 10:39 UTC · [original](https://github.com/omonkeyz/xbox-emulator/pull/273) `GDAgent:fix/d3d12-dred-dispatch-groups` → `main` · +69 −6 · 2 files · 1 commits · closed without merging **Library / area:** `d3d12_xs` (`dred_marks.rs`, two log strings in `dred.rs`) **Exports changed (exports.txt rows):** none **Why:** with `TOMBOX_DRED=2`, a device-removal report names the PSO (the Xbox shader hashes) of every op around the first unfinished one, but not the size of a dispatch. When a compute shader hangs the GPU, the group count is the first thing needed to tell a runaway loop from a dispatch that is simply too large. This came up while chasing a `DXGI_ERROR_DEVICE_HUNG` in a Niagara compute shader in The Matrix Awakens, where the report showed which dispatch hung but not how big it was. Changes: - With PSO markers on (`TOMBOX_DRED=2`), `Dispatch` (Xbox slot 14) and `DispatchX` (slot 78) also write a `SetMarker` `tbdispatch XxYxZ` before forwarding to the previous slot entry. They chain like the other hooks on those slots (for example `TOMBOX_PASSCAP`). - The removal report appends `groups=XxYxZ` to a `DISPATCH` op when the latest dispatch marker before it has no other draw or dispatch in between. Dispatch markers are not shown as title markers and do not count as PSO markers. - The `TOMBOX_DRED` log lines say that mode 2 also adds Dispatch markers. - Without `TOMBOX_DRED=2` nothing changes: no hook is installed. Tests: - `dred_marks::tests::dispatch_markers_give_the_group_counts_of_the_dispatch_they_precede`: done, first-unfinished and queued dispatches get their own counts; a dispatch with no marker since the previous work op gets none; a draw never does; marker text format. - `cargo test -p d3d12_xs --lib -- --test-threads=1` (with `TOMBOX_REMOVED_EXIT_MS=off`): 660 passed, 4 failed, 71 ignored; the same 4 fail on `main` here (`alias::tests::msaa_depth_with_a_larger_pc_layout_never_overlaps_the_next_title_placement`, `placed_offset::tests::uneven_views_get_exact_helpers_and_msaa_shares_the_alias_heap`, `title_shadow::tests::buffer_then_texture_migrates_to_one_local_heap_and_keeps_bytes`, `xs_exports::console_fixed_tests::fixed_result_dxgix_exports_match_every_console_d3d12_xs`). - Native Windows 11; not run under Proton. **Not verified in a title:** the markers were added on a test branch for the Matrix hang above, but no removal has been captured with them yet, so a real report with `groups=` has not been seen. - [x] Tests pass - [x] No game or console files and no binaries included - [x] No fake success; anything not possible is left `missing` with a note
A device-removal report with TOMBOX_DRED=2 names the PSO (Xbox shader
hashes) of every op around the first unfinished one, but not the size
of a dispatch. When a compute shader hangs, the group count is the first
thing needed to tell a runaway loop from a dispatch that is simply too
large.

With PSO markers on, Dispatch (Xbox slot 14) and DispatchX (slot 78) now
also write a SetMarker "tbdispatch XxYxZ" before forwarding to the
previous slot entry (so they chain with other hooks on those slots, for
example TOMBOX_PASSCAP). The removal report appends groups=XxYxZ to a
DISPATCH op when the latest such marker before it has no other draw or
dispatch in between. Dispatch markers are not shown as title markers and
do not count as PSO markers. The TOMBOX_DRED log lines say that mode 2
adds Dispatch markers.

Test: dred_marks dispatch_markers_give_the_group_counts_of_the_dispatch_they_precede
(done, first-unfinished and queued dispatches get their own counts, a
dispatch without a marker since the previous work op gets none, a draw
never does, and the marker text format).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 06:16:50 +00:00
github-bot closed this pull request 2026-11-26 06:16:50 +00:00
Author
Owner

@⁠omonkeyz on GitHub · 2026-11-23 13:45 UTC · original

Applied locally on main with your authorship kept (cherry-picked, 89d07c1); tests pass in a sandbox. It ships in the next release; this PR will be closed when that is pushed. Thanks.

**@⁠omonkeyz** on GitHub · 2026-11-23 13:45 UTC · [original](https://github.com/omonkeyz/xbox-emulator/pull/273#issuecomment-7102984973) Applied locally on main with your authorship kept (cherry-picked, 89d07c1); tests pass in a sandbox. It ships in the next release; this PR will be closed when that is pushed. Thanks.
Author
Owner

@⁠omonkeyz on GitHub · 2026-11-25 13:09 UTC · original

Applied on main in 89d07c1 (cherry-picked onto the current history with your authorship kept; comment lines stripped per CONTRIBUTING). Thank you.

**@⁠omonkeyz** on GitHub · 2026-11-25 13:09 UTC · [original](https://github.com/omonkeyz/xbox-emulator/pull/273#issuecomment-7163375923) Applied on main in 89d07c1 (cherry-picked onto the current history with your authorship kept; comment lines stripped per CONTRIBUTING). Thank you.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.