VICTORY_RECORD: the title aborts about 30 s into a capture (+0x2215c35, write 0x0), so the capture is never completed #441

Open
opened 2026-12-04 04:19:18 +00:00 by github-bot · 1 comment
Owner

@⁠abomalocaris on GitHub · 2026-12-04 04:14 UTC · original

With VICTORY_RECORD=<folder> and a go file as the trigger, on main at 842767a with #216, #262 and #274 merged (diagnostics build), the capture starts and the title stops about 31 seconds later:

frame recorder: the next frame is captured presents=6139 waited=3
VIctory: hang watch: no frame begun for 10 s (frame 6141) ...
VIctory: unhandled exception 0xc0000005 at victory-image-b99f876b74d4a77f.dll+0x23cf683 (write 0x0: nothing mapped there)
  #1  victory-image-b99f876b74d4a77f.dll+0x2215c35
  #2  victory-image-b99f876b74d4a77f.dll+0x2215eca
  #3  kernel32.dll+0x116b9

present.bin is left at 0 bytes. The thread starts in kernel32 and goes straight to that site, so it looks like the title's own watchdog giving up on a frame that stands still: writing "what the CPU changed" took 266 s here (23.5 GB of 28 GB).

A local workaround that let the capture finish: in the vectored handler in crates/victory-loader/src/crash.rs, when an access violation is a write to address 0 at a chosen offset of the title's image (I passed 23cf683 in an environment variable), the thread sleeps for good instead of the exception being passed on. With that the capture completed and the title carried on afterwards:

frame recorder: 40 submissions, 291 lists, 26713 resources, 1350 pipelines; 3609 MB of the card's memory, 23544 MB of changes by the CPU; 267.4 s: contents of the card's memory 0.9 s, waiting for the card 0.1 s, what the CPU changed 266.0 s

I can open a PR with that as an opt-in diagnostics switch if it is wanted in this form; a cleaner fix may be to keep the title's clock or that thread still while a capture runs. Separately: is 23.5 GB of CPU-side changes for one frame expected with VICTORY_PAGES=0? At that size the capture cannot be replayed on a 32 GB machine.

Setup: RX 9070 XT 16 GB, Ryzen 7 9800X3D, 32 GB RAM, CachyOS, Series X profile, 2560x1440 with FSR 4 quality, VICTORY_PAGES=0.

Written with AI assistance (Claude Code); the runs and observations are from my own machine.

**@⁠abomalocaris** on GitHub · 2026-12-04 04:14 UTC · [original](https://github.com/lobomfz/VIctory-xmem/issues/441) With `VICTORY_RECORD=<folder>` and a `go` file as the trigger, on `main` at `842767a` with #216, #262 and #274 merged (diagnostics build), the capture starts and the title stops about 31 seconds later: ``` frame recorder: the next frame is captured presents=6139 waited=3 VIctory: hang watch: no frame begun for 10 s (frame 6141) ... VIctory: unhandled exception 0xc0000005 at victory-image-b99f876b74d4a77f.dll+0x23cf683 (write 0x0: nothing mapped there) #1 victory-image-b99f876b74d4a77f.dll+0x2215c35 #2 victory-image-b99f876b74d4a77f.dll+0x2215eca #3 kernel32.dll+0x116b9 ``` `present.bin` is left at 0 bytes. The thread starts in `kernel32` and goes straight to that site, so it looks like the title's own watchdog giving up on a frame that stands still: writing "what the CPU changed" took 266 s here (23.5 GB of 28 GB). A local workaround that let the capture finish: in the vectored handler in `crates/victory-loader/src/crash.rs`, when an access violation is a write to address 0 at a chosen offset of the title's image (I passed `23cf683` in an environment variable), the thread sleeps for good instead of the exception being passed on. With that the capture completed and the title carried on afterwards: ``` frame recorder: 40 submissions, 291 lists, 26713 resources, 1350 pipelines; 3609 MB of the card's memory, 23544 MB of changes by the CPU; 267.4 s: contents of the card's memory 0.9 s, waiting for the card 0.1 s, what the CPU changed 266.0 s ``` I can open a PR with that as an opt-in diagnostics switch if it is wanted in this form; a cleaner fix may be to keep the title's clock or that thread still while a capture runs. Separately: is 23.5 GB of CPU-side changes for one frame expected with `VICTORY_PAGES=0`? At that size the capture cannot be replayed on a 32 GB machine. Setup: RX 9070 XT 16 GB, Ryzen 7 9800X3D, 32 GB RAM, CachyOS, Series X profile, 2560x1440 with FSR 4 quality, `VICTORY_PAGES=0`. _Written with AI assistance (Claude Code); the runs and observations are from my own machine._
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-04 04:19:19 +00:00
Author
Owner

@⁠Widget9337 on GitHub · 2026-12-04 15:31 UTC · original

Same here, and your workaround works. RX 9070 XT 16 GB, Ryzen 9 7950X3D, 64 GB RAM, CachyOS (kernel 7.2), this repo's Mesa and vkd3d-proton, Series X, 1080p with FSR 4 Balanced, ray tracing on, paging on (not VICTORY_PAGES=0). Build: 8585cd4 with #216, #344 and #428 picked on top, diagnostics build.

The abort. Two captures ended the same way, 31 s after the capture began: a write to 0 at victory-image+0x23cf683, called from +0x2215c35. With your workaround as a local switch (VICTORY_PARK_FAULT=23cf683: in the vectored handler, a write to 0 at that offset of the title's image sleeps that thread for good), a third capture finished and the title carried on afterwards. A switch like that, off by default, would be useful upstream.

A second way a capture dies. In one try the game ended 11 s in, and not from the title: VIctory's own hang watch crashed while dumping every thread's stack (read of 0 in ntdll, from crash::unwind_into ← stacks::frames_of ← run::hang_watch). With VICTORY_HANG_WATCH_S=0 it didn't happen again. The hang watch could stay quiet while a capture runs.

What the finished capture cost. Two frames, triggered at a flash:

62 submissions, 526 lists, 58120 resources, 1550 pipelines; 4206 MB of the card's memory, 26788 MB of changes by the CPU; 570.1 s: contents of the card's memory 1.0 s, waiting for the card 0.1 s, what the CPU changed 568.2 s

The first frame wrote about 26.7 GB of changes and the second about 1.4 GB, but each took about 4¾ minutes, so reading is the limit, not writing: it ran at the same rate to a compressed btrfs drive and to a plain ext4 one.

Replaying it doesn't fit in 64 GB. I watched one with a guard that reads MemAvailable every 0.1 s and kills the replay under 12 GB:

time available GTT used VRAM used
start 57.3 GB 0.1 GB 0.6 GB
2.0 s 32.9 GB 26.3 GB 0.6 GB
2.5 s 24.5 GB 30.0 GB 0.6 GB
4.5 s 13.2 GB 30.0 GB 0.6 GB

The guard killed it at 4.8 s, still in setup. The heaps were made in system memory through GTT, which filled to its limit (half of RAM by default) in about a second while VRAM never moved, and it was still taking about 6 GB a second beyond that. A warning for anyone trying this: before the guard, one uncontained replay ran the whole PC out of memory and the OOM killer took down the desktop session, and a second one inside a systemd scope with MemoryMax=44G hard locked the PC. The cap never fired, because GTT pages aren't charged to the cgroup.

So to your question: 23.5 GB (here 26.8 GB) of CPU side changes for one frame looks like whole buffers of title memory, not what the frame reads. Recording only the pages a frame's commands touch, or letting the replay place those heaps on the card or read them from disk as needed, would probably be what makes a capture replayable on 32 or 64 GB.

One more thing that may help others: I had the pop watch start the recorder at the first frame with two or more blips, but the recorder only took the frame about 7 frames after the flash (judged one frame late, then three presents to arm), and the flash was over. A capture of a one frame flash may need the recorder kept armed so it can take the very next frame.

**@⁠Widget9337** on GitHub · 2026-12-04 15:31 UTC · [original](https://github.com/lobomfz/VIctory-xmem/issues/441#issuecomment-7415990494) Same here, and your workaround works. RX 9070 XT 16 GB, Ryzen 9 7950X3D, 64 GB RAM, CachyOS (kernel 7.2), this repo's Mesa and vkd3d-proton, Series X, 1080p with FSR 4 Balanced, ray tracing on, paging on (not `VICTORY_PAGES=0`). Build: `8585cd4` with #216, #344 and #428 picked on top, diagnostics build. **The abort.** Two captures ended the same way, 31 s after the capture began: a write to 0 at `victory-image+0x23cf683`, called from `+0x2215c35`. With your workaround as a local switch (`VICTORY_PARK_FAULT=23cf683`: in the vectored handler, a write to 0 at that offset of the title's image sleeps that thread for good), a third capture finished and the title carried on afterwards. A switch like that, off by default, would be useful upstream. **A second way a capture dies.** In one try the game ended 11 s in, and not from the title: VIctory's own hang watch crashed while dumping every thread's stack (read of 0 in `ntdll`, from `crash::unwind_into` ← `stacks::frames_of` ← `run::hang_watch`). With `VICTORY_HANG_WATCH_S=0` it didn't happen again. The hang watch could stay quiet while a capture runs. **What the finished capture cost.** Two frames, triggered at a flash: ``` 62 submissions, 526 lists, 58120 resources, 1550 pipelines; 4206 MB of the card's memory, 26788 MB of changes by the CPU; 570.1 s: contents of the card's memory 1.0 s, waiting for the card 0.1 s, what the CPU changed 568.2 s ``` The first frame wrote about 26.7 GB of changes and the second about 1.4 GB, but each took about 4¾ minutes, so reading is the limit, not writing: it ran at the same rate to a compressed btrfs drive and to a plain ext4 one. **Replaying it doesn't fit in 64 GB.** I watched one with a guard that reads `MemAvailable` every 0.1 s and kills the replay under 12 GB: | time | available | GTT used | VRAM used | |---|---|---|---| | start | 57.3 GB | 0.1 GB | 0.6 GB | | 2.0 s | 32.9 GB | 26.3 GB | 0.6 GB | | 2.5 s | 24.5 GB | 30.0 GB | 0.6 GB | | 4.5 s | 13.2 GB | 30.0 GB | 0.6 GB | The guard killed it at 4.8 s, still in setup. The heaps were made in system memory through GTT, which filled to its limit (half of RAM by default) in about a second while VRAM never moved, and it was still taking about 6 GB a second beyond that. A warning for anyone trying this: before the guard, one uncontained replay ran the whole PC out of memory and the OOM killer took down the desktop session, and a second one inside a systemd scope with `MemoryMax=44G` hard locked the PC. The cap never fired, because GTT pages aren't charged to the cgroup. So to your question: 23.5 GB (here 26.8 GB) of CPU side changes for one frame looks like whole buffers of title memory, not what the frame reads. Recording only the pages a frame's commands touch, or letting the replay place those heaps on the card or read them from disk as needed, would probably be what makes a capture replayable on 32 or 64 GB. One more thing that may help others: I had the pop watch start the recorder at the first frame with two or more blips, but the recorder only took the frame about 7 frames after the flash (judged one frame late, then three presents to arm), and the flash was over. A capture of a one frame flash may need the recorder kept armed so it can take the very next frame.
This discussion has been locked. Commenting is limited to contributors.
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.

Dependencies

No dependencies set

Reference
github/lobomfz--VIctory-xmem#441
No description provided.