xmem: opt-in lazy/file-backed physical pages for 1455 commit limit #297

Open
github-bot wants to merge 73 commits from github-bot/gh-297 into rx9070xt AGit
Owner

@⁠Adika713 on GitHub · 2026-11-26 19:27 UTC · original
Adika713:fix/lazy-physical-pages-rx9070xt → rx9070xt · +3552 −444 · 55 files · 73 commits · open

## What and why

On a 32 GB Windows 11 host with a small pagefile (2688 MB, unchanged), Belobug rx9070xt/cd8dfc06 exits at ~4s before any frame presentation with:

Windows commit limit reached while committing 6538919936 bytes of physical pages ... (os error 1455)

This PR adds opt-in mitigations in victory-hle xmem physical-page allocation:

  • VICTORY_LAZY_PHYSICAL=1: for large reserved physical-page views, commit a 64 MiB prefix and register the rest for demand-commit via a vectored exception handler (64 KiB page granularity). Ranges are tracked and split/removed on unmap. Before kernel-write paths (ReadFile, fread, DirectStorage raw destination writes), lazy pages in the target range are explicitly committed.
  • VICTORY_FILE_PHYSICAL=1: back physical-page sections with a temporary file in VICTORY_CACHE_DIR, else %LOCALAPPDATA%\victory\cache, else TEMP, else cwd. Windows uses FILE_FLAG_DELETE_ON_CLOSE; file is also removed on section free. Falls back to normal section on failure.

Both default off. Wine/file-backed whole-commit paths are preserved.

What is in it

  • crates/victory-hle/src/modules/xmem.rs: section backing metadata, lazy range tracking, VEH demand commit, explicit lazy pre-commit for kernel writes, file-backed section creation/cleanup, lazy cleanup on unmap, commit bookkeeping fixes.
  • crates/victory-hle/src/modules/files.rs: ensure_lazy_committed before ReadFile/fread kernel writes.
  • crates/victory-hle/src/modules/dstorage.rs: ensure_lazy_committed before raw DirectStorage destination kernel writes.
  • Game-free test: lazy_range_tracking_splits_on_remove.

Tested

Hardware: Windows 11, AMD Radeon RX 6950 XT 16 GB, Ryzen 5 3600, 32 GB RAM, 2688 MB pagefile unchanged. Game files supplied locally; not included.

Commands/tests (F: target dir):

  • cargo build -p victory -p victory-hle - OK.
  • cargo test -p victory-hle --lib xmem -- --test-threads=1 - 18 passed, 0 failed, 1 ignored.
  • cargo test -p victory-hle --lib lazy_range_tracking_splits_on_remove -- --test-threads=1 - 1 passed.

Measured monitored runs (_agent_reports/test-story-belobug-rx9070xt.ps1, series-x, 1280x720, VICTORY_WINDOW_BUDGET_MB=64, VICTORY_TEXTURE_MAX=128, no RT, DRED light where noted):

Run Config Result
20261126-193000 pre-patch elapsed_s=4 stop=exited, 0 frames. 1455 6.1 GiB physical-page commit, then 0x80000003.
20261126-195526 LAZY=1 FILE=1, RELAY=2 199s exited, 11 presented/max1024. No 1455. 0x887A0007 device removed after 28 submissions (RELAY=1).
20261126-200207 LAZY=1 FILE=1, RELAY=2 (harness override bug) 264s exited, 11 presented/max1024. No 1455. 0x887A0007 after 18 submissions. User observed cutscene audio further and "directed by" on black screen (user observation; not FPS/visual proof).
20261126-202519 LAZY=1 FILE=1, RELAY=0, CARD_STEPS=0 300s timeout_killed, 12 presented/max2048, world_entry=False heuristic. No 1455/0x887A0007/0x8007000E markers. Shots non-black but not render proof.
20261126-203609 LAZY=1 FILE=1, RELAY=0, CARD_STEPS=2 300s timeout_killed, 22 presented/max1024. No 1455/0x887A0007/0x8007000E.
20261126-204416 LAZY=1 FILE=1, RELAY=0, CARD_STEPS=0 (a202dc8a) 300s timeout_killed, 24 presented/max2048. No 1455/0x887A0007/0x8007000E.
20261126-205115 LAZY=0 FILE=1, RELAY=0, CARD_STEPS=0 301s timeout_killed, 24 presented/max2048. No 1455/0x887A0007/0x8007000E.
20261126-205650 LAZY=1 FILE=0, RELAY=0, CARD_STEPS=0 189s exited, 12 presented/max2048. No 1455/0x887A0007 marker found; many 0x8007000E shared-buffer/memory allocation failures. Single run.

Caveat: frame_presented_log_count comes from power-of-two frame presented logs and harness lacks interval_us; it is not FPS proof.

Not tested

  • No stable ingame FPS/world-entry/visual-correctness proof; RELAY=0 runs survive 300s but evidence is incomplete.
  • No claim of 15-20 fps or 100% completion.
  • Not tested on other GPUs/drivers/pagefile sizes.
  • Did not run full victory-hle test suite beyond xmem module tests above.
  • No RT/AOT/FSR4K validation in these runs.
  • Kernel-write lazy pre-commit audited for ReadFile, fread, DirectStorage raw destination path; other kernel-write APIs not exhaustively audited.

AI use

OpenCode / opencode/big-pickle (AI-assisted). I reviewed code changes and ran the commands/tests listed above; results are reported only where measured.

**@⁠Adika713** on GitHub · 2026-11-26 19:27 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/297) `Adika713:fix/lazy-physical-pages-rx9070xt` → `rx9070xt` · +3552 −444 · 55 files · 73 commits · open ## What and why On a 32 GB Windows 11 host with a small pagefile (2688 MB, unchanged), Belobug `rx9070xt`/`cd8dfc06` exits at ~4s before any frame presentation with: `Windows commit limit reached while committing 6538919936 bytes of physical pages ... (os error 1455)` This PR adds **opt-in** mitigations in `victory-hle` xmem physical-page allocation: - `VICTORY_LAZY_PHYSICAL=1`: for large reserved physical-page views, commit a 64 MiB prefix and register the rest for demand-commit via a vectored exception handler (64 KiB page granularity). Ranges are tracked and split/removed on unmap. Before kernel-write paths (`ReadFile`, `fread`, DirectStorage raw destination writes), lazy pages in the target range are explicitly committed. - `VICTORY_FILE_PHYSICAL=1`: back physical-page sections with a temporary file in `VICTORY_CACHE_DIR`, else `%LOCALAPPDATA%\victory\cache`, else `TEMP`, else cwd. Windows uses `FILE_FLAG_DELETE_ON_CLOSE`; file is also removed on section free. Falls back to normal section on failure. Both default **off**. Wine/file-backed whole-commit paths are preserved. ## What is in it - `crates/victory-hle/src/modules/xmem.rs`: section backing metadata, lazy range tracking, VEH demand commit, explicit lazy pre-commit for kernel writes, file-backed section creation/cleanup, lazy cleanup on unmap, commit bookkeeping fixes. - `crates/victory-hle/src/modules/files.rs`: `ensure_lazy_committed` before `ReadFile`/`fread` kernel writes. - `crates/victory-hle/src/modules/dstorage.rs`: `ensure_lazy_committed` before raw DirectStorage destination kernel writes. - Game-free test: `lazy_range_tracking_splits_on_remove`. ## Tested Hardware: Windows 11, AMD Radeon RX 6950 XT 16 GB, Ryzen 5 3600, 32 GB RAM, 2688 MB pagefile **unchanged**. Game files supplied locally; not included. Commands/tests (F: target dir): - `cargo build -p victory -p victory-hle` - OK. - `cargo test -p victory-hle --lib xmem -- --test-threads=1` - **18 passed, 0 failed, 1 ignored**. - `cargo test -p victory-hle --lib lazy_range_tracking_splits_on_remove -- --test-threads=1` - **1 passed**. Measured monitored runs (`_agent_reports/test-story-belobug-rx9070xt.ps1`, series-x, 1280x720, `VICTORY_WINDOW_BUDGET_MB=64`, `VICTORY_TEXTURE_MAX=128`, no RT, DRED light where noted): | Run | Config | Result | |---|---|---| | `20261126-193000` | pre-patch | `elapsed_s=4 stop=exited`, 0 frames. 1455 6.1 GiB physical-page commit, then `0x80000003`. | | `20261126-195526` | LAZY=1 FILE=1, RELAY=2 | `199s exited`, 11 presented/max1024. No 1455. **0x887A0007 device removed** after 28 submissions (RELAY=1). | | `20261126-200207` | LAZY=1 FILE=1, RELAY=2 (harness override bug) | `264s exited`, 11 presented/max1024. No 1455. **0x887A0007** after 18 submissions. User observed cutscene audio further and "directed by" on black screen (user observation; not FPS/visual proof). | | `20261126-202519` | LAZY=1 FILE=1, RELAY=0, CARD_STEPS=0 | `300s timeout_killed`, 12 presented/max2048, `world_entry=False` heuristic. No 1455/0x887A0007/0x8007000E markers. Shots non-black but not render proof. | | `20261126-203609` | LAZY=1 FILE=1, RELAY=0, CARD_STEPS=2 | `300s timeout_killed`, 22 presented/max1024. No 1455/0x887A0007/0x8007000E. | | `20261126-204416` | LAZY=1 FILE=1, RELAY=0, CARD_STEPS=0 (a202dc8a) | `300s timeout_killed`, 24 presented/max2048. No 1455/0x887A0007/0x8007000E. | | `20261126-205115` | LAZY=0 FILE=1, RELAY=0, CARD_STEPS=0 | `301s timeout_killed`, 24 presented/max2048. No 1455/0x887A0007/0x8007000E. | | `20261126-205650` | LAZY=1 FILE=0, RELAY=0, CARD_STEPS=0 | `189s exited`, 12 presented/max2048. No 1455/0x887A0007 marker found; many `0x8007000E` shared-buffer/memory allocation failures. Single run. | Caveat: `frame_presented_log_count` comes from power-of-two `frame presented` logs and harness lacks `interval_us`; it is **not FPS proof**. ## Not tested - No stable ingame FPS/world-entry/visual-correctness proof; RELAY=0 runs survive 300s but evidence is incomplete. - No claim of 15-20 fps or 100% completion. - Not tested on other GPUs/drivers/pagefile sizes. - Did not run full `victory-hle` test suite beyond xmem module tests above. - No RT/AOT/FSR4K validation in these runs. - Kernel-write lazy pre-commit audited for `ReadFile`, `fread`, DirectStorage raw destination path; other kernel-write APIs not exhaustively audited. ## AI use OpenCode / opencode/big-pickle (AI-assisted). I reviewed code changes and ran the commands/tests listed above; results are reported only where measured.
Add VICTORY_LAZY_PHYSICAL=1 to defer commit of large reserved physical-page views beyond a 64 MiB prefix and commit touched 64 KiB pages on demand via a vectored exception handler. Add VICTORY_FILE_PHYSICAL=1 to back physical-page sections with a temporary file instead of pagefile commit.

Both modes are opt-in and default off. Targets measured Windows commit-limit failure (6.1 GiB physical-page allocation, os error 1455) on 32 GB hosts with small pagefiles; local Belobug rx9070xt baseline went from 4s 1455 exit to 199s+ with frames/cutscene audio before later GPU device removal.

Game-free test: lazy_range_tracking_splits_on_remove.

AI-assisted: OpenCode / opencode/big-pickle
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 19:49:08 +00:00
Author
Owner

@⁠Adika713 on GitHub · 2026-11-26 19:31 UTC · original

## Measured run update (same WIP branch, local test PC)

Hardware: Win11 / RX 6950 XT 16 GB / Ryzen 5 3600 / 32 GB RAM / 2688 MB pagefile unchanged.
Build: 1be739a5 (fix/lazy-physical-pages-rx9070xt), cargo build -p victory -p victory-hle OK.
Test: cargo test -p victory-hle --lib xmem -- --test-threads=1 => 18 passed, 0 failed, 1 ignored.

New run: test-belobug-rx9070xt-series-x-20261126-202519

Config: series-x, 1280x720, VICTORY_WINDOW_BUDGET_MB=64, VICTORY_TEXTURE_MAX=128, no RT, VICTORY_LAZY_PHYSICAL=1, VICTORY_FILE_PHYSICAL=1, VICTORY_RELAY=0, VICTORY_RELAY_COPY=0, VICTORY_CARD_STEPS=0, VICTORY_D3D12_DRED=light.

Measured summary:

  • elapsed_s=300 stop=timeout_killed
  • frame_interval_count=0
  • max_frame_logged=2048
  • frame_presented_log_count=12
  • world_entry_candidate=False (insufficient_present_samples)
  • Shots: 30s avg 81.2, 90s avg 65.7, 150s avg 64.2, 210s avg 33.2 (non-black; not proof of correct world render/FPS)
  • No os error 1455 / physical-page commit-limit failure observed.
  • No 0x887A0007 device-removed / 0x8007000E OOM markers observed in notable scan.
  • Process still alive at 300s (killed by harness timeout). End sample: working ~16.6 GB, private ~16.6 GB, free phys ~4.2 GB, commit headroom ~1.4 GB.

This is better than the 4s 1455 baseline and better than earlier 171-264s device-removal runs with RELAY=2, but it is not stable ingame/FPS proof. Frame-present logs stop at frame 2048 around 19:26:35 while process continues; needs investigation (present pacing/logging/black-screen path).

AI-assisted: OpenCode / opencode/big-pickle.

**@⁠Adika713** on GitHub · 2026-11-26 19:31 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/297#issuecomment-7201678698) ## Measured run update (same WIP branch, local test PC) Hardware: Win11 / RX 6950 XT 16 GB / Ryzen 5 3600 / 32 GB RAM / 2688 MB pagefile unchanged. Build: `1be739a5` (`fix/lazy-physical-pages-rx9070xt`), `cargo build -p victory -p victory-hle` OK. Test: `cargo test -p victory-hle --lib xmem -- --test-threads=1` => 18 passed, 0 failed, 1 ignored. ### New run: `test-belobug-rx9070xt-series-x-20261126-202519` Config: series-x, 1280x720, `VICTORY_WINDOW_BUDGET_MB=64`, `VICTORY_TEXTURE_MAX=128`, no RT, `VICTORY_LAZY_PHYSICAL=1`, `VICTORY_FILE_PHYSICAL=1`, `VICTORY_RELAY=0`, `VICTORY_RELAY_COPY=0`, `VICTORY_CARD_STEPS=0`, `VICTORY_D3D12_DRED=light`. Measured summary: - `elapsed_s=300 stop=timeout_killed` - `frame_interval_count=0` - `max_frame_logged=2048` - `frame_presented_log_count=12` - `world_entry_candidate=False` (`insufficient_present_samples`) - Shots: 30s avg 81.2, 90s avg 65.7, 150s avg 64.2, 210s avg 33.2 (non-black; not proof of correct world render/FPS) - No `os error 1455` / physical-page commit-limit failure observed. - No `0x887A0007` device-removed / `0x8007000E` OOM markers observed in notable scan. - Process still alive at 300s (killed by harness timeout). End sample: working ~16.6 GB, private ~16.6 GB, free phys ~4.2 GB, commit headroom ~1.4 GB. This is better than the 4s 1455 baseline and better than earlier 171-264s device-removal runs with RELAY=2, but it is **not** stable ingame/FPS proof. Frame-present logs stop at frame 2048 around 19:26:35 while process continues; needs investigation (present pacing/logging/black-screen path). AI-assisted: OpenCode / opencode/big-pickle.
Author
Owner

@⁠MamaLeVrai on GitHub · 2026-11-26 19:34 UTC · original

Tested on an RX 6950 XT (RDNA2), Windows 11 build 26300, Rust 1.98.1, head 1be739a on rx9070xt cd8dfc0. cargo test --release -p victory-hle --lib, twice: 160 passed, 0 failed, 2 ignored. The new lazy_range_tracking_splits_on_remove passes too.

Reading the change, I see four things. The first matters for the lazy mode in the game:

  1. Kernel writes into lazy pages fail without any fault. The vectored handler only sees faults from user-mode code. When the kernel writes into a reserved page, for a ReadFile straight into title memory, the call fails with ERROR_NOACCESS (998) and no exception is raised. I checked this on this machine: ReadFile of 4 KiB into a fresh SEC_RESERVE view returns 998; after VirtualAlloc(MEM_COMMIT) of the page it reads 92 bytes. files::ReadFile passes title buffers straight to the kernel, and its comment says the title's synchronous reads "retry a failed ReadFile forever". With VICTORY_LAZY_PHYSICAL=1, a read into a page past the 64 MiB prefix would then hang the title. One way out: commit the lazy pages of [buffer, buffer + len) in files::ReadFile, in fread and in DirectStorage's reads before the kernel call. The kernel_writing call already marks that spot.
  2. lazy_has uses try_lock. If another thread holds LAZY (register_lazy or lazy_remove on a map or an unmap) when a lazy page faults, the handler returns "continue search". The access violation then goes unhandled and the title crashes. A RwLock read, or a plain lock() (no thread faults while holding it), avoids that.
  3. Only the prefix is marked committed, even when the full commit worked. In Section::commit_runs / Section::commit, lazy_partial depends only on lazy_physical_enabled() && len > LAZY_PREFIX, not on whether commit() took the lazy path. With the variable set and enough commit, the pages past 64 MiB stay unmarked and get committed again on each later request. That costs time but returns the right result.
  4. File-backed sections can be left on disk. Without VICTORY_CACHE_DIR in the environment (victory.toml's cache_dir is not read here), the files go to the current directory. That is the repository with scripts\play.ps1, which Push-Locations there. They are removed only when the Section drops, so a crash or a killed run leaves multi-GiB files behind. FILE_FLAG_DELETE_ON_CLOSE on the file handle would remove them in every case.

Side note from this machine: the same card here (RX 6950 XT) also loses the device with 0x887A0007 a while after the world comes up, with DRED showing no list in flight, on main-based builds. It happened with the commit limit nearly reached, and once with a 64 GiB paging file, though GPU tests of mine were running at the same time in that run. So the device loss you hit after getting past 1455 is probably not caused by this PR.

AI-assisted (Claude Code); no game data.

**@⁠MamaLeVrai** on GitHub · 2026-11-26 19:34 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/297#issuecomment-7201729043) Tested on an RX 6950 XT (RDNA2), Windows 11 build 26300, Rust 1.98.1, head `1be739a` on `rx9070xt` `cd8dfc0`. `cargo test --release -p victory-hle --lib`, twice: 160 passed, 0 failed, 2 ignored. The new `lazy_range_tracking_splits_on_remove` passes too. Reading the change, I see four things. The first matters for the lazy mode in the game: 1. **Kernel writes into lazy pages fail without any fault.** The vectored handler only sees faults from user-mode code. When the kernel writes into a reserved page, for a `ReadFile` straight into title memory, the call fails with `ERROR_NOACCESS` (998) and no exception is raised. I checked this on this machine: `ReadFile` of 4 KiB into a fresh `SEC_RESERVE` view returns `998`; after `VirtualAlloc(MEM_COMMIT)` of the page it reads 92 bytes. `files::ReadFile` passes title buffers straight to the kernel, and its comment says the title's synchronous reads "retry a failed `ReadFile` forever". With `VICTORY_LAZY_PHYSICAL=1`, a read into a page past the 64 MiB prefix would then hang the title. One way out: commit the lazy pages of `[buffer, buffer + len)` in `files::ReadFile`, in `fread` and in DirectStorage's reads before the kernel call. The `kernel_writing` call already marks that spot. 2. **`lazy_has` uses `try_lock`.** If another thread holds `LAZY` (`register_lazy` or `lazy_remove` on a map or an unmap) when a lazy page faults, the handler returns "continue search". The access violation then goes unhandled and the title crashes. A `RwLock` read, or a plain `lock()` (no thread faults while holding it), avoids that. 3. **Only the prefix is marked committed, even when the full commit worked.** In `Section::commit_runs` / `Section::commit`, `lazy_partial` depends only on `lazy_physical_enabled() && len > LAZY_PREFIX`, not on whether `commit()` took the lazy path. With the variable set and enough commit, the pages past 64 MiB stay unmarked and get committed again on each later request. That costs time but returns the right result. 4. **File-backed sections can be left on disk.** Without `VICTORY_CACHE_DIR` in the environment (`victory.toml`'s `cache_dir` is not read here), the files go to the current directory. That is the repository with `scripts\play.ps1`, which `Push-Location`s there. They are removed only when the `Section` drops, so a crash or a killed run leaves multi-GiB files behind. `FILE_FLAG_DELETE_ON_CLOSE` on the file handle would remove them in every case. Side note from this machine: the same card here (RX 6950 XT) also loses the device with `0x887A0007` a while after the world comes up, with DRED showing no list in flight, on `main`-based builds. It happened with the commit limit nearly reached, and once with a 64 GiB paging file, though GPU tests of mine were running at the same time in that run. So the device loss you hit after getting past 1455 is probably not caused by this PR. AI-assisted (Claude Code); no game data.
Author
Owner

@⁠Adika713 on GitHub · 2026-11-26 19:44 UTC · original

## Update: 203609 A/B + WIP fix for review feedback (not runtime-validated yet)

Hardware: Win11 / RX 6950 XT 16 GB / Ryzen 5 3600 / 32 GB RAM / 2688 MB pagefile unchanged.
Branch: Adika713:fix/lazy-physical-pages-rx9070xt (a202dc8a pushed).

Measured run test-belobug-rx9070xt-series-x-20261126-203609

Config: series-x 1280x720, budget 64, tex 128, no RT, LAZY=1 FILE=1 RELAY=0 RELAY_COPY=0 CARD_STEPS=2 DRED=light.

  • elapsed_s=300 stop=timeout_killed
  • frame_presented_log_count=22 max_frame_logged=1024 frame_interval_count=0
  • world_entry_candidate=False (insufficient_present_samples)
  • Shots: 30s avg 41.6, 90s avg 66.7, 150s avg 20.3, 210s avg 23.4 (non-black; not proof of correct render/FPS)
  • No 1455 / 0x887A0007 / 0x8007000E markers found by notable scan.
  • Process alive at 300s; end sample private ~22.5GB working ~17.7GB free phys ~3.1GB commit headroom ~0.8GB.

Compared to 202519 (CARD_STEPS=0): both survived 300s with no device removal/1455 in these runs; neither is FPS/world-entry proof. Frame-present logs are power-of-two only and harness lacks interval_us.

Code changes in a202dc8a (addresses part of @⁠MamaLeVrai review; not game-runtime tested yet)

  • Added xmem::ensure_lazy_committed(base,len) and call it before kernel-write paths in ReadFile, fread, and DirectStorage raw destination writes. Intended to avoid kernel ERROR_NOACCESS on uncommitted lazy pages.
  • Changed lazy_has to use blocking LAZY.lock() instead of try_lock() to avoid VEH returning continue-search under lock contention.
  • commit/commit_shown now track actual committed page count; lazy partial commits mark only prefix committed (fixes repeated recommit bookkeeping).
  • Not yet addressed: file-backed section cleanup hardening (FILE_FLAG_DELETE_ON_CLOSE / cache-dir source), and I have not yet audited every kernel-write destination path beyond the three above.

Tests/build: cargo test -p victory-hle --lib xmem -- --test-threads=1 => 18 passed, 0 failed, 1 ignored. cargo build -p victory -p victory-hle OK.

AI-assisted: OpenCode / opencode/big-pickle. No game data included.

**@⁠Adika713** on GitHub · 2026-11-26 19:44 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/297#issuecomment-7201909627) ## Update: 203609 A/B + WIP fix for review feedback (not runtime-validated yet) Hardware: Win11 / RX 6950 XT 16 GB / Ryzen 5 3600 / 32 GB RAM / 2688 MB pagefile unchanged. Branch: `Adika713:fix/lazy-physical-pages-rx9070xt` (`a202dc8a` pushed). ### Measured run `test-belobug-rx9070xt-series-x-20261126-203609` Config: series-x 1280x720, budget 64, tex 128, no RT, `LAZY=1 FILE=1 RELAY=0 RELAY_COPY=0 CARD_STEPS=2 DRED=light`. - `elapsed_s=300 stop=timeout_killed` - `frame_presented_log_count=22 max_frame_logged=1024 frame_interval_count=0` - `world_entry_candidate=False (insufficient_present_samples)` - Shots: 30s avg 41.6, 90s avg 66.7, 150s avg 20.3, 210s avg 23.4 (non-black; not proof of correct render/FPS) - No 1455 / 0x887A0007 / 0x8007000E markers found by notable scan. - Process alive at 300s; end sample private ~22.5GB working ~17.7GB free phys ~3.1GB commit headroom ~0.8GB. Compared to 202519 (`CARD_STEPS=0`): both survived 300s with no device removal/1455 in these runs; neither is FPS/world-entry proof. Frame-present logs are power-of-two only and harness lacks `interval_us`. ### Code changes in `a202dc8a` (addresses part of @⁠MamaLeVrai review; **not game-runtime tested yet**) - Added `xmem::ensure_lazy_committed(base,len)` and call it before kernel-write paths in `ReadFile`, `fread`, and DirectStorage raw destination writes. Intended to avoid kernel `ERROR_NOACCESS` on uncommitted lazy pages. - Changed `lazy_has` to use blocking `LAZY.lock()` instead of `try_lock()` to avoid VEH returning continue-search under lock contention. - `commit/commit_shown` now track actual committed page count; lazy partial commits mark only prefix committed (fixes repeated recommit bookkeeping). - Not yet addressed: file-backed section cleanup hardening (`FILE_FLAG_DELETE_ON_CLOSE` / cache-dir source), and I have not yet audited every kernel-write destination path beyond the three above. Tests/build: `cargo test -p victory-hle --lib xmem -- --test-threads=1` => 18 passed, 0 failed, 1 ignored. `cargo build -p victory -p victory-hle` OK. AI-assisted: OpenCode / opencode/big-pickle. No game data included.
Author
Owner

@⁠Adika713 on GitHub · 2026-11-26 19:50 UTC · original

## Measured run: 204416 (a202dc8a binary, runtime validation of kernel-write lazy commit fix)

Hardware: Win11 / RX 6950 XT 16 GB / Ryzen 5 3600 / 32 GB RAM / 2688 MB pagefile unchanged.
Config: series-x 1280x720, budget 64, tex 128, no RT, LAZY=1 FILE=1 RELAY=0 RELAY_COPY=0 CARD_STEPS=0 DRED=light, 300s max.

  • elapsed_s=300 stop=timeout_killed
  • frame_presented_log_count=24 max_frame_logged=2048 frame_interval_count=0
  • world_entry_candidate=False (insufficient_present_samples) (heuristic)
  • Shots: 30s avg 80.6, 90s avg 119.9, 150s avg 69.8, 210s avg 21.6 (non-black; not proof of correct render/FPS)
  • No 1455 / 0x887A0007 / 0x8007000E markers found by notable scan.
  • End sample: private ~22.3GB working ~17.8GB free phys ~3.6GB commit headroom ~0.7GB. Process alive at 300s.

Compared to 202519 (same env, pre-a202dc8a): both 300s timeout_killed, no 1455/device-removal in these runs; 204416 had 24 frame-present log lines vs 12, but logging is power-of-two and not FPS proof.

Pushed 7aa13c7: file-backed physical sections now use FILE_FLAG_DELETE_ON_CLOSE (Windows) to avoid leaving temp files on crash. Still not a full fix for cache-dir selection from victory.toml.

AI-assisted: OpenCode / opencode/big-pickle.

**@⁠Adika713** on GitHub · 2026-11-26 19:50 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/297#issuecomment-7202015433) ## Measured run: 204416 (a202dc8a binary, runtime validation of kernel-write lazy commit fix) Hardware: Win11 / RX 6950 XT 16 GB / Ryzen 5 3600 / 32 GB RAM / 2688 MB pagefile unchanged. Config: series-x 1280x720, budget 64, tex 128, no RT, `LAZY=1 FILE=1 RELAY=0 RELAY_COPY=0 CARD_STEPS=0 DRED=light`, 300s max. - `elapsed_s=300 stop=timeout_killed` - `frame_presented_log_count=24 max_frame_logged=2048 frame_interval_count=0` - `world_entry_candidate=False (insufficient_present_samples)` (heuristic) - Shots: 30s avg 80.6, 90s avg 119.9, 150s avg 69.8, 210s avg 21.6 (non-black; not proof of correct render/FPS) - No 1455 / 0x887A0007 / 0x8007000E markers found by notable scan. - End sample: private ~22.3GB working ~17.8GB free phys ~3.6GB commit headroom ~0.7GB. Process alive at 300s. Compared to 202519 (same env, pre-a202dc8a): both 300s timeout_killed, no 1455/device-removal in these runs; 204416 had 24 frame-present log lines vs 12, but logging is power-of-two and not FPS proof. Pushed `7aa13c7`: file-backed physical sections now use `FILE_FLAG_DELETE_ON_CLOSE` (Windows) to avoid leaving temp files on crash. Still not a full fix for cache-dir selection from `victory.toml`. AI-assisted: OpenCode / opencode/big-pickle.
Author
Owner

@⁠Adika713 on GitHub · 2026-11-26 19:56 UTC · original

## A/B: FILE_PHYSICAL only (205115, 7aa13c78 binary)

Config: series-x 1280x720, budget 64, tex 128, no RT, LAZY=0 FILE_PHYSICAL=1 RELAY=0 RELAY_COPY=0 CARD_STEPS=0 DRED=light, 300s.

  • elapsed_s=301 stop=timeout_killed
  • frame_presented_log_count=24 max_frame_logged=2048 frame_interval_count=0
  • world_entry_candidate=False (insufficient_present_samples)
  • Shots: 30s 72.2, 90s 68.8, 150s 67.1, 210s 22.4 (non-black; not render/FPS proof)
  • No 1455 / 0x887A0007 / 0x8007000E markers found by notable scan.
  • End sample: private ~22.2GB working ~17.7GB free phys ~4.4GB commit headroom ~1.0GB. Alive at 300s.

Similar survival to LAZY+FILE runs at this config; not an ingame/FPS proof. Next A/B: LAZY=1 FILE=0.

AI-assisted: OpenCode / opencode/big-pickle.

**@⁠Adika713** on GitHub · 2026-11-26 19:56 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/297#issuecomment-7202131792) ## A/B: FILE_PHYSICAL only (205115, 7aa13c78 binary) Config: series-x 1280x720, budget 64, tex 128, no RT, `LAZY=0 FILE_PHYSICAL=1 RELAY=0 RELAY_COPY=0 CARD_STEPS=0 DRED=light`, 300s. - `elapsed_s=301 stop=timeout_killed` - `frame_presented_log_count=24 max_frame_logged=2048 frame_interval_count=0` - `world_entry_candidate=False (insufficient_present_samples)` - Shots: 30s 72.2, 90s 68.8, 150s 67.1, 210s 22.4 (non-black; not render/FPS proof) - No 1455 / 0x887A0007 / 0x8007000E markers found by notable scan. - End sample: private ~22.2GB working ~17.7GB free phys ~4.4GB commit headroom ~1.0GB. Alive at 300s. Similar survival to LAZY+FILE runs at this config; not an ingame/FPS proof. Next A/B: LAZY=1 FILE=0. AI-assisted: OpenCode / opencode/big-pickle.
Author
Owner

@⁠Adika713 on GitHub · 2026-11-26 20:00 UTC · original

## A/B: LAZY_PHYSICAL only (205650, 7aa13c78 binary)

Config: series-x 1280x720, budget 64, tex 128, no RT, LAZY=1 FILE_PHYSICAL=0 RELAY=0 RELAY_COPY=0 CARD_STEPS=0 DRED=light, 300s.

  • elapsed_s=189 stop=exited exit_code=
  • frame_presented_log_count=12 max_frame_logged=2048 frame_interval_count=0
  • world_entry_candidate=False (insufficient_present_samples)
  • Shots: 30s 47.8, 90s 80.8, 150s 124.1 (non-black; not render/FPS proof)
  • Notable: many no shared buffer ... 0x8007000E and memory allocation of 7864416 bytes failed; final sample free phys ~8.2GB, commit headroom ~1.7GB (process already exited). No 1455/0x887A0007 device-removed marker found.

This A/B is worse than FILE-only / LAZY+FILE on the same settings (early exit with host OOM/resource exhaustion), but it is only one run.

AI-assisted: OpenCode / opencode/big-pickle.

**@⁠Adika713** on GitHub · 2026-11-26 20:00 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/297#issuecomment-7202196359) ## A/B: LAZY_PHYSICAL only (205650, 7aa13c78 binary) Config: series-x 1280x720, budget 64, tex 128, no RT, `LAZY=1 FILE_PHYSICAL=0 RELAY=0 RELAY_COPY=0 CARD_STEPS=0 DRED=light`, 300s. - `elapsed_s=189 stop=exited exit_code=` - `frame_presented_log_count=12 max_frame_logged=2048 frame_interval_count=0` - `world_entry_candidate=False (insufficient_present_samples)` - Shots: 30s 47.8, 90s 80.8, 150s 124.1 (non-black; not render/FPS proof) - Notable: many `no shared buffer ... 0x8007000E` and `memory allocation of 7864416 bytes failed`; final sample free phys ~8.2GB, commit headroom ~1.7GB (process already exited). No 1455/0x887A0007 device-removed marker found. This A/B is worse than FILE-only / LAZY+FILE on the same settings (early exit with host OOM/resource exhaustion), but it is only one run. AI-assisted: OpenCode / opencode/big-pickle.
Author
Owner

@⁠Adika713 on GitHub · 2026-11-26 20:11 UTC · original

## Code update (no new game run)

Pushed d0a666a9: file-backed physical sections now prefer VICTORY_CACHE_DIR, else %LOCALAPPDATA%\victory\cache, else TEMP, before cwd fallback. This reduces risk of leaving large temp files in the repo/workdir when delete-on-close is not effective; still not reading victory.toml cache_dir directly from xmem.

Per @⁠MamaLeVrai review: kernel-write lazy commit pre-commit added for ReadFile/fread/DStorage raw dest (a202dc8a), lazy_has uses blocking lock, lazy commit bookkeeping fixed, FILE_FLAG_DELETE_ON_CLOSE added for Windows. Remaining: audit other kernel-write paths (e.g. any other ReadFile/overlapped destinations into lazy pages), and ideally plumb configured cache_dir.

No new game tests started (user requested pause).

AI-assisted: OpenCode / opencode/big-pickle.

**@⁠Adika713** on GitHub · 2026-11-26 20:11 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/297#issuecomment-7202391675) ## Code update (no new game run) Pushed `d0a666a9`: file-backed physical sections now prefer `VICTORY_CACHE_DIR`, else `%LOCALAPPDATA%\victory\cache`, else `TEMP`, before cwd fallback. This reduces risk of leaving large temp files in the repo/workdir when delete-on-close is not effective; still not reading `victory.toml` cache_dir directly from xmem. Per @⁠MamaLeVrai review: kernel-write lazy commit pre-commit added for ReadFile/fread/DStorage raw dest (a202dc8a), lazy_has uses blocking lock, lazy commit bookkeeping fixed, FILE_FLAG_DELETE_ON_CLOSE added for Windows. Remaining: audit other kernel-write paths (e.g. any other ReadFile/overlapped destinations into lazy pages), and ideally plumb configured cache_dir. No new game tests started (user requested pause). AI-assisted: OpenCode / opencode/big-pickle.
Author
Owner

@⁠Adika713 on GitHub · 2026-11-26 20:15 UTC · original

## Code update (no new game run)

Pushed 18c698f: ensure_lazy_committed now removes committed ranges from LAZY tracking after explicit pre-commit for kernel-write paths. This avoids repeated VEH/range work on already-committed pages; section commit bitmaps are not updated there (VirtualAlloc MEM_COMMIT is idempotent; later paths self-heal).

Validated locally (no game): cargo test -p victory-hle --lib xmem -- --test-threads=1 => 18 passed, 0 failed, 1 ignored; build OK.

Still not game-runtime tested per your pause request.

AI-assisted: OpenCode / opencode/big-pickle.

**@⁠Adika713** on GitHub · 2026-11-26 20:15 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/297#issuecomment-7202461465) ## Code update (no new game run) Pushed `18c698f`: `ensure_lazy_committed` now removes committed ranges from `LAZY` tracking after explicit pre-commit for kernel-write paths. This avoids repeated VEH/range work on already-committed pages; section commit bitmaps are not updated there (VirtualAlloc MEM_COMMIT is idempotent; later paths self-heal). Validated locally (no game): `cargo test -p victory-hle --lib xmem -- --test-threads=1` => 18 passed, 0 failed, 1 ignored; build OK. Still not game-runtime tested per your pause request. AI-assisted: OpenCode / opencode/big-pickle.
Author
Owner

@⁠JFIREonFIRE on GitHub · 2026-11-26 20:34 UTC · original

A measurement that may help here, from an RTX 3090 / 32 GB PC with a system-managed page file (details and the runs in #333): the process's private bytes track the card's memory in use one for one (fit over ~380 memory lines, R² ≈ 1.000), while the working set grows only 0.1–0.3 MB per MB of VRAM. Of ~38–42 GB private, about 20 GB was the commit charge of the card's own memory; the working set peaked at 21–25 GB. So on a 32 GB PC with a small page file, the commit limit runs out well before the RAM does, and VRAM use (the 10-minute texture cache in vram_keep fills it to 88%) is a large part of it. Lazy or file-backed physical pages address the title's share; the card's share may need the page file or a lower VRAM ceiling.

Measured and written with Claude Code (AI).

**@⁠JFIREonFIRE** on GitHub · 2026-11-26 20:34 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/297#issuecomment-7202850000) A measurement that may help here, from an RTX 3090 / 32 GB PC with a system-managed page file (details and the runs in #333): the process's private bytes track the card's memory in use one for one (fit over ~380 memory lines, R² ≈ 1.000), while the working set grows only 0.1–0.3 MB per MB of VRAM. Of ~38–42 GB private, about 20 GB was the commit charge of the card's own memory; the working set peaked at 21–25 GB. So on a 32 GB PC with a small page file, the commit limit runs out well before the RAM does, and VRAM use (the 10-minute texture cache in `vram_keep` fills it to 88%) is a large part of it. Lazy or file-backed physical pages address the title's share; the card's share may need the page file or a lower VRAM ceiling. Measured and written with Claude Code (AI).
Author
Owner

@⁠Adika713 on GitHub · 2026-11-26 20:43 UTC · original

## Measured run (213626, b82a5db8, no new code changes)

Hardware: Win11, RX 6950 XT 16GB, Ryzen 5 3600, 32GB RAM, 2688MB pagefile unchanged.

  • Config: series-x 1280x720, budget 64, tex 128, no RT, LAZY=1 FILE=1 RELAY=0 RELAY_COPY=0 CARD_STEPS=0 DRED=light, 300s.
  • Result: elapsed_s=300 stop=timeout_killed.
  • frame_presented_log_count=11 max_frame_logged=1024 frame_interval_count=0, present_log_span_s=63.608 present_frame_delta=1023 present_log_fps_estimate=16.083 (heuristic from power-of-two present logs; not FPS proof).
  • world_entry_candidate=False (insufficient_present_samples).
  • Shots (non-black, not render proof): 30s avg 81.3, 90s 120.6, 150s 30.5, 210s 25.3.
  • Notable: victory_gpu::pool: no block of texture memory ... 0x8007000E; no 1455/commit-limit/device-removed marker found in summary.
  • Final sample: free phys ~5.2GB, commit headroom ~2.4GB.

Also ran 213220 with harness-default RELAY=2/CARD_STEPS=2 (script args not honored by this harness version): 179s exited, device removed 0x887A0004 after 2 submissions ahead; not a RELAY=0 A/B.

AI-assisted: OpenCode / opencode/big-pickle.

**@⁠Adika713** on GitHub · 2026-11-26 20:43 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/297#issuecomment-7203003882) ## Measured run (213626, b82a5db8, no new code changes) Hardware: Win11, RX 6950 XT 16GB, Ryzen 5 3600, 32GB RAM, 2688MB pagefile unchanged. - Config: series-x 1280x720, budget 64, tex 128, no RT, `LAZY=1 FILE=1 RELAY=0 RELAY_COPY=0 CARD_STEPS=0 DRED=light`, 300s. - Result: `elapsed_s=300 stop=timeout_killed`. - `frame_presented_log_count=11 max_frame_logged=1024 frame_interval_count=0`, `present_log_span_s=63.608 present_frame_delta=1023 present_log_fps_estimate=16.083` (heuristic from power-of-two present logs; **not FPS proof**). - `world_entry_candidate=False (insufficient_present_samples)`. - Shots (non-black, not render proof): 30s avg 81.3, 90s 120.6, 150s 30.5, 210s 25.3. - Notable: `victory_gpu::pool: no block of texture memory ... 0x8007000E`; no 1455/commit-limit/device-removed marker found in summary. - Final sample: free phys ~5.2GB, commit headroom ~2.4GB. Also ran 213220 with harness-default RELAY=2/CARD_STEPS=2 (script args not honored by this harness version): 179s exited, device removed `0x887A0004` after 2 submissions ahead; not a RELAY=0 A/B. AI-assisted: OpenCode / opencode/big-pickle.
Author
Owner

@⁠Adika713 on GitHub · 2026-11-26 20:50 UTC · original

## Measured A/B: frame interval override (214521, b82a5db8)

Hardware: Win11, RX 6950 XT 16GB, Ryzen 5 3600, 32GB RAM, 2688MB pagefile unchanged.

  • Config: series-x 1280x720, budget 64, tex 128, no RT, LAZY=1 FILE=1 RELAY=0 RELAY_COPY=0 CARD_STEPS=0 DRED=light, VICTORY_FRAME_INTERVAL_MS=16.667, VICTORY_TIMER_LOG=1, 300s requested.
  • Result: elapsed_s=248 stop=exited exit_code= (early exit before 300s). No 1455/device-removed marker found in summary notable lines.
  • frame_presented_log_count=12 max_frame_logged=2048 frame_interval_count=0, present_log_span_s=72.153 present_frame_delta=2047 present_log_fps_estimate=28.37 (heuristic; not FPS proof).
  • Shots: 30s avg 40.6, 90s 111.4, 150s 28.9, 210s 57.7 (non-black, not render proof).
  • Notable: memory allocation of 71303184 bytes failed; final sample free phys ~4.7GB, commit headroom ~2.1GB.
  • Frame pacing (VICTORY_TIMER_LOG): early 5s windows had ~16-19ms means; later windows degraded to seconds/frame (e.g. mean 867ms/max 13013ms, then 2-4s means), indicating severe stall/collapse, not smooth intro playback.

Comparison: 213626 (same base config, no frame interval override) 300s timeout_killed, 11 presented/max1024, heuristic 16.083, 0x8007000E texture-pool warning. 214521 did not improve stability; it exited early with large allocation failure and late pacing collapse.

Harness note: test-story-belobug-rx9070xt.ps1 currently ignores -VictoryRelay/-VictoryLazyPhysical/... style args; overrides must be set via env vars before launch. I patched the local harness copy to preserve VICTORY_FRAME_INTERVAL_MS/TITLE_FPS/TIMER_LOG.

AI-assisted: OpenCode / opencode/big-pickle.

**@⁠Adika713** on GitHub · 2026-11-26 20:50 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/297#issuecomment-7203119849) ## Measured A/B: frame interval override (214521, b82a5db8) Hardware: Win11, RX 6950 XT 16GB, Ryzen 5 3600, 32GB RAM, 2688MB pagefile unchanged. - Config: series-x 1280x720, budget 64, tex 128, no RT, `LAZY=1 FILE=1 RELAY=0 RELAY_COPY=0 CARD_STEPS=0 DRED=light`, `VICTORY_FRAME_INTERVAL_MS=16.667`, `VICTORY_TIMER_LOG=1`, 300s requested. - Result: `elapsed_s=248 stop=exited exit_code=` (early exit before 300s). No 1455/device-removed marker found in summary notable lines. - `frame_presented_log_count=12 max_frame_logged=2048 frame_interval_count=0`, `present_log_span_s=72.153 present_frame_delta=2047 present_log_fps_estimate=28.37` (heuristic; **not FPS proof**). - Shots: 30s avg 40.6, 90s 111.4, 150s 28.9, 210s 57.7 (non-black, not render proof). - Notable: `memory allocation of 71303184 bytes failed`; final sample free phys ~4.7GB, commit headroom ~2.1GB. - Frame pacing (VICTORY_TIMER_LOG): early 5s windows had ~16-19ms means; later windows degraded to seconds/frame (e.g. mean 867ms/max 13013ms, then 2-4s means), indicating severe stall/collapse, not smooth intro playback. Comparison: 213626 (same base config, no frame interval override) `300s timeout_killed`, 11 presented/max1024, heuristic 16.083, `0x8007000E` texture-pool warning. 214521 did not improve stability; it exited early with large allocation failure and late pacing collapse. Harness note: `test-story-belobug-rx9070xt.ps1` currently ignores `-VictoryRelay/-VictoryLazyPhysical/...` style args; overrides must be set via env vars before launch. I patched the local harness copy to preserve `VICTORY_FRAME_INTERVAL_MS/TITLE_FPS/TIMER_LOG`. AI-assisted: OpenCode / opencode/big-pickle.
Author
Owner

@⁠Adika713 on GitHub · 2026-11-26 20:59 UTC · original

## Measured A/B: lower texture pressure (215349, b82a5db8)

Hardware: Win11, RX 6950 XT 16GB, Ryzen 5 3600, 32GB RAM, 2688MB pagefile unchanged.

  • Config: series-x 1280x720, budget 32, tex 64, no RT, LAZY=1 FILE=1 RELAY=0 RELAY_COPY=0 CARD_STEPS=0 DRED=light, TIMER_LOG=1, 300s.
  • Result: elapsed_s=295 stop=exited exit_code=.
  • frame_presented_log_count=11 max_frame_logged=1024 frame_interval_count=0, present_log_span_s=62.547 present_frame_delta=1023 present_log_fps_estimate=16.356 (heuristic; not FPS proof).
  • Shots: 30s 40.8, 90s 65.3, 150s 13.9, 210s 74.1 (non-black, not render proof).
  • Notable: many dstorage read failures os error 1450 (insufficient system resources), 0x8007000E texture-pool/shared-buffer warnings, and final memory allocation of 1114112 bytes failed (process abort). No 1455/device-removed marker found.
  • Final sample: free phys ~7.2GB, commit headroom ~7.2GB at exit sample (process already dying).

Comparison: 213626 budget64/tex128 LAZY+FILE RELAY=0 300s timeout_killed with texture-pool 0x8007000E; 214521 added FRAME_INTERVAL_MS and exited 248s with 71MB alloc failure. Lowering budget/tex did not remove resource pressure.

AI-assisted: OpenCode / opencode/big-pickle.

**@⁠Adika713** on GitHub · 2026-11-26 20:59 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/297#issuecomment-7203276837) ## Measured A/B: lower texture pressure (215349, b82a5db8) Hardware: Win11, RX 6950 XT 16GB, Ryzen 5 3600, 32GB RAM, 2688MB pagefile unchanged. - Config: series-x 1280x720, budget 32, tex 64, no RT, `LAZY=1 FILE=1 RELAY=0 RELAY_COPY=0 CARD_STEPS=0 DRED=light`, `TIMER_LOG=1`, 300s. - Result: `elapsed_s=295 stop=exited exit_code=`. - `frame_presented_log_count=11 max_frame_logged=1024 frame_interval_count=0`, `present_log_span_s=62.547 present_frame_delta=1023 present_log_fps_estimate=16.356` (heuristic; **not FPS proof**). - Shots: 30s 40.8, 90s 65.3, 150s 13.9, 210s 74.1 (non-black, not render proof). - Notable: many dstorage read failures `os error 1450` (insufficient system resources), `0x8007000E` texture-pool/shared-buffer warnings, and final `memory allocation of 1114112 bytes failed` (process abort). No 1455/device-removed marker found. - Final sample: free phys ~7.2GB, commit headroom ~7.2GB at exit sample (process already dying). Comparison: 213626 budget64/tex128 LAZY+FILE RELAY=0 300s timeout_killed with texture-pool 0x8007000E; 214521 added FRAME_INTERVAL_MS and exited 248s with 71MB alloc failure. Lowering budget/tex did not remove resource pressure. AI-assisted: OpenCode / opencode/big-pickle.
Author
Owner

@⁠Adika713 on GitHub · 2026-11-26 21:06 UTC · original

## Measured run: lower pressure, file-only (220229, b82a5db8)

Hardware: Win11, RX 6950 XT 16GB, Ryzen 5 3600, 32GB RAM, 2688MB pagefile unchanged.

  • Config: series-x 1280x720, budget 32, tex 64, no RT, LAZY=0 FILE_PHYSICAL=1 RELAY=0 RELAY_COPY=0 CARD_STEPS=0 DRED=light TIMER_LOG=1, 180s.
  • Result: elapsed_s=180 stop=timeout_killed.
  • frame_presented_log_count=12 max_frame_logged=2048 frame_interval_count=0, present_log_span_s=115.103 present_frame_delta=2047 present_log_fps_estimate=17.784 (heuristic; not FPS proof).
  • Shots: 30s 139.1, 90s 68.1, 150s 72.9 (non-black, not render proof).
  • Notable scan: no 1455/0x8007000E/os error 1450/device-removed/memory-allocation-failure markers found in summary.
  • Final sample: free phys ~5.9GB, commit headroom ~0.8GB.

This is a better short-run survival signal than 214521/215349, but still not world-entry/visual-correctness/15-20fps proof.

AI-assisted: OpenCode / opencode/big-pickle.

**@⁠Adika713** on GitHub · 2026-11-26 21:06 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/297#issuecomment-7203396586) ## Measured run: lower pressure, file-only (220229, b82a5db8) Hardware: Win11, RX 6950 XT 16GB, Ryzen 5 3600, 32GB RAM, 2688MB pagefile unchanged. - Config: series-x 1280x720, budget 32, tex 64, no RT, `LAZY=0 FILE_PHYSICAL=1 RELAY=0 RELAY_COPY=0 CARD_STEPS=0 DRED=light TIMER_LOG=1`, 180s. - Result: `elapsed_s=180 stop=timeout_killed`. - `frame_presented_log_count=12 max_frame_logged=2048 frame_interval_count=0`, `present_log_span_s=115.103 present_frame_delta=2047 present_log_fps_estimate=17.784` (heuristic; **not FPS proof**). - Shots: 30s 139.1, 90s 68.1, 150s 72.9 (non-black, not render proof). - Notable scan: no 1455/0x8007000E/os error 1450/device-removed/memory-allocation-failure markers found in summary. - Final sample: free phys ~5.9GB, commit headroom ~0.8GB. This is a better short-run survival signal than 214521/215349, but still not world-entry/visual-correctness/15-20fps proof. AI-assisted: OpenCode / opencode/big-pickle.
Author
Owner

@⁠Adika713 on GitHub · 2026-11-26 21:10 UTC · original

## Measured A/B: low pressure FILE-only vs LAZY+FILE (b82a5db8)

Hardware: Win11, RX 6950 XT 16GB, Ryzen 5 3600, 32GB RAM, 2688MB pagefile unchanged. 720p, budget 32, tex 64, no RT, RELAY=0, CARD_STEPS=0, DRED=light, TIMER_LOG=1, RUST_BACKTRACE=1, 180s.

Run LAZY FILE Result Present heuristic (not FPS proof) Notable markers
220229 0 1 180s timeout_killed 12 presented/max2048, span 115.103s, delta 2047, est 17.784 none found in summary scan
220650 1 1 180s timeout_killed 12 presented/max2048, span 105.639s, delta 2047, est 19.377 none found in summary scan

Both survived 180s with no 1455/0x8007000E/os error 1450/device-removed/alloc-failure markers found by summary scan. Shots non-black, not render proof. Not world-entry/visual-correctness proof.

AI-assisted: OpenCode / opencode/big-pickle.

**@⁠Adika713** on GitHub · 2026-11-26 21:10 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/297#issuecomment-7203459532) ## Measured A/B: low pressure FILE-only vs LAZY+FILE (b82a5db8) Hardware: Win11, RX 6950 XT 16GB, Ryzen 5 3600, 32GB RAM, 2688MB pagefile unchanged. 720p, budget 32, tex 64, no RT, RELAY=0, CARD_STEPS=0, DRED=light, TIMER_LOG=1, RUST_BACKTRACE=1, 180s. | Run | LAZY | FILE | Result | Present heuristic (not FPS proof) | Notable markers | |---|---:|---:|---|---|---| | 220229 | 0 | 1 | 180s timeout_killed | 12 presented/max2048, span 115.103s, delta 2047, est 17.784 | none found in summary scan | | 220650 | 1 | 1 | 180s timeout_killed | 12 presented/max2048, span 105.639s, delta 2047, est 19.377 | none found in summary scan | Both survived 180s with no 1455/0x8007000E/os error 1450/device-removed/alloc-failure markers found by summary scan. Shots non-black, not render proof. Not world-entry/visual-correctness proof. AI-assisted: OpenCode / opencode/big-pickle.
Address adrianmjim review on PR #297: only demand-commit MEM_RESERVE pages in the VEH handler so PAGE_GUARD/watch faults on already-committed lazy-mapped pages are not converted to READWRITE/EXCEPTION_CONTINUE_EXECUTION. Remove committed lazy pages from LAZY tracking, register only the deferred tail after the eager prefix, and remove lazy ranges on View/Section drop to avoid stale-range miscommit/reuse.

Tested (Win11/RX 6950 XT/R5 3600/32GB, F: target):
  cargo test -p victory-hle --lib xmem -- --test-threads=1
  => 18 passed, 0 failed, 1 ignored
Cap ite memo growth at MAX_NODES and bail out as overflow (existing callers already handle overflow). This prevents unbounded hashbrown rehash allocations seen in a 000852 180s run (71MB alloc failure from Bools::ite memo resize) on Win11/RX 6950 XT/32GB.

Tested (Win11/RX 6950 XT/R5 3600/32GB, F: target):
  cargo test -p victory-shader --lib structure -- --test-threads=1
  => 16 passed, 0 failed, 0 ignored
When a texture slot is deferred (later) or partially uploaded (partly), clear its recheck fingerprint. Prevents stale fingerprints from causing repeated re-hash/changed-after-upload work on streamed-out or partial slots.

Inspired by Voltexs/VIctory-RTXNvidia TextureQueue fix; applied narrowly to TextureQueue::later/partly.

Tested (Win11/RX 6950 XT/R5 3600/32GB, F: target):
  cargo test -p victory-gpu --lib descriptor::host::tests::views_are_made_beside_the_heap_and_copied_in -- --test-threads=1
  => same pre-existing failure on clean checkout; change reverted/confirmed unrelated
  cargo test -p victory-gpu --lib descriptor -- --test-threads=1
  => 37 passed, 1 failed (same pre-existing views_are_made_beside_the_heap_and_copied_in), 0 ignored
Add a no-alloc Windows stderr marker when the counting global allocator observes a null alloc/realloc. This gives attribution signal for Rust OOM exits where std backtrace printing is skipped on recursion.

Diagnostics-only behavior impact; normal alloc path unchanged on success.

Tested (Win11/RX 6950 XT/R5 3600/32GB, F: target):
  cargo build --profile diag -p victory --features diagnostics
  => finished diag profile
Add explicit usize-to-function transmute type annotations in the
descriptor site test helper to satisfy clippy::missing_transmute_annotations
with -D warnings on CI.

AI-assisted: opencode/big-pickle
- Add explicit transmute type args in host panel NtQuery lookup.
- Remove unnecessary mut passed to watch::open in title_memory_remapped.
- Replace File::try_lock with Windows share_mode lock to avoid MSRV 1.89
  clippy::incompatible_msrv on pipeline library writer.
- Skip depth_bounds_pipeline_loads_and_filters_draws when host reports
  depth bounds supported but does not enforce them (CI/WARP behavior).

AI-assisted: opencode/big-pickle
Satisfy clippy::question_mark in ensure_lazy_committed.

AI-assisted: opencode/big-pickle
Add low-noise diagnostics for memory-pressure attribution:
- residency: log commit headroom and pause texture uploads on E_OUTOFMEMORY
- host/pool: route alloc failures through residency and include block_bytes
- dstorage: log raw_os_error for failed reads

AI-assisted: opencode/big-pickle
Fix clippy dead field warning introduced in diagnostics-only refactor.

AI-assisted: opencode/big-pickle
Author
Owner

@⁠MamaLeVrai on GitHub · 2026-11-26 21:34 UTC · original

Thanks, the four points look handled at b82a5db: ensure_lazy_committed before the kernel writes in files::ReadFile, fread and DirectStorage's raw reads; lazy_has now takes the lock (and returns early when nothing is lazy); FILE_FLAG_DELETE_ON_CLOSE; the cache folder by default. cargo test --release -p victory-hle --lib on the RX 6950 XT: 160 passed, 0 failed, 2 ignored.

AI-assisted (Claude Code); no game data.

**@⁠MamaLeVrai** on GitHub · 2026-11-26 21:34 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/297#issuecomment-7203860173) Thanks, the four points look handled at `b82a5db`: `ensure_lazy_committed` before the kernel writes in `files::ReadFile`, `fread` and DirectStorage's raw reads; `lazy_has` now takes the lock (and returns early when nothing is lazy); `FILE_FLAG_DELETE_ON_CLOSE`; the cache folder by default. `cargo test --release -p victory-hle --lib` on the RX 6950 XT: 160 passed, 0 failed, 2 ignored. AI-assisted (Claude Code); no game data.
Author
Owner

@⁠Adika713 on GitHub · 2026-11-26 21:44 UTC · original

## Measured run: low pressure FILE-only, 300s (223853, b82a5db8)

Hardware: Win11, RX 6950 XT 16GB, Ryzen 5 3600, 32GB RAM, 2688MB pagefile unchanged.

  • Config: series-x 1280x720, budget 32, tex 64, no RT, LAZY=0 FILE_PHYSICAL=1 RELAY=0 RELAY_COPY=0 CARD_STEPS=0 DRED=light TIMER_LOG=1 RUST_BACKTRACE=1, 300s.
  • Result: elapsed_s=300 stop=timeout_killed.
  • frame_presented_log_count=11 max_frame_logged=1024 frame_interval_count=0, present_log_span_s=63.515 present_frame_delta=1023 present_log_fps_estimate=16.107 (heuristic; not FPS proof).
  • Shots: 30s 80.2, 90s 64.6, 150s 33.7, 210s 20.7 (non-black, not render proof).
  • Notable scan: no 1455/0x8007000E/os error 1450/device-removed/memory-allocation-failure markers found in summary.
  • Final sample: free phys ~2.8GB, commit headroom ~0.25GB (tight, but survived).

Compared to earlier collapsing runs (214521 early exit + alloc failure; 215349 os error 1450/0x8007000E/alloc failure), this lower-pressure FILE-only config is the most stable so far on this machine. Still not world-entry/visual-correctness/15-20fps proof.

AI-assisted: OpenCode / opencode/big-pickle.

**@⁠Adika713** on GitHub · 2026-11-26 21:44 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/297#issuecomment-7204018234) ## Measured run: low pressure FILE-only, 300s (223853, b82a5db8) Hardware: Win11, RX 6950 XT 16GB, Ryzen 5 3600, 32GB RAM, 2688MB pagefile unchanged. - Config: series-x 1280x720, budget 32, tex 64, no RT, `LAZY=0 FILE_PHYSICAL=1 RELAY=0 RELAY_COPY=0 CARD_STEPS=0 DRED=light TIMER_LOG=1 RUST_BACKTRACE=1`, 300s. - Result: `elapsed_s=300 stop=timeout_killed`. - `frame_presented_log_count=11 max_frame_logged=1024 frame_interval_count=0`, `present_log_span_s=63.515 present_frame_delta=1023 present_log_fps_estimate=16.107` (heuristic; **not FPS proof**). - Shots: 30s 80.2, 90s 64.6, 150s 33.7, 210s 20.7 (non-black, not render proof). - Notable scan: no 1455/0x8007000E/os error 1450/device-removed/memory-allocation-failure markers found in summary. - Final sample: free phys ~2.8GB, commit headroom ~0.25GB (tight, but survived). Compared to earlier collapsing runs (214521 early exit + alloc failure; 215349 os error 1450/0x8007000E/alloc failure), this lower-pressure FILE-only config is the most stable so far on this machine. Still not world-entry/visual-correctness/15-20fps proof. AI-assisted: OpenCode / opencode/big-pickle.
Author
Owner

@⁠Adika713 on GitHub · 2026-11-26 21:48 UTC · original

## Measured run: 540p low pressure FILE-only (224516, b82a5db8)

Hardware: Win11, RX 6950 XT 16GB, Ryzen 5 3600, 32GB RAM, 2688MB pagefile unchanged.

  • Config: series-x 1280x720? No - VICTORY_DISPLAY_MODE/Resolution 540p (-Resolution 540p), budget 32, tex 64, no RT, LAZY=0 FILE_PHYSICAL=1 RELAY=0 RELAY_COPY=0 CARD_STEPS=0 DRED=light TIMER_LOG=1 RUST_BACKTRACE=1, 180s.
  • Result: elapsed_s=182 stop=timeout_killed.
  • frame_presented_log_count=12 max_frame_logged=2048 frame_interval_count=0, present_log_span_s=71.827 present_frame_delta=2047 present_log_fps_estimate=28.499 (heuristic; not FPS proof).
  • Shots: 30s 61.4, 90s 58.4, 150s 126.4 (non-black, not render proof).
  • Notable scan: no 1455/0x8007000E/os error 1450/device-removed/memory-allocation-failure markers found in summary.
  • Final sample: free phys ~11.7GB, commit headroom ~0.8GB.

Compared to 720p/32/64 FILE-only 223853 (300s timeout_killed, heuristic 16.107, tight 0.25GB commit headroom), 540p gave a higher heuristic present-log rate and much more free physical RAM in this run. Still not world-entry/visual-correctness/15-20fps proof.

AI-assisted: OpenCode / opencode/big-pickle.

**@⁠Adika713** on GitHub · 2026-11-26 21:48 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/297#issuecomment-7204085975) ## Measured run: 540p low pressure FILE-only (224516, b82a5db8) Hardware: Win11, RX 6950 XT 16GB, Ryzen 5 3600, 32GB RAM, 2688MB pagefile unchanged. - Config: series-x 1280x720? No - `VICTORY_DISPLAY_MODE`/Resolution 540p (`-Resolution 540p`), budget 32, tex 64, no RT, `LAZY=0 FILE_PHYSICAL=1 RELAY=0 RELAY_COPY=0 CARD_STEPS=0 DRED=light TIMER_LOG=1 RUST_BACKTRACE=1`, 180s. - Result: `elapsed_s=182 stop=timeout_killed`. - `frame_presented_log_count=12 max_frame_logged=2048 frame_interval_count=0`, `present_log_span_s=71.827 present_frame_delta=2047 present_log_fps_estimate=28.499` (heuristic; **not FPS proof**). - Shots: 30s 61.4, 90s 58.4, 150s 126.4 (non-black, not render proof). - Notable scan: no 1455/0x8007000E/os error 1450/device-removed/memory-allocation-failure markers found in summary. - Final sample: free phys ~11.7GB, commit headroom ~0.8GB. Compared to 720p/32/64 FILE-only 223853 (300s timeout_killed, heuristic 16.107, tight 0.25GB commit headroom), 540p gave a higher heuristic present-log rate and much more free physical RAM in this run. Still not world-entry/visual-correctness/15-20fps proof. AI-assisted: OpenCode / opencode/big-pickle.
Author
Owner

@⁠Adika713 on GitHub · 2026-11-26 21:49 UTC · original

Correction to previous comment (224516): the run was not 540p. I passed -Resolution 540p but the harness parameter is -DisplayMode; it defaulted to display=1280x720 as shown in the summary. Treat 224516 as another 720p/32/64/FILE-only/LAZY=0 180s run (timeout_killed, heuristic 28.499, no 1455/0x8007000E/1450/device-removed/alloc-fail markers found). Sorry for the config labeling error.

AI-assisted: OpenCode / opencode/big-pickle.

**@⁠Adika713** on GitHub · 2026-11-26 21:49 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/297#issuecomment-7204093200) Correction to previous comment (224516): the run was **not 540p**. I passed `-Resolution 540p` but the harness parameter is `-DisplayMode`; it defaulted to `display=1280x720` as shown in the summary. Treat 224516 as another 720p/32/64/FILE-only/LAZY=0 180s run (timeout_killed, heuristic 28.499, no 1455/0x8007000E/1450/device-removed/alloc-fail markers found). Sorry for the config labeling error. AI-assisted: OpenCode / opencode/big-pickle.
Author
Owner

@⁠Adika713 on GitHub · 2026-11-26 21:51 UTC · original

Thanks for rechecking b82a5db8 on RX 6950 XT - appreciate the confirmation (160 passed, 0 failed, 2 ignored).

I’ve continued measured A/Bs on the same class of machine (RX 6950 XT/32GB/2688MB pagefile unchanged). Best survival so far is low-pressure FILE-only (LAZY=0 FILE=1, 720p budget32 tex64, RELAY=0, 300s timeout_killed), while higher-pressure/frame-interval runs still hit 0x8007000E/os error 1450/alloc failures. No world-entry/FPS/visual-correctness proof yet; present-log FPS is heuristic only.

AI-assisted: OpenCode / opencode/big-pickle.

**@⁠Adika713** on GitHub · 2026-11-26 21:51 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/297#issuecomment-7204131192) Thanks for rechecking `b82a5db8` on RX 6950 XT - appreciate the confirmation (160 passed, 0 failed, 2 ignored). I’ve continued measured A/Bs on the same class of machine (RX 6950 XT/32GB/2688MB pagefile unchanged). Best survival so far is low-pressure FILE-only (`LAZY=0 FILE=1`, 720p budget32 tex64, RELAY=0, 300s timeout_killed), while higher-pressure/frame-interval runs still hit `0x8007000E`/os error 1450/alloc failures. No world-entry/FPS/visual-correctness proof yet; present-log FPS is heuristic only. AI-assisted: OpenCode / opencode/big-pickle.
Author
Owner

@⁠Adika713 on GitHub · 2026-11-26 21:51 UTC · original

Thanks for the data point - this lines up with what we’re seeing on RX 6950 XT / 32GB / 2688MB pagefile.

On our 300s low-pressure FILE-only run (223853, 720p budget32 tex64 no RT, LAZY=0 FILE=1 RELAY=0): survived to timeout_killed, final sample showed free phys ~2.8GB but commit headroom only ~0.25GB. Earlier collapsing runs hit 0x8007000E, dstorage os error 1450, and alloc failures before/during exit (214521 had a 71MB alloc failure). We haven’t measured VRAM-vs-private-byte correlation here yet, but your R²≈1.000 finding is a useful explanation for why commit headroom collapses even when working set/free phys look less dire.

Actionable takeaway for this PR: lazy/file-backed physical pages help title-side commit, but we likely still need VRAM/texture-pressure controls (budget/tex caps, cache behavior) on small-pagefile 32GB hosts. No pagefile changes made in our tests.

AI-assisted: OpenCode / opencode/big-pickle.

**@⁠Adika713** on GitHub · 2026-11-26 21:51 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/297#issuecomment-7204131307) Thanks for the data point - this lines up with what we’re seeing on RX 6950 XT / 32GB / 2688MB pagefile. On our 300s low-pressure FILE-only run (223853, 720p budget32 tex64 no RT, `LAZY=0 FILE=1 RELAY=0`): survived to timeout_killed, final sample showed free phys ~2.8GB but commit headroom only ~0.25GB. Earlier collapsing runs hit `0x8007000E`, dstorage `os error 1450`, and alloc failures before/during exit (214521 had a 71MB alloc failure). We haven’t measured VRAM-vs-private-byte correlation here yet, but your R²≈1.000 finding is a useful explanation for why commit headroom collapses even when working set/free phys look less dire. Actionable takeaway for this PR: lazy/file-backed physical pages help title-side commit, but we likely still need VRAM/texture-pressure controls (budget/tex caps, cache behavior) on small-pagefile 32GB hosts. No pagefile changes made in our tests. AI-assisted: OpenCode / opencode/big-pickle.
Author
Owner

@⁠Adika713 on GitHub · 2026-11-26 22:13 UTC · original

## Measured 300s A/B with E_OUTOFMEMORY/1450 diagnostics (local instrumented build, b82a5db8 base)

Hardware: Win11, RX 6950 XT 16GB, Ryzen 5 3600, 32GB RAM, 2688MB pagefile unchanged.
Config: series-x 1280x720, budget 32, tex 64, no RT, RELAY=0 RELAY_COPY=0 CARD_STEPS=0 DRED=light TIMER_LOG=1 RUST_BACKTRACE=1, 300s.

Run LAZY FILE Result Present heuristic (not FPS proof) Notable markers
230237 0 1 300s timeout_killed 12/max2048, span 108.427s, delta 2047, est 18.879 no 1455/0x8007000E/os error 1450/device-removed/alloc-fail/E_OUTOFMEMORY/pausing-texture-uploads markers found in summary scan
230801 1 1 300s timeout_killed 11/max1024, span 64.368s, delta 1023, est 15.893 no 1455/0x8007000E/os error 1450/device-removed/alloc-fail/E_OUTOFMEMORY/pausing-texture-uploads markers found in summary scan

Shots non-black, not render proof. No world-entry/visual-correctness/15-20fps proof.

Diagnostics added locally (not pushed): residency::allocation_error logs commit headroom on E_OUTOFMEMORY + texture-upload pause; pool includes block size on texture-block failure; host reports residency::allocation_error on shared-buffer failure; dstorage logs raw_os_error on read failures.

AI-assisted: OpenCode / opencode/big-pickle.

**@⁠Adika713** on GitHub · 2026-11-26 22:13 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/297#issuecomment-7204480402) ## Measured 300s A/B with E_OUTOFMEMORY/1450 diagnostics (local instrumented build, b82a5db8 base) Hardware: Win11, RX 6950 XT 16GB, Ryzen 5 3600, 32GB RAM, 2688MB pagefile unchanged. Config: series-x 1280x720, budget 32, tex 64, no RT, `RELAY=0 RELAY_COPY=0 CARD_STEPS=0 DRED=light TIMER_LOG=1 RUST_BACKTRACE=1`, 300s. | Run | LAZY | FILE | Result | Present heuristic (not FPS proof) | Notable markers | |---|---:|---:|---|---|---| | 230237 | 0 | 1 | 300s timeout_killed | 12/max2048, span 108.427s, delta 2047, est 18.879 | no 1455/0x8007000E/os error 1450/device-removed/alloc-fail/E_OUTOFMEMORY/pausing-texture-uploads markers found in summary scan | | 230801 | 1 | 1 | 300s timeout_killed | 11/max1024, span 64.368s, delta 1023, est 15.893 | no 1455/0x8007000E/os error 1450/device-removed/alloc-fail/E_OUTOFMEMORY/pausing-texture-uploads markers found in summary scan | Shots non-black, not render proof. No world-entry/visual-correctness/15-20fps proof. Diagnostics added locally (not pushed): `residency::allocation_error` logs commit headroom on E_OUTOFMEMORY + texture-upload pause; `pool` includes block size on texture-block failure; `host` reports `residency::allocation_error` on shared-buffer failure; dstorage logs `raw_os_error` on read failures. AI-assisted: OpenCode / opencode/big-pickle.
Author
Owner

@⁠adrianmjim on GitHub · 2026-11-26 22:45 UTC · original

Checked by reading the code on rx9070xt cd8dfc0 (head b82a5db); I did not build or run it. Lines in xmem.rs are at b82a5db, lines in watch.rs at cd8dfc0. Nothing merged into a-publier since (4eb6cfd) changes xmem.rs or the cited parts of watch.rs.

Lazy mode and the GPU write guards

  • Which handler runs first: XMemMapPhysicalPages calls victory_gpu::title_memory_remapping() (xmem.rs:1296), which installs the watch's on_write handler with first=1 (watch.rs:3577, 3857). Only after that does it reach show -> commit_shown -> commit -> register_lazy, and that first touch of VEH installs commit_on_demand, also with first=1 (xmem.rs:1884). So commit_on_demand sits ahead of the watch's handler.
  • register_lazy(base, len) (xmem.rs:2033) registers the whole view, including the 64 MiB prefix that was just committed. commit_on_demand (xmem.rs:1886-1896) never removes the page it commits; only ensure_lazy_committed removes what it commits (xmem.rs:1943). So lazy_has is true for the prefix and for fault-committed pages, for as long as the view is mapped.
  • The watch makes blocks of title views PAGE_READONLY (watch.rs:3039, 3068-3072). It needs the write fault to reach on_write so it can open the block and mark it written. With VICTORY_LAZY_PHYSICAL=1, a title write to a guarded block inside a lazy range goes to commit_on_demand first. That runs VirtualAlloc(MEM_COMMIT, PAGE_READWRITE) on a page that is already committed and returns EXCEPTION_CONTINUE_EXECUTION. The watch's handler never sees the fault.
  • What happens next depends on whether that VirtualAlloc resets the protection. I have not tested this. If it resets it to read-write, the write goes through and the watch still counts the block as protected and clean. The copies of it keep the old bytes. The watch never guards the block again, because it already counts it as protected. If it does not reset it, the same write faults again forever on that thread.
  • A possible fix: in commit_on_demand, check VirtualQuery and only act when State == MEM_RESERVE (otherwise return 0). Also lazy_remove the page after committing it, and register only [base + prefix, base + len).
  • Related cost: while any lazy range exists, every access violation in the process, guard faults included, takes the LAZY mutex before the watch sees it (xmem.rs:1899-1902). Committed pages that stay registered make that last as long as the view is mapped.

The LAZY=1 FILE=1 runs

  • commit returns before the lazy branch when the section is file-backed (xmem.rs:2012-2013). So with VICTORY_FILE_PHYSICAL=1, the lazy path only runs if creating the file-backed section failed and the code fell back to the pagefile (xmem.rs:782).
  • That means the LAZY=1 FILE=1 runs, the 300 s pair at 22:13 included, most likely ran the same code as FILE-only, and the differences between the LAZY=0 and LAZY=1 columns would be run-to-run variation, not an effect of LAZY. The logs can confirm it: with no "file-backed section failed; using pagefile" warning, there is no "committed prefix and deferred remaining physical pages" warning either (xmem.rs:2037). 205650 (LAZY=1 FILE=0) looks like the only run so far where the lazy path was used.

Stale lazy ranges

  • View::map (xmem.rs:841) and Section::window (xmem.rs:447) can also take the lazy path, when their commit of more than 64 MiB hits 1455.
  • View::drop (xmem.rs:857) and Section::drop (xmem.rs:495) unmap those views without calling lazy_remove. Their ranges stay in LAZY. If that address range is used for something else later, the handler or ensure_lazy_committed would commit it read-write.

Not checked: what VirtualAlloc(MEM_COMMIT) does to the protection of an already committed read-only page in a section view; the logs of any run.

**@⁠adrianmjim** on GitHub · 2026-11-26 22:45 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/297#issuecomment-7204956451) Checked by reading the code on rx9070xt cd8dfc0 (head b82a5db); I did not build or run it. Lines in `xmem.rs` are at b82a5db, lines in `watch.rs` at cd8dfc0. Nothing merged into a-publier since (4eb6cfd) changes `xmem.rs` or the cited parts of `watch.rs`. **Lazy mode and the GPU write guards** - Which handler runs first: `XMemMapPhysicalPages` calls `victory_gpu::title_memory_remapping()` (xmem.rs:1296), which installs the watch's `on_write` handler with `first=1` (watch.rs:3577, 3857). Only after that does it reach `show` -> `commit_shown` -> `commit` -> `register_lazy`, and that first touch of `VEH` installs `commit_on_demand`, also with `first=1` (xmem.rs:1884). So `commit_on_demand` sits ahead of the watch's handler. - `register_lazy(base, len)` (xmem.rs:2033) registers the whole view, including the 64 MiB prefix that was just committed. `commit_on_demand` (xmem.rs:1886-1896) never removes the page it commits; only `ensure_lazy_committed` removes what it commits (xmem.rs:1943). So `lazy_has` is true for the prefix and for fault-committed pages, for as long as the view is mapped. - The watch makes blocks of title views `PAGE_READONLY` (watch.rs:3039, 3068-3072). It needs the write fault to reach `on_write` so it can open the block and mark it written. With `VICTORY_LAZY_PHYSICAL=1`, a title write to a guarded block inside a lazy range goes to `commit_on_demand` first. That runs `VirtualAlloc(MEM_COMMIT, PAGE_READWRITE)` on a page that is already committed and returns `EXCEPTION_CONTINUE_EXECUTION`. The watch's handler never sees the fault. - What happens next depends on whether that `VirtualAlloc` resets the protection. I have not tested this. If it resets it to read-write, the write goes through and the watch still counts the block as protected and clean. The copies of it keep the old bytes. The watch never guards the block again, because it already counts it as protected. If it does not reset it, the same write faults again forever on that thread. - A possible fix: in `commit_on_demand`, check `VirtualQuery` and only act when `State == MEM_RESERVE` (otherwise return 0). Also `lazy_remove` the page after committing it, and register only `[base + prefix, base + len)`. - Related cost: while any lazy range exists, every access violation in the process, guard faults included, takes the `LAZY` mutex before the watch sees it (xmem.rs:1899-1902). Committed pages that stay registered make that last as long as the view is mapped. **The LAZY=1 FILE=1 runs** - `commit` returns before the lazy branch when the section is file-backed (xmem.rs:2012-2013). So with `VICTORY_FILE_PHYSICAL=1`, the lazy path only runs if creating the file-backed section failed and the code fell back to the pagefile (xmem.rs:782). - That means the LAZY=1 FILE=1 runs, the 300 s pair at 22:13 included, most likely ran the same code as FILE-only, and the differences between the LAZY=0 and LAZY=1 columns would be run-to-run variation, not an effect of LAZY. The logs can confirm it: with no "file-backed section failed; using pagefile" warning, there is no "committed prefix and deferred remaining physical pages" warning either (xmem.rs:2037). 205650 (LAZY=1 FILE=0) looks like the only run so far where the lazy path was used. **Stale lazy ranges** - `View::map` (xmem.rs:841) and `Section::window` (xmem.rs:447) can also take the lazy path, when their commit of more than 64 MiB hits 1455. - `View::drop` (xmem.rs:857) and `Section::drop` (xmem.rs:495) unmap those views without calling `lazy_remove`. Their ranges stay in `LAZY`. If that address range is used for something else later, the handler or `ensure_lazy_committed` would commit it read-write. Not checked: what `VirtualAlloc(MEM_COMMIT)` does to the protection of an already committed read-only page in a section view; the logs of any run.
Author
Owner

@⁠Adika713 on GitHub · 2026-11-26 23:15 UTC · original

Measured update (local diag build, includes xmem VEH/watch hardening for adrianmjim review; not claiming stability/FPS/world-entry)

Hardware: Win11, RX 6950 XT 16GB, Ryzen 5 3600, 32GB RAM, 2688MB pagefile unchanged.
Config: series-x 720p, budget32, tex64, no RT, LAZY=0 FILE=1 RELAY=0 RELAY_COPY=0 CARD_STEPS=0 JOIN_COPIES=0 INDIRECT_WINDOW=0 INDIRECT_BATCH=0 MAP_THREADS=0 WIDE_BACK=0 CARD_REHASH_RUNS=0 DRED=light, PIPELINE_BOOK=1, VICTORY_LIBRARY_DIR=F:\victory-cache-retail\pipelines-shared.

Run Build Result Notes
235612 diag @ local xmem fix exited 169s memory allocation of 2162688 bytes failed, then 18874368 bytes failed; “skipping backtrace printing to avoid potential recursion”. No scanned 1455/1450/0x8007000E/0x887A0007/E_OUTOFMEMORY/texture-upload-pause markers. Shared pipeline lib saved (host-pipelines.bin 263672).
000359 same + RUST_BACKTRACE=full 180s timeout_killed no scanned alloc/1450/E_OUTOFMEMORY/device-removal markers; host pipeline library loaded bytes=263672 mapped=true. Heuristic present estimate 29.343 over 34s span only (frame_interval_count=0) - not FPS proof.
000852 same + RUST_BACKTRACE=full 180s timeout_killed memory allocation of 71303184 bytes failed logged; run still reached 180s timeout. Backtrace shows hashbrown/raw table resize in victory_shader::structure::* path (full symbol/name partially interleaved in stderr), so alloc pressure may be shader/structure-table related. host pipeline library loaded bytes=270826 mapped=true.

Code update pushed: ee1e2d80 on Adika713:fix/lazy-physical-pages-rx9070xt addresses adrianmjim’s review: VEH demand-commit only on MEM_RESERVE pages; committed lazy page removed from LAZY; deferred tail only registered as lazy; View::drop/Section::drop call lazy_remove. cargo test -p victory-hle --lib xmem -- --test-threads=1 => 18 passed, 0 failed, 1 ignored (F: target). Not game-tested in a LAZY=1 fallback case yet.

Caveats: heuristic present-log estimate is not FPS/world-entry/visual proof. Rust alloc failures remain a blocker on this 32GB/2688MB-pagefile machine; 000852 shows they can be non-fatal in at least one run but still indicate pressure. No pagefile changes.

**@⁠Adika713** on GitHub · 2026-11-26 23:15 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/297#issuecomment-7205381701) ## Measured update (local diag build, includes xmem VEH/watch hardening for adrianmjim review; not claiming stability/FPS/world-entry) **Hardware:** Win11, RX 6950 XT 16GB, Ryzen 5 3600, 32GB RAM, 2688MB pagefile unchanged. **Config:** series-x 720p, budget32, tex64, no RT, `LAZY=0 FILE=1 RELAY=0 RELAY_COPY=0 CARD_STEPS=0 JOIN_COPIES=0 INDIRECT_WINDOW=0 INDIRECT_BATCH=0 MAP_THREADS=0 WIDE_BACK=0 CARD_REHASH_RUNS=0 DRED=light`, `PIPELINE_BOOK=1`, `VICTORY_LIBRARY_DIR=F:\victory-cache-retail\pipelines-shared`. | Run | Build | Result | Notes | |---|---|---:|---| | 235612 | diag @ local xmem fix | exited 169s | `memory allocation of 2162688 bytes failed`, then `18874368 bytes failed`; “skipping backtrace printing to avoid potential recursion”. No scanned 1455/1450/0x8007000E/0x887A0007/E_OUTOFMEMORY/texture-upload-pause markers. Shared pipeline lib saved (`host-pipelines.bin` 263672). | | 000359 | same + `RUST_BACKTRACE=full` | 180s timeout_killed | no scanned alloc/1450/E_OUTOFMEMORY/device-removal markers; `host pipeline library loaded bytes=263672 mapped=true`. Heuristic present estimate 29.343 over 34s span only (`frame_interval_count=0`) - not FPS proof. | | 000852 | same + `RUST_BACKTRACE=full` | 180s timeout_killed | `memory allocation of 71303184 bytes failed` logged; run still reached 180s timeout. Backtrace shows hashbrown/raw table resize in `victory_shader::structure::*` path (full symbol/name partially interleaved in stderr), so alloc pressure may be shader/structure-table related. `host pipeline library loaded bytes=270826 mapped=true`. | **Code update pushed:** `ee1e2d80` on `Adika713:fix/lazy-physical-pages-rx9070xt` addresses adrianmjim’s review: VEH demand-commit only on `MEM_RESERVE` pages; committed lazy page removed from `LAZY`; deferred tail only registered as lazy; `View::drop`/`Section::drop` call `lazy_remove`. `cargo test -p victory-hle --lib xmem -- --test-threads=1` => 18 passed, 0 failed, 1 ignored (F: target). Not game-tested in a LAZY=1 fallback case yet. **Caveats:** heuristic present-log estimate is not FPS/world-entry/visual proof. Rust alloc failures remain a blocker on this 32GB/2688MB-pagefile machine; 000852 shows they can be non-fatal in at least one run but still indicate pressure. No pagefile changes.
Author
Owner

@⁠adrianmjim on GitHub · 2026-11-26 23:29 UTC · original

Thanks. I checked ee1e2d8 (the two commits after it don't touch xmem.rs) and ran cargo test -p victory-hle --lib xmem -- --test-threads=1: 18 passed here too.

The VEH change does what I asked: pages that are already committed now fall through to the watch's handler. I also tested the open question from my last comment with a small standalone program. Two views of one SEC_RESERVE section:

  • VirtualAlloc(MEM_COMMIT, PAGE_READWRITE) on an already committed PAGE_READONLY page succeeds and sets it back to read-write. So the old handler would have silently dropped guards.
  • A page committed through one view shows as MEM_COMMIT in VirtualQuery through the other, so aliases are covered as well.

Registering only the deferred tail, and removing pages once the fault commits them, also look right.

Two things still look wrong to me (both only with LAZY=1):

  1. ensure_lazy_committed doesn't round end up to 64 KiB (let end = base.saturating_add(len)). Take ReadFile(P+0x100, 0x2000) into a lazy range:
    • It commits up to P+0x3000.
    • lazy_remove then leaves a range starting at the unaligned P+0x2100.
    • A later touch at P+0x8000 faults, and commit_on_demand looks up the page base P. lazy_has(P) is false. Even if it weren't, VirtualQuery at the 64 KiB base reports MEM_COMMIT, because its first 4 KiB pages are committed (I checked this case too). So nobody handles the access violation.
    • Rounding end up to PAGE, and querying the faulting address rather than the page base, would fix it.
  2. In View::drop and Section::drop, lazy_remove runs after the unmap. Another thread's View::map can get the same address back in between and register its deferred tail, and the late lazy_remove then deletes that registration. Its next write to the tail is an unhandled access violation. Calling lazy_remove before the unmap, as unmap() already does, closes this.

Smaller points:

  • On NotLazy the stale entry stays registered, so every later fault on that page pays the mutex plus a VirtualQuery. A committed page of a SEC_RESERVE view can't go back to reserved, so it's safe to lazy_remove it there.
  • Checking info.Type == MEM_MAPPED would be cheap hardening.
  • A unit test that needs no commit limit: map a SEC_RESERVE view, register_lazy it, commit one page and make it read-only. Then check that commit_fault_page returns NotLazy and leaves the protection alone.

Still open from before: do the LAZY=1 FILE=1 logs show the "committed prefix and deferred" warning? If not, those runs never took the lazy path. As far as I can see, commit leaves before it for file-backed sections.

**@⁠adrianmjim** on GitHub · 2026-11-26 23:29 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/297#issuecomment-7205588546) Thanks. I checked `ee1e2d8` (the two commits after it don't touch `xmem.rs`) and ran `cargo test -p victory-hle --lib xmem -- --test-threads=1`: 18 passed here too. The VEH change does what I asked: pages that are already committed now fall through to the watch's handler. I also tested the open question from my last comment with a small standalone program. Two views of one `SEC_RESERVE` section: - `VirtualAlloc(MEM_COMMIT, PAGE_READWRITE)` on an already committed `PAGE_READONLY` page succeeds and sets it back to read-write. So the old handler would have silently dropped guards. - A page committed through one view shows as `MEM_COMMIT` in `VirtualQuery` through the other, so aliases are covered as well. Registering only the deferred tail, and removing pages once the fault commits them, also look right. Two things still look wrong to me (both only with `LAZY=1`): 1. **`ensure_lazy_committed` doesn't round `end` up to 64 KiB** (`let end = base.saturating_add(len)`). Take `ReadFile(P+0x100, 0x2000)` into a lazy range: - It commits up to P+0x3000. - `lazy_remove` then leaves a range starting at the unaligned P+0x2100. - A later touch at P+0x8000 faults, and `commit_on_demand` looks up the page base P. `lazy_has(P)` is false. Even if it weren't, `VirtualQuery` at the 64 KiB base reports `MEM_COMMIT`, because its first 4 KiB pages are committed (I checked this case too). So nobody handles the access violation. - Rounding `end` up to `PAGE`, and querying the faulting address rather than the page base, would fix it. 2. **In `View::drop` and `Section::drop`, `lazy_remove` runs after the unmap.** Another thread's `View::map` can get the same address back in between and register its deferred tail, and the late `lazy_remove` then deletes that registration. Its next write to the tail is an unhandled access violation. Calling `lazy_remove` before the unmap, as `unmap()` already does, closes this. Smaller points: - On `NotLazy` the stale entry stays registered, so every later fault on that page pays the mutex plus a `VirtualQuery`. A committed page of a `SEC_RESERVE` view can't go back to reserved, so it's safe to `lazy_remove` it there. - Checking `info.Type == MEM_MAPPED` would be cheap hardening. - A unit test that needs no commit limit: map a `SEC_RESERVE` view, `register_lazy` it, commit one page and make it read-only. Then check that `commit_fault_page` returns `NotLazy` and leaves the protection alone. Still open from before: do the `LAZY=1 FILE=1` logs show the "committed prefix and deferred" warning? If not, those runs never took the lazy path. As far as I can see, `commit` leaves before it for file-backed sections.
Addresses adrianmjim review on Belobug/VIctory-Belobug-AMD#297:
- round ensure_lazy_committed end up to 64KiB page boundary and advance by
  committed aligned length to avoid unaligned tail holes
- drop stale lazy tracking for committed MEM_MAPPED pages in commit_fault_page
  and require MEM_MAPPED before demand commit
- remove lazy ranges before unmapping in View/Section drop to close remap race

Adds a game-free unit test proving commit_fault_page returns NotLazy and does
not change protection on a committed read-only mapped page.

AI-assisted: OpenCode / opencode/big-pickle (no game data).
Add game-free regression test for adrianmjim PR #297 review case: unaligned
kernel-write precommit (P+0x100,len 0x2000) must round up to 64KiB and remove
lazy tracking for the whole touched page.

Verified: cargo test -p victory-hle --lib xmem -- --test-threads=1 => 20 passed, 0 failed, 1 ignored.

AI-assisted: OpenCode / opencode/big-pickle (no game data).
Adds big_mb field for >=32MB allocation failures to make large host OOMs easier
to attribute in logs during low-commit runs. Diagnostics-only; no behavior change.

Verified: cargo check -p victory-gpu.

AI-assisted: OpenCode / opencode/big-pickle (no game data).
CI default tests run without VICTORY_LAZY_PHYSICAL=1; allow precommit when
HAS_LAZY indicates registered lazy ranges. Fixes CI failure in
ensure_lazy_committed_rounds_unaligned_kernel_write_range.

Verified: cargo test -p victory-hle --lib ensure_lazy_committed_rounds_unaligned_kernel_write_range -- --test-threads=1 => 1 passed.

AI-assisted: OpenCode / opencode/big-pickle (no game data).
Replace INFINITE WaitForSingleObject in host fence/card-clock/relay/fetch
waits with a 5s polling wait that returns on fence completion or device
removal. This reduces deadlock risk at 2-5fps, TDR/device-loss scenarios.

Diagnostics-only behavior change in failure mode; normal completion still
waits until signaled.

Verified: cargo check -p victory-gpu.

AI-assisted: OpenCode / opencode/big-pickle (no game data).
Fix CI clippy failure introduced by INFINITE-wait hardening.

Verified: cargo clippy -p victory-gpu --lib -- -D warnings.

AI-assisted: OpenCode / opencode/big-pickle (no game data).
Poll fence waits with 5s timeout in host helper paths to avoid deadlock at
2-5fps/TDR/device-loss. Keep behavior normal on completion.

Verified: cargo check -p victory-gpu.

AI-assisted: OpenCode / opencode/big-pickle (no game data).
Poll fence waits with 5s timeout and device-loss bail to reduce deadlock
risk at 2-5fps/TDR. Remove unused INFINITE import from host.rs.

Verified: cargo check -p victory-gpu.

AI-assisted: OpenCode / opencode/big-pickle (no game data).
Poll fence wait with timeout and device-loss bail.

Verified: cargo check -p victory-gpu.

AI-assisted: OpenCode / opencode/big-pickle (no game data).
Use 5s polling waits in bench and pipeline crash-watch helper to avoid
indefinite hangs in diagnostics/helper threads.

Verified: cargo check -p victory-gpu.

AI-assisted: OpenCode / opencode/big-pickle (no game data).
Cleanup after wait hardening; behavior unchanged.

Verified: cargo check -p victory-gpu.

AI-assisted: OpenCode / opencode/big-pickle (no game data).
CI clippy/check failed due to missing device field on bare_cost::Rig; remove
device-removal check in that test helper wait loop.

Verified: cargo check -p victory-gpu; cargo clippy -p victory-gpu --lib -- -D warnings.

AI-assisted: OpenCode / opencode/big-pickle (no game data).
Use borrowed written ranges while line lock is held, dropping before return.
Small allocation reduction on hot late-blocked checks.

Verified: cargo check -p victory-gpu.

AI-assisted: OpenCode / opencode/big-pickle (no game data).
Author
Owner

@⁠Adika713 on GitHub · 2026-11-27 01:41 UTC · original

Thanks for the detailed follow-up on ee1e2d8.

I pushed 66d859b9 on Adika713:fix/lazy-physical-pages-rx9070xt (PR #297 head) to address the points you called out:

  • ensure_lazy_committed: rounds end up to 64 KiB (PAGE) and advances by the aligned committed length, so kernel-write precommits do not leave an unaligned tail hole.
  • commit_fault_page: when a page is already MEM_COMMIT|MEM_MAPPED inside lazy tracking, it returns NotLazy and removes stale lazy tracking for that page; it also requires MEM_MAPPED before demand-committing a reserved page.
  • View::drop / Section::drop: lazy_remove now runs before UnmapViewOfFile/UnmapViewOfFile2, matching the unmap() ordering.
  • Added game-free unit test commit_fault_page_leaves_committed_guarded_page_alone: maps a SEC_COMMIT view, registers lazy, protects one page PAGE_READONLY, asserts commit_fault_page returns NotLazy and protection stays PAGE_READONLY.

Verified locally (Windows 11, no game run, F: target dir):

cargo test -p victory-hle --lib xmem -- --test-threads=1
# test result: ok. 18 passed; 0 failed; 1 ignored; 0 measured; 143 filtered out

cargo test -p victory-hle --lib commit_fault_page_leaves_committed_guarded_page_alone -- --test-threads=1
# test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 162 filtered out

Open/remaining:

  • I have not game-runtime-tested a LAZY=1 fallback case after this patch (user asked to pause game tests because Enter/input is unreliable).
  • Your LAZY=1 FILE=1 observation still looks right from code: commit() returns early for file-backed sections, so lazy demand-commit is only exercised when file-backed section creation falls back. I have not added new log-confirmed LAZY+FILE evidence in this turn.
  • I have not yet added a dedicated unit test for the exact unaligned ReadFile(P+0x100,0x2000) then fault-at-P+0x8000 case you described; the alignment fix is in place, but that specific regression test would be good follow-up.

AI-assisted: OpenCode / opencode/big-pickle. No game data included.

**@⁠Adika713** on GitHub · 2026-11-27 01:41 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/297#issuecomment-7207504103) Thanks for the detailed follow-up on `ee1e2d8`. I pushed `66d859b9` on `Adika713:fix/lazy-physical-pages-rx9070xt` (PR #297 head) to address the points you called out: - `ensure_lazy_committed`: rounds `end` up to 64 KiB (`PAGE`) and advances by the aligned committed length, so kernel-write precommits do not leave an unaligned tail hole. - `commit_fault_page`: when a page is already `MEM_COMMIT|MEM_MAPPED` inside lazy tracking, it returns `NotLazy` and removes stale lazy tracking for that page; it also requires `MEM_MAPPED` before demand-committing a reserved page. - `View::drop` / `Section::drop`: `lazy_remove` now runs before `UnmapViewOfFile`/`UnmapViewOfFile2`, matching the `unmap()` ordering. - Added game-free unit test `commit_fault_page_leaves_committed_guarded_page_alone`: maps a `SEC_COMMIT` view, registers lazy, protects one page `PAGE_READONLY`, asserts `commit_fault_page` returns `NotLazy` and protection stays `PAGE_READONLY`. Verified locally (Windows 11, no game run, F: target dir): ```powershell cargo test -p victory-hle --lib xmem -- --test-threads=1 # test result: ok. 18 passed; 0 failed; 1 ignored; 0 measured; 143 filtered out cargo test -p victory-hle --lib commit_fault_page_leaves_committed_guarded_page_alone -- --test-threads=1 # test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 162 filtered out ``` Open/remaining: - I have not game-runtime-tested a `LAZY=1` fallback case after this patch (user asked to pause game tests because Enter/input is unreliable). - Your `LAZY=1 FILE=1` observation still looks right from code: `commit()` returns early for file-backed sections, so lazy demand-commit is only exercised when file-backed section creation falls back. I have not added new log-confirmed LAZY+FILE evidence in this turn. - I have not yet added a dedicated unit test for the exact unaligned `ReadFile(P+0x100,0x2000)` then fault-at-`P+0x8000` case you described; the alignment fix is in place, but that specific regression test would be good follow-up. AI-assisted: OpenCode / opencode/big-pickle. No game data included.
Author
Owner

@⁠adrianmjim on GitHub · 2026-11-27 01:44 UTC · original

Checked 66d859b: the four changes are what I meant.

  • ensure_lazy_committed rounds end up to PAGE and steps by the aligned length.
  • commit_fault_page needs MEM_MAPPED, and drops the stale entry on a committed page.
  • Both Drops now call lazy_remove before the unmap.

Since commits now cover whole 64 KiB pages, the base-address VirtualQuery no longer sees the half-committed page from my example. cargo test -p victory-hle --lib xmem -- --test-threads=1 gives 19 passed, 1 ignored here (Windows 11, RX 7900 XT machine, no game), including the new commit_fault_page_leaves_committed_guarded_page_alone.

No further points from me on the lazy path. The unaligned ReadFile(P+0x100, 0x2000) regression test would still be a nice follow-up, as you say. It can stay game-free by calling ensure_lazy_committed on a registered SEC_RESERVE view and checking VirtualQuery at P+0x8000.

**@⁠adrianmjim** on GitHub · 2026-11-27 01:44 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/297#issuecomment-7207534223) Checked `66d859b`: the four changes are what I meant. - `ensure_lazy_committed` rounds `end` up to `PAGE` and steps by the aligned length. - `commit_fault_page` needs `MEM_MAPPED`, and drops the stale entry on a committed page. - Both `Drop`s now call `lazy_remove` before the unmap. Since commits now cover whole 64 KiB pages, the base-address `VirtualQuery` no longer sees the half-committed page from my example. `cargo test -p victory-hle --lib xmem -- --test-threads=1` gives 19 passed, 1 ignored here (Windows 11, RX 7900 XT machine, no game), including the new `commit_fault_page_leaves_committed_guarded_page_alone`. No further points from me on the lazy path. The unaligned `ReadFile(P+0x100, 0x2000)` regression test would still be a nice follow-up, as you say. It can stay game-free by calling `ensure_lazy_committed` on a registered `SEC_RESERVE` view and checking `VirtualQuery` at P+0x8000.
Borrow line.written under lock during card-steps blocking check; drop lock before take.
Small perf/allocation reduction in late/relay path.

Verified: cargo check -p victory-gpu.

AI-assisted: OpenCode / opencode/big-pickle (no game data).
Merge sorted ranges in-place instead of allocating a new output Vec.
Behavior-preserving; covered by existing ranges_touch_where_they_overlap test.

Verified: cargo test -p victory-gpu --lib ranges_touch_where_they_overlap -- --nocapture; cargo check -p victory-gpu.

AI-assisted: OpenCode / opencode/big-pickle (no game data).
(cherry picked from commit 7dfe29e990)
(cherry picked from commit b2decf2a97)
(cherry picked from commit 7e2a44f2bb)
(cherry picked from commit e42c25dc2c)
Manual port of the DirectStorage source-lifetime fix from PR #518
(aarushvan, Belobug/VIctory-Belobug-AMD#518) adapted to PR297 layout.
Retain file-backed sources from enqueue/submit until worker completion
so queued reads do not observe a released file object.

Co-authored-by: aarushvan <[email protected]>
AI-assisted: opencode/big-pickle
Cherry-picked from Belobug/VIctory-Belobug-AMD#537 (hajduzsolt).
Keep the existing 1,024 ordinary spare chunks, cap backing allocations
at 16 MiB, and recycle recording chunks without a temporary collection.

AI-assisted: opencode/big-pickle
Cherry-picked from Belobug/VIctory-Belobug-AMD#536 (MamaLeVrai).
listed() waits on the PENDING state, not ON_THEIR_WAY job presence, to
avoid copy/draw upload race while claim is still creating the job.

Co-authored-by: Claude Opus 4.6 <[email protected]>
AI-assisted: opencode/big-pickle
Manual port of Belobug/VIctory-Belobug-AMD#535 (hajduzsolt) to PR297
known.rs layout. Read keys/counts/selected records with bounded buffering
and preserve record numbers and torn-tail handling.

AI-assisted: opencode/big-pickle
Manual port of Belobug/VIctory-Belobug-AMD#532 (hajduzsolt) onto PR297.
Adds opt-in VICTORY_PC_FSR provider switch for normal Series S/X profiles
without forcing the 4K FSR image patch; resolves conflicts with PR297
run/fidelityfx layout.

AI-assisted: opencode/big-pickle
Fixes CI failure (Clippy/Default/Diagnostics) on PR297 head: leftover
conflict markers in run.rs and fidelityfx.rs from manual PR532 port.

AI-assisted: opencode/big-pickle
Cherry-picked from Belobug/VIctory-Belobug-AMD#437 (VIREX).
Preserves original pairwise planner for small/degenerate cases and adds
deterministic randomized equivalence tests.

AI-assisted: opencode/big-pickle
Manual port of Belobug/VIctory-Belobug-AMD#440 (VIREX) to PR297.
Preserves pairwise path for small/degenerate cases and adds deterministic
equivalence tests.

AI-assisted: opencode/big-pickle
Cherry-picked from Belobug/VIctory-Belobug-AMD#539 (jptorres96).
Test-only: serializes standing-asking tests to avoid process-wide
ask_once/ask_once_end contention under cargo test.

AI-assisted: opencode/big-pickle
Manual port of Belobug/VIctory-Belobug-AMD#552 (hajduzsolt) to PR297.
Preserves sentinel backlog handling and test; keeps bounded wait loop
while checking device-removal reason.

AI-assisted: opencode/big-pickle
Manual port of Belobug/VIctory-Belobug-AMD#548 (hajduzsolt) to PR297.
Select/sort only the batch that fits; add equivalence regression test.

AI-assisted: opencode/big-pickle
Manual port of Belobug/VIctory-Belobug-AMD#555 (hajduzsolt) to PR297.
Resolved README conflict; kept PR297 README structure and updated
VICTORY_TEXTURE_STORE description.

AI-assisted: opencode/big-pickle
Manual port of Belobug/VIctory-Belobug-AMD#554 (SalmanBarkat) to PR297.
Adds supports_typed_uav cache/query and rejects unsupported typed UAV
formats in fits(); includes regression test.

AI-assisted: opencode/big-pickle
Fixes Clippy -D warnings failure on PR297 CI.

AI-assisted: opencode/big-pickle
Cherry-picked from Belobug/VIctory-Belobug-AMD#550 (adrianmjim).
Drop CREATE_NOT_RESIDENT in replay heap flags and cover with unit test.

AI-assisted: opencode/big-pickle
Manual port of Belobug/VIctory-Belobug-AMD#540 (hajduzsolt), adapted from
notquiteog/victory-nvidia ff87d849. Use builder_whole() readiness check so
ambient fallback does not prepare incomplete BVH pipeline set.

AI-assisted: opencode/big-pickle

Co-authored-by: notquiteog <[email protected]>
Co-authored-by: Claude Opus 4.6 <[email protected]>
Manual port of Belobug/VIctory-Belobug-AMD#547 (DecayingEagle), backport of
avatarmanz/VIctory-7900XTX#434 (Jake). Learns pages written after submission
and waits on later fills; compares GPU/CPU fills at landing. Kept PR297
card_steps API/layout.

AI-assisted: opencode/big-pickle

Co-authored-by: Jake <[email protected]>
Co-authored-by: Claude Opus 4.6 <[email protected]>
Author
Owner

@⁠Adika713 on GitHub · 2026-11-27 13:19 UTC · original

## Measured post-warm runs on 988d4796 (no game input automation; game stopped after log capture)

Hardware: Win11, RX 6950 XT 16GB, Ryzen 5 3600, 32GB RAM, 2688MB pagefile unchanged. Build from this PR worktree (988d4796), debug victory.exe. Cache: F:\victory-cache-retail, shared pipeline lib F:\victory-cache-retail\pipelines-shared.

Pipeline warm

victory warm --used completed: 83598 pipelines known, 2581 to make, 8 processes, 2581 made in 36s (8 had no host pipeline, 0 ended process); median 15.7ms, p90 142.5ms, p99 543.7ms, max 9575ms. Log: local warm-pr297-20261127-140100.log.

Post-warm game run (stopped by request after capture)

Config: --console series-s --execute, 960x540, VICTORY_WINDOW_BUDGET_MB=16, VICTORY_TEXTURE_MAX=16, VICTORY_LAZY_PHYSICAL=1, VICTORY_FILE_PHYSICAL=1, VICTORY_RELAY=0, VICTORY_RELAY_COPY=0, VICTORY_CARD_STEPS=0, VICTORY_JOIN_COPIES=0, VICTORY_INDIRECT_WINDOW=0, VICTORY_INDIRECT_BATCH=0, VICTORY_MAP_THREADS=0, VICTORY_WIDE_BACK=0, VICTORY_CARD_REHASH_RUNS=0, VICTORY_D3D12_DRED=light, VICTORY_PIPELINE_BOOK=1.

Observed frame-summary snapshots (err log, not full-run proof):

  • 30.0 fps, 33.3 ms/frame ... dropped 0 without a host pipeline
  • later degraded to 0.3 fps, 3387.2 ms/frame (1131.2 preparing: copies 171.6 ms 234.0 MB, textures 826.9 ms 100.2 MB; 167.0 on the GPU; 2072.2 copying back 61.5 MB), 1800 draws/frame, dropped 1020 without a host pipeline (0 being made)
  • texture refresh detail in same period: 913.9 ms, ... 13.9 ms waiting for title memory to hold still ...; another sample 5623.5 ms ... 4045.0 ms waiting for title memory to hold still

Best-known Nxssie-style base (same config family, RELAY=0) rerun

Same machine/config as above (FILE+LAZY, RELAY=0), separate run. Snapshots degraded similarly: 0.2-0.4 fps, ~3160-4438 ms/frame, copies 50-197ms/110-259MB, textures 1085-1874ms/108-175MB, GPU 99-286ms, copy-back 1032-2250ms/32-55MB, 861-4830 draws/frame, 166-744 dropped without host pipeline (0 being made). Texture refreshes showed 1758-5624ms with 0-4045ms "waiting for title memory to hold still". No 1455/0x887A0007/0x8007000E markers found in scanned summary lines for this run.

This is not a claim of world-entry/FPS/stability improvement; it’s an objective regression signal that prewarm alone didn’t address the dominant texture-refresh hold-still/copy-back/descriptor-heavy path in these captures. I’m investigating those hot paths next.

AI-assisted: OpenCode / opencode/big-pickle. No game data included.

**@⁠Adika713** on GitHub · 2026-11-27 13:19 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/297#issuecomment-7219330708) ## Measured post-warm runs on 988d4796 (no game input automation; game stopped after log capture) Hardware: Win11, RX 6950 XT 16GB, Ryzen 5 3600, 32GB RAM, 2688MB pagefile unchanged. Build from this PR worktree (`988d4796`), debug `victory.exe`. Cache: `F:\victory-cache-retail`, shared pipeline lib `F:\victory-cache-retail\pipelines-shared`. ### Pipeline warm `victory warm --used` completed: 83598 pipelines known, 2581 to make, 8 processes, **2581 made in 36s** (8 had no host pipeline, 0 ended process); median 15.7ms, p90 142.5ms, p99 543.7ms, max 9575ms. Log: local `warm-pr297-20261127-140100.log`. ### Post-warm game run (stopped by request after capture) Config: `--console series-s --execute`, 960x540, `VICTORY_WINDOW_BUDGET_MB=16`, `VICTORY_TEXTURE_MAX=16`, `VICTORY_LAZY_PHYSICAL=1`, `VICTORY_FILE_PHYSICAL=1`, `VICTORY_RELAY=0`, `VICTORY_RELAY_COPY=0`, `VICTORY_CARD_STEPS=0`, `VICTORY_JOIN_COPIES=0`, `VICTORY_INDIRECT_WINDOW=0`, `VICTORY_INDIRECT_BATCH=0`, `VICTORY_MAP_THREADS=0`, `VICTORY_WIDE_BACK=0`, `VICTORY_CARD_REHASH_RUNS=0`, `VICTORY_D3D12_DRED=light`, `VICTORY_PIPELINE_BOOK=1`. Observed frame-summary snapshots (err log, not full-run proof): - `30.0 fps, 33.3 ms/frame ... dropped 0 without a host pipeline` - later degraded to `0.3 fps, 3387.2 ms/frame (1131.2 preparing: copies 171.6 ms 234.0 MB, textures 826.9 ms 100.2 MB; 167.0 on the GPU; 2072.2 copying back 61.5 MB), 1800 draws/frame, dropped 1020 without a host pipeline (0 being made)` - texture refresh detail in same period: `913.9 ms, ... 13.9 ms waiting for title memory to hold still ...`; another sample `5623.5 ms ... 4045.0 ms waiting for title memory to hold still` ### Best-known Nxssie-style base (same config family, RELAY=0) rerun Same machine/config as above (FILE+LAZY, RELAY=0), separate run. Snapshots degraded similarly: `0.2-0.4 fps, ~3160-4438 ms/frame`, copies 50-197ms/110-259MB, textures 1085-1874ms/108-175MB, GPU 99-286ms, copy-back 1032-2250ms/32-55MB, 861-4830 draws/frame, 166-744 dropped without host pipeline (0 being made). Texture refreshes showed 1758-5624ms with 0-4045ms "waiting for title memory to hold still". No 1455/0x887A0007/0x8007000E markers found in scanned summary lines for this run. This is not a claim of world-entry/FPS/stability improvement; it’s an objective regression signal that prewarm alone didn’t address the dominant texture-refresh hold-still/copy-back/descriptor-heavy path in these captures. I’m investigating those hot paths next. AI-assisted: OpenCode / opencode/big-pickle. No game data included.
Ported from kyokyotosh/VIctory-6700XT (GPL-3.0), commits:
- f1733477 Host lists of landed flights go back to the pool at once
- 018d3724 Flights sent ahead land first while an aperture segment is near its limit
- e3c07030 The aperture-segment back-off holds
- 63a773e4 Preludes come from a pool

Original author: kyoto <[email protected]>

AI-assisted: opencode/big-pickle
Port idea from kyokyotosh/VIctory-6700XT 6a772184 (GPL-3.0).
Original author: kyoto <[email protected]>.

Default VICTORY_THIN_THREADS to a quarter of logical cores, clamped 2-8,
instead of 8. On 5800X3D this reduced contention and improved heavy-street
fps in kyoto's measurements; override remains via VICTORY_THIN_THREADS.

AI-assisted: opencode/big-pickle
Author
Owner

@⁠Adika713 on GitHub · 2026-11-27 13:52 UTC · original

## Aperture+TEXTURE_NO_WAIT A/B (commit 37c3928, 2026-11-27, stopped ~4.6 min, no auto-input)

Same low-pressure base: Series S 960x540, budget16/tex16, LAZY=1 FILE=1 RELAY=0 RELAY_COPY=0 CARD_STEPS=0 JOIN_COPIES=0 INDIRECT_WINDOW=0 INDIRECT_BATCH=0 MAP_THREADS=0 WIDE_BACK=0 CARD_REHASH_RUNS=0 DRED=light PIPELINE_BOOK=1, shared pipeline lib, plus VICTORY_TEXTURE_NO_WAIT=1. Win11/RX 6950 XT/R5 3600/32GB/2688MB pagefile unchanged.

  • Early (~1 min): 10-11 fps, 87-102 ms/frame, texture hold-still 0.0 ms, copy-back 0 MB, dropped 0 without host pipeline (261->0 being made).
  • Degraded (~4.6 min): 0.2-0.4 fps, 2392-4049 ms/frame. Preparing 795-1687ms (copies 76-207ms/140-247MB, textures 648-1452ms/94-195MB, hold-still 0.0ms); GPU 134-287ms; copy-back 1451-2166ms/45-67MB; 1194-3520 draws/frame; dropped 476-1139 without host pipeline (0 being made). No device-removal/OOM markers in scanned tail.

Takeaway: TEXTURE_NO_WAIT removes remap hold-still but degradation remains dominated by copy-back, texture CPU work, and drops with 0 being made. Not a world-entry/FPS/stability proof. Investigating copy-back/pipeline-drop causes next; no new game run while user is on another game.

AI-assisted: OpenCode / opencode/big-pickle.

**@⁠Adika713** on GitHub · 2026-11-27 13:52 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/297#issuecomment-7220050260) ## Aperture+TEXTURE_NO_WAIT A/B (commit 37c3928, 2026-11-27, stopped ~4.6 min, no auto-input) Same low-pressure base: Series S 960x540, budget16/tex16, `LAZY=1 FILE=1 RELAY=0 RELAY_COPY=0 CARD_STEPS=0 JOIN_COPIES=0 INDIRECT_WINDOW=0 INDIRECT_BATCH=0 MAP_THREADS=0 WIDE_BACK=0 CARD_REHASH_RUNS=0 DRED=light PIPELINE_BOOK=1`, shared pipeline lib, plus `VICTORY_TEXTURE_NO_WAIT=1`. Win11/RX 6950 XT/R5 3600/32GB/2688MB pagefile unchanged. - Early (~1 min): 10-11 fps, 87-102 ms/frame, texture hold-still 0.0 ms, copy-back 0 MB, dropped 0 without host pipeline (261->0 being made). - Degraded (~4.6 min): 0.2-0.4 fps, 2392-4049 ms/frame. Preparing 795-1687ms (copies 76-207ms/140-247MB, textures 648-1452ms/94-195MB, hold-still 0.0ms); GPU 134-287ms; copy-back 1451-2166ms/45-67MB; 1194-3520 draws/frame; dropped 476-1139 without host pipeline (0 being made). No device-removal/OOM markers in scanned tail. Takeaway: `TEXTURE_NO_WAIT` removes remap hold-still but degradation remains dominated by copy-back, texture CPU work, and drops with 0 being made. Not a world-entry/FPS/stability proof. Investigating copy-back/pipeline-drop causes next; no new game run while user is on another game. AI-assisted: OpenCode / opencode/big-pickle.
The diagnostics test for late card-step learning shared process-global
late-learned pages with other tests. Clear the late page set in the
card_steps tests that assert initial unlearned state.

Fixes CI Diagnostics failure in
host::card_steps::tests::places_written_after_sending_are_learned.

AI-assisted: opencode/big-pickle
When wide_back find_all already proved a declared range has no differing
64KiB pieces, skip taking the snapshot lock and walking title memory in
copy_back_with. copy_back_done is still called by hand_back for declared
range bookkeeping.

Game-free validation: cargo test -p victory-gpu shadow -- --nocapture
(36 passed, 0 failed, 1 ignored).

AI-assisted: opencode/big-pickle
Use HostTexture::backing_bytes() for copy_state/census/targets_census so
levels-on-demand reserved textures report mapped tile bytes instead of
host.bytes=0. Prevents VRAM under-counting and eviction blind spots.

Port idea from LooperSalty/AnyXboxX#287 (Mauro Alvarez, GPL-3.0) via
zocram4cc/victory-linux-perf f9e8f84; adapted to PR297's backing_bytes().

Game-free validation: cargo test -p victory-gpu resource -- --nocapture
(17 passed, 0 failed, 0 ignored).

AI-assisted: opencode/big-pickle
Diagnostics-only: report pipeline drop reason as not queued/queued/being
made when a Pending has no made host pipeline yet. This separates missing
queue/start cases from in-flight compilation in frame logs.

Game-free validation:
  cargo test -p victory-gpu --features diagnostics pipeline::make -- --nocapture
  (7 passed, 0 failed, 0 ignored)

AI-assisted: opencode/big-pickle
Queue pipelines not on the early/warm list at creation time (bounded by
VICTORY_PIPELINE_EAGER, default 256) so workers can compile them before
first use. Requested draws still promote and wait as before.

Port idea from 11run11/VIctory PR #622 (XboxCompatibility T-0037,
GPL-3.0-or-later), adapted to PR297 make.rs structure.

Game-free validation: cargo test -p victory-gpu pipeline::make -- --nocapture
(7 passed, 0 failed, 0 ignored); cargo build -p victory pass.

AI-assisted: opencode/big-pickle
Include queued_at_creation (EAGER) in the " host pipelines all made\
log
When wide_back is enabled but all declared ranges are carded/empty, avoid
calling find_all and only complete copy_back_done bookkeeping.

Game-free validation:
  cargo test -p victory-gpu shadow -- --nocapture (pass, no failures)
  cargo build -p victory (pass)

AI-assisted: opencode/big-pickle
When the write watch reports a texture range written, hash the copied
bytes before detiling/upload prep. Skip detile when content is unchanged,
avoiding redundant work from spurious/coalesced write notifications.

Game-free validation:
  cargo test -p victory-gpu texture -- --nocapture (33 pass, 5 ignored)
  cargo build -p victory (pass)

AI-assisted: opencode/big-pickle
This pull request can be merged automatically.
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/297/head:github-bot/gh-297'
git switch 'github-bot/gh-297'

Merge

Merge the changes and update on Forgejo.
git switch 'rx9070xt'
git merge --no-ff 'github-bot/gh-297'
git switch 'github-bot/gh-297'
git rebase 'rx9070xt'
git switch 'rx9070xt'
git merge --ff-only 'github-bot/gh-297'
git switch 'github-bot/gh-297'
git rebase 'rx9070xt'
git switch 'rx9070xt'
git merge --no-ff 'github-bot/gh-297'
git switch 'rx9070xt'
git merge --squash 'github-bot/gh-297'
git switch 'rx9070xt'
git merge --ff-only 'github-bot/gh-297'
git switch 'rx9070xt'
git merge 'github-bot/gh-297'
git push origin 'rx9070xt'
This discussion has been locked. Commenting is limited to contributors.
No description provided.