GPU: a pipeline library save the host has no memory for waits, not aborts (1.7 GB library on NVIDIA) #2007
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2007
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2007/head"
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?
@KevinPratap on GitHub · 2026-11-25 02:48 UTC · original
KevinPratap:gpu/library-save-fallible→main· +26 −4 · 1 files · 1 commits · merged 2026-11-25 21:53 UTCProblem
library::saveserialises the pipeline library withvec![0u8; GetSerializedSize()]. On NVIDIA the library holds each pipeline's machine code: aftertranslate --cache --pipelinesit is about 1.7 GB on an RTX 4050 Laptop, where the README mentions about 4 MB on AMD. A save in the world then aborted the whole process:(32 GB RAM, about 21 GB committed by the process at that point.)
Fix
The buffer is reserved with
try_reserve_exact. Without memory, the save logs a warning and returns. The pipelines stay counted as added, so the next save tries again.Verified
a_save_buffer_the_host_cannot_give_is_refused; thepipeline::librarytests pass (9).cargo clippy -p victory-gpu --all-targets -- -D warningsis clean.Related: the size itself (one blob rewritten whole every 20 s) is worth splitting on NVIDIA, but that is a larger change.
Only
crates/victory-gpu/src/pipeline/library.rschanges.AI-assisted.
🤖 Generated with Claude Code
@jeremygold02 on GitHub · 2026-11-25 03:35 UTC · original
Triage verdict — Keep the fallible allocation; preserve early-list retries (
54b994d)Evidence
l.addedintact is insufficient. Whenl.added == 0,prebuilt_changedis false, and the early list alone is dirty, the entry check consumesUSED_CHANGEDwithswap(false, …)before callingzeroed. The new failure return leaves no dirty flag for a later retry. The existing serializer-error path has the same bookkeeping gap.Checks and limits
savewith only the early list dirty. The exact-head Windows check passed. I reviewed the source and CI without inducing host memory pressure.Next step
This verification was AI-assisted.
@Marvisak on GitHub · 2026-11-25 09:16 UTC · original
Automated triage for the maintainers.
Merge candidate.
crates/victory-gpu/src/pipeline/library.rs::savenow allocates the serialisation buffer withtry_reserve_exact(new helperzeroed) instead ofvec[0u8; GetSerializedSize()], so a library too large for the host's free memory logs a warning and is retried on a later save instead of aborting the process.l.added/prebuilt_changedare left untouched on that path, so the retry does happen; on Windows the allocator reports failure rather than overcommitting, sotry_reserve_exactis the right tool here. Small, focused, merges cleanly.Optional follow-up, also raised in the earlier review comment: when only the early list is dirty,
USED_CHANGEDhas already been swapped tofalsebefore the allocation, so a failed allocation (like the existing serialiser-error path) drops that pending early-list save until something else changes; restoring the flag on both failure returns would close that. #2129 contains the same fallible helper inside a much larger rework of the library file; this PR is the smaller way to land just the abort fix. Recommending a look, not approving.CI: passing (
check).Generated by Claude Code