feat(gpu,hle): share SectionWindow whole-section view and skip redundant remaps #328
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/328"
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-02T12:18:08Z.
Summary
Shares one refcounted whole-section VA mapping between
victory-hle::xmemandvictory-gpu::inplace, skips unnecessary alias guard scans for non-aliased views, and avoids redundant unmap/remap churn on identicalxmemmappings:SectionWindow/Arc<WholeView>(crates/victory-gpu/src/{inplace.rs,lib.rs,land.rs,watch.rs},crates/victory-hle/src/modules/xmem.rs):MapViewOfFilemappings inxmem::Section::windowandinplace::beside/beside_pagewith one refcountedSectionWindow(Arc<WholeView>)mapping created viatitle_memory_section_window.title_memory_section_gonefrom unmapping out from under an activeSectionWindoworbesidereader (dropping/unmapping happens cleanly outside theVIEWSlock once all holders finish).views_mappedskip (inplace.rs):title_memory_viewonly invokeswatch::views_mappedwhenshown.len() >= 2, eliminating redundant shard/protected-bitmap checks for single-view physical pages.xmem.rs): AddsPhysical::shows_run/Physical::shows_slicesto skip unmap/remap/GPU-notification churn inmap_pages(!lazy) andalias_as(!lazy) when the destination already maps the exact same physical pages with matching view granularity (while still coalescing fragmented single-page views whenuns_in_one = true).
Verification
cargo +1.98.1-x86_64-pc-windows-gnu xtask policy(322 files ok),cargo +1.98.1-x86_64-pc-windows-gnu test --locked -p victory-gpu inplace(11 passed),victory-hle xmem -- --test-threads=1(35 passed, 0 failed, 1 ignoredbenchmark),victory-gpu land&watch, dual workspaceclippy --all-targets --locked -- -D warnings(default &--features diagnostics),objdump -p(standard Windows DLLs only).--releaseA/B vsmain(e1130bf, Series X + DLSS quality, RTX 4060 Ti 8 GB, 0 crashes/DRED,no_view_warns=0):14.2 -> 14.9 fps(+0.7 fps), Mean FPS12.39 -> 15.73 fps(+3.34 fps),working_set_mb max19,669 -> 19,169 MB(-500 MB),private_commit_mb max21,062 -> 20,784 MB(-278 MB),thin_ms avg461.1 -> 446.8 ms(-14.4 ms),final_waiting3,636 -> 2,456.6.3 -> 6.3 fps,working_set_mb avg16,888 -> 16,477 MB(-411 MB; max20,545 -> 20,387 MB),private_commit_mb avg19,236 -> 18,976 MB(-260 MB),shared_mb avg4,663 -> 4,481 MB(-182 MB),thin_ms avg533.0 -> 510.9 ms(-22.1 ms),preparing_core_ms med31.80 -> 29.60 ms(-2.20 ms).--features diagnosticsVisual Gate (diag-pr-secwin-1440p-90s): PASS (6/6 gates) —world_windows=21, max_draws=13961, crashes=0, used_max=6258 MB / budget_min=6690 MB, final_waiting=1793, mapped_rate=0.8 ms/s, pngs=24 lit=20/24 luma=101.22 near_black=0.07% edge_energy=7.74 magenta=0.0%. Inspectedframe-2376.png,frame-2384.png,frame-2390.png— spotless rendering.Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-02T12:48:55Z.
Autonomous architectural audit PASSED on
1daa6a2f(CI GREEN, allowlisted authorAndrotim):SectionWindow(Arc<WholeView>)sharing one whole-section VA mapping betweenxmem::Section::windowandinplace::beside/beside_page(safe off-lock unmap on drop), non-aliasedviews_mappedskip (shown.len() >= 2), and granularity-preservingshows_run/shows_slicesremap no-op fast path (zero new opt-in switches).--releaseA/B (0crashes /0DRED):14.2 -> 14.9 fps(+0.7med /+3.34mean),working_set max -500 MB,private_commit max -278 MB,thin_ms -14.4 ms,final_waiting 3,636 -> 2,456.6.3 -> 6.3 fps,working_set avg -411 MB,private_commit avg -260 MB,shared avg -182 MB,preparing_core med -2.20 ms,thin_ms -22.1 ms.1440p90s): All 6 gates PASS (final_waiting=1,793,luma=101.22,near_black=0.07%,edge_energy=7.74,magenta=0.0%);frame-2376.pngandframe-2384.pnginspected directly — crisp lighting, reflections, and zero visual regressions.Squash-merging into
main.