Memory: bound coherent decommits to whole pages in one block #1453
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1463"
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 anakatt on 2026-11-24T16:29:21Z.
Stacked on #1357; merge that first. The new change is
215d5eacbf808a4372b69b4843230ce9ff89e4fcon top of9aa114cda968072c7165578da16313ec0616e646.I corrected the coherent-memory
VirtualFree(MEM_DECOMMIT)path. It cleared only the requested bytes, ignored zero-size decommits, and could overwrite the next allocation.What is in it
Tested
Windows 11 Pro ARM64 10.0.26100.1742, UTM VM with 4 GiB RAM, x64 Rust 1.100.0 (
x86_64-pc-windows-msvc) under Windows emulation. These checks use real virtual memory, not a GPU.I tested an archive of main
47efa2ecea0a12934719ae69b81930cf02a4b1c3with #1357's helper and the changed source/test files copied in, then committed those files as the head above. These were not clean-checkout smoke runs.Before the fix:
The zero-size request left stale data from byte zero, unlike native Windows after recommit.
After the fix:
The regression compares return values, failure codes and bytes against native
VirtualFreeplus recommit: aligned/unaligned first-page zero-size requests, an invalid interior-page zero-size request, a two-page span, and a cross-allocation request. It also verifies that the adjacent allocation stays unchanged and neither allocation is released.Regression run
Not run. I do not have generated
xcl-smokeblocks from clean main and PR-head commits using the same title and duration. This remains a draft until those required runs are available.Not tested
Full workspace suite, real-title smoke runs, concurrent GPU access and gameplay effects. The tests do not claim physical memory reclamation.
AI use
omp, openai-codex/gpt-6-astra: investigated native Windows behavior, implemented the fix and regression, ran the Windows VM checks, and prepared this PR.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T18:52:58Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~21 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodifiedmain.)Thanks!
Imported from ivall/xcl. Originally posted by CuteBooty on 2026-11-24T21:02:16Z.
Regression run on a retail title for
215d5ea: pass (no device removal, no crash, frames and peak commit within the check's limits).Tested
scripts\smoke.ps1 -Game <folder> -Seconds 60, no input, on this PR's head as it is and onmain47efa2e, the commit it branches from (so with #1357, on which it is stacked, in it), each from a clean checkout. Each build ran twice back to back; the blocks are the second runs. Themainblock is shared with my reports on other PRs of the same base.main:
this PR:
Not tested
mainmerged in, AMD and Intel GPUs.AI use
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T05:50:54Z.
Triage (#1607) – head
215d5eaStacked on #1357 (its first commit
9aa114cis #1357); the top commit addsUma::decommit_coherent(whole pages, bounded to one block). Not a duplicate, and main's coherentVirtualFreestill zeroessizebytes unchecked onMEM_DECOMMIT.Main's
MEM_RELEASEpath for coherent blocks now also callsforget_title_mappings,mirrors::place_gone/releasedandsparse::remappedbeforeu.free;coherent_virtual_free's release branch must keep those when this is rebased.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.