XMem: the title's spare defaults to 6,300 MiB, a little more than its 6,236 MiB heap (#3273) #3353

Open
github-bot wants to merge 1 commit from github-bot/gh-3353 into main AGit
Owner

@⁠kibagami-nc on GitHub · 2026-11-29 22:10 UTC · original
kibagami-nc:xmem/title-spare-6300 → main · +17 −3 · 1 files · 1 commits · open

From #3273, measured by @⁠straperlu.

What happens

v2026.11.29.04 (f72cec77) reserves 8,192 MiB of address space for the title at start, top-down in [4 GiB, 128 GiB). The spare only has to hold room for the title's 6,236 MiB heap: when the heap is refused, the spare is given back and the request is tried again.

On a PC where that window is already tight, the extra room the spare takes is what the start was missing. The PC in #3273 is an RTX 3090, 32 GB, where DLSS's driver holds 36 + 28 GiB of the range (#2081, #2133). There, .04 as shipped stopped for good in the start's shader-cache walk: 19,000 of 27,591, 16 s of CPU, no error, no window.

Three runs there, all with the .04 release asset, the same switches and the same warm cache:

VICTORY_TITLE_SPARE_MB Result
8,192 (the default) the cache walk stops dead at 19,000/27,591
6,300 the walk completes, the 6,236 MiB heap is placed, the title runs (14 fps, frame generation 28)
0 the walk completes, and the heap is refused at start (+0x1e6c284, the #2081 stop)

The change

  • The new default: 6,300 MiB, the value measured to work, 64 MiB above the heap.
  • The constants: the heap's size and the default are named in xmem.rs, with a compile-time check that the default stays above the heap.
  • The switch: VICTORY_TITLE_SPARE_MB still sets any other size, and 0 turns the spare off.

Where the spare still covers the heap, nothing else changes: it is given back and the heap is tried again, as before.

A design that holds the spare only until the title asks for its heap, as #3273 suggests, would not depend on the number at all. That is a bigger change, and this one keeps f72cec77's design as it is.

Tests

  • cargo test -p victory-hle --locked: 423 passed.
    • a_read_by_range_waits_only_for_a_remapping_that_meets_it failed once in a full run, and passes alone (3 of 3). It's timing-sensitive under parallel tests and unrelated to this constant.
  • The compile-time check TITLE_SPARE_MB > TITLE_HEAP_MB holds.
  • cargo clippy -p victory-hle --all-targets: nothing in the changed lines.

Not run here: no PC here has a window this tight. The numbers are #3273's.

**@⁠kibagami-nc** on GitHub · 2026-11-29 22:10 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3353) `kibagami-nc:xmem/title-spare-6300` → `main` · +17 −3 · 1 files · 1 commits · open From #3273, measured by @⁠straperlu. ## What happens v2026.11.29.04 (f72cec77) reserves 8,192 MiB of address space for the title at start, top-down in [4 GiB, 128 GiB). The spare only has to hold room for the title's 6,236 MiB heap: when the heap is refused, the spare is given back and the request is tried again. On a PC where that window is already tight, the extra room the spare takes is what the start was missing. The PC in #3273 is an RTX 3090, 32 GB, where DLSS's driver holds 36 + 28 GiB of the range (#2081, #2133). There, .04 as shipped stopped for good in the start's shader-cache walk: 19,000 of 27,591, 16 s of CPU, no error, no window. Three runs there, all with the .04 release asset, the same switches and the same warm cache: | `VICTORY_TITLE_SPARE_MB` | Result | |---|---| | 8,192 (the default) | the cache walk stops dead at 19,000/27,591 | | 6,300 | the walk completes, the 6,236 MiB heap is placed, the title runs (14 fps, frame generation 28) | | 0 | the walk completes, and the heap is refused at start (`+0x1e6c284`, the #2081 stop) | ## The change - **The new default:** 6,300 MiB, the value measured to work, 64 MiB above the heap. - **The constants:** the heap's size and the default are named in `xmem.rs`, with a compile-time check that the default stays above the heap. - **The switch:** `VICTORY_TITLE_SPARE_MB` still sets any other size, and 0 turns the spare off. Where the spare still covers the heap, nothing else changes: it is given back and the heap is tried again, as before. A design that holds the spare only until the title asks for its heap, as #3273 suggests, would not depend on the number at all. That is a bigger change, and this one keeps f72cec77's design as it is. ## Tests - `cargo test -p victory-hle --locked`: 423 passed. - `a_read_by_range_waits_only_for_a_remapping_that_meets_it` failed once in a full run, and passes alone (3 of 3). It's timing-sensitive under parallel tests and unrelated to this constant. - The compile-time check `TITLE_SPARE_MB > TITLE_HEAP_MB` holds. - `cargo clippy -p victory-hle --all-targets`: nothing in the changed lines. Not run here: no PC here has a window this tight. The numbers are #3273's.
The spare only has to hold room for the title's 6,236 MiB heap: when the heap
is refused it is given back and the request is tried again. 8,192 MiB was more
than a tight window has. On an RTX 3090 PC where DLSS's driver already holds
36 + 28 GiB of [4 GiB, 128 GiB) (#2081, #2133), v2026.11.29.04 stopped for good
in the start's shader-cache walk; with VICTORY_TITLE_SPARE_MB=6300 the walk
finished and the heap was still placed, and with 0 the heap was refused (#3273).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 22:12:16 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/3353/head:github-bot/gh-3353'
git switch 'github-bot/gh-3353'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-3353'
git switch 'github-bot/gh-3353'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-3353'
git switch 'github-bot/gh-3353'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-3353'
git switch 'main'
git merge --squash 'github-bot/gh-3353'
git switch 'main'
git merge --ff-only 'github-bot/gh-3353'
git switch 'main'
git merge 'github-bot/gh-3353'
git push origin 'main'
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!3353
No description provided.