Report bound descriptor tables accurately in DRED breadcrumbs #1233

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

@⁠Jitheswar on GitHub · 2026-11-24 16:37 UTC · original
gpu-dred-table-bindings → main · +113 −30 · 1 files · 1 commits · closed without merging

The device-removed (DRED) report names what each draw or dispatch was bound with. For user data it recomputed each value from the title's current state and read every table value as value / 32, an index into the first bound heap (heaps[0]). That's wrong in three common cases, and they mislead exactly when the report matters:

  • A table rebuilt for the draw (fresh dynamic slots) was described as whatever title slot happened to sit at that offset.
  • A sampler table was looked up in the view heap.
  • A table slot the title never set was shown as heap index 0's contents.

What changes

  • While binding (only when DRED is on), the draw records the user-data values it actually sent to each stage and which tables were rebuilt for it.
  • The report then describes each value from that record:
    • constants by value;
    • rebuilt tables as [rebuilt view table base N];
    • title tables by the heap they're actually in (view or sampler) and the slot they start at, with that slot's host view;
    • unset tables as [unbound table].
  • Upstream's detail for a view the host never made (the title's own words at that slot) is kept, now read from the right heap.
  • "tables" in the report is renamed "title tables", since it lists the title's tables, not the bound ones.

Test: draw::breadcrumb_tests::breadcrumbs_distinguish_constants_rebuilt_tables_and_missing_tables (diagnostics feature, synthetic state).

Rebased onto upstream by hand: bind() was restructured for the page table and root views. Windows-target clippy -D warnings is clean with and without diagnostics. victory-gpu --features diagnostics on an RTX 3050 6 GB (Linux, Proton 11, vkd3d-proton): 72 passed / 10 failed. The same 10 fail on plain upstream on that host (view heap capped at 1,000,000), and the breadcrumb test passes. Not run in the game for this change.

AI-assisted (Claude Code).

🤖 Generated with Claude Code

**@⁠Jitheswar** on GitHub · 2026-11-24 16:37 UTC · [original](https://github.com/Marvisak/VIctory/pull/1233) `gpu-dred-table-bindings` → `main` · +113 −30 · 1 files · 1 commits · closed without merging The device-removed (DRED) report names what each draw or dispatch was bound with. For user data it recomputed each value from the title's current state and read every table value as `value / 32`, an index into the first bound heap (`heaps[0]`). That's wrong in three common cases, and they mislead exactly when the report matters: - A table **rebuilt for the draw** (fresh dynamic slots) was described as whatever title slot happened to sit at that offset. - A **sampler table** was looked up in the view heap. - A table slot the title **never set** was shown as heap index 0's contents. **What changes** - While binding (only when DRED is on), the draw records the user-data values it actually sent to each stage and which tables were rebuilt for it. - The report then describes each value from that record: - constants by value; - rebuilt tables as `[rebuilt view table base N]`; - title tables by the heap they're actually in (view or sampler) and the slot they start at, with that slot's host view; - unset tables as `[unbound table]`. - Upstream's detail for a view the host never made (the title's own words at that slot) is kept, now read from the right heap. - "tables" in the report is renamed "title tables", since it lists the title's tables, not the bound ones. **Test:** `draw::breadcrumb_tests::breadcrumbs_distinguish_constants_rebuilt_tables_and_missing_tables` (diagnostics feature, synthetic state). Rebased onto upstream by hand: `bind()` was restructured for the page table and root views. Windows-target clippy `-D warnings` is clean with and without `diagnostics`. `victory-gpu --features diagnostics` on an RTX 3050 6 GB (Linux, Proton 11, vkd3d-proton): 72 passed / 10 failed. The same 10 fail on plain upstream on that host (view heap capped at 1,000,000), and the breadcrumb test passes. Not run in the game for this change. AI-assisted (Claude Code). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Rebased onto 70564ae: the report keeps upstream's title words for a
view the host never made, now read from the heap the table is in.

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

@⁠MichaelSmithAI on GitHub · 2026-11-24 16:49 UTC · original

We compared the dispatch marker on this PR and its base on an RTX 4090 under Wine/GE 3.2. A guest command list bound a CBV that required a rebuilt table, a UAV in the adjacent slot, and a separate scalar root constant. On both revisions the shader wrote 18 to the expected texel (17 from the CBV plus 1 from the root constant).

On the base, the marker printed u0=0x0 [heap 0: null] for that working table and described heap slot 1 beside the scalar. With this PR it printed u0=0x40 [rebuilt view table base 2] u1=0x1. That matches the byte offset sent to the shader and keeps the scalar readable.

For interpreting #1216 and #1222, the remaining distinction is the identity of an individual resource. The fixture independently knew the destination texture and checked its contents. The marker’s title tables entry gave its shape and format (uav 2x2 f42), while the rebuilt-table annotation gave the base. Two same-shaped UAVs would still need another identifier to tell them apart in the log.

**@⁠MichaelSmithAI** on GitHub · 2026-11-24 16:49 UTC · [original](https://github.com/Marvisak/VIctory/pull/1233#issuecomment-7138263828) We compared the dispatch marker on this PR and its base on an RTX 4090 under Wine/GE 3.2. A guest command list bound a CBV that required a rebuilt table, a UAV in the adjacent slot, and a separate scalar root constant. On both revisions the shader wrote 18 to the expected texel (17 from the CBV plus 1 from the root constant). On the base, the marker printed `u0=0x0 [heap 0: null]` for that working table and described heap slot 1 beside the scalar. With this PR it printed `u0=0x40 [rebuilt view table base 2] u1=0x1`. That matches the byte offset sent to the shader and keeps the scalar readable. For interpreting #1216 and #1222, the remaining distinction is the identity of an individual resource. The fixture independently knew the destination texture and checked its contents. The marker’s `title tables` entry gave its shape and format (`uav 2x2 f42`), while the rebuilt-table annotation gave the base. Two same-shaped UAVs would still need another identifier to tell them apart in the log.
Author
Owner

@⁠Zipettte on GitHub · 2026-11-24 17:59 UTC · original

Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 312ff56: cargo test -p victory-gpu passes, 50 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).

Tested with AI assistance (Claude).

**@⁠Zipettte** on GitHub · 2026-11-24 17:59 UTC · [original](https://github.com/Marvisak/VIctory/pull/1233#issuecomment-7140001875) Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 312ff56: `cargo test -p victory-gpu` passes, 50 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed). _Tested with AI assistance (Claude)._
Author
Owner

@⁠Jitheswar on GitHub · 2026-11-24 22:57 UTC · original

Rebased onto 70564ae as 3575db4. Upstream's restructured bind() (page table, root views, heap binding) meant reapplying the change by hand. The report keeps upstream's new detail for a slot the host never made (the title's words there), now read from the heap the table is actually in instead of always heap 0. Windows-target clippy -D warnings passes with and without diagnostics. On an RTX 3050 (Proton 11, vkd3d-proton) victory-gpu --features diagnostics gives 72 passed / 10 failed: the same 10 that fail on plain 70564ae on this host (view heap capped at 1,000,000), and the breadcrumb test passes. AI-assisted (Claude Code).

**@⁠Jitheswar** on GitHub · 2026-11-24 22:57 UTC · [original](https://github.com/Marvisak/VIctory/pull/1233#issuecomment-7146851214) Rebased onto `70564ae` as `3575db4`. Upstream's restructured `bind()` (page table, root views, heap binding) meant reapplying the change by hand. The report keeps upstream's new detail for a slot the host never made (the title's words there), now read from the heap the table is actually in instead of always heap 0. Windows-target clippy `-D warnings` passes with and without `diagnostics`. On an RTX 3050 (Proton 11, vkd3d-proton) `victory-gpu --features diagnostics` gives 72 passed / 10 failed: the same 10 that fail on plain `70564ae` on this host (view heap capped at 1,000,000), and the breadcrumb test passes. AI-assisted (Claude Code).
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 01:20 UTC · original

Automated triage for the maintainers.

Merge candidate. This is a diagnostics-only change to the DRED draw/dispatch markers in crates/victory-gpu/src/draw.rs. Today State::op_text reads every table value as an index into heap 0, so a table rebuilt for the draw, or one in another heap, is misreported. The PR records each stage's user data as bound in bind (BoundUserData, only while VICTORY_D3D12_DRED is on) and prints it through note_user_data. A rebuilt table shows its fresh base, a bound table its own heap and slot (with the "title words" detail now read from that heap), and an unset table shows as unbound. I checked that bind pushes one entry per stage before any point where op_text can run, and that HostList::note builds the text only with DRED on. Emulation behaviour does not change. One tester's fixture shows the old marker was wrong and the new one matches the offset sent to the shader.

Please add a short PR description. The body is empty.

CI: no check runs on the head commit.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 01:20 UTC · [original](https://github.com/Marvisak/VIctory/pull/1233#issuecomment-7149442213) <!-- victory-triage v1 head=3575db403056776b510d49cbb2520a5a77a0e24d verdict=merge-candidate at=2026-11-25T01:20:09Z --> Automated triage for the maintainers. **Merge candidate.** This is a diagnostics-only change to the DRED draw/dispatch markers in `crates/victory-gpu/src/draw.rs`. Today `State::op_text` reads every table value as an index into heap 0, so a table rebuilt for the draw, or one in another heap, is misreported. The PR records each stage's user data as bound in `bind` (`BoundUserData`, only while `VICTORY_D3D12_DRED` is on) and prints it through `note_user_data`. A rebuilt table shows its fresh base, a bound table its own heap and slot (with the "title words" detail now read from that heap), and an unset table shows as unbound. I checked that `bind` pushes one entry per stage before any point where `op_text` can run, and that `HostList::note` builds the text only with DRED on. Emulation behaviour does not change. One tester's fixture shows the old marker was wrong and the new one matches the offset sent to the shader. Please add a short PR description. The body is empty. CI: no check runs on the head commit. --- _Generated by [Claude Code](https://claude.ai/code)_

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!1233
No description provided.