Repository navigation
Description
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
- On the
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. - Opt in with e.g.
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. - Bound pending descriptors by count as well as payloads by bytes; defer at ingress, not after copying into an unbounded waiting list. Preserve dependency and retirement order. Do not wait holding allocator, queue or submit locks, on a thread needed to retire the work, or while holding a partial reservation needed by another job. Completion, cancellation, failure and device loss must unblock waiters. If one job cannot fit, chunk only when the format permits it; otherwise fail through the existing operation’s error path with owner, required and available bytes. No indefinite retry, partial success, or silently skipped upload.
Fit with existing work. Keep title_memory_mb guest-visible; #1566/#1831 address whole-process commit, #640/#1773 GPU pages and residency. DirectStorage already has XCL_DSTORAGE_MEMORY_BUDGET_MIB and 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?
- Deterministic two-producer fixture: both jobs fit individually but not together. Peak stays within budget, second job makes progress after retirement, and both outputs match the unlimited path byte-for-byte. Force a delayed fence and prove its backing is not recycled early. Exercise idle trim, cancellation, oversize and shutdown with a waiter; none may leak credit or hang. No new gate when unset.
- Guarded parent/head comparison with identical cache state, inputs and workload: report staging peak, bytes reclaimed, waits/time, process/scope peak, minimum available RAM and last completed load stage. Repeat with cold and warm caches distinguished. On this 16 GiB Wine machine keep the 9 GiB scope, 512 MiB swap ceiling and 2 GiB system headroom guard; don't approach a kernel OOM to demonstrate one. If the stock vkd3d integration (Linux (Wine + vkd3d-proton): a retail game reaches what
mainreaches on Windows; the obstacle is replaced vtables — proposal: proxies #175) stops the title earlier, report fixture evidence only. Lower staging usage with unchanged total pressure is useful negative evidence, not proof of gameplay.
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.
Activity
pickles976 commentedon Nov 26, 2026
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.
razormontana commentedon Nov 26, 2026
I’d like to take the CPU detiling measurement in #2639, in coordination with the committed-memory work in #2688. On
8b957bec, the owned read fallback allocates a full-size slice or volume buffer, copies only readable committed spans and leaves the gaps zeroed. Detiled output stays alive through the upload fence wait, and an oversized first texture can exceed the 32 MiB guest-byte batch limit. Batch lifetime · CPU backingI’ll report live owned backing bytes for detile output and the source buffers allocated inside
subresources, plus their combined peak, underXCL_ACTIVITY. Borrowed views count as zero. This complements #2862’s GPU staging counters and checks for short-lived peaks within the aggregate Rust heap already sampled for workstream 6. I’ll verify capacities and lifetimes in synthetic serial and parallel cases, including partially committed and oversized inputs, then compare with commit and DXGI usage in a guarded world-load run. The first PR would add measurements only. Earlier Rust heap measurementsAI use
Codex GPT-6.2 traced the allocation path, checked related work and drafted this claim.