GPU memory: split the copy admission from its allocation, and use the title's own backing where it can be opened #2538

Closed
github-bot wants to merge 0 commits from github-bot/gh-2538 into main AGit
Owner

@⁠CwWwWwW on GitHub · 2026-11-29 13:59 UTC · original
CwWwWwW:feat/gpu-memory-copy-bridges → main · +2040 −88 · 9 files · 3 commits · closed without merging

GPU memory: split the copy admission from its allocation, and use the title's own backing where it can be opened

This is the rebased successor of the closed #916, split into three commits as its closing comment
asked. The code was re-derived on the current main (829188e), not applied as the old diff: main had
already evolved the same memory code through other forks, and the parts this branch would have
duplicated (the by-address cap, the checked device-removal waits, the window/arena budget
separation) are kept from main and recorded as such in the docs.

What it fixes

  1. The placement of a copy was invisible. Whether a host copy got a device-local side or stayed
    in system memory was decided inside the allocation, and a refused copy left no trace. The first
    commit makes that decision explicit (card_admission / window_admission), counts every host
    buffer by the heap class the API reports, and counts the copies that stay in system memory by the
    reason they did. It also fixes an accounting defect: a window's second system-memory side was
    charged to the window device-local budget.
  2. Some copies are redundant because the GPU can reach the title's bytes. When the policy refuses
    a device-local side, the copy stays in system memory either way; opening the title's own backing
    (private allocation, or one run of one section through our own view) and placing the buffer
    there removes the mirror and all its machinery. This is the second commit, behind switches that
    are off by default, with the existing copy path as the fallback for every refusal. It never
    replaces a copy that would have been device-local (that would be a memory-class downgrade).
  3. Coherence and lifetime for the direct path. A placed copy's shader writes are declared so the
    late waits order CPU readers behind the flight; the title's free/decommit/protect and the raw
    32-bit free path let placed copies go before the kernel call; a mapping change lets go of
    exactly the copies over the range through an exact registry; a section view keeps the section's
    pages alive after the title unmaps its own view.
  4. The record of what remains. The third commit documents the copy-bridge inventory and
    classification, what this work removed, the copies that are required and why, the unresolved
    classes, and what only a real NVIDIA run can establish.

The three commits

  1. c9887c4b GPU memory: split the copy admission from its allocation and add the placement
    ledger
    — 3 files, +526/-7. shadow::card_admission/window_admission; the placement ledger
    in residency (HeapClass/class_of from GetHeapProperties, Fallback reasons,
    fallback_add/fallback_freed, placement_line every 5 s or with
    VICTORY_MEMORY_REPORT); host.rs counts every buffer made; the window second-side budget
    fix; say_separation_switches; tests for the decisions, the heap classes and the counter
    balance.
  2. 53094eba GPU memory: use the title's own backing where it can be opened — 6 files,
    +973/-83. inplace::openability, refcounted SectionView, shared regions per section run
    (REGION_MOST 512 MiB), place_view_part, place_fallback with VICTORY_INPLACE_VIEW=1/2
    and VICTORY_INPLACE=3; shadow places only where admission refused, keeps placed copies in
    the exact registry, declares their shader writes, and gives no placed copy a staging/mirror/card
    side/refresh/snapshot/compare/copy-back; xmem intercepts VirtualProtect unconditionally and
    the raw 32-bit XMemFreeDefault path lets placed copies go first; port uses the shared
    SectionView; the ledger counts directly backed copies and refused direct asks; WARP tests for
    the placement mechanics, the section lifetime, the shared region, the exact invalidation and the
    counters.
  3. 56dd8d81 GPU memory: record the audit of the memory split and the copy bridges — the three
    docs: the platform model, the heap classes, ownership, admission, the ledger and how to read it,
    the window budget and the exception matrix, the copy inventory and classification, the
    implementation records, the copies that remain, the follow-ups and the verification record.

What does not change

  • Every direct-access switch is off by default (VICTORY_INPLACE, VICTORY_INPLACE_VIEW,
    VICTORY_INPLACE_MB, VICTORY_INPLACE_PROBE); with them unset the product path behaves as at
    829188e - no policy, threshold, budget, launcher default or rendering change.
  • Required copies stay: carded VRAM sides, by-address shader memory, textures/targets for
    layout/format/depth reasons, read-backs and the D3D12 infrastructure.
  • No new dependency; the workspace lockfile is untouched.

Validation

Local (Windows, Rust 1.98.1 x86_64-pc-windows-gnu):

Check Result
cargo check --workspace --all-targets --locked PASS after each commit
cargo check --workspace --all-targets --all-features --locked fails identically at plain 829188e (diagnostics feature: copystat's mb, a timing local shadowing the function) - inherited, not caused by this branch
warnings in changed files none

GitHub Actions (Windows/WARP), from a temporary ci/** branch of the fork (test workflow only,
not part of this branch; the branch itself is feat/gpu-memory-rebased):

Run Result
Build check, default features PASS
Build check, all features fails at 829188e too (inherited)
Tests (workspace, every test target), this branch 924 passed, 0 failed, 57 ignored for the victory-gpu lib (914 passed on the baseline); the focused in-place tests 15/15 PASS; every other test target passes; the only failures are the nine the baseline has too
Tests (workspace, every test target), 829188e baseline the same nine inherited failures (three bcpack::oracle_parity_*, five emit tests, xtask's asset-policy repository_passes_policy); victory-gpu lib 914 passed, 1 failed (a flaky card-steps test)

The branch adds ten passing tests to the victory-gpu lib (924 against 914) and introduces no
failure: the nine failures are identical on plain 829188e with the same workflow, in files this
change does not touch. The tested source tip is 53094eba; the third commit (docs only) was amended
after the run, so the source is unchanged after it.

What must be established on real NVIDIA hardware

Nothing here claims the direct path is ready to be a default: WARP proves the mechanics, not the
driver or the hardware. Before any switch becomes a default:

  • that OpenExistingHeapFromAddress1 is accepted by the target driver for private allocations and
    for our section views, what it pins and at what working-set cost;
  • the openable share of the real title's memory (the in-place census, VICTORY_INPLACE_PROBE=1);
  • that a placed copy's shader writes are ordered correctly under the real relay and late waits;
  • the PCIe cost of access in place against the copies it replaces, per class, plus physical
    residency/WDDM paging and device-removal/TDR behaviour.

Note on #916

This is the rebased successor of the closed #916: the same memory work, re-derived on the current
main and split into three commits as its closing comment asked, so it can be reviewed commit by
commit.

Follow-ups

  • View-byte copies (shadow::exact) over openable backing: needs the exact pool to hold a placed
    form.
  • Multi-run composition for scattered/holed view memory (needs a driver experiment).
  • A layout census and probe for the layout-equal texture subset.
  • A device-local by-address arena, or a documented reason it cannot exist.
  • Delete the experiment switches once a hardware A/B shows the direct path equal or better wherever
    the memory is openable.
**@⁠CwWwWwW** on GitHub · 2026-11-29 13:59 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2538) `CwWwWwW:feat/gpu-memory-copy-bridges` → `main` · +2040 −88 · 9 files · 3 commits · closed without merging # GPU memory: split the copy admission from its allocation, and use the title's own backing where it can be opened This is the rebased successor of the closed #916, split into three commits as its closing comment asked. The code was re-derived on the current main (829188e), not applied as the old diff: main had already evolved the same memory code through other forks, and the parts this branch would have duplicated (the by-address cap, the checked device-removal waits, the window/arena budget separation) are kept from main and recorded as such in the docs. ## What it fixes 1. **The placement of a copy was invisible.** Whether a host copy got a device-local side or stayed in system memory was decided inside the allocation, and a refused copy left no trace. The first commit makes that decision explicit (`card_admission` / `window_admission`), counts every host buffer by the heap class the API reports, and counts the copies that stay in system memory by the reason they did. It also fixes an accounting defect: a window's second *system-memory* side was charged to the window *device-local* budget. 2. **Some copies are redundant because the GPU can reach the title's bytes.** When the policy refuses a device-local side, the copy stays in system memory either way; opening the title's own backing (private allocation, or one run of one section through our own view) and placing the buffer there removes the mirror and all its machinery. This is the second commit, behind switches that are off by default, with the existing copy path as the fallback for every refusal. It never replaces a copy that would have been device-local (that would be a memory-class downgrade). 3. **Coherence and lifetime for the direct path.** A placed copy's shader writes are declared so the late waits order CPU readers behind the flight; the title's free/decommit/protect and the raw 32-bit free path let placed copies go before the kernel call; a mapping change lets go of exactly the copies over the range through an exact registry; a section view keeps the section's pages alive after the title unmaps its own view. 4. **The record of what remains.** The third commit documents the copy-bridge inventory and classification, what this work removed, the copies that are required and why, the unresolved classes, and what only a real NVIDIA run can establish. ## The three commits 1. **`c9887c4b` GPU memory: split the copy admission from its allocation and add the placement ledger** — 3 files, +526/-7. `shadow::card_admission`/`window_admission`; the placement ledger in `residency` (`HeapClass`/`class_of` from `GetHeapProperties`, `Fallback` reasons, `fallback_add`/`fallback_freed`, `placement_line` every 5 s or with `VICTORY_MEMORY_REPORT`); `host.rs` counts every buffer made; the window second-side budget fix; `say_separation_switches`; tests for the decisions, the heap classes and the counter balance. 2. **`53094eba` GPU memory: use the title's own backing where it can be opened** — 6 files, +973/-83. `inplace::openability`, refcounted `SectionView`, shared regions per section run (`REGION_MOST` 512 MiB), `place_view_part`, `place_fallback` with `VICTORY_INPLACE_VIEW=1/2` and `VICTORY_INPLACE=3`; `shadow` places only where admission refused, keeps placed copies in the exact registry, declares their shader writes, and gives no placed copy a staging/mirror/card side/refresh/snapshot/compare/copy-back; `xmem` intercepts `VirtualProtect` unconditionally and the raw 32-bit `XMemFreeDefault` path lets placed copies go first; `port` uses the shared `SectionView`; the ledger counts directly backed copies and refused direct asks; WARP tests for the placement mechanics, the section lifetime, the shared region, the exact invalidation and the counters. 3. **`56dd8d81` GPU memory: record the audit of the memory split and the copy bridges** — the three docs: the platform model, the heap classes, ownership, admission, the ledger and how to read it, the window budget and the exception matrix, the copy inventory and classification, the implementation records, the copies that remain, the follow-ups and the verification record. ## What does not change - Every direct-access switch is off by default (`VICTORY_INPLACE`, `VICTORY_INPLACE_VIEW`, `VICTORY_INPLACE_MB`, `VICTORY_INPLACE_PROBE`); with them unset the product path behaves as at `829188e` - no policy, threshold, budget, launcher default or rendering change. - Required copies stay: carded VRAM sides, by-address shader memory, textures/targets for layout/format/depth reasons, read-backs and the D3D12 infrastructure. - No new dependency; the workspace lockfile is untouched. ## Validation Local (Windows, Rust 1.98.1 x86_64-pc-windows-gnu): | Check | Result | |---|---| | `cargo check --workspace --all-targets --locked` | **PASS** after each commit | | `cargo check --workspace --all-targets --all-features --locked` | fails identically at plain `829188e` (diagnostics feature: `copystat`'s `mb`, a `timing` local shadowing the function) - **inherited**, not caused by this branch | | warnings in changed files | none | GitHub Actions (Windows/WARP), from a temporary `ci/**` branch of the fork (test workflow only, not part of this branch; the branch itself is `feat/gpu-memory-rebased`): | Run | Result | |---|---| | Build check, default features | **PASS** | | Build check, all features | fails at `829188e` too (inherited) | | Tests (workspace, every test target), this branch | **924 passed, 0 failed, 57 ignored** for the `victory-gpu` lib (914 passed on the baseline); the focused in-place tests 15/15 PASS; every other test target passes; the only failures are the nine the baseline has too | | Tests (workspace, every test target), `829188e` baseline | the same nine inherited failures (three `bcpack::oracle_parity_*`, five `emit` tests, `xtask`'s asset-policy `repository_passes_policy`); `victory-gpu` lib 914 passed, 1 failed (a flaky card-steps test) | The branch adds ten passing tests to the `victory-gpu` lib (924 against 914) and introduces no failure: the nine failures are identical on plain `829188e` with the same workflow, in files this change does not touch. The tested source tip is `53094eba`; the third commit (docs only) was amended after the run, so the source is unchanged after it. - branch run: https://github.com/CwWwWwW/VIctory-NVIDIA/actions/runs/46269247875 - baseline run: https://github.com/CwWwWwW/VIctory-NVIDIA/actions/runs/46267700603 ## What must be established on real NVIDIA hardware Nothing here claims the direct path is ready to be a default: WARP proves the mechanics, not the driver or the hardware. Before any switch becomes a default: - that `OpenExistingHeapFromAddress1` is accepted by the target driver for private allocations and for our section views, what it pins and at what working-set cost; - the openable share of the real title's memory (the in-place census, `VICTORY_INPLACE_PROBE=1`); - that a placed copy's shader writes are ordered correctly under the real relay and late waits; - the PCIe cost of access in place against the copies it replaces, per class, plus physical residency/WDDM paging and device-removal/TDR behaviour. ## Note on #916 This is the rebased successor of the closed #916: the same memory work, re-derived on the current main and split into three commits as its closing comment asked, so it can be reviewed commit by commit. ## Follow-ups - View-byte copies (`shadow::exact`) over openable backing: needs the exact pool to hold a placed form. - Multi-run composition for scattered/holed view memory (needs a driver experiment). - A layout census and probe for the layout-equal texture subset. - A device-local by-address arena, or a documented reason it cannot exist. - Delete the experiment switches once a hardware A/B shows the direct path equal or better wherever the memory is openable.
The layer's host copies are either given a device-local side in the card's memory or
left in system memory, and the decision was made inside the allocation (card_for /
window_card_for): a copy that got no card side was never counted, and the log said
nothing about where the copies went. This makes the decision explicit and records it.

- shadow::card_admission / window_admission: exactly the checks card_for /
  window_card_for make (the cards switch, the size limits, the host's readiness, the
  DXGI budget line, the path's own byte cap), before any buffer is allocated.
  card_for and window_card_for keep deciding as before; the copies that get no
  device-local side are recorded in the new placement ledger together with why.
- residency: the placement ledger. HeapClass and class_of ask the API what heap class
  it reports for every host buffer made (ID3D12Resource::GetHeapProperties); Fallback
  names why a copy stayed in system memory; fallback_add / fallback_freed count the
  live and total bytes by reason; placement_line prints it every 5 seconds while a
  fallback copy is alive, or when VICTORY_MEMORY_REPORT is set. host.rs counts every
  buffer the copy and transfer machinery makes.
- The windows' second side (VICTORY_WINDOWS_OWN) is system memory: it is no longer
  charged to the window device-local budget, and is counted in the placement ledger
  instead (the window-budget finding of the separation audit). Only a device-local
  window side is charged and given back.
- host::say_separation_switches names the separation-relevant switches in force at
  startup and warns for the combinations the code documents as unsupported or as
  placement weakening; the two inherited CI conditions are unchanged.
- tests: heap classes come from the API's heap properties, the MB figures of the
  line, and the fallback counter balance.

No allocation policy, admission threshold, budget, switch default or rendering
behaviour changes: with the direct switches off the product path behaves as at
829188e.
The copies the memory policy refuses a device-local side are the ones that stay in
system memory; for them the GPU already reads and writes RAM over the bus, so it can
read and write the title's own bytes instead of a copy of them. This adds that path,
off by default, and keeps the copy as the fallback.

- inplace: openability says whether a title range can be opened as a host heap:
  private memory committed whole, or one contiguous run of one section (through our
  own view of the run); scattered, holed or uncommitted memory is refused with a
  reason. A refcounted SectionView owns each run's mapping; one view and one heap are
  shared per run (REGIONS), and the view keeps the section's pages alive after the
  title unmaps its own view and closes its handle. place_view_part and place_fallback
  implement the migration policy: page-pool view memory first (VICTORY_INPLACE_VIEW=1
  windows, =2 title buffers), then private memory (VICTORY_INPLACE=3), and only where
  the admission already refused a device-local side; the mirror stays the fallback and
  every refusal is counted with its reason in the placement ledger. The in-place byte
  cap stays VICTORY_INPLACE_MB (default 4096).
- shadow: lookup and loose ask place_fallback exactly where card_admission /
  window_admission refused. A placed copy makes no staging or mirror, no card side, no
  hash twin, no send/fetch state, no refresh, snapshot, compare or copy-back. Placed
  copies are kept in an exact registry, so a mapping change lets go of exactly the
  copies over the range instead of a bounded scan missing some.
- shadow::gpu_writes: a placed copy's shader writes are declared to the copy machinery
  (defer_gpu_write), so the late waits order a CPU reader of those title bytes behind
  the flight that may write them; the copy knows it was written.
- host: the startup report names the view switches and says the placed writes are
  declared; the in-place notes are unchanged for the legacy levels.
- xmem: the title's VirtualProtect is intercepted unconditionally, and
  XMemFreeDefault's raw VirtualFree for the title's 32-bit allocations lets placed
  copies go before the kernel releases the pages. watch already calls
  inplace::title_memory_freeing before the title's own free/decommit/release.
- port: its own mapping becomes a user of the shared SectionView (one owner, one
  lifetime); a section close forgets its regions.
- residency: directly backed copies and refused direct asks are counted in the
  placement ledger (bytes, windows vs title buffers, and each refusal reason).
- tests: the placement mechanics and policy on the software adapter (WARP): data both
  ways across title views, a reprotected and unmapped title view under the heap, the
  section lifetime after the title lets go, the shared region and its forget, the exact
  invalidation among many copies, and the direct-backing counters.

No allocation policy, admission threshold, budget, switch default or rendering
behaviour changes with the switches off: the product path behaves as at 829188e.
The previous two commits change where copies live and where they are made; this one writes
down what they were measured against, what they removed, and what a real-hardware run still
has to establish.

- docs/memory-separation.md: the platform model (console unified memory vs the host's two
  domains), the heap classes as the API reports them, ownership rules, how a copy is admitted
  (card_admission / window_admission and the budget lines), the placement ledger and how to
  read it, the direct-access path and its switches, the transfer and synchronisation
  contract, what main already fixes from other forks and what this work adds, and what only
  an NVIDIA run can establish.
- docs/memory-separation-window-budget.md: the window device-local budget (window_card_most,
  window_line, card_copy_fits, WINDOW_CARD_BYTES), what is charged to it - a second
  system-memory side is not (fixed here) - the by-address arena budget separation, the
  exception matrix, what the ledger shows for windows, and the hardware-only questions.
- docs/copy-bridges.md: the inventory and classification of every copy bridge: title buffers,
  windows, view-byte copies, by-address arenas, textures, targets/depth/read-backs, D3D12
  infrastructure, the title's own CPU steps and the experiment switches; the direct-access
  mechanism implemented in the previous commit (openability, SectionView, shared regions,
  place_fallback, declared placed writes, lifetime hooks, the switches); the copies that
  remain and why; the follow-ups; what a hardware run must establish; the verification
  record.

No source change: documentation only.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 14:01:24 +00:00
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-29 20:07 UTC · original

The placement line never prints: its 5-second timer is reset on every check.

READ IN CODE (PR head 56dd8d81, host.rs around line 13888): Meter::frame reaches the placement block about once a second (after frame_times_line). The block does

let last = LAST_PLACEMENT.swap(now, Ordering::Relaxed);
if now.saturating_sub(last) >= 5_000 {

so now is stored on every call and the gap is never more than about 1,000 ms. The first check doesn't print either: now_ms() starts its clock at its first call, so now is near 0 there. The result is no memory placement line, with VICTORY_MEMORY_REPORT=1 or without it.

A fix that prints at the first check and then every 5 s:

let last = LAST_PLACEMENT.load(Ordering::Relaxed);
if last == 0 || now.saturating_sub(last) >= 5_000 {
    LAST_PLACEMENT.store(now.max(1), Ordering::Relaxed);
    crate::residency::placement_line(host().and_then(Host::video_memory_groups));
}

MEASURED: with VICTORY_MEMORY_REPORT=1, a 6.4-min session printed 0 memory placement lines (the startup memory separation: placement switches set: ... VICTORY_MEMORY_REPORT=1 line shows the switch was seen). With the fix, a 7.0-min session printed 86 lines, a 17-min one 194.

What the ledger then showed (MEASURED, one run each, not the same route, so read it as direction, not effect size):

Run Windows' line / cap Hitches > 100 ms Texture-room lines with no room Copies with a system-memory GPU side, at the end VRAM peak (DXGI local)
7.0 min 80 % / 1024 MB (this tree's defaults) 32.6/min 78 of 85 3,268 MB: budget 1,812, cap 1,456 13,187 of 14,823 MB
17.0 min 89 % / 1024 MB 9.5/min 68 of 194 2,368 MB: budget 240, cap 2,128 13,306 of 14,798 MB
19.7 min 89 % / 2048 MB 27.0/min 148 of 227 2,989 MB: budget 2,597, cap 392 14,449 of 14,831 MB
  • The budget refusals are windows. The title-buffer path logs every refusal (no card copy for a title buffer), and there are none in the first two runs. The 2048 MB run has 21, totalling 6 MB, all near the end with the card at 14,405 of 14,826 MB.
  • The cap is the windows' 1,024 MB. Title-buffer card copies made in the 17-min run sum to about 1,005 MB of their 2,048 MB cap (from the a buffer's host copy is in the card's memory lines).
  • 89 % (main's value for budgets over 12 GiB) moved the windows' budget refusals onto the cap. Raising the cap to 2048 MB moved them back onto the budget and pushed VRAM to 97 %, and texture no-room went up. On this card the room is shared, so it doesn't add up to a free win.

Method

  • Build: not the PR head. I ported the measuring part of c9887c4b by hand onto an older tree: fork main 9300875 plus local picks (#339, #348, #638, #1074/#1145, #1551, main's 25b3b5c) and a 3619 port. The port takes residency's ledger verbatim, plus placed(), the meter block, say_separation_switches, and card_admission/window_admission written against that tree's card_room_for/window_room_for. It leaves out the VICTORY_WINDOWS_OWN budget change and commits 2–3. The timer code above is the same in the port and at the PR head. The 80 %/89 % line is a local switch (VICTORY_CARD_WINDOWS_PERCENT), and the cap is the existing VICTORY_CARD_WINDOWS_MB.
  • Numbers: the memory placement lines (last line, and peaks per minute), the texture queue's room lines (count of no room), and frame_times windows with a median over 20 ms (in the world; frames are the game's before frame generation, with a 71.4 ms pacing cap). Hitches are the windows' over 100 ms counts per minute in the world.
  • Settings: 4K output, DLSS Performance, frame generation 4x, launcher mode 6.
  • Hardware: RTX 5070 Ti 16 GB, driver 621.40; Ryzen 7 9800X3D; 32 GB RAM; Windows 11 Home 26300.
  • Not tested: the PR head itself, its in-place switches (commit 2), other cards.

Written with Claude Code (Claude Opus 5.5) from our own runs; I checked it before posting.

**@⁠futurepro62** on GitHub · 2026-11-29 20:07 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2538#issuecomment-7261825574) **The placement line never prints: its 5-second timer is reset on every check.** READ IN CODE (PR head `56dd8d81`, `host.rs` around line 13888): `Meter::frame` reaches the placement block about once a second (after `frame_times_line`). The block does ```rust let last = LAST_PLACEMENT.swap(now, Ordering::Relaxed); if now.saturating_sub(last) >= 5_000 { ``` so `now` is stored on every call and the gap is never more than about 1,000 ms. The first check doesn't print either: `now_ms()` starts its clock at its first call, so `now` is near 0 there. The result is no `memory placement` line, with `VICTORY_MEMORY_REPORT=1` or without it. A fix that prints at the first check and then every 5 s: ```rust let last = LAST_PLACEMENT.load(Ordering::Relaxed); if last == 0 || now.saturating_sub(last) >= 5_000 { LAST_PLACEMENT.store(now.max(1), Ordering::Relaxed); crate::residency::placement_line(host().and_then(Host::video_memory_groups)); } ``` MEASURED: with `VICTORY_MEMORY_REPORT=1`, a 6.4-min session printed 0 `memory placement` lines (the startup `memory separation: placement switches set: ... VICTORY_MEMORY_REPORT=1` line shows the switch was seen). With the fix, a 7.0-min session printed 86 lines, a 17-min one 194. **What the ledger then showed** (MEASURED, one run each, not the same route, so read it as direction, not effect size): | Run | Windows' line / cap | Hitches > 100 ms | Texture-room lines with no room | Copies with a system-memory GPU side, at the end | VRAM peak (DXGI local) | |---|---|---|---|---|---| | 7.0 min | 80 % / 1024 MB (this tree's defaults) | 32.6/min | 78 of 85 | 3,268 MB: budget 1,812, cap 1,456 | 13,187 of 14,823 MB | | 17.0 min | 89 % / 1024 MB | 9.5/min | 68 of 194 | 2,368 MB: budget 240, cap 2,128 | 13,306 of 14,798 MB | | 19.7 min | 89 % / 2048 MB | 27.0/min | 148 of 227 | 2,989 MB: budget 2,597, cap 392 | 14,449 of 14,831 MB | - The budget refusals are windows. The title-buffer path logs every refusal (`no card copy for a title buffer`), and there are none in the first two runs. The 2048 MB run has 21, totalling 6 MB, all near the end with the card at 14,405 of 14,826 MB. - The cap is the windows' 1,024 MB. Title-buffer card copies made in the 17-min run sum to about 1,005 MB of their 2,048 MB cap (from the `a buffer's host copy is in the card's memory` lines). - 89 % (main's value for budgets over 12 GiB) moved the windows' budget refusals onto the cap. Raising the cap to 2048 MB moved them back onto the budget and pushed VRAM to 97 %, and texture no-room went up. On this card the room is shared, so it doesn't add up to a free win. **Method** - Build: not the PR head. I ported the measuring part of `c9887c4b` by hand onto an older tree: fork main `9300875` plus local picks (#339, #348, #638, #1074/#1145, #1551, main's `25b3b5c`) and a 3619 port. The port takes residency's ledger verbatim, plus `placed()`, the meter block, `say_separation_switches`, and `card_admission`/`window_admission` written against that tree's `card_room_for`/`window_room_for`. It leaves out the `VICTORY_WINDOWS_OWN` budget change and commits 2–3. The timer code above is the same in the port and at the PR head. The 80 %/89 % line is a local switch (`VICTORY_CARD_WINDOWS_PERCENT`), and the cap is the existing `VICTORY_CARD_WINDOWS_MB`. - Numbers: the `memory placement` lines (last line, and peaks per minute), the `texture queue's room` lines (count of `no room`), and `frame_times` windows with a median over 20 ms (in the world; frames are the game's before frame generation, with a 71.4 ms pacing cap). Hitches are the windows' `over 100 ms` counts per minute in the world. - Settings: 4K output, DLSS Performance, frame generation 4x, launcher mode 6. - Hardware: RTX 5070 Ti 16 GB, driver 621.40; Ryzen 7 9800X3D; 32 GB RAM; Windows 11 Home 26300. - Not tested: the PR head itself, its in-place switches (commit 2), other cards. Written with Claude Code (Claude Opus 5.5) from our own runs; I checked it before posting.
github-bot closed this pull request 2026-11-30 08:28:27 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!2538
No description provided.