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

Open
Jesper-Andersson wants to merge 1 commit from upstream-pr/360 into main
Jesper-Andersson commented 2026-11-26 18:47:57 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by Jesper-Andersson on 2026-11-26T18:47:57Z.


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

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:issue:5515512445 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/360). Originally posted by [Jesper-Andersson](https://github.com/Jesper-Andersson) on 2026-11-26T18:47:57Z. --- 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).
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/360:upstream-pr/360'
git switch 'upstream-pr/360'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/360'
git switch 'upstream-pr/360'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/360'
git switch 'upstream-pr/360'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/360'
git switch 'main'
git merge --squash 'upstream-pr/360'
git switch 'main'
git merge --ff-only 'upstream-pr/360'
git switch 'main'
git merge 'upstream-pr/360'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
avatarmanz/VIctory-7900XTX!360
No description provided.