KernelX: batch contiguous scatter unmap home-page commits #1175
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from ivall/xcl. Originally posted by TG0000 on 2026-11-24T12:56:25Z.
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 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
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T13:14:34Z.
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.
Imported from ivall/xcl. Originally posted by fromthemoonx on 2026-11-24T14:30:39Z.
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
Imported from ivall/xcl. Originally posted by JoaoPauluu on 2026-11-24T14:34:51Z.
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
upstream-sync referenced this pull request2026-11-25 03:04:25 +00:00
Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-25T10:09:53Z.
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.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T05:01:48Z.
Triage (#1607) – head
3b54c24This change is already on main: commit
ad58990has the same subject and an identical patch (commit_homes_ahead,HOMES_AHEAD,Away::ready,lazy::is_markedand the three tests). The line overlap with #3099/#3111/#3112/#3335/#3361 comes from their amd-dev base, which contains the same commit.Recommendation: close (superseded by main commit
ad58990).AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Imported from ivall/xcl. Originally posted by throny on 2026-12-01T12:43:32Z.
Closing as superseded: this change is already on
main(ad58990). identical patch-id (git patch-id --stable of the PR diff ==ad58990) andad58990is an ancestor of origin/mainTwo independent checks found this: Foniass's close list on #1607 and ours against current
main. If something here is still missing onmain, say so and reopen it, or ask and I will.AI use: Claude Code (Claude Opus 5.5); the per-PR comparison was done by Claude Sonnet 5.5 sub-agents.
Pull request closed