GPU: #1779 (view heaps on hosts capped below 2^21) on current main, with lazy placed-texture views #2650
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!2650
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2650"
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?
@Pierrot1398 on GitHub · 2026-11-25 17:32 UTC · original
Pierrot1398:gpu/1779-on-main→main· +923 −131 · 11 files · 2 commits · openFrom a tester working with Claude (AI-assisted); measured on my own machine.
#1779 on current
main(13f91ca), for whichever the maintainers prefer: this branch, or its resolution taken into #1779. wrothgaril's commits (#1779 head9323a74) are kept unchanged under one merge commit. Only the conflict resolution is new.Why
#1779 no longer merges into
main. Today'smainmakes placed textures' views lazily (mirror,make_read,evictindescriptor/host.rsanddescriptor.rs), and moved the view-address table to 16 bytes a slot. Both meet #1779's change of the same code: on a capped heap a title slot and a host slot are no longer the same number.Resolution
mirror():main's flow (a placed texture's view left null until a draw reads it; preparation outside the slot lock; the record read again and the slot remade if the title wrote it meanwhile) with #1779's mapping. The host's arrays are indexed by host slot:made,kept, strides, addresses, marks and CPU handles. The title's bookkeeping is indexed by title slot:viewed,vacate. A title slot without a host slot gives #1779's warning andNone.make_readcalledmirror(i, …)with that index as the title's. A newHostHeap::title_of(slot)(the reverse ofslot) maps it back;stamp_readandunmade_placedkeep the host slot.evict: the same mapping forviewedandforget_read. The title slots are looked up beforemadeis locked, becausemirrortakes the blocks' map first and the reverse order would invite a deadlock.main's 16-byte entries, sized for every host slot under blocks (as #1779 sizes them) and for the title's slots otherwise.draw.rs,lower.rs,emit/mod.rs,shader.rs,stride_tests.rs: both sides' items.Measured
RTX 5060 Ti 8 GB (driver 621.24,
MaxViewDescriptorHeapSize1,000,000), Windows 11 26300.cargo test -p victory-gpu --lib: 198 passed, 0 failed, includingdynamic_slots_are_held_until_releasedandlists_share_a_table_and_copies_keep_their_views, which fail onmainon this card.cargo test -p victory-shader --lib stride: 8 of 9. The one left,a_heap_buffer_read_by_element_takes_the_views_stride, is the structured-view read on NVIDIA (#2178), which fails onmaintoo.cargo xtask policyandcargo clippy -p victory-gpu -p victory-shader -- -D warningsare clean.title slot past the host heapofmainare gone, the black wait before the first boot screen goes from 91 s to 2 s, and the title reaches the world on this card.🤖 Generated with Claude Code
https://claude.ai/code/session_011f6R3kMoarujHzzA1AvSBb
@Bj0rnis on GitHub · 2026-11-25 17:38 UTC · original
Independent Windows 11 + NVIDIA GeForce RTX 5070 Ti + WARP verification of #2650 at
3e606d27(cleangit merge-treewithorigin/main13f91cae, Rust 1.98.1 MSVC):victory-gpu):cargo test -p victory-gpu --features diagnostics --lib --locked -- --test-threads=1-> 201 passed, 0 failed, 1 ignored (3.25s). Fixes both pre-existing #1744 NVIDIA 1M view-heap baseline failures (descriptor::host::tests::dynamic_slots_are_held_until_releasedandmemory::tests::lists_share_a_table_and_copies_keep_their_views) that fail onmain13f91cae(196 passed, 2 failed).VICTORY_D3D12_WARP=1): 201 passed, 0 failed, 1 ignored (1.72s).victory-gpu):cargo clippy -p victory-gpu --all-targets --all-features --locked -- -D warnings-> 0 warnings.victory-shader:emit::memory_tests::heap_direct_texture_reads_mark_their_heap_indexexited with0xc0000005(STATUS_ACCESS_VIOLATION) on RTX 5070 Ti; confirmed this reproduces identically on cleanmain13f91cae(not a regression from #2650).Not tested: live game workload /
victory-shaderfull suite past the pre-existing access violation.AI-assisted test run and summary.
@kotekompotek on GitHub · 2026-11-25 17:54 UTC · original
Reviewed the slot-mapping piece: on capped hosts the host heap holds the title's slots by blocks, so every shader-reported index must go through
title_of()— bothmake_readsites now translate before comparing againstdesc.count, andstamp_readis keyed on the host slot consistently. This closes the same capped-heap family as #2475's trim work but at the mapping layer, which is the more fundamental fix; check for overlap with #2628's clamp-side change when ordering merges. CI pending at review time.@fuzeofficlal on GitHub · 2026-11-25 18:24 UTC · original
Independent Windows 11 + NVIDIA GeForce RTX 5090 + WARP verification and code review of
3e606d27(on13f91ca):Hardware Verification (
rustc 1.98.1MSVC)victory-gpu):cargo test --locked -p victory-gpu --features diagnostics --lib -- --test-threads=1-> 201 passed, 0 failed, 1 ignored (2.59s). Fixes both pre-existing 1M-cap failures on13f91ca(dynamic_slots_are_held_until_releasedandlists_share_a_table_and_copies_keep_their_views).VICTORY_D3D12_WARP=1): 201 passed, 0 failed, 1 ignored (1.89s).victory-gpu):cargo clippy --locked -p victory-gpu --all-targets --all-features -- -D warnings-> 0 warnings.Bugs found in code review (
crates/victory-gpu/src/descriptor/host.rs)HostHeap::sync_slotsstill indexesself.madeby title slotiinstead of host slot (untouched in this PR):On
13f91ca,sync_slots(lines 636–657) doesmade.get(i as usize)directly with the title sloti. Underblocks.sparse == true(1M-capped hosts like RTX 5090/3080/Arc A770),self.madeis indexed by host slot (map.host[i / BLOCK] * BLOCK + i % BLOCK), not title sloti:i < self.countlives in a remapped host block and is cleared (!current), if the unrelated host slotihappens to havemade[i] == 0,sync_slotsskipsself.mirror(i, ...). The real host slot is never nulled, itskeptID3D12Resourceis not released, andself.vacate(i)never runs to decrementmap.views[block]and return the host block.i < self.countchanges from view A to view B (current == true) and unrelatedmade[i]already matches view B's key (e.g., identical view copied into another slot),sync_slotsskipsmirror(i)and leaves the host slot stuck on view A.self.count: for every title sloti >= self.count,made.get(i as usize)returnsNone => true, forcing a per-slotmirror(i)call on every heap sync even when the slot is empty or unchanged.blocks.map -> madelock order already noted inevict, resolve the host slot (Option<u32>) for eachiinfirst..lastunder oneblocks.maplock before lockingself.made; then forSome(slot)compare againstmade[slot as usize], and forNone(unmapped block) mark stale only ifcurrentis true.Concurrency window between
self.place(...)andself.madelock inHostHeap::mirror:mirrorcallsself.place(index, view.is_some())(which releasesblocks.map) before acquiringself.made. If thread A resolvesslotfor a view (particularly on thelater == truepath, which does not re-readhandle) and pauses before lockingmade, thread B can concurrently observeindexcleared, nullmade[slot], dropmade, and callself.vacate(index)— freeing host blockslot / BLOCK(which thread C can then reassign to a different title block). When thread A then acquiresmade, it writesmade[slot],strides[slot],addresses[slot], and a descriptor into a vacated or reassigned host block. Holding the block mapping check / re-verifyingslotagainstself.slot(index)or serializingvacatewithmade(e.g. underblocks.map->madeorder) would close this window.@Marvisak on GitHub · 2026-11-25 22:15 UTC · original
Automated triage for the maintainers.
This PR no longer merges cleanly into
main(f3578e3):crates/victory-gpu/src/descriptor/host.rs,crates/victory-gpu/src/draw.rsandcrates/victory-gpu/src/host.rsconflict with changes that landed onmain. It will be reviewed once it is rebased.Generated by Claude Code
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.