Diagnostics: an indirect draw's "prepare failed" names the exit that dropped it #360

Open
github-bot wants to merge 1 commit from github-bot/gh-360 into main AGit
Owner

@⁠Jesper-Andersson on GitHub · 2026-11-26 18:47 UTC · original
Jesper-Andersson:worktree-issue-70 → main · +28 −11 · 1 files · 1 commits · open

Refs #70, #35.

An indirect draw or dispatch that can't be prepared is counted as indirect kind <k>: prepare failed, with no word on why (crates/victory-gpu/src/draw.rs, State::execute_indirect). State::prepare_for and State::bind have about a dozen ways to give false, and most of them log only once per run (once!), two of them not at all. #70 (RTX 4070 Ti SUPER) reports up to 3,627 such drops in a frame, and an RTX 2070 SUPER shows the same, with no way to tell which exit they come from.

Change

  • Each exit of prepare_for, bind, root_uav and root_srv_table that drops the draw records a short reason in a thread-local (not_bound). The indirect path reads it, and the drop reason becomes prepare failed (<why>), for example prepare failed (descriptor table: no free slots). The per-frame drop summary then counts each exit on its own line, with no new counter.
  • The reasons: pipeline skipped, no host pipeline, another kind of pipeline, index buffer outside title buffers, descriptor table: no free slots, title memory by address: no view heap, root UAV: nothing to bind / no view heap / no free slot, root SRV: no view heap / no free slot.
  • root UAV: no free slot and root SRV: no free slot (host.dynamic(1) giving none) were silent before.
  • Diagnostics builds only. Without --features diagnostics the thread-local isn't compiled, not_bound just gives false, and the drop text stays prepare failed.

Where it does nothing

  • Builds without diagnostics: the same exits, the same results.
  • Which draws run: only the text of the drop reason changes. Each exit gives false exactly where it did before.

Measured

RTX 2070 SUPER 8 GB (driver 621.14), Ryzen 7 5800X, 32 GB, Windows 11, diag build, scripts\play.ps1 defaults, prologue.

With this change (on main c9c932c plus a local merge of PR #237 and other open PRs, about 3.5 minutes), every indirect drop had one reason:

dropped 354.0/frame without a host pipeline: indirect kind 2: prepare failed (descriptor table: no free slots)
dropped 55.0/frame without a host pipeline: indirect kind 10: prepare failed (descriptor table: no free slots)
dropped 4.0/frame without a host pipeline: indirect kind 0: prepare failed (descriptor table: no free slots)

That's the dynamic descriptor pool running out (#35), not the indirect clamp. Details are in #70. It has no effect on frame time: it's a diagnostics label.

Checks

  • cargo build --locked --profile diag -p victory --features diagnostics: builds; used for the run above.
  • cargo clippy --locked -p victory-gpu, with and without --features diagnostics: nothing in changed code. The only warning is main's open doesn't need a mutable reference (#241, fixed by #324).
  • cargo xtask policy (pre-commit hook): 1 files ok.
  • cargo test: not run. Another test was using this PC at the time.
  • In game: yes, the run above.

Not checked

  • AMD hosts and Linux/Proton.
  • A run of this exact branch (main plus this commit alone). The in-game run was on the local merge described above. This commit's diff applies to main unchanged.
  • #35 and its PRs #42, #47, #48, #237, and #332: they work on the dynamic slots themselves. This PR only names the exit, so their effect can be seen per reason.
  • #10 touches indirect.rs (dispatch splitting). It doesn't overlap.

This change was made with AI assistance (Claude Code).

**@⁠Jesper-Andersson** on GitHub · 2026-11-26 18:47 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/360) `Jesper-Andersson:worktree-issue-70` → `main` · +28 −11 · 1 files · 1 commits · open Refs #70, #35. An indirect draw or dispatch that can't be prepared is counted as `indirect kind <k>: prepare failed`, with no word on why (`crates/victory-gpu/src/draw.rs`, `State::execute_indirect`). `State::prepare_for` and `State::bind` have about a dozen ways to give false, and most of them log only once per run (`once!`), two of them not at all. #70 (RTX 4070 Ti SUPER) reports up to 3,627 such drops in a frame, and an RTX 2070 SUPER shows the same, with no way to tell which exit they come from. ## Change - Each exit of `prepare_for`, `bind`, `root_uav` and `root_srv_table` that drops the draw records a short reason in a thread-local (`not_bound`). The indirect path reads it, and the drop reason becomes `prepare failed (<why>)`, for example `prepare failed (descriptor table: no free slots)`. The per-frame drop summary then counts each exit on its own line, with no new counter. - The reasons: pipeline skipped, no host pipeline, another kind of pipeline, index buffer outside title buffers, descriptor table: no free slots, title memory by address: no view heap, root UAV: nothing to bind / no view heap / no free slot, root SRV: no view heap / no free slot. - `root UAV: no free slot` and `root SRV: no free slot` (`host.dynamic(1)` giving none) were silent before. - Diagnostics builds only. Without `--features diagnostics` the thread-local isn't compiled, `not_bound` just gives false, and the drop text stays `prepare failed`. ## Where it does nothing - Builds without diagnostics: the same exits, the same results. - Which draws run: only the text of the drop reason changes. Each exit gives false exactly where it did before. ## Measured RTX 2070 SUPER 8 GB (driver 621.14), Ryzen 7 5800X, 32 GB, Windows 11, diag build, `scripts\play.ps1` defaults, prologue. With this change (on main `c9c932c` plus a local merge of PR #237 and other open PRs, about 3.5 minutes), every indirect drop had one reason: ``` dropped 354.0/frame without a host pipeline: indirect kind 2: prepare failed (descriptor table: no free slots) dropped 55.0/frame without a host pipeline: indirect kind 10: prepare failed (descriptor table: no free slots) dropped 4.0/frame without a host pipeline: indirect kind 0: prepare failed (descriptor table: no free slots) ``` That's the dynamic descriptor pool running out (#35), not the indirect clamp. Details are in #70. It has no effect on frame time: it's a diagnostics label. ## Checks - `cargo build --locked --profile diag -p victory --features diagnostics`: builds; used for the run above. - `cargo clippy --locked -p victory-gpu`, with and without `--features diagnostics`: nothing in changed code. The only warning is main's `open` doesn't need a mutable reference (#241, fixed by #324). - `cargo xtask policy` (pre-commit hook): 1 files ok. - `cargo test`: not run. Another test was using this PC at the time. - In game: yes, the run above. ## Not checked - AMD hosts and Linux/Proton. - A run of this exact branch (main plus this commit alone). The in-game run was on the local merge described above. This commit's diff applies to main unchanged. ## Related - #35 and its PRs #42, #47, #48, #237, and #332: they work on the dynamic slots themselves. This PR only names the exit, so their effect can be seen per reason. - #10 touches `indirect.rs` (dispatch splitting). It doesn't overlap. This change was made with AI assistance (Claude Code).
The drop reason becomes "prepare failed (<why>)": no host pipeline, a
descriptor table or root SRV/UAV with no free slot, no view heap, an index
buffer outside title buffers. The root SRV and UAV slot exits logged nothing
before. Diagnostics builds only; other builds are unchanged. (#70)

This change was made with AI assistance (Claude Code).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 18:52:03 +00:00
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/360/head:github-bot/gh-360'
git switch 'github-bot/gh-360'

Merge

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