xmem: large reservations are said before the host is asked, not only after #3242

Closed
github-bot wants to merge 1 commit from github-bot/gh-3242 into main AGit
Owner

@⁠vanatorr on GitHub · 2026-11-29 20:57 UTC · original
vanatorr:log-large-reservations-before-the-call → main · +20 −0 · 1 files · 1 commits · closed without merging

VirtualAlloc2 of a large range can take a long time, and every line around it is written once it has come back. A run that stops inside it leaves no sign of which reservation it was in: the log simply ends at whatever was said last, which is usually an unrelated small allocation several lines earlier.

Reservations of 256 MiB or more now say so before the host is asked. The title's own large ranges are far above that; the many small reservations stay quiet.

Why

Tracking a start that never reaches the world on an RTX 3080 10 GB with DLSS on. The log always ended here, identically, in six runs:

title memory asked for as protection 0x4, kind 0x203000, flags 0x3: 2 times, 82 MB, last 0x998710000+0x10000
title memory asked for as protection 0x4, kind 0x203000, flags 0x3: 4 times, 82 MB, last 0x998730000+0x10000

That reads like it stopped at an 82 MB allocation. It did not. With DLSS off the same run carries on, and the very next thing it does is the title's heap:

XMemVirtualAlloc without write watching at=0x9bb200000 size=4170186752
title memory asked for as protection 0x2004, kind 0x42000, flags 0x23: 1 times, 3977 MB

The 3,977 MB reservation is the call that never comes back, and nothing in the log pointed at it. Working that out took comparing a 32,000-line good log against a 120-line bad one.

What it looks like now

Run on the same machine, this build, DLSS off (so it gets past the point above):

XMemVirtualAlloc of a large range: asking the host now size=17179869184 at=0x0 kind=0x42000
XMemVirtualAlloc without write watching (the title's own address, or a placeholder) at=0x100000000 size=17179869184
XMemVirtualAlloc of a large range: asking the host now size=17179869184 at=0x0 kind=0x42000
XMemVirtualAlloc without write watching (the title's own address, or a placeholder) at=0x500000000 size=17179869184
XMemVirtualAlloc of a large range: asking the host now size=1218445312 at=0x0 kind=0x203000
XMemVirtualAlloc of a large range: asking the host now size=1339031552 at=0x0 kind=0x203000
XMemVirtualAlloc of a large range: asking the host now size=270532608 at=0x0 kind=0x203000
XMemVirtualAlloc of a large range: asking the host now size=4170186752 at=0x0 kind=0x42000

Six lines for a whole start, each paired with the existing line once the call returns. A run that hangs inside one of them now ends on the line that names it.

Tested

  • cargo check -p victory-hle: clean.
  • Release build run on the title: the six lines above, each followed by the existing line where the call returned. No other change in behaviour.
  • RTX 3080 10 GB, driver 621.24, Windows 11 26300, Series S profile, v2026.11.29.02 plus this commit.

Scope

Diagnostics only. It does not fix the DLSS hang described above, which I have not root-caused; it makes that class of hang name itself instead of ending the log at an unrelated line. Happy to change the threshold, the wording, or put it behind a switch.

🤖 Generated with Claude Code

**@⁠vanatorr** on GitHub · 2026-11-29 20:57 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3242) `vanatorr:log-large-reservations-before-the-call` → `main` · +20 −0 · 1 files · 1 commits · closed without merging `VirtualAlloc2` of a large range can take a long time, and every line around it is written once it has come back. A run that stops inside it leaves no sign of which reservation it was in: the log simply ends at whatever was said last, which is usually an unrelated small allocation several lines earlier. Reservations of 256 MiB or more now say so **before** the host is asked. The title's own large ranges are far above that; the many small reservations stay quiet. ## Why Tracking a start that never reaches the world on an RTX 3080 10 GB with DLSS on. The log always ended here, identically, in six runs: ``` title memory asked for as protection 0x4, kind 0x203000, flags 0x3: 2 times, 82 MB, last 0x998710000+0x10000 title memory asked for as protection 0x4, kind 0x203000, flags 0x3: 4 times, 82 MB, last 0x998730000+0x10000 ``` That reads like it stopped at an 82 MB allocation. It did not. With DLSS off the same run carries on, and the very next thing it does is the title's heap: ``` XMemVirtualAlloc without write watching at=0x9bb200000 size=4170186752 title memory asked for as protection 0x2004, kind 0x42000, flags 0x23: 1 times, 3977 MB ``` The 3,977 MB reservation is the call that never comes back, and nothing in the log pointed at it. Working that out took comparing a 32,000-line good log against a 120-line bad one. ## What it looks like now Run on the same machine, this build, DLSS off (so it gets past the point above): ``` XMemVirtualAlloc of a large range: asking the host now size=17179869184 at=0x0 kind=0x42000 XMemVirtualAlloc without write watching (the title's own address, or a placeholder) at=0x100000000 size=17179869184 XMemVirtualAlloc of a large range: asking the host now size=17179869184 at=0x0 kind=0x42000 XMemVirtualAlloc without write watching (the title's own address, or a placeholder) at=0x500000000 size=17179869184 XMemVirtualAlloc of a large range: asking the host now size=1218445312 at=0x0 kind=0x203000 XMemVirtualAlloc of a large range: asking the host now size=1339031552 at=0x0 kind=0x203000 XMemVirtualAlloc of a large range: asking the host now size=270532608 at=0x0 kind=0x203000 XMemVirtualAlloc of a large range: asking the host now size=4170186752 at=0x0 kind=0x42000 ``` Six lines for a whole start, each paired with the existing line once the call returns. A run that hangs inside one of them now ends on the line that names it. ## Tested - `cargo check -p victory-hle`: clean. - Release build run on the title: the six lines above, each followed by the existing line where the call returned. No other change in behaviour. - RTX 3080 10 GB, driver 621.24, Windows 11 26300, Series S profile, v2026.11.29.02 plus this commit. ## Scope Diagnostics only. It does not fix the DLSS hang described above, which I have not root-caused; it makes that class of hang name itself instead of ending the log at an unrelated line. Happy to change the threshold, the wording, or put it behind a switch. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
`VirtualAlloc2` of a large range can take a long time, and every line around
it is written once it has returned. A run that stops inside it leaves no sign
of which reservation it was in: the log simply ends at whatever was said last,
which is usually an unrelated small allocation several lines earlier.

Reservations of 256 MiB or more now say so before the call. The title's own
large ranges are far above that, and the many small reservations stay quiet.

Found while tracking a start that never reaches the world on an RTX 3080 with
DLSS on: the log ended at an 82 MB allocation, and the step that never came
back was the title's 3,977 MB heap two lines later. With this the log names it.

Co-Authored-By: Claude Opus 5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 21:03:20 +00:00
Author
Owner

@⁠copilot-pull-request-reviewer[bot] on GitHub · 2026-11-29 20:57 UTC · original · reviewed

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

**@⁠copilot-pull-request-reviewer[bot]** on GitHub · 2026-11-29 20:57 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3242#pullrequestreview-6104770522) · **reviewed** Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
github-bot closed this pull request 2026-12-01 18:58:58 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
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/trustno1-coder--VIctory-NVIDIA!3242
No description provided.