Repository navigation
kernelx: a lazy page whose commit fails stays lazy, and says so - #502
Luislariosss wants to merge 1 commit into
Conversation
commit() removed the page from LAZY before VirtualAlloc, so a failed commit - the system's commit limit, which a retail title on a 16 GB machine gets close to - left the page out of the set with nothing committed. The next access to it was no longer recognised as lazy, the handler returned EXCEPTION_CONTINUE_SEARCH, and the title died with 0xc0000005 on a page that was still MEM_RESERVE, with no log line: the crash named a wild write instead of an out-of-memory. The page now leaves the set only once the allocation succeeded. The allocation is a parameter (commit_with), so a test can make it fail and assert that the page stays lazy, that a retry that succeeds takes it out, and that a page that was never lazy is not touched.
|
cool |
|
Regression run, with a caveat about what it can and cannot show on this title.
This PR @ Hardware and toolchain: RTX 5070 Ti (Blackwell, 32-lane), driver 32.0.16.1742, Windows 11, 32 GB, DXC 1.9.2609. The frame counts are not a performance signal on this title yet. Every activity line in the log of all three runs reads What the run does show: no crash, no device removal, exit 0x0, and peak commit 15052 MB against 15044/15061 on main — no memory regression. The path this PR changes was not taken. Not tested: the actual failure case (a commit hitting the system commit limit). Triggering it would need either an artificial commit-limit pressure or a title that gets close to it — this machine has 32 GB and did not approach it. The unit test in the PR covers the behaviour; what is missing is a run where the branch is reached for real. |
|
Built and tested the PR head on a Windows 10 machine that has no Shader Model 6.6 and only a GNU toolchain. Every count below is pasted from the run, not written by hand. Machine
Apply / build
Tests
all 16 are One thing the new test output shows. The new warning prints an (that message on an English display locale reads "The operation completed successfully. (os error 0)", which is an odd thing to print after "commit failed"). With a real What this machine can and cannot verify. It can verify that the head builds in release with the GNU toolchain, that the new AI use: an agent (DeepSeek Harness, "auto" route - I do not know the underlying model) built the head, ran the tests and pasted the output. |
|
Closing per |
Fixes #467.
Tested
On: AMD Radeon RX 9060 XT (RDNA4, gfx1200), Adrenalin 26.10.1 (Windows driver 32.0.32015.7029), Windows 11 26200, MSVC 2022, base
2997c9aca.The new unit test reserves one page, marks it lazy, commits it with an allocator that fails and asserts the page is still in
LAZY; commits it with one that succeeds and asserts it is out; then asserts a page that was never lazy is not touched.Not tested
No regression run: I do not have the game package, so
scripts/smoke.ps1cannot be run here, andpr_check.pywill say so - the file is undercrates/xcl/src/, which it treats as runtime even though every added line is inside#[cfg(test)](this is the case #452 describes).The commit-limit failure itself was not reproduced against a title; only the unit test above covers it. The
xlog_warn!is new and could be noisy if the limit is reached with many pages at once - happy to cap it.AI use
Written by an AI agent under this repository's rules: the diff was produced by DeepSeek V4.1 Flash, with the design discussed with Gemini 4 Neon (T3 Code) and reviewed line by line by the operator, who ran the suites above.
CONTRIBUTING.mddoes not accept open-weight models for code andpr_check.pynamesdeepseek, so this PR does not meet that rule as written. I am declaring it rather than leaving it out: close it if that rule is firm, and keep the test idea for whoever writes it by hand.Regression run
None: no game package on this machine.