Snapshot for Shadow : writing is committed at the full copy length (256 MiB for a 1 MiB range) #4521

Open
opened 2026-11-30 21:51:40 +00:00 by github-bot · 3 comments
Owner

@⁠Kerimrode on GitHub · 2026-11-30 21:48 UTC · original

While reading shadow.rs I measured what declaring a range with Shadow::writing costs a big copy. Reproducible without a title or a card (test in my PR from Kerimrode:measure-snapshot-commit):

cargo test -p victory-gpu --lib snapshot_commit -- --ignored --nocapture --test-threads=1

Windows 11, debug build, defaults (wide_back: true, relay: false), 256 MiB copy, 1 MiB declared:

first range:  working set +0.5 MiB, committed +256.8 MiB
second range: working set +0.0 MiB, committed +0.0 MiB

writing takes its snapshot from pooled(total), with total the length of the whole copy, so the commit charge is the copy's size while almost none of it is resident. docs/windows-memory.md reports system commit, not physical RAM, as the limit that ends the process, so this may be a part of it.

What I do not know: how big the declared ranges are against their copies in a real title, and how much the snapshot pool's reuse softens it. I have no title to run, so I cannot say whether this matters in practice.

Could someone with a run check it? For example the sum of pooled capacities against the sum of declared bytes over a scene load. If that ratio is large, snapshots sized to the declared ranges (or committed per 64 KiB piece) might lower the commit peak. If it is near 1, nothing to do here.

I am happy to add a counter for that ratio to the memory line if that would help, many thanks

**@⁠Kerimrode** on GitHub · 2026-11-30 21:48 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/4520) While reading `shadow.rs` I measured what declaring a range with `Shadow::writing` costs a big copy. Reproducible without a title or a card (test in my PR from Kerimrode:measure-snapshot-commit): cargo test -p victory-gpu --lib snapshot_commit -- --ignored --nocapture --test-threads=1 Windows 11, debug build, defaults (wide_back: true, relay: false), 256 MiB copy, 1 MiB declared: first range: working set +0.5 MiB, committed +256.8 MiB second range: working set +0.0 MiB, committed +0.0 MiB `writing` takes its snapshot from `pooled(total)`, with `total` the length of the whole copy, so the commit charge is the copy's size while almost none of it is resident. docs/windows-memory.md reports system commit, not physical RAM, as the limit that ends the process, so this may be a part of it. What I do not know: how big the declared ranges are against their copies in a real title, and how much the snapshot pool's reuse softens it. I have no title to run, so I cannot say whether this matters in practice. Could someone with a run check it? For example the sum of `pooled` capacities against the sum of declared bytes over a scene load. If that ratio is large, snapshots sized to the declared ranges (or committed per 64 KiB piece) might lower the commit peak. If it is near 1, nothing to do here. I am happy to add a counter for that ratio to the memory line if that would help, many thanks
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 21:51:40 +00:00
Author
Owner

@⁠github-actions[bot] on GitHub · 2026-11-30 21:49 UTC · original

Please attach both logs from the run that went wrong. Without them we can only guess. Paste %LOCALAPPDATA% into the address bar of File Explorer to get there.

  1. The play log, in %LOCALAPPDATA%\victory\logs\: the newest victory-nvidia-play-<date>-<time>-<number>.log (from victory.exe) or victory-nvidia-<date>-<time>.log (from the script launcher). The window shows its path at the start, on the line Log: ....
  2. The crash log: %LOCALAPPDATA%\VIctory\data\7952987A\crashes.log, and, if there is one from that run, the newest victory-<date>-<time>-<number>.crash.log in %LOCALAPPDATA%\VIctory\data\7952987A\temp\.

Also say which GPU, Windows version (10 or 11)

**@⁠github-actions[bot]** on GitHub · 2026-11-30 21:49 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/4520#issuecomment-7292940392) Please attach both logs from the run that went wrong. Without them we can only guess. Paste `%LOCALAPPDATA%` into the address bar of File Explorer to get there. 1. The play log, in `%LOCALAPPDATA%\victory\logs\`: the newest `victory-nvidia-play-<date>-<time>-<number>.log` (from `victory.exe`) or `victory-nvidia-<date>-<time>.log` (from the script launcher). The window shows its path at the start, on the line `Log: ...`. 2. The crash log: `%LOCALAPPDATA%\VIctory\data\7952987A\crashes.log`, and, if there is one from that run, the newest `victory-<date>-<time>-<number>.crash.log` in `%LOCALAPPDATA%\VIctory\data\7952987A\temp\`. Also say which GPU, Windows version (10 or 11)
Author
Owner

@⁠Kerimrode on GitHub · 2026-11-30 21:50 UTC · original

This is not a crash report, so there are no play or crash logs: I have no title to run. The evidence is the reproducible measurement above, which needs no game, card or logs (the ignored test in #4515). The label needs-logs can be ignored here, or removed.

**@⁠Kerimrode** on GitHub · 2026-11-30 21:50 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/4520#issuecomment-7292984211) This is not a crash report, so there are no play or crash logs: I have no title to run. The evidence is the reproducible measurement above, which needs no game, card or logs (the ignored test in #4515). The label `needs-logs` can be ignored here, or removed.
Author
Owner

@⁠Raesdf on GitHub · 2026-12-01 11:02 UTC · original · edited 2026-12-01 12:25 UTC

m taking this one — I'll start by reproducing the measurement from #4515 on Windows, then look at sizing the snapshot to the declared ranges. I'll mention #4515 in the PR's Overlap section
EDIT : Reproduced on Windows 11: 256 MiB copy, 1 MiB declared per range — first range committed +256.8 MiB, working set +0.5 MiB; second range +0.0/+0.0 (test from #4515, cherry-picked onto current main). Confirms the snapshot is committed at the full copy length. Now looking at the fix.

**@⁠Raesdf** on GitHub · 2026-12-01 11:02 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/4520#issuecomment-7309083771) · edited 2026-12-01 12:25 UTC m taking this one — I'll start by reproducing the measurement from #4515 on Windows, then look at sizing the snapshot to the declared ranges. I'll mention #4515 in the PR's Overlap section EDIT : Reproduced on Windows 11: 256 MiB copy, 1 MiB declared per range — first range committed +256.8 MiB, working set +0.5 MiB; second range +0.0/+0.0 (test from #4515, cherry-picked onto current main). Confirms the snapshot is committed at the full copy length. Now looking at the fix.
This discussion has been locked. Commenting is limited to contributors.
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#4521
No description provided.