Finish scanning past the dynamic descriptor cursor #8
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/uiliannn--VItoriaBr!8
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/8/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?
@Lilith133T on GitHub · 2026-11-25 03:34 UTC · original
Lilith133T:fix/dynamic-descriptor-wrap-scan→main· +25 −23 · 1 files · 1 commits · closed without mergingProblem
The wraparound scan extends the second pass by n − 1 slots to find a free range that straddles the cursor. The DYNAMIC iteration cap truncates that extension on a full-size view heap. The allocator can then report exhaustion even when a contiguous range is free.
The existing test leaves the tail of the heap free. The allocator legitimately chooses the next range at the cursor, so the test does not exercise wraparound.
Change
Walk both bounded ranges when the free-slot check permits a search. Keep the check that prevents an allocation from crossing the physical end of the heap. The regression now fills the heap and leaves a single four-slot range with two free slots on each side of the cursor.
Verification
32d7848and finds slot 18 with the fix.@flale1 on GitHub · 2026-11-25 04:00 UTC · original
Read through the change (not run): both bounded ranges are finite, the
n - 1extension covers a range that straddles the cursor, and the run reset at slot 0 still keeps an allocation from crossing the physical end of the heap. Tracing the new regression by hand, the old scan stops before revisiting slots 16-17 and returnsNone, and the new one returns 18, matching the description.For context: upstream Marvisak/VIctory does not cap this scan (its loop walks
startswithout theDYNAMIClimit), so the truncation seems specific to this tree's adaptation ofc1c3281.One note: the test returns early when the heap cannot be created (no GPU), so on a runner without a usable adapter it passes without checking anything. A line in the log when it skips would make that visible.
AI-assisted (Claude Code).
@Yoshi-233 on GitHub · 2026-11-25 06:08 UTC · original
I reproduced the false exhaustion on
aa85bb0and verified the fix on3af493e. I ran the actualHostHeap::dynamicandreleasemethods in a Linux CPU harness with an in-memory heap, so the check ran even without a D3D12 adapter.With 262,144 dynamic slots, the base returned
Noneon both cursor-crossing fixtures. This head returned slot 18 for the fixture here and slot 14 for the one from #9. Two slots at the physical end plus two at the beginning were correctly refused as a four-slot allocation. Releasing two more slots next to the first two then allowed a retry at the beginning.I also scaled the capacity to eight slots and compared against a reference that checks each candidate start in cursor order. Across all 256 occupancy patterns × 8 cursors × 8 request sizes, the base missed 450 valid allocations. This head matched the reference in all 16,384 cases, including which slot was chosen. #9 also passed the same matrix.
@uiliannn on GitHub · 2026-11-25 10:10 UTC · original
Obrigado pela contribuição! Esse fix de wraparound no scan de descritores dinâmicos já foi integrado na
mainvia commita91ef70(backport dec1c3281). Por outro lado, o seu PR #7 (fix de stride de 16 bytes noSLOT_VIEWS) foi mergeado namainemd396d11— muito obrigado pelo achado!Pull request closed