victory-gpu: page-scoped write-watch askings for submission queries #324
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/324"
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?
Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-02T11:01:47Z.
Summary
Replaces whole-address-space write-watch locking (
Asking::hold_all()) during submissionask_ahead/ask_restqueries incrates/victory-gpu/src/watch.rswith default-on page-scoped interval holding (Askings, withVICTORY_ASK_HOLD_PAGES=0kill-switch):Askings,overlaps,hold_pages):Askings::hold(ranges)which atomically acquires sorted, coalesced page intervals inASKING, blocking only when another thread queries an overlapping page range and allowing disjoint queries (such asdescriptorheap sync onHeapSync) to run concurrently without waiting.VICTORY_ASK_HOLD_PAGES=0kill-switch (parse_hold_pages).ask_aheadpre-grouping & empty-run fast path:ASKINGand returns early whenruns.is_empty()instead of acquiring locks unnecessarily.Askings::hold_or_all.ask_rest+ sharedcollect_rest_candidates/record_rest_pageshelpers:j.aheadempty under a full-memoryAsking::hold_all()lock (which forced concurrent readers to fall back to kernel queries), clonesjournal().ahead, collects uncachedalonecandidates viacollect_rest_candidates, skipsASKINGcompletely whenalone.is_empty(), and holds only coalescedaloneintervals viaAskings::holdwhile recording results through sharedrecord_rest_pages.watch::ask_holds):parse_hold_pages_defaults_on_and_honors_zero_kill_switchoverlaps_handles_sorted_non_overlapping_rangesan_asking_waits_only_for_the_pages_it_asks_aboutVerification
cargo +1.98.1-x86_64-pc-windows-gnu xtask policy: PASS (asset policy: 322 files ok)cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu --lib watch --locked): 61 passed, 0 failed, 0 ignoredclippy --all-targets -- -D warnings(default +--features diagnostics): PASS--release --bin MiniVI --locked+objdump -p: PASS (standard Windows DLLs only)--features diagnostics1440p 90s in-world verification (diag-pr-askpages-1440p-90s): PASS (6/6 gates)world_windows=18, max_draws=14311,crashes=0,no_host_texture_errors=0,used_max=6204 MB / budget_min=6768 MB,final_waiting=2167,mapped_rate=0.49 ms/s(4800calls,381.6 ms, longest9.8 ms),pngs=24, lit=21/24, luma=100.94, near_black=0.06%, edge_energy=7.71, magenta=0.0%ranges heldlock waits per frame (victory_gpu::copystat):1.16–1.28 ms->0.43–0.45 mssteady state (-62%)frame-2377.png,frame-2409.png,frame-2385.png): clean world rendering and HUD with zero visual regressions.Paired Same-Path Plain-
--releaseA/B Benchmarks vsmain(1dffebf)Both runs executed on RTX 4060 Ti 8 GB / i7-13700F / 32 GB RAM from
D:\victory-build\minivi\release\victory.exe(-PlayParity -AutoNudgeMenu -WorldSeconds 90). Zero crashes, panics, or DRED faults.1440p (90s, 21 world windows)
main(1dffebf)perf/watch-page-scoped-askings)14.6 fps(68.5 ms)15.1 fps(66.2 ms)+0.5 fps(-2.3 ms)13.61 fps16.54 fps+2.93 fpspreparing26.1 ms25.0 ms-1.1 mscopyback11.4 ms10.6 ms-0.8 msprep_core_ms(avg / max)36.58 ms/83.00 ms35.07 ms/49.30 ms-1.51 ms/-33.70 msparse_cpufastpreparing_core_ms(avg / max)30.17 ms/83.00 ms29.88 ms/57.40 ms-0.29 ms/-25.60 ms13.39 ms/16.66 ms12.33 ms/14.21 ms-1.06 ms/-2.45 msasking(avg)3.72 ms3.35 ms-0.37 mswaited(avg / max)0.35 ms/1.70 ms0.29 ms/0.74 ms-0.06 ms/-0.96 mstitle_present_wait_ms(avg / med)22.96 ms/19.70 ms17.87 ms/15.80 ms-5.09 ms/-3.90 mscard_idle_behind_ms(avg / med)7.75 ms/7.80 ms6.11 ms/6.30 ms-1.64 ms/-1.50 msthin_ms(avg / med)473.56 ms/508.10 ms451.55 ms/495.10 ms-22.01 ms/-13.00 msused_max/room_false/pool_not_made6,340 MB/11.8%/4,9116,279 MB/0.0%/0-61 MB/-11.8 pp/-4,911working_set_mb(avg / max)16,959/19,744 MB16,740/19,389 MB-219/-355 MBprivate_commit_mb(max)21,376 MB20,955 MB-421 MBshared_mb(avg / med)4,453/5,062 MB4,300/4,907 MB-153/-155 MB4K DLSS Quality (90s, 18 world windows)
main(1dffebf)perf/watch-page-scoped-askings)6.4 fps(155.65 ms, avg6.49)6.4 fps(156.45 ms, avg6.50)0.0 fps(GPU-bound)preparing19.1 ms17.2 ms-1.9 ms(-10.0%)prep_core_ms(avg / med)35.48 ms/33.15 ms33.72 ms/29.60 ms-1.76 ms/-3.55 msparse_cpufastpreparing_core_ms(avg / med / max)29.74/31.80/163.60 ms27.49/29.50/106.80 ms-2.25/-2.30/-56.80 mswaited(avg / max)0.28 ms/4.08 ms0.14 ms/0.79 ms-50%/-80.6%thin_ms(avg)567.28 ms523.90 ms-43.38 mspool_not_made1160-116working_set_mb(avg / max)16,923/20,160 MB16,477/19,942 MB-446/-218 MBshared_mb(med)5,684 MB5,561 MB-123 MBImported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-02T11:03:36Z.
Automated triage for the maintainers (not an approval).
Verdict:
needs-gpu-test· CI (check):pendingReview Summary
Solid, well-scoped concurrency improvement in
crates/victory-gpu/src/watch.rsreplacing whole-address-spaceAsking::hold_all()with default-on page-scoped interval holding (Askings, withVICTORY_ASK_HOLD_PAGES=0kill-switch) forask_aheadandask_rest.Verified Details
Askings::hold,overlaps,Drop for Askings): Acquires all sorted, coalesced page intervals atomically underASKING.0+ASKING.1condvar wait, avoiding lock-ordering deadlocks and interoperating cleanly with single-rangeAsking::holdandAsking::hold_all.overlapsbinary search viapartition_point(|&(_, end)| end <= a)andstart < bis sound for sorted non-overlapping half-open intervals.ask_aheadpre-grouping: Groupingk - i >= 2runs before acquiringASKINGand returning early whenruns.is_empty()avoids unnecessary locking and matches the existingpieces.len() < 2early return. Coalescing(first, last)across runs covers every pageask_run(&pieces[i..k], ...)can query, and_heldremains live through thejournal_mut()update.ask_rest(collect_rest_candidates,record_rest_pages,ask_rest_all): Cloningjournal().aheadrather thanstd::mem::takeavoids forcing concurrent readers to missj.aheadwhileask_restruns. Since all writers toj.aheadmaintain sorted, coalesced intervals (viacoalesce_intervalsorclear),contains_intervalincollect_rest_candidatesis valid, andrecord_rest_pagespreserves the deduplication check andcoalesce_intervalsbefore updatingj.aheadandKEPT.watch::ask_holds): Coversparse_hold_pagesdefault-on /"0"kill-switch,overlapsboundary/touching cases, and concurrent blocking/non-blocking behavior betweenAskings::holdandAsking::hold.PAGE_HOLDSis incremented inAskings::holdbut is not currently read or reported in diagnostics.Status
CI is currently
pending. Because this changes default-on write-watch locking on the live GPU submission / descriptor heap sync path, it warrants a local real-GPU smoke test once CI completes.Generated with Antigravity CLI (
agy).Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-02T11:18:18Z.
Autonomous architectural audit PASSED on
c193cde1(CI GREEN, allowlisted authorAndrotim):VICTORY_ASK_HOLD_PAGES=0safety kill-switch only) incrates/victory-gpu/src/watch.rs— atomic single-lock interval acquisition inAskings::hold(deadlock-free), early return whenruns.is_empty()inask_ahead, non-destructivejournal().aheadclone + empty-alonefast path inask_rest, and61/61passingwatchtests.--releaseA/B (0crashes /0DRED):14.6 -> 15.1 fps(+0.5 fpsmed,+2.93 fpsin-world avg),preparing 26.1 -> 25.0 ms(-1.1 ms, max-33.7 ms),copyback 11.4 -> 10.6 ms(-0.8 ms),title_present_wait_ms -5.09 ms,room_false 11.8% -> 0.0%,pool_not_made 4,911 -> 0,working_set -355 MBmax,private_commit -421 MBmax.preparing 19.1 -> 17.2 ms(-1.9 ms/-10.0%,prep_coremax-56.8 ms), descriptor syncwaited -50%avg /-80.6%max,thin_ms -43.4 ms,pool_not_made 116 -> 0,working_set -446 MBavg,shared_mb -123 MBmed,6.4 -> 6.4 fps.1440p90s): All 6 gates PASS (luma=100.94,near_black=0.06%,edge_energy=7.71,magenta=0.0%,final_waiting=2,167,mapped_rate=0.49 ms/s,ranges heldlock waits-62%).Squash-merging into
main.