Repository navigation
Conversation
…hed reclamation Replace the byte-per-slot Vec<bool> linear scan in HostHeap::dynamic and per-range release_dynamic lock loops in State::tables_done / Drop with a pure-Rust 2-level 64-bit bitmap allocator and batched reclamation: - Add crates/victory-gpu/src/descriptor/slots.rs (L0 u64 occupancy words + L1 non-full summary words, O(log n) bit-parallel within-word scan, O(1) cross-word fast path for n <= 64, next-fit cursor & too_long watermark, clamped release_batch). - Add descriptor::release_dynamic_batch (single SHADER_HEAPS.read() lock, zero-alloc fast path for single-heap batches, sorted chunk_by multi-heap path, wrong/stale heap ID and title-slot bounds filtering) and switch State::tables_done / Drop for State to use it. - Preserve VIctory-NVIDIA's PORTABLE_VIEWS, VICTORY_DYNAMIC_SLOTS, slot_evict, and diagnostics copystat counters verbatim. - Add 127,500+ op Vec<bool> oracle parity tests across 13 capacities, wraparound/too_long tests, multi-heap batch reclamation tests, and an opt-in release microbenchmark (17.8x fragmented speedup at 262K slots, 17.4x at 1M slots).
Dukestar69
approved these changes
Nov 28, 2026
Dukestar69
left a comment
There was a problem hiding this comment.
LGTM — verified on Windows (RTX 5090):
cargo test -p victory-gpu --lib descriptor::passed (67/67, includingoracle_parity_randomized_all_capacities_and_edge_cases,find_zero_run_in_word_matches_naive_exhaustive_patterns,wrap_across_cursor_and_no_physical_wrap_parity, andrelease_dynamic_batch_handles_empty_single_multi_wrong_id_and_stale)- 0 new compiler warnings in touched files
cargo xtask policypassed (295 files ok)
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces the byte-per-slot
Vec<bool>linear scan inHostHeap::dynamicand per-rangerelease_dynamiclock loops inState::tables_done/Drop for Statewith a pure-Rust 2-level 64-bit bitmap allocator and batched reclamation (zero conflict with #646, #666, or #693).Changes
DynamicSlots(slots.rs): Level-0u64occupancy words + Level-1 summary bitmap skipping completely full 64-word (4,096-slot) chunks in one instruction, O(log n) bit-parallel within-word run search, O(1) cross-word fast path forn <= 64, exact next-fit cursor / wraparound /too_longwatermark parity, and overflow-clampedrelease_batch.descriptor.rs,descriptor/host.rs,draw.rs):release_dynamic_batchtakesSHADER_HEAPS.read()once per command list (zero-alloc fast path for single-heap batches, sortedchunk_byfor multi-heap batches, filtering stale heap IDs and title-slot indices< host.count()). PreservesPORTABLE_VIEWS,VICTORY_DYNAMIC_SLOTS,slot_evict, anddiagnosticscopystatcounters verbatim.Release Microbenchmark (
cargo test --release --locked -p victory-gpu --lib bench_dynamic_slots_vs_vec_bool -- --ignored --nocapture)Vec<bool>+ per-range)DynamicSlots+ batch)Verification
cargo test --locked -p victory-gpu --lib -- descriptor::slots dynamic_slots descriptor::host::tests -- --test-threads=1(52 passed, 0 failed — includes 127,500+ op randomizedVec<bool>oracle parity tests across 13 capacities, wraparound /too_longtests, and multi-heap / wrong-ID / title-slot batch reclamation tests).cargo test --locked -p victory-gpu --lib --features diagnostics -- descriptor::slots dynamic_slots -- --test-threads=1(8 passed, 0 failed).--all-features) andcargo test --locked -p xtaskpassed (6 passed, 0 failed, including asset policy).