GPU: remove dropped host descriptor heaps from GPU_RANGES #3452
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!3452
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3452"
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?
@alexandruiulian201-bot on GitHub · 2026-11-27 03:06 UTC · original
alexandruiulian201-bot:fix/drop-gpu-ranges→main· +107 −9 · 1 files · 1 commits · openProblem
HostHeap::newappends the heap's GPU address range to the globalGPU_RANGESlist used bynear_heapsin device-removed diagnostics, butHostHeapnever removes its entry when dropped. When descriptor heaps are released and recreated (or across tests),near_heapscontinues to report stale/destroyed heap ranges and can collide with newly allocated heaps reusing the same GPU virtual address.Fix
GpuRangewith a unique monotonicid(AtomicU64) and storerange_idonHostHeap.DropforHostHeapto remove itsrange_idfromGPU_RANGES.register_gpu_range,unregister_gpu_range, andnear_heaps_inhelpers with unit tests covering range formatting and unregistering only the matching heap even when GPU start addresses match.Verification
cargo test -p victory-gpu --lib --locked gpu_ranges_unregister_removes_only_matching_heap: 1 passed.cargo test -p victory-gpu --lib --locked near_heaps_formats_below_inside_and_past_end: 1 passed.cargo clippy -p victory-gpu --all-targets --locked -- -D warnings: clean.cargo clippy -p victory-gpu --all-targets --all-features --locked -- -D warnings: clean.cargo test -p xtask --bin xtask --locked: 6 passed (repository_passes_policyok).AI-assisted. Synthetic unit tests only (no game files used).
@oni-swr on GitHub · 2026-11-27 03:27 UTC · original
WARP test report (AI-assisted with Claude; synthetic tests only, no game files)
5d0e2240c9e393a4faf22f2c9f7bbff681928b22, base:origin/main@63bcca4(this PR's merge base)VICTORY_WARP=1,VICTORY_D3D12_WARP=1, adapter vendor 0x1414 / software flag), DXIL validatordxil.dllfrom the Windows SDK 10.0.26100VICTORY_D3D12_WARPis only honored with--features diagnostics(host.rscreate()); without itcargo test -p victory-gpu --libpicks the hardware GPU. I ran with--features diagnostics.cargo test -p victory-gpu --lib --locked --features diagnostics: 248 passed, 0 failed, 1 ignored (base: 246 passed, 0 failed, 1 ignored; the +2 are this PR'sgpu_ranges_unregister_removes_only_matching_heapandnear_heaps_formats_below_inside_and_past_end, both pass)cargo test -p xtask --bin xtask --locked: 6 passedframe::tests::waits_end_on_ticks_and_count_framespassed on base and head here. I did not re-run clippy.Review: no correctness issue found. Ids are unique and monotonic, nothing can return between registration and the
HostHeapconstruction (no leaked range), andDroptolerates a poisoned lock. Nit: the tests cover the pure helpers only, not that dropping a realHostHeapunregisters its range.@cloph-dsp on GitHub · 2026-11-27 06:42 UTC · original
Independent CPU-only verification of PR #3452 (
GPU_RANGES unregister).CARGO_TARGET_DIR(D:\Victory-Contrib\target-3452-watch),CARGO_BUILD_JOBS=2.5d0e2240c9e393a4faf22f2c9f7bbff681928b22, merge base63bcca43c6a00a758510398fa43096ce7e4f7df0.--exact --test-threads=1 --quiet):cargo test --locked -p victory-gpu --lib -- descriptor::host::tests::gpu_ranges_unregister_removes_only_matching_heap->1 passed; 0 failed; 233 filtered.cargo test --locked -p victory-gpu --lib -- descriptor::host::tests::near_heaps_formats_below_inside_and_past_end->1 passed; 0 failed; 233 filtered.63bcca4viagit grep -F.git diff --check 63bcca4 HEADexit 0 (clean).@futurepro62 on GitHub · 2026-11-27 08:28 UTC · original
NVIDIA full-suite run, to go with the reports above by cloph-dsp, oni-swr, since none of them names a GPU run. Tested exact head
5d0e224(on its base63bcca4).Tested
dxil.dllfrom Windows SDK 10.0.26100 (the loader's default), debug.cargo build --workspace --locked, thencargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware: 868 passed, 0 failed, 10 ignored.gpu_ranges_unregister_removes_only_matching_heap,near_heaps_formats_below_inside_and_past_end.--skipleaves out tests that fail on main63bcca4on this card too, not because of this PR:heap_direct_texture_reads_mark_their_heap_indexends thevictory-shadertest process with0xc0000005(#2571), so without the skip the rest of that crate never reports;dynamic_slots_are_held_until_released,lists_share_a_table_and_copies_keep_their_viewsand the twostride_testshit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317);gathers_at_a_level_match_the_hardwarefails on lane 0 (#1744).Not tested
AI use
@AurumCarlos on GitHub · 2026-11-27 09:11 UTC · original · reviewed
The
Dropremoves the range when theHostHeapgoes, but the host heap itself can outlive it. Lists keep theID3D12DescriptorHeapthey bind (draw.rs:1027,list.keep(h)), so a title heap released before its submitted lists finish leaves a live GPU heap that is no longer inGPU_RANGES. A device-removed fault in one of those lists, reading through that heap, then gets nonear_heapsentry for it, and that's the case the report is most useful for.The address-reuse case in the description can't happen while a list holds the heap, since its GPU range stays allocated. Keeping the entry and marking it released at drop (
; view heap 0x…+0x… (released): inside, slot N) would keep both cases readable without losing the in-flight one.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.