play: keep hand-set memory switches instead of clearing them #4014

Open
jeboy-nono wants to merge 1 commit from upstream-pr/4014 into main
jeboy-nono commented 2026-11-30 14:40:08 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by jeboy-nono on 2026-11-30T14:40:08Z.


Problem

prepare() clears every ambient VICTORY_* variable that is not in KEPT
before it applies the start's own settings (apps/victory/src/play.rs,
"every other VICTORY_... variable is cleared before the settings are put
in"). The card-memory knobs were not in KEPT, so values set in a launcher
script never reached the layer:

rem play-xss.cmd
set VICTORY_VRAM_BUDGET_MB=6000
set VICTORY_ROOM_REAL=1
set VICTORY_TEXTURE_ROOM_PERCENT=70

The play log of that start (2026-11-29T23:07:42Z) had no
VICTORY_TEXTURE_ROOM_PERCENT in its switch line, and the room line used
the 90 % default:

the texture queue's room: ... against a line of 5400 MB
  (90.0 % of a budget of 6000 MB; ...): no room, new textures wait

That run climbed from ~6.2 GB to 8,546 MB on an 8 GB RTX 5060 in 18 minutes
and ended in 0x8007000E (no upload buffer).

Change

Add the memory/room switches to KEPT, next to the other hand-set values.
A settings file or --more still overrides them, because those are applied
to the settings map after the ambient values are kept.

    "VICTORY_VRAM_BUDGET_MB",
    "VICTORY_TEXTURE_ROOM_PERCENT",
    "VICTORY_ROOM_REAL",
    "VICTORY_FACE_HEADROOM_MB",
    "VICTORY_CARD_ROOM_FOR_TARGETS_MB",
    "VICTORY_TEXTURE_BUDGET_MB",
    "VICTORY_TEXTURE_SOFT_MB",

Test

RTX 5060 8 GB, Series S profile, 720p internal / 1080p output, DLSS
Quality, play-xss.cmd as above (budget 6000, line 70 %, ROOM_REAL=1).

The switch now reaches the layer:

2026-11-30T13:55:12Z ... the texture queue's room: 1245 MB in use - ...
  against a line of 4200 MB (70.0 % of a budget of 6000 MB; ...)

Curve (end-of-minute used and texture copies from the room line):

t (min) before: used before: copies after: used after: copies
0 1175 290 5879* 1931*
3 6302 2813 6736 2361
6 6648 3003 7211 2805
9 6898 3116 7547 3129
12 7359 3360 7684 3235
15 7602 3562 7800 3336
18 8546 → OOM 3687 7884 3447
21 — — 7997 3554
24 — — 8134 3697
26 — — 8151, still rendering 3698

* the first minute of the "after" log is after the world's first frame, so
its t=0 is not the same point in the load as the "before" log's.

The "before" run reached 8,546 MB and failed with 0x8007000E at 18 min.
The "after" run plateaued at ~8,150 MB, kept rendering (15–20 fps) past
26 min, and produced no new 0x8007000E. One optional compute pipeline
fails at load with the same key and 0x8007000E in both runs; it is
independent of this change.

Honest limit of the measurement: the texture peak is the same in both runs
(~3.7 GB). The line controls how early admission stops, not the final
working set, and the non-texture footprint differed between the two runs.
So this is a switch-plumbing fix with a bounded peak in this test, not a
demonstration that the budget caps the process.

What this does not do

The budget is a ceiling on the texture queue's line, not a hard cap on the
process. On this title/card the non-texture footprint is ~4.4 GB (render
targets ~1.8 GB, card copies of title buffers ~0.8 GB, other/driver
~1.8 GB) and the texture working set is ~3.7 GB, so ~8.1 GB is the floor.
A 6,000 MB hard cap would require ~2 GB of textures to be absent.

We deliberately do not reach it by evicting textures that index slots show.
An experiment that trusted VICTORY_SAMPLED_EVICT at the budget evicted the
player's skin and left it white: the evicted copies then became first
uploads, and first_upload_decision refused them at the whole-card budget
(1,439 refusals in 5 s in that run), so they never came back. That
experiment is not part of this patch.

GPL

No derived code is added. The rejected experiment referenced the memory
stack by skornuta (skornuta/victory-memory-stack, 57fb136,
GPL-3.0-or-later); it is not in this diff.

🤖 Generated with Claude Code

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5567432576 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4014). Originally posted by [jeboy-nono](https://github.com/jeboy-nono) on 2026-11-30T14:40:08Z. --- ## Problem `prepare()` clears every ambient `VICTORY_*` variable that is not in `KEPT` before it applies the start's own settings (`apps/victory/src/play.rs`, "every other `VICTORY_...` variable is cleared before the settings are put in"). The card-memory knobs were not in `KEPT`, so values set in a launcher script never reached the layer: ``` rem play-xss.cmd set VICTORY_VRAM_BUDGET_MB=6000 set VICTORY_ROOM_REAL=1 set VICTORY_TEXTURE_ROOM_PERCENT=70 ``` The play log of that start (`2026-11-29T23:07:42Z`) had no `VICTORY_TEXTURE_ROOM_PERCENT` in its switch line, and the room line used the 90 % default: ``` the texture queue's room: ... against a line of 5400 MB (90.0 % of a budget of 6000 MB; ...): no room, new textures wait ``` That run climbed from ~6.2 GB to 8,546 MB on an 8 GB RTX 5060 in 18 minutes and ended in `0x8007000E` (no upload buffer). ## Change Add the memory/room switches to `KEPT`, next to the other hand-set values. A settings file or `--more` still overrides them, because those are applied to the settings map after the ambient values are kept. ``` "VICTORY_VRAM_BUDGET_MB", "VICTORY_TEXTURE_ROOM_PERCENT", "VICTORY_ROOM_REAL", "VICTORY_FACE_HEADROOM_MB", "VICTORY_CARD_ROOM_FOR_TARGETS_MB", "VICTORY_TEXTURE_BUDGET_MB", "VICTORY_TEXTURE_SOFT_MB", ``` ## Test RTX 5060 8 GB, Series S profile, 720p internal / 1080p output, DLSS Quality, `play-xss.cmd` as above (budget 6000, line 70 %, `ROOM_REAL=1`). The switch now reaches the layer: ``` 2026-11-30T13:55:12Z ... the texture queue's room: 1245 MB in use - ... against a line of 4200 MB (70.0 % of a budget of 6000 MB; ...) ``` Curve (end-of-minute `used` and texture copies from the room line): | t (min) | before: used | before: copies | after: used | after: copies | |---:|---:|---:|---:|---:| | 0 | 1175 | 290 | 5879* | 1931* | | 3 | 6302 | 2813 | 6736 | 2361 | | 6 | 6648 | 3003 | 7211 | 2805 | | 9 | 6898 | 3116 | 7547 | 3129 | | 12 | 7359 | 3360 | 7684 | 3235 | | 15 | 7602 | 3562 | 7800 | 3336 | | 18 | **8546 → OOM** | 3687 | 7884 | 3447 | | 21 | — | — | 7997 | 3554 | | 24 | — | — | 8134 | 3697 | | 26 | — | — | **8151, still rendering** | 3698 | \* the first minute of the "after" log is after the world's first frame, so its t=0 is not the same point in the load as the "before" log's. The "before" run reached 8,546 MB and failed with `0x8007000E` at 18 min. The "after" run plateaued at ~8,150 MB, kept rendering (15–20 fps) past 26 min, and produced no new `0x8007000E`. One optional compute pipeline fails at load with the same key and `0x8007000E` in both runs; it is independent of this change. Honest limit of the measurement: the texture peak is the same in both runs (~3.7 GB). The line controls how early admission stops, not the final working set, and the non-texture footprint differed between the two runs. So this is a switch-plumbing fix with a bounded peak in this test, not a demonstration that the budget caps the process. ## What this does not do The budget is a ceiling on the texture queue's line, not a hard cap on the process. On this title/card the non-texture footprint is ~4.4 GB (render targets ~1.8 GB, card copies of title buffers ~0.8 GB, other/driver ~1.8 GB) and the texture working set is ~3.7 GB, so ~8.1 GB is the floor. A 6,000 MB hard cap would require ~2 GB of textures to be absent. We deliberately do not reach it by evicting textures that index slots show. An experiment that trusted `VICTORY_SAMPLED_EVICT` at the budget evicted the player's skin and left it white: the evicted copies then became first uploads, and `first_upload_decision` refused them at the whole-card budget (1,439 refusals in 5 s in that run), so they never came back. That experiment is not part of this patch. ## GPL No derived code is added. The rejected experiment referenced the memory stack by skornuta (`skornuta/victory-memory-stack`, `57fb136`, GPL-3.0-or-later); it is not in this diff. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
andrewpozdnakov7-jpg commented 2026-12-01 14:37:51 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by andrewpozdnakov7-jpg on 2026-12-01T14:37:51Z.


On a84fe88e, keeping the environment variable is only the first step. With frame generation enabled, the launcher still writes its automatic 80% texture-room value over an inherited explicit percentage. A blank saved budget also leaves the old ambient budget in place.

0a53b5ce brings these memory values into the same settings map used at startup, before the saved file and --set. It recognizes the inherited automatic-reserve marker when the F1 menu restarts the launcher.

I ran the exact settings and environment code on Windows. With a lowercase ambient percentage of 68 and a 9,000 MiB budget, the author head used 80% with the automatic reserve. The patch used 68% and the 9,000 MiB cap. A blank saved cap cleared the environment value, saved and --set overrides took precedence, and a framegen-ready restart selected the automatic 86% value. The same fixture passed on the candidate merged with 5fabb46e, where it also preserved an ambient 1,500 MiB soft limit. The staged asset check passed.

The ambient VRAM-budget case is also reported in #4930.

Please keep the Git author on cherry-pick or rebase, or add Co-authored-by: andrewpozdnakov7-jpg <[email protected]> if folding the change in.

AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7314571363 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4014#issuecomment-7314571363). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-12-01T14:37:51Z. --- On `a84fe88e`, keeping the environment variable is only the first step. With frame generation enabled, the launcher still writes its automatic 80% texture-room value over an inherited explicit percentage. A blank saved budget also leaves the old ambient budget in place. [0a53b5ce](https://github.com/andrewpozdnakov7-jpg/VIctory-NVIDIA/commit/0a53b5ce50d216715d89cd251f2f9de38bfa56d8) brings these memory values into the same settings map used at startup, before the saved file and `--set`. It recognizes the inherited automatic-reserve marker when the F1 menu restarts the launcher. I ran the exact settings and environment code on Windows. With a lowercase ambient percentage of 68 and a 9,000 MiB budget, the author head used 80% with the automatic reserve. The patch used 68% and the 9,000 MiB cap. A blank saved cap cleared the environment value, saved and `--set` overrides took precedence, and a framegen-ready restart selected the automatic 86% value. The same fixture passed on the candidate merged with `5fabb46e`, where it also preserved an ambient 1,500 MiB soft limit. The staged asset check passed. The ambient VRAM-budget case is also reported in #4930. Please keep the Git author on cherry-pick or rebase, or add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>` if folding the change in. AI-assisted with OpenAI Codex.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/4014:upstream-pr/4014'
git switch 'upstream-pr/4014'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/4014'
git switch 'upstream-pr/4014'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/4014'
git switch 'upstream-pr/4014'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/4014'
git switch 'main'
git merge --squash 'upstream-pr/4014'
git switch 'main'
git merge --ff-only 'upstream-pr/4014'
git switch 'main'
git merge 'upstream-pr/4014'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
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.

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