Memory: bound queued host work and reclaim idle staging before world-load allocations fail #2639
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl#2639
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@pickles976 on GitHub · 2026-11-26 04:07 UTC · original
Triage request:
goal:world-load(#1833). Let a loader that can finish serially spend longer loading rather than allocate several jobs’ peak scratch space at once. Please start with one measured XCL-owned buffer path, not a replacement allocator or a change to the console memory profile.Why not just set a process cap? In #1566, a 13,824 MB process cap refused required texture pages during startup; the title died twice at 11.7 s. On our 16 GiB Linux / Wine 11.0 / RTX 4060 Laptop GPU (8 GiB), #1831’s isolated enforcement test assigned a 64 MiB job limit but a 128 MiB commit still succeeded. Neither refusal nor unenforced limits provide backpressure. Separately, a contributor on #542 reported nearly identical ~40 GB commit peaks with 4 vs 15 compiler workers, but ~28 GB with three upload/detile changes together. That makes transient copies worth measuring, not proof they dominate on every 16 GiB host.
Proposed first slice
XCL_ACTIVITYtick, expose capacity held by upload/detile staging: reserved but not allocated, active (including fence-pinned), and idle/reusable, with high-water marks. Count backing allocations once, including capacity retained in pools, not views or just payload length. Compare these with process commit, resident memory and local/non-local GPU memory as distinct series. If staging is small at the load peak, publish that result and pick the measured owner instead.XCL_HOST_STAGING_BUDGET_MIB(unset/0: unchanged; positive MiB converted once to bytes). For participating owners, reserved + active + idle must not exceed the configured bytes. Reserve the job’s peak simultaneous input/output/scratch before materializing it. Reuse an idle allocation or drop reconstructible idle backing before asking for more. Hold the charge through completion, including GPU fences and aliases. Never discard dirty guest data or memory still in use. Releasing a buffer means it is reusable or freed, not a claim that OS RSS immediately fell.Fit with existing work. Keep
title_memory_mbguest-visible; #1566/#1831 address whole-process commit, #640/#1773 GPU pages and residency. DirectStorage already hasXCL_DSTORAGE_MEMORY_BUDGET_MIBand ordered retirement: reuse that policy if integrating it later, with both limits checked in one admission decision, not two blocking reservations. Compiler parallelism (#542/#2624) can be tuned independently; opaque DXC/driver allocations are not enforceable staging bytes. This is not a maximum on RSS, title CRT allocations, worker processes or driver memory. If required live data alone exceeds physical RAM, a longer wait is not a fix.What would demonstrate it works?
Maintainer decision requested: does an activity-counter patch for upload/detile staging followed by an opt-in admission patch for the measured owner fit the world-load roadmap?
AI assistance: OpenAI Codex reviewed existing reports and drafted this proposal. The linked Wine cap result is a local fixture; the other XCL load measurements are attributed above. No retail data attached.
@pickles976 on GitHub · 2026-11-26 04:16 UTC · original
Human being here: basically it seems like
xcljust allocates memory when the executable asks for it. Instead we should be able to set some limit of how much memoryxclis allowed to use. Requests beyond this point go into a queue, and are realloc'ed when data in memory is no longer needed. I'm not exactly sure what is being loaded during the game's startup, but I am expecting that some of that data is transient, and does not need to live in memory the whole time.Without
xclenforcing memory limits, the game will always OOM on smaller machines. I am with family for Thanksgiving and running on my gaming laptop with 16GB and this is a hard blocker for running on this machine.Let me know what you think.