gpu/descriptor: 2-level 64-bit bitmap DynamicSlots allocator and batc… #234

Open
github-bot wants to merge 1 commit from github-bot/gh-234 into main AGit
Owner

@⁠mint17 on GitHub · 2026-11-27 11:22 UTC · original
mint17:perf/dynamic-slots-bitmap-batch-release → main · +1213 −68 · 4 files · 1 commits · open

…hed reclamation

Replace the byte-per-slot Vec linear scan in HostHeap::dynamic and per-range release_dynamic lock storms in State::drop / State::tables_done:

  • Add pure-Rust DynamicSlots (crates/victory-gpu/src/descriptor/slots.rs) with a 64-bit Level-0 occupancy bitmap (8x smaller) and Level-1 full-word summary bitmap (skipping 4,096 taken slots per word), preserving exact next-fit cursor wrap-around, free count, and too_long watermark semantics (resetting too_long only when slots actually transition 1 -> 0).
  • Add descriptor::release_dynamic_batch and HostHeap::release_batch so State::drop and State::tables_done acquire SHADER_HEAPS.read() once and host.next.lock() once per distinct (heap, id) (zero-alloc single-heap fast path).
  • Verified with 127,500-op randomized Vec oracle parity tests across 13 capacities, batched reclamation tests, and opt-in release microbenchmark (17.8x speedup in fragmented regimes, 2.3x-3.8x normal/high-occupancy).
**@⁠mint17** on GitHub · 2026-11-27 11:22 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/234) `mint17:perf/dynamic-slots-bitmap-batch-release` → `main` · +1213 −68 · 4 files · 1 commits · open …hed reclamation Replace the byte-per-slot Vec<bool> linear scan in HostHeap::dynamic and per-range release_dynamic lock storms in State::drop / State::tables_done: - Add pure-Rust DynamicSlots (crates/victory-gpu/src/descriptor/slots.rs) with a 64-bit Level-0 occupancy bitmap (8x smaller) and Level-1 full-word summary bitmap (skipping 4,096 taken slots per word), preserving exact next-fit cursor wrap-around, free count, and too_long watermark semantics (resetting too_long only when slots actually transition 1 -> 0). - Add descriptor::release_dynamic_batch and HostHeap::release_batch so State::drop and State::tables_done acquire SHADER_HEAPS.read() once and host.next.lock() once per distinct (heap, id) (zero-alloc single-heap fast path). - Verified with 127,500-op randomized Vec<bool> oracle parity tests across 13 capacities, batched reclamation tests, and opt-in release microbenchmark (17.8x speedup in fragmented regimes, 2.3x-3.8x normal/high-occupancy).
Replace the byte-per-slot Vec<bool> linear scan in HostHeap::dynamic and
per-range release_dynamic lock storms in State::drop / State::tables_done:

- Add pure-Rust DynamicSlots (crates/victory-gpu/src/descriptor/slots.rs)
  with a 64-bit Level-0 occupancy bitmap (8x smaller) and Level-1 full-word
  summary bitmap (skipping 4,096 taken slots per word), preserving exact
  next-fit cursor wrap-around, free count, and too_long watermark semantics
  (resetting too_long only when slots actually transition 1 -> 0).
- Add descriptor::release_dynamic_batch and HostHeap::release_batch so
  State::drop and State::tables_done acquire SHADER_HEAPS.read() once and
  host.next.lock() once per distinct (heap, id) (zero-alloc single-heap fast
  path).
- Verified with 127,500-op randomized Vec<bool> oracle parity tests across
  13 capacities, batched reclamation tests, and opt-in release microbenchmark
  (17.8x speedup in fragmented regimes, 2.3x-3.8x normal/high-occupancy).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 11:25:56 +00:00
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-27 11:42 UTC · original

@⁠mint17 The allocator oracle gives us confidence in next-fit placement and wraparound. For the batch path, I’ll check that ranges across different heap IDs become eligible at the same fences as before. The 17.8× result describes the fragmented allocator benchmark.

**@⁠TaynanGT** on GitHub · 2026-11-27 11:42 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/234#issuecomment-7217380026) @⁠mint17 The allocator oracle gives us confidence in next-fit placement and wraparound. For the batch path, I’ll check that ranges across different heap IDs become eligible at the same fences as before. The 17.8× result describes the fragmented allocator benchmark.
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/descriptor.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/234/head:github-bot/gh-234'
git switch 'github-bot/gh-234'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-234'
git switch 'github-bot/gh-234'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-234'
git switch 'github-bot/gh-234'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-234'
git switch 'main'
git merge --squash 'github-bot/gh-234'
git switch 'main'
git merge --ff-only 'github-bot/gh-234'
git switch 'main'
git merge 'github-bot/gh-234'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.