Repository navigation
Vice-Tay memory fixes: placed-view leak, slot release, snapshot pool (switches off) - #14
Open
oceansde012 wants to merge 14 commits into
Open
oceansde012 wants to merge 14 commits into
oceansde012 wants to merge 14 commits into
Conversation
…cription The title may leave words 1 and 13 of the 56-byte resource description it passes to device methods 0x230/0x238 unwritten, so the same view came in with different bytes there and every one was a new shape: the 2^22 shapes were full after half an hour, after which each placed view was a table entry kept for the run (34.9 million, 16.7 GB after 70 minutes on Series S). Only the named fields are copied now; the padding is zero. From JMAN730/project-flamingo b1e0cd1d (merged there through PR #620), with its test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit f07e54a)
… use Run vt-shapes logged which words tell placed-view shapes apart. Past the resource description's padding (words 1 and 13), the view description's padding word 3 (shader resource views: the union starts on 8 bytes) took 131,392 values and word 9 (the union's unused tail) 36,413 in a million shapes: the title leaves them unwritten, so the same view was a new shape each time. Those words are now zero for each dimension (D3D12_BUFFER_SRV, D3D12_TEX2D_SRV and the like say which words of the union are used); an unknown dimension keeps every word. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit ce91490)
… releases Once the shapes of placed views are full (4,194,304 after half an hour of play), every placed view the title writes became a table entry kept for the run: 34.9 million entries and 16.7 GB after 70 minutes on Series S, with the frame rate halved as memory went past physical RAM. Such entries now sit in a queue, oldest first; past VICTORY_OWNERLESS_VIEWS (default 1,048,576; 0 keeps all) the oldest is freed under a new generation, so a descriptor still naming it reads as stale, as one naming a released resource's view does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit d3626d2)
…walking the table views_kept walked every table entry to count constant buffer and placed views; the report around it took a median 49 ms once the table passed 30 million entries. The two counts are now kept as entries are made and reused (a freed entry reused for another kind is counted out and in, so they match the walk). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 40e9ea1)
Lists that ran are kept 64 flights longer before they are reset (VICTORY_BURY_LAG), and the dynamic descriptor slots of their tables went back only at that reset. At about 17 flights a frame, almost four frames of tables held slots no submission read any more. A host heap capped at 1,000,000 views has 2^18 such slots; in busy scenes up to 9,000 of 21,000 tables a frame found none, and their draws and dispatches were dropped (a median of 555 a frame). The slots now go back as soon as the card has run the flight, as on the paths that wait for their submissions. The host lists and their upload memory still wait out the lag, and a resource a reused slot viewed is still retired through it. One thread lands at a time, so the flights kept stay in the order they landed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 31e8d23)
The recording line gave the tables asked for and refused, but not how many slots they took, so a run could not tell how many frames of tables the dynamic slots hold. It now adds the slots taken per frame (diagnostics builds). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit b883e5e)
The slot-return change came from a tree where the field was `_state`; here it is `state`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit d8f70e3)
…t padding Placed views now leave out the resource description's padding words, so a description with values there read back without them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit f1f5221)
Return before touching the view table for a zero-length range. Cover both the no-op and removal of a non-empty range in the regression test. (cherry picked from commit 1d8308579faef9fa81c9754528925f96535b9712)
PLACED_RAW kept every (address, description-with-filler) pair for the whole run and scanned all variants of an address on each insert, under the PLACED_TEXTURES lock. It only feeds the PLACED_TWINS counter, which diagnostics builds read. It now runs only with the diagnostics feature, and there it starts over at 16,384 entries. Adds two #[ignore] load tests (run with --ignored --nocapture) that print the table sizes and the process's private memory: placed view shapes with padding-only changes, and placed-texture asks with different filler words. Written with AI help (Claude/Kiro). (cherry picked from commit ceda200) Conflict: dropped the upstream test hunk that also carried sweep_batch tests absent from this base; the placed_filler load test is not ported.
…ssure POOL kept up to 512 MiB of snapshot buffers for the rest of the run once snapshots stopped: only give_back trimmed it, and only when another buffer came back. The once-a-second sweep now empties it after the idle time of the other host caches (ram_idle_ms) and four frames, and keeps only the smallest 32 MiB while residency::pressured() holds. Load test (ignored): 508 MiB private kept full, 25 MiB pressed, 0 idle. (cherry picked from commit bd27027) Conflict: this base has no window RAM band in let_go_idle; kept the base body and added only the let_go_idle_snapshots() call.
Not taken: in this base views_gone(at, 0) removes the view that holds at, and unmapping/remap callers may pass a zero length; making it a no-op could leave stale views. Revisit with evidence.
…default) VICTORY_PLACED_SHAPE_CLEAN=1 keys placed views on cleaned words (Vice-Tay #27); unset keeps every word as in the base. VICTORY_OWNERLESS_VIEWS now defaults to 0 (keep all, base behaviour); Vice-Tay's value is 1048576. Patch by DeepSeek. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FLuVRoJmD4HPnEcgaxEdCM
…default) VICTORY_SLOTS_ON_LAND=1: dynamic descriptor slots go back when a flight lands (Vice-Tay 31e8d23); unset runs the base land() unchanged. VICTORY_SNAPSHOT_POOL_TRIM=1: release the idle snapshot pool (Vice-Tay bd27027); unset keeps the pool as before. PLACED_RAW only in diagnostics builds. Patch by DeepSeek. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FLuVRoJmD4HPnEcgaxEdCM
Owner
Author
|
CI Generated by Claude Code |
oceansde012
added a commit
that referenced
this pull request
Nov 28, 2026
…8f04) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FLuVRkq9FEXaXsKnfJYUZn
This was referenced Nov 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Vlad · project thread
Base f4b48ad + cherry-picks (
-x) from TaynanGT/Vice-Tay (GPL-3.0). All behaviour behind env switches, off by default, so an unset environment runs the base code paths.Why
Vice-Tay #27: placed views are keyed with padding words the title leaves unwritten, so each view mints a new shape. After ~30 min the 2^22 shape space fills and every view becomes a permanent table entry (upstream RTX 4090: 16.7 GB / 34.9 M entries after 70 min, private 39-52 GB, fps 20 -> 8-10). Our base has the same keying and no cap, so it has the same leak. Our A/B runs are too short to show it.
What
VICTORY_PLACED_SHAPE_CLEAN=1VICTORY_OWNERLESS_VIEWS=1048576(default now 0 = keep all)VICTORY_SLOTS_ON_LAND=1VICTORY_SNAPSHOT_POOL_TRIM=1Picked and then reverted: 1d83085 (#351), because a zero length removes a view in this base. Gating patches written by DeepSeek.
Checks
cargo check --workspace --all-targets --target x86_64-pc-windows-msvcOK, plus-p victory-gpu --features diagnosticsOK.cargo teston Windows, and a long (30+ min) game run comparing private bytes, commit and VRAM against base.Report: project files
reports/vicetay-memory-2026-11-28.md.Generated by Claude Code