GPU: compact watch page tracking with dense PageBits and inline OneOrMany storage #3229
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!3229
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3229"
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?
@0xKaji on GitHub · 2026-11-26 13:48 UTC · original
0xKaji:perf/compact-watch-tracking→main· +253 −26 · 1 files · 1 commits · openSummary
Compacts
victory-gpu's write-watch metadata inwatch.rsto eliminate per-pageBTreeSetnodes and per-page heapVecallocations when tracking hundreds of thousands of 64 KiB pages.Changes
PageBitsdense bitset (watch.rs): ReplacesChanged.0: Mutex<BTreeSet<usize>>with a contiguousBox<[u64]>bitset relative to the tracked range's start page (1 bit per 64 KiB page = 16 bytes per MiB), with O(1)insert/remove/containsandtrailing_zeros()-basedrange_pages.OneOrMany<T>inline storage (watch.rs): ReplacesVec<Arc<Changed>>inGuards::holdersandVec<usize>inGuards::alias_ofwith an inline single-element enum (One(T) | Many(Vec<T>)) that spills toVeconly when a page has multiple holders/aliases and collapses back toOneonretain.Tracked::disarmtrimming (watch.rs): Shrinks oversizedSaved::armed(> 64) andSaved::bytes(> 16) capacities when disarming.Verification
cargo xwin clippy --workspace --all-targets --locked --target x86_64-pc-windows-msvc -- -D warningscargo xwin clippy --workspace --all-targets --all-features --locked --target x86_64-pc-windows-msvc -- -D warningscargo test -p xtask --locked(6/6 passed)watch::tests:: --test-threads=1: 17/17 passed (includingpage_bits_tracks_multi_word_rangesandone_or_many_spills_and_collapses).Related PRs
watch.rsin areas distinct from#3154(alias page unprotection on last tracker drop),#3156(take_splitunmapped merge), and#3161(transitive alias groups).@Dukestar69 on GitHub · 2026-11-26 14:09 UTC · original · approved these changes
Verified on RTX 5090 against
origin/main(63bcca4):cargo test -p victory-gpu --lib watch:: -- --test-threads=1: 17/17 passed (includingone_or_many_spills_and_collapsesandpage_bits_tracks_multi_word_ranges).cargo test -p victory-gpu --lib shadow:: -- --test-threads=1: 10/10 passed.cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Cleanly compacts watch page tracking with dense
PageBitsand inlineOneOrManystorage.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
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.