perf: batch contiguous XMem page-view registration #651
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/lobomfz--VIctory-xmem!651
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-651"
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?
@tommiehansen on GitHub · 2026-12-05 23:56 UTC · original
tommiehansen:perf/phase13-mapping-views-20261206→main· +219 −25 · 5 files · 3 commits · openWhy
A contiguous XMem mapping can register many individual 64 KiB page views while holding mapping metadata locks and invalidating guards repeatedly. Streaming or large mapping operations can therefore incur avoidable CPU bookkeeping even when the backing and offsets form one compatible run.
What changes
With
VICTORY_BATCH_MAPPING_VIEWS=1, register compatible contiguous views under one lock, update the run index once and invalidate guards once per run. Individual view identity and alias/partial-unmap behavior remain intact. Driver mapping calls, ordering and HWRT address visibility are unchanged. Incompatible runs retain the existing path. Inspired by Boxon's structural mapping work; this is XMEM's metadata implementation, not a sparse Vulkan backend.Benchmark results — Windows CPU metadata registration
Latest CI 47587142974,
62e9f08. Eight paired blocks per size, 16 samples per arm; all 40 blocks exact. Absolute times are medians of block medians; changes are median paired percentages.At 256 pages the absolute median difference is 25.5 µs; pooled p95 90.6 → 30.6 µs. Independent earlier run found 55–57% reductions for 4–256 pages and a neutral one-page median, 32/32 multi-page wins. These results isolate CPU metadata, not driver ioctl cost, full mapping time or gameplay FPS.
Why this should be merged
Repeated, exact results demonstrate a scoped CPU bookkeeping benefit for multi-page runs without requiring a driver change. The conservative opt-in path and one-page control bound the impact; actual end-to-end mapping benefit remains a separate hardware question.
Validation and compatibility
Initial alias/partial-unmap tests and latest concurrent alias/partial-unmap test and HLE production compile passed. The actual patched-driver XMemMapPhysicalPages/physical backing read/activation fixture compiles but has not been run on a patched physical AMD driver.
Reproduce:
cargo test --locked --release -p victory-gpu --lib page_run_paired_registration_cost -- --ignored --nocapture --test-threads=1. Request full mapping and activation measurements with the patched UM driver, option off/on, before claiming wider benefit or enabling by default.Continuous comparison verified
CI 47590692671 at unchanged
62e9f08completed generic Quick and Standard (2/8 runs per arm), both comparable, but explicitly missing changed-path coverage. Native metadata job also completed all 40 exact paired blocks. Generic Mapping evidence is not an XMem driver performance measurement. Generic raw report · Native raw data.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.