Skip to content

Memory: avoid VirtualQuery walks in sparse windows - #142

Draft
bmjask wants to merge 1 commit into
stack/138-complete-failed-build-jobsfrom
stack/139-sparse-window-query-cache
Draft

bmjask wants to merge 1 commit into
stack/138-complete-failed-build-jobsfrom
stack/139-sparse-window-query-cache

Conversation

@bmjask

@bmjask bmjask commented Nov 26, 2026

Copy link
Copy Markdown
Owner

Stacked on #141.

This is an internal draft stack in bmjask/xcl; it is not an upstream merge request.

What and why

This unit isolates memory: avoid virtualquery walks in sparse windows as one reviewable step in the redesign.

Upstream overlap

This overlaps upstream PR xcl-dev#501 and is retained only as an internal reconciliation draft.

What is in it

  • 9b462b66 is the cleaned-stack form of integrated commit c7283497.

The patch content is preserved; only ancestry changed to omit a canceled add/revert sequence.

Tested

Tests were not rerun while packaging this already-integrated change into the draft stack.

Regression run

Not run during stack packaging.

Not tested

  • Windows MSVC build and test suite
  • D3D12 GPU execution
  • scripts/smoke.ps1 main/head comparison

AI use

Codex, GPT-5.6-sol, removed canceled ancestry, created the stack branch, and drafted this description. It did not author new code during stack packaging.

@bmjask
bmjask force-pushed the stack/138-complete-failed-build-jobs branch from ce160ef to 3b5c137 Compare November 27, 2026 00:46
@bmjask
bmjask force-pushed the stack/139-sparse-window-query-cache branch 3 times, most recently from 452d30b to fef6763 Compare November 27, 2026 05:14
@bmjask
bmjask force-pushed the stack/138-complete-failed-build-jobs branch from 215d3cd to fffaf24 Compare November 27, 2026 05:14
DirectStorage destinations and emulated CLZERO checked sparse-window pages with VirtualQuery. The measured source PR xcl-dev#501 found those walks averaged 6.7 ms, reached 138 ms, and serialized GetWriteWatch on a retail title.

Adapt its affirmative commit/protection cache to the integrated sparse lifecycle. The state lock checks one mask per 64 KiB tile and is released before batched working-set queries. Non-writable changes publish conservatively before the OS call, commits publish protection atomically, current-process *Ex handles are tracked by process ID, and probed-but-untracked pages remain in the fallback path. All uncertain cases still use VirtualQuery.

The Windows GNU library/test cross-check passed with the existing warnings. Windows MSVC runtime, GPU, and smoke tests were not available here; xcl-dev#501's timing and title results were not independently reproduced.

Source implementation and measurements: xcl-dev#501 by mrp1no with Claude Code (Claude Opus 5.5).

Assisted-by: Codex (GPT-5.6-sol)
@bmjask
bmjask force-pushed the stack/138-complete-failed-build-jobs branch from fffaf24 to dee2f21 Compare November 27, 2026 12:35
@bmjask
bmjask force-pushed the stack/139-sparse-window-query-cache branch from fef6763 to 5104d2b Compare November 27, 2026 12:35
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