GPU: a title memory copy left out of a page table is named when slots come back #2235
No reviewers
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!2235
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2235"
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?
@denkencar-sketch on GitHub · 2026-11-25 08:31 UTC · original
denkencar-sketch:fix/view-heap-retry→main· +45 −1 · 1 files · 1 commits · openSummary
Shared::rewritesetsgeneration = noweven when some copy got no view slots (HostHeap::pair()returnedNone: a capped heap, or the dynamic slots all in use for the moment).memory::prepareonly rewrites whengeneration != shadow::generation(), so after one such rewrite it skips the table at every later submission until some copy is created or unregistered. The copy keeps reading as missing, and its misses withhold every shader write of the lists that use it.Change
rewriteremembers whether it left a copy out and then leaves the generation stale (u64::MAX), so the next submission rewrites again (slots come back as lists reset). Cost: a rewrite per submission while slots stay short, which is the state that needed it.Testing
memory::tests::a_copy_without_view_slots_is_named_when_slots_come_backtakes every slot of a host heap, registers a copy, rewrites (the copy gets no pair and the generation must stay stale: this assertion fails onmain), gives the slots back and rewrites again (the copy is named and the generation is current). Run three times in a row with the rest of the suite, no flakes.cargo clippy --workspace --all-targets [--all-features] --locked -- -D warningsis clean.Not tried: a run in the game, or a capped (NVIDIA) heap; the test forces the slot shortage instead.
modules::dstorage::tests::a_page_list_filled_after_its_request_startsfails now and then onmaintoo (5 of 20 runs ofcargo test -p victory-hle --lib); it is unrelated.AI-assisted.
@Marvisak on GitHub · 2026-11-25 13:31 UTC · original
Automated triage for the maintainers.
Merge candidate (worth a look). In
crates/victory-gpu/src/memory.rs,Shared::rewritenow leavesgenerationat theu64::MAXsentinel (the same valueShared::newstarts with) whenHostHeap::pair()had no slot for a copy.preparetherefore rewrites again at the next submission instead of leaving that copy unnamed until some copy comes or goes. I checked againstmain:prepareonly rewrites ons.generation != now, so the bug is real, and the fix is small, at the cost of one rewrite per submission while slots are short. CI (check) passes on this head; the new test uses its ownHostHeap.Generated by Claude Code
@fuzeofficlal on GitHub · 2026-11-26 00:52 UTC · original
Code review and RTX 5090 + WARP verification at head
8bd603c05208merged cleanly ontomain(63bcca43c6a0):crates/victory-gpu/src/memory.rs:518-553):heap.pair()returnsNoneinShared::rewrite, settingleft_out = trueandself.generation = u64::MAXforces the nextprepare()(s.generation != now) to rebuild the page table without waiting for anothershadow::generation()bump, immediately filling the omitted copy onceHostListreset frees dynamic slots.with_heap->shared()) stays consistent acrossprepare()/bind(), and any omitted copy remains absent fromLayout::copies/owner(null page-table entry), so reads/writes during that submit continue through the miss/withheld path safely.VICTORY_D3D12_DEBUG=1, Rust 1.98.1):cargo xtask policy:191 files ok;cargo clippy -p victory-gpu --all-targets -- -D warnings(default +--features diagnostics): 0 warnings--features diagnostics,memory:: shadow:: draw::tests): 39/39 passed (includinga_copy_without_view_slots_is_named_when_slots_come_back)memory:: shadow:: draw::tests, skipping pre-existing NVIDIA 1M view-heap cap baselinelists_share_a_table_and_copies_keep_their_views): 38/38 passed.LGTM.
@catminou4 on GitHub · 2026-11-25 08:48 UTC · original · reviewed
A title memory copy left out of a page table (no descriptor slots) is retried at the next submission via generation=u64::MAX sentinel. Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows-sys); not compiled or tested on this macOS arm64 host. rustc 1.98.1. Careful fix for a real hole; the sentinel is documented in the comment.
@DenRakEiw on GitHub · 2026-11-25 09:02 UTC · original · approved these changes
Verified locally merged onto
origin/main(940d32f, Windows 11 x64, NVIDIA GeForce RTX 5090, Rust 1.98.1 MSVC):cargo test -p victory-gpu --lib a_copy_without_view_slots_is_named_when_slots_come_back— passed on RTX 5090cargo clippy -p victory-gpu --all-targets— 0 warningscargo xtask policy— ok (183 files ok)Clean backfill of page-table entries once view slots become available again. Looks good.
AI-assisted (Gemini 4 Neon).
@fuzeofficlal on GitHub · 2026-11-26 13:18 UTC · original · approved these changes
Reviewed and verified
8bd603c0merged locally ontoorigin/main(63bcca43) on Windows 11 x64 (NVIDIA GeForce RTX 5090 and WARP, Rust1.98.1MSVC, Windows SDK10.0.26100.0dxil.dll; synthetic tests only, no game files).Verification
git merge-treeagainstorigin/main(63bcca43): clean.cargo xtask policy(PR head):182 files ok.cargo clippy --locked -p victory-gpu --all-targets -- -D warnings(default and--all-features, PR head and merged): 0 warnings.VICTORY_D3D12_DEBUG=1,--features diagnostics, merged):memory::tests,shadow::tests, anddraw::tests(skipping the pre-existing NVIDIA 1M view-heap cap baselinelists_share_a_table_and_copies_keep_their_views) — 37 passed, 0 failed, plus 3/3 consecutive focused passes ofa_copy_without_view_slots_is_named_when_slots_come_back.VICTORY_D3D12_WARP=1,VICTORY_D3D12_DEBUG=1,--features diagnostics, merged): fullmemory::tests,shadow::tests, anddraw::tests(no skips) — 38 passed, 0 failed.Review Notes
Shared::rewrite(crates/victory-gpu/src/memory.rs:279-326), recordingleft_out = truewheneverheap.pair()returnsNone(:300) and leavingself.generation = u64::MAX(:324, matchingShared::new's sentinel) ensuresprepare()retries on the next submission rather than leaving the omitted copy unnamed until an unrelated shadow registration/unregistration bumpsshadow::generation().crates/victory-gpu/src/memory.rs:598-634) allocates an isolatedHostHeap, exercises both the exhausted and recovered states, and unregisters cleanly.Looks good to merge.
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.