GPU/Placement: defer free() reap, on-demand place() reap, and O(1) heap metadata #2955
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2955
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2955"
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?
@RVZO6 on GitHub · 2026-11-26 01:30 UTC · original
RVZO6:rvzo/placement-fast→main· +236 −31 · 1 files · 1 commits · openSummary
Eliminates redundant heap reaping and O(N) free-list scans in
crates/victory-gpu/src/placement.rs:free()reap:free()releases the placed resource and marks the owning heap dirty instead of immediately walking all heaps on every free.place()reap:place()reaps pending frees only when needed to satisfy a new placement request (explicitly documented in the module doc comment as a deferred-reap lifecycle).place()skips heaps that cannot satisfy an allocation without linearly scanning their free lists.Verification
cargo clippy --workspace --all-targets --locked -- -D warnings,--all-features,xtask policy, and full workspace tests (victory-gpu: 233 passed, 0 failed, includingdeferred_free_and_on_demand_reap_reuse_without_extra_heapsandfree_list_metadata_stays_exact_across_fragmentation_and_coalescing).AI-assisted: T3 Code (Antigravity, gemini-4-neon).
GPU/Placement: defer free() reap, on-demand place() reap, O(1) heap metadata, and TLS fits->place alloc-info cacheto GPU/Placement: defer free() reap, on-demand place() reap, and O(1) heap metadataaee97ff82btof9d79afee8@Marvisak on GitHub · 2026-11-26 05:43 UTC · original · edited 2026-11-26 07:19 UTC
Automated triage for the maintainers.
Needs work. Thanks for
f9d79af. Thethread_local!cache and the ignored benchmark are gone, and the module docs now say when deferred ranges and empty heaps are given back. TheFreeListtotals still look exact to me, andallocatereaps before it makes a new heap.The main point is still open: nothing shows that
place,freeorreapcost measurable time in a real frame. The PR now adds aREAP_THRESHOLD/next_reap_atbackoff and changes when memory is returned, without any measurement. A profile or frame-report line from a title run showing time spent in placement would make the case. Without one, this is extra mechanism for no shown gain.Smaller points:
free()"marks the owning heap dirty", but no such flag exists.FreeList::takerecomputesmax_freeby scanning all ranges whenever the largest range is used, so "O(1) heap metadata" overstates it.CI: passing (
check).Generated by Claude Code
@RVZO6 on GitHub · 2026-11-26 06:56 UTC · original
Addressed triage feedback in
f9d79af:thread_local!DescKey/LAST_ALLOC_INFOcache and restored plainGetResourceAllocationInfocalls infits()andplace().#[ignore]bench_placement_freelist_skip_and_summicrobenchmark from unit tests.victory-gpu, both clippy profiles, andxtask policy. Not run: the title; any hardware GPU.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.