[Ready to merge] GPU diagnostics: a heap slot says which host resource it views #895
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory#895
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@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,
d634ae9and915dd1b, on top offfe310e; the second also puts the same suffix on the per-drawreadsline).What it does
HostHeap::describe_slotalready prints the title view a heap slot holds, which is what the black-frame draw trace uses (VICTORY_LOG=info,victory_gpu::draw=debug, thenblack frame <n>: ...lines). For textures that text stops at the view's own words, for example: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 nonewhen the slot holds no resource: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 0draws,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.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.
@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 reportednull.The ordinary
black frame … readsline still callsState::readsbefore binding. That method formats the guest view. The caller ofHostHeap::describe_slotisState::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 callerFor the #850 example,
dim 1 1584x1 f0describes a 1,584-byte buffer. The zero format belongs to the resource description. The SRV has its own format. The reporter also identifieddfafaf385b2f94e8as the vertex shader and reported zero resource bindings for its paired pixel shader06295fb1d1aefb78. 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@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:
915dd1badds the same suffix toState::readsthrough a smallHostHeap::host_resource, so the quotedblack frame ... readsline carries it too. Before that commit, the draw debug log alone indeed could not show it - the only caller ofdescribe_slotwasop_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 fromd634ae9. That was my mistake in the report, and the branch now matches it. Build andcargo test -p victory-gpu --lib --features diagnostics(55 passed, 0 failed, 1 ignored) are on915dd1b.You are also right that
dim 1 1584x1 f0is 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 thedim 4ones (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
readsfromStage::usedbeforetables()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 aftermake_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 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:
Both commits are on
ffe310e(currentmainat the time of writing), touch onlycrates/victory-gpu/src/descriptor/host.rsandcrates/victory-gpu/src/draw.rs, and the second one is the fix MichaelSmithAI pointed at: the per-drawreadsline now carries the host suffix too.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.
@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_slotincrates/victory-gpu/src/descriptor/host.rsadds 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 withmain. 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
@rpmaster2 on GitHub · 2026-11-25 13:07 UTC · original
This is addressed by #1449, which is a merge candidate with
Co-authored-by: @rpmaster2pointing back here - thank you @fuzeofficlal.For the record, so the two versions are comparable: my branch did the same two changes (
describe_slotplusState::readsthroughHostHeap::host_resource) and I verified it in game rather than only in tests:black frame ... readsline then printshost 1584x1 f0 mips 1/host noneper 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;Their version is better in two respects I did not handle: dynamic and stale slots, and
State::readsresolving throughheap_of/Heap::indexso 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.