XMem: title-placed reservations are write-watched only when asked for (Series S boot, #3023) #3126

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

@⁠TheSovietWaffle on GitHub · 2026-11-29 20:08 UTC · original
TheSovietWaffle:fix/series-s-watch-placed → main · +46 −5 · 1 files · 1 commits · open

Addresses #3023. The kernel stall itself is not explained here; this removes it from the default path and keeps the title-placed watch testable.

What it changes

78324212 gave title-placed reservations MEM_WRITE_WATCH by default. On the Series S the title's 3977 MB pool at 0x2000000000 goes through VirtualAlloc2 with that watch and never returns, so the profile hangs before the menu, the thread stays in the kernel, and the process cannot be killed. The reporter in #3023 bisected it to that commit and booted a build with watch_placement forced to false (a one-line change); that is the evidence this change is built on.

Comparing the last good build, v2026.11.28.03, with main, the write-watch change in xmem.rs is this branch: .28.03 watched only host-placed allocations (if constrained { ... kind |= MEM_WRITE_WATCH }). Unset now restores exactly that, and the switch keeps the newer path available.

This makes that path opt-in instead of default:

  • VICTORY_WATCH_PLACED_XMEM=1: ask for the watch, as v2026.11.29.02 did, so the title-placed path can keep being tested.
  • Unset (the default): placed reservations are not watched. Host-placed reservations (MEM_ADDRESS_REQUIREMENTS) are still watched exactly as before, a placeholder is still never watched, and a MEM_WRITE_WATCH the title asked for itself is still honoured.
  • The decision is a unit-tested function, can_watch_placement; the switch is read once through a OnceLock, like VICTORY_WATCH_LARGE_XMEM beside it.

Nothing else changes: the existing fallback for a refused watch, the "XMemVirtualAlloc without write watching" line, and all host-placed watching stay as they were. Series X is unaffected, because its pool is placed by us, on the constrained path.

I considered limiting the watch by size instead (the hang is on the 3977 MB pool, the earlier 82 MB placements went through), but the cause is not understood, so a threshold would be a guess about which sizes are safe. Off by default is the conservative choice, and the switch leaves the experiment available.

How it was tested

  • New test a_placed_reservation_is_watched_only_when_asked_for: a placed reservation is watched only when the switch asks for it, never through the host-placed path, never for placeholders, and the title's own MEM_WRITE_WATCH still passes. It passes.
  • cargo build --release --locked -p victory: finishes, same warnings as main.
  • cargo clippy -p victory-hle --lib: no finding in xmem.rs (the crate's other warnings are on main, unchanged).
  • GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing): smoke-tested with the title (Windows 10 19045, RTX 3080, fresh cache/data, default switches): Series S boots, allocates the 3977 MB pool, starts 8 pipeline workers and runs to frame ~5,700 with no errors. This is not a differential test: in that run the big pool was host-placed (asked_at=0x0), so the title-placed watch path of #3023 was never taken; the evidence for the fix remains the reporter's build with the same effective change (watch off) booting the profile, quoted in #3023. A build from this branch with the switch unset is the missing step; with VICTORY_WATCH_PLACED_XMEM=1 the hang should come back, which is the knob for whoever wants to chase the kernel call.
  • cargo test -p victory-hle --lib modules::xmem: 46 passed, 1 failed: a_read_by_range_waits_only_for_a_remapping_that_meets_it, the known parallel-run flake of #2420 item 2 (PR #2439). It passes when run alone, and it does not touch this path.

Checked for overlap

  • I searched the open pull requests for #3023 and for watch_placement: none touches this code. Related: #2048 and #3086 (diagnostics build), #2792 (first Clippy gate), #2439 (the xmem flake above); none changes xmem.rs's placement watching.
**@⁠TheSovietWaffle** on GitHub · 2026-11-29 20:08 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3126) `TheSovietWaffle:fix/series-s-watch-placed` → `main` · +46 −5 · 1 files · 1 commits · open Addresses #3023. The kernel stall itself is not explained here; this removes it from the default path and keeps the title-placed watch testable. ## What it changes `78324212` gave title-placed reservations `MEM_WRITE_WATCH` by default. On the Series S the title's 3977 MB pool at `0x2000000000` goes through `VirtualAlloc2` with that watch and never returns, so the profile hangs before the menu, the thread stays in the kernel, and the process cannot be killed. The reporter in #3023 bisected it to that commit and booted a build with `watch_placement` forced to `false` (a one-line change); that is the evidence this change is built on. Comparing the last good build, v2026.11.28.03, with `main`, the write-watch change in `xmem.rs` is this branch: `.28.03` watched only host-placed allocations (`if constrained { ... kind |= MEM_WRITE_WATCH }`). Unset now restores exactly that, and the switch keeps the newer path available. This makes that path opt-in instead of default: - `VICTORY_WATCH_PLACED_XMEM=1`: ask for the watch, as v2026.11.29.02 did, so the title-placed path can keep being tested. - Unset (the default): placed reservations are not watched. Host-placed reservations (`MEM_ADDRESS_REQUIREMENTS`) are still watched exactly as before, a placeholder is still never watched, and a `MEM_WRITE_WATCH` the title asked for itself is still honoured. - The decision is a unit-tested function, `can_watch_placement`; the switch is read once through a `OnceLock`, like `VICTORY_WATCH_LARGE_XMEM` beside it. Nothing else changes: the existing fallback for a refused watch, the "XMemVirtualAlloc without write watching" line, and all host-placed watching stay as they were. Series X is unaffected, because its pool is placed by us, on the `constrained` path. I considered limiting the watch by size instead (the hang is on the 3977 MB pool, the earlier 82 MB placements went through), but the cause is not understood, so a threshold would be a guess about which sizes are safe. Off by default is the conservative choice, and the switch leaves the experiment available. ## How it was tested - New test `a_placed_reservation_is_watched_only_when_asked_for`: a placed reservation is watched only when the switch asks for it, never through the host-placed path, never for placeholders, and the title's own `MEM_WRITE_WATCH` still passes. It passes. - `cargo build --release --locked -p victory`: finishes, same warnings as `main`. - `cargo clippy -p victory-hle --lib`: no finding in `xmem.rs` (the crate's other warnings are on `main`, unchanged). - GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing): smoke-tested with the title (Windows 10 19045, RTX 3080, fresh cache/data, default switches): Series S boots, allocates the 3977 MB pool, starts 8 pipeline workers and runs to frame ~5,700 with no errors. **This is not a differential test**: in that run the big pool was host-placed (`asked_at=0x0`), so the title-placed watch path of #3023 was never taken; the evidence for the fix remains the reporter's build with the same effective change (watch off) booting the profile, quoted in #3023. A build from this branch with the switch unset is the missing step; with `VICTORY_WATCH_PLACED_XMEM=1` the hang should come back, which is the knob for whoever wants to chase the kernel call. - `cargo test -p victory-hle --lib modules::xmem`: 46 passed, 1 failed: `a_read_by_range_waits_only_for_a_remapping_that_meets_it`, the known parallel-run flake of #2420 item 2 (PR #2439). It passes when run alone, and it does not touch this path. ## Checked for overlap - [x] I searched the open pull requests for #3023 and for `watch_placement`: none touches this code. Related: #2048 and #3086 (diagnostics build), #2792 (first Clippy gate), #2439 (the xmem flake above); none changes `xmem.rs`'s placement watching.
On the Series S the title's 3977 MB pool at 0x2000000000 made VirtualAlloc2
with MEM_WRITE_WATCH never return (v2026.11.29.01, #3023): the profile hangs
before the menu and the process cannot be killed. The reporter bisected it to
78324212 and booted a build with watch_placement forced false.

Keep that path, but off by default: VICTORY_WATCH_PLACED_XMEM=1 asks for the
watch to keep testing it. Host-placed reservations are watched as before, and
placeholders and a watch the title asked for itself are honoured as asked.
The predicate is a unit-tested function; the switch is read once, like
VICTORY_WATCH_LARGE_XMEM beside it.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 20:12:53 +00:00
github-bot force-pushed github-bot/gh-3126 from 3316cf2bf7 to 59be6404d8 2026-11-29 22:18:21 +00:00 Compare
github-bot force-pushed github-bot/gh-3126 from 59be6404d8 to 92458a4fa5 2026-11-30 00:40:22 +00:00 Compare
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/3126/head:github-bot/gh-3126'
git switch 'github-bot/gh-3126'

Merge

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