draw: maintain descriptor copy spans as slots change #304
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/lobomfz--VIctory-xmem!304
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-304"
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?
@tommiehansen on GitHub · 2026-12-03 09:51 UTC · original
tommiehansen:perf/t05-descriptor-copy-spans→main· +168 −12 · 2 files · 1 commits · merged 2026-12-03 17:11 UTCProblem
After updating the changed and periodically revisited descriptor slots, the heap pass folds the entire retained slot table again to compute each host copy's address span.
Implementation
Index slot intervals by host copy and recompute an extent only after one of its members changes. Preserve the existing changed-slot and periodic discovery path, stale-slot pruning, exact union bounds, copy identity, and first contributing slot order. Preserve the original full fold for A/B testing and fall back if index invariants fail. The index borrows copy identity from live retained slots and does not change resource ownership.
Evidence from related implementations
Comparison with the existing approach
The retained-slot traversal and ordered output still have costs. The index adds maintenance overhead when slots churn. Longroad's measured reduction establishes a useful precedent, not a predicted xmem speedup.
Why this should be merged
Repeated full extent folding is a specific avoidable CPU cost. The opt-in index is independently reviewable and has a randomized equivalence test plus an original-fold fallback. Measure its incremental CPU cost separately from #295, which addresses a different scan, before claiming any whole-frame improvement.
Validation
An extracted portable differential test compared 8,192 randomized insertions, overwrites and removals against a full fold. Standard and diagnostics Windows-target checks passed on macOS with test targets enabled, using a check-only mimalloc override and pure Rust BLAKE3. Hardware benchmarking was unavailable.
Compare
VICTORY_HEAP_SPAN_INDEX=0and1on native Series X RT routes at 1080p on RX 9060 XT 16 GB and 1440p on RX 9070 XT. Record heap preparation time, memory overhead, median and P99 frame time and image parity. Index maintenance can offset the avoided scan if slots churn frequently. The setting is off by default.github-bot referenced this pull request2026-12-03 16:15:26 +00:00