KernelX: batch contiguous scatter unmap home-page commits #1184
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1184
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1184"
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?
@TG0000 on GitHub · 2026-11-24 12:56 UTC · original
TG0000:perf/scatter-unmap-home-runs→main· +178 −3 · 2 files · 1 commits · openXMemMapPhysicalPagesScattertakes 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 main47efa2e(738 passed, 3 failed, 41 ignored):placed_title_textures_share_vram_and_preserve_pixelsreads zero in a 3D mip (#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
@DavidM1911 on GitHub · 2026-11-24 13:14 UTC · original
Independent verification on current
main384f7f7(branch already contains it — clean).Machine: Windows 11, Ryzen 9 7900X + RTX 3060 Ti; Rust stable MSVC, debug.
cargo test -p xcl --lib kernelx: 35 passed, 0 failed, 1 ignored — includes the newa_scatter_that_unmaps_commits_homes_in_runscovering the batched home-page commits.AI use: test runs by Devin (Cognition, SWE-2); no code changes.
@fromthemoonx on GitHub · 2026-11-24 14:30 UTC · original
Whole-suite NVIDIA run, to go with the
kernelxrun above.Tested
stable-x86_64-pc-windows-msvc3b54c24f571b27b55a6b3053db094c513b6c44ca(on its base47efa2e),cargo build --workspace, thencargo test --workspace --no-fail-fast -- --test-threads=4:main.cargo build --release --workspacefirst): 744 passed, 0 failed, 41 ignoredmain930e8b4(no conflict), debug: 754 passed, 0 failed, 41 ignored.filter(|_| !lazy::is_marked(at))removed),a_scatter_that_unmaps_commits_homes_in_runsfails withleft: 2, right: 4.commit_homes_aheadbeing called (main's page-by-page path),a_scatter_that_unmaps_commits_homes_in_runsanda_home_another_page_is_mapped_at_is_not_committed_aheadfail.hle::kernelxtests, 10 runs: 10 of 10 passed (34 passed, 1 ignored each)main930e8b4. At the head itself it also logs id 538, which is #958, fixed onmainsince your base.gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardwareNot tested
AI use
@JoaoPauluu on GitHub · 2026-11-24 14:34 UTC · original
A run on Linux under Wine.
Tested
x86_64-pc-windows-gnu.3b54c24as it is (based on47efa2e), no uncommitted changes. The lib test binary runs under Wine, one test per process (--exact). The commit and decommit calls under kernelx are Wine's here.hle::kernelx::tests::a_home_another_page_is_mapped_at_is_not_committed_ahead: ok, no SKIPPED.hle::kernelx::tests::a_scatter_refused_part_way_gives_its_homes_back: ok, no SKIPPED.hle::kernelx::tests::a_scatter_that_unmaps_commits_homes_in_runs: ok, no SKIPPED.Not tested
AI use
@thehollowedone on GitHub · 2026-11-25 10:09 UTC · original · edited 2026-11-25 10:31 UTC
Independent Windows run on 3b54c24. Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti (621.35), Rust 1.99.1 MSVC, DXC 1.8.2502.11.
cargo build --workspace --offline --locked -j 4passed.cargo test --workspace --offline --locked --no-fail-fast -j 4 -- --nocapture --test-threads=4finished with 744 passed, 0 failed, 41 ignored, including two wave64 runtime skips in Cargo’s pass count.A synthetic release fixture timed only
XMemMapPhysicalPagesScatteron the native D3D12 sparse backing. Both paths ran in the same binary, with a test-only switch disabling the ahead-of-time commits for the page-by-page control. Each case used four samples per path in alternating order, with fresh mappings and validation outside the timed interval.The batched path issued five and seven ahead-of-time commit ranges respectively. Both paths copied every page back and verified exact markers at the first and last word of each page across all 16 samples.
cargo test --release --offline --locked -j 4 -p xcl --lib local_scatter_home_batch_timing -- --nocapture --test-threads=1passed 1 of 1 without skips. These timings cover the synthetic unmap call.Retail startup follow-up. I used one release binary built from main 568e7db with 3b54c24 applied and the same local guards and timing hooks in both arms. The control disabled only the ahead-of-time commits. Both runs started offline from separate copies of the same profile and cache seed, with no input. Each call completed successfully.
One startup run per arm, page-by-page first. The implicit driver cache was uncontrolled. Both calls happened after the first frame. The comparison measures time inside those calls and leaves whole-load time and frame pacing unverified.
AI use: Codex (GPT-6, exact variant unspecified) wrote the scratch fixture and timing hook, ran the tests and drafted this report.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.