Skip to content

[pr-fix] Hold room below 2^37 for the title's big reservation, so it starts with DLSS (#15) - #44

Open
AstralDrift wants to merge 3 commits into
Kemerd:mainfrom
AstralDrift:fix-15-title-window
Open

AstralDrift wants to merge 3 commits into
Kemerd:mainfrom
AstralDrift:fix-15-title-window

Conversation

@AstralDrift

Copy link
Copy Markdown

For #15 (not "Fixes": confirmed on one PC, not yet by others who reported it).

What it changes

Since 3109d38 the title's 64-bit memory is capped at 2^37, the reach of the directory of memory by address. With DLSS loaded, two blocks of 36 GB and 28 GB sit in that window, the title's 6.2 GB reservation has no gap, and the title stops itself at +0x1e6c284. Test 12 looked up to 2^40 and booted.

  • Room held (on by default, runs that ask for DLSS or DLSS frame generation only). VICTORY_TITLE_ROOM_MB (6400, 0 for none) reserves a placeholder at the top of the window before Streamline loads. It is cut to the title's reservation when that comes, never released first, so nothing can take it in between. It is given back when a request the window refuses needs it, or Streamline does not load. Address space only, no memory committed.
  • Fallback (on by default). VICTORY_TITLE_WIDE_FALLBACK (0 for off) retries a reservation that still has no gap over the full range its flags allow, with one WARN.
  • No search of a window known to be full. For reservations (not commits) of 64 MB or more, the window is walked first and the host is not asked if there is no gap. On Windows 11 build 26300, a standalone probe of VirtualAlloc2 showed such a search spinning in the kernel, for some shapes of the window, in a process that then cannot be killed. Smaller, committed and internal requests can still make that search, as before.
  • Log lines. What appears in the window is logged around slInit, the making of the device, slSetD3DDevice and the feature load.

Known risks

  • Memory the fallback places above 2^37 has no directory entry: shaders that read it by address read zeros, so draws can be missing or wrong (#218). The title's GPU work can reach this block.
  • The window is too full for everything, so the room moves other allocations elsewhere. VICTORY_TITLE_ROOM_MB=0 turns it off.
  • Both switches are on by default, against the rule in AGENTS.md that new ones are off. Say if you want them off.

How it was tested

  • GPU and profile: RTX 4090, 32 GB RAM, Windows 11 build 26300, Series X profile, DLSS with Ray Reconstruction and frame generation loaded.
  • Before (test 13/14 behaviour, same PC, same day): refused, asked_mb=6236 largest_free_gap_mb=3610, stopped about 2 s in.
  • After: the reservation landed in the room at 0x1defe00000, below 2^37. The largest gap at that point was 24,318 MB. About 4.5 minutes of running, ended by hand; no error, crash entry or lost device in the log. The fallback was not used.
  • The 36 GB block appeared across slSetD3DDevice, not across the making of the device. The log cannot say which library takes it. The 28 GB block did not appear in the window in that run.
  • Five cases (room used, room given back, Streamline not loaded, fallback, fallback off) were run three times each in processes of their own with the window filled, using the title's exact request. That harness is not in the PR: an early form of it hit the kernel spin above, and it should not be able to wedge a PC or CI.
  • For shader changes, the wave sizes tested: no shader changes.
  • cargo test passed for the crates it touches: no, not all of it. victory-hle lib: 468 passed, 1 failed (a_read_by_range_waits_only_for_a_remapping_that_meets_it, which fails on a clean checkout of main here too). victory-gpu: only the 9 upload tests were run.
  • Clippy (default features) gives the same warnings as main; --all-features finishes without errors. Neither was run to a pass with -D warnings: main already fails that here. cargo xtask policy passes.

Not tested: the fallback in a run of the title, other cards, other resolutions, long sessions, the full workspace test suite on this branch (on main it stalled here).

Checked for overlap

🤖 Generated with Claude Code

AstralDrift and others added 3 commits November 30, 2026 20:11
… (issue Kemerd#15)

Since 3109d38 the title's 64-bit memory is capped at 2^37, the reach of the
directory of memory by address. With DLSS loaded about 64 GB of that window
is held by blocks whose owner is not known, the title's 6.2 GB reservation
has no gap, and the title stops itself.

- VICTORY_TITLE_ROOM_MB (6400, 0 for none): in runs that ask for DLSS, a
  placeholder is held before Streamline loads and cut to the title's
  reservation when it comes. It is given back for a request the window
  refuses, and where Streamline does not load.
- VICTORY_TITLE_WIDE_FALLBACK (on, 0 for off): a reservation that still has
  no gap is placed over the full range its flags allow, as before 3109d38.
- A big reservation the window has no gap for is not asked of the host: on
  Windows build 26300 that search can spin in the kernel without end, in a
  process that cannot be killed.
- The window is walked around slInit, the making of the device and the
  hand-over to Streamline, and what appeared is logged.

Known risk: memory the fallback places above 2^37 has no entry in the
directory. Shaders that read it by address read zeros, so draws can be
missing or wrong (#218). The room pushes other allocations elsewhere; what
that does in a run of the title is not known. Both are on by default as the
issue asked, where the tree's rule for switches is off.

Verified: each path in a process of its own with the window filled, outside
the tree. Not run in the title.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ssue Kemerd#15)

An entry for the address of the stop, what the two switches do, the risk of memory above 2^37, and the log lines to look for.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Corrects the notes of the two commits before, which were written before any run: on an RTX 4090 with 32 GB on Windows 11 build 26300 the title's big reservation landed in the room, with DLSS, Ray Reconstruction and frame generation loaded, and the fallback above 2^37 was not used. One run of 4.5 minutes; the fallback has not run in the title.

The log of that run also says when the 36 GB block comes: across slSetD3DDevice, not across the making of the device.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant