Skip to content

[upstream #1781] kernelx: a failed physical page read or write commits no earlier home - #353

Open
ufoptg wants to merge 1 commit into
mainfrom
upstream-pr/1781
Open

ufoptg wants to merge 1 commit into
mainfrom
upstream-pr/1781

Conversation

@ufoptg

@ufoptg ufoptg commented Nov 25, 2026

Copy link
Copy Markdown
Owner

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 Memory: the title's budget is reported but never enforced - a retail title reaches 94 GB of commit and takes the machine's commit limit xcl-dev/xcl#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.

Mirror of xcl-dev#1781 (auto-synced, do not edit).

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.

All page_home lookups are collected and validated before the first home_again runs; the success path resolves the same homes in the same order as before.

Measured: cargo test -p xcl --lib kernelx at this head: 37 passed, 0 failed, 1 ignored; the new test fails without the fix.

Assisted-by: opencode (Sonnet fix and gate; HY4 Flash Free)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants