GPU diagnostics: trace each draw and dispatch of captured frames with its targets and drop reason #591

Closed
github-bot wants to merge 3 commits from gh-pr/591/head into gh-pr/591/base
Owner

@⁠ghost on GitHub · 2026-11-24 05:14 UTC · original
upstream_frameops → main · +118 −1 · 3 files · 3 commits · closed without merging

What

With VICTORY_LOG=victory_gpu::draw=debug and frames listed for capture, every draw, mesh dispatch, indirect execution and dispatch in those frames logs one line:

  • pipeline and topology;
  • render targets and depth, named as in the VICTORY_DUMP_TARGETS file names, so a dumped target can be traced to the work that writes it;
  • ran, or DROPPED: and why: the shader that does not translate, being made, a host pipeline that could not be prepared, or the indirect or dispatch path's own early reason;
  • then the device-removed report's text for the operation.

pipeline::drop_reason gives note_drop's reason in words. In listed frames this replaces the existing per-draw debug line, which overlapped it. Diagnostics builds only. It works with VICTORY_CAPTURE_DRAWS (#500).

Why

The world's picture is black, but its targets are not all empty. To see which dropped work leaves which target empty, each operation has to be tied to its targets. One world frame on an RX 9060 XT (d2a4bae + #135 + #365):

  • About 3,800 draws, mesh dispatches and indirect executions write one G-buffer colour target, and 1,100 of them are dropped. The largest single cause is pixel 7bdefdfde461f6e3 (655 ExecuteIndirect calls, image_sample_d_cl, #318).
  • A 2560x1440 RGBA16F target stays zero, with 490 of its 695 writers dropped: 284 for pixel b37565055f2f7d3b (#385) and 194 rectangle-list indirect draws (#346).

Dispatches carry no targets here, so their UAV writes are not attributed; their drops are still listed. With #318, #385, #346 and #305 applied, the largest drops in another world frame are about 2,500 compute dispatches of six programs with an address in an SGPR that is no root parameter (#302/#489).

Tested

  • 936c4c7 merged with #135, #365 and #500 (main alone stops before the world), diag, on the title with VICTORY_LOG=victory_gpu::draw=debug,info and VICTORY_CAPTURE_DRAWS=10000,2. Two world frames logged 8,409 and 7,018 lines (2,534 and 3,344 dropped), 0.5–0.6 KB a line, about 4–5 MB a frame.
  • cargo test --workspace: all pass except victory-shader --lib, which hits the WARP concurrency crash in #181 and passes single-threaded (69/69). The diagnostics test build compiles. cargo xtask policy passes. Release builds.
  • main 533b7e2 merged in and ec2e184 (a frame line for dispatches #336 drops when a table cannot be made): cargo check -p victory-gpu with and without diagnostics, clippy -D warnings, cargo test -p victory-gpu --features diagnostics (50 passed), cargo xtask policy. On the title (ec2e184 alone, 150 s, frames 60–1100 listed): 46 frame lines, all ran, no errors; the new exit did not fire. This build reaches the world, but no world frame was listed.

AI-assisted (Claude Code, Claude Opus 5.5); no game data.

🤖 Generated with Claude Code

**@⁠ghost** on GitHub · 2026-11-24 05:14 UTC · [original](https://github.com/Marvisak/VIctory/pull/591) `upstream_frameops` → `main` · +118 −1 · 3 files · 3 commits · closed without merging ### What With `VICTORY_LOG=victory_gpu::draw=debug` and frames listed for capture, every draw, mesh dispatch, indirect execution and dispatch in those frames logs one line: - pipeline and topology; - render targets and depth, named as in the `VICTORY_DUMP_TARGETS` file names, so a dumped target can be traced to the work that writes it; - `ran`, or `DROPPED:` and why: the shader that does not translate, `being made`, a host pipeline that could not be prepared, or the indirect or dispatch path's own early reason; - then the device-removed report's text for the operation. `pipeline::drop_reason` gives `note_drop`'s reason in words. In listed frames this replaces the existing per-draw debug line, which overlapped it. Diagnostics builds only. It works with `VICTORY_CAPTURE_DRAWS` (#500). ### Why The world's picture is black, but its targets are not all empty. To see which dropped work leaves which target empty, each operation has to be tied to its targets. One world frame on an RX 9060 XT (`d2a4bae` + #135 + #365): - About 3,800 draws, mesh dispatches and indirect executions write one G-buffer colour target, and 1,100 of them are dropped. The largest single cause is pixel `7bdefdfde461f6e3` (655 `ExecuteIndirect` calls, `image_sample_d_cl`, #318). - A 2560x1440 RGBA16F target stays zero, with 490 of its 695 writers dropped: 284 for pixel `b37565055f2f7d3b` (#385) and 194 rectangle-list indirect draws (#346). Dispatches carry no targets here, so their UAV writes are not attributed; their drops are still listed. With #318, #385, #346 and #305 applied, the largest drops in another world frame are about 2,500 compute dispatches of six programs with `an address in an SGPR that is no root parameter` (#302/#489). ### Tested - `936c4c7` merged with #135, #365 and #500 (`main` alone stops before the world), `diag`, on the title with `VICTORY_LOG=victory_gpu::draw=debug,info` and `VICTORY_CAPTURE_DRAWS=10000,2`. Two world frames logged 8,409 and 7,018 lines (2,534 and 3,344 dropped), 0.5–0.6 KB a line, about 4–5 MB a frame. - `cargo test --workspace`: all pass except `victory-shader --lib`, which hits the WARP concurrency crash in #181 and passes single-threaded (69/69). The `diagnostics` test build compiles. `cargo xtask policy` passes. Release builds. - `main` `533b7e2` merged in and `ec2e184` (a frame line for dispatches #336 drops when a table cannot be made): `cargo check -p victory-gpu` with and without `diagnostics`, clippy `-D warnings`, `cargo test -p victory-gpu --features diagnostics` (50 passed), `cargo xtask policy`. On the title (`ec2e184` alone, 150 s, frames 60–1100 listed): 46 frame lines, all `ran`, no errors; the new exit did not fire. This build reaches the world, but no world frame was listed. AI-assisted (Claude Code, Claude Opus 5.5); no game data. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
With frames listed for capture and debug logging for victory_gpu::draw, every
draw, mesh dispatch, indirect execution and dispatch of those frames logs one
line: the pipeline, its render targets and depth (named as in the
VICTORY_DUMP_TARGETS files, so a dumped target can be traced to the work that
writes it), whether it ran and, if not, why (the shader that does not
translate, a pipeline still being made, or a host pipeline that could not be
prepared), followed by the device-removed report's text for the operation.

Diagnostics builds only.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Main now drops a dispatch when bind cannot make a table it reads (#336);
that exit logs its frame line too, so every operation of a listed frame
still has one. Also wraps four indirect trace calls as rustfmt does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:09:26 +00:00
github-bot closed this pull request 2026-11-26 04:09:26 +00:00
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-24 07:44 UTC · original

The #71 capture grouped 115 dropped G-buffer writers under preparation failures. I tested a small follow-up on 936c4c7 that gives the indirect preparation exits separate reasons for a mismatched host pipeline kind, a missing index-buffer shadow, and unsupported indirect rectangles. The captured frame line and the drop aggregate use the same reason. If pipeline creation finishes after preparation already returned unavailable, the operation still gets counted with an unavailable-at-prepare reason.

The synthetic indirect tests on RTX 5090 and WARP distinguish the wrong-kind and rectangle cases. The no-pipeline control remains counted once on both backends. The missing-shadow and late-readiness paths were checked in source.

Follow-up commit

**@⁠fuzeofficlal** on GitHub · 2026-11-24 07:44 UTC · [original](https://github.com/Marvisak/VIctory/pull/591#issuecomment-7125329312) The [#71 capture](https://git.gtahub.st/github/Marvisak--VIctory/issues/71) grouped 115 dropped G-buffer writers under preparation failures. I tested a small follow-up on `936c4c7` that gives the indirect preparation exits separate reasons for a mismatched host pipeline kind, a missing index-buffer shadow, and unsupported indirect rectangles. The captured frame line and the drop aggregate use the same reason. If pipeline creation finishes after preparation already returned unavailable, the operation still gets counted with an unavailable-at-prepare reason. The synthetic indirect tests on RTX 5090 and WARP distinguish the wrong-kind and rectangle cases. The no-pipeline control remains counted once on both backends. The missing-shadow and late-readiness paths were checked in source. [Follow-up commit](https://github.com/fuzeofficlal/VIctory/commit/aed8515fd49afb6eb313a7135e4d678a0c66f777)
Author
Owner

@⁠ghost on GitHub · 2026-11-24 08:06 UTC · original

Merged main 533b7e2 into the branch (no rebase, so 936c4c7 stays as it was). Since #336, a dispatch is dropped when bind cannot make a table it reads; that exit had no frame line, so ec2e184 adds one (DROPPED: a table it reads could not be made) and wraps four indirect trace calls the way rustfmt does. Draws already report a failed bind through prepare. cargo check -p victory-gpu with and without diagnostics, clippy with -D warnings, cargo test -p victory-gpu --features diagnostics (50 passed) and cargo xtask policy pass. Not re-run on the title since, and that exit has not fired in any run yet.

@⁠fuzeofficlal thanks, separate reasons for those three exits would help. Your commit changes prepare's signature in all builds, not only diagnostics ones, and on top of this branch it now conflicts in draw.rs, where #336 changed prepare, so I'd keep it as its own PR on top of this one rather than fold it in. I can run it on the title once it's up.

AI-assisted (Claude Code, Claude Opus 5.5); no game data.

**@⁠ghost** on GitHub · 2026-11-24 08:06 UTC · [original](https://github.com/Marvisak/VIctory/pull/591#issuecomment-7125742094) Merged `main` `533b7e2` into the branch (no rebase, so `936c4c7` stays as it was). Since #336, a dispatch is dropped when `bind` cannot make a table it reads; that exit had no frame line, so `ec2e184` adds one (`DROPPED: a table it reads could not be made`) and wraps four indirect trace calls the way rustfmt does. Draws already report a failed `bind` through `prepare`. `cargo check -p victory-gpu` with and without `diagnostics`, clippy with `-D warnings`, `cargo test -p victory-gpu --features diagnostics` (50 passed) and `cargo xtask policy` pass. Not re-run on the title since, and that exit has not fired in any run yet. @⁠fuzeofficlal thanks, separate reasons for those three exits would help. Your commit changes `prepare`'s signature in all builds, not only diagnostics ones, and on top of this branch it now conflicts in `draw.rs`, where #336 changed `prepare`, so I'd keep it as its own PR on top of this one rather than fold it in. I can run it on the title once it's up. AI-assisted (Claude Code, Claude Opus 5.5); no game data.
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-24 08:52 UTC · original

I rebased the separate follow-up on ec2e184, including the fallible table binding from #336. The indirect compute and graphics paths now report the table failure as a specific drop reason. The frame line and aggregate count use the same reason, and the direct dispatch diagnosis is preserved.

On RTX 5090 and WARP, a synthetic exhausted descriptor heap exercised both indirect table failures. All six indirect cases produced one matching frame line and one aggregate count each. The direct dispatch control still produced its existing diagnosis once.

Source commit 83cc0e4 is based on this PR head and ready to use for your offered test.

**@⁠fuzeofficlal** on GitHub · 2026-11-24 08:52 UTC · [original](https://github.com/Marvisak/VIctory/pull/591#issuecomment-7126666198) I rebased the separate follow-up on `ec2e184`, including the fallible table binding from #336. The indirect compute and graphics paths now report the table failure as a specific drop reason. The frame line and aggregate count use the same reason, and the direct dispatch diagnosis is preserved. On RTX 5090 and WARP, a synthetic exhausted descriptor heap exercised both indirect table failures. All six indirect cases produced one matching frame line and one aggregate count each. The direct dispatch control still produced its existing diagnosis once. [Source commit `83cc0e4`](https://github.com/fuzeofficlal/VIctory/commit/83cc0e4682947133716455fbc9baa46a36453fc9) is based on this PR head and ready to use for your offered test.

Pull request closed

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/Marvisak--VIctory!591
No description provided.