Ped skinning on RTX 5070 Ti reads zeros from a populated bindless vertex buffer when the host slot is null #1567
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#1567
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?
@YouKnowWh on GitHub · 2026-11-24 19:14 UTC · original
On an RTX 5070 Ti (driver 621.14, Windows, Series X mode), the ped skinning compute shader selected a bindless raw vertex buffer from a CBV at byte offset 0x40. In a local diagnostics build, its selected host slot was null even though the title buffer contained nonzero vertex data. This provides a live case for #413 and the scalar heap-buffer translation discussed in #1015.
How to check this on another build
After extending the local handling to _4 and _8, one run of the instrumented stack recorded 14,521 sampled triangles with nonzero projected area for mesh ef5409053e14aa82 / pixel 94d281151ca58b4f. Pipeline statistics for the tracked indirect mesh draws recorded 634,040 pixel shader invocations across two fences. All 122 sampled groups had allocations matching the vertex and primitive counts in the meshlet record. Another run reached only empty draws. The process still eventually reported device removal.
These are GPU measurements. Final composite visibility was not checked. The local stack also includes mesh and culling translation changes and aligned structured SRV handling related to #984 and #986. Scene scheduling varied, and the host materialization and scalar lowering changes were tested together. An independent check of the source-word comparison on a current integration would help establish which changes are needed upstream.
AI-assisted local instrumentation and analysis. No game files attached.
@DrDarkDK on GitHub · 2026-11-24 19:46 UTC · original
I checked the exact
CS_PedStandardSkinning_7shader (fb332f777bae57fb) offline. The two scalar header loads at0x8cand0x94and the vector load at0x3204all use the same dynamically loaded descriptor.ffe310e: both scalar loads use CBV handles. The vector load uses a raw SRV.b8cfe8c): all three loads use a raw SRV.643aef6): same result as #1015 alone.All three builds emitted DXIL that passed validation, so validation alone misses this handle mismatch. This isolates the shader-lowering half of the report. I haven’t measured whether the host slot is populated at dispatch time or whether the GPU reads the expected vertex words.
AI-assisted with Codex.
@YouKnowWh on GitHub · 2026-11-24 20:06 UTC · original
Follow-up to the offline check above. I separated raw-SRV materialization/refresh on the host from scalar raw-SRV lowering and measured both on the RTX 5070 Ti. Same local instrumented executable and starting cache for all four configurations in each sweep. These are local diagnostics toggles, not isolated upstream PR builds.
For CS_PedStandardSkinning_7, the probe captured the four destination SGPRs immediately after each load and paired them with the selected source view at byte offsets 0x70 (PC 0x8c) and 0x60 (PC 0x94). Each entry below is exact four-word matches / paired lane observations. Both scalar PCs gave the same counts.
In all three failing configurations each paired source tuple had nonzero data and all four GPU words were zero. The first on/on run had no paired samples. Its repeat reached one sampled dispatch, so the positive scalar result has limited dispatch coverage. Unpaired lanes were excluded.
Separately, with the same four configurations in the same table order, the vector load at 0x3204 gave 0/112, 0/112, 176/176, and 144/144 exact two-word matches. Thus populating the slot alone restored that vector read on this stack, while the scalar header reads matched only with both changes enabled. Runs still eventually hit device removal. No final-image claim.
AI-assisted local instrumentation and analysis.
@YouKnowWh on GitHub · 2026-11-25 01:24 UTC · original
Follow-up — placed raw SRV creation and submit-time refresh
I traced the descriptor used by
CS_PedStandardSkinning_7(fb332f777bae57fb) back to its heap record and tested the slot lifecycle separately from shader translation. This updates the interpretation of the earlier RTX 5070 Ti report. The original observation stands for the instrumented build based one50ed36. I have not reproduced the same in-game fault ona9d233fe.Revision boundary on the actual shader
I built upstream 4f57f46f and its immediate child c75fdba39 separately. I added only trace prints at the two emission paths in the scalar-memory lowering function and ran
victory translate --validateon the same container. At both PCs, the parent emitted onecbufferLoadLegacy.i32; the child emitted fourrawBufferLoad.f32operations for the four dwords. Both outputs passed DXIL validation. This pins the translation change to one upstream commit. It does not require #1762. No pipeline was created and no game was launched in this comparison.The same commit narrows descriptor creation deferral from buffers/placed views to placed textures. A later, distinct change, 86a5ed6ba, mirrors shader-visible heap records copied as bytes before collecting uploads at submission. I do not know whether the original title slot reached the heap via an API write or byte copy.
I also rejoined the four historical _7 hardware logs by probe and shader-selected index, checked the 32-byte slot arithmetic, and compared the lane's pair of dwords at the captured byte offset. The two host-disabled runs each yielded 112 paired lane observations across seven distinct (fence, probe, index) tuples; all had zero cached keys and returned two zeros from nonzero source data. With host handling enabled, 176/176 (11 tuples) and 144/144 (9 tuples) matched, respectively without and with the scalar fix. For each positive pair the cached view's title address and length agreed with the guest source range and a host shadow address was found. That address is a software lookup, not an independent measurement of the GPU descriptor. The counts reuse previously reported runs.
Where the descriptor comes from
In the original GFX10 program, PC
0x40fetches the descriptor for the upstream constants. PC0x60reads the index from byte0x40of those constants intos32. PC0x6cmultiplies that index by 32 (bytes per heap slot), and PC0x70loads the selected descriptor intos[12:15]. The scalar loads at0x8cand0x94use it at offsets0x70and0x60. The vector load at0x3204uses the same descriptor registers with a per-lane byte offset.All 38 target-view log entries across the earlier four configurations reported a placed raw buffer SRV: buffer dimension, R32_TYPELESS, zero structure stride, RAW flag. These are 38 logged observations, not 38 distinct descriptors. The structured-to-raw conversion proposed by #1762 requires an UNKNOWN format and nonzero structure stride. That conversion does not apply to the sampled views here.
What the old “null slot” measurement meant
In the older stack,
describe_slotreturned “null” when its cached descriptor-generation key was zero. It was not a hardware descriptor readback. The code indescriptor/host.rsdeferred materialization when!for_draw && view.is_buffer();is_buffer()included everyView::Placed. This gives a concrete path from a populated title record to a zero host key and a null descriptor. The earlier diagnostic workaround forced mirroring and refreshed backing data together. The exact write/copy history of the slot in the failing title dispatch was not recorded.Controlled replay on
a9d233feWindows, Microsoft WARP, diagnostics build. No title execution. I adapted
bindless::tests::heap_views_are_currentto place a synthetic 256-byte raw buffer SRV at slot 36379 in a shader-visible heap backed by tracked memory. A small compute shader reads that slot through a table pointing to it. It does not run the title shader or reproduce its dynamic index calculation. Each round changes the title buffer after list recording and before submission, then compares all 64 output dwords.mirror(..., true)creates the key. No dispatch in this control.So the two mechanisms can be distinguished. On this revision a zero key before submission is expected for a byte-copied record. Submission calls
descriptor::sync_heaps()before collecting the uploads. A present key alone also does not establish that the buffer data was uploaded. Neither negative control demonstrates an in-game failure on this revision.Separately, on the exact title shader, an observation-only run of the translator at
a9d233feselectedheap_constants=true, srv=trueat both scalar PCs and emitted validator-accepted DXIL. No PSO or title dispatch was run for this check. The remaining hardware question is whether the selected slot and bytes are correct after heap sync and upload, on the first real dispatch. Before another game run, the synthetic replay can be independently repeated on another adapter. I would keep the historical result scoped to its build until that comparison exists.Repro for the attached test-only patch: start at
a9d233fe5d496b64737419ddf41056d8ab8d36b3, applylifecycle-reproducer.patch, setVICTORY_D3D12_WARP=1, and runcargo test -p victory-gpu --locked --features diagnostics --lib bindless::tests::heap_views_are_current -- --exact --nocapture --test-threads=1. Use a fresh process for each row. SetSKIN_DESCRIPTOR_REPLAY=apiorbytesfor the first two; for the controls useapiplus onlySKIN_OLD_DEFER=1or onlySKIN_NO_UPLOAD=1, respectively. The last row should fail its data assertion.Rebinding the same slot after recording
On the same revision and WARP adapter I also tested replacing the identity of the source buffer. The compute shader reads 64 dwords from a synthetic placed raw SRV. Its descriptor range is volatile. Each round closes the command list, writes distinct new patterns into both source buffers, changes the guest record, submits, and checks the cached host record identity and all 64 words of GPU output. The next round begins after readback of the previous round. This exercises ordered submissions, not overlapping queues.
At slot 36379 the requested sequence was A → B → null → A. I ran separate cases for direct placed-SRV creation, a 32-byte record copy, and direct creation followed by a byte copy on the A → B transition. Clearing the slot was a byte write in all cases. All four reads in each case matched; their first words were 1000, 21000, 0 and 4000. For the byte-copy transition the cached host record still identified A before submission and identified B after completion.
In the matched negative control I suppressed only the submit-time descriptor-heap scan in the mixed case. The A → B submission kept A. It returned A's freshly updated pattern (first word 2000, all 64 words checked), while the guest record selected B (first word 21000). This isolates stale descriptor identity despite fresh backing data. It is an intentionally induced failure. These tests do not establish that the old game dispatch missed this particular scan or that the same condition occurs on current hardware.
Reproduction: apply the standalone
rebind-reproducer.patchto the clean revision identified above; it includes the earlier fixture, so use it instead of stacking the two patches. Run the same test command withSKIN_REBIND=1and WARP. UseSKIN_DESCRIPTOR_REPLAY=apiorbytes; for the matched pair useapiwithSKIN_COPY_SECOND=1both times and addSKIN_SUPPRESS_SYNC=1only for the negative control. That control passes when the old A data is observed.AI-assisted analysis. The reproducer contains synthetic buffers and project test code only.
lifecycle-reproducer.patch (expand to copy)
rebind-reproducer.patch (expand to copy)
@Marvisak on GitHub · 2026-11-25 10:26 UTC · original
Automated triage for the maintainers.
Run report: RTX 5070 Ti, driver 621.14, a local diagnostics build based on
e50ed36plus local changes. A heap buffer view picked by a compute program read zeros, and the run later lost the device.Both mechanisms you traced are in
main(940d32f) now.c75fdbamade scalar loads of constant data through the heap read a raw view (smemincrates/victory-shader/src/emit/lower.rs), andHostHeap::mirrorincrates/victory-gpu/src/descriptor/host.rsnow defers only placed textures, not placed buffers.86a5ed6mirrors heap records the title copies as bytes. Your WARP replay on a later revision found no failure without the induced controls.So the open question is whether the title still reads zeros on current
main. Please run940d32funmodified on the same card and post: whether the same dispatch (by shader hash) now reads the source data, whether the device is still lost (DRED output andcrashes.loglines), and your Windows build.Please identify programs by hash only. Internal shader program names and step-by-step descriptions of the title's code must not be posted here.
Generated by Claude Code