8 GB Intel Arc: world-entry 0x80000003 is not VRAM exhaustion; two memory-ledger defects found while measuring #3932

Open
opened 2026-12-01 09:15:22 +00:00 by spektra · 4 comments
spektra commented 2026-12-01 09:15:22 +00:00 (Migrated from github.com)
Contributor

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:

  1. Bug: umem double-counts title textures that live inside the pooled arena, which made unaccounted saturate at 0 and masked ~1.8 GiB of real usage.
  2. Bug: watch::kernel_will_write returns a bare bool, 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 took request failed from 4 per run to 0.
  3. Negative result: the world-entry assert survives with ~3.4 GiB of VRAM headroom, so it is not an out-of-memory condition. This is the part I most want a maintainer's eye on.

Everything below is measured from victory_gpu::umem log lines and the title's own crash context, not estimated.

Environment

GPU Intel Arc A750 8 GB (0x8086:0x56A2 family, ACM-G10, ReBAR on); also observed on A580 8 GB
OS Windows 10 x64 19045
Stack Agility SDK 1.620.2, DXC 1.9.2609.5, --features xess
Title Xbox Series X dump, build 930.048.020 (vb_sub_story, device.model: Xbox Series S reported by the title)
Render 1280×720 internal (quality 0.6667) and 640×360 internal (ultra_performance, 0.3333), output 1080p

1. umem under-counts by double-counting: unaccounted saturates to 0

title_textures_mib is computed from the texture kinds, but textures the title fills while resident in the pooled arena are already inside title_pool_mib. Adding title_textures_mib + title_pool_mib therefore 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() and unaccounted is kept signed so an over-subscription shows as negative instead of silently becoming 0.
  • New fields pooled_title_textures_mib, cpu_visible_mib, staging_mib.
  • umem::note_pooled_texture is called from pool::texture on placement and from the Reclaim release 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 in unaccounted.

After the fix the ledger reads honestly, e.g. in-world:

used 6607, soft 6460, hard 6460; textures 3098 (pool 2972), targets 937,
copies 252, heaps 61, staging 144, unaccounted 1918

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_write has no mapping span, so kernel fills can race a remap

title_memory_reading and title_memory_remapping both take a span/guard, so a remap waits for readers. kernel_will_write returns only bool: it tells the remapper "someone is writing", but it does not hold the mapping still for the duration of the kernel call. A ReadFile/fread/DirectStorage fill can therefore have its destination remapped mid-copy.

Observed before the fix, 4 request failed per run, both from the DirectStorage path:

  • hr=0x800706f8 — ERROR_INVALID_USER_BUFFER (1784)
  • hr=0x800703e6 — ERROR_NOACCESS (998)
  • one at destination=0x11d5b700 (a low host address, i.e. not title memory at all)

Fix applied locally:

  • watch::writing() now returns a Reading span guard; files.rs (ReadFile, fread) and dstorage.rs::into_destination hold it across the kernel call.
  • read_into retries ERROR_INVALID_USER_BUFFER and ERROR_NOACCESS, and at exhaustion completes without a destination instead of failing the request.

Result: request failed went 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:

Run Internal res used soft/hard textures targets copies crashed offset
baseline 1280×720 6676 6590 3509 807 509 yes image+0x23d8f03
+ copies capped 256 MiB 1280×720 6607 6460 3098 937 252 yes image+0x23d8f03
VICTORY_TEXTURE_BUDGET_MB=2200 1280×720 5707 6102 2229 968 252 yes image+0x22106e0
ultra_performance 640×360 3312 6737 / 7073 697 722 253 yes image+0x23d8f03

Two things worth noting:

  • The last row crashed at used 3312 with card_soft_mib=6737 — over 3 GiB free. Cutting the texture budget by ~1.3 GiB moved the crash to a different offset (+0x22106e0 vs the usual +0x23d8f03) rather than avoiding it, which smells like a deterministic assert reached slightly earlier/later in scene setup, not a failed allocation.
  • The title's own crash context at the moment of death: 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 is load_percent-driven, it is reacting to system RAM or its own 7776 MiB pool accounting rather than to dxgi_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 to submit.backtrace.io is 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 __debugbreak path, or an assert/memory.load_percent override worth trying? I would rather fix the cause than paper over the breakpoint.

4. targets_room_kept returns 0 in-world, starving ongoing target creation

resource::targets_room_kept_for returned 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 of most/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> to victory-hle/src/modules/gameinput.rs: it ORs pad A into 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

  • All numbers are from a fork with local patches; the soft == hard ceiling on 8 GB moves with system state (6102 / 6460 / 6590 / 6737 MiB observed across sessions), so absolute used values are only comparable within a run.
  • The crash offsets are from the translated image (victory-image-<hash>.dll), so they are not stable across shader/translation cache changes.
  • I have not bisected whether findings 1 and 2 predate this fork; both code shapes above look upstream to me.
<!-- greyfinch-sync:Marvisak/VIctory:issue:6716785320 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/3932). Originally posted by [spektra](https://github.com/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: 1. **Bug:** `umem` double-counts title textures that live inside the pooled arena, which made `unaccounted` saturate at 0 and masked ~1.8 GiB of real usage. 2. **Bug:** `watch::kernel_will_write` returns a bare `bool`, 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 took `request failed` from 4 per run to 0. 3. **Negative result:** the world-entry assert survives with **~3.4 GiB of VRAM headroom**, so it is not an out-of-memory condition. This is the part I most want a maintainer's eye on. Everything below is measured from `victory_gpu::umem` log lines and the title's own crash context, not estimated. ## Environment | | | | :--- | :--- | | GPU | Intel Arc A750 8 GB (`0x8086:0x56A2` family, ACM-G10, ReBAR on); also observed on A580 8 GB | | OS | Windows 10 x64 19045 | | Stack | Agility SDK 1.620.2, DXC 1.9.2609.5, `--features xess` | | Title | Xbox Series X dump, build `930.048.020` (`vb_sub_story`, `device.model: Xbox Series S` reported by the title) | | Render | 1280×720 internal (quality 0.6667) and 640×360 internal (ultra_performance, 0.3333), output 1080p | ## 1. `umem` under-counts by double-counting: `unaccounted` saturates to 0 `title_textures_mib` is computed from the texture kinds, but textures the title fills while resident in the pooled arena are already inside `title_pool_mib`. Adding `title_textures_mib + title_pool_mib` therefore 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()` and `unaccounted` is kept **signed** so an over-subscription shows as negative instead of silently becoming 0. - New fields `pooled_title_textures_mib`, `cpu_visible_mib`, `staging_mib`. - `umem::note_pooled_texture` is called from `pool::texture` on placement and from the `Reclaim` release 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 in `unaccounted`. After the fix the ledger reads honestly, e.g. in-world: ``` used 6607, soft 6460, hard 6460; textures 3098 (pool 2972), targets 937, copies 252, heaps 61, staging 144, unaccounted 1918 ``` 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_write` has no mapping span, so kernel fills can race a remap `title_memory_reading` and `title_memory_remapping` both take a span/guard, so a remap waits for readers. `kernel_will_write` returns only `bool`: it tells the remapper "someone is writing", but it does **not** hold the mapping still for the duration of the kernel call. A `ReadFile`/`fread`/DirectStorage fill can therefore have its destination remapped mid-copy. Observed before the fix, 4 `request failed` per run, both from the DirectStorage path: - `hr=0x800706f8` — `ERROR_INVALID_USER_BUFFER` (1784) - `hr=0x800703e6` — `ERROR_NOACCESS` (998) - one at `destination=0x11d5b700` (a low host address, i.e. not title memory at all) Fix applied locally: - `watch::writing()` now returns a `Reading` span guard; `files.rs` (`ReadFile`, `fread`) and `dstorage.rs::into_destination` hold it across the kernel call. - `read_into` retries `ERROR_INVALID_USER_BUFFER` and `ERROR_NOACCESS`, and at exhaustion **completes without a destination** instead of failing the request. Result: `request failed` went 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: | Run | Internal res | `used` | `soft`/`hard` | textures | targets | copies | crashed | offset | | :--- | :--- | ---: | ---: | ---: | ---: | ---: | :--- | :--- | | baseline | 1280×720 | 6676 | 6590 | 3509 | 807 | 509 | yes | `image+0x23d8f03` | | + copies capped 256 MiB | 1280×720 | 6607 | 6460 | 3098 | 937 | 252 | yes | `image+0x23d8f03` | | `VICTORY_TEXTURE_BUDGET_MB=2200` | 1280×720 | **5707** | 6102 | 2229 | 968 | 252 | yes | `image+0x22106e0` | | `ultra_performance` | 640×360 | **3312** | 6737 / 7073 | 697 | 722 | 253 | yes | `image+0x23d8f03` | Two things worth noting: - The last row crashed at `used 3312` with `card_soft_mib=6737` — over 3 GiB free. Cutting the texture budget by ~1.3 GiB moved the crash to a *different* offset (`+0x22106e0` vs the usual `+0x23d8f03`) rather than avoiding it, which smells like a deterministic assert reached slightly earlier/later in scene setup, not a failed allocation. - The title's own crash context at the moment of death: `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 is `load_percent`-driven, it is reacting to system RAM or its own 7776 MiB pool accounting rather than to `dxgi_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 to `submit.backtrace.io` is 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 `__debugbreak` path, or an assert/`memory.load_percent` override worth trying? I would rather fix the cause than paper over the breakpoint. ## 4. `targets_room_kept` returns 0 in-world, starving ongoing target creation `resource::targets_room_kept_for` returned 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 of `most/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>` to `victory-hle/src/modules/gameinput.rs`: it ORs pad `A` into 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 - All numbers are from a fork with local patches; the `soft == hard` ceiling on 8 GB moves with system state (6102 / 6460 / 6590 / 6737 MiB observed across sessions), so absolute `used` values are only comparable within a run. - The crash offsets are from the translated image (`victory-image-<hash>.dll`), so they are not stable across shader/translation cache changes. - I have not bisected whether findings 1 and 2 predate this fork; both code shapes above look upstream to me.
spektra commented 2026-12-01 10:10:35 +00:00 (Migrated from github.com)
Author
Contributor

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 0x80000003 always at image+0x23d8f03, but a later build reports the frames above it. It is not the main thread — it is a worker created with CreateThread:

#0  victory-image-<hash>.dll+0x23d8f03   (int3)
#1  victory-image-<hash>.dll+0x2593e91
#2  victory-image-<hash>.dll+0x2592d69
#3  victory-image-<hash>.dll+0x2215eca
#4  KERNEL32.DLL+0x17124                 (BaseThreadInitThunk)
#5  ntdll.dll+0x4cc91                    (RtlUserThreadStart)

Two runs, same five frames, registers at the breakpoint:

run rdi r12 r13 rax rbx
1 0x1ce90 (118416) 0x9a3 (2467) 0x9a3 0 0x9a6294120
2 0x27e70 (163440) 0xd4d (3405) 0xd4d 0 0x9a6294120

rdi == 0x30 * r12 in both (118416 = 48 × 2467, 163440 = 48 × 3405), and r12 == 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. rax is 0 in both. r8/r9 look like a packed/tagged 64-bit value (r9 = r8 + 0x43a << 40).

I tried scraping the faulting stack for image-pointed strings (MSVC assert keeps 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:

internal res used soft/hard crashed
1280×720 6676 6590 yes
1280×720, copies capped 256 MiB 6607 6460 yes
1280×720, VICTORY_TEXTURE_BUDGET_MB=2200 5707 6102 yes
640×360 3312 6737 yes
640×360 (later run, got in-world) 6151 6575 yes

Cutting the texture budget 1.3 GiB moved the crash to +0x22106e0 rather 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/GlobalMemoryStatus in 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. Its memory.load_percent: 93 is therefore a description of the host, not an input to any budget, and shaping it changes nothing (it still crashed at the same offset with total 7776 / avail 7776 / load 0 reported). It also never calls XMemGetWorkingSetStatistics at all in this title.

What I added along the way (in my fork, happy to send any of it)

  • GlobalMemoryStatusEx/GlobalMemoryStatus overrides with VICTORY_SYSMEM_MB=N (clamp reported total/available) and VICTORY_MEM_TRUTH=1 (answer as the console's partition would), logging reported vs. host figures. Defaults to passthrough — the same shape greenhouse documents as gh_sysmem_mb/gh_mem_truth.
  • The umem ledger 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.
  • The crash report now prints the frames above a breakpoint (previously it printed only the faulting instruction) and scrapes the faulting stack for image-pointed strings.

Ask

Does 0x2593e91 / 0x2592d69 (which both sit in the same function cluster as the 0x2215eca thread 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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7307786689 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/3932#issuecomment-7307786689). Originally posted by [spektra](https://github.com/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 `0x80000003` always at `image+0x23d8f03`, but a later build reports the frames above it. It is not the main thread — it is a worker created with `CreateThread`: ``` #0 victory-image-<hash>.dll+0x23d8f03 (int3) #1 victory-image-<hash>.dll+0x2593e91 #2 victory-image-<hash>.dll+0x2592d69 #3 victory-image-<hash>.dll+0x2215eca #4 KERNEL32.DLL+0x17124 (BaseThreadInitThunk) #5 ntdll.dll+0x4cc91 (RtlUserThreadStart) ``` Two runs, same five frames, registers at the breakpoint: | run | rdi | r12 | r13 | rax | rbx | | :--- | ---: | ---: | ---: | ---: | ---: | | 1 | `0x1ce90` (118416) | `0x9a3` (2467) | `0x9a3` | 0 | `0x9a6294120` | | 2 | `0x27e70` (163440) | `0xd4d` (3405) | `0xd4d` | 0 | `0x9a6294120` | `rdi == 0x30 * r12` in both (118416 = 48 × 2467, 163440 = 48 × 3405), and `r12 == 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. `rax` is 0 in both. `r8`/`r9` look like a packed/tagged 64-bit value (`r9 = r8 + 0x43a << 40`). I tried scraping the faulting stack for image-pointed strings (MSVC `assert` keeps 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: | internal res | used | soft/hard | crashed | | :--- | ---: | ---: | :--- | | 1280×720 | 6676 | 6590 | yes | | 1280×720, copies capped 256 MiB | 6607 | 6460 | yes | | 1280×720, `VICTORY_TEXTURE_BUDGET_MB=2200` | 5707 | 6102 | yes | | 640×360 | 3312 | 6737 | yes | | 640×360 (later run, got in-world) | 6151 | 6575 | yes | Cutting the texture budget 1.3 GiB moved the crash to `+0x22106e0` rather 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`/`GlobalMemoryStatus` in 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. Its `memory.load_percent: 93` is therefore a description of the host, not an input to any budget, and shaping it changes nothing (it still crashed at the same offset with `total 7776 / avail 7776 / load 0` reported). It also never calls `XMemGetWorkingSetStatistics` at all in this title. ## What I added along the way (in my fork, happy to send any of it) - `GlobalMemoryStatusEx`/`GlobalMemoryStatus` overrides with `VICTORY_SYSMEM_MB=N` (clamp reported total/available) and `VICTORY_MEM_TRUTH=1` (answer as the console's partition would), logging reported vs. host figures. Defaults to passthrough — the same shape greenhouse documents as `gh_sysmem_mb`/`gh_mem_truth`. - The `umem` ledger 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. - The crash report now prints the frames above a breakpoint (previously it printed only the faulting instruction) and scrapes the faulting stack for image-pointed strings. ## Ask Does `0x2593e91` / `0x2592d69` (which both sit in the same function cluster as the `0x2215eca` thread 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.
spektra commented 2026-12-01 10:28:39 +00:00 (Migrated from github.com)
Author
Contributor

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 advances RIP past the int3 at +0x23d8f03 and resumes, to test whether the trap was spurious. It is not:

VIctory: stepped over the title's assert at ...+0x23d8f03 (1 so far)
VIctory: stepped over the title's assert at ...+0x23d8f03 (2 so far)
VIctory: first-chance exception 0xc0000005 at ...+0x2b8035 (read 0x0: nothing mapped there)

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] with rbx = 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:

mov  rbx, [rcx+0x70]        ; array base from the object
imul rdi, [rcx+0x88]        ; index × element size (0x88 = 0x30 = 48 bytes)
mov  rcx, [rbx+rdi+8]       ; element -> its object
mov  rax, [rcx]             ; that object's vtable
lea  rsi, [rsp+0x38]        ; a zeroed local
mov  rdx, rsi               ; passed as the out-parameter
call [rax+8]                ; virtual call, expected to fill the local
mov  rax, [rsi]             ; ← returns nothing; still 0
test rax, rax
je   <int3>

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 CreateThread worker 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 title int3 once and resumes (diagnostic only, opt-in, title images only). Result above is the reason it is not a fix.
  • The crash report now prints the frames above a breakpoint, and scrapes image-pointed strings from the faulting stack (this assert carries no text).
<!-- greyfinch-sync:Marvisak/VIctory:comment:7308246908 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/3932#issuecomment-7308246908). Originally posted by [spektra](https://github.com/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 advances `RIP` past the `int3` at `+0x23d8f03` and resumes, to test whether the trap was spurious. It is not: ``` VIctory: stepped over the title's assert at ...+0x23d8f03 (1 so far) VIctory: stepped over the title's assert at ...+0x23d8f03 (2 so far) VIctory: first-chance exception 0xc0000005 at ...+0x2b8035 (read 0x0: nothing mapped there) ``` 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]` with `rbx = 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`: ```asm mov rbx, [rcx+0x70] ; array base from the object imul rdi, [rcx+0x88] ; index × element size (0x88 = 0x30 = 48 bytes) mov rcx, [rbx+rdi+8] ; element -> its object mov rax, [rcx] ; that object's vtable lea rsi, [rsp+0x38] ; a zeroed local mov rdx, rsi ; passed as the out-parameter call [rax+8] ; virtual call, expected to fill the local mov rax, [rsi] ; ← returns nothing; still 0 test rax, rax je <int3> ``` 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 `CreateThread` worker 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 title `int3` once and resumes (diagnostic only, opt-in, title images only). Result above is the reason it is not a fix. - The crash report now prints the frames above a breakpoint, and scrapes image-pointed strings from the faulting stack (this assert carries no text).
spektra commented 2026-12-01 11:04:02 +00:00 (Migrated from github.com)
Author
Contributor

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

0x80000003 was downstream of DirectStorage requests that our layer completed without writing their destination. The run that cracked it logged, seconds before the assert:

WARN dstorage: destination is not writable; the request completes without it
  destination=0x10b5d9000 len=1056 offset=4243312640
  error=Invalid access to memory location. (os error 998) state=0x1000 protect=0x2

state=0x1000 is MEM_COMMIT, protect=0x2 is PAGE_READONLY. Eight such requests completed per run, each handing the title unwritten bytes for real archive data (story000.rpf and its .ttpf packs 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() walks guards.protected / guards.aliased). A block left read-only for any other reason — a guard cleared by a sweep, a view the title protected — stays PAGE_READONLY, so every retry fails identically with ERROR_NOACCESS until the retry budget runs out and the request completes with nothing written.

Fix

  • victory-gpu/src/watch.rs: new writable_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 the ERROR_NOACCESS/ERROR_INVALID_USER_BUFFER retry 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:

before after
destination is not writable per run 4–8 0
0x80000003 at +0x23d8f03 every run, within seconds of world entry 0
time in world seconds 8+ minutes, still running
draws/frame 3,660–5,028 before dying 1,334–1,582 sustained

The 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's break 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 title int3 for experiments (it is how I proved the assert was load-bearing: skipping it produced an immediate null dereference at +0x2b8035).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7309120522 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/3932#issuecomment-7309120522). Originally posted by [spektra](https://github.com/spektra) on 2026-12-01T11:04:02Z. --- Found and fixed the cause — it was our side, not the title's. ## Root cause `0x80000003` was downstream of DirectStorage requests that our layer **completed without writing their destination**. The run that cracked it logged, seconds before the assert: ``` WARN dstorage: destination is not writable; the request completes without it destination=0x10b5d9000 len=1056 offset=4243312640 error=Invalid access to memory location. (os error 998) state=0x1000 protect=0x2 ``` `state=0x1000` is `MEM_COMMIT`, `protect=0x2` is `PAGE_READONLY`. Eight such requests completed per run, each handing the title unwritten bytes for real archive data (`story000.rpf` and its `.ttpf` packs 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()` walks `guards.protected` / `guards.aliased`). A block left read-only for any other reason — a guard cleared by a sweep, a view the title protected — stays `PAGE_READONLY`, so every retry fails identically with `ERROR_NOACCESS` until the retry budget runs out and the request completes with nothing written. ## Fix - `victory-gpu/src/watch.rs`: new `writable_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 the `ERROR_NOACCESS`/`ERROR_INVALID_USER_BUFFER` retry 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: | | before | after | | :--- | :--- | :--- | | `destination is not writable` per run | 4–8 | **0** | | `0x80000003` at `+0x23d8f03` | every run, within seconds of world entry | **0** | | time in world | seconds | **8+ minutes, still running** | | draws/frame | 3,660–5,028 before dying | 1,334–1,582 sustained | The 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`'s `break 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 title `int3` for experiments (it is how I proved the assert was load-bearing: skipping it produced an immediate null dereference at `+0x2b8035`).
spektra commented 2026-12-01 11:48:49 +00:00 (Migrated from github.com)
Author
Contributor

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_into completed 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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7310180288 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/3932#issuecomment-7310180288). Originally posted by [spektra](https://github.com/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_into` completed 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.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Marvisak/VIctory#3932
No description provided.