Skip to content

kernelx: track 64 KiB sparse reservations in mirror table - #2

Draft
RandomGithub12309 wants to merge 1 commit into
mainfrom
kernelx/sparse-mirror-tracking
Draft

RandomGithub12309 wants to merge 1 commit into
mainfrom
kernelx/sparse-mirror-tracking

Conversation

@RandomGithub12309

Copy link
Copy Markdown
Owner

Track 64 KiB sparse VirtualAlloc reservations and VirtualFree releases in kernelx::mirrors alongside the fallback reserve_watched path.

Previously, VirtualAlloc only called mirrors::reserved on fallback allocations when MEM_64K_PAGES did not land in uma.sparse_reserve (and VirtualFree only called mirrors::released on fallback releases), so 64 KiB CPU/GPU mirror pairs placed in sparse windows were missed by mirrors::source.

(Parked as a draft PR on RandomGithub12309/xcl while #667 and #674 are in review upstream; rebase onto ivall/xcl:main and run the full workspace test suite + scripts/smoke.ps1 before opening upstream.)

What is in it

  • crates/xcl/src/hle/kernelx.rs: call mirrors::reserved on reserve-only (t & 0x1000 == 0) 64 KiB uma.sparse_reserve allocations, call mirrors::released on sparse MEM_RELEASE, and add virtual_alloc_64k_pairs_track_mirrors_across_sparse_and_fallback.

Tested

  • Hardware: NVIDIA GeForce RTX 5050 Laptop GPU (driver 32.0.16.2114), Intel Core Ultra 7 255HX (20 cores), Windows 11 Build 26300, rustc 1.100.0 (0ef1bc386 2026-11-09) stable-x86_64-pc-windows-msvc (debug).
  • cargo test -p xcl --lib hle::kernelx::tests -- --test-threads=4 --nocapture: 24 passed, 0 failed, 1 ignored (scatter_timing ignored; virtual_alloc_64k_pairs_track_mirrors_across_sparse_and_fallback and gpu_view_reservations_name_their_cpu_view both passed).

Regression run

  • Pending: parked on fork branch (main baseline dd2ae9a already captured on this machine; run cargo test --workspace -- --test-threads=4 and scripts/smoke.ps1 before submitting upstream to ivall/xcl).

Not tested

  • Full cargo test --workspace and scripts/smoke.ps1 on this standalone branch (deferred until ready to open upstream), AMD/Intel GPUs, Wine/Linux.

AI use

  • Antigravity with Gemini 4 Neon — wrote the change and unit test; test command executed on the hardware listed above.

VirtualAlloc only registered mirrors::reserved on the fallback reserve_watched path when 64 KiB allocations did not use uma.sparse_reserve, and VirtualFree only called mirrors::released on fallback releases.

Track reserve-only (t & 0x1000 == 0) 64 KiB uma.sparse_reserve allocations in mirrors::reserved and sparse MEM_RELEASE in mirrors::released, with a regression unit test covering paired sparse reservations.

Assisted-by: Antigravity (Gemini 4 Neon)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant