Texture blocks: the textures of the emptiest ones made again elsewhere (VICTORY_REPACK, off) #556
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/556"
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 readmet3xt-lab/foxhound. Originally posted by voiceovarian1-max on 2026-12-03T09:45:14Z.
A texture block goes back to the card only when no texture is left in it, and
textures of every age end up in every block: on a 12 GB card 0.6-1.0 GB stood
free in holes of a few MB within five minutes, while textures went to the PC's
memory for want of room.
With VICTORY_REPACK=1 the emptiest blocks under half full are marked draining
(two at a time, while the free part of the blocks is 256 MiB or more and the
other blocks could hold what they hold): nothing new is cut from them, the host
copies of the title textures in them are made again elsewhere the way
grow_small replaces one (uploaded from title memory at the next texture pass,
the slots showing the old copy until then), and a drained block goes back to the
card at once. Each title texture's block is noted when its host copy is made,
so a pass looks only at the textures of the draining blocks; a first version
that scanned every title texture each pass cost about 10 fps. Textures whose
content the host's shaders or copies wrote, and those made small for want of
room, are left where they are. A draining block that holds no fewer bytes for 15 s
(such a texture lies in it) is given up: it takes new pieces again and is never
marked again (the first version kept two such blocks marked for good, and
repacking stopped about two minutes in).
Measured on a 12 GB RTX card with the same change on a local build of this base
(window scene, 300 s, walking out of the cell from 70 s, two runs each,
alternating): 45.2 / 44.6 fps without, 45.1 / 44.2 with; textures made in the
PC's memory for want of room 1,000+ a run without, 1 with; 180-300 MB fewer
holes; the card's memory in use unchanged (the texture queue fills to its line).
Tests: pool::tests::a_draining_block_takes_nothing_new_and_goes_back_once_empty,
a_draining_block_that_stops_emptying_is_given_up, block_of checks in
a_texture_gives_its_piece_back_when_it_goes.
What is in it
crates/victory-gpu/src/draw.rs| 9 ++crates/victory-gpu/src/pool.rs| 241 ++++++++++++++++++++++++++++++++++++-crates/victory-gpu/src/resource.rs| 106 ++++++++++++++++Tested
cargo test -p victory-gpu --lib -- pool:: resource::: 41 passed, 0 failed.cargo check --workspace --tests --lockedonmain7dbcdcb: no errors, no warnings.mainitself: only in one combined build with other PRs (results to follow here before this leaves draft).Not tested
AI use
Claude Code with Claude Opus 5.5 wrote the change and its tests (two sessions: one wrote the repacking, one found and fixed the stalled drain from the first version's logs) and this description.
🤖 Generated with Claude Code
Imported from readmet3xt-lab/foxhound. Originally posted by voiceovarian1-max on 2026-12-03T10:04:29Z.
Combined test of this PR with #521, #543 and #544-#556, all merged onto
main7dbcdcb(branch fox-all of voiceovarian1-max/foxhound):cargo test --workspace --locked -- --test-threads=4: 1,415 passed, 0 failed, 50 ignored (29 binaries), noSKIPPED.VICTORY_KEYS, no input from the PC): window scene 38-42 fps against 34-37 formainon the same boot; no device removal, no crash; a burst of 67 pictures showed no one-picture flicker of the character's clothes.Tested by Claude Code with Claude Opus 5.5 on the hardware named.
Imported from readmet3xt-lab/foxhound. Originally posted by tillo88 on 2026-12-04T03:40:59Z.
Replay-bench measurement on v0.8.3.5 with
VICTORY_REPACK=1: no measurable fps differenceMeasured: PR head
f4ae795merged onto release v0.8.3.5 (5e44415), withVICTORY_REPACK=1set (off by default in the PR), 2 measured runs (after a warm-up run that is not counted), against 7 runs of v0.8.3.5 without the PR, same route (~6.5 min).Mean fps: release 36.88, PR 36.95 (+0.2%): no measurable difference. CPU prep was below every release run in both PR runs (18.10 / 18.14 ms against 18.34-19.38), about 0.7 ms under the release mean, and frames over 100 ms were 11 and 10, below the release's 12-17. Frame-time percentiles are inside the release's range. With 2 runs these are observations, not results; the bench does not measure texture-memory fragmentation or how much the repack moved.
Crashes: none in the PR runs and none in the release runs (no host GPU failure, no device lost).
Config: RTX 5070 Ti 16 GB, Ryzen 7 9800X3D, 32 GB, Windows 11; default
play-foxhound.ps1settings (Series X profile, 1440p, DLSS balanced, no frame generation), fullscreen, no frame cap.Measured unattended on a replay bench (same save, recorded controller input); numbers and text prepared with Claude.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.