Repository navigation
Conversation
Only remove a page from LAZY after VirtualAlloc succeeds; record fail count/page/GetLastError for the crash line; ensure returns false so DirectStorage refuses unwritable destinations. Co-authored-by: Cursor <cursoragent@cursor.com>
shdann
left a comment
There was a problem hiding this comment.
lazy::ensure can reject a writable destination when two callers snapshot the same lazy page. The first caller commits it and removes it from LAZY. The second then gets false from commit because the entry is gone. dstorage::writable treats that as a commit failure and rejects the request. Please distinguish an entry that is already gone from a failed VirtualAlloc, and let the existing writability check handle the former. A two-caller test should check that both requests succeed when the page was committed successfully. Static review with OpenAI Codex (GPT-6).
From xcl-dev/xcl#487 by @Grimkaaah, squashed. Supersedes xcl-dev/xcl#488 (dropped: its child-process test overflows the stack under the job commit limit instead of hitting the limit, so the crash-line assertion cannot hold).
|
Tested
I added a temporary test (removed afterwards): 256 lazy pages, two threads behind a barrier call Dropping the hunk keeps the fix: This review was AI-assisted. |
|
Test run of Tested
Review: Removing a lazy page from Not tested: no retail title or regression run (I have no unpacked game), no Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code. |
|
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 Forcing the requirement shows the SM 6.5 cap directly ( On the What this machine can and cannot verify. It can verify that the head builds in release with the GNU toolchain, that the three 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. |
|
Two contributors checked independently and found that #488 solves the same problem (for #467) in a different way: #1607, group D13. You may want to compare them with the other author and agree on one, or say in the PR why both are needed. This is a hint, not a request from the maintainers; nobody from the project has adopted #1607 so far. AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table. |
|
Regression run of Against the limits in CONTRIBUTING.md: 90 % of AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, AI use: Claude Code (Claude Opus 5.5) built both trees and ran |
Summary
LAZYonly afterVirtualAlloc(MEM_COMMIT)succeeds, so a commitment-limit failure can be retried instead of becoming a bare0xc0000005on still-reserved memory.count, last page,GetLastError) and appendfail_summary()to the AV crash line ineh.rs.lazy::ensurenow returnsbool; DirectStoragewritable()fails closed when a destination page cannot be committed.Fixes #467
Test plan
cargo test -p xcl --lib hle::kernelx::lazy::(3 passed, including failed-commit keeps page lazy)