kernelx: preserve null scatter unmaps with physical aliases #3074
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3074"
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 ZekkJJ on 2026-11-27T21:36:28Z.
Stacked on #2307, which carries #2293 and #2294 by @adiologydev. Review the final commit,
785d7dc5533edc8577c9a8e8e221acd40d980d23, against the clean integration parent3878609d850826fa51813477ffa7482081fb2383. The prerequisite commits are the original upstream commits. Focused diffOn
main, #495 by @notdxbi treats a nullXMemMapPhysicalPagesScatterarray as an unmap for each address. Integrating #2307 onto current main preserves the legacy branch's null handling, but the section-backed branch still advances the null pointer. Starting at the second entry,map_aliasedtries to read a page number at address0x8. An archived retail crash with matching PDBs resolves tomap_aliased <- XMemMapPhysicalPagesScatter.What is in it
map_aliasedpath already interprets it as an unmap.Tested
Windows 11 build 26200, Ryzen 7 8845HS, 16 GiB RAM, NVIDIA RTX 4060 Laptop GPU 8 GiB, driver
32.0.16.1656, Rust1.98.1MSVC.On
785d7dc5533edc8577c9a8e8e221acd40d980d23withXCL_PAGE_ALIAS=1, the focused filters for kernelx alias, sections and guards, DirectStorage physical pages, and concurrent-decommit texture reads gave 23 passed, 0 failed, 0 ignored, 0 capability skips.The existing byte-exact GPU mirror upload fixture passed in conventional mode. Alias mode fails its write-watch setup assertion before readback, matching the prior Windows report on the prerequisite. Prerequisite test report
After building the test-title fixtures with
cargo build --workspace,cargo test --workspace --no-fail-fast -- --test-threads=4exited 0. The harness reported 1,486 pass statuses, 0 failures, and 47 ignored. It emitted 27 explicit skip notices separately (21 missing wave64, 3 unsupported per-lane forms, 1 Developer Mode requirement, 1 missing heap-window capability, and 1 default-mode skip of the new opt-in test, which passed separately).Regression run
The clean release builds are main
6089122a1c96dff16e93b6fdf04c8ed20cfb6102and candidate785d7dc5533edc8577c9a8e8e221acd40d980d23. No fresh smoke block was generated. The clean Series S preflight expired at 3205 MiB free RAM and 13200 MiB free commit. The guarded runner requires 6,600 MiB RAM and 18,000 MiB free commit at startup. The last idle check still showed 4129 MiB RAM and 13941 MiB free commit. Series X was deferred.Historical evidence from a different integration, using the same executable in both Series S modes, reached 4,200 DirectStorage requests and 262 MiB with zero storage errors in both. System commit growth was 9,426 MiB in conventional mode and 1,985 MiB with section aliasing, a difference of 7,441 MiB. Both runs later crashed. The conventional crash was a texture read during concurrent decommit. The alias crash was the null scatter path covered here. This historical measurement belongs to the alias architecture and accompanying integration.
Not tested
AI use
Codex (GPT-6 family, exact runtime variant unavailable) recovered and compared the patches, wrote the follow-up and regression test, ran local validation, and drafted this description.
Imported from ivall/xcl. Originally posted by grahamster2 on 2026-11-27T22:36:00Z.
Retail world test of #3074 + #3075 with
XCL_PAGE_ALIAS=1: it reaches the world, ran the full 720 s without a crash, and uses much less memory.Setup
XCL_DEVICE_TYPE=lockhart).6089122aplus some local default-off memory diagnostics, with785d7dc5(#3074) andcfe04f43(#3075) merged on top. No shader-cache-key files changed, so both runs used the same warm shader cache.XCL_PAGE_ALIAS=1and the #3074/#3075 code itself: the alias-off run was an earlier build without those commits.Results
XCL_PAGE_ALIAS=1(run 99)Caveats
Imported from ivall/xcl. Originally posted by ZekkJJ on 2026-11-28T19:53:04Z.
@bmjask mind reviewing this when you get a chance? We've got independent retail validation now, with noticeable rendering and stability improvements.
Imported from ivall/xcl. Originally posted by brainhay5 on 2026-12-01T01:54:05Z.
Triage note: this no longer merges with current
main(mergeable=false), so it cannot be built or tested as it stands.Why I am asking rather than just noting it: we have run fifteen mergeable candidates on the retail title on an RTX 5070 Ti, and every one still stops presenting at 50–80 s (device removed, surfacing ~88 s later on the next allocation). The PRs whose descriptions actually match that symptom are the ones that no longer apply — this is one of them. A rebase would make it testable again, and we will run it and report the numbers.
If it has been superseded by merged work, saying so is enough and it can be closed.
AI use: an agent posted this triage note.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T09:26:51Z.
Triage (#1607) – head
785d7dcStacked on #2307 (section-backed physical page aliases, still open); only the top commit
785d7dcbelongs here. #3075 is stacked on this PR and contains it, which is not a duplicate.The fix in
kernelx.rs:XMemMapPhysicalPagesScatterpasses a null page array through tomap_aliased, which already treats it as an unmap, instead of advancing the null pointer;scatter_without_pages_unmaps_only_the_listed_aliasescovers it (only withXCL_PAGE_ALIAS=1, otherwise skipped). No problems found in the diff.Recommendation: keep open.
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 Foniass on 2026-12-01T10:51:13Z.
Review (head
785d7dc5, diff read, not a merge-check; conflicts with main,PR descriptionred: no smoke blocks):3878609d: it takes main's #495 "null array = unmap" behaviour but leaves the alias branch stepping through the null pointer (entry 2 reads a page number at 0x8). #2307 on its own rejects a null page array, so this fix belongs in #2307's rebase rather than in a PR of its own.kernelx.rs(theVirtualFreeExcondition, nowis_viewon main, and the newapi_costtiming inMapTitlePhysicalPages),lazy.rs(is_marked/ensure) andvfs_hooks.rs. The fix's own hunk auto-merges, though main has since changed the scatter function (commit_homes_ahead).XCL_PAGE_ALIAS=1(alias.rs~422). With aliasing on, it would crash without the fix.Fine: the fix itself (
kernelx.rs~1529-1533). A null array reachesmap_aliasedas page 0, andmap_oneunmaps it. Aliasing is off by default and read once. The archived retail crash stack (map_aliased <- XMemMapPhysicalPagesScatter) backs the bug. #3075 is stacked on it.AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
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.