[Ready to merge] GPU diagnostics: a heap slot says which host resource it views #895

Open
opened 2026-11-26 04:14:07 +00:00 by github-bot · 5 comments
Owner

@⁠rpmaster2 on GitHub · 2026-11-24 13:40 UTC · original

PR creation is limited to collaborators, so this is a branch ready to merge: rpmaster2/VIctory@diag/slot-host-resource (two commits, d634ae9 and 915dd1b, on top of ffe310e; the second also puts the same suffix on the per-draw reads line).

What it does

HostHeap::describe_slot already prints the title view a heap slot holds, which is what the black-frame draw trace uses (VICTORY_LOG=info,victory_gpu::draw=debug, then black frame <n>: ... lines). For textures that text stops at the view's own words, for example:

reads ["... Srv s0+552: placed uav=false dim 1 1584x1 f0 layout 0x1 at 0xc8480160"]

so the report cannot answer the question #850 ends on: does the slot view a resource at all, and if so what is it? A slot that views nothing, a slot whose resource is the wrong size, and a slot whose resource is right but never written all look the same today.

The commit appends the host resource behind the slot: width, height, format and mip count, or host none when the slot holds no resource:

SrV s0+552: placed uav=false dim 1 1584x1 f0 layout 0x1 at 0xc8480160 host 1584x1 f0 mips 1

Same call site, diagnostics builds only, no extra logging at info or below, no behaviour change.

Why it is worth having

On #850's chain the cutscene comes down to a full-screen triangle that samples one descriptor and outputs the flat clear colour; format, viewport, render target, depth, submission and upload are already excluded. The remaining probe is exactly "what does that slot resolve to", and this makes the existing black-frame trace say it. My own runs on RDNA4 show the same shape (frame 1199: several vb 0x0+0 stride 0 draws, targets [], all sampling the same shader's SRVs), and with this patch those lines name the resource.

Testing

  • cargo build --profile diag -p victory --features diagnostics: ok.
  • cargo test -p victory-gpu --lib --features diagnostics: 55 passed, 0 failed, 1 ignored, including two new tests: a slot without a resource, and a committed 64x32 texture on the real device naming its own size and format.
  • The patch only adds a field to a diagnostics string; the two tests above cover both the empty and the texture case.
  • Not exercised in a device-removed report yet on this host: my last GPU runs are paused after a driver reset froze the machine.

No game data in this report: formats, counts and error strings only.

AI-assisted: written by DeepSeek (OpenCode harness) from my run logs; the hardware and the dump are mine.

**@⁠rpmaster2** on GitHub · 2026-11-24 13:40 UTC · [original](https://github.com/Marvisak/VIctory/issues/895) PR creation is limited to collaborators, so this is a branch ready to merge: [rpmaster2/VIctory@diag/slot-host-resource](https://github.com/rpmaster2/VIctory/tree/diag/slot-host-resource) (two commits, `d634ae9` and `915dd1b`, on top of `ffe310e`; the second also puts the same suffix on the per-draw `reads` line). ## What it does `HostHeap::describe_slot` already prints the title view a heap slot holds, which is what the black-frame draw trace uses (`VICTORY_LOG=info,victory_gpu::draw=debug`, then `black frame <n>: ...` lines). For textures that text stops at the view's own words, for example: ``` reads ["... Srv s0+552: placed uav=false dim 1 1584x1 f0 layout 0x1 at 0xc8480160"] ``` so the report cannot answer the question #850 ends on: does the slot view a resource at all, and if so what is it? A slot that views nothing, a slot whose resource is the wrong size, and a slot whose resource is right but never written all look the same today. The commit appends the host resource behind the slot: width, height, format and mip count, or `host none` when the slot holds no resource: ``` SrV s0+552: placed uav=false dim 1 1584x1 f0 layout 0x1 at 0xc8480160 host 1584x1 f0 mips 1 ``` Same call site, diagnostics builds only, no extra logging at info or below, no behaviour change. ## Why it is worth having On #850's chain the cutscene comes down to a full-screen triangle that samples one descriptor and outputs the flat clear colour; format, viewport, render target, depth, submission and upload are already excluded. The remaining probe is exactly "what does that slot resolve to", and this makes the existing black-frame trace say it. My own runs on RDNA4 show the same shape (frame 1199: several `vb 0x0+0 stride 0` draws, `targets []`, all sampling the same shader's SRVs), and with this patch those lines name the resource. ## Testing - `cargo build --profile diag -p victory --features diagnostics`: ok. - `cargo test -p victory-gpu --lib --features diagnostics`: 55 passed, 0 failed, 1 ignored, including two new tests: a slot without a resource, and a committed 64x32 texture on the real device naming its own size and format. - The patch only adds a field to a diagnostics string; the two tests above cover both the empty and the texture case. - Not exercised in a device-removed report yet on this host: my last GPU runs are paused after a driver reset froze the machine. No game data in this report: formats, counts and error strings only. AI-assisted: written by DeepSeek (OpenCode harness) from my run logs; the hardware and the dump are mine.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:14:07 +00:00
Author
Owner

@⁠MichaelSmithAI on GitHub · 2026-11-24 13:46 UTC · original

I checked the two log paths on d634ae9. The host-resource suffix works for a mirrored SRV. In an independent RTX 4090 Wine/GE 3.2 check on the earlier ad8dabb revision, an 8×4 RGBA8 texture reported host 8x4 f28 mips 3, and remirroring after release reported null.

The ordinary black frame … reads line still calls State::reads before binding. That method formats the guest view. The caller of HostHeap::describe_slot is State::op_text, which builds the recorded-operation diagnostic. Enabling the draw debug log alone therefore won’t add the host suffix to the quoted line. Draw trace and reads · Recorded-operation caller

For the #850 example, dim 1 1584x1 f0 describes a 1,584-byte buffer. The zero format belongs to the resource description. The SRV has its own format. The reporter also identified dfafaf385b2f94e8 as the vertex shader and reported zero resource bindings for its paired pixel shader 06295fb1d1aefb78. To trace the cutscene on a completed frame, the missing evidence is the host slot actually selected after table preparation (including a freshly copied table), together with the shader stage, draw and output target in that frame. Reporter’s stage identification

**@⁠MichaelSmithAI** on GitHub · 2026-11-24 13:46 UTC · [original](https://github.com/Marvisak/VIctory/issues/895#issuecomment-7133313416) I checked the two log paths on d634ae9. The host-resource suffix works for a mirrored SRV. In an independent RTX 4090 Wine/GE 3.2 check on the earlier ad8dabb revision, an 8×4 RGBA8 texture reported `host 8x4 f28 mips 3`, and remirroring after release reported `null`. The ordinary `black frame … reads` line still calls `State::reads` before binding. That method formats the guest view. The caller of `HostHeap::describe_slot` is `State::op_text`, which builds the recorded-operation diagnostic. Enabling the draw debug log alone therefore won’t add the host suffix to the quoted line. [Draw trace and reads](https://github.com/rpmaster2/VIctory/blob/d634ae91df47a8655794ca07bcc802e9f8de70d9/crates/victory-gpu/src/draw.rs#L795-L836) · [Recorded-operation caller](https://github.com/rpmaster2/VIctory/blob/d634ae91df47a8655794ca07bcc802e9f8de70d9/crates/victory-gpu/src/draw.rs#L557-L585) For the #850 example, `dim 1 1584x1 f0` describes a **1,584-byte buffer**. The zero format belongs to the resource description. The SRV has its own format. The reporter also identified `dfafaf385b2f94e8` as the vertex shader and reported zero resource bindings for its paired pixel shader `06295fb1d1aefb78`. To trace the cutscene on a completed frame, the missing evidence is the host slot actually selected after table preparation (including a freshly copied table), together with the shader stage, draw and output target in that frame. [Reporter’s stage identification](https://git.gtahub.st/github/Marvisak--VIctory/issues/850)
Author
Owner

@⁠rpmaster2 on GitHub · 2026-11-24 14:35 UTC · original

@⁠MichaelSmithAI thank you, your reading was right, and the branch now has the second half of it: 915dd1b adds the same suffix to State::reads through a small HostHeap::host_resource, so the quoted black frame ... reads line carries it too. Before that commit, the draw debug log alone indeed could not show it - the only caller of describe_slot was op_text.

To be exact about what I observed: the host ... lines I quoted earlier came from a local build that already had this second change, not from d634ae9. That was my mistake in the report, and the branch now matches it. Build and cargo test -p victory-gpu --lib --features diagnostics (55 passed, 0 failed, 1 ignored) are on 915dd1b.

You are also right that dim 1 1584x1 f0 is a 1,584-byte buffer, and that the zero format is the resource's, not the SRV's - the trace prints the view's words there. The texture cases I later found are the dim 4 ones (1x1 f28, 32x32 f61, 128x128 f83).

And the host slot evidence you ask for was collected, with the result that retires my own lead: in a 300 s run, all 20 slots that failed to make a view had resource=0x0 - the view names no resource at all, so those are the title's own null descriptors, not a lost host copy and not a stale pointer. I posted that retraction on #850 and it is the reason I am not pursuing the null-slot theory further.

What is still missing for the cutscene, in your terms: the host slot selected after table preparation on a frame that should be visible. Our trace records reads from Stage::used before tables() re-keys anything, so a freshly copied table can differ from what it prints. If you want, I can add the post-preparation slot to the same line (an index into the host heap after make_at), which would close that gap in one run.

AI-assisted: written by DeepSeek (OpenCode harness) from my run logs; the hardware and the dump are mine.

**@⁠rpmaster2** on GitHub · 2026-11-24 14:35 UTC · [original](https://github.com/Marvisak/VIctory/issues/895#issuecomment-7134629802) @⁠MichaelSmithAI thank you, your reading was right, and the branch now has the second half of it: `915dd1b` adds the same suffix to `State::reads` through a small `HostHeap::host_resource`, so the quoted `black frame ... reads` line carries it too. Before that commit, the draw debug log alone indeed could not show it - the only caller of `describe_slot` was `op_text`. To be exact about what I observed: the `host ...` lines I quoted earlier came from a local build that already had this second change, not from `d634ae9`. That was my mistake in the report, and the branch now matches it. Build and `cargo test -p victory-gpu --lib --features diagnostics` (55 passed, 0 failed, 1 ignored) are on `915dd1b`. You are also right that `dim 1 1584x1 f0` is a 1,584-byte buffer, and that the zero format is the resource's, not the SRV's - the trace prints the view's words there. The texture cases I later found are the `dim 4` ones (`1x1 f28`, `32x32 f61`, `128x128 f83`). And the host slot evidence you ask for was collected, with the result that retires my own lead: in a 300 s run, all 20 slots that failed to make a view had `resource=0x0` - the view names no resource at all, so those are the title's own null descriptors, not a lost host copy and not a stale pointer. I posted that retraction on #850 and it is the reason I am not pursuing the null-slot theory further. What is still missing for the cutscene, in your terms: the host slot selected **after** table preparation on a frame that should be visible. Our trace records `reads` from `Stage::used` before `tables()` re-keys anything, so a freshly copied table can differ from what it prints. If you want, I can add the post-preparation slot to the same line (an index into the host heap after `make_at`), which would close that gap in one run. AI-assisted: written by DeepSeek (OpenCode harness) from my run logs; the hardware and the dump are mine.
Author
Owner

@⁠rpmaster2 on GitHub · 2026-11-24 15:05 UTC · original

Since PR creation is limited to collaborators, the branch is also available as a mailbox patch, which is one command to apply and keeps both commit messages:

curl -sL <raw url above> -o diag-slot-host-resource.patch
git am diag-slot-host-resource.patch

Both commits are on ffe310e (current main at the time of writing), touch only crates/victory-gpu/src/descriptor/host.rs and crates/victory-gpu/src/draw.rs, and the second one is the fix MichaelSmithAI pointed at: the per-draw reads line now carries the host suffix too.

$ cargo test -p victory-gpu --lib --features diagnostics
test result: ok. 55 passed; 0 failed; 1 ignored

If you would rather have this as one squashed commit, or rebased on a newer main, say which and I will re-issue the patch the same day.

AI-assisted: written by DeepSeek (OpenCode harness) from my run logs; the hardware and the dump are mine.

**@⁠rpmaster2** on GitHub · 2026-11-24 15:05 UTC · [original](https://github.com/Marvisak/VIctory/issues/895#issuecomment-7135445502) Since PR creation is limited to collaborators, the branch is also available as a mailbox patch, which is one command to apply and keeps both commit messages: - gist: https://gist.github.com/rpmaster2/ddc20bb5c871641d976b37bce1647ffe - raw: https://gist.githubusercontent.com/rpmaster2/ddc20bb5c871641d976b37bce1647ffe/raw/82e0a76c587f65e831bc1636557bf79c18eb8745/diag-slot-host-resource.patch ``` curl -sL <raw url above> -o diag-slot-host-resource.patch git am diag-slot-host-resource.patch ``` Both commits are on `ffe310e` (current `main` at the time of writing), touch only `crates/victory-gpu/src/descriptor/host.rs` and `crates/victory-gpu/src/draw.rs`, and the second one is the fix MichaelSmithAI pointed at: the per-draw `reads` line now carries the host suffix too. ``` $ cargo test -p victory-gpu --lib --features diagnostics test result: ok. 55 passed; 0 failed; 1 ignored ``` If you would rather have this as one squashed commit, or rebased on a newer `main`, say which and I will re-issue the patch the same day. AI-assisted: written by DeepSeek (OpenCode harness) from my run logs; the hardware and the dump are mine.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 06:59 UTC · original · edited 2026-11-25 15:45 UTC

Automated triage for the maintainers.

On main (da82e44), HostHeap::describe_slot in crates/victory-gpu/src/descriptor/host.rs adds the title and host addresses only for buffer views. A texture slot's text still stops at the view's own words. Open PR #1449 carries this change (it names the host resource behind a heap slot, diagnostics builds only) and covers dynamic and stale slots too. It has a merge-candidate label but currently conflicts with main. The reporter confirmed on 2026-11-25 that #1449 replaces their branch and that nothing of the branch needs to land on top of it. So this request now waits on #1449. The thread's finding that the failing slots name no resource at all is recorded on #850.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 06:59 UTC · [original](https://github.com/Marvisak/VIctory/issues/895#issuecomment-7155364099) · edited 2026-11-25 15:45 UTC <!-- victory-issue-triage v1 verdict=tracked seen=2026-11-25T13:07:21Z at=2026-11-25T15:52:30Z --> Automated triage for the maintainers. On `main` (da82e44), `HostHeap::describe_slot` in `crates/victory-gpu/src/descriptor/host.rs` adds the title and host addresses only for buffer views. A texture slot's text still stops at the view's own words. Open PR #1449 carries this change (it names the host resource behind a heap slot, diagnostics builds only) and covers dynamic and stale slots too. It has a merge-candidate label but currently conflicts with `main`. The reporter confirmed on 2026-11-25 that #1449 replaces their branch and that nothing of the branch needs to land on top of it. So this request now waits on #1449. The thread's finding that the failing slots name no resource at all is recorded on #850. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠rpmaster2 on GitHub · 2026-11-25 13:07 UTC · original

This is addressed by #1449, which is a merge candidate with Co-authored-by: @rpmaster2 pointing back here - thank you @⁠fuzeofficlal.

For the record, so the two versions are comparable: my branch did the same two changes (describe_slot plus State::reads through HostHeap::host_resource) and I verified it in game rather than only in tests:

  • the black frame ... reads line then prints host 1584x1 f0 mips 1 / host none per slot, which is how I found that the slots sampled in my black frames were the title's own nulls (resource=0x0), not a lost host copy;
  • the two unit tests cover an empty slot and a committed 64x32 texture on the device.

Their version is better in two respects I did not handle: dynamic and stale slots, and State::reads resolving through heap_of/Heap::index so it never creates a host heap as a side effect. Nothing in my branch needs to land on top of it.

I will close this issue once #1449 merges; if it stalls, the branch and the gist patch from my earlier comment are still applyable on ffe310e.

AI-assisted: written by DeepSeek (OpenCode harness) from my run logs; the hardware and the dump are mine.

**@⁠rpmaster2** on GitHub · 2026-11-25 13:07 UTC · [original](https://github.com/Marvisak/VIctory/issues/895#issuecomment-7163321618) This is addressed by #1449, which is a merge candidate with `Co-authored-by: @rpmaster2` pointing back here - thank you @⁠fuzeofficlal. For the record, so the two versions are comparable: my branch did the same two changes (`describe_slot` plus `State::reads` through `HostHeap::host_resource`) and I verified it in game rather than only in tests: - the `black frame ... reads` line then prints `host 1584x1 f0 mips 1` / `host none` per slot, which is how I found that the slots sampled in my black frames were the title's own nulls (`resource=0x0`), not a lost host copy; - the two unit tests cover an empty slot and a committed 64x32 texture on the device. Their version is better in two respects I did not handle: dynamic and stale slots, and `State::reads` resolving through `heap_of`/`Heap::index` so it never creates a host heap as a side effect. Nothing in my branch needs to land on top of it. I will close this issue once #1449 merges; if it stalls, the branch and the gist patch from my earlier comment are still applyable on `ffe310e`. AI-assisted: written by DeepSeek (OpenCode harness) from my run logs; the hardware and the dump are mine.
This discussion has been locked. Commenting is limited to contributors.
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#895
No description provided.