Repository navigation
Conversation
XMemMapPhysicalPagesScatter takes each unmapped page home on its own: one VirtualAlloc, one VirtualQuery and, in a sparse window, one UpdateTileMappings and one Signal per 64 KiB page. A retail game unmaps 4136 and then 6720 pages in two calls while it loads, and the homes of each call are one run of neighbours: 2.7-3.2 s in those two calls, the larger part in the tile mappings. The parts of a call that only unmap (1024 pages, 64 MiB, at a time) now commit their homes ahead, a run of neighbouring pages per VirtualAlloc and per sparse::committed. Homes that are committed already, or cannot be, still go page by page, and a call that fails part way gives back the homes no page went to. The two calls take 0.4-0.5 s. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Independent verification on current Machine: Windows 11, Ryzen 9 7900X + RTX 3060 Ti; Rust stable MSVC, debug.
AI use: test runs by Devin (Cognition, SWE-2); no code changes. |
|
Whole-suite NVIDIA run, to go with the Tested
Not tested
AI use
|
|
A run on Linux under Wine. Tested
Not tested
AI use
|
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.
XMemMapPhysicalPagesScattertakes each unmapped page home on its own: oneVirtualAlloc, oneVirtualQueryand, in a sparse window, oneUpdateTileMappings+Signalper 64 KiB page. A retail game unmaps 4136 and then 6720 pages in two calls while it loads, and the homes of each call are one run of neighbours. The parts of a call that only unmap now commit their homes ahead in runs.What is in it
kernelx.rs:commit_homes_ahead, for at most 1024 pages (64 MiB) at a time. Homes already committed go page by page as before; a call that fails part way gives back the homes no page went to. Mapping pages is unchanged.kernelx/lazy.rs:is_marked.Tested
cargo test --workspace --no-fail-fast -- --test-threads=4: 741 passed, 3 failed, 41 ignored. The same 3 fail on clean main 47efa2e (738 passed, 3 failed, 41 ignored):placed_title_textures_share_vram_and_preserve_pixelsreads zero in a 3D mip (D3D12.X: map and unmap 3D texture mips separately #1028 describes it), andtransitions_apply_when_their_list_is_submittedandd32s8_targets_take_their_own_size_of_video_memoryfind the mutex it poisoned. The test output had no SKIPPED lines, but captured output of passing tests is not shown.Regression run
main:
PR:
Not tested
XMemMapPhysicalPageswithout a page array, and scatters that map and unmap in one part, still go page by page.AI use