gpu: opt-in working-set trim of cold title memory (VICTORY_TRIM_BELOW_MB, review fixes) #160
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ReTerryDavis--ReVIctory!160
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-159"
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?
@SovietBearz0r on GitHub · 2026-12-05 18:27 UTC · original
SovietBearz0r:minivi-workingset-trim→main· +766 −2 · 6 files · 1 commits · openReplaces the closed #113 with the review fixed: strictly opt-in (no RAM-size auto-on), the OFF-path journal leak removed, and no lock held across syscalls.
Maintainer points addressed
VICTORY_TRIM_BELOW_MB=<MiB>is the only switch; unset/0/invalid = off (below_from(None) == 0). Off path starts no thread, journals nothing, hooks early-return. README marks it experimental/off.WRITE_COMBINED_RANGESleak: the journal moved out ofwatch.rsintotrim.rs, written only while armed, and pruned ontitle_memory_freed(MEM_RELEASE drops all ranges under the base; decommit cuts intersecting ranges) — tested.OPEN_LOCK.read()is never held acrossVirtualQuery/VirtualUnlock/Sleep; a bounded batch (≤64 × 16 MiB) is snapshotted under a short syscall-free read hold, then syscalls run outside it with per-chunk re-query (still committedMEM_PRIVATE, not guard/WC/no-access) and re-check against currentTITLE/OPENED/journal state. The unavoidable query→call window is documented (# TOCTOU); chunking/batching are pure tested helpers.inplace::From::Section: documented (a section heap is aMEM_MAPPEDview; the scan never trims mapped memory) instead of a silent skip;From::Region/Partstill recorded.VICTORY_TRIM_GENTLE=0/K32EmptyWorkingSet(emptied the whole process working set, not only title-private memory). Title-private-only rule, image/mapped/heap/guard/WC exclusions, 16 MiB paced unlock, 30 s/2 GiB gating kept.Verification
cargo test -p victory-gpu --lib: 724 passed, 0 failed, 21 ignored (+8 trim tests: default-off/no-thread, parsing, gating, classification, subtraction/join, journal prune, 16 MiB chunk + batch bound, allocation/exclusion gate);--all-features801 passed;cargo check -p victory; policy 443 files;cargo test -p xtask9; clippy-D warningsclean.working_set_before/5s_afterlog), no multi-second streaming stalls, no soft-fault hitching, no per-frame regressions.VirtualUnlockon non-VirtualLocked pages is not guaranteed to drop them on every Windows build, so a run must show the working set moving.VirtualUnlockonly makes pages pageable, contents are not discarded.Supersedes #113 (closed); branch force-pushed
2f7116f3.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.