Repository navigation
GPU: our view heap is bound for a list that binds none (stacked on #3039) - #3050
kotekompotek wants to merge 2 commits into
Conversation
Dukestar69
left a comment
There was a problem hiding this comment.
Tested locally merged onto origin/main (63bcca4) on Windows 11 x64 (NVIDIA GeForce RTX 5090 + WARP):
- Diff review:
State::wantednow selectsMEMORY_HEAPwhentitle[0] == 0(mirroringSAMPLERS_OURSwhentitle[1] == 0) andbind_heapscheckswant[0] == MEMORY_HEAP, ensuring a list that binds no title view heap still has a valid view heap bound before setting a root signature indexing the resource heap directly (#2894). cargo test -p victory-gpu draw::tests -- --test-threads=1(RTX 5090): 20 passed, 0 failed (includinga_list_without_a_sampler_heap_gets_ours).VICTORY_WARP=1 cargo test -p victory-gpu draw::tests -- --test-threads=1(WARP): 20 passed, 0 failed.cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
fuzeofficlal
left a comment
There was a problem hiding this comment.
Static review of 3d3a7af1 (crates/victory-gpu/src/draw.rs).
One blocking dependency issue against current main:
- On
main,host_state_lost()still setsself.host_heaps = [usize::MAX; 2], whileMEMORY_HEAP == usize::MAXandSAMPLERS_OURS == usize::MAX. With#3050applied standalone (not stacked on#3039),State::wanted([0, 0], false)now returns[usize::MAX, usize::MAX], which widens the#2881collision: aftercut()orexternal::record,bind_heapswill now skipSetDescriptorHeapsfor[0, 0]lists even whenmemory_heap == false. Please either stack this on#3039or include theOption<[usize; 2]>sentinel fix directly here (so the PR is safe to merge in either order).
Minor notes:
- Since the only caller (
draw.rs:629-631) only setsmemory_heap = truewhenself.heaps[0] == 0, thememory_heapparameter onwantedandbind_heapsbecomes redundant oncetitle[0] == 0always selectsMEMORY_HEAP. - Note for maintainers:
#2896already addresses#2894together with the#2881sentinel collision in one PR.
host_state_lost marked host_heaps [usize::MAX; 2], but a list that binds no heaps and reads title memory wants [MEMORY_HEAP, SAMPLERS_OURS] — the same pair. After a cut or an external record, bind_heaps found them equal and bound nothing; the next directly-indexing root signature ran with no heaps, the device removal Marvisak#1778 was written to prevent. None now marks the lost state: it equals no pair wanted can make, so the next bind_heaps binds again. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The sibling of the missing sampler heap: a list binding no view heap still gets a root signature that indexes the view heap directly, which D3D12 requires a bound heap for (debug layer id 1419); NVIDIA removes the device. wanted() now asks for ours whenever the title binds none, not only when title memory's views are read, and bind_heaps inserts it on that want rather than on the memory-heap flag alone. Fixes Marvisak#2894. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
3d3a7af to
8404ede
Compare
|
Rebased onto On the minor note: you're right that |
fuzeofficlal
left a comment
There was a problem hiding this comment.
Re-reviewed at 8404edee after rebasing onto the Option<[usize; 2]> sentinel from #3039: host_state_lost() now clears host_heaps to None, which can no longer collide with Some([MEMORY_HEAP, SAMPLERS_OURS]), and both State::wanted (title[0] == 0) and bind_heaps (want[0] == MEMORY_HEAP) are consistent with the new unit tests. Looks good.
|
Automated triage for the maintainers. Verdict: proposed close, as a duplicate of #2896. The fix here is correct. In This PR will be closed in 48 hours unless the author pushes a change that sets it apart from #2896, or a maintainer removes the label (for example, if they prefer #3039's CI: Generated by Claude Code |
|
The two routes are coupled through the sentinel decision: #2896 is stacked on #2882, which fixes the same lost-state collision as #3039 by moving So I would ask to keep this open until the #3039-vs-#2882 choice is made: this is the |
|
I ran the same synthetic compute readback on both routes. The guest binds neither heap, and the root signature declares both directly indexed heaps. Each case reads the word
I ran the memory-request cases first on the controls, since asking for neither heap first can make the later readbacks in the same process inconclusive on this WARP. The #3050 build passed all 22 draw tests and the full GPU suite (248 passed, 1 ignored). These readbacks confirm both stacks cover the two cases under discussion. AI-assisted with Codex. |
Summary
State::wantedreturned[0, SAMPLERS_OURS]for a list that binds no view heap and does not read title memory, sobind_heapsbound only our sampler heap — while every generated root signature indexes both descriptor heaps directly. D3D12 requires a heap of each kind bound before such a signature is set (debug layer id 1419); NVIDIA removes the device over it.wantednow asks forMEMORY_HEAPwhenever the title binds no view heap (title[0] == 0), not only whenmemory_heapis set, andbind_heapsinserts our heap onwant[0] == MEMORY_HEAPinstead of on the flag alone — the same stand-in the sampler half already does.root_viewand the write-mark table already live in that heap.wantedreturn[usize::MAX; 2](colliding with thehost_state_lostmarker) for every no-view-heap list — it needs GPU: a lost host list's heaps are not a wanted pair #3039'sOptionsentinel first. Once GPU: a lost host list's heaps are not a wanted pair #3039 merges this PR shows only its own commit.SAMPLERS_OURS = usize::MAX - 1); either route works, maintainers' pick.Test plan
a_list_without_a_sampler_heap_gets_oursextended:wanted([0,0], false)andwanted([0,0x20], false)now assertMEMORY_HEAPcargo test -p victory-gpu --lib(msvc),cargo clippy -p victory-gpu --all-targets --locked -- -D warningscleanGenerated with Devin