Tests: release placed descriptor heaps before reusing their memory #2262
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!2262
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2262/head"
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?
@andrewpozdnakov7-jpg on GitHub · 2026-11-25 09:17 UTC · original
andrewpozdnakov7-jpg:fix/2252-test-descriptor-heap-lifetime→main· +18 −11 · 1 files · 1 commits · merged 2026-11-25 21:56 UTCFixes #2252.
The placed-heap test overwrote its first COM handle and then dropped the backing memory. Its still-registered heap could intercept writes when another fixture allocated descriptors at that address. That left the new heap's host descriptors uninitialized. Release both fixture heaps before returning and check that a descriptor write at a reused address reaches the new heap.
940d32f, the new address-reuse assertion fails because the new heap receives no descriptor write. It passes with the release calls.Please preserve the Git author if reapplying this change. If its code or test is folded into another commit, please add:
Co-authored-by: andrewpozdnakov7-jpg [email protected]
AI-assisted. Synthetic tests only.
@eazyves on GitHub · 2026-11-25 10:42 UTC · original
On an RX 9070 XT (RDNA4), hardware adapter:
main940d32ffails in 10 of 250 runs, this PR (d183e7c, same base) in 0 of 250.Each run is the built
victory-gpulib test binary, default threads, default features, one process after another.mainbindless::tests::heap_views_are_current(0 instead of 1064)bindless::tests::heap_views_follow_writes_through_another_mapping(0 instead of 1064)draw::tests::root_views_reach_their_copy_and_read_zeros_past_it(draw.rs:2024, all zeros instead of 20480..)shadow::tests::marked_pages_go_back_by_the_bytes_the_gpu_changed(shadow.rs:1136, 0 instead of 170)An earlier 80 runs of
mainhad 5 such failures: 2heap_views_follow_..., 2root_views_reach_..., and 1descriptor::host::tests::dynamic_slots_are_held_until_released.So the two
bindlesstests are the ones I can tie to this fix. The other three are rarer: 0 in 250 fits this fix covering them, but it is too few to say so, and I have not traced them.Setup: RX 9070 XT, driver 32.0.32029.2010, Ryzen 7 5800X3D, Windows 11 26200, Rust 1.98.1. The tests ran from a service session (session 0). No game data. AI-assisted (Claude Code); run on my machine.
@eazyves on GitHub · 2026-11-25 12:17 UTC · original · edited 2026-11-25 13:03 UTC
Follow-up with more runs, same two builds and machine as above: this PR now has 0 failures in 1,000 runs (250 + 750).
The second series on
mainwas cut off before its end, so I only know it had at most 750 runs. In it:main(≤ 750 runs)heap_views_are_currentheap_views_follow_writes_through_another_mappingroot_views_reach_their_copy_and_read_zeros_past_itdynamic_slots_are_held_until_releasedframe::tests::waits_end_on_ticks_and_count_framesThat changes one thing I wrote:
root_views_reach_...now has 10 failures onmain(2 + 2 + 6, in at most 1,080 runs) against 0 in 1,000 here, so this fix most likely covers it too. I have not traced why. The last two are too rare to say, andmarked_pages_go_back_...did not fail again.Correction: other builds ran on the machine during part of the second
mainseries, so its conditions differed from this PR's series. The first 250 against 250 is the cleaner comparison (10 against 0).AI-assisted (Claude Code); run on my machine. No game data.
@Marvisak on GitHub · 2026-11-25 12:45 UTC · original
Automated triage for the maintainers.
Merge candidate (test fix). The placed-heap test in
crates/victory-gpu/src/descriptor.rsleft its placed descriptor heaps registered after it finished. Another test whose heap later reused that address could then have its descriptor writes routed to the stale registration. The PR releases both heaps. On Windows it also checks that a heap created again at the same address receives a descriptor write (pending == [0]).The evidence is strong. On an RX 9070 XT,
mainshowed intermittent failures in severalbindless/drawtests (about 1 in 50 runs), and this PR showed none in 1,000 runs. CIcheckpasses, and the branch merges cleanly. This likely explains the flakybindless::testsfailure reported as #2252.Generated by Claude Code