perf(shader,gpu): port interp-live, stream-bound loose windows, and segment-tight list recycling #404
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/404"
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-03T17:50:34Z.
Summary
Ports three verified GPL-3.0 / GPL-3.0-or-later GPU shader and low-VRAM optimizations into MiniVI while maintaining strict D3D12 lifetime safety, DXIL soundness, and clean-room asset policy compliance:
Exact first-half pixel interpolation liveness (
VICTORY_OPT_INTERP_LIVE, default on):Bebrik229/VIctory-Ultra57f9202(GPL-3.0-or-later).victory_shader::io::raise_structured(wired acrossemitentrypoints andTRANSLATOR_ENV_KEYSinshader_cache.rs) usingStructured::boolsROBDD checks andis_full_vgpr_overwriteto prove when a foldedv_interp_p1*temp VGPR is only kept by dead inactive-lane old-destination reads, keeping FP16 pixel inputs on hardware interpolation instead of promoting toSV_Barycentrics+AttributeAtVertex.is_full_vgpr_overwriteto rejectv_permlane16_b32/v_permlanex16_b32(which preserve inactive lanes whenopsel & 2 == 0),Fields::Image { d16, tfe },Fields::Buffer { lds, tfe },Fields::Flat { lds }, andFields::Ds { gds }, and keepsHalveslazy whenStructuredis absent.Stream-bounded loose buffer windows (
VICTORY_STREAM_BOUND, default on) + sub-cell defaults:SandBar-developer/VIctory-SandBare414204and9de6e35(GPL-3.0).texture::LIVE(next_texture_after) and addsshadow::find_stream(gated onstream_bound() && window() < WINDOW) so unsized root SRV stream lookups stop at the next live texture in the cell (minimum 64 KiB) rather than spanning adjacent textures.draw.rsroot SRV lookups (includingUSER_VIEW_BIASand diagnostic logging when the slot is instage.root_srvs) throughfind_streamso biased streams cannot allocate a second full-cell loose window.VICTORY_WINDOW_KB=256,VICTORY_WINDOW_TAILS=1, andVICTORY_STREAM_BOUND=1inapps/victory/src/play.rsandscripts/play-minivi.ps1.WDDM aperture segment back-off (
VICTORY_SEGMENT_TIGHT) and immediate landed list recycling:caiocpl/victory-low-end58f3e23,b084391,6fa8ab7, and8382649(GPL-3.0).victory_gpu::host::segments(usingwindowsfeatureWdk_Graphics_Direct3D+&raw mut q) pollingD3DKMTQueryStatisticsevery 100 ms with 80% on / 70% off hysteresis usingu128overflow-safe math.Host::send_latesettles flights in the air and trims oldest idleHostLists past 64 off-thread vialist::trim_idle(host::drop_aside).Host::Held+HostList::take_heldandlist::recycle_landedso landed command lists and allocators reset and return toIDLEimmediately (landed_lagdefaults to0), while GPU-referenced deferred state, upload memory, descriptor state, host textures, twins, async refreshes, and indirect runs remain retired acrossbury_lag.Verification
Verified in
MiniVI-wt-eco-vramwithC:\msys64\mingw64\bin;C:\msys64\ucrt64\bin;onPATHandRUSTUP_TOOLCHAIN=1.98.1-x86_64-pc-windows-gnu:cargo clippy --workspace --all-targets --locked -- -D warnings: passed (0 warnings)cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: passed (0 warnings)cargo xtask policy: passed (355 files ok)cargo test -p victory-gpu --locked -- --test-threads=1:873 passed; 0 failed; 39 ignored(including new tests forsegments,list::drain_idle_excess,host::held_tests,texture::live_tests,shadow::stream_tests, andshader_cache)cargo test -p victory-shader --locked -- --test-threads=1:419 passed; 3 failed; 6 ignored— all 5 new tests inio::testsandemit::barycentric_tests::fp16_interp_live_eliminates_weighted_and_validates_with_dxilpassed (includingdxil.dllvalidation); the 3 failing tests (first_half_values_render_on_hardware_and_warp,rectangles_are_drawn_whole,the_rectangle_stage_is_a_geometry_shader) fail identically on baselinemain(21fcafd) against the local Windows SDK10.0.22000.0\x64\dxil.dll(101.6.2104.33) PSV0 checkcargo test -p xtask -p victory --locked:victory48 passed; 0 failed(census2 passed; 0 failed),xtask8 passed; 0 failedcargo test -p victory-core -p victory-formats -p victory-game -p victory-hle -p victory-pe -p victory-pipeline -p victory-loader --lib --locked: all library test suites passed (victory-core15,victory-formats69/7 ignored,victory-game3,victory-hle249/3 ignored + 1 subprocess,victory-loaderlib 66,victory-pe36,victory-pipeline13; notevictory-loader --test load_probewas excluded from lib run because its nestedhle-probebuild passes MSVC-only/DELAYLOAD:under the GNU linker)Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-03T18:03:47Z.
Triage (
226628d9, CIcheckPASS):+1,505/-80, 14 files) with zero opt-in toggles (VICTORY_OPT_INTERP_LIVE,VICTORY_STREAM_BOUND+VICTORY_WINDOW_KB=256/VICTORY_WINDOW_TAILS=1inplay.rs/play-minivi.ps1, andVICTORY_SEGMENT_TIGHT=80default /0disables). Directly attacks Directive #40 Rank 3 (shadow::LOOSE4 MiB window slack).#282) + Gate 3 live GPU verification:raise_structured/is_full_vgpr_overwritesoundness on FP16 pixel inputs, (b)texture::LIVE+shadow::find_streamstream bounds (no truncated root SRVs or staleLIVEentries), (c)D3DKMTQueryStatisticsaperture polling +Host::Held/list::recycle_landed(landed_lag = 0) GPU-lifetime safety.--release1440p & 4K A/B vsmain(21fcafdc) (verify RAM/VRAM drop, FPS,copyback,0crashes/DRED) +--features diagnosticsvisual PNGs.apps/victory/src/play.rs,scripts/play-minivi.ps1,host.rs, andlist.rs(shared with#403and#400) — merge sequentially.Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-03T19:02:19Z.
Automated triage for the maintainers (not an approval).
Verdict:
needs-rebase· CI (check):noneThis PR no longer merges cleanly into
main.To change the verdict: Rebase onto current
mainand resolve conflicts; CI and triage will run again automatically.Generated with Antigravity CLI (
agy).Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-03T19:02:40Z.
Marking
triage: needs rebaseafter#400merged ontomain(c59a8027). Once rebased with green CI, ready for Gate 2 re-signoff + Gate 3 GPU A/B.Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-03T20:01:42Z.
Verified clean merge with main (
d09133a4) and CI check PASS. Swapped label to triage: needs gpu test — awaiting Gate 2 re-signoff + Gate 3 1440p/4K plain --release A/B + --features diagnostics PNGs.