Index non-full pool blocks without changing allocation choices #4219
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4219"
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 trustno1-coder/VIctory-NVIDIA. Originally posted by sklzygit on 2026-11-30T17:32:07Z.
What it changes
Pool::cut currently collects and sorts every block for each fullest-first allocation. Maintain an ordered set of non-full blocks keyed by (Reverse(held_bytes), block_index), updating it when blocks are added, pieces are taken or become reusable, and empty blocks are reclaimed. Allocation order, alignment, variable block sizes, ripe/oldest fallback, quarantine and growth/backoff remain unchanged. The release's 64 MiB block size and memory-retention limits are unchanged.
How it was tested
Original validation on Windows, Ryzen 7 9800X3D:
cargo test --locked -p victory-gpu --lib pool:: -- --test-threads=1: 32 passed, 5 ignored. Includes an independent copy of the original sorted selector over 20,000 operations and a mixed-size block lifecycle comparison.99a2f43328d0a325. Both reference and indexed paths include index maintenance, so this isolates selection cost rather than measuring an untouched binary end to end. The committed benchmark can also be run through Cargo withpaired_crowded_pool_allocation_measurement -- --ignored --nocapturein an optimized build.git diff --checkpasses.No gameplay FPS, RAM/VRAM saving, or full-workspace CI pass is claimed. Index maintenance adds metadata and update work; fragmented ranges may still require examining multiple non-full blocks. The original first-fit setting remains supported.
Checked for overlap
Current-main revalidation (2026-12-01)
Rebased as one focused commit
ca4df4e1directly on upstream5fabb46e, removing the obsolete upstream-history divergence from the PR comparison. No unrelated launcher, shader or dependency changes.Hardware for the local checks: Windows 11, Ryzen 7 9800X3D, GeForce RTX 5080 16 GB, 32 GB system RAM, NVIDIA driver 621.40 (32.0.16.2140). These PRs are generic allocator/host changes; the tests below are not gameplay measurements. The local game profile is Series X, output 2560×1440, DLSS Quality, 30 FPS base cap, frame generation off in the latest recorded playtest, ray tracing off. The focused regression tests do not launch the game or depend on this profile.
cargo test --locked -p victory-gpu --lib pool:: -- --test-threads=1: 32 passed, 0 failed, 5 ignored.git diff --check origin/main...HEAD: passed.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Alilou92 on 2026-12-01T18:31:58Z.
Tested on Windows 11, Intel Core Ultra 7 265KF, NVIDIA GeForce RTX 5070 (12 Go), merged onto main
5fabb46e.cargo test -p victory-gpu --lib pool: the pool tests pass, including both parity tests against the original sorted selector.cargo test --release -p victory-gpu --lib paired_crowded_pool_allocation_measurement -- --ignored --nocapture: sorted median 7167 µs, indexed median 442 µs (x16.2),placement_digest=99a2f43328d0a325, the same digest as in your description.Unrelated to this PR:
host::uav_pool::tests::host_list_uav_pool_lifecycle_retire_trim_and_info_queuefails at uav_pool.rs:488 (!spare_has(bet4m_raw, 4 << 20)) in about one run in three when run alongside the other pool tests: 3 of 8 runs on main without this PR. It passes when run alone.spare_hascompares raw buffer addresses in the sharedUAV_SPARE, which the other GPU tests running at the same time also fill, so a freed address can come back as another test's buffer.Nit: in
reclaim's sweep,self.available.remove(&(Reverse(0), i))assumes a whole block hasheld == 0.heldis lowered withsaturating_sub, so removing(Reverse(empty.held), i)would keep the index consistent even ifheldever drifts.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-12-01T18:45:27Z.
Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.
Pull request closed