Repository navigation
xmem: preserve ownership and native errors after partial releases - #8825
Demon12377 wants to merge 3 commits into
Conversation
Dependency snapshot: ItsNotRexed#7742 at 51736cd. The subsequent commits contain the new regression cases and failure-handling fix.
The 290-check suite completes with 24 failures on the ItsNotRexed#7742 implementation. Failure callbacks are compiled only into xmem_test. Claim: ItsNotRexed#8344 (comment) AI-assisted: yes (Codex).
Keep original-base retry aliases over surviving owned spans, preserve nested ownership, and invalidate/rehome aliases on tracked address reuse. Serialize reserve and bookkeeping. The same 290 checks now pass. AI-assisted: yes (Codex; implementation and independent review agents).
|
Verified head
AI-assisted. |
|
Tested
|
|
AI-assisted independent validation (Claude Code), native Windows, CPU only, no game files. Tested PR head
|
Claimed in the coordination issue as: #8344 (comment)
Depends on: #7742 at
51736cd2f2b2e2a08a37ae0c67a359ab2b362142. This is a separate failure-handling follow-up. The first commit carries #7742's implementation and normal-path tests, credited to @ASTROWwwW; the next commit adds failing regression cases, and the final commit fixes them. Textual overlap with the other open XMem work (#7580, #7712, #8289) needs the usual rebase after those land.What and why
When an unmap or release fails partway through
TitleVirtualFree(base, 0, MEM_RELEASE), #7742 erases the range bookkeeping even though some views/placeholders remain. A retry then falls back to the host call at the old base, and the first native error is replaced withERROR_INVALID_ADDRESS.Keep original-base retry aliases over only the surviving owned spans, trim confirmed freed windows, and preserve the first native error after unlocking. Re-query native split topology on retry so remapping a retained placeholder still works. Preserve independent nested owners while letting the outer owner release its carved windows. A fresh reservation invalidates/re-homes old aliases and keeps the new owner's memory out of the old retry; native reserve and bookkeeping share the physical-memory mutex.
Controlled failure callbacks are compiled only into
xmem_test. The runtime has no test callback storage or setter.Tested
Windows 10 Pro x64, build 19045; MSVC 19.44 / VS 2022 Build Tools 14.44; Windows SDK 10.0.26100.0; CMake 4.4.4. GPU unused, no game files.
09ab692bbd974001aecc53c6697da06608b82eebcompletes with 24 failures; fixed head completes with 290 passed / 0 failed. Allocations and views are real small local Windows fixtures; the API failures are deliberately injected, not a claim about natural failure frequency.xmem.cppcompiled without the test flag;dumpbin /symbolsconfirms no test setter/callback storage.git diff --checkandscripts/check_no_game_data.pyon all four files pass.main867d922f0, clean build/no-game-data check, and 290 checks passed.mainand four other changes without conflicts;xmempasses. Their batch has other runtime failures, so this is an integration report, not an all-green full-suite or CI result.Reproduce either the regression commit or the fixed head:
Vulkan headers are absent on this host, so this is the targeted CPU test, not a full runtime/GPU test result. Retail execution was not tested.
AI-assisted: yes (Codex, implementation and independent review agents).
Checklist