perf(gpu/host): default-on lazy card compare and hot-piece narrowing #327
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/327"
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:43:35Z.
Summary
Adapts default-on lazy card-memory compares and hot-piece flight-write narrowing (
crates/victory-gpu/src/host/lazy.rs, ported cleanly fromupsidedownstack/VIctory-Performance @ ad20a7e/ GPL-3.0, 100% title-neutral & repo-neutral) with=0kill-switches:VICTORY_LAZY_COMPARE_MB=64,=0disables): On card copies >= 64 MiB, each submission only compares 64 KiB pieces that were recently found written (hot > 0, decaying overVICTORY_LAZY_HOT=64compares), pending pieces uploaded by CPU (hold_back+forced), and a bounded rolling sweep ofVICTORY_LAZY_SWEEP=128cold pieces (preservingmode = 2hashes for compared pieces only).VICTORY_LAZY_NARROW=1,=0disables): MaintainsLine::narrow/Line::blocking()so read-blocking andcard_stepschecks against large card copies only wait on hot pieces while keepingline.writtenintact for bottom-of-pipe value waits and CPU-merge refreshes.list_upload_pool_testsout ofcrates/victory-gpu/src/host.rsintocrates/victory-gpu/src/host/list_upload_pool_tests.rs(keepinghost.rsat651,696bytes, under the655,360byte policy cap).Verification
cargo +1.98.1-x86_64-pc-windows-gnu xtask policy(324 files ok),cargo +1.98.1-x86_64-pc-windows-gnu test --locked -p victory-gpu lazy(5 passed),list_upload_pool_tests(9 passed), dual workspaceclippy --all-targets --locked -- -D warnings(default &--features diagnostics),objdump -p(standard Windows DLLs only).--releaseA/B vsmain(1dffebf, Series X + DLSS quality, RTX 4060 Ti 8 GB, 0 crashes/DRED):14.2 -> 14.7 fps(+0.5 fps), Mean FPS12.19 -> 13.21 fps(+1.02 fps),preparing26.1 -> 24.6 ms(-1.5 ms;preparing_core_ms avg34.22 -> 27.62 ms,-6.60 ms),copyback12.0 -> 10.3 ms(-1.7 ms), card pieces compared~8,864 -> ~3,267/frame(-63%),used_max6384 -> 6336 MB.~8,520 -> ~2,692/frame(-68%),preparing20.1 -> 18.65 ms(-1.45 ms;preparing_core_ms med35.60 -> 28.40 ms,-7.20 ms),copyback14.75 -> 12.8 ms(-1.95 ms),working_set_mb max21,083 -> 19,958 MB(-1,125 MB),shared_mb med5,792 -> 5,645 MB(-147 MB), median FPS6.35 -> 6.3 fps(4K GPU-bound).--features diagnosticsVisual Gate (diag-pr-lazy-1440p-90s): PASS (6/6 gates) —world_windows=18, max_draws=14788, crashes=0, used_max=6229 MB / budget_min=6684 MB, final_waiting=4478, mapped_rate=0.53 ms/s, pngs=24 lit=20/24 luma=100.08 near_black=0.06% edge_energy=7.89 magenta=0.0%;2,722lazy compares/frame vs8,368full. Inspectedframe-4357.png,frame-4365.png,frame-4371.png— clean geometry, textures, reflections, lighting, and character rendering.Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-02T11:49:00Z.
Autonomous architectural audit PASSED on
28fcbdf3(allowlisted authorAndrotim):VICTORY_LAZY_COMPARE_MB=64,=0disables) & hot-piece blocking narrowing (VICTORY_LAZY_NARROW=1,=0disables) incrates/victory-gpu/src/host/lazy.rs+host.rs+card_steps.rs, preservingline.writtenfor bottom-of-pipe/CPU-merge correctness and keepinghost.rsbelow the policy cap (651,696bytes).--releaseA/B (0crashes /0DRED):14.2 -> 14.7 fps(+0.5 fpsmed,+1.02 fpsmean),preparing 26.1 -> 24.6 ms(-1.5 ms;preparing_core_ms avg -6.60 ms),copyback 12.0 -> 10.3 ms(-1.7 ms), card pieces compared-63%,used_max 6,384 -> 6,336 MB(note: single-runfinal_waitingvaried3,672 -> 6,024as faster streaming reached the 8 GBroom=falseboundary sooner, while 4K improved12,975 -> 12,716and diagnostics passed at4,478).preparing 20.1 -> 18.65 ms(-1.45 ms;preparing_core_ms med -7.20 ms),copyback 14.75 -> 12.8 ms(-1.95 ms), card pieces compared-68%,working_set_mb max -1,125 MB,shared_mb med -147 MB,final_waiting 12,975 -> 12,716,6.35 -> 6.3 fps(4K GPU-bound).diag-pr-lazy-1440p-90s): All 6 gates PASS (luma=100.08,near_black=0.06%,edge_energy=7.89,magenta=0.0%);frame-4357.pngandframe-4365.pnginspected directly — crisp waterfront structures, reflections, foliage, sky, and HUD with zero visual regressions.Status: Waiting on CI run
46874043020(Clippyx2 green,Testscurrently in progress). Will squash-merge automatically on the next cycle once green.Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-02T12:03:45Z.
Automated triage for the maintainers (not an approval).
Verdict:
needs-gpu-test· CI (check):passingTechnical Review — PR #327
Summary: Adds default-on lazy card-memory compares (
VICTORY_LAZY_COMPARE_MB=64,=0disables) and hot-piece flight-write narrowing (VICTORY_LAZY_NARROW=1,=0disables) incrates/victory-gpu/src/host/lazy.rs, wired intocrates/victory-gpu/src/host.rsandcrates/victory-gpu/src/host/card_steps.rs, and extractslist_upload_pool_testsintocrates/victory-gpu/src/host/list_upload_pool_tests.rsto stay under thehost.rsfile-size cap. CI is passing and static/policy checks are clean.What was verified
hold_backcorrectness (host.rs,host/lazy.rs):>= min()(64 MiBdefault),lazy::hold_backexcludespendingpieces from the post-upload hash pass (mode = 0) and marks themforced, whileis_wholefirst-time uploads still hash all pieces.lazy::selectschedules hot/forced pieces for declared ranges, andlazy::sweepdrains any remaining forced pieces plus up toVICTORY_LAZY_SWEEP(128) rolling pending pieces across both declared and_syncedcopies.mode = 2whenever(r.lazy || flown) && !r.picked, preserving existing hashes for skipped pieces and updating hashes only for compared pieces.CardPlan::lazy_foundfilters onr.lazy && r.compared(safe ifwork.differsoverflows) and is invoked in both the relay landing path andHost::card_back.host.rs,host/card_steps.rs):Line::narrowis maintained alongsideLine::writtenon submission (join_narrow), on partial settle/rebuild, and on full settle clear.late_blocked,relay_wait,card_steps::cut_for, andcard_stepsblocking checks useLine::blocking(), whileline.writtenremains intact for bottom-of-pipe value waits and CPU-merge refreshes.lazy::STATESis a leaf mutex and never acquiresLINEorCARD_WORK.host/list_upload_pool_tests.rs): Verbatim move of existing unit tests out ofhost.rs.Minor non-blocking notes
lazy::STATESis keyed byshadow.id()and entries are not evicted onShadowdrop; negligible for a handful of long-lived>= 64 MiBcopies, though worth keeping in mind if a title churns large shadow allocations.mb << 20inlazy::min()could usesaturating_mul(1 << 20)to avoid shift overflow on extreme env values.Verdict:
needs-gpu-testLogic, kill-switches, and CI look solid, with no blocking issues found. Because this changes default-on D3D12 host GPU compare and flight-write synchronization behavior (
VICTORY_LAZY_COMPARE_MB=64,VICTORY_LAZY_NARROW=1), a local real-GPU smoke test is warranted before merging.(Automated technical triage review — not formal maintainer approval.)
Generated with Antigravity CLI (
agy).