Find free descriptor tables that span the search cursor #251
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!251
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/251/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?
@tcurtsinger on GitHub · 2026-11-24 01:50 UTC · original
tcurtsinger:fix/descriptor-search-cursor→main· +90 −19 · 1 files · 3 commits · closed without mergingThe dynamic descriptor allocator could turn down a table that fit. For example, free adjacent four-slot and five-slot tables while the cursor is between them. A nine-slot request then searches each side independently and misses the available span.
The new search applies the cursor to candidate start slots. On the second pass a table starting before the cursor can extend past it. An occupied slot skips every candidate that would overlap it. The allocation still ends within the physical heap and preserves next-fit order.
Verification
d2a4baewithNoneinstead ofSome(4)and passed on WARP with the fix. It allocates and releases whole tables throughHostHeap.cargo test --workspace --lockedpassed 267 tests with four ignored. The GPU diagnostics suite passed 48 tests on WARP with one ignored. The asset-policy and diff checks passed.An RTX 4080 first-mission run logged a nine-slot allocation failure about 32 seconds before device removal. That log did not include slot occupancy, so it cannot distinguish this allocator bug from genuine exhaustion. The change also applies to the capped heap size used in #135.
The first failed allocation now reports the heap capacity, total free slots and longest contiguous free span while the allocator lock is held. A new test covers full, empty and fragmented heaps, including free spans at both ends.
RTX 4080 follow-up
With this fix and #135 on the capped 65,536-slot dynamic heap, the first failed request was for ten consecutive slots. The diagnostic counted 136 free slots in total and a longest free span of nine. That request genuinely could not fit. The earlier nine-slot failure on the previous build had no occupancy data. The synthetic regression above remains the direct test of the cursor fix. Native run and memory measurements.
@jeremygold02 on GitHub · 2026-11-24 05:46 UTC · original
Tested current PR head
deb58a669560673b3ba6dc53903b52028b28ffe0.cargo test --locked -p victory-gpu --lib descriptor::host::tests -- --test-threads=1: 4 passed, 43 filtered out.free_table_chooses_the_first_contiguous_fit_in_cursor_orderchecks all 256 occupancy patterns, every cursor, and request sizes 1–8 against the expected first contiguous fit; this includes cases where no fit exists.free_space_counts_separate_runs_at_the_heap_endscovers full, empty, and fragmented heaps.a_free_table_can_straddle_the_search_cursorexercises reuse when the cursor splits free tables and verifies the held tail still blocks an oversized request; the existing dynamic-slot test checks release behavior (allocator helpers, tests).The exhaustive bitmap test is pure. The heap-integration tests return early if no host GPU is available, so the pass result alone does not establish that the host-heap branch ran.
@wbnm77 on GitHub · 2026-11-24 14:03 UTC · original
On Windows 10 Pro 19045, RTX 5060 Ti driver 621.24 and Rust 1.98.1,
cargo test --offline --locked -p victory-gpu descriptor::host::tests -- --nocapture --test-threads=1passed 4 of 4 on the unmodified PR headdeb58a669560673b3ba6dc53903b52028b28ffe0.With the crossing test instrumented to require a real D3D12 heap, the nine-slot request returned
Noneon merge based2a4baeand passed on the PR head. The PR currently conflicts withffe310ewhere #336 made the capacity per heap. A local rebase preserving the PR authorship and usingheap.dynamic - 9in the crossing fixture passed 6 of 6 in the same test group. I can share the rebase diff if useful. These were synthetic tests. Codex (GPT-6) assisted with testing, conflict resolution and this report.@tcurtsinger on GitHub · 2026-11-24 15:33 UTC · original
Thanks for checking the crossing case on hardware and WARP. I merged current main (
ffe310e) into this branch atf0eddd8. The allocator keeps #336’s per-heap capacity and searches candidate table starts across the cursor. The regression now sizes its held tail fromheap.dynamic - 9. Once a host device is available, failure to create the test heap also fails the test.I ran the same nine-slot regression on Windows D3D12 WARP. Main returned
Nonefor the available table at slot 4. All six descriptor tests passed on the updated PR, including the exhaustive search-order test.The workspace passed 345 tests with default features and 349 with diagnostics. Six were ignored in each run. Both workspace Clippy configurations passed with warnings denied, along with the asset-policy and diff checks.
AI-assisted implementation and testing.
Pull request closed