gpu: gate new texture blocks and by-address VRAM against the budget line #399
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/399"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Kikoarl on 2026-11-27T21:55:08Z.
Summary
Ports
VICTORY_POOL_GATEandVICTORY_POOL_FULLESTfromfxceless/victory-forkcommit2eade68cade9b2f8cd2511cc97328e83f58508c3(GPL-3.0-or-later), rebased ontomain(63b902f).Changes
pool.rs,resource.rs: Allocate a new 64 MiB texture block only while card real use + new block + buffer-copy reserve +targets_to_comeremains at or below the texture budget line (VICTORY_POOL_GATE=0disables). Otherwise reuse free pieces or defer waitable heap textures while keeping headroom + one block free during idle sweeps so the gate does not deadlock. Adds optional fullest-block-first placement (VICTORY_POOL_FULLEST=1;play.rsdefaults to0first-fit). Preservesmain'sVICTORY_POOL_STATStracking (smallblock flag ongive_back_with/counted).draw.rs,host.rs: Defer heap texture slots when no free piece fits and the gate is closed, trackHEAP_TEXTURES_NO_PLACE/pool::BLOCKS, and logtexture blocks: ...alongsideroom_terms.shadow.rs,apps/victory/src/play.rs: Enforcetargets_to_comereserve (VICTORY_CARD_ROOM_FOR_TARGETS_MB) inby_address_roomfor title memory by address. Becausemainalready routes arenas throughshadow::by_address,memory.rsis left untouched and merged PR #88 is preserved.Distinct from PR #79 (
VICTORY_POOL_STATSlogging) and PR #209 (window heap hole reuse).Verification
Verified on Windows (
x86_64-pc-windows-msvc) after rebasing ontomain(63b902f):git diff --check origin/main..HEAD— cleancargo test -p xtask --locked— 6 passed, 0 failed (repository_passes_policyok)cargo clippy -p victory-gpu -p victory --all-targets --locked— exit 0, 0 warnings in PR-changed lines (mainhas pre-existing clippy warnings in untouched lines such asshadow.rs:1708andvictory-hle/src/modules/gameinput.rs:1372)cargo test -p victory-gpu --locked pool::— 11 passed, 0 failedcargo test -p victory-gpu --locked resource::— 22 passed, 0 failedcargo test -p victory --locked— 26 passed (unit tests) + 2 passed (census), 0 failedImported from trustno1-coder/VIctory-NVIDIA. Originally posted by CuteBooty on 2026-11-27T22:55:31Z.
Test data from an 8 GB card, in case it helps the review. I ran the same gate today before seeing this PR.
Important: this is not this branch. It is my own local port of the gate from
fxceless/victory-fork2eade68contof3534e6b(pool.rs,resource.rs, thedraw.rshunk, thetexture blocks:line). Differences from this PR that I know of: the by-address (ray arena) room term is left out, andshadow.rs/memory.rsare untouched. I have not built or run this PR's code.Setup: RTX 3070 8 GB (DXGI budget 7,250 MB), Ryzen 7 5800X3D, 32 GB, Windows 11. Series S profile, 1920x1080, no DLSS, no frame generation, ray tracing off, built from source.
VICTORY_POOL_GATEat its default (on),VICTORY_POOL_FULLEST=0,VICTORY_CARD_ROOM_FOR_TARGETS_MBat its default (3072). 39 minutes of ordinary story play with a lot of driving, one session.What the
texture blocks:line said over the session:What I read from it:
d12eb1b2plus the #58 fix) and a different route, a 60-minute session gave 4,317 (72 a minute). Different base and route, so I would not call that a difference.Frame times in that session, for what one run is worth: 55 / 60 / 70 / 78 ms at 3-5k / 5-7k / 7-9k / 9-11k draws a frame.
Caveats: one session;
VICTORY_DYNAMIC_WAIT=1andVICTORY_THIN_GATE=1from the same fork were also on (the dynamic-slot wait never triggered: 0.00 draws a frame found no slot), so this is not the gate alone. Not tested:VICTORY_CARD_ROOM_FOR_TARGETS_MBat a lower value,VICTORY_POOL_FULLEST=1, Series X, DLSS.I can post the log lines or rerun with other settings if that is useful.
Measurements and this note were prepared with an AI assistant (Claude Code); the session was played on my machine.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by ArturoWolff on 2026-11-28T00:10:42Z.
Independent Linux/Proton test of this PR's actual source delta on an 8 GB card (rather than a different port). RTX 4060 desktop, 16 GB host RAM, NVIDIA driver 620.73.04, GE-Proton11-14/vkd3d-proton 3.2.0 (
cae8353ed7959c4+).Receiver:
64d4931b3dd90305134512b805fc98f04119fb6e(v2026.11.27.8), with the same three compatibility fixes in both arms described in #357. Candidate adds Kikoarl's11a44a1fa9a13fa75d117ec78d2db47533849886delta againstdf2daafeb1b2170931cf7a6eddff6de254841d9c, ported from fxceless2eade68cade9b2f8cd2511cc97328e83f58508c3(GPL-3.0-or-later). Applied cleanly; locked offline MSVC release build passed in 1m43s. Combined candidate patch SHA-256faa299b7e3dd06cf67c3015ca9c3a5a3e35a492c746a521ab61d7e058983775d.Both launches used separate copies of the same private profile, fresh engine/external caches, Wine Windows 11 mode (the startup workaround described in #120), Series X,
1080to1440(1440p swap chain, 1080p client), DLSS/FG off for this diagnostic, water light/BVH enabled, full write-back, waits on, no explicit pass omissions or Bink skipping. Both showed the account picker and received one explicitly gated A input. Effective engine switch headers differ only by the addedVICTORY_POOL_FULLEST=0default; the block gate defaults on in the candidate. Earlier pre-engine timeouts occurred in both builds and are excluded from this rendering comparison.The candidate's last block report showed 30 blocks (1920 MB), 71 MB free; its prospective new-block sum 6732 MB against 6198 MB, with the admission message saying no new block and reuse free pieces. However, the cumulative counts were still 0 blocks not made for want of room, 0 made without room, 0 given back, 0 texture-placement waits. Thus the policy was observed closed at the final sample but this short workload did not witness an actual refused block request. The separate texture-queue accounting has a different free-space term (120 MB at that sample); these lines are sampled diagnostics, not a hard physical VRAM cap.
Both runs progressed through loading artwork to black frames, then exit 5, with the same one unsupported Wave64 compute translation and no missing clamp/compare/library warning. No new host OOM kill, recorded kernel GPU fault or 256 MiB guard stop; temporary backing directories empty after retirement. This is a matched startup/load comparison, not a world-play benchmark or a texture-fidelity verdict. It does not demonstrate memory savings or a fix for the black screen on this workload; the gate needs a longer allocation-heavy world run before drawing that conclusion. The comparable negative result is retained so we do not attribute the pre-existing load failure to this PR.
AI assistance: Hermes Agent, working on behalf of ArturoWolff. (GPT 6.2 Sol High).
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-11-28T19:22:52Z.
Thanks for this. I'm closing it without merging because it conflicts with the current main in several places (main has moved a lot since it was opened, with about 100 pull requests merged today), and I can't resolve that safely on your behalf. If you'd still like it in, please rebase it on the current main and open a new pull request.
Pull request closed