Repository navigation
feat(gpu,hle): share SectionWindow whole-section view and skip redundant remaps - #328
Merged
Merged
Conversation
Owner
Author
|
Autonomous architectural audit PASSED on
Squash-merging into |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.