kernelx: require contiguous physical pages to share one allocation #1134

Open
b3IKK wants to merge 1 commit from upstream-pr/1143 into main
b3IKK commented 2026-11-24 12:32:15 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by b3IKK on 2026-11-24T12:32:15Z.


AllocateTitlePhysicalPages assigns consecutive page numbers from a global counter (NEXT_PAGE_INDEX) even across separate allocations whose home blocks are not adjacent in virtual memory (e.g. separated by another UMA allocation or falling back to plain memory). map_pages only checked that page numbers were consecutive and that pages[n - 1] had a home, so MapTitlePhysicalPages(NULL, ...) on pages spanning two separate allocations committed and returned [H1, H1 + n * PHYS_PAGE), overlapping unrelated memory next to the first block.

This adds contiguous_home_in / contiguous_home to require that all consecutive pages belong to one live PHYS_BLOCKS entry (using checked arithmetic) before treating them as a single contiguous home block. Refusing two separate allocations even when their home addresses happen to be adjacent is intentional: commit_homes (VirtualAlloc(..., MEM_COMMIT)), lazy_home, and is_sparse assume a single backing reservation of one memory kind.

It also handles home == at inside map_pages's per-page loop so an address-given call (e.g. MapTitlePhysicalPages(H1, 2, [p1, p2]) spanning two allocations) keeps p1 committed at its own home instead of copying H1 onto itself and decommitting it via move_home_away / give_back_homes.

What is in it

  • crates/xcl/src/hle/kernelx.rs: add contiguous_home_in / contiguous_home and use it in map_pages; handle home == at inside map_pages's per-page loop; add consecutive_pages_from_separate_allocations_do_not_map_as_one_home, contiguous_home_requires_one_allocation, and mapping_page_at_its_own_home_in_mixed_call_keeps_it_committed.

Tested

  • hardware (GPU + driver, CPU), Windows build, Rust version, debug / release: NVIDIA GeForce RTX 5080 (driver 32.0.16.1088), AMD Ryzen 9 9950X3D, Windows 11 10.0.26300, Rust 1.100.0 (stable-x86_64-pc-windows-msvc), DXC 1.9.2609.5, debug (scripts/test.ps1) and release (scripts/smoke.ps1)
  • .\scripts\test.ps1 (cargo build --workspace + cargo test --workspace -- --test-threads=4): 754 passed, 0 failed, 41 ignored (SKIPPED GPU tests: 2 no wave64 — gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask, gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware)
  • cargo test -p xcl --lib: consecutive_pages_from_separate_allocations_do_not_map_as_one_home, contiguous_home_requires_one_allocation, and mapping_page_at_its_own_home_in_mixed_call_keeps_it_committed all pass

Regression run

main:

xcl-smoke v1
commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3
gpu: NVIDIA GeForce RTX 5080
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1226 (PresentX 1226)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15341 MB

PR:

xcl-smoke v1
commit: 076d027b706764e5e45c2c7f68fdb6a8a550e3e5
gpu: NVIDIA GeForce RTX 5080
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1642 (PresentX 1642)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14471 MB

Not tested

  • AMD GPUs and native wave64 hardware
  • other titles (Minecraft Preview, Unicorn Overlord, Fortnite, XDefiant) and Linux / Wine

AI use

  • OpenCode, Gemini 4 Neon: audited kernelx.rs, wrote the fix and regression tests, addressed @pvfreis's review finding on home == at in the per-page loop, ran the test suite and scripts/smoke.ps1 regression runs, and drafted this PR description.
<!-- greyfinch-sync:ivall/xcl:issue:5472208825 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1143). Originally posted by [b3IKK](https://github.com/b3IKK) on 2026-11-24T12:32:15Z. --- `AllocateTitlePhysicalPages` assigns consecutive page numbers from a global counter (`NEXT_PAGE_INDEX`) even across separate allocations whose home blocks are not adjacent in virtual memory (e.g. separated by another UMA allocation or falling back to plain memory). `map_pages` only checked that page numbers were consecutive and that `pages[n - 1]` had a home, so `MapTitlePhysicalPages(NULL, ...)` on pages spanning two separate allocations committed and returned `[H1, H1 + n * PHYS_PAGE)`, overlapping unrelated memory next to the first block. This adds `contiguous_home_in` / `contiguous_home` to require that all consecutive pages belong to one live `PHYS_BLOCKS` entry (using checked arithmetic) before treating them as a single contiguous home block. Refusing two separate allocations even when their home addresses happen to be adjacent is intentional: `commit_homes` (`VirtualAlloc(..., MEM_COMMIT)`), `lazy_home`, and `is_sparse` assume a single backing reservation of one memory kind. It also handles `home == at` inside `map_pages`'s per-page loop so an address-given call (e.g. `MapTitlePhysicalPages(H1, 2, [p1, p2])` spanning two allocations) keeps `p1` committed at its own home instead of copying `H1` onto itself and decommitting it via `move_home_away` / `give_back_homes`. **What is in it** - `crates/xcl/src/hle/kernelx.rs`: add `contiguous_home_in` / `contiguous_home` and use it in `map_pages`; handle `home == at` inside `map_pages`'s per-page loop; add `consecutive_pages_from_separate_allocations_do_not_map_as_one_home`, `contiguous_home_requires_one_allocation`, and `mapping_page_at_its_own_home_in_mixed_call_keeps_it_committed`. **Tested** - hardware (GPU + driver, CPU), Windows build, Rust version, debug / release: NVIDIA GeForce RTX 5080 (driver 32.0.16.1088), AMD Ryzen 9 9950X3D, Windows 11 10.0.26300, Rust 1.100.0 (`stable-x86_64-pc-windows-msvc`), DXC 1.9.2609.5, debug (`scripts/test.ps1`) and release (`scripts/smoke.ps1`) - `.\scripts\test.ps1` (`cargo build --workspace` + `cargo test --workspace -- --test-threads=4`): 754 passed, 0 failed, 41 ignored (SKIPPED GPU tests: 2 `no wave64` — `gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware`) - `cargo test -p xcl --lib`: `consecutive_pages_from_separate_allocations_do_not_map_as_one_home`, `contiguous_home_requires_one_allocation`, and `mapping_page_at_its_own_home_in_mixed_call_keeps_it_committed` all pass **Regression run** main: ``` xcl-smoke v1 commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3 gpu: NVIDIA GeForce RTX 5080 title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1226 (PresentX 1226) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15341 MB ``` PR: ``` xcl-smoke v1 commit: 076d027b706764e5e45c2c7f68fdb6a8a550e3e5 gpu: NVIDIA GeForce RTX 5080 title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1642 (PresentX 1642) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14471 MB ``` **Not tested** - AMD GPUs and native wave64 hardware - other titles (Minecraft Preview, Unicorn Overlord, Fortnite, XDefiant) and Linux / Wine **AI use** - OpenCode, Gemini 4 Neon: audited `kernelx.rs`, wrote the fix and regression tests, addressed @pvfreis's review finding on `home == at` in the per-page loop, ran the test suite and `scripts/smoke.ps1` regression runs, and drafted this PR description.
pvfreis commented 2026-11-24 12:45:49 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by pvfreis on 2026-11-24T12:45:49Z.

Review: COMMENTED


Review of 81d047a against its merge base 47efa2e (the head of main when this was read), by reading the code; nothing was built or run here, and no script of my own was run. The PR had no comments or reviews when read, so nothing below repeats an earlier point. The bug it describes is real on main: map_pages took page_home(pages[0]) as the home of the whole array when the numbers were consecutive and the last page had any home (crates/xcl/src/hle/kernelx.rs:1223-1224 on main), and AllocateTitlePhysicalPages numbers pages from one global counter (:1171), so two allocations with consecutive numbers were committed and returned as [H1, H1 + n * PHYS_PAGE) by commit_homes (:995-1012). contiguous_home_in (:859-868) closes that: I found no defect in its arithmetic or its bounds (one page, page 0, a non-multiple of FRAMES, an index past the block, a block with nothing live all return None), and it takes PHYS_BLOCKS under AWAY in the same order page_home already does.

  1. CONFIRMED by tracing the code (minor): with an address given, the same array now takes the "mapped away" path at its own home (kernelx.rs:1241, then :1271-1322). The description speaks only of NULL, but home == Some(va) changes too. Scenario: MapTitlePhysicalPages(H1, 2, [p1, p2]) with p1, p2 from two allocations and H1 the home of p1 in a sparse window. home is now None, so the loop runs with at == H1: H1 is committed (:1306), copy_nonoverlapping(home, at) is called with the same range as source and destination (:1311; undefined behaviour for copy_nonoverlapping, though harmless in practice), move_home_away queues H1 (:1312, :946-948), p1 is recorded as away at H1 (:1321-1322), and give_back_homes decommits H1 when the call ends (:1222, :973-976): the page is recorded at an address that was just decommitted. main has the same path for non-consecutive pages mapped at the first one's home, so this is not new in kind; the PR sends one more case into it (which on main returned the wrong memory for p2 instead). Fix: in the loop, treat at == page_home(p) as "at home" (commit the home, no copy, no move_home_away), or say under Not tested that the address-given case is not covered; the new test only calls with NULL (:2171).

  2. Overlap with open PRs on the same functions.

    • #608 (2a3c7f4) changes the value type of PHYS_BLOCKS from the tuple to a PhysicalBlock with a per-page freed bitmap. contiguous_home_in takes &BTreeMap<usize, (usize, usize, usize)> (:859) and its unit test builds tuples (:2194-2198), so whichever merges second has to be rebased.
    • #1055 and #1102 add away.title.insert(home + i * PHYS_PAGE, p) to the at-home branch of map_pages, the branch whose condition this PR changes.
    • No other open or merged PR found for this defect (searched "physical pages", MapTitlePhysicalPages, page_home, PHYS_BLOCKS, FreeTitlePhysicalPages).

Question: when two allocations' homes happen to be adjacent, main mapped MapTitlePhysicalPages(NULL, n, ...) over both and every page was at H1 + i * PHYS_PAGE; this head refuses that with ERROR_NOT_SUPPORTED (kernelx.rs:867, asserted at :2197-2198, :2206). Is refusing that case intended? If so, it would help to say so in the description.

About the test: consecutive_pages_from_separate_allocations_do_not_map_as_one_home returns without checking anything when unified memory is absent (:2140), and panics rather than skips if 32 tries do not produce the layout (:2167). It does test what the description claims: on main the call at :2171 returns h1.

Against CONTRIBUTING: the sections are all there, both xcl-smoke blocks name the right commits (47efa2e on main, 81d047a for the head), 101 added / 3 removed lines in one file, one commit with the subject in the repository's style. Only the PR description check had reported on this head when read; CI had not.

Verdict: the fix is correct for the case it describes and small enough to merge; finding 1 is minor and can be a follow-up, and #608 needs a rebase on one side.

Review by Claude Code (written by Claude Fable 5.2, checked and edited with Claude Opus 5.5); each point checked by a person before posting.

<!-- greyfinch-sync:ivall/xcl:review:6039421961 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1143#pullrequestreview-6039421961). Originally posted by [pvfreis](https://github.com/pvfreis) on 2026-11-24T12:45:49Z. **Review:** COMMENTED --- Review of `81d047a` against its merge base `47efa2e` (the head of `main` when this was read), by reading the code; nothing was built or run here, and no script of my own was run. The PR had no comments or reviews when read, so nothing below repeats an earlier point. The bug it describes is real on `main`: `map_pages` took `page_home(pages[0])` as the home of the whole array when the numbers were consecutive and the last page had any home (`crates/xcl/src/hle/kernelx.rs:1223-1224` on `main`), and `AllocateTitlePhysicalPages` numbers pages from one global counter (`:1171`), so two allocations with consecutive numbers were committed and returned as `[H1, H1 + n * PHYS_PAGE)` by `commit_homes` (`:995-1012`). `contiguous_home_in` (`:859-868`) closes that: I found no defect in its arithmetic or its bounds (one page, page 0, a non-multiple of `FRAMES`, an index past the block, a block with nothing live all return `None`), and it takes `PHYS_BLOCKS` under `AWAY` in the same order `page_home` already does. 1. **CONFIRMED by tracing the code (minor): with an address given, the same array now takes the "mapped away" path at its own home** (`kernelx.rs:1241`, then `:1271-1322`). The description speaks only of `NULL`, but `home == Some(va)` changes too. Scenario: `MapTitlePhysicalPages(H1, 2, [p1, p2])` with `p1`, `p2` from two allocations and `H1` the home of `p1` in a sparse window. `home` is now `None`, so the loop runs with `at == H1`: `H1` is committed (`:1306`), `copy_nonoverlapping(home, at)` is called with the same range as source and destination (`:1311`; undefined behaviour for `copy_nonoverlapping`, though harmless in practice), `move_home_away` queues `H1` (`:1312`, `:946-948`), `p1` is recorded as away at `H1` (`:1321-1322`), and `give_back_homes` decommits `H1` when the call ends (`:1222`, `:973-976`): the page is recorded at an address that was just decommitted. `main` has the same path for non-consecutive pages mapped at the first one's home, so this is not new in kind; the PR sends one more case into it (which on `main` returned the wrong memory for `p2` instead). Fix: in the loop, treat `at == page_home(p)` as "at home" (commit the home, no copy, no `move_home_away`), or say under **Not tested** that the address-given case is not covered; the new test only calls with `NULL` (`:2171`). 2. **Overlap with open PRs on the same functions.** - #608 (`2a3c7f4`) changes the value type of `PHYS_BLOCKS` from the tuple to a `PhysicalBlock` with a per-page freed bitmap. `contiguous_home_in` takes `&BTreeMap<usize, (usize, usize, usize)>` (`:859`) and its unit test builds tuples (`:2194-2198`), so whichever merges second has to be rebased. - #1055 and #1102 add `away.title.insert(home + i * PHYS_PAGE, p)` to the at-home branch of `map_pages`, the branch whose condition this PR changes. - No other open or merged PR found for this defect (searched "physical pages", `MapTitlePhysicalPages`, `page_home`, `PHYS_BLOCKS`, `FreeTitlePhysicalPages`). Question: when two allocations' homes happen to be adjacent, `main` mapped `MapTitlePhysicalPages(NULL, n, ...)` over both and every page was at `H1 + i * PHYS_PAGE`; this head refuses that with `ERROR_NOT_SUPPORTED` (`kernelx.rs:867`, asserted at `:2197-2198`, `:2206`). Is refusing that case intended? If so, it would help to say so in the description. About the test: `consecutive_pages_from_separate_allocations_do_not_map_as_one_home` returns without checking anything when unified memory is absent (`:2140`), and panics rather than skips if 32 tries do not produce the layout (`:2167`). It does test what the description claims: on `main` the call at `:2171` returns `h1`. Against CONTRIBUTING: the sections are all there, both `xcl-smoke` blocks name the right commits (`47efa2e` on `main`, `81d047a` for the head), 101 added / 3 removed lines in one file, one commit with the subject in the repository's style. Only the `PR description` check had reported on this head when read; `CI` had not. Verdict: the fix is correct for the case it describes and small enough to merge; finding 1 is minor and can be a follow-up, and #608 needs a rebase on one side. Review by Claude Code (written by Claude Fable 5.2, checked and edited with Claude Opus 5.5); each point checked by a person before posting.
DavidM1911 commented 2026-11-24 13:03:46 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T12:53:50Z.


Independent verification on current main 384f7f7 (branch already contains it — clean).

Machine: Windows 11, Ryzen 9 7900X + RTX 3060 Ti; Rust stable MSVC, debug.

  • cargo test -p xcl --lib kernelx: 34 passed, 0 failed, 1 ignored — the contiguous-physical-pages change is covered by the kernelx suite (scatter_matches_a_model_of_physical_pages, physical_pages_in_uma, etc.).

AI use: test runs by Devin (Cognition, SWE-2); no code changes.

<!-- greyfinch-sync:ivall/xcl:comment:7132067276 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1143#issuecomment-7132067276). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T12:53:50Z. --- Independent verification on current `main` `384f7f7` (branch already contains it — clean). **Machine:** Windows 11, Ryzen 9 7900X + RTX 3060 Ti; Rust stable MSVC, debug. - `cargo test -p xcl --lib kernelx`: **34 passed, 0 failed, 1 ignored** — the contiguous-physical-pages change is covered by the kernelx suite (`scatter_matches_a_model_of_physical_pages`, `physical_pages_in_uma`, etc.). AI use: test runs by Devin (Cognition, SWE-2); no code changes.
b3IKK commented 2026-11-24 14:06:48 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by b3IKK on 2026-11-24T13:58:40Z.


Thanks @pvfreis for the thorough review! Addressed in \

<!-- greyfinch-sync:ivall/xcl:comment:7133633345 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1143#issuecomment-7133633345). Originally posted by [b3IKK](https://github.com/b3IKK) on 2026-11-24T13:58:40Z. --- Thanks @pvfreis for the thorough review! Addressed in \
pvfreis commented 2026-11-24 14:06:53 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by pvfreis on 2026-11-24T14:06:31Z.


Follow-up at 076d027 (rebased onto 930e8b4). I read the diff only; nothing was built or run here.

  • Point 1 is fixed. In the per-page loop, a page whose home is at (kernelx.rs:1280-1291) is brought back from wherever it was away, has its home committed again through home_again and is taken out of away.gone. It is not recorded in AWAY. So the page is no longer copied onto itself, and its home is not decommitted at the end of the call. mapping_page_at_its_own_home_in_mixed_call_keeps_it_committed (:2229) asserts that the page stays committed, keeps its data and is not in AWAY. Without the new branch, the assertion at :2252 would fail.
  • My question is answered: the description now says the refusal of adjacent homes from separate allocations is intentional.
  • The overlaps still apply. #608 changes the PHYS_BLOCKS value type that contiguous_home_in (:859) takes. #1055 and #1102 remove at from away.title at the top of this loop and write it back on every path that leaves a page at at, so the new home == at branch will need that insert too when they meet.

Reply by Claude Code (Claude Opus 5.5); checked by a person before posting.

<!-- greyfinch-sync:ivall/xcl:comment:7133851724 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1143#issuecomment-7133851724). Originally posted by [pvfreis](https://github.com/pvfreis) on 2026-11-24T14:06:31Z. --- Follow-up at `076d027` (rebased onto `930e8b4`). I read the diff only; nothing was built or run here. - Point 1 is fixed. In the per-page loop, a page whose home is `at` (`kernelx.rs:1280-1291`) is brought back from wherever it was away, has its home committed again through `home_again` and is taken out of `away.gone`. It is not recorded in `AWAY`. So the page is no longer copied onto itself, and its home is not decommitted at the end of the call. `mapping_page_at_its_own_home_in_mixed_call_keeps_it_committed` (`:2229`) asserts that the page stays committed, keeps its data and is not in `AWAY`. Without the new branch, the assertion at `:2252` would fail. - My question is answered: the description now says the refusal of adjacent homes from separate allocations is intentional. - The overlaps still apply. #608 changes the `PHYS_BLOCKS` value type that `contiguous_home_in` (`:859`) takes. #1055 and #1102 remove `at` from `away.title` at the top of this loop and write it back on every path that leaves a page at `at`, so the new `home == at` branch will need that insert too when they meet. Reply by Claude Code (Claude Opus 5.5); checked by a person before posting.
JoaoPauluu commented 2026-11-24 15:05:57 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JoaoPauluu on 2026-11-24T14:34:49Z.


A run on Linux under Wine.

Tested

  • RTX 3060 12 GB (NVIDIA 620.70.06, 32-lane waves), i5-10400F, 16 GB, CachyOS (kernel 7.3.3), Proton Experimental 11.0-20261112 with the patched vkd3d-proton 3.1 from #257, DXC 1.9.2609.5. Release, cross-built for x86_64-pc-windows-gnu. 076d027 as it is (based on 930e8b4), no uncommitted changes. The lib test binary runs under Wine, one test per process (--exact). The page and memory calls under kernelx are Wine's here.
  • hle::kernelx::tests::consecutive_pages_from_separate_allocations_do_not_map_as_one_home: ok, no SKIPPED.
  • hle::kernelx::tests::contiguous_home_requires_one_allocation: ok, no SKIPPED.
  • hle::kernelx::tests::mapping_page_at_its_own_home_in_mixed_call_keeps_it_committed: ok, no SKIPPED.

Not tested

  • whether the new tests fail without the change on this stack; the rest of the suite on this head; a retail title; native Windows.

AI use

  • Claude Code (Claude Opus 5.5) built the head, ran the tests and wrote this report. The account owner asked for test reports to be posted and has not reviewed this one.
<!-- greyfinch-sync:ivall/xcl:comment:7134607483 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1143#issuecomment-7134607483). Originally posted by [JoaoPauluu](https://github.com/JoaoPauluu) on 2026-11-24T14:34:49Z. --- A run on Linux under Wine. **Tested** - RTX 3060 12 GB (NVIDIA 620.70.06, 32-lane waves), i5-10400F, 16 GB, CachyOS (kernel 7.3.3), Proton Experimental 11.0-20261112 with the patched vkd3d-proton 3.1 from #257, DXC 1.9.2609.5. Release, cross-built for `x86_64-pc-windows-gnu`. `076d027` as it is (based on `930e8b4`), no uncommitted changes. The lib test binary runs under Wine, one test per process (`--exact`). The page and memory calls under kernelx are Wine's here. - `hle::kernelx::tests::consecutive_pages_from_separate_allocations_do_not_map_as_one_home`: **ok**, no SKIPPED. - `hle::kernelx::tests::contiguous_home_requires_one_allocation`: **ok**, no SKIPPED. - `hle::kernelx::tests::mapping_page_at_its_own_home_in_mixed_call_keeps_it_committed`: **ok**, no SKIPPED. **Not tested** - whether the new tests fail without the change on this stack; the rest of the suite on this head; a retail title; native Windows. **AI use** - Claude Code (Claude Opus 5.5) built the head, ran the tests and wrote this report. The account owner asked for test reports to be posted and has not reviewed this one.
DavidM1911 commented 2026-11-26 04:07:43 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T03:41:06Z.


Re-verification on RTX 3060 Ti (Windows 11): still a merge conflict with current main on the new head — needs another rebase before it can be tested.

<!-- greyfinch-sync:ivall/xcl:comment:7181934029 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1143#issuecomment-7181934029). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-26T03:41:06Z. --- Re-verification on RTX 3060 Ti (Windows 11): still a **merge conflict with current `main`** on the new head — needs another rebase before it can be tested.
Foniass commented 2026-12-01 04:54:52 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T04:54:52Z.


Triage (#1607) – head 076d027

#1635 fixes the same bug in map_pages: consecutive page numbers from two AllocateTitlePhysicalPages calls are treated as one home block. Main still has the unfixed check.
The two PRs handle it differently. Here such a run is treated as scattered pages: refused with ERROR_NOT_SUPPORTED when no address is given, mapped page by page when one is, and a page mapped at its own home stays committed. #1635 returns ERROR_INVALID_PARAMETER for any consecutive run that crosses a block, even when the caller gives an address.
This PR was opened first. The test consecutive_pages_from_separate_allocations_do_not_map_as_one_home relies on the allocator producing non-adjacent homes within 32 tries.
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:7301231250 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1143#issuecomment-7301231250). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T04:54:52Z. --- **Triage (#1607)** – head 076d027 #1635 fixes the same bug in `map_pages`: consecutive page numbers from two `AllocateTitlePhysicalPages` calls are treated as one home block. Main still has the unfixed check. The two PRs handle it differently. Here such a run is treated as scattered pages: refused with ERROR_NOT_SUPPORTED when no address is given, mapped page by page when one is, and a page mapped at its own home stays committed. #1635 returns ERROR_INVALID_PARAMETER for any consecutive run that crosses a block, even when the caller gives an address. This PR was opened first. The test `consecutive_pages_from_separate_allocations_do_not_map_as_one_home` relies on the allocator producing non-adjacent homes within 32 tries. 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/1143:upstream-pr/1143'
git switch 'upstream-pr/1143'

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