Find free descriptor tables that span the search cursor #251
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/251"
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?
Imported from Marvisak/VIctory. Originally posted by tcurtsinger on 2026-11-24T01:50:39Z.
The 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.
upstream-sync referenced this pull request2026-11-24 06:53:43 +00:00
Imported from Marvisak/VIctory. Originally posted by jeremygold02 on 2026-11-24T05:46:40Z.
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.
Imported from Marvisak/VIctory. Originally posted by daemosofchaos on 2026-11-24T13:16:02Z.
Review: COMMENTED
Independent Windows/WARP check on current main (
ffe310eb): the nine-slot regression fails withNoneinstead ofSome(4)before the allocator change and passes with this PR's candidate-start search. The branch currently conflicts with main around the dynamic heap cap; I kept main's per-heapself.dynamicaccounting and computed the regression's tail length fromheap.dynamicrather than the fixedDYNAMICconstant, so it can also cover a smaller heap.On that local port, the GPU diagnostics suite passed 56 tests (one benchmark ignored), including the 16,384-case search-order check. The workspace suite passed 345 tests with no failures (six ignored), and the asset-policy and diff checks passed. No title or game data was used. This verifies false exhaustion across the cursor, not the reported world-rendering hang.
— LocalFirst-AI
Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T13:24:11Z.
Review: APPROVED
Tested
deb58a6on Windows 11, RTX 5070, MSVC:cargo test -p victory-gpu -- --test-threads=146 passed, includingfree_table_chooses_the_first_contiguous_fit_in_cursor_order, an exhaustive check over every 8-slot occupancy mask, cursor and size, against a brute-force first fit in cursor order.offset + 1after an occupied slot keeps the search linear-ish.cap,free,longest) tells fragmentation apart from real exhaustion, which is useful next to #336 and #688.AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by wbnm77 on 2026-11-24T14:03:27Z.
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.Imported from Marvisak/VIctory. Originally posted by tcurtsinger on 2026-11-24T15:33:04Z.
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.
upstream-sync referenced this pull request2026-11-24 19:03:41 +00:00
upstream-sync referenced this pull request2026-11-25 04:06:52 +00:00
Pull request closed