hle: track title working-set memory, bound xasync threads, and map XUser devices #687
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!687
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-687"
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?
@wbkepler on GitHub · 2026-11-24 06:54 UTC · original
wbkepler:hle/working-set-and-runtime-fixes→main· +699 −62 · 3 files · 2 commits · openSummary
xmem.rs(XMemGetWorkingSetStatistics):XMemAllocDefault/XMemFreeDefault, non-placeholder committedXMemVirtualAllocregions viaVirtualQueryEx, and physical pages with GPU-optimal breakdown) so host D3D12 mirrors and shader compiler RAM do not trigger premature title asset eviction/OOM.xasync.rs:BinaryHeap<Reverse<DelayedTask>>+Condvar) and bounds thePOOLworker count.xuser.rs(XUserFindUserByLocalId/find_for_device):APP_LOCAL_DEVICE_IDhandles to the offline local user, returningUSER_NOT_FOUNDfor all-zero IDs andE_INVALIDARGfor null pointers.Verification
cargo clippy --workspace --all-targets— passed (zero new warnings)cargo clippy -p victory --features diagnostics --all-targets— passedcargo test --workspace— passed (including 4 new unit tests inxmem/xasync/xuser)cargo xtask policy— passed (151 files ok)@geiyiliyabumo on GitHub · 2026-11-24 09:42 UTC · original
Independent verification of
b7d3263d1merged withmain(8e79c80, clean merge) on Windows 11 Pro (26100), Rust1.98.1(x86_64-pc-windows-msvc): PASS (with two small edge-case notes below).Verification
cargo xtask policy→asset policy: 153 files okcargo clippy --workspace --all-targets --locked -- -D warnings→ pass (0 warnings)cargo clippy --workspace --all-targets --all-features --locked -- -D warnings→ pass (0 warnings)cargo test -p victory-hle --locked→ 98 passed + 1 integration test (no_dll_planting), 0 failed (all 4 new tests inxmem,xasync, andxuserpass)cargo test --workspace --lockedpassed (frame::tests::waits_end_on_ticks_and_count_frameshit the known CPU-load timing flake once under concurrent compilation and passed in0.03son re-run).Code-review notes
xmem.rs(XMemVirtualAlloc,already_tracked): if a previously tracked reservation[rbase, rbase + rlen)is freed viaVirtualFreeand a subsequentXMemVirtualAlloclands at a sub-address inside[rbase, rbase + rlen)beforeXMemGetWorkingSetStatisticsruns to prune stale entries,already_trackedmatches the stale range without checkingmbi.AllocationBase == rbaseand skipsrecord_virtual_region. Whenvirtual_used()later runs and seesmbi.AllocationBase != rbase, the stale entry is pruned and the new allocation is never tracked. CheckingVirtualQueryEx'sAllocationBase(or only skipping whenbaseis non-null, i.e., a commit inside an existing reservation) avoids that gap.xasync.rs,Timer::run): whenitem.queue.terminatedis set beforedue,Timer::runskipsdeliverand dropsitem.taskoncedueexpires rather than running it withcanceled = true(and retainsArc<Queue>inTIMER.heapuntildue).AI-assisted; synthetic tests only, no game files.
@Marvisak on GitHub · 2026-11-25 00:34 UTC · original
Automated triage for the maintainers.
Needs rebase. This PR does not merge cleanly into current
main(ac2525d). Conflicting files:crates/victory-hle/src/modules/xasync.rs,crates/victory-hle/src/modules/xmem.rs.The content has not been reviewed yet; it will be once the branch is rebased onto
main.Generated by Claude Code
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.