Repository navigation
perf(gpu): give idle spare-list scratch back after a while - #474
Merged
pragyaangaur merged 1 commit intoNov 27, 2026
Merged
Conversation
Spare host lists kept their last cycle's upload scratch for good: up to 64 lists, each as large as its biggest cycle (64 lists keeping 12 MB held 764 MB), and the texture staging pools and the upload list only aged on submissions with textures to bring up, so a texture-free stretch held the last staged memory. A spare list's scratch now goes once the list has been idle for recent::WINDOW, and the oldest goes past 256 MB in all (the most texture staging keeps); a list made again from a spare makes its scratch as a new one does. Every submission trims the spare lists and ages the staging pools, and the upload list lets go of what it staged as soon as the next submission begins (not only when that one has textures). Diagnostics print the spare lists and the scratch they keep. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
gdemontalivet
added a commit
to gdemontalivet/VIctory-macOS
that referenced
this pull request
Nov 27, 2026
…ync submit worker (VICTORY_ASYNC_SUBMIT=1) Implement Wait-Before-Prep Flight-1 overlap (VICTORY_FLIGHT1=1) and a dedicated victory-submit worker thread (VICTORY_ASYNC_SUBMIT=1) behind opt-in environment switches (default off), rebased cleanly onto main: - Split Host::execute_with_barriers into prepare_submission, execute_sync, and finish_post_gpu, preserving all main submission behavior across both sync and Flight-1 paths (pragyaangaur#403 SUBMISSIONS_DONE/retire_any/advance_retired, pragyaangaur#417 ReadyDrain/release_worker, pragyaangaur#419 coalesced UAV barriers, pragyaangaur#453 hoisted indirect clamps in prelude, pragyaangaur#457 texback::land, pragyaangaur#474 trim_idle, and unconditional bindless::uploads). - Keep pragyaangaur#417's bindless::Uploads semantics (Holder dirty tracking + ReadyDrain + release_worker) while checking out the upload HostList from LIST so Uploads is genuinely Send across the flight lifecycle without holding a MutexGuard across threads or GPU waits; call release_worker() immediately after the flight's GPU fence completes and return the upload list to LIST on drop. - Enforce Wait-Before-Prep in host/flight.rs: finish_flight_locked drains Flight N-1 completely before Flight N touches any shared Shadow, descriptor heap, upload staging pool, or Mark buffer, and Host::quiet() drains any active flight under Host::submitted before heap creation/null-fill. - Add coalescing Held::take_ready_with / finish_running so victory-submit and Flight-1 never hold HELD across GPU submission, preserving the lock DAG (SUBMIT_DRAIN -> HELD -> Host::submitted -> Host::flight -> Fence::waiters) and draining cleanly at PresentX, CopyPageMappingsBatchX, and synchronous Host::execute calls.
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.
A spare host list kept its last cycle's upload scratch for good (the count was capped at 64, the bytes were not), and the staging pools and the upload list aged only on submissions with textures. Now a spare list's scratch goes after
recent::WINDOW(10 s) idle, the oldest goes past 256 MB in all (the most texture staging keeps), and every submission does the trimming; a list made again from a spare makes its scratch as a new one does.Tested: native
victory-gpulib tests (107 pass), Windows clippy in both configurations; not run under CrossOver, the model's list sizes and trace are assumed, so the RAM held and the scratch made again in a real run are unmeasured (diagnostics now print the spare lists and their scratch). Small conflicts with #403, #404, #417 and #447.🤖 Generated with Claude Code