kernelx: keep lazy pages on failed MEM_COMMIT (#467) #482

Open
Grimkaaah wants to merge 1 commit from upstream-pr/487 into main
Grimkaaah commented 2026-11-24 00:58:35 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Grimkaaah on 2026-11-24T00:58:35Z.


Summary

  • Remove a lazy physical page from LAZY only after VirtualAlloc(MEM_COMMIT) succeeds, so a commitment-limit failure can be retried instead of becoming a bare 0xc0000005 on still-reserved memory.
  • Record failed commits in atomics (count, last page, GetLastError) and append fail_summary() to the AV crash line in eh.rs.
  • lazy::ensure now returns bool; DirectStorage writable() 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)
<!-- greyfinch-sync:ivall/xcl:issue:5464029406 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/487). Originally posted by [Grimkaaah](https://github.com/Grimkaaah) on 2026-11-24T00:58:35Z. --- ## Summary - Remove a lazy physical page from `LAZY` **only after** `VirtualAlloc(MEM_COMMIT)` succeeds, so a commitment-limit failure can be retried instead of becoming a bare `0xc0000005` on still-reserved memory. - Record failed commits in atomics (`count`, last page, `GetLastError`) and append `fail_summary()` to the AV crash line in `eh.rs`. - `lazy::ensure` now returns `bool`; DirectStorage `writable()` fails closed when a destination page cannot be committed. Fixes #467 ## Test plan - [x] `cargo test -p xcl --lib hle::kernelx::lazy::` (3 passed, including failed-commit keeps page lazy)
mdberkey commented 2026-11-24 00:59:04 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by mdberkey on 2026-11-24T00:59:04Z.

Review: COMMENTED


t

<!-- greyfinch-sync:ivall/xcl:review:6032002867 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/487#pullrequestreview-6032002867). Originally posted by [mdberkey](https://github.com/mdberkey) on 2026-11-24T00:59:04Z. **Review:** COMMENTED --- t
shdann commented 2026-11-24 01:01:40 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by shdann on 2026-11-24T01:01:40Z.

Review: COMMENTED


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).

<!-- greyfinch-sync:ivall/xcl:review:6032022833 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/487#pullrequestreview-6032022833). Originally posted by [shdann](https://github.com/shdann) on 2026-11-24T01:01:40Z. **Review:** COMMENTED --- `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).
brothernog commented 2026-11-24 07:05:22 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by brothernog on 2026-11-24T01:44:00Z.


Tested bf21bcb on an RTX 3050 (driver 610.88), Windows 11 Home 26300, Rust 1.100.0, debug. This adds one thing to the comparison on #467, about the dstorage.rs hunk: it does change behaviour, and it can refuse a healthy destination.

ensure takes the lazy pages under the read lock (lazy.rs:129), drops it, then calls commit for each. commit returns false when the page is no longer in LAZY (lazy.rs:67), which is also the case when another thread committed it in between: a second ensure, or the title touching the page and the vectored handler committing it. ensure then reports a failure, and writable (dstorage.rs:728) fails a request whose pages are all committed and writable.

I added a temporary test (removed afterwards): 256 lazy pages, two threads behind a barrier call ensure over the same range. In 5 of 5 runs at least one call returned false (4 runs [false, false], 1 run [true, false]), and every page was committed afterwards.

Dropping the hunk keeps the fix: writable already checks every page with VirtualQuery after ensure, so a page that stayed reserved fails there. If you want the bool kept, commit could tell "not lazy any more" apart from "the commit failed", and ensure could return false only for the second case.

This review was AI-assisted.

<!-- greyfinch-sync:ivall/xcl:comment:7119392998 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/487#issuecomment-7119392998). Originally posted by [brothernog](https://github.com/brothernog) on 2026-11-24T01:44:00Z. --- Tested `bf21bcb` on an RTX 3050 (driver 610.88), Windows 11 Home 26300, Rust 1.100.0, debug. This adds one thing to the comparison on #467, about the `dstorage.rs` hunk: it does change behaviour, and it can refuse a healthy destination. `ensure` takes the lazy pages under the read lock (`lazy.rs:129`), drops it, then calls `commit` for each. `commit` returns `false` when the page is no longer in `LAZY` (`lazy.rs:67`), which is also the case when another thread committed it in between: a second `ensure`, or the title touching the page and the vectored handler committing it. `ensure` then reports a failure, and `writable` (`dstorage.rs:728`) fails a request whose pages are all committed and writable. I added a temporary test (removed afterwards): 256 lazy pages, two threads behind a barrier call `ensure` over the same range. In 5 of 5 runs at least one call returned `false` (4 runs `[false, false]`, 1 run `[true, false]`), and every page was committed afterwards. Dropping the hunk keeps the fix: `writable` already checks every page with `VirtualQuery` after `ensure`, so a page that stayed reserved fails there. If you want the bool kept, `commit` could tell "not lazy any more" apart from "the commit failed", and `ensure` could return `false` only for the second case. This review was AI-assisted.
MesshM commented 2026-11-24 07:06:31 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by MesshM on 2026-11-24T05:16:00Z.


Test run of bf21bcba64680fb85a01e4802a86971af03c4e36 on AMD RDNA4. I merged it onto current main 6025201 locally (clean merge).

Tested

  • AMD Radeon RX 9060 XT 16 GB (RDNA4), driver 32.0.32029.2010; Ryzen 7 5700X, 64 GB RAM, Windows 11 Pro build 26200, Rust 1.100.0 stable-x86_64-pc-windows-msvc, debug
  • cargo build --workspace + cargo test --workspace -- --test-threads=4 on the merge: 705 passed, 0 failed, 41 ignored, exit code 0; xcl lib tests 664 passed, 0 failed, 21 ignored
  • 0 SKIPPED; the lazy tests pass, the failed-commit one included.

Review: Removing a lazy page from LAZY only after MEM_COMMIT succeeds is right. Overlap with #512 (open), whose title is about the e2e test output but which also changes kernelx/lazy.rs to keep the page on a failed commit; the two will conflict there, and this PR is the one that is about #467.

Not tested: no retail title or regression run (I have no unpacked game), no XCL_SAMPLE_* tests, release build; the PR's head on its old base was not run, only its merge onto main.

Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.

<!-- greyfinch-sync:ivall/xcl:comment:7122784550 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/487#issuecomment-7122784550). Originally posted by [MesshM](https://github.com/MesshM) on 2026-11-24T05:16:00Z. --- Test run of `bf21bcba64680fb85a01e4802a86971af03c4e36` on AMD RDNA4. I merged it onto current `main` `6025201` locally (clean merge). **Tested** - AMD Radeon RX 9060 XT 16 GB (RDNA4), driver 32.0.32029.2010; Ryzen 7 5700X, 64 GB RAM, Windows 11 Pro build 26200, Rust 1.100.0 `stable-x86_64-pc-windows-msvc`, debug - `cargo build --workspace` + `cargo test --workspace -- --test-threads=4` on the merge: **705 passed, 0 failed, 41 ignored**, exit code 0; `xcl` lib tests 664 passed, 0 failed, 21 ignored - **0 `SKIPPED`**; the `lazy` tests pass, the failed-commit one included. **Review:** Removing a lazy page from `LAZY` only after `MEM_COMMIT` succeeds is right. **Overlap with #512** (open), whose title is about the e2e test output but which also changes `kernelx/lazy.rs` to keep the page on a failed commit; the two will conflict there, and this PR is the one that is about #467. **Not tested:** no retail title or regression run (I have no unpacked game), no `XCL_SAMPLE_*` tests, release build; the PR's head on its old base was not run, only its merge onto `main`. Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.
asd3670576 commented 2026-11-24 11:05:44 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by asd3670576 on 2026-11-24T10:25:03Z.


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

  • Windows 10 Pro for Workstations 19045.3324 (22H2), Rust/cargo 1.100.0, host toolchain x86_64-pc-windows-gnu (no MSVC, no Windows SDK: cargo build here needs MinGW-w64 on PATH or it dies with error calling dlltool 'dlltool.exe': program not found), Ryzen 9 5950X (32 logical CPUs), 64 GB RAM.
  • GPU: RTX 3080 20 GB, driver 610.88. DXC 1.9.2609.5 at H:\leonida\dxc\bin\x64 (XCL_DXC_DIR). Agility 1.620.2 at H:\leonida\agility\build\native\bin\x64 (XCL_D3D12_DIR) but it cannot load on this OS build (no ID3D12SDKConfiguration1 before KB5029331), so the inbox runtime caps at Shader Model 6.5 and XCL's GPU recompiler path is unavailable here.
  • Release profile throughout. No title run here, so no xcl-smoke block from this machine.

Apply / build

  • git fetch https://github.com/ivall/xcl pull/487/head:pr487 → bf21bcba64680fb85a01e4802a86971af03c4e36, checked out as-is: no rebase, no conflict resolution, git status --porcelain empty before the build and after it. The API reports mergeable: true, mergeable_state: unstable against current main.
  • cargo build --release --workspace → exit code 0:
    Finished `release` profile [optimized] target(s) in 27.75s

Tests

cargo test --release -p xcl --lib -- kernelx::lazy, three runs on the default thread count:

run 1: test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 655 filtered out; finished in 0.02s
run 2: test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 655 filtered out; finished in 0.02s
run 3: test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 655 filtered out; finished in 0.02s

cargo test --release -p xcl --lib -- gpu::recomp::dxc:

test result: ok. 14 passed; 0 failed; 0 ignored; 0 measured; 644 filtered out; finished in 0.44s

cargo test --release -p xcl --lib -- kernelx::lazy gpu::recomp::dxc (both modules in one process, default threads):

test result: ok. 17 passed; 0 failed; 0 ignored; 0 measured; 641 filtered out; finished in 0.44s

cargo test --release --workspace --no-fail-fast -- --test-threads=4 → exit code 0. 16 test result: lines (one per test binary plus the doc-test run); the xcl lib is:

test result: ok. 637 passed; 0 failed; 21 ignored; 0 measured; 0 filtered out; finished in 5.28s

all 16 are ok; summed over them: 677 passed; 0 failed; 41 ignored. Skips, reported rather than counted as coverage: 86 SKIPPED lines, 84 : no GPU and 2 : no wave64, for example

SKIPPED gpu::recomp::tests::gpu_bvh_intersect_ray: no GPU
SKIPPED gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no GPU
SKIPPED gpu::recomp::mesh_dispatch::tests::gpu_dispatch_matches_native_wave64_reference: no GPU

Forcing the requirement shows the SM 6.5 cap directly (XCL_REQUIRE_GPU=mesh cargo test --release -p xcl --lib -- --exact gpu::recomp::tests::gpu_bvh_intersect_ray):

thread 'gpu::recomp::tests::gpu_bvh_intersect_ray' (20752) panicked at crates\xcl\src\gpu\recomp\runner.rs:439:9:
gpu::recomp::tests::gpu_bvh_intersect_ray: no GPU, but XCL_REQUIRE_GPU=mesh

On the dstorage.rs hunk. The code in this head agrees with @brothernog's reading: commit returns false both when the page is no longer in LAZY (another thread committed it) and when VirtualAlloc fails, and ensure maps either one to false. The pre-existing threads_first_touching_one_lazy_page_together_all_go_on drives the pages through the vectored handler rather than through ensure and asserts nothing about a return value, so it cannot catch that case; the new test covers the failed-commit path only. I did not measure the race itself here.

What this machine can and cannot verify. It can verify that the head builds in release with the GNU toolchain, that the three kernelx::lazy tests are stable here (3/3, and 17/17 with the dxc tests in the same process), and that nothing else in the workspace regresses. It cannot verify the case the fix is about: with 64 GB of RAM and a 153 GB commit limit (125 GB of it free) nothing here reaches ERROR_COMMITMENT_LIMIT, so commit's failure branch only runs because the test injects a failing allocator. And because the adapter caps at SM 6.5, no GPU test executed at all — the 84 skips are the whole GPU surface, so this run says nothing about the recompiler paths.

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.

<!-- greyfinch-sync:ivall/xcl:comment:7128751571 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/487#issuecomment-7128751571). Originally posted by [asd3670576](https://github.com/asd3670576) on 2026-11-24T10:25:03Z. --- 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** - Windows 10 Pro for Workstations 19045.3324 (22H2), Rust/cargo 1.100.0, host toolchain `x86_64-pc-windows-gnu` (no MSVC, no Windows SDK: `cargo build` here needs MinGW-w64 on PATH or it dies with `error calling dlltool 'dlltool.exe': program not found`), Ryzen 9 5950X (32 logical CPUs), 64 GB RAM. - GPU: RTX 3080 20 GB, driver 610.88. DXC 1.9.2609.5 at `H:\leonida\dxc\bin\x64` (`XCL_DXC_DIR`). Agility 1.620.2 at `H:\leonida\agility\build\native\bin\x64` (`XCL_D3D12_DIR`) but it cannot load on this OS build (no `ID3D12SDKConfiguration1` before KB5029331), so the inbox runtime caps at Shader Model 6.5 and XCL's GPU recompiler path is unavailable here. - Release profile throughout. No title run here, so no `xcl-smoke` block from this machine. **Apply / build** - `git fetch https://github.com/ivall/xcl pull/487/head:pr487` → `bf21bcba64680fb85a01e4802a86971af03c4e36`, checked out as-is: no rebase, no conflict resolution, `git status --porcelain` empty before the build and after it. The API reports `mergeable: true`, `mergeable_state: unstable` against current `main`. - `cargo build --release --workspace` → exit code 0: ``` Finished `release` profile [optimized] target(s) in 27.75s ``` **Tests** `cargo test --release -p xcl --lib -- kernelx::lazy`, three runs on the default thread count: ``` run 1: test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 655 filtered out; finished in 0.02s run 2: test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 655 filtered out; finished in 0.02s run 3: test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 655 filtered out; finished in 0.02s ``` `cargo test --release -p xcl --lib -- gpu::recomp::dxc`: ``` test result: ok. 14 passed; 0 failed; 0 ignored; 0 measured; 644 filtered out; finished in 0.44s ``` `cargo test --release -p xcl --lib -- kernelx::lazy gpu::recomp::dxc` (both modules in one process, default threads): ``` test result: ok. 17 passed; 0 failed; 0 ignored; 0 measured; 641 filtered out; finished in 0.44s ``` `cargo test --release --workspace --no-fail-fast -- --test-threads=4` → exit code 0. 16 `test result:` lines (one per test binary plus the doc-test run); the xcl lib is: ``` test result: ok. 637 passed; 0 failed; 21 ignored; 0 measured; 0 filtered out; finished in 5.28s ``` all 16 are `ok`; summed over them: **677 passed; 0 failed; 41 ignored**. Skips, reported rather than counted as coverage: 86 `SKIPPED` lines, 84 `: no GPU` and 2 `: no wave64`, for example ``` SKIPPED gpu::recomp::tests::gpu_bvh_intersect_ray: no GPU SKIPPED gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no GPU SKIPPED gpu::recomp::mesh_dispatch::tests::gpu_dispatch_matches_native_wave64_reference: no GPU ``` Forcing the requirement shows the SM 6.5 cap directly (`XCL_REQUIRE_GPU=mesh cargo test --release -p xcl --lib -- --exact gpu::recomp::tests::gpu_bvh_intersect_ray`): ``` thread 'gpu::recomp::tests::gpu_bvh_intersect_ray' (20752) panicked at crates\xcl\src\gpu\recomp\runner.rs:439:9: gpu::recomp::tests::gpu_bvh_intersect_ray: no GPU, but XCL_REQUIRE_GPU=mesh ``` **On the `dstorage.rs` hunk.** The code in this head agrees with @brothernog's reading: `commit` returns `false` both when the page is no longer in `LAZY` (another thread committed it) and when `VirtualAlloc` fails, and `ensure` maps either one to `false`. The pre-existing `threads_first_touching_one_lazy_page_together_all_go_on` drives the pages through the vectored handler rather than through `ensure` and asserts nothing about a return value, so it cannot catch that case; the new test covers the failed-commit path only. I did not measure the race itself here. **What this machine can and cannot verify.** It can verify that the head builds in release with the GNU toolchain, that the three `kernelx::lazy` tests are stable here (3/3, and 17/17 with the dxc tests in the same process), and that nothing else in the workspace regresses. It cannot verify the case the fix is about: with 64 GB of RAM and a 153 GB commit limit (125 GB of it free) nothing here reaches `ERROR_COMMITMENT_LIMIT`, so `commit`'s failure branch only runs because the test injects a failing allocator. And because the adapter caps at SM 6.5, no GPU test executed at all — the 84 skips are the whole GPU surface, so this run says nothing about the recompiler paths. 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.
throny commented 2026-11-24 21:29:56 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-24T21:15:15Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7144683264 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/487#issuecomment-7144683264). Originally posted by [throny](https://github.com/throny) on 2026-11-24T21:15:15Z. --- <!-- xcl-1607-hint:D13 --> 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.
Toons29 commented 2026-11-25 03:05:53 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Toons29 on 2026-11-25T02:56:02Z.


Regression run of bf21bcba on the retail title, for this PR's Regression run section. Both blocks are from scripts/smoke.ps1 as printed, not edited: main on 4178e888, this PR on its head commit with no uncommitted changes, same title and time.

xcl-smoke v1
commit: 4178e888c0b5be50a2887eda45cdb832763b68a4
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1618 (PresentX 1618)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 14831 MB
xcl-smoke v1
commit: bf21bcba64680fb85a01e4802a86971af03c4e36
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1461 (PresentX 1461)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14765 MB

Against the limits in CONTRIBUTING.md: 90 % of main's frames, 100 % of its peak commit, no crash, no device removal.

AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, cargo build --release -p xcl, 60 s, XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.

AI use: Claude Code (Claude Opus 5.5) built both trees and ran scripts/smoke.ps1; I checked the blocks before posting.

<!-- greyfinch-sync:ivall/xcl:comment:7151378309 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/487#issuecomment-7151378309). Originally posted by [Toons29](https://github.com/Toons29) on 2026-11-25T02:56:02Z. --- Regression run of `bf21bcba` on the retail title, for this PR's **Regression run** section. Both blocks are from `scripts/smoke.ps1` as printed, not edited: `main` on `4178e888`, this PR on its head commit with no uncommitted changes, same title and time. ``` xcl-smoke v1 commit: 4178e888c0b5be50a2887eda45cdb832763b68a4 gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1618 (PresentX 1618) presents per 2 s (last 3): 61 60 60 device removals: 0 crashes: 0 peak commit: 14831 MB ``` ``` xcl-smoke v1 commit: bf21bcba64680fb85a01e4802a86971af03c4e36 gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1461 (PresentX 1461) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14765 MB ``` Against the limits in CONTRIBUTING.md: 90 % of `main`'s frames, 100 % of its peak commit, no crash, no device removal. AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, `cargo build --release -p xcl`, 60 s, `XCL_NETWORK=0`. This is a regression check only: it does not show whether the run reaches the code this PR changes. AI use: Claude Code (Claude Opus 5.5) built both trees and ran `scripts/smoke.ps1`; I checked the blocks before posting.
DavidM1911 commented 2026-11-25 14:10:14 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T14:05:08Z.


Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7164733371 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/487#issuecomment-7164733371). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T14:05:08Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
Foniass commented 2026-12-01 03:35:29 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T03:35:29Z.


Triage (#1607) – head bf21bcb

Update (rechecked against main 6bfb5c51): withdrawn from the close list; recommendation: keep open. Its proposed carrier #488 was closed today, and main still drops the lazy page before VirtualAlloc (lazy.rs:39-45), so this is the only open fix for #467. The dstorage.rs part should be dropped, or made to tell "already committed" apart from "commit failed".

#488 makes the same change in hle/kernelx/lazy.rs and eh.rs: commit checks contains, removes the page only when VirtualAlloc(MEM_COMMIT) succeeds, records the count, page and GetLastError in atomics, and appends a summary to the crash line. #488 also names the error code and tests a real commit limit (job object).
Problem in the extra part: ensure now returns false whenever commit returns false, including when the page is no longer in LAZY because another thread committed it between the read-locked range and the write-locked commit. With parallel DirectStorage requests (#819) into the same 64 KiB page, dstorage.rs writable then fails a valid request with E_ACCESS_VIOLATION. commit would need to tell 'already committed' apart from 'commit failed'.
Recommendation: close (duplicate of #488).

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run.

<!-- greyfinch-sync:ivall/xcl:comment:7299863594 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/487#issuecomment-7299863594). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T03:35:29Z. --- **Triage (#1607)** – head bf21bcb **Update (rechecked against main 6bfb5c51): withdrawn from the close list; recommendation: keep open.** Its proposed carrier #488 was closed today, and main still drops the lazy page before `VirtualAlloc` (`lazy.rs:39-45`), so this is the only open fix for #467. The `dstorage.rs` part should be dropped, or made to tell "already committed" apart from "commit failed". #488 makes the same change in `hle/kernelx/lazy.rs` and `eh.rs`: `commit` checks `contains`, removes the page only when `VirtualAlloc(MEM_COMMIT)` succeeds, records the count, page and `GetLastError` in atomics, and appends a summary to the crash line. #488 also names the error code and tests a real commit limit (job object). Problem in the extra part: `ensure` now returns false whenever `commit` returns false, including when the page is no longer in `LAZY` because another thread committed it between the read-locked `range` and the write-locked `commit`. With parallel DirectStorage requests (#819) into the same 64 KiB page, `dstorage.rs` `writable` then fails a valid request with `E_ACCESS_VIOLATION`. `commit` would need to tell 'already committed' apart from 'commit failed'. ~~Recommendation: close (duplicate of #488).~~ AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/487:upstream-pr/487'
git switch 'upstream-pr/487'

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.

git switch 'main'
git merge --no-ff 'upstream-pr/487'
git switch 'upstream-pr/487'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/487'
git switch 'upstream-pr/487'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/487'
git switch 'main'
git merge --squash 'upstream-pr/487'
git switch 'main'
git merge --ff-only 'upstream-pr/487'
git switch 'main'
git merge 'upstream-pr/487'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!482
No description provided.