GPU: our view heap is bound for a list that binds none (stacked on #3039) #3048
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3050"
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?
Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-26T05:23:59Z.
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 #3039'sOptionsentinel first. Once #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
Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T05:27:25Z.
Review: APPROVED
Tested locally merged onto
origin/main(63bcca4) on Windows 11 x64 (NVIDIA GeForce RTX 5090 + WARP):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).
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T05:27:32Z.
Review: CHANGES_REQUESTED
Static review of
3d3a7af1(crates/victory-gpu/src/draw.rs).One blocking dependency issue against current
main: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:
draw.rs:629-631) only setsmemory_heap = truewhenself.heaps[0] == 0, thememory_heapparameter onwantedandbind_heapsbecomes redundant oncetitle[0] == 0always selectsMEMORY_HEAP.#2896already addresses#2894together with the#2881sentinel collision in one PR.Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-26T05:51:57Z.
Rebased onto
gpu/lost-heaps-marker(#3039) at8404ede— theOptionsentinel now makes the widenedwanted([0,0], …)unforgeable, so this is safe in either merge order relative to main (it will conflict textually with #2896 on the same lines if that lands first; both approaches fix the same two issues, maintainers' pick).On the minor note: you're right that
memory_heapis redundant oncetitle[0] == 0selectsMEMORY_HEAP— kept the parameter so this stays a minimal delta over #3039; happy to drop it in a follow-up.Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T06:15:17Z.
Review: APPROVED
Re-reviewed at
8404edeeafter rebasing onto theOption<[usize; 2]>sentinel from #3039:host_state_lost()now clearshost_heapstoNone, which can no longer collide withSome([MEMORY_HEAP, SAMPLERS_OURS]), and bothState::wanted(title[0] == 0) andbind_heaps(want[0] == MEMORY_HEAP) are consistent with the new unit tests. Looks good.Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-26T06:17:43Z.
Automated triage for the maintainers.
Verdict: proposed close, as a duplicate of #2896. The fix here is correct. In
crates/victory-gpu/src/draw.rs,State::wantednow givesMEMORY_HEAPwhentitle[0] == 0, andbind_heapsinserts our heap whenwant[0] == MEMORY_HEAP. However, #2896 makes the same change to the same lines, with the same tests onwanted([0,0], false)andwanted([0,0x20], false). It was opened earlier and includes debug-layer evidence from Windows hardware (id 1419 gone). It is stacked on #2882, which fixes the lost-state marker by movingSAMPLERS_OURStousize::MAX - 1. That is the role #3039 plays for this PR. The two routes conflict textually, and only one is needed.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
Optionsentinel over #2882's).CI:
checkpassing.Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-26T17:17:18Z.
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
SAMPLERS_OURStousize::MAX - 1. If the maintainers prefer #3039'sOptionsentinel (the triage on #3039 leans that way), #2882 does not land, #2896 loses its base and conflicts, while this PR already sits on theOptiondesign.So I would ask to keep this open until the #3039-vs-#2882 choice is made: this is the
wantedfix written for the world where the sentinel is removed rather than renumbered. If #2882 lands instead, this one can close.Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-26T17:53:29Z.
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
1234abcdfrom a fallback view;cafe0000is the initial output. This is app-local WARP 1.0.22 with Agility 1.620.2. Earlier test fixturemain63bcca41234abcd/cafe0000cafe0000/cafe0000c141c1f1234abcd/1234abcdcafe0000/cafe00008404ede1234abcd/1234abcd1234abcd/1234abcd26b7532merged onto63bcca41234abcd/1234abcd1234abcd/1234abcdI 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.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.