kernelx: catch CPU writes to the views of physical pages, page by page #2284

Open
adiologydev wants to merge 3 commits from upstream-pr/2294 into main
adiologydev commented 2026-11-25 12:45:47 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by adiologydev on 2026-11-25T12:45:47Z.


Stacked on #2293; only the top two commits (6602a70, d660e30) belong here. Second part of the plan on #1031.

The upload of title memory to video memory (d3d12x::sparse) and title_textures learn what the CPU wrote from the write watch, and a view of a section cannot be write-watched. This keeps the views of a physical page read-only and catches the first write through any of them, so a write through one view is uploaded at all of them. Nothing watches a view yet.

What is in it

  • 6602a70 crates/xcl/src/hle/kernelx/guards.rs (new): watch(page, view) guards a view; a vectored handler opens a written view and notes its page; take_dirty hands over the 4 KiB pages of every view of each page written and guards them again before their bytes are read; forget, committed (a view the lazy handler committed counts as written). A write to a view not committed yet is left to the lazy handler (claimed here it would fault again for ever – a test calls the handler with that fault). lazy::commit and lazy::ensure call it; both take no lock until a view is watched.
  • d660e30 guards.rs, lazy.rs, vfs_hooks.rs, dstorage.rs, d3d12x/cpu_writes.rs: a kernel call does not fault into the handler, it fails – so guards::open returns Opened, which keeps its views writable until dropped (take_dirty uploads a pinned view without guarding it again), and lazy::ensure returns it to its callers, which hold it across their write. An overlapped ReadFile writes after the call returns: its views stay open until its OVERLAPPED is no longer STATUS_PENDING (read with ReadProcessMemory: the title may free it once done). A retail title reads 271 MB that way into the CPU view of its 24 GB reservation 8.5 s after start. guards::written counts a page written by page number.
  • 8 unit tests in guards.rs, among them 8 threads writing 64 guarded pages at once.

Tested

  • NVIDIA GeForce RTX 5090 32 GB (driver 621.40), AMD Ryzen 9 7950X, 64 GB RAM, Windows 11 Pro 26200, Rust 1.100.0 MSVC, DXC 1.9.2609 (XCL_DXC_DIR), debug tests, release runs.
  • cargo test --workspace -- --test-threads=4 on d660e30: 1109 passed, 4 failed, 26 ignored. The 4 failures are gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3 (CreateComputePipelineState → E_OUTOFMEMORY on this card, #1905); main 568e7db fails the same 4 here (1094 passed, 4 failed, 26 ignored). SKIPPED (23, the same on main): 20 need 64-lane waves ("no wave64"), 3 per-lane f16 refusals in lower_dxil::tests::{f16,f32}_programs_on_the_gpu.
  • Parallel runs of cargo test -p xcl --lib kernelx:: repeat existing races that main has too (gpu_visible_fallback_memory_is_write_watched, virtual_free_ex_and_sparse_validation, a_page_whose_move_fails_stays_mapped_where_it_was; 3 failures in 40 runs of main 568e7db).

Regression run
scripts/smoke.ps1 -Game <retail title> -Seconds 60, no input, main first, same machine (each run's xcl.exe built from a clean checkout of its commit):

xcl-smoke v1
commit: 568e7db7729c8fa6c8f0f4b32d798faaf11462bb
gpu: NVIDIA GeForce RTX 5090
title: 2c508222
seconds: 60
exit: 0x0
frames shown: 1015 (PresentX 1015)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16257 MB
xcl-smoke v1
commit: d660e3070bef6e3ae095393dc134ecd517ab4a35
gpu: NVIDIA GeForce RTX 5090
title: 2c508222
seconds: 60
exit: 0x0
frames shown: 1527 (PresentX 1528)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15776 MB

Not tested

  • AMD and Intel GPUs; Wine / Proton.
  • Nothing watches a view in this PR, so the smoke runs only show it changes nothing; the guards run in the title with #2307.

AI use

  • Claude Code (Claude Opus 5.5): wrote the code, the tests and this description, and made the runs above on this hardware. I read every line of the diff and checked it.
<!-- greyfinch-sync:ivall/xcl:issue:5491588528 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2294). Originally posted by [adiologydev](https://github.com/adiologydev) on 2026-11-25T12:45:47Z. --- Stacked on #2293; only the top two commits (`6602a70`, `d660e30`) belong here. Second part of the plan on #1031. The upload of title memory to video memory (`d3d12x::sparse`) and `title_textures` learn what the CPU wrote from the write watch, and a view of a section cannot be write-watched. This keeps the views of a physical page read-only and catches the first write through any of them, so a write through one view is uploaded at all of them. Nothing watches a view yet. **What is in it** - `6602a70` `crates/xcl/src/hle/kernelx/guards.rs` (new): `watch(page, view)` guards a view; a vectored handler opens a written view and notes its page; `take_dirty` hands over the 4 KiB pages of every view of each page written and guards them again before their bytes are read; `forget`, `committed` (a view the lazy handler committed counts as written). A write to a view not committed yet is left to the lazy handler (claimed here it would fault again for ever – a test calls the handler with that fault). `lazy::commit` and `lazy::ensure` call it; both take no lock until a view is watched. - `d660e30` `guards.rs`, `lazy.rs`, `vfs_hooks.rs`, `dstorage.rs`, `d3d12x/cpu_writes.rs`: a kernel call does not fault into the handler, it fails – so `guards::open` returns `Opened`, which keeps its views writable until dropped (`take_dirty` uploads a pinned view without guarding it again), and `lazy::ensure` returns it to its callers, which hold it across their write. An overlapped `ReadFile` writes after the call returns: its views stay open until its OVERLAPPED is no longer `STATUS_PENDING` (read with `ReadProcessMemory`: the title may free it once done). A retail title reads 271 MB that way into the CPU view of its 24 GB reservation 8.5 s after start. `guards::written` counts a page written by page number. - 8 unit tests in `guards.rs`, among them 8 threads writing 64 guarded pages at once. **Tested** - NVIDIA GeForce RTX 5090 32 GB (driver 621.40), AMD Ryzen 9 7950X, 64 GB RAM, Windows 11 Pro 26200, Rust 1.100.0 MSVC, DXC 1.9.2609 (`XCL_DXC_DIR`), debug tests, release runs. - `cargo test --workspace -- --test-threads=4` on `d660e30`: 1109 passed, 4 failed, 26 ignored. The 4 failures are `gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3` (`CreateComputePipelineState` → `E_OUTOFMEMORY` on this card, #1905); `main` 568e7db fails the same 4 here (1094 passed, 4 failed, 26 ignored). SKIPPED (23, the same on `main`): 20 need 64-lane waves ("no wave64"), 3 per-lane f16 refusals in `lower_dxil::tests::{f16,f32}_programs_on_the_gpu`. - Parallel runs of `cargo test -p xcl --lib kernelx::` repeat existing races that `main` has too (`gpu_visible_fallback_memory_is_write_watched`, `virtual_free_ex_and_sparse_validation`, `a_page_whose_move_fails_stays_mapped_where_it_was`; 3 failures in 40 runs of `main` 568e7db). **Regression run** `scripts/smoke.ps1 -Game <retail title> -Seconds 60`, no input, `main` first, same machine (each run's `xcl.exe` built from a clean checkout of its commit): ``` xcl-smoke v1 commit: 568e7db7729c8fa6c8f0f4b32d798faaf11462bb gpu: NVIDIA GeForce RTX 5090 title: 2c508222 seconds: 60 exit: 0x0 frames shown: 1015 (PresentX 1015) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 16257 MB ``` ``` xcl-smoke v1 commit: d660e3070bef6e3ae095393dc134ecd517ab4a35 gpu: NVIDIA GeForce RTX 5090 title: 2c508222 seconds: 60 exit: 0x0 frames shown: 1527 (PresentX 1528) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15776 MB ``` **Not tested** - AMD and Intel GPUs; Wine / Proton. - Nothing watches a view in this PR, so the smoke runs only show it changes nothing; the guards run in the title with #2307. **AI use** - Claude Code (Claude Opus 5.5): wrote the code, the tests and this description, and made the runs above on this hardware. I read every line of the diff and checked it.
nnonno91 commented 2026-11-25 15:08:03 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by nnonno91 on 2026-11-25T14:56:43Z.


Independent native Windows verification of d660e3070bef6e3ae095393dc134ecd517ab4a35, including a real file read across two guarded pages.

Tested

  • Windows 11 25H2 build 26200.9974, Ryzen 7 9800X3D, Rust 1.100.0 MSVC, unoptimized profile. CPU-side tests.
  • Ran cargo test --locked -p xcl --lib hle::kernelx::guards -- --nocapture --test-threads=4 in three separate processes. Each gave 8 passed, 0 failed, 0 ignored and no skips. The eight-thread write check and simulated pending-overlapped check passed each time.
  • A temporary test used std::fs::File::read_exact to read a 16-byte file across the boundary of two committed pages while their destination views were held open. A second view of the same pages immediately read back all 16 bytes. After the open guard was dropped and dirty pages were collected, all four views were reported and guarded again. cargo test --locked -p xcl --lib hle::kernelx::guards::tests::local_file_read_across_two_guarded_pages -- --exact --nocapture --test-threads=1 gave 1 passed, 0 failed, 0 ignored and no skips. The temporary test was removed.

Not tested

Real overlapped file I/O, GPU uploads, a retail title, Wine and the full workspace suite.

AI use

OpenAI Codex (GPT-6.2 Sol) added the temporary file-read check, ran the tests and wrote this report.

<!-- greyfinch-sync:ivall/xcl:comment:7166059911 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2294#issuecomment-7166059911). Originally posted by [nnonno91](https://github.com/nnonno91) on 2026-11-25T14:56:43Z. --- Independent native Windows verification of `d660e3070bef6e3ae095393dc134ecd517ab4a35`, including a real file read across two guarded pages. **Tested** - Windows 11 25H2 build 26200.9974, Ryzen 7 9800X3D, Rust 1.100.0 MSVC, unoptimized profile. CPU-side tests. - Ran `cargo test --locked -p xcl --lib hle::kernelx::guards -- --nocapture --test-threads=4` in three separate processes. Each gave 8 passed, 0 failed, 0 ignored and no skips. The eight-thread write check and simulated pending-overlapped check passed each time. - A temporary test used `std::fs::File::read_exact` to read a 16-byte file across the boundary of two committed pages while their destination views were held open. A second view of the same pages immediately read back all 16 bytes. After the open guard was dropped and dirty pages were collected, all four views were reported and guarded again. `cargo test --locked -p xcl --lib hle::kernelx::guards::tests::local_file_read_across_two_guarded_pages -- --exact --nocapture --test-threads=1` gave 1 passed, 0 failed, 0 ignored and no skips. The temporary test was removed. **Not tested** Real overlapped file I/O, GPU uploads, a retail title, Wine and the full workspace suite. **AI use** OpenAI Codex (GPT-6.2 Sol) added the temporary file-read check, ran the tests and wrote this report.
oni-swr commented 2026-11-25 16:12:23 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by oni-swr on 2026-11-25T16:05:14Z.


amd-win test report for head d660e3070bef6e3ae095393dc134ecd517ab4a35 (exact PR head, not a merge; its merge-base with main is 568e7db7).

Hardware: AMD Radeon RX 7800 XT (driver 32.0.31035.1003), Ryzen 7 5700X3D, Windows 11 26200, Rust 1.100.0, debug for tests, release for the smoke runs.

Focused tests

  • cargo test -p xcl --lib kernelx::guards: 8 passed, 0 failed
  • cargo test -p xcl --lib kernelx::sections: 7 passed, 0 failed
  • cargo test -p xcl --lib kernelx::: 53 passed, 0 failed, 1 ignored

Full suite: cargo build --workspace, then cargo test --workspace --no-fail-fast -- --test-threads=4: 1168 passed, 1 failed, 46 ignored.

  • The failure is gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1 (seed 722: res[30] = 0x1, CPU 0x7fffffff). It fails the same way on the merge-base 568e7db7 (1 failed, same seed and message), so it is not caused by this PR.
  • SKIPPED (adapter/semantics, not coverage): f16_programs_on_the_gpu and f32_programs_on_the_gpu (several forms, "unsupported V_MUL_F16 / V_PK_MUL_F16 / V_CVT_F16_F32"), heap_window_out_of_memory_falls_back_to_the_switch_form ("no heap windows").

Regression run (retail title, 60 s, scripts/smoke.ps1 -Seconds 60, release builds of 568e7db7 and of the PR head; one run each, so run-to-run noise applies). These are not pasted xcl-smoke blocks: the script stamps the checkout's HEAD, and I ran both binaries from one checkout, so I quote the numbers instead.

frames shown presents per 2 s (last 3) device removals crashes peak commit
568e7db7 (main) 1495 60 60 60 0 0 17116 MB
PR head 1433 60 60 60 0 0 16411 MB

PR head is 96 % of main's frames, and its peak commit is 96 % of main's.

Not tested: NVIDIA, wave32-only GPUs, runs longer than 60 s, any title other than the one above. The smoke run reaches the title's world load, and I did not check whether it exercises the new write-watch path specifically.

AI use: this report was run and written by Claude Code (Claude Sonnet 5.5).

<!-- greyfinch-sync:ivall/xcl:comment:7167581311 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2294#issuecomment-7167581311). Originally posted by [oni-swr](https://github.com/oni-swr) on 2026-11-25T16:05:14Z. --- **amd-win test report** for head `d660e3070bef6e3ae095393dc134ecd517ab4a35` (exact PR head, not a merge; its merge-base with `main` is `568e7db7`). Hardware: AMD Radeon RX 7800 XT (driver 32.0.31035.1003), Ryzen 7 5700X3D, Windows 11 26200, Rust 1.100.0, debug for tests, release for the smoke runs. **Focused tests** - `cargo test -p xcl --lib kernelx::guards`: 8 passed, 0 failed - `cargo test -p xcl --lib kernelx::sections`: 7 passed, 0 failed - `cargo test -p xcl --lib kernelx::`: 53 passed, 0 failed, 1 ignored **Full suite**: `cargo build --workspace`, then `cargo test --workspace --no-fail-fast -- --test-threads=4`: 1168 passed, 1 failed, 46 ignored. - The failure is `gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1` (`seed 722: res[30] = 0x1, CPU 0x7fffffff`). It fails the same way on the merge-base `568e7db7` (1 failed, same seed and message), so it is not caused by this PR. - SKIPPED (adapter/semantics, not coverage): `f16_programs_on_the_gpu` and `f32_programs_on_the_gpu` (several forms, "unsupported V_MUL_F16 / V_PK_MUL_F16 / V_CVT_F16_F32"), `heap_window_out_of_memory_falls_back_to_the_switch_form` ("no heap windows"). **Regression run** (retail title, 60 s, `scripts/smoke.ps1 -Seconds 60`, release builds of `568e7db7` and of the PR head; one run each, so run-to-run noise applies). These are not pasted `xcl-smoke` blocks: the script stamps the checkout's HEAD, and I ran both binaries from one checkout, so I quote the numbers instead. | | frames shown | presents per 2 s (last 3) | device removals | crashes | peak commit | |---|---|---|---|---|---| | `568e7db7` (main) | 1495 | 60 60 60 | 0 | 0 | 17116 MB | | PR head | 1433 | 60 60 60 | 0 | 0 | 16411 MB | PR head is 96 % of main's frames, and its peak commit is 96 % of main's. **Not tested**: NVIDIA, wave32-only GPUs, runs longer than 60 s, any title other than the one above. The smoke run reaches the title's world load, and I did not check whether it exercises the new write-watch path specifically. **AI use**: this report was run and written by Claude Code (Claude Sonnet 5.5).
safesearch77 commented 2026-11-25 17:07:22 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by safesearch77 on 2026-11-25T16:30:23Z.


Reviewed d660e30 (#2294, stacked on #2293) against main (0829441). Clean design using Opened pins for kernel writes where user-mode VEH won't fire — caught two subtle PAGE_READONLY races in the callers when XCL_PAGE_ALIAS=1 is turned on in #2307:

  1. dstorage/parallel.rs NtWriteVirtualMemory race (0x89240009 E_ACCESS_VIOLATION):

    • In dstorage::writable(p, n), let _open = lazy::ensure(p, n); drops Opened before writable returns. That works for serial execute()'s user-mode copy_nonoverlapping, but Pipeline::retire_one (parallel.rs:465, 488) writes file-backed zlib requests via the kernel syscall NtWriteVirtualMemory.
    • If a render thread runs ExecuteCommandLists -> title_textures::refresh_once -> guards::take_dirty between writable(at, n) returning and write_destination(at, ...), take_dirty re-arms PAGE_READONLY on at, causing NtWriteVirtualMemory to fail in the kernel (0x89240009) without invoking guards::handler. Returning Opened from writable and holding it across write_destination closes that window.
  2. d3d12x/cpu_writes.rs silently dropping Write32/64BitValueBottomOfPipeX on re-guarded views:

    • cpu_writes::writable(va, bytes) calls lazy::ensure at enqueue time, but write_now(va, words) (cpu_writes.rs:92-107) and u64_writable_now(va) (cpu_writes.rs:110-126) run later on the xcl-cpu-writes worker after GPU fence completion and check VirtualQuery for PAGE_READWRITE | PAGE_EXECUTE_READWRITE without calling lazy::ensure before executing the atomic store.
    • If take_dirty re-protected the view to PAGE_READONLY while GPU work was in flight, write_now / write_u64_now / max_u64_now see PAGE_READONLY and return early without writing the bottom-of-pipe fence value (never reaching the store that would fault into guards::handler). Holding let _open = lazy::ensure(va, bytes); inside write_now and u64_writable_now fixes this too.

AI use: Antigravity (Gemini 4 Carbon) helped trace Opened lifetimes across dstorage/parallel.rs and cpu_writes.rs; verified against the source by me.

<!-- greyfinch-sync:ivall/xcl:comment:7168088864 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2294#issuecomment-7168088864). Originally posted by [safesearch77](https://github.com/safesearch77) on 2026-11-25T16:30:23Z. --- Reviewed `d660e30` (`#2294`, stacked on `#2293`) against `main` (`0829441`). Clean design using `Opened` pins for kernel writes where user-mode VEH won't fire — caught two subtle `PAGE_READONLY` races in the callers when `XCL_PAGE_ALIAS=1` is turned on in `#2307`: 1. **`dstorage/parallel.rs` `NtWriteVirtualMemory` race (`0x89240009` `E_ACCESS_VIOLATION`):** - In `dstorage::writable(p, n)`, `let _open = lazy::ensure(p, n);` drops `Opened` before `writable` returns. That works for serial `execute()`'s user-mode `copy_nonoverlapping`, **but `Pipeline::retire_one` (`parallel.rs:465, 488`) writes file-backed zlib requests via the kernel syscall `NtWriteVirtualMemory`**. - If a render thread runs `ExecuteCommandLists` -> `title_textures::refresh_once` -> `guards::take_dirty` between `writable(at, n)` returning and `write_destination(at, ...)`, `take_dirty` re-arms `PAGE_READONLY` on `at`, causing `NtWriteVirtualMemory` to fail in the kernel (`0x89240009`) without invoking `guards::handler`. Returning `Opened` from `writable` and holding it across `write_destination` closes that window. 2. **`d3d12x/cpu_writes.rs` silently dropping `Write32/64BitValueBottomOfPipeX` on re-guarded views:** - `cpu_writes::writable(va, bytes)` calls `lazy::ensure` at enqueue time, **but `write_now(va, words)` (`cpu_writes.rs:92-107`) and `u64_writable_now(va)` (`cpu_writes.rs:110-126`) run later on the `xcl-cpu-writes` worker after GPU fence completion and check `VirtualQuery` for `PAGE_READWRITE | PAGE_EXECUTE_READWRITE` *without* calling `lazy::ensure` before executing the atomic store**. - If `take_dirty` re-protected the view to `PAGE_READONLY` while GPU work was in flight, `write_now` / `write_u64_now` / `max_u64_now` see `PAGE_READONLY` and return early without writing the bottom-of-pipe fence value (never reaching the store that would fault into `guards::handler`). Holding `let _open = lazy::ensure(va, bytes);` inside `write_now` and `u64_writable_now` fixes this too. AI use: Antigravity (Gemini 4 Carbon) helped trace `Opened` lifetimes across `dstorage/parallel.rs` and `cpu_writes.rs`; verified against the source by me.
upipibi commented 2026-11-25 17:07:37 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by upipibi on 2026-11-25T17:07:21Z.


NVIDIA test report for d660e30 (head as is, base 568e7db; stacked on #2293), for #1607's NVIDIA list. RTX 3070 8 GB (Ampere, 32-lane waves), driver 616.56, Windows 11, debug, after cargo build --workspace:

  • cargo test --workspace --no-fail-fast -- --test-threads=4 --skip hle::xaudio2: 1160 passed, 0 failed, 46 ignored. The end-to-end title tests pass.
  • main 0829441 on the same machine, same command: 1263 passed, 0 failed, 46 ignored (the PR's base is older, so it has fewer tests).
  • Skipped hle::xaudio2, because its tests fail or hang on this machine on main too. The PR doesn't touch it.
  • SKIPPED lines: 25: 20 no wave64 on this card, 3 f16/f32 forms the per-lane path refuses, 1 no heap windows, and 1 PSO measurement that needs Developer Mode to turn the driver cache off.

AI-assisted (Claude Code, Claude Opus 5.5). Synthetic tests only; no title run.

<!-- greyfinch-sync:ivall/xcl:comment:7169037177 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2294#issuecomment-7169037177). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-25T17:07:21Z. --- NVIDIA test report for `d660e30` (head as is, base `568e7db`; stacked on #2293), for #1607's NVIDIA list. RTX 3070 8 GB (Ampere, 32-lane waves), driver 616.56, Windows 11, debug, after `cargo build --workspace`: - `cargo test --workspace --no-fail-fast -- --test-threads=4 --skip hle::xaudio2`: **1160 passed, 0 failed, 46 ignored**. The end-to-end title tests pass. - `main` `0829441` on the same machine, same command: 1263 passed, 0 failed, 46 ignored (the PR's base is older, so it has fewer tests). - Skipped `hle::xaudio2`, because its tests fail or hang on this machine on `main` too. The PR doesn't touch it. - SKIPPED lines: 25: 20 `no wave64` on this card, 3 f16/f32 forms the per-lane path refuses, 1 no heap windows, and 1 PSO measurement that needs Developer Mode to turn the driver cache off. AI-assisted (Claude Code, Claude Opus 5.5). Synthetic tests only; no title run.
DavidM1911 commented 2026-11-25 18:04:35 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T17:29:51Z.


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:7169587513 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2294#issuecomment-7169587513). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T17:29:51Z. --- 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!
Decodere commented 2026-11-27 06:56:32 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Decodere on 2026-11-27T06:56:32Z.


Independent desktop NVIDIA verification of PR #2294 at head d660e3070bef6e3ae095393dc134ecd517ab4a35 (3 commits stacked on PR #2293: 03ceddb0be3d06287ca21ae800dbb0d7f98049e7 -> 6602a7020122f508f72fed942286f488e3bd1bb9 -> d660e3070bef6e3ae095393dc134ecd517ab4a35; exact parent & merge-base: 568e7db7729c8fa6c8f0f4b32d798faaf11462bb, pre-#2555 ancestor of main).

Environment

  • GPU: NVIDIA GeForce RTX 4060 (8 GB / 7956 MiB reported by D3D12), driver 32.0.16.2114 (NVIDIA 621.14, WDDM 3.2)
  • CPU / RAM / OS: Intel Core i5-11400F (6C / 12T), 32 GB RAM (31.9 GiB usable), Windows 11 Home 26200 (Developer Mode off)
  • Toolchain: rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC, DXC 1.9.2609.5, --release

Targeted release tests & build (d660e307)

Command Result
cargo test --release -p xcl --lib hle::kernelx::guards:: -- --test-threads=1 --nocapture (3 consecutive runs) 8 passed; 0 failed; 0 ignored; 1131 filtered out × 3 (0.00s × 3, 0 skipped: a_forgotten_view_is_no_longer_reported, a_view_committed_later_counts_as_written, a_write_through_one_view_reports_every_view_of_the_page, a_write_to_a_view_not_committed_yet_is_left_to_the_next_handler, open_makes_views_writable_for_a_kernel_call_and_counts_the_write, steps_of_4_kib_cover_the_view, views_an_overlapped_read_writes_stay_open_until_it_is_done, writes_from_many_threads_are_all_caught_and_kept)
cargo test --release -p xcl --lib hle::kernelx:: -- --test-threads=1 (3 consecutive runs) 53 passed; 0 failed; 1 ignored; 1085 filtered out × 3 (1.16s, 1.15s, 1.14s, 0 skipped; includes all 8 guards::tests and all 7 stacked sections::tests)
cargo build --release -p xcl Clean build (1m 18s, exit 0, 0 new warnings in non-test build; cargo test emits 1 new unused_assignments warning in #[cfg(test)]: crates/xcl/src/hle/kernelx/guards.rs:366:9 ov[0] = 0)

Paired quiet 60 s retail smoke (title: 29640639)

Exact parent & merge-base (568e7db7729c8fa6c8f0f4b32d798faaf11462bb, cached baseline on the same machine):

xcl-smoke v1
commit: 568e7db7729c8fa6c8f0f4b32d798faaf11462bb
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1587 (PresentX 1587)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14527 MB

PR #2294 (d660e3070bef6e3ae095393dc134ecd517ab4a35):

xcl-smoke v1
commit: d660e3070bef6e3ae095393dc134ecd517ab4a35
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1554 (PresentX 1554)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14500 MB

Limits of coverage

  • Page-by-page VEH write-catching across aliased views, kernel-call/overlapped-read open/open_until_done windows, multi-threaded concurrent faults, and uncommitted-page fallthrough were directly verified on Windows 11 via all 8 new hle::kernelx::guards::tests (3/3, 0 skipped) and hle::kernelx:: (53/53 × 3).
  • Full runtime XCL_PAGE_ALIAS=1 activation is wired in stacked PR #2307, so this 60 s retail smoke confirms default-path non-regression on title: 29640639 (single-run frame/commit delta reflects normal startup variance, not this PR).

AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).

<!-- greyfinch-sync:ivall/xcl:comment:7211990532 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2294#issuecomment-7211990532). Originally posted by [Decodere](https://github.com/Decodere) on 2026-11-27T06:56:32Z. --- Independent desktop NVIDIA verification of **PR #2294** at head `d660e3070bef6e3ae095393dc134ecd517ab4a35` (`3` commits stacked on PR #2293: `03ceddb0be3d06287ca21ae800dbb0d7f98049e7` -> `6602a7020122f508f72fed942286f488e3bd1bb9` -> `d660e3070bef6e3ae095393dc134ecd517ab4a35`; exact parent & merge-base: `568e7db7729c8fa6c8f0f4b32d798faaf11462bb`, pre-`#2555` ancestor of `main`). ### Environment - **GPU:** NVIDIA GeForce RTX 4060 (8 GB / `7956 MiB` reported by D3D12), driver `32.0.16.2114` (NVIDIA `621.14`, WDDM 3.2) - **CPU / RAM / OS:** Intel Core i5-11400F (6C / 12T), 32 GB RAM (`31.9 GiB` usable), Windows 11 Home `26200` (Developer Mode off) - **Toolchain:** `rustc 1.100.0 (0ef1bc386 2026-11-09)` MSVC, DXC `1.9.2609.5`, `--release` ### Targeted release tests & build (`d660e307`) | Command | Result | | --- | --- | | `cargo test --release -p xcl --lib hle::kernelx::guards:: -- --test-threads=1 --nocapture` (3 consecutive runs) | `8 passed; 0 failed; 0 ignored; 1131 filtered out` × 3 (`0.00s` × 3, `0` skipped: `a_forgotten_view_is_no_longer_reported`, `a_view_committed_later_counts_as_written`, `a_write_through_one_view_reports_every_view_of_the_page`, `a_write_to_a_view_not_committed_yet_is_left_to_the_next_handler`, `open_makes_views_writable_for_a_kernel_call_and_counts_the_write`, `steps_of_4_kib_cover_the_view`, `views_an_overlapped_read_writes_stay_open_until_it_is_done`, `writes_from_many_threads_are_all_caught_and_kept`) | | `cargo test --release -p xcl --lib hle::kernelx:: -- --test-threads=1` (3 consecutive runs) | `53 passed; 0 failed; 1 ignored; 1085 filtered out` × 3 (`1.16s`, `1.15s`, `1.14s`, `0` skipped; includes all `8` `guards::tests` and all `7` stacked `sections::tests`) | | `cargo build --release -p xcl` | Clean build (`1m 18s`, exit `0`, `0` new warnings in non-test build; `cargo test` emits 1 new `unused_assignments` warning in `#[cfg(test)]`: `crates/xcl/src/hle/kernelx/guards.rs:366:9` `ov[0] = 0`) | ### Paired quiet 60 s retail smoke (`title: 29640639`) Exact parent & merge-base (`568e7db7729c8fa6c8f0f4b32d798faaf11462bb`, cached baseline on the same machine): ``` xcl-smoke v1 commit: 568e7db7729c8fa6c8f0f4b32d798faaf11462bb gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1587 (PresentX 1587) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14527 MB ``` PR #2294 (`d660e3070bef6e3ae095393dc134ecd517ab4a35`): ``` xcl-smoke v1 commit: d660e3070bef6e3ae095393dc134ecd517ab4a35 gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1554 (PresentX 1554) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14500 MB ``` ### Limits of coverage - Page-by-page VEH write-catching across aliased views, kernel-call/overlapped-read `open`/`open_until_done` windows, multi-threaded concurrent faults, and uncommitted-page fallthrough were directly verified on Windows 11 via all 8 new `hle::kernelx::guards::tests` (`3/3`, `0` skipped) and `hle::kernelx::` (`53/53` × 3). - Full runtime `XCL_PAGE_ALIAS=1` activation is wired in stacked PR #2307, so this 60 s retail smoke confirms default-path non-regression on `title: 29640639` (single-run frame/commit delta reflects normal startup variance, not this PR). *AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).*
Foniass commented 2026-12-01 07:46:10 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T07:46:10Z.


Triage (#1607) – head d660e30

Stacked on #2293 (only 6602a70 and d660e30 belong here); #2307 is stacked on this PR. No other open or merged PR adds write guards for section views.
No blocking problems found in the diff. Note that dstorage.rs::writable and cpu_writes.rs::writable drop the Opened they get from lazy::ensure when they return, before the copy, so those writes depend on the VEH (user-mode copies, which is fine). Only hk_read_file holds the views open across the kernel call.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7304456783 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2294#issuecomment-7304456783). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T07:46:10Z. --- **Triage (#1607)** – head d660e30 Stacked on #2293 (only `6602a70` and `d660e30` belong here); #2307 is stacked on this PR. No other open or merged PR adds write guards for section views. No blocking problems found in the diff. Note that `dstorage.rs::writable` and `cpu_writes.rs::writable` drop the `Opened` they get from `lazy::ensure` when they return, before the copy, so those writes depend on the VEH (user-mode copies, which is fine). Only `hk_read_file` holds the views open across the kernel call. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
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/2294:upstream-pr/2294'
git switch 'upstream-pr/2294'

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/2294'
git switch 'upstream-pr/2294'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2294'
git switch 'upstream-pr/2294'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2294'
git switch 'main'
git merge --squash 'upstream-pr/2294'
git switch 'main'
git merge --ff-only 'upstream-pr/2294'
git switch 'main'
git merge 'upstream-pr/2294'
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!2284
No description provided.