kernelx: with XCL_PAGE_ALIAS=1 the queue's page mappings show real pages #2308

Open
github-bot wants to merge 7 commits from github-bot/gh-2308 into main AGit
Owner

@⁠adiologydev on GitHub · 2026-11-25 13:27 UTC · original
adiologydev:kernelx/page-mappings-alias → main · +1871 −19 · 10 files · 7 commits · open

Stacked on #2307 and on #1055; only the top two commits (31fe59c, 64ad64c) belong here. 4f34c8d is #1055's commit (@⁠Xeltax's, unchanged apart from one conflict with today's main in VirtualFree: both mirrors::released(a) and forget_title_mappings(a, n) kept). Fourth part of the plan on #1031.

The queue's CopyPageMappingsBatchX maps pool pages into GPU views; on the console a GPU-view page then shows the physical page mapped at its pool page at the time of the call. #1055 decodes the calls and keeps a record of them. With XCL_PAGE_ALIAS=1 (#2307) the GPU view is a reservation of views, so the decoded mappings can be made for real.

What is in it

  • 31fe59c crates/xcl/src/hle/kernelx.rs: mirrors::decode_batches – #1055's checked decoding, apart from its record (apply_batches records as before). No change in behaviour.
  • 64ad64c kernelx/alias.rs, d3d12x/real.rs, kernelx.rs: with the switch, the queue method makes each GPU-view page a view of the physical page mapped at its pool page now, or unmaps it (kind 2, or nothing at the pool page), and bumps the GPU-view generation so textures there look again. title_textures already reads a texture at its own address when a physical page is mapped there. Without the switch the call is recorded as in #1055. Test: a page written through the CPU view reads back in the GPU view, one pool page at two GPU-view pages, a write in the GPU view uploads every view of the page, and a later change of the pool page leaves the GPU view on the page it was given.

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 64ad64c: 1118 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.
  • The retail title with XCL_PAGE_ALIAS=1, 300 s into its world: 256 calls by 170 s, 31 196 GPU-view pages mapped to a physical page, 3 137 unmapped, none pointing at an empty pool page; no crash or device removal (before, every one of these mappings was dropped).

Regression run (the switch off, as the PR checks run it)
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: 64ad64ce6bcae6a0b5847b54c24ff12d12d5324b
gpu: NVIDIA GeForce RTX 5090
title: 2c508222
seconds: 60
exit: 0x0
frames shown: 1532 (PresentX 1532)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 17567 MB

Not tested

  • AMD and Intel GPUs; Wine / Proton.
  • Whether the world looks right: shaders still cannot read the GPU view (outside the memory windows, #697), and every run here stops presenting in cold pipeline compiles once the world loads (#2088). This PR is what the CPU side (textures kept in step, DirectStorage by page) sees.
  • The method is applied when the title calls it, not in order with the queue's work, as #1055 records it.

AI use

  • Claude Code (Claude Opus 5.5): wrote 31fe59c and 64ad64c, the test and this description, and made the runs above on this hardware. 4f34c8d is @⁠Xeltax's #1055. I read every line of the diff and checked it.
**@⁠adiologydev** on GitHub · 2026-11-25 13:27 UTC · [original](https://github.com/xcl-dev/xcl/pull/2308) `adiologydev:kernelx/page-mappings-alias` → `main` · +1871 −19 · 10 files · 7 commits · open Stacked on #2307 and on #1055; only the top two commits (`31fe59c`, `64ad64c`) belong here. `4f34c8d` is #1055's commit (@⁠Xeltax's, unchanged apart from one conflict with today's `main` in `VirtualFree`: both `mirrors::released(a)` and `forget_title_mappings(a, n)` kept). Fourth part of the plan on #1031. The queue's `CopyPageMappingsBatchX` maps pool pages into GPU views; on the console a GPU-view page then shows the physical page mapped at its pool page at the time of the call. #1055 decodes the calls and keeps a record of them. With `XCL_PAGE_ALIAS=1` (#2307) the GPU view is a reservation of views, so the decoded mappings can be made for real. **What is in it** - `31fe59c` `crates/xcl/src/hle/kernelx.rs`: `mirrors::decode_batches` – #1055's checked decoding, apart from its record (`apply_batches` records as before). No change in behaviour. - `64ad64c` `kernelx/alias.rs`, `d3d12x/real.rs`, `kernelx.rs`: with the switch, the queue method makes each GPU-view page a view of the physical page mapped at its pool page now, or unmaps it (kind 2, or nothing at the pool page), and bumps the GPU-view generation so textures there look again. `title_textures` already reads a texture at its own address when a physical page is mapped there. Without the switch the call is recorded as in #1055. Test: a page written through the CPU view reads back in the GPU view, one pool page at two GPU-view pages, a write in the GPU view uploads every view of the page, and a later change of the pool page leaves the GPU view on the page it was given. **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 `64ad64c`: 1118 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`. - The retail title with `XCL_PAGE_ALIAS=1`, 300 s into its world: 256 calls by 170 s, 31 196 GPU-view pages mapped to a physical page, 3 137 unmapped, none pointing at an empty pool page; no crash or device removal (before, every one of these mappings was dropped). **Regression run** (the switch off, as the PR checks run it) `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: 64ad64ce6bcae6a0b5847b54c24ff12d12d5324b gpu: NVIDIA GeForce RTX 5090 title: 2c508222 seconds: 60 exit: 0x0 frames shown: 1532 (PresentX 1532) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 17567 MB ``` **Not tested** - AMD and Intel GPUs; Wine / Proton. - Whether the world looks right: shaders still cannot read the GPU view (outside the memory windows, #697), and every run here stops presenting in cold pipeline compiles once the world loads (#2088). This PR is what the CPU side (textures kept in step, DirectStorage by page) sees. - The method is applied when the title calls it, not in order with the queue's work, as #1055 records it. **AI use** - Claude Code (Claude Opus 5.5): wrote `31fe59c` and `64ad64c`, the test and this description, and made the runs above on this hardware. `4f34c8d` is @⁠Xeltax's #1055. I read every line of the diff and checked it.
On the console a physical page mapped at several addresses is one page. XCL
keeps a page at one address at a time and copies it when the title maps it
elsewhere (`move_away`), so the other addresses go stale; a retail title maps
its streamed pages into a pool, into the CPU view of a 24 GB reservation and
into that reservation's GPU view (#1031).

`kernelx::sections` is the base for real aliasing: a block of physical pages
is one pagefile-backed SEC_RESERVE section, and a page is mapped as a view of
its 64 KiB slice into a placeholder (MapViewOfFile3 with
MEM_REPLACE_PLACEHOLDER). Every view of a slice is the same memory and a page
takes commit once, when it is committed through any view. Unmapping leaves a
placeholder for the next view. Ordinary reserved memory (write-watched if
asked) can replace part of a placeholder and go back to one.

Nothing calls it yet. Measured in a standalone program on Windows 11 26200
over 200 000 pages: map 2.2 us, unmap 2.75 us, commit 0.9 us a page.
GetWriteWatch refuses a range that holds a view (error 87), and one call
cannot span two neighbouring reservations either.
The upload of title memory to video memory (`d3d12x::sparse`) and the
textures kept in step with title memory learn what the CPU wrote from the
write watch, and a view of a section (`kernelx::sections`) cannot be
write-watched: GetWriteWatch refuses any range that holds one.

`kernelx::guards` keeps the views of a physical page read-only. The first
write through any of them faults; a vectored handler makes that view
writable, notes the page and lets the write go on. `take_dirty` hands over
the pages of every view of each page written – a write through one view is
a write to all of them – and guards those views again before their bytes are
read, so a later write is caught again and an earlier one is in what is read.

Kernel calls do not fault into the handler, they fail: `lazy::ensure`, which
XCL already calls before a kernel call or its own code writes title memory,
opens the guards there first and counts the write. A view committed by the
lazy handler is writable and counts as written. Both take no lock until a
view has been watched.

Nothing watches a view yet.
A guarded view of a physical page (`kernelx::guards`) is read-only until it
is written. Code of XCL's own that writes there faults into the guard and
goes on, but a kernel call does not fault: ReadFile into such a view fails.
`lazy::ensure` opened the views first, yet the submit thread's `take_dirty`
could guard them again before the write – between DirectStorage's check of
its destination and the copy, or before the kernel wrote a ReadFile buffer.

`guards::open` now returns `Opened`, which keeps its views writable until it
is dropped; `take_dirty` uploads a pinned view but does not guard it again,
and the end of the write counts as a write. `lazy::ensure` returns it and its
callers hold it across their write: the routed ReadFile for a synchronous
read, and the destination checks of DirectStorage and the CPU-side
bottom-of-pipe writes. An overlapped ReadFile writes after the call returns:
its views stay open until its OVERLAPPED is no longer STATUS_PENDING, which
`take_dirty` reads without faulting (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 as written through all its views when XCL
writes it by page number.

Nothing watches a view yet, so nothing changes without views.
Without it XCL keeps a physical page at one address at a time and copies it
when the title maps it elsewhere; the console shows the page at every
address it is mapped at. A retail title maps its streamed pages into a pool,
into the CPU view of a 24 GB reservation and into that reservation's GPU
view (#1031).

With `XCL_PAGE_ALIAS=1` (`kernelx::alias`):
- a block of physical pages is a section (`kernelx::sections`) with a view
  of its own, through which XCL reads and writes pages by number
  (DirectStorage); the title never maps a page there;
- the title's reservations of 64 KiB pages with no commit (its CPU view, GPU
  view and pool) are placeholders, and a page mapped there is a view of its
  slice, guarded (`kernelx::guards`) so that a write through one view is
  uploaded at all of them; `title_textures` adds those pages to what the
  write watch found;
- a page mapped anywhere else (a placeholder region the title made in a
  sparse window) is moved there and back with its bytes, as before.

Pages are committed on first use as before (`kernelx::lazy`); whether a page
is committed is a bit per page: asking Windows walked the rest of a fresh
block, and a title mapping 100 000 new pages one at a time took 20 s longer
to its first frame.

Measured in a traced run of a retail title: 3 blocks (11 360, 2 960 and
99 776 pages), 131 072 map calls in 150 s, nearly all single pages into its
plain reservations, none at a page's home, no commit inside them.
Queue method #31 (#29 of the older layout) maps pages of the title's
memory into GPU views; it was a stub. Its batches are now decoded and
checked against the batch count and the pool, and each 64 KiB page of
a GPU view records the pool page it was given and the physical page the
title had mapped there (kernelx::mirrors). A bad call records nothing;
releasing a view drops its pages.

XCL keeps a physical page's data where it was mapped last, and the
title maps most streamed pages into the CPU view behind the GPU view
too, so `mapped_source` answers where that page is now (`page_now`),
else the pool page itself. Each title mapping is remembered per address
(Away::title), written once the page is in place and forgotten when the
reservation goes; a page freed while its allocation lives is no longer
looked for (Away::freed).

Nothing reads the record yet: textures are unchanged; the queue logs its
counts. (#1031)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
`mirrors::decode_batches` checks and decodes one call of the queue's
CopyPageMappingsBatchX into (GPU-view page, pool page or unmapped) pairs;
`apply_batches` records them as before. No change in behaviour: the next
commit maps the decoded pages for real when physical pages alias.
The queue's CopyPageMappingsBatchX maps pool pages into GPU views; on the
console a GPU-view page then shows the physical page mapped at its pool page
at the time of the call. #1055 decodes the calls and keeps a record of them;
with physical pages aliasing (`kernelx::alias`) the GPU view is a reservation
of views, so the decoded mappings are made for real: each GPU-view page
becomes a view of the physical page mapped at its pool page now, or is
unmapped (kind 2, or nothing mapped at the pool page). Textures in the GPU
view then read the page at their own address (`title_textures` prefers an
address with a physical page mapped), and a write through any view of the
page is uploaded at all of them.

Without the switch nothing changes: the call is recorded as in #1055.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:26:37 +00:00
Author
Owner

@⁠SlopTart on GitHub · 2026-11-25 14:37 UTC · original

Wine/vkd3d-proton lane: this PR's own new test fails deterministically here, in both switch states, and with the switch on one pre-existing main test breaks on the branch too.

Tested: heads 31fe59c + 64ad64c (branch 64ad64ce) merged onto current origin/main (auto-merge, clean), Linux (Arch, kernel 7.2.15), Mesa 26.2.5 RADV, Radeon RX 7900 XT (NAVI31), cargo target x86_64-pc-windows-gnu run under wine-11.0 (Proton), rustc 1.94.0, vkd3d-proton 3.1 with the XCL patch, official MS DXC (binaries 2026-09-29). The branch carries its open ancestors (#1055 via 4f34c8d, #2307, #2294, #2293) on top of main.

Switch off (default): gpu_ suite 144 passed / 4 failed / 1 ignored. Three failures are this rig's known baseline (fuzz seed 1003 of #2115, gpu_nonfused_mad_and_mac_prevent_fma_contraction, gpu_depth_buffer_created_for_unordered_access_is_placed). The fourth is this PR's own test:

  • hle::kernelx::alias::tests::the_queue_page_mapping_method_shows_the_pool_pages_physical_page_in_the_gpu_view FAILED, 3/3 solo reruns (--exact --test-threads=1), panic at alias.rs:553: assertion left == right failed: a write in the GPU view: every view of the page is uploaded, left: [].

Switch on (XCL_PAGE_ALIAS=1): the same test still fails (both suite runs), and more does:

  • alias module: 2 passed / 4 failed, identical set on both reruns; the #2307 trio (a_page_mapped_into_two_spaces..., a_page_moved_outside_the_spaces..., pages_read_and_written_by_number...) plus this PR's queue-mapping test.
  • gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes (a test that exists on plain origin/main and passes there with the switch off) FAILED on this branch with the switch on. Control: plain origin/main with the switch on does not fail it. So the mapping-change semantics change somewhere in this stack, and that test's assumptions no longer hold under XCL_PAGE_ALIAS=1.

The alias tests are in-process unit tests (finish in 0.03 s), and the failures are identical across reruns, so this does not look like timing flakiness; it looks like a real behavior gap for the physical-page-upload invariants on the Wine/vkd3d-proton lane. Whether the root is in the top two commits or in an unmerged ancestor layer I cannot separate from outside the stack; the queue-mapping test failure at least is in code this PR adds.

Not tested: native Windows CI (upstream CI presumably sees these green, so the delta is lane-specific); NVIDIA lane (parked); retail titles (no title data on this lane, counts only).

AI use: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting.

**@⁠SlopTart** on GitHub · 2026-11-25 14:37 UTC · [original](https://github.com/xcl-dev/xcl/pull/2308#issuecomment-7165578648) **Wine/vkd3d-proton lane: this PR's own new test fails deterministically here, in both switch states, and with the switch on one pre-existing main test breaks on the branch too.** **Tested**: heads `31fe59c` + `64ad64c` (branch `64ad64ce`) merged onto current `origin/main` (auto-merge, clean), Linux (Arch, kernel 7.2.15), Mesa 26.2.5 RADV, Radeon RX 7900 XT (NAVI31), cargo target `x86_64-pc-windows-gnu` run under wine-11.0 (Proton), rustc 1.94.0, vkd3d-proton 3.1 with the XCL patch, official MS DXC (binaries 2026-09-29). The branch carries its open ancestors (#1055 via `4f34c8d`, #2307, #2294, #2293) on top of main. **Switch off (default)**: `gpu_` suite 144 passed / 4 failed / 1 ignored. Three failures are this rig's known baseline (fuzz seed 1003 of #2115, `gpu_nonfused_mad_and_mac_prevent_fma_contraction`, `gpu_depth_buffer_created_for_unordered_access_is_placed`). The fourth is this PR's own test: - `hle::kernelx::alias::tests::the_queue_page_mapping_method_shows_the_pool_pages_physical_page_in_the_gpu_view` FAILED, 3/3 solo reruns (`--exact --test-threads=1`), panic at `alias.rs:553`: `assertion left == right failed: a write in the GPU view: every view of the page is uploaded`, left: `[]`. **Switch on (`XCL_PAGE_ALIAS=1`)**: the same test still fails (both suite runs), and more does: - alias module: 2 passed / 4 failed, identical set on both reruns; the #2307 trio (`a_page_mapped_into_two_spaces...`, `a_page_moved_outside_the_spaces...`, `pages_read_and_written_by_number...`) plus this PR's queue-mapping test. - `gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes` (a test that exists on plain `origin/main` and passes there with the switch off) FAILED on this branch with the switch on. Control: plain `origin/main` with the switch on does not fail it. So the mapping-change semantics change somewhere in this stack, and that test's assumptions no longer hold under `XCL_PAGE_ALIAS=1`. The alias tests are in-process unit tests (finish in 0.03 s), and the failures are identical across reruns, so this does not look like timing flakiness; it looks like a real behavior gap for the physical-page-upload invariants on the Wine/vkd3d-proton lane. Whether the root is in the top two commits or in an unmerged ancestor layer I cannot separate from outside the stack; the queue-mapping test failure at least is in code this PR adds. **Not tested**: native Windows CI (upstream CI presumably sees these green, so the delta is lane-specific); NVIDIA lane (parked); retail titles (no title data on this lane, counts only). **AI use**: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting.
Author
Owner

@⁠nnonno91 on GitHub · 2026-11-25 14:47 UTC · original

Native Windows check of exact head 64ad64ce6bcae6a0b5847b54c24ff12d12d5324b for comparison with the Wine report.

Tested

  • Windows 11 25H2 build 26200.9974, Ryzen 7 9800X3D, Rust 1.100.0 MSVC, unoptimized profile. Radeon(TM) Graphics driver 32.0.21042.62, GeForce RTX 5090 driver 32.0.16.1742, SDK DXC/DXIL 1.8.2502.11.
  • cargo test --locked -p xcl --lib hle::kernelx::alias::tests:: -- --nocapture --test-threads=1 with XCL_PAGE_ALIAS unset and 1 in separate processes gave 6 passed, 0 failed each. The new queue page-mapping test passed both times.
  • Same command with filter gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes and each adapter selected via XCL_ADAPTER. On each adapter, unset gave 1 passed, 0 failed. With 1, each gave 0 passed, 1 failed at title_textures.rs:1287: fallback must be write-watched, before the readback. No ignores or skips. The runtime log confirmed both adapter selections.
  • The same mirror assertion already fails on the Radeon at #2307's f30ca3f037e474fe1ca1720835313db161b36004 when the switch is on. This isolates the test setup failure to the stack before the queue method change.

Not tested

A mirror readback using an alias-aware fixture, Wine, retail smoke, and the full workspace suite.

AI use

OpenAI Codex (GPT-6.2 Sol) ran the checks, compared the two heads and wrote this report.

**@⁠nnonno91** on GitHub · 2026-11-25 14:47 UTC · [original](https://github.com/xcl-dev/xcl/pull/2308#issuecomment-7165809511) Native Windows check of exact head `64ad64ce6bcae6a0b5847b54c24ff12d12d5324b` for comparison with the Wine report. **Tested** - Windows 11 25H2 build 26200.9974, Ryzen 7 9800X3D, Rust 1.100.0 MSVC, unoptimized profile. Radeon(TM) Graphics driver 32.0.21042.62, GeForce RTX 5090 driver 32.0.16.1742, SDK DXC/DXIL 1.8.2502.11. - `cargo test --locked -p xcl --lib hle::kernelx::alias::tests:: -- --nocapture --test-threads=1` with `XCL_PAGE_ALIAS` unset and `1` in separate processes gave 6 passed, 0 failed each. The new queue page-mapping test passed both times. - Same command with filter `gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes` and each adapter selected via `XCL_ADAPTER`. On each adapter, unset gave 1 passed, 0 failed. With `1`, each gave 0 passed, 1 failed at `title_textures.rs:1287`: `fallback must be write-watched`, before the readback. No ignores or skips. The runtime log confirmed both adapter selections. - The same mirror assertion already fails on the Radeon at #2307's `f30ca3f037e474fe1ca1720835313db161b36004` when the switch is on. This isolates the test setup failure to the stack before the queue method change. **Not tested** A mirror readback using an alias-aware fixture, Wine, retail smoke, and the full workspace suite. **AI use** OpenAI Codex (GPT-6.2 Sol) ran the checks, compared the two heads and wrote this report.
Author
Owner

@⁠thiagocalile on GitHub · 2026-11-25 16:25 UTC · original

Independent test and 60 s smoke report for head 64ad64ce6bcae6a0b5847b54c24ff12d12d5324b on an AMD Radeon RX 6600 (8 GB VRAM, RDNA2, native wave64).

Tested

  • Hardware: AMD Radeon RX 6600 (8146 MiB VRAM, RDNA2, native wave64, driver 32.0.21045.29003, XCL_ADAPTER=radeon), AMD Ryzen 7 5700X3D, 47.9 GB RAM, Windows 11 (10.0.26200.0), Rust 1.100.0 (stable-x86_64-pc-windows-msvc), DXC 1.8.2502.11.
  • XCL_ADAPTER=radeon cargo test --no-fail-fast -p xcl --lib -- hle::kernelx --test-threads=1: 62 passed, 0 failed, 1 ignored (0 skipped), covering alias, guards, sections, lazy, and mirrors.

Regression run (scripts/smoke.ps1 -Seconds 60, release builds, XCL_ADAPTER=radeon)

main (06c9f55):

xcl-smoke v1
commit: 06c9f5505f63f10c5ec49ef932d75b2c28177324
gpu: AMD Radeon RX 6600
title: 3c290c16
seconds: 60
exit: 0x0
frames shown: 1469 (PresentX 1469)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13436 MB

PR #2308 (64ad64c):
Default (XCL_PAGE_ALIAS unset):

xcl-smoke v1
commit: 64ad64ce6bcae6a0b5847b54c24ff12d12d5324b
gpu: AMD Radeon RX 6600
title: 3c290c16
seconds: 60
exit: 0x0
frames shown: 1508 (PresentX 1509)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15048 MB

With XCL_PAGE_ALIAS=1:

xcl-smoke v1
commit: 64ad64ce6bcae6a0b5847b54c24ff12d12d5324b
gpu: AMD Radeon RX 6600
title: 3c290c16
seconds: 60
exit: 0x0
frames shown: 1511 (PresentX 1511)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14707 MB

Not tested: full workspace test suite on this head, NVIDIA/Intel GPUs, Linux/Wine, or world load past the 60 s smoke window.

AI use: Antigravity (Gemini 4 Neon) ran the builds, tests, and smoke runs and drafted this report; the account owner reviewed and approved posting.

**@⁠thiagocalile** on GitHub · 2026-11-25 16:25 UTC · [original](https://github.com/xcl-dev/xcl/pull/2308#issuecomment-7167966132) Independent test and 60 s smoke report for head `64ad64ce6bcae6a0b5847b54c24ff12d12d5324b` on an **AMD Radeon RX 6600** (8 GB VRAM, RDNA2, native wave64). **Tested** - Hardware: AMD Radeon RX 6600 (8146 MiB VRAM, RDNA2, native wave64, driver `32.0.21045.29003`, `XCL_ADAPTER=radeon`), AMD Ryzen 7 5700X3D, 47.9 GB RAM, Windows 11 (`10.0.26200.0`), Rust `1.100.0` (`stable-x86_64-pc-windows-msvc`), DXC `1.8.2502.11`. - `XCL_ADAPTER=radeon cargo test --no-fail-fast -p xcl --lib -- hle::kernelx --test-threads=1`: **62 passed, 0 failed, 1 ignored** (`0` skipped), covering `alias`, `guards`, `sections`, `lazy`, and `mirrors`. **Regression run** (`scripts/smoke.ps1 -Seconds 60`, release builds, `XCL_ADAPTER=radeon`) `main` (`06c9f55`): ``` xcl-smoke v1 commit: 06c9f5505f63f10c5ec49ef932d75b2c28177324 gpu: AMD Radeon RX 6600 title: 3c290c16 seconds: 60 exit: 0x0 frames shown: 1469 (PresentX 1469) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 13436 MB ``` PR `#2308` (`64ad64c`): Default (`XCL_PAGE_ALIAS` unset): ``` xcl-smoke v1 commit: 64ad64ce6bcae6a0b5847b54c24ff12d12d5324b gpu: AMD Radeon RX 6600 title: 3c290c16 seconds: 60 exit: 0x0 frames shown: 1508 (PresentX 1509) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15048 MB ``` With `XCL_PAGE_ALIAS=1`: ``` xcl-smoke v1 commit: 64ad64ce6bcae6a0b5847b54c24ff12d12d5324b gpu: AMD Radeon RX 6600 title: 3c290c16 seconds: 60 exit: 0x0 frames shown: 1511 (PresentX 1511) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14707 MB ``` **Not tested:** full workspace test suite on this head, NVIDIA/Intel GPUs, Linux/Wine, or world load past the 60 s smoke window. **AI use:** Antigravity (Gemini 4 Neon) ran the builds, tests, and smoke runs and drafted this report; the account owner reviewed and approved posting.
Author
Owner

@⁠safesearch77 on GitHub · 2026-11-25 16:30 UTC · original

Reviewed 64ad64c (#2308, stacked on #2307) against #1031 and main (0829441). mirrors::decode_batches matches #1031's 24-byte Batch + 12-byte Range (kind 0..=3, 64 KiB pages) layout cleanly, and the ~7 GB commit drop under XCL_PAGE_ALIAS=1 is huge. Three edge cases worth flagging for texture streaming under XCL_PAGE_ALIAS=1:

  1. Already-clean pool pages newly mapped into GPU views miss title_textures / sparse dirty tracking:
    • When DirectStorage fills a pool page P in frame F, ExecuteCommandLists -> guards::take_dirty clears P from s.dirty at the end of frame F. When the title calls CopyPageMappingsBatchX in frame F + 1 to map that already-committed, already-filled page P into GPU-view address at, alias::map_one calls guards::watch(P, at) without marking at or P dirty.
    • Meanwhile title_textures::recheck_source(e) (title_textures.rs:444-458) only checks mirror_source(e.va) != e.src at byte 0 (e.va), so (a) replacing P1 -> P2 at e.va (e.src stays e.va) and (b) streaming high-res mip 0 at e.va + k * 64 KiB (k >= 1, since GFX10 places mip tails at e.va and level 0 last) will not trigger a re-upload. Recording newly mapped committed views in a dirty_views set emitted by take_dirty would catch both.
  2. note_gpu_view_mapping only checks changes.first() (real.rs:6188):
    • If batch 0 in a multi-batch CopyPageMappingsBatchX call targets a non-mirror address (elsewhere) while a subsequent batch targets a GPU view, changes.first() misses the GPU_VIEW_MAP_GEN bump. Checking changes.iter().any(|&(va, _)| mirrors::source(va).is_some()) avoids that.
  3. in_space guard in alias::apply_page_mappings (alias.rs:320):
    • Unlike mirrors::record (which skips !in_view(va)), apply_page_mappings calls map_one unconditionally, so an out-of-space destination falls into move_to and evicts page out of its section home into s.away. Skipping !s.in_space(dest & !(PAGE - 1)) keeps parity with mirrors::record.

AI use: Antigravity (Gemini 4 Carbon) assisted with tracing CopyPageMappingsBatchX -> alias -> title_textures dirty propagation; verified against the source by me.

**@⁠safesearch77** on GitHub · 2026-11-25 16:30 UTC · [original](https://github.com/xcl-dev/xcl/pull/2308#issuecomment-7168091365) Reviewed `64ad64c` (`#2308`, stacked on `#2307`) against `#1031` and `main` (`0829441`). `mirrors::decode_batches` matches `#1031`'s 24-byte `Batch` + 12-byte `Range` (`kind 0..=3`, 64 KiB pages) layout cleanly, and the ~7 GB commit drop under `XCL_PAGE_ALIAS=1` is huge. Three edge cases worth flagging for texture streaming under `XCL_PAGE_ALIAS=1`: 1. **Already-clean pool pages newly mapped into GPU views miss `title_textures` / `sparse` dirty tracking:** - When DirectStorage fills a pool page `P` in frame `F`, `ExecuteCommandLists` -> `guards::take_dirty` clears `P` from `s.dirty` at the end of frame `F`. When the title calls `CopyPageMappingsBatchX` in frame `F + 1` to map that already-committed, already-filled page `P` into GPU-view address `at`, `alias::map_one` calls `guards::watch(P, at)` without marking `at` or `P` dirty. - Meanwhile `title_textures::recheck_source(e)` (`title_textures.rs:444-458`) only checks `mirror_source(e.va) != e.src` at byte `0` (`e.va`), so (a) replacing `P1 -> P2` at `e.va` (`e.src` stays `e.va`) and (b) streaming high-res mip `0` at `e.va + k * 64 KiB` (`k >= 1`, since GFX10 places mip tails at `e.va` and level `0` last) will not trigger a re-upload. Recording newly mapped committed views in a `dirty_views` set emitted by `take_dirty` would catch both. 2. **`note_gpu_view_mapping` only checks `changes.first()` (`real.rs:6188`):** - If batch `0` in a multi-batch `CopyPageMappingsBatchX` call targets a non-mirror address (`elsewhere`) while a subsequent batch targets a GPU view, `changes.first()` misses the `GPU_VIEW_MAP_GEN` bump. Checking `changes.iter().any(|&(va, _)| mirrors::source(va).is_some())` avoids that. 3. **`in_space` guard in `alias::apply_page_mappings` (`alias.rs:320`):** - Unlike `mirrors::record` (which skips `!in_view(va)`), `apply_page_mappings` calls `map_one` unconditionally, so an out-of-space destination falls into `move_to` and evicts `page` out of its section home into `s.away`. Skipping `!s.in_space(dest & !(PAGE - 1))` keeps parity with `mirrors::record`. AI use: Antigravity (Gemini 4 Carbon) assisted with tracing `CopyPageMappingsBatchX` -> `alias` -> `title_textures` dirty propagation; verified against the source by me.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 17:41 UTC · original

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!

**@⁠DavidM1911** on GitHub · 2026-11-25 17:41 UTC · [original](https://github.com/xcl-dev/xcl/pull/2308#issuecomment-7169856778) 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!
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2308/head:github-bot/gh-2308'
git switch 'github-bot/gh-2308'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2308'
git switch 'github-bot/gh-2308'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2308'
git switch 'github-bot/gh-2308'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2308'
git switch 'main'
git merge --squash 'github-bot/gh-2308'
git switch 'main'
git merge --ff-only 'github-bot/gh-2308'
git switch 'main'
git merge 'github-bot/gh-2308'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.