Skip to content

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

Closed
ghost wants to merge 3 commits into
mainfrom
unknown repository
Closed

ghost wants to merge 3 commits into
mainfrom
unknown repository

Conversation

@ghost

@ghost ghost commented Nov 24, 2026 •

Copy link
Copy Markdown

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):

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

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

🤖 Generated with Claude Code

… its targets and drop reason

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 <noreply@anthropic.com>

@LAKSHYA-cmd-tech LAKSHYA-cmd-tech left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified and tested on Windows 11 x64 (D3D12).

  • Confirmed conditional compilation with and without --features diagnostics. Both build cleanly.
  • rame_op and rame_op_why cleanly log render targets, depth, and drop reasons (including shader translation failures and indirect execution reasons) without regressing default release builds.
  • Checked cargo clippy -p victory-gpu --features diagnostics --lib -- -D warnings: 0 warnings.
  • Checked cargo run -p xtask -- policy: 151 files clean.

@fuzeofficlal

Copy link
Copy Markdown
Contributor

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

nullmarsh and others added 2 commits November 24, 2026 03:06
…e made

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 <noreply@anthropic.com>
@ghost

ghost commented Nov 24, 2026

Copy link
Copy Markdown
Author

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.

@fuzeofficlal

Copy link
Copy Markdown
Contributor

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.

Yaekai pushed a commit to Yaekai/VIctory that referenced this pull request Nov 24, 2026
… its targets and drop reason

Upstream: Marvisak#591 by @nullmarsh
jlefebure added a commit to jlefebure/VIctory that referenced this pull request Nov 24, 2026
nazmi pushed a commit to nazmi/VIctory that referenced this pull request Nov 24, 2026
…e made

Applied as the net diff of upstream PR Marvisak#591 (head ec2e184), 3 commits: ec2e184,8c7dc7a7,936c4c7d.
@ghost ghost closed this Nov 24, 2026
github-actions Bot added a commit to KevinPratap/VIctory that referenced this pull request Nov 24, 2026
…captured frames with its targets and drop reason
fornorharry added a commit to NitricAcidDev/VIctory-Omega-Fork that referenced this pull request Nov 25, 2026
…r launch

From open pull requests of fxceless/victory-gta6, each reviewed, applied with
its tests and fitted to this tree:

- Marvisak#756: one sampler written into a program and used with and without a
  comparison is two static samplers; a comparison sampler with a minimum or
  maximum reduction stays a comparison.
- Marvisak#714: a mesh program that allocates in every lane keeps its LDS barriers;
  scalar reads of unordered views; both edges of a branch to one block; the
  first lane of an offset that is held per lane. With the early-start bias
  of this tree's raw views on the unordered ones too.
- Marvisak#576, in part: a loop with two empty latches, and the double flag of a
  program that lost its doubles. Not its block-local handles: 1,507 of 1,516
  compute programs of a local cache make host pipelines here as they are, and
  the nine others ask for waves of 64 lanes (older translations).
- Marvisak#646, in part: `DispatchX` counts threads where its flag says so. They ran
  as groups.
- Marvisak#676, in part: a new view of a texture already on the card needs no room;
  two views of a placed texture that differ in its filler words (the title's
  stack, another in every launch) are of one texture.
- Marvisak#481, in part: no barrier for a window of indirect arguments that this
  draw did not clamp.
- Marvisak#591: the parts of a host copy a submission asks for, not the span between
  them. Marvisak#522: table constants that flights write are filled on the card.
- Marvisak#745: samplers with modes the host does not know.

Added: an ignored test that makes a host pipeline from every compute
translation of a local cache; the staging pool's test waits for other tests'
submissions.

AI-assisted. GPU (170), shader (226) and format unit tests pass. Not run with
the title.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants