Skip to content

[upstream #934] kernelx: preserve explicitly committed physical pages on unmap - #160

Closed
ufoptg wants to merge 1 commit into
mainfrom
upstream-pr/934
Closed

ufoptg wants to merge 1 commit into
mainfrom
upstream-pr/934

Conversation

@ufoptg

@ufoptg ufoptg commented Nov 24, 2026

Copy link
Copy Markdown
Owner

A Windows VirtualAlloc commit can populate a lazy physical-page mapping without invoking XCL's lazy fault handler. Unmapping then discards the bytes as if the page were untouched.

What is in it

  • Preserve committed spans on unmap and leave reserved spans zero. If a committed span cannot be read, keep the mapping so the caller can restore access and retry. Added regressions for a full commit and disjoint 4 KiB commits.

Tested

  • Windows 11 build 26300, RTX 4070 driver 621.35, Intel i7-13700K, rustc 1.94.1. Debug tests and release smokes.
  • cargo test --workspace --offline --locked -- --test-threads=4 reported 718 passed, 0 failed, 41 ignored. Two of the reported passes printed SKIPPED for no wave64: gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware.
  • Both preservation regressions failed with the runtime from main and passed on this head. The focused kernelx suite reported 27 passed, 0 failed, 1 ignored.

Regression run
Both clean builds ran the upstream smoke script offline for 60 seconds with fresh private data and separate cold DXIL caches. An earlier pair with copied saves hit the same startup breakpoint on both builds, so the fresh-profile pair below is the gate.

Main

xcl-smoke v1
commit: 09940bb87fa11bc394fd9e5de570c2b7cfd16323
gpu: NVIDIA GeForce RTX 4070
title: RetailTitle
seconds: 60
exit: 0x0
frames shown: 459 (PresentX 459)
presents per 2 s (last 3): 11 11 14
device removals: 0
crashes: 0
peak commit: 15345 MB

This PR

xcl-smoke v1
commit: 54ba01423ba0c19a24046c370841d31c0635b4f4
gpu: NVIDIA GeForce RTX 4070
title: RetailTitle
seconds: 60
exit: 0x0
frames shown: 546 (PresentX 546)
presents per 2 s (last 3): 27 24 25
device removals: 0
crashes: 0
peak commit: 15339 MB

Not tested

  • The retail smoke does not show whether the title exercised the specific external-commit path. AMD and Intel GPU runs were not performed.

AI use

  • Codex, GPT-6 (exact deployment identifier unavailable), implemented the fix and regression tests and assembled the report from the retained test and smoke outputs.

Mirror of xcl-dev#934 (auto-synced, do not edit).

VirtualAlloc can populate a lazy mapping without entering the fault handler. Save the committed spans before releasing the mapping and keep reserved spans zero. Keep unreadable mappings intact so the caller can restore access and retry.
@ufoptg

ufoptg commented Nov 25, 2026

Copy link
Copy Markdown
Owner Author

Upstream PR xcl-dev#934 was closed or merged.

@ufoptg ufoptg closed this Nov 25, 2026
@ufoptg
ufoptg deleted the upstream-pr/934 branch November 25, 2026 00:08
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.

2 participants