GPU: a texture pass with no room gives up the oldest slots' host copies #140
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!140
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-140"
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?
@undeadhuman37 on GitHub · 2026-11-24 21:48 UTC · original
undeadhuman37:fx/bindless-residency→main· +511 −68 · 6 files · 9 commits · draftWhat
The index pass keeps a host copy for every slot it uploads, and a slot's copy is never idle to the sweep, so only unmapping frees it. Once the card passed 90% of its budget,
room()stayed false: the pass refused 256 slots and stopped every frame for the rest of the run, and uploads froze (about 14 GB, thousands of slots still due).Now, when a pass finds no room, up to 256 slots the pass made more than 4 s ago, oldest first, are made null so the sweep can free their copies. The memory line gets a count of slots given up. Marked
shortcut:in the code: oldest made first, not least sampled, because a draw reading a texture by index leaves no trace. A slot given up stays empty until the title writes or maps it again, so a texture still on screen may draw empty meanwhile.Tested
cargo clippy --workspace --all-targets -- -D warnings,cargo test --workspace(499 passed, 0 failed) andcargo xtask policypass.eviction_takes_the_oldest_made_slots_and_spares_the_recent(synthetic, no game files).AI use: an AI tool (Claude Code) wrote this change; a person ran and reviewed the checks.
Note on this branch: it is based on
fx-main, so besides this change (one commit, 3 files) the diff also carries the other commits merged there. A one-commit version onmainis prepared and not yet pushed. Eviction can leave a slot drawing empty; see the test comment below about visual differences, whose cause is not isolated.4e17478) into fx-main 990649c50e@m335671 on GitHub · 2026-11-24 22:59 UTC · original
Test run on an RTX 4070: the texture queue stays short for the whole run. Note that this branch also carries #25, #32 and #24 (merged into
fx-mainunder the commit), so what follows is the four of them together, not this commit alone.Tested
cc69162, merged with #77, #218, #51 and #81 on2119b0e(no other conflict than both adding tests towaterfall_tests.rs).VICTORY_LATE_WAIT=3 VICTORY_WIDE_BACK=1 VICTORY_CARD_BUFFERS_MIN_MB=1 VICTORY_CARD_BUFFERS_MB=1024.Texture queue, last 30 samples (~3 minutes) of each run
1684989-based + #77, ~11 min)passes that made none for lack of room: 63 (14086 slots given up to make room), card 8,277 MB of a 10,808 MB budget.Visual differences I saw, cause not isolated (any of the four PRs could be behind them):
Not tested: this commit without #25/#32/#24, process memory (still about 23 GB committed), other GPUs.
AI use: the run was done on my machine. Claude Code (Claude Opus 5.5) built and ran it, read the logs, worked out the figures and wrote this comment.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.