fix(gpu/host): preserve FetchWatermark shrink target, replace numeric reaper knob, and raise critical spare floor #298
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: launcher
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
run report
security: hold
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs gpu test
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/Androtim--MiniVI!298
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-298"
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?
@Androtim on GitHub · 2026-12-01 23:22 UTC · original
Androtim:fix/host-fetch-watermark-and-reaper-killswitch→main· +53 −39 · 1 files · 1 commits · merged 2026-12-01 23:48 UTCSummary
Follow-up fixes to
crates/victory-gpu/src/host.rs:Preserve
FetchWatermarkshrink target (target.max(needed)):FetchWatermark::should_shrinkpreviously returnedbooland discardedtarget = self.peak_bytes.max(floor), causingRelayFetch::bufferandCardWork::fetchedto reallocate withself.fetch_buffer(total). When the quiet/pressure shrink window fired on a small fetch (e.g.64 KiB), it shrank the buffer belowfloor(16 MiB/4 MiB) andpeak_bytes, causing immediate reallocation on the next multi-MiB fetch.Option<u64>(Some(target.max(needed))), and both callers allocateself.fetch_buffer(bytes)on growth (None/< total) or shrink (Some(bytes)). Updatedfetch_watermark_shrinks_oversized_buffer_after_quiet_window_or_pressureto assert exact returned byte targets.Replace numeric reaper knob with a
=0kill-switch:VICTORY_REAPER_LIMIT(parse_reaper_limit);drop_asidekeeps an internal256-entry boundedsync_channelwithVICTORY_REAPER=0(reaper_enabled) as the safety kill-switch.Raise
SPARE_CRITICAL_FLOORfrom8 MiBto16 MiB:critical_commit()without exceedingSPARE_PRESSURE_FLOOR(32 MiB) orSPARE_MOST(128 MiB).Verification (100% Measured After Final Edit)
cargo +1.98.1-x86_64-pc-windows-gnu xtask policy:asset policy: 319 files okvictory-gpuhost::tests:::69 passed; 0 failedvictory-gpulist_upload_pool_tests:::9 passed; 0 failedclippy --workspace --locked --all-targets -- -D warnings: 0 warnings (default and--features diagnostics)--release --bin MiniVI --locked: compiled cleanly,objdump -pimports standard Windows DLLs onlyMatched-Scene 90s Plain
--release1440p A/B (PlayParity,LowVram,DLSS quality,-AutoNudgeMenu) vsorigin/main(b2b072e)Both runs sampled
20in-world windows at matched draw peaks (max_draws = 7,336vs7,346) with 2 s OS memory polling (PrivateMemorySize64,WorkingSet64,Win32_OperatingSystem.FreeVirtualMemoryover the 60 s in-world tail):origin/main(b2b072e)db8fffb)frame_ms)10.35 fps(96.45 ms)11.45 fps(87.45 ms)used_max / budget)6,308 / 6,514 MB(room_false=17.6%,pool not_made=2,208)6,120 / 6,519 MB(room_false=6.2%,pool not_made=0)final_waiting/uploaded)11,287/69,6807,610/78,19421,299.9 MiB/22,212.5 MiB20,825.9 MiB/22,147.7 MiB19,790.8 MiB19,402.6 MiB1,389.5 MiB/460.3 MiB1,744.3 MiB/405.5 MiBpreparing/copyback36.25 ms/9.25 ms37.2 ms/11.0 ms+0.95 ms/+1.75 ms0/0 MB0/0 MB@Androtim on GitHub · 2026-12-01 23:48 UTC · original
Audited full diff (
db8fffb4,+53 -39incrates/victory-gpu/src/host.rs) and matched-scene 90s plain---releaseA/B:FetchWatermark::should_shrinknow returnsOption<u64>(Some(target.max(needed))) with unit tests asserting exact targets (16 MiB/20 MiB/4 MiBon64 KiBcalls), eliminating the under-allocation churn onmain. Replaces the numericVICTORY_REAPER_LIMITknob with an internal256bound +VICTORY_REAPER=0kill-switch, and raisesSPARE_CRITICAL_FLOORto16 MiB.--release90s A/B (20windows, matched draws7,336vs7,346):+1.10 fps(10.35 -> 11.45 fps,-9.0 msframe time),-188 MBpeak VRAM (pool not_made: 2,208 -> 0,over=0 MB),-3,677final_waiting(-32.6%),-474.0 MiBmedian private RAM,+354.8 MiBmedian OS commit left,0crashes. (preparing/copybacksit withinmain's own9.25–11.5 msrun-to-run spread;dbe161b4mainmeasured11.5 mscopyback vs11.0 mshere, and none of the three changes add hot-path overhead.)dbe161b4(watch.rs), CI green (46769150433). Merging now.github-bot referenced this pull request2026-12-03 16:34:10 +00:00