kernelx: a failed physical page read or write commits no earlier home #1771

Open
Luislariosss wants to merge 1 commit from upstream-pr/1781 into main
Luislariosss commented 2026-11-24 20:36:13 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Luislariosss on 2026-11-24T20:36:13Z.


resolve_physical_pages committed each page's home as it resolved it: a multi-page read or write that failed on a later page left the earlier pages' sparse homes reserved — memory the title cannot account for, surfacing later as an allocation or mapping failure.

What is in it

  • Every page_home lookup for pages[..need] is collected and validated before the first home_again runs; a failed read or write commits nothing.
  • The success path resolves the same homes in the same order as before.
  • Test failed_physical_page_read_or_write_does_not_commit_earlier_sparse_homes: a write and a read that fail on their second page leave the first page's home uncommitted (the test no-ops on an adapter without sparse pages).

Tested

  • Windows 11 26200, AMD Radeon RX 9060 XT 16 GB (driver 32.0.32015.7029), Ryzen 5 9600X, 16 GB RAM; Rust 1.99 stable-x86_64-pc-windows-msvc; DXC 1.9.2609.5 through XCL_DXC_DIR; CARGO_PROFILE_TEST_DEBUG=0.
  • cargo test -p xcl --lib kernelx at the head: 37 passed, 0 failed, 1 ignored. The new test fails without the fix (verified by reverting the fix hunk and back).
  • Workspace suite at the head (cargo build --workspace then cargo test --workspace --no-fail-fast -- --test-threads=4): 876 passed, 0 failed, 38 ignored (20 test binaries; SKIPPED: pso_measurement_compiles_an_exact_synthetic_record — cannot disable the driver cache; heap_window_out_of_memory_falls_back_to_the_switch_form — no heap windows).
  • Regression run (retail title, 60 s, machine idle; the XCL process ran under a Job Object per-process committed-memory cap of 20,480 MB as in #1566 — this machine has 16 GB RAM; the blocks' title: line reads retail-title, the folder name is withheld):

main (85e3826, clean tree):

xcl-smoke v1
commit: 85e38262ff94aecd75d6f83fa8156a8b7697bd13
gpu: AMD Radeon RX 9060 XT
title: retail-title
seconds: 60
exit: 0x0
frames shown: 938 (PresentX 938)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15565 MB

head (dbdc480, clean tree):

xcl-smoke v1
commit: dbdc480262a0c12df0e9e0598bb8759fc1f79a08
gpu: AMD Radeon RX 9060 XT
title: retail-title
seconds: 60
exit: 0x0
frames shown: 863 (PresentX 863)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15547 MB

Not tested

  • Whether any retail title hits a failing multi-page read or write in normal play; the new test covers the path directly.

AI use

  • opencode: HY4 Flash Free (builds, test and smoke runs, PR assembly); the fix and its review gate by Sonnet (Claude). The smoke blocks and test counts are script-generated.
<!-- greyfinch-sync:ivall/xcl:issue:5479908693 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1781). Originally posted by [Luislariosss](https://github.com/Luislariosss) on 2026-11-24T20:36:13Z. --- `resolve_physical_pages` committed each page's home as it resolved it: a multi-page read or write that failed on a later page left the earlier pages' sparse homes reserved — memory the title cannot account for, surfacing later as an allocation or mapping failure. **What is in it** - Every `page_home` lookup for `pages[..need]` is collected and validated before the first `home_again` runs; a failed read or write commits nothing. - The success path resolves the same homes in the same order as before. - Test `failed_physical_page_read_or_write_does_not_commit_earlier_sparse_homes`: a write and a read that fail on their second page leave the first page's home uncommitted (the test no-ops on an adapter without sparse pages). **Tested** - Windows 11 26200, AMD Radeon RX 9060 XT 16 GB (driver 32.0.32015.7029), Ryzen 5 9600X, 16 GB RAM; Rust 1.99 `stable-x86_64-pc-windows-msvc`; DXC 1.9.2609.5 through `XCL_DXC_DIR`; `CARGO_PROFILE_TEST_DEBUG=0`. - `cargo test -p xcl --lib kernelx` at the head: 37 passed, 0 failed, 1 ignored. The new test fails without the fix (verified by reverting the fix hunk and back). - Workspace suite at the head (`cargo build --workspace` then `cargo test --workspace --no-fail-fast -- --test-threads=4`): **876 passed, 0 failed, 38 ignored** (20 test binaries; `SKIPPED`: `pso_measurement_compiles_an_exact_synthetic_record` — cannot disable the driver cache; `heap_window_out_of_memory_falls_back_to_the_switch_form` — no heap windows). - **Regression run** (retail title, 60 s, machine idle; the XCL process ran under a Job Object per-process committed-memory cap of 20,480 MB as in #1566 — this machine has 16 GB RAM; the blocks' `title:` line reads `retail-title`, the folder name is withheld): main (`85e3826`, clean tree): ``` xcl-smoke v1 commit: 85e38262ff94aecd75d6f83fa8156a8b7697bd13 gpu: AMD Radeon RX 9060 XT title: retail-title seconds: 60 exit: 0x0 frames shown: 938 (PresentX 938) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15565 MB ``` head (`dbdc480`, clean tree): ``` xcl-smoke v1 commit: dbdc480262a0c12df0e9e0598bb8759fc1f79a08 gpu: AMD Radeon RX 9060 XT title: retail-title seconds: 60 exit: 0x0 frames shown: 863 (PresentX 863) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15547 MB ``` **Not tested** - Whether any retail title hits a failing multi-page read or write in normal play; the new test covers the path directly. **AI use** - opencode: HY4 Flash Free (builds, test and smoke runs, PR assembly); the fix and its review gate by Sonnet (Claude). The smoke blocks and test counts are script-generated.
frenziedcoder commented 2026-11-24 21:09:46 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by frenziedcoder on 2026-11-24T20:55:47Z.


NVIDIA test report for dbdc480: an NVIDIA run next to the RX 9060 XT one in the description. Full suite green, the PR's own test passing, and a clean smoke pair (1652 vs 1654 frames).

Tested

  • NVIDIA GeForce RTX 5080 16 GB (driver 617.14, 32-lane waves), AMD Ryzen 7 9800X3D, 64 GB, Windows 11 Pro 25H2 (26200.9974), rustc 1.100.0 stable-x86_64-pc-windows-msvc, DXC 1.8.2502.11 (SDK 10.0.26100.0). Exact head dbdc480262a0c12df0e9e0598bb8759fc1f79a08, no local changes.
  • cargo build --workspace && cargo test --workspace -- --test-threads=4 (debug): 876 passed, 0 failed, 42 ignored; failed_physical_page_read_or_write_does_not_commit_earlier_sparse_homes passes. SKIPPED: gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware (no wave64), heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).

Regression run (scripts/smoke.ps1 -Seconds 60, release, the retail title of #505 at its start screen; XCL_PSO_PRELOAD=0 for both builds, because this machine's preload list holds the program of #1307)

base (4178e88, this PR's base; the same base run as in my report on #1747):

xcl-smoke v1
commit: 4178e888c0b5be50a2887eda45cdb832763b68a4
gpu: NVIDIA GeForce RTX 5080
title: RetailTitle
seconds: 60
exit: 0x0
frames shown: 1654 (PresentX 1654)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14604 MB

this PR:

xcl-smoke v1
commit: dbdc480262a0c12df0e9e0598bb8759fc1f79a08
gpu: NVIDIA GeForce RTX 5080
title: RetailTitle
seconds: 60
exit: 0x0
frames shown: 1652 (PresentX 1652)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14605 MB

Not tested: a failed multi-page physical read or write in the title (none is logged at its start screen); the world load; AMD.

AI use: Claude Code (Claude Opus 5.5) built and ran the tests and smoke runs on my machine and wrote this report; I checked it.

<!-- greyfinch-sync:ivall/xcl:comment:7144245212 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1781#issuecomment-7144245212). Originally posted by [frenziedcoder](https://github.com/frenziedcoder) on 2026-11-24T20:55:47Z. --- **NVIDIA test report for `dbdc480`: an NVIDIA run next to the RX 9060 XT one in the description. Full suite green, the PR's own test passing, and a clean smoke pair (1652 vs 1654 frames).** **Tested** - NVIDIA GeForce RTX 5080 16 GB (driver 617.14, 32-lane waves), AMD Ryzen 7 9800X3D, 64 GB, Windows 11 Pro 25H2 (26200.9974), rustc 1.100.0 `stable-x86_64-pc-windows-msvc`, DXC 1.8.2502.11 (SDK 10.0.26100.0). Exact head `dbdc480262a0c12df0e9e0598bb8759fc1f79a08`, no local changes. - `cargo build --workspace && cargo test --workspace -- --test-threads=4` (debug): **876 passed, 0 failed, 42 ignored**; `failed_physical_page_read_or_write_does_not_commit_earlier_sparse_homes` passes. SKIPPED: `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware` (no wave64), `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). **Regression run** (`scripts/smoke.ps1 -Seconds 60`, release, the retail title of #505 at its start screen; `XCL_PSO_PRELOAD=0` for both builds, because this machine's preload list holds the program of #1307) base (`4178e88`, this PR's base; the same base run as in my report on #1747): ``` xcl-smoke v1 commit: 4178e888c0b5be50a2887eda45cdb832763b68a4 gpu: NVIDIA GeForce RTX 5080 title: RetailTitle seconds: 60 exit: 0x0 frames shown: 1654 (PresentX 1654) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14604 MB ``` this PR: ``` xcl-smoke v1 commit: dbdc480262a0c12df0e9e0598bb8759fc1f79a08 gpu: NVIDIA GeForce RTX 5080 title: RetailTitle seconds: 60 exit: 0x0 frames shown: 1652 (PresentX 1652) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14605 MB ``` **Not tested:** a failed multi-page physical read or write in the title (none is logged at its start screen); the world load; AMD. *AI use: Claude Code (Claude Opus 5.5) built and ran the tests and smoke runs on my machine and wrote this report; I checked it.*
DavidM1911 commented 2026-11-25 00:08:57 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T23:36:00Z.


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

  • cargo test -p xcl --lib: all passed, 0 failed, ~23 ignored. (Intermittent single-test flake under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified main.)

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7147584074 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1781#issuecomment-7147584074). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T23:36:00Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~23 ignored. (Intermittent single-test flake under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified `main`.) Thanks!
anes66 commented 2026-11-25 06:06:02 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by anes66 on 2026-11-25T05:57:32Z.


Independent CPU-only reproduction on exact head dbdc480262a0c12df0e9e0598bb8759fc1f79a08: optional test companion 0b7fc45 adds a plain-memory variant of the regression, directly on that head. No runtime changes.

The existing regression depends on sparse GPU setup. The new test instead registers three reserved Windows pages as a synthetic plain physical-page home in an isolated child process and calls the real read_physical_pages / write_physical_pages functions. It asserts that XCL's real D3D12 device pointer stays null. UMA's CPU address reservations use 1 MiB settings; no GPU backend is created.

Tested

  • Windows 10 Pro 19045, Ryzen 7 9800X3D, Rust 1.100.0 MSVC, debug. No GPU, DXC or title execution.
  • 36 invalid requests: zero, misaligned and out-of-allocation page numbers, each at the first/middle/last position, offsets 0 and the last byte of the first page, both read and write. Every reserved home stays uncommitted and failed reads preserve their destination bytes.
  • Positive controls: a valid three-page read commits zero-filled memory; multi-page write/read round trips match at both offsets. An unused trailing invalid page is ignored, as expected for a request that ends before it.
  • cargo test --locked -p xcl --lib failed_physical_page_io_keeps_plain_homes_reserved_without_a_gpu -j 2 -- --nocapture --test-threads=1: 1 passed / 0 failed / 0 ignored / 0 skips. The output also contains the isolated child's run of that same test; it is not a second independent case.
  • Replacing the all-page validation pre-pass with the original per-page page_home / home_again loop makes the test fail with failed write committed page 0. Restored before the final passing run and commit.

Not tested
Sparse GPU homes, moved/away mappings, actual allocation exhaustion, release, full workspace suite, retail smoke, or newer-main integration. The test establishes that an invalid later page has no earlier plain-home commit side effect; it does not establish atomicity when all page numbers are valid but a later OS commit itself fails. No claim that this PR fixes our retail loading crashes.

AI use: Codex (GPT-6; exact variant unavailable) wrote the CPU variant and negative control, ran verification and prepared this report.

<!-- greyfinch-sync:ivall/xcl:comment:7154300452 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1781#issuecomment-7154300452). Originally posted by [anes66](https://github.com/anes66) on 2026-11-25T05:57:32Z. --- Independent CPU-only reproduction on exact head `dbdc480262a0c12df0e9e0598bb8759fc1f79a08`: optional test companion [0b7fc45](https://github.com/anes66/xcl/commit/0b7fc45a904de4d97314645269506af5f3e461e2) adds a plain-memory variant of the regression, directly on that head. No runtime changes. The existing regression depends on sparse GPU setup. The new test instead registers three reserved Windows pages as a synthetic plain physical-page home in an isolated child process and calls the real `read_physical_pages` / `write_physical_pages` functions. It asserts that XCL's real D3D12 device pointer stays null. UMA's CPU address reservations use 1 MiB settings; no GPU backend is created. **Tested** - Windows 10 Pro 19045, Ryzen 7 9800X3D, Rust 1.100.0 MSVC, debug. No GPU, DXC or title execution. - **36 invalid requests**: zero, misaligned and out-of-allocation page numbers, each at the first/middle/last position, offsets 0 and the last byte of the first page, both read and write. Every reserved home stays uncommitted and failed reads preserve their destination bytes. - Positive controls: a valid three-page read commits zero-filled memory; multi-page write/read round trips match at both offsets. An unused trailing invalid page is ignored, as expected for a request that ends before it. - `cargo test --locked -p xcl --lib failed_physical_page_io_keeps_plain_homes_reserved_without_a_gpu -j 2 -- --nocapture --test-threads=1`: **1 passed / 0 failed / 0 ignored / 0 skips**. The output also contains the isolated child's run of that same test; it is not a second independent case. - Replacing the all-page validation pre-pass with the original per-page `page_home` / `home_again` loop makes the test fail with `failed write committed page 0`. Restored before the final passing run and commit. **Not tested** Sparse GPU homes, moved/away mappings, actual allocation exhaustion, release, full workspace suite, retail smoke, or newer-main integration. The test establishes that an invalid later page has no earlier plain-home commit side effect; it does not establish atomicity when all page numbers are valid but a later OS commit itself fails. No claim that this PR fixes our retail loading crashes. AI use: Codex (GPT-6; exact variant unavailable) wrote the CPU variant and negative control, ran verification and prepared this report.
throny commented 2026-11-25 10:10:40 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-25T09:55:42Z.


Test report for exact head dbdc480.

Tested

  • Windows 11 Pro 10.0.26300, NVIDIA GeForce RTX 4080 (driver 610.88, 32-lane waves), Intel i9-12900K, 64 GB; Rust 1.100.0 MSVC; DXC 1.9.2602.17; tests in debug, title runs in release.
  • cargo build --workspace && cargo test --workspace -- --test-threads=4 on dbdc480 as it is (its own base): 876 passed, 0 failed, 42 ignored. SKIPPED: 4 lines (no wave64 on this adapter, and the like).
  • scripts/smoke.ps1, the retail title, 60 s, release builds, main 568e7db first, then this head:

main:

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

PR:

xcl-smoke v1
commit: dbdc480262a0c12df0e9e0598bb8759fc1f79a08
gpu: NVIDIA GeForce RTX 4080
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1604 (PresentX 1604)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15858 MB

Not tested: AMD, the head merged onto current main, a world load.

AI use: Claude Code (Claude Opus 5.5) ran this and wrote the report; the diff was read for safety by a Claude Opus 5.5 sub-agent before it was built.

<!-- greyfinch-sync:ivall/xcl:comment:7158990036 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1781#issuecomment-7158990036). Originally posted by [throny](https://github.com/throny) on 2026-11-25T09:55:42Z. --- Test report for exact head `dbdc480`. **Tested** - Windows 11 Pro 10.0.26300, NVIDIA GeForce RTX 4080 (driver 610.88, 32-lane waves), Intel i9-12900K, 64 GB; Rust 1.100.0 MSVC; DXC 1.9.2602.17; tests in debug, title runs in release. - `cargo build --workspace && cargo test --workspace -- --test-threads=4` on `dbdc480` as it is (its own base): **876 passed, 0 failed, 42 ignored**. `SKIPPED`: 4 lines (no wave64 on this adapter, and the like). - `scripts/smoke.ps1`, the retail title, 60 s, release builds, `main` `568e7db` first, then this head: main: ``` xcl-smoke v1 commit: 568e7db7729c8fa6c8f0f4b32d798faaf11462bb gpu: NVIDIA GeForce RTX 4080 title: 21222967 seconds: 60 exit: 0x0 frames shown: 1606 (PresentX 1606) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15816 MB ``` PR: ``` xcl-smoke v1 commit: dbdc480262a0c12df0e9e0598bb8759fc1f79a08 gpu: NVIDIA GeForce RTX 4080 title: retail-title seconds: 60 exit: 0x0 frames shown: 1604 (PresentX 1604) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15858 MB ``` **Not tested:** AMD, the head merged onto current `main`, a world load. AI use: Claude Code (Claude Opus 5.5) ran this and wrote the report; the diff was read for safety by a Claude Opus 5.5 sub-agent before it was built.
Pipodi commented 2026-11-30 14:20:20 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Pipodi on 2026-11-30T14:20:20Z.


merge-check claim
head: dbdc480262

<!-- greyfinch-sync:ivall/xcl:comment:7281214975 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1781#issuecomment-7281214975). Originally posted by [Pipodi](https://github.com/Pipodi) on 2026-11-30T14:20:20Z. --- merge-check claim head: dbdc480262a0c12df0e9e0598bb8759fc1f79a08
Pipodi commented 2026-11-30 14:37:36 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Pipodi on 2026-11-30T14:37:36Z.


merge-check
base: 9dfbe3ea66
head: dbdc480262
merge: clean (local merge tree 423481a964e07d07d44fd33af4a1f28467aa6466)
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2886 passed, 1 failed, 51 ignored; failing: gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16 (also fails on main 9dfbe3ea, fixed by #3513). New test hle::kernelx::tests::failed_physical_page_read_or_write_does_not_commit_earlier_sparse_homes passes on the merge and fails with the production hunk reverted (uncommitted, resolve_physical_pages back to checking and committing page by page: assert at kernelx.rs:3845). 25 SKIPPED: 22 "no wave64", plus two_pass_binds_set_the_shared_view_heap and heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows) and pso_measurement_compiles_an_exact_synthetic_record (cannot disable the driver cache: Developer Mode needed).
review: read the whole diff (crates/xcl/src/hle/kernelx.rs, +20 -2). resolve_physical_pages now looks up every page home first (collect into Option) and only then calls home_again, which commits a sparse home, so a failing later page no longer leaves earlier homes committed; read and write keep the AWAY lock the whole time, so the check and use cannot interleave. Behaviour on success is unchanged. One extra Vec of homes per call (need is small). No blocker. The console API the helper sits behind (AllocateTitlePhysicalPages page numbers, xgmemory.h gen8 line 541; XMemMapPhysicalPages returns NULL on a mapping failure, reference/system/xmem/functions/xmemmapphysicalpages.md line 49) names no partial effect for a failed call, so a failure that leaves no commit is the safe reading; the page-number read/write itself is an XCL helper with no GDK counterpart. No game data in the diff.
performance: none measurable; one small allocation per physical-page read or write.
verdict: safe to merge
hardware / tool and model: NVIDIA RTX 4090, driver 621.40; i9-13900K; Windows 11 Pro 10.0.26300; rustc 1.100.0; debug. Claude Code, Claude Opus 5.5.

<!-- greyfinch-sync:ivall/xcl:comment:7281671986 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1781#issuecomment-7281671986). Originally posted by [Pipodi](https://github.com/Pipodi) on 2026-11-30T14:37:36Z. --- merge-check base: 9dfbe3ea6653a9c76ef3ea0d66187a4b5407483b head: dbdc480262a0c12df0e9e0598bb8759fc1f79a08 merge: clean (local merge tree 423481a964e07d07d44fd33af4a1f28467aa6466) build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2886 passed, 1 failed, 51 ignored; failing: gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16 (also fails on main 9dfbe3ea, fixed by #3513). New test hle::kernelx::tests::failed_physical_page_read_or_write_does_not_commit_earlier_sparse_homes passes on the merge and fails with the production hunk reverted (uncommitted, resolve_physical_pages back to checking and committing page by page: assert at kernelx.rs:3845). 25 SKIPPED: 22 "no wave64", plus two_pass_binds_set_the_shared_view_heap and heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows) and pso_measurement_compiles_an_exact_synthetic_record (cannot disable the driver cache: Developer Mode needed). review: read the whole diff (crates/xcl/src/hle/kernelx.rs, +20 -2). resolve_physical_pages now looks up every page home first (collect into Option<Vec>) and only then calls home_again, which commits a sparse home, so a failing later page no longer leaves earlier homes committed; read and write keep the AWAY lock the whole time, so the check and use cannot interleave. Behaviour on success is unchanged. One extra Vec of homes per call (need is small). No blocker. The console API the helper sits behind (AllocateTitlePhysicalPages page numbers, xgmemory.h gen8 line 541; XMemMapPhysicalPages returns NULL on a mapping failure, reference/system/xmem/functions/xmemmapphysicalpages.md line 49) names no partial effect for a failed call, so a failure that leaves no commit is the safe reading; the page-number read/write itself is an XCL helper with no GDK counterpart. No game data in the diff. performance: none measurable; one small allocation per physical-page read or write. verdict: safe to merge hardware / tool and model: NVIDIA RTX 4090, driver 621.40; i9-13900K; Windows 11 Pro 10.0.26300; rustc 1.100.0; debug. Claude Code, Claude Opus 5.5.
saintwolf commented 2026-11-30 14:42:24 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by saintwolf on 2026-11-30T14:42:24Z.


merge-check claim
head: dbdc480262

<!-- greyfinch-sync:ivall/xcl:comment:7281798066 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1781#issuecomment-7281798066). Originally posted by [saintwolf](https://github.com/saintwolf) on 2026-11-30T14:42:24Z. --- merge-check claim head: dbdc480262a0c12df0e9e0598bb8759fc1f79a08
saintwolf commented 2026-11-30 14:47:31 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by saintwolf on 2026-11-30T14:47:31Z.


merge-check
base: 9dfbe3ea66
head: dbdc480262
merge: clean (trial merge b91c732483de62903792b3fdea2b50cc0d343833; git diff --check clean; +19/-2 in crates/xcl/src/hle/kernelx.rs)
build: cargo build --workspace -> ok (39 pre-existing warnings, none from the PR's files)
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2886 passed, 1 failed, 51 ignored; SKIPPED: 27 (22 "no wave64" — wave32-only GPU, 2 "no heap windows", 1 "cannot disable the driver cache (Developer Mode)", 2 "no xgameruntime.dll"); failing: gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16, pre-existing on this machine (fails identically on base 9dfbe3ea; the thread notes #3513, already in the ready list, fixes it). New regression test failed_physical_page_read_or_write_does_not_commit_earlier_sparse_homes passes on the merge, and I verified it fails with the production hunk reverted (panic kernelx.rs:3844, "a failed write leaves the earlier home reserved") and passes again restored.
review: read the whole diff and the helpers in the merged tree. resolve_physical_pages now collects every page_home lookup (a pure read of the PHYS_BLOCKS table) before any home_again call, and home_again is the only commit site (VirtualAlloc MEM_COMMIT plus the sparse mark), so a failing later page no longer leaves earlier homes committed; callers hold AWAY across resolve and copy, so the check and the use cannot interleave. Behaviour on success is unchanged; cost is one small Vec per call. Confirmed in the thread and re-checked here: if all page numbers are valid but a later OS commit itself fails, an earlier home can still be committed — out of scope for this fix. No game data in the diff.
performance: none measurable; one small allocation per physical-page read or write.
verdict: safe to merge
hardware / tool and model: RTX 4070 SUPER (driver 32.0.16.2140), Ryzen 7 7800X3D, Windows 11 build 26300, Rust 1.100.0 / OpenCode, Qwen 3.8 27B

<!-- greyfinch-sync:ivall/xcl:comment:7281935750 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1781#issuecomment-7281935750). Originally posted by [saintwolf](https://github.com/saintwolf) on 2026-11-30T14:47:31Z. --- merge-check base: 9dfbe3ea6653a9c76ef3ea0d66187a4b5407483b head: dbdc480262a0c12df0e9e0598bb8759fc1f79a08 merge: clean (trial merge b91c732483de62903792b3fdea2b50cc0d343833; git diff --check clean; +19/-2 in crates/xcl/src/hle/kernelx.rs) build: cargo build --workspace -> ok (39 pre-existing warnings, none from the PR's files) tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2886 passed, 1 failed, 51 ignored; SKIPPED: 27 (22 "no wave64" — wave32-only GPU, 2 "no heap windows", 1 "cannot disable the driver cache (Developer Mode)", 2 "no xgameruntime.dll"); failing: gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16, pre-existing on this machine (fails identically on base 9dfbe3ea; the thread notes #3513, already in the ready list, fixes it). New regression test failed_physical_page_read_or_write_does_not_commit_earlier_sparse_homes passes on the merge, and I verified it fails with the production hunk reverted (panic kernelx.rs:3844, "a failed write leaves the earlier home reserved") and passes again restored. review: read the whole diff and the helpers in the merged tree. resolve_physical_pages now collects every page_home lookup (a pure read of the PHYS_BLOCKS table) before any home_again call, and home_again is the only commit site (VirtualAlloc MEM_COMMIT plus the sparse mark), so a failing later page no longer leaves earlier homes committed; callers hold AWAY across resolve and copy, so the check and the use cannot interleave. Behaviour on success is unchanged; cost is one small Vec per call. Confirmed in the thread and re-checked here: if all page numbers are valid but a later OS commit itself fails, an earlier home can still be committed — out of scope for this fix. No game data in the diff. performance: none measurable; one small allocation per physical-page read or write. verdict: safe to merge hardware / tool and model: RTX 4070 SUPER (driver 32.0.16.2140), Ryzen 7 7800X3D, Windows 11 build 26300, Rust 1.100.0 / OpenCode, Qwen 3.8 27B
Foniass commented 2026-12-01 06:46:30 +00:00 (Migrated from github.com)

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


Triage (#1607) – head dbdc480

No open or merged PR makes the same change. Main's resolve_physical_pages still calls home_again page by page, so a dead later page leaves the earlier sparse homes committed. #1916, #3123 and #2004 rewrite the same function for other reasons and would conflict. #2004 makes reads avoid committing at all, but it is a large multi-topic PR.
No problems found in the diff. A VirtualAlloc failure in home_again midway can still leave earlier homes committed; that is outside this PR's case.
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:7303256133 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1781#issuecomment-7303256133). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T06:46:30Z. --- **Triage (#1607)** – head dbdc480 No open or merged PR makes the same change. Main's `resolve_physical_pages` still calls `home_again` page by page, so a dead later page leaves the earlier sparse homes committed. #1916, #3123 and #2004 rewrite the same function for other reasons and would conflict. #2004 makes reads avoid committing at all, but it is a large multi-topic PR. No problems found in the diff. A `VirtualAlloc` failure in `home_again` midway can still leave earlier homes committed; that is outside this PR's case. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
tiagonleal commented 2026-12-02 21:42:36 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by tiagonleal on 2026-12-02T21:42:36Z.


merge-check
base: 5ad98adbc3
head: dbdc480262
merge: clean (merge commit ac3780fc89c92f35fea86306e7afcdfcc96841fd; git diff --check clean)
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 3006 passed, 0 failed, 52 ignored; SKIPPED: 24 (22 no wave64, 2 no heap windows); failing: none
title run: Newer Retail Game, release build of this merge, Series S settings (XCL_DEVICE_TYPE=lockhart, XCL_COHERENT_MB=512, XCL_UMA_WINDOWS=16, XCL_SPARSE_LAZY=1), scripted A presses, 240 s planned: into the world at 78 s, 54 s there with 73 frames presented, no crash, no device removal; then our RAM guard stopped it (free RAM under 1 GB on this 32 GB PC, as in main's second run).
review: none that blocks. Minor: if home_again fails on page k, the pages before it stay committed (zero-filled, harmless).
performance: one small Vec per call. World frame rate not compared: on this 32 GB PC the runs of main and of the PRs end 30 to 150 s into the world (RAM guard or time limit).
verdict: safe to merge
hardware / tool and model: RTX 5070 Ti 16 GB (driver 617.42), Ryzen 7 9800X3D, 32 GB, Windows 11 Pro 26300 / Claude Code with Claude Opus 5.5

Same settings on main 5ad98adb, two runs: into the world at 94 s with 145 s there and no frame presented (ran to the 240 s limit); into the world at 80 s with 59 s there and 90 frames, then stopped by our RAM guard (free RAM under 1 GB). "In the world" here means the first 2 s window of the activity log with 5,000+ draws and dispatches.

AI use: Claude Code (Claude Opus 5.5) ran the build, tests and title runs and wrote this; a Claude Sonnet subagent read the diff and I checked its points.
~Tiago

<!-- greyfinch-sync:ivall/xcl:comment:7359668466 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1781#issuecomment-7359668466). Originally posted by [tiagonleal](https://github.com/tiagonleal) on 2026-12-02T21:42:36Z. --- merge-check base: 5ad98adbc360225ac8a57ad9661e16fe8df9d8dd head: dbdc480262a0c12df0e9e0598bb8759fc1f79a08 merge: clean (merge commit ac3780fc89c92f35fea86306e7afcdfcc96841fd; `git diff --check` clean) build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 3006 passed, 0 failed, 52 ignored; SKIPPED: 24 (22 no wave64, 2 no heap windows); failing: none title run: Newer Retail Game, release build of this merge, Series S settings (`XCL_DEVICE_TYPE=lockhart`, `XCL_COHERENT_MB=512`, `XCL_UMA_WINDOWS=16`, `XCL_SPARSE_LAZY=1`), scripted A presses, 240 s planned: into the world at 78 s, 54 s there with 73 frames presented, no crash, no device removal; then our RAM guard stopped it (free RAM under 1 GB on this 32 GB PC, as in main's second run). review: none that blocks. Minor: if `home_again` fails on page k, the pages before it stay committed (zero-filled, harmless). performance: one small Vec per call. World frame rate not compared: on this 32 GB PC the runs of main and of the PRs end 30 to 150 s into the world (RAM guard or time limit). verdict: safe to merge hardware / tool and model: RTX 5070 Ti 16 GB (driver 617.42), Ryzen 7 9800X3D, 32 GB, Windows 11 Pro 26300 / Claude Code with Claude Opus 5.5 Same settings on main 5ad98adb, two runs: into the world at 94 s with 145 s there and no frame presented (ran to the 240 s limit); into the world at 80 s with 59 s there and 90 frames, then stopped by our RAM guard (free RAM under 1 GB). "In the world" here means the first 2 s window of the activity log with 5,000+ draws and dispatches. AI use: Claude Code (Claude Opus 5.5) ran the build, tests and title runs and wrote this; a Claude Sonnet subagent read the diff and I checked its points. ~Tiago
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/1781:upstream-pr/1781'
git switch 'upstream-pr/1781'

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