8 GB Intel Arc: world-entry 0x80000003 is not VRAM exhaustion; two memory-ledger defects found while measuring #3932
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?
Imported from Marvisak/VIctory. Originally posted by spektra on 2026-12-01T09:15:22Z.
Summary
I ported VIctory to a Windows 10 box with an Intel Arc A750 8 GB (the fork here targets A580; A750 is the same Xe-HPG ACM-G10 family), with the goal of fitting a Series X dump into 8 GB. To do that I made the VRAM ledger (
victory_gpu::umem) the source of truth rather than guessing, and that produced three things worth reporting:umemdouble-counts title textures that live inside the pooled arena, which madeunaccountedsaturate at 0 and masked ~1.8 GiB of real usage.watch::kernel_will_writereturns a barebool, so a DirectStorage/kernel write into title memory can race a remap; the resulting failures (hr=0x800706f8,hr=0x800703e6) are a precursor to the world-entry assert. Fixing the span tookrequest failedfrom 4 per run to 0.Everything below is measured from
victory_gpu::umemlog lines and the title's own crash context, not estimated.Environment
0x8086:0x56A2family, ACM-G10, ReBAR on); also observed on A580 8 GB--features xess930.048.020(vb_sub_story,device.model: Xbox Series Sreported by the title)1.
umemunder-counts by double-counting:unaccountedsaturates to 0title_textures_mibis computed from the texture kinds, but textures the title fills while resident in the pooled arena are already insidetitle_pool_mib. Addingtitle_textures_mib + title_pool_mibtherefore counts them twice, and the signed remainder (card_used − all owners) clamps to 0 — exactly when the budget is tight and you need it most.Fix applied locally:
outside_pool = KINDS[1] − pooled_textures()andunaccountedis kept signed so an over-subscription shows as negative instead of silently becoming 0.pooled_title_textures_mib,cpu_visible_mib,staging_mib.umem::note_pooled_textureis called frompool::textureon placement and from theReclaimrelease path, so pooled bytes are attributed at the point of ownership rather than inferred.pool::staging_pool_bytes()exposes the staging arena so it stops landing inunaccounted.After the fix the ledger reads honestly, e.g. in-world:
That residual ~1.9 GiB is real title-side allocation (heaps/buffers/PSOs) that the layer cannot see into. Before the fix it was invisible.
2.
watch::kernel_will_writehas no mapping span, so kernel fills can race a remaptitle_memory_readingandtitle_memory_remappingboth take a span/guard, so a remap waits for readers.kernel_will_writereturns onlybool: it tells the remapper "someone is writing", but it does not hold the mapping still for the duration of the kernel call. AReadFile/fread/DirectStorage fill can therefore have its destination remapped mid-copy.Observed before the fix, 4
request failedper run, both from the DirectStorage path:hr=0x800706f8—ERROR_INVALID_USER_BUFFER(1784)hr=0x800703e6—ERROR_NOACCESS(998)destination=0x11d5b700(a low host address, i.e. not title memory at all)Fix applied locally:
watch::writing()now returns aReadingspan guard;files.rs(ReadFile,fread) anddstorage.rs::into_destinationhold it across the kernel call.read_intoretriesERROR_INVALID_USER_BUFFERandERROR_NOACCESS, and at exhaustion completes without a destination instead of failing the request.Result:
request failedwent 4 per run → 0. This did not stop the world-entry assert (see below), so it is a separate defect, but it is a real one and the fix is small.3. The world-entry assert is not a memory-out condition
Unhandled
0x80000003(STATUS_BREAKPOINT— the title's own__debugbreak) at world entry. Four runs, four different VRAM budgets, all crashed, including one with ~3.4 GiB of headroom:usedsoft/hardimage+0x23d8f03image+0x23d8f03VICTORY_TEXTURE_BUDGET_MB=2200image+0x22106e0ultra_performanceimage+0x23d8f03Two things worth noting:
used 3312withcard_soft_mib=6737— over 3 GiB free. Cutting the texture budget by ~1.3 GiB moved the crash to a different offset (+0x22106e0vs the usual+0x23d8f03) rather than avoiding it, which smells like a deterministic assert reached slightly earlier/later in scene setup, not a failed allocation.memory.load_percent: 93,system.memory.free: 2155544(KiB),system.memory.total: 33392416,swap.free: 15260636. The title believes it is near a memory limit while the GPU budget says otherwise. If the assert isload_percent-driven, it is reacting to system RAM or its own 7776 MiB pool accounting rather than todxgi_budget_mib(7329).I could not get a stack: the breakpad handler writes its minidump to a
T:\path that is not a mounted drive, the upload tosubmit.backtrace.iois blocked by the HLE's net stub, and no WER event is produced.Question: is this offset known? Is there a knob that suppresses the title's
__debugbreakpath, or an assert/memory.load_percentoverride worth trying? I would rather fix the cause than paper over the breakpoint.4.
targets_room_keptreturns 0 in-world, starving ongoing target creationresource::targets_room_kept_forreturned 0 once in-world, which stops reserving room for the title's ongoing target creation and leaves it to fight the mirrors. Keeping a reserve ofmost/2(512 MiB on 8 GB) instead raised the title's live targets from 807 MiB to ~968 MiB across runs, which is the behaviour I would expect from a reserve.Something unrelated but useful: unattended startup
For measuring, I added
VICTORY_AUTOSTART=<seconds>tovictory-hle/src/modules/gameinput.rs: it ORs padAinto slot 0's state for 200 ms every N seconds while!victory_gpu::in_world(), so the title reaches the intro/menu without a human. It works alongside a real pad (scripted keys are OR'd in, not replacing). Happy to send that as a PR if it is wanted upstream — it made every measurement in this report possible.Caveats
soft == hardceiling on 8 GB moves with system state (6102 / 6460 / 6590 / 6737 MiB observed across sessions), so absoluteusedvalues are only comparable within a run.victory-image-<hash>.dll), so they are not stable across shader/translation cache changes.Imported from Marvisak/VIctory. Originally posted by spektra on 2026-12-01T10:10:35Z.
Follow-up with more runs and a much better crash report. Summary: the assert now has a worker-thread stack, and three memory explanations have been measured and ruled out.
The stack
Unhandled
0x80000003always atimage+0x23d8f03, but a later build reports the frames above it. It is not the main thread — it is a worker created withCreateThread:Two runs, same five frames, registers at the breakpoint:
0x1ce90(118416)0x9a3(2467)0x9a30x9a62941200x27e70(163440)0xd4d(3405)0xd4d0x9a6294120rdi == 0x30 * r12in both (118416 = 48 × 2467, 163440 = 48 × 3405), andr12 == r13. So the two counts are equal and one of them has a 48-byte stride applied — it looks like a capacity/count check over an array of 48-byte elements, scaling with how much of the world is loaded, not a fixed address.raxis 0 in both.r8/r9look like a packed/tagged 64-bit value (r9 = r8 + 0x43a << 40).I tried scraping the faulting stack for image-pointed strings (MSVC
assertkeeps expression/file/line as literals), and found none — so whatever this check is, it prints nothing on the way out.Three memory explanations, measured and ruled out
1. VRAM exhaustion — no. Crashed with up to 3.4 GiB of the budget free:
VICTORY_TEXTURE_BUDGET_MB=2200Cutting the texture budget 1.3 GiB moved the crash to
+0x22106e0rather than avoiding it.2. Windows commit exhaustion — no. This one looked promising: one run had only 16 MiB of commit headroom left at the crash. But another run crashed identically with 16,275 MiB of commit free (
commit_avail_mib) and 17,019 MiB at the crash-time reading. So commit pressure is a real hazard on this host but not this trigger.3. The host memory the title reads — no, and this is now proven. I intercepted
GlobalMemoryStatusEx/GlobalMemoryStatusin the HLE (it was going straight to host kernel32) and logged every call. Over 12 runs' worth of load, the title calls it exactly once per run — after the exception record is raised, i.e. from its own crash reporter. Itsmemory.load_percent: 93is therefore a description of the host, not an input to any budget, and shaping it changes nothing (it still crashed at the same offset withtotal 7776 / avail 7776 / load 0reported). It also never callsXMemGetWorkingSetStatisticsat all in this title.What I added along the way (in my fork, happy to send any of it)
GlobalMemoryStatusEx/GlobalMemoryStatusoverrides withVICTORY_SYSMEM_MB=N(clamp reported total/available) andVICTORY_MEM_TRUTH=1(answer as the console's partition would), logging reported vs. host figures. Defaults to passthrough — the same shape greenhouse documents asgh_sysmem_mb/gh_mem_truth.umemledger now also prints host RAM, commit headroom/limit, and our own process commit, since VRAM alone was never the whole story. At world entry our process commit jumps 5.6 → 10.2 GiB (the card mirrors we own cost ~4.6 GiB of host commit) — worth knowing for 8 GB / 32 GB machines, though unrelated to this assert.Ask
Does
0x2593e91/0x2592d69(which both sit in the same function cluster as the0x2215ecathread entry) mean anything to you — a job/streaming completion path? Any known invariant there involving a count with a 48-byte stride would be worth a look, because that is what the registers say.Imported from Marvisak/VIctory. Originally posted by spektra on 2026-12-01T10:28:39Z.
Two more findings, one of which corrects my earlier guess.
The assert is load-bearing — stepping over it does not work
I added an opt-in
VICTORY_SKIP_ASSERT=<rva>that advancesRIPpast theint3at+0x23d8f03and resumes, to test whether the trap was spurious. It is not:The title reached the world and ran (5,028 draws, 2–4 fps) for a few seconds, then dereferenced the same null:
mov rax,[rbx]; call [rax+0x2f8]withrbx = 0— a virtual call on a null object. So the pointer is genuinely null and the assert is protecting a real invariant.What the null actually is
Disassembled around the trap (offsets are RVAs in the original image, so they line up with the crash report). The containing function starts at
0x23d8e70:So it is not a missing array element or a missing object: both are present and readable. A virtual method on that object is expected to hand back a result and hands back null instead. That matches the register pattern I reported earlier —
rdi = 0x30 × r12, i.e. index × 48, with the index scaling with world load (2,467 and 3,405 in the two runs).Given it fires on a
CreateThreadworker at world entry while ~18,000 texture slots are still queued for memory in our layer, my working guess is that this is a "this resource should be resident/ready by now" lookup, and the answer is "not yet". If that is right, it is a streaming-timing problem rather than a size problem — which would also explain why every VRAM budget change (2,200 MiB through 6,700 MiB) moved nothing.If the class at
[rbx+rdi+8]means anything to you, that would settle it: I can resolve the vtable's RTTI to a type name at the trap if it helps.Also added while chasing this
VICTORY_SKIP_ASSERT=<rva[,rva...]>: steps over a titleint3once and resumes (diagnostic only, opt-in, title images only). Result above is the reason it is not a fix.Imported from Marvisak/VIctory. Originally posted by spektra on 2026-12-01T11:04:02Z.
Found and fixed the cause — it was our side, not the title's.
Root cause
0x80000003was downstream of DirectStorage requests that our layer completed without writing their destination. The run that cracked it logged, seconds before the assert:state=0x1000isMEM_COMMIT,protect=0x2isPAGE_READONLY. Eight such requests completed per run, each handing the title unwritten bytes for real archive data (story000.rpfand its.ttpfpacks were being opened at the time).The cause is in the write-watch:
watch::writing()(a.k.a.kernel_will_write) lifts the read-only guard so a kernel write can land, but it only lifts guards the watch itself recorded (open()walksguards.protected/guards.aliased). A block left read-only for any other reason — a guard cleared by a sweep, a view the title protected — staysPAGE_READONLY, so every retry fails identically withERROR_NOACCESSuntil the retry budget runs out and the request completes with nothing written.Fix
victory-gpu/src/watch.rs: newwritable_now(at, len)—VirtualProtect(PAGE_READWRITE)over the range the title asked to be filled. It deliberately bypasses the guard bookkeeping: the title's own request is the authority on those bytes.victory-hle/src/modules/dstorage.rs: call it on theERROR_NOACCESS/ERROR_INVALID_USER_BUFFERretry path before each retry.Result
Same build, same launch (
ultra_performance, 640×360 internal, copies capped at 256 MiB), against six runs that previously died at world entry:destination is not writableper run0x80000003at+0x23d8f03The assert was the title correctly noticing that a look-up returned nothing. The look-up returned nothing because an archive read had been silently dropped. That also explains why every VRAM budget from 2,200 MiB to 6,700 MiB changed nothing: it was never a size problem.
Worth noting for the same reason
read_into'sbreak Ok(())at retry exhaustion (mine, added to stop the title seeing failed requests) was the mechanism that converted a hard error into silent corruption. With the protection bug fixed it should never be reached, but it is still the wrong default — a request that cannot be filled should probably fail loudly rather than complete with the title's buffer untouched. I will change that to a failing completion unless someone here would rather keep it as-is.Two diagnostics that came out of this and may be generally useful: the crash report now prints the frames above a breakpoint plus the words each register points at, and
VICTORY_SKIP_ASSERT=<rva>steps over a titleint3for experiments (it is how I proved the assert was load-bearing: skipping it produced an immediate null dereference at+0x2b8035).Imported from Marvisak/VIctory. Originally posted by spektra on 2026-12-01T11:48:49Z.
Follow-up for anyone reading this later: the assert here was root-caused (DirectStorage writing to blocks our write-watch had left PAGE_READONLY, so
read_intocompleted without writing its destination). With that fixed the title now stays in-world indefinitely on an Arc A750.Everything measured in the first long session after the fix — the shader-translation gaps (and how to reproduce them offline in seconds), the 63 draws/frame being dropped, the per-frame CPU/GPU budget, the VRAM ledger, and a storage measurement — is written up in #3936.