[pr-fix][rendering][memory] Retry temporary stand-in texture allocation failures #245
Loading…
Reference in a new issue
No description provided.
Delete branch "andrewpozdnakov7-jpg/Darner:port/4863-retry-neutral-texture-allocation"
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?
Contributor role (optional)
What it changes
Stand-in textures use a once-initialized cache. Main caches the first failed allocation for the rest of the run. Cache only a successful allocation and retry a failed one at most once per second per texture kind. Other kinds keep their own retry deadline.
Restores locally saved VIctory-NVIDIA work from December 1, 2026. Recovered revision: c9e0b97. Adapted by andrewpozdnakov7-jpg (GitHub profile).
How it was tested
76cdf41onf3840d7.Checklist
Checked for overlap
Code-read review of
76cdf41. I did not build or run it.Caching only a success and retrying at most once a second per kind is the right shape: on main
get_or_init(|| make_neutral(kind))(descriptor/host.rs:550) stores aNonefor the whole run. The double-checkedtexture.get()under the per-kind mutex means one thread builds.One hazard, which exists on main but which this PR makes repeatable. In
make_neutral,queue.ExecuteCommandLists(..)(PR head:650) is followed byqueue.Signal(&fence, 1).ok()?(:651) andfence.SetEventOnCompletion(..).ok()?(:653). If either fails, the function returns and dropsmade, the list, the allocator and the queue while the copy may still be executing. That should only happen with a removed device, but main hit it at most once per kind and this retry can hit it once a second per kind. Suggested: on a failedSignalorSetEventOnCompletion, leak (std::mem::forget) the list, allocator, queue and fence, or returnSome(made)only after the wait succeeded and otherwise keep the objects alive for the rest of the run.Smaller: a failed attempt is silent, so a stand-in that never arrives leaves no trace in the log. One
tracing::warn!on the first failure of each kind would help triage.This comment was written with AI assistance (Claude Code).
Code review only (read the diff at
76cdf41), nothing built or run. I agree with the earlier review on the retry shape and the one-timewarn!. Additions:make_neutralstarts withhost.upload_buffer(256)?, andmaindocuments that upload buffer being refused under memory pressure at world load (host.rs:18076-18081). Onmain, one such refusal leaves every missing texture of that kind with a null (black) view for the rest of the run, so this PR plausibly helps memory-tight PCs. Those failures come before anything is submitted, so retrying them is safe.ExecuteCommandLists: I read it as real but unlikely to repeat.Signalfails essentially only on a removed device, and after that every retry fails earlier (CreateCommittedResourceorCreateCommandQueue), before anything is submitted. So it can happen about once, as onmain, not once a second. Not a blocker in my view. If wanted,std::mem::forgetthe queue, list, allocator, upload buffer and texture on those two error paths.neutral_of,NEUTRALS,is_neutral) and adds a second stand-in table that caches failure the old way. #335 adds a third (far_occlusion_of). Whichever lands second may want the same retry.Reviewed with Claude Code (AI-assisted); findings checked by a human before posting.
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.