kernelx: XCL_PAGE_ALIAS=1 shows a physical page at every address it is mapped at #2297

Open
adiologydev wants to merge 4 commits from upstream-pr/2307 into main
adiologydev commented 2026-11-25 13:27:22 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by adiologydev on 2026-11-25T13:27:22Z.


Stacked on #2294; only the top commit (f30ca3f) belongs here. Third part of the plan on #1031: behind XCL_PAGE_ALIAS=1 (off by default), a physical page shows at every address the title maps it at.

Measured in a traced run of a retail title first (local logging, not in the PR): it allocates 3 blocks of physical pages (11 360, 2 960 and 99 776 pages), and in 150 s makes 131 072 map calls, nearly all single pages, into its plain reservations of 64 KiB pages (the CPU view of its 24 GB pair and its 6.2 GB pool) – never at a page's home, and it never commits memory of its own inside them. 5 calls (2 960 pages) go into a placeholder region it made in a sparse window.

What is in it (f30ca3f)

  • crates/xcl/src/hle/kernelx/alias.rs (new), with XCL_PAGE_ALIAS=1:
    • a block of physical pages is a section (#2293) with a view of its own, through which XCL reads and writes pages by number (DirectStorage); homes are plain address space, not the sparse windows, since the title never maps a page there;
    • the title's reservations of 64 KiB pages with no commit (CPU view, GPU view, pool) are placeholders; a page mapped there is a view of its slice, guarded (#2294), so a write through one view is uploaded at all of them;
    • a page mapped anywhere else is moved there and back with its bytes, as without the switch;
    • whether a page is committed is a bit per page: asking Windows walked the rest of a fresh block, and 100 000 single-page maps delayed the first frame by 20 s;
    • 5 unit tests.
  • crates/xcl/src/hle/kernelx.rs: the switch in VirtualAlloc / VirtualFree(Ex), Allocate/Free/MapTitlePhysicalPages, XMemMapPhysicalPagesScatter, read/write_physical_pages, physical_page_at; a commit inside such a reservation is refused (never seen) with a warning.
  • d3d12x/title_textures.rs: the guarded pages join what the write watch found. lazy.rs: a view the lazy handler commits sets its bit. sections.rs: release_all.

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 f30ca3f: 1114 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, against main 568e7db, the same route into its world (pad A at the account prompt, A A at the title screen), 240 s each, runs interleaved (the pipeline cache warms with every run):

    run (in order) frames in 240 s peak commit last frame before the cold pipeline compiles (#2088) crashes / device removals
    XCL_PAGE_ALIAS=1 (f30ca3f) 4 516 23 525 MB 180 s 0 / 0
    main 568e7db 5 001 30 813 MB 192 s 0 / 0
    main 568e7db 4 085 31 855 MB 160 s 0 / 0
    XCL_PAGE_ALIAS=1 (f30ca3f) 4 252 24 341 MB 168 s 0 / 0

    About 7 GB less peak commit with the switch; frames and the time of the last frame are within the run-to-run spread (an earlier single pair showed more frames with the switch; it did not hold up here).

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: f30ca3f037e474fe1ca1720835313db161b36004
gpu: NVIDIA GeForce RTX 5090
title: 2c508222
seconds: 60
exit: 0x0
frames shown: 1530 (PresentX 1530)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15857 MB

Not tested

  • AMD and Intel GPUs; Wine / Proton.
  • The title's world as a picture: on this machine every run stops presenting in the driver's cold pipeline compiles once the world loads (#2088), with or without the switch.
  • Shaders still cannot read the GPU view: it is outside the memory windows (#697). That is the plan's parts 5–6; this PR fixes what the CPU side sees.

AI use

  • Claude Code (Claude Opus 5.5): wrote the code, the tests and this description, and made the runs above on this hardware. I read every line of the diff and checked it.
<!-- greyfinch-sync:ivall/xcl:issue:5492236429 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2307). Originally posted by [adiologydev](https://github.com/adiologydev) on 2026-11-25T13:27:22Z. --- Stacked on #2294; only the top commit (`f30ca3f`) belongs here. Third part of the plan on #1031: behind `XCL_PAGE_ALIAS=1` (off by default), a physical page shows at every address the title maps it at. Measured in a traced run of a retail title first (local logging, not in the PR): it allocates 3 blocks of physical pages (11 360, 2 960 and 99 776 pages), and in 150 s makes 131 072 map calls, nearly all single pages, into its plain reservations of 64 KiB pages (the CPU view of its 24 GB pair and its 6.2 GB pool) – never at a page's home, and it never commits memory of its own inside them. 5 calls (2 960 pages) go into a placeholder region it made in a sparse window. **What is in it** (`f30ca3f`) - `crates/xcl/src/hle/kernelx/alias.rs` (new), with `XCL_PAGE_ALIAS=1`: - a block of physical pages is a section (#2293) with a view of its own, through which XCL reads and writes pages by number (DirectStorage); homes are plain address space, not the sparse windows, since the title never maps a page there; - the title's reservations of 64 KiB pages with no commit (CPU view, GPU view, pool) are placeholders; a page mapped there is a view of its slice, guarded (#2294), so a write through one view is uploaded at all of them; - a page mapped anywhere else is moved there and back with its bytes, as without the switch; - whether a page is committed is a bit per page: asking Windows walked the rest of a fresh block, and 100 000 single-page maps delayed the first frame by 20 s; - 5 unit tests. - `crates/xcl/src/hle/kernelx.rs`: the switch in `VirtualAlloc` / `VirtualFree(Ex)`, `Allocate/Free/MapTitlePhysicalPages`, `XMemMapPhysicalPagesScatter`, `read/write_physical_pages`, `physical_page_at`; a commit inside such a reservation is refused (never seen) with a warning. - `d3d12x/title_textures.rs`: the guarded pages join what the write watch found. `lazy.rs`: a view the lazy handler commits sets its bit. `sections.rs`: `release_all`. **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 `f30ca3f`: 1114 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`, against `main` 568e7db, the same route into its world (pad A at the account prompt, A A at the title screen), 240 s each, runs interleaved (the pipeline cache warms with every run): | run (in order) | frames in 240 s | peak commit | last frame before the cold pipeline compiles (#2088) | crashes / device removals | |---|---|---|---|---| | `XCL_PAGE_ALIAS=1` (`f30ca3f`) | 4 516 | 23 525 MB | 180 s | 0 / 0 | | `main` 568e7db | 5 001 | 30 813 MB | 192 s | 0 / 0 | | `main` 568e7db | 4 085 | 31 855 MB | 160 s | 0 / 0 | | `XCL_PAGE_ALIAS=1` (`f30ca3f`) | 4 252 | 24 341 MB | 168 s | 0 / 0 | About 7 GB less peak commit with the switch; frames and the time of the last frame are within the run-to-run spread (an earlier single pair showed more frames with the switch; it did not hold up here). **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: f30ca3f037e474fe1ca1720835313db161b36004 gpu: NVIDIA GeForce RTX 5090 title: 2c508222 seconds: 60 exit: 0x0 frames shown: 1530 (PresentX 1530) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15857 MB ``` **Not tested** - AMD and Intel GPUs; Wine / Proton. - The title's world as a picture: on this machine every run stops presenting in the driver's cold pipeline compiles once the world loads (#2088), with or without the switch. - Shaders still cannot read the GPU view: it is outside the memory windows (#697). That is the plan's parts 5–6; this PR fixes what the CPU side sees. **AI use** - Claude Code (Claude Opus 5.5): wrote the code, the tests and this description, and made the runs above on this hardware. I read every line of the diff and checked it.
SlopTart commented 2026-11-25 15:07:53 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-25T14:37:16Z.


Tested: head f30ca3f 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). Note the branch carries its open ancestors (#2294, #2293) on top of main, same as it will when reviewed.

Default (switch off): gpu_ suite 141 passed / 4 failed / 1 ignored. Three are the 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, gpu_geometry_wave32_prefix_count_over_a_mask, is this rig's known flaky family: solo reruns 3/3 green on this branch, and plain origin/main reproduces the same failure under the same conditions. Not attributable to this change.

With XCL_PAGE_ALIAS=1: the alias tests added by the top commit fail on this lane, deterministically (2/2 reruns, --test-threads=1):

  • a_page_mapped_into_two_spaces_is_one_page_and_writes_reach_both FAILED
  • a_page_moved_outside_the_spaces_goes_and_comes_back_with_its_bytes FAILED
  • pages_read_and_written_by_number_are_the_pages_the_title_sees FAILED
  • a_page_not_from_the_title_is_refused ok, remapping_an_address_shows_the_new_page_and_keeps_the_old_one ok

On the #2308 branch, which carries these same alias tests unmodified apart from one added test, flag-off runs also fail at real assertion lines (alias.rs:452, alias.rs:495, alias.rs:518), so this is not just switch gating. These are in-process unit tests (0.03 s), not timing-sensitive game runs, so the red looks like a real behavior difference on the Wine/vkd3d-proton lane rather than flakiness.

Not tested: native Windows CI behavior (upstream CI presumably sees these green, so the delta is lane-specific); 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.

<!-- greyfinch-sync:ivall/xcl:comment:7165560936 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2307#issuecomment-7165560936). Originally posted by [SlopTart](https://github.com/SlopTart) on 2026-11-25T14:37:16Z. --- **Tested**: head `f30ca3f` 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). Note the branch carries its open ancestors (#2294, #2293) on top of main, same as it will when reviewed. **Default (switch off)**: `gpu_` suite 141 passed / 4 failed / 1 ignored. Three are the 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, `gpu_geometry_wave32_prefix_count_over_a_mask`, is this rig's known flaky family: solo reruns 3/3 green on this branch, and plain `origin/main` reproduces the same failure under the same conditions. Not attributable to this change. **With `XCL_PAGE_ALIAS=1`**: the alias tests added by the top commit fail on this lane, deterministically (2/2 reruns, `--test-threads=1`): - `a_page_mapped_into_two_spaces_is_one_page_and_writes_reach_both` FAILED - `a_page_moved_outside_the_spaces_goes_and_comes_back_with_its_bytes` FAILED - `pages_read_and_written_by_number_are_the_pages_the_title_sees` FAILED - `a_page_not_from_the_title_is_refused` ok, `remapping_an_address_shows_the_new_page_and_keeps_the_old_one` ok On the #2308 branch, which carries these same alias tests unmodified apart from one added test, flag-off runs also fail at real assertion lines (`alias.rs:452`, `alias.rs:495`, `alias.rs:518`), so this is not just switch gating. These are in-process unit tests (0.03 s), not timing-sensitive game runs, so the red looks like a real behavior difference on the Wine/vkd3d-proton lane rather than flakiness. **Not tested**: native Windows CI behavior (upstream CI presumably sees these green, so the delta is lane-specific); 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.
nnonno91 commented 2026-11-25 15:07:58 +00:00 (Migrated from github.com)

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


Native Windows check of f30ca3f037e474fe1ca1720835313db161b36004. The alias unit tests pass here. The existing mirror upload test stops at a write-watch setup assertion when aliasing is enabled.

Tested

  • Windows 11 25H2 build 26200.9974, Ryzen 7 9800X3D, Rust 1.100.0 MSVC, unoptimized profile. AMD Radeon(TM) Graphics driver 32.0.21042.62, 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 5 passed, 0 failed each.
  • Same command with filter gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes and XCL_ADAPTER=AMD Radeon. Unset: 1 passed, 0 failed. With 1: 0 passed, 1 failed at title_textures.rs:1287, fallback must be write-watched. The log confirmed the Radeon. The assertion is in the test reservation setup, before the texture readback. No skips or ignores.

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 and wrote this report.

<!-- greyfinch-sync:ivall/xcl:comment:7165808335 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2307#issuecomment-7165808335). Originally posted by [nnonno91](https://github.com/nnonno91) on 2026-11-25T14:47:02Z. --- Native Windows check of `f30ca3f037e474fe1ca1720835313db161b36004`. The alias unit tests pass here. The existing mirror upload test stops at a write-watch setup assertion when aliasing is enabled. **Tested** - Windows 11 25H2 build 26200.9974, Ryzen 7 9800X3D, Rust 1.100.0 MSVC, unoptimized profile. AMD Radeon(TM) Graphics driver 32.0.21042.62, 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 5 passed, 0 failed each. - Same command with filter `gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes` and `XCL_ADAPTER=AMD Radeon`. Unset: 1 passed, 0 failed. With `1`: 0 passed, 1 failed at `title_textures.rs:1287`, `fallback must be write-watched`. The log confirmed the Radeon. The assertion is in the test reservation setup, before the texture readback. No skips or ignores. **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 and wrote this report.
tiagonleal commented 2026-11-25 16:12:15 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by tiagonleal on 2026-11-25T15:37:22Z.


Tested: PR #2307 at head f30ca3f037e474fe1ca1720835313db161b36004, release build, Newer Retail Game, 6 guarded runs of 300 s on one Windows machine, XCL_PAGE_ALIAS unset (A) vs XCL_PAGE_ALIAS=1 (B), n=3 each. In short: peak process commit 25.0 to 25.7 GB with the switch against 30.2 to 32.4 GB without, total system commit only about 1 GB lower, no device removal or crash in either, and the one run my memory guard cut was without the switch.

Setup

  • Windows 11 Pro 10.0.26300, Developer Mode on, NVIDIA GeForce RTX 5070 Ti 16 GB, driver 617.42 (32.0.16.1742), Ryzen 7 9800X3D, 32 GB RAM.
  • One binary (cargo build --release -p xcl at the head above), copied under a new exe name for every run (the driver keeps a shader cache per exe name).
  • Env, the same for all six except the switch: XCL_DIRECT_DXIL=1 XCL_PSO_PRELOAD=0 XCL_FRAME_DUMP=60 XCL_PRESS_A_AT=15,22,25,30,35,40,50,60,80,100, XCL_DXIL_CACHE = the same warm cache folder; B adds XCL_PAGE_ALIAS=1. The log also shows XCL_NETWORK=0.
  • Memory guard (my own, outside XCL): it kills the process if free physical RAM drops below 1.0 GB, process commit goes above 70 GB, free commit below 6 GB, or the NVIDIA driver logs a reset event.
  • Order: A1, B1, B2, A2, A3, B3. An earlier attempt was discarded because of a bug in my launcher; it is not in the table. Read-only sampler every 1 to 2 s (memory, GPU memory), process census every 5 s.

Results (MB unless noted; times are seconds from the start of the run; "process commit" = the memory: log line, "private" and "WS" = sampler)

Run Free RAM at start System commit at start Peak process commit Peak private Peak WS Min free RAM (at s) Peak system commit Peak local VRAM Ended Frames shown Presents/s, 60 s to end Last present (s) First ListX #101 (s)
A1 17948 24688 31269 31298 16479 1467 (303) 56604 13891 300 s 1362 0.61 68 65.9
B1 18821 24709 25160 25113 14928 1940 (293) 55648 12726 300 s 1480 0.99 74 71.5
B2 19106 24810 25041 25112 15101 1649 (291) 56356 12544 300 s 1419 0.75 70 67.8
A2 19016 24843 30171 (to 156 s) 30211 15559 974 (155) 57701 13889 cut by guard at 156 s n/a 1.49 (60 to 150 s) 66 49.2
A3 19414 24352 32401 32147 17289 1401 (294) 57007 13820 300 s 1318 0.38 66 64.2
B3 19756 24273 25659 25694 15738 1978 (301) 55791 12484 300 s 1413 0.77 70 65.0

All six: 0 device removals, 0 crashes, 0 driver events, no ERROR lines. Peak private working set (not in the table): A 16317 / 15400 / 17122, B 11315 / 11595 / 12091.

Not a measure of "world entry": the title never got past loading in any run. All six stop presenting between about 66 and 74 s and show 0 presents for the rest of the 300 s. I use the first ListX #101 stub line as the marker; the log's "target pages above 5 GB" line is at 48.0 s in all six runs, so it does not separate anything.

Log content: the same 25 to 26 WARN types in every run, no type present only in A or only in B. Counts: 80 / 77 (cut at 156 s) / 79 WARN lines in A, 77 / 79 / 77 in B. 40 "mesh pipeline ... refused" lines in each run. DirectStorage "request failed" lines: A 3 / 0 / 2, B 0 / 2 / 0 (different files each run). No log line mentions the switch; the 16 "CreatePlacedResourceX ... aliases an earlier resource" lines are in A and B alike.

Reading

  • With the switch, peak process commit was 25.0 to 25.7 GB against 30.2 to 32.4 GB without; the ranges do not overlap (n=3 each). Private working set and local VRAM peak were also lower (VRAM 12.5 to 12.7 GB against 13.8 to 13.9 GB).
  • Total system commit only dropped by about 1 GB (55.6 to 56.4 GB against 56.6 to 57.7 GB). The one process census I looked at with the switch on (B1) shows about 188,000 mapped section views holding about 12.4 GB of commit, so part of the process saving moves into mapped sections.
  • Lowest free RAM was 1.65 to 1.98 GB with the switch and 0.97 to 1.47 GB without. Run A2 was cut by my guard at 156 s because free RAM fell to 0.94 GB, under my own 1 GB threshold on this 32 GB machine; that says nothing about a machine with more RAM or a different threshold.
  • The title kept presenting until 66 to 68 s (A) and 70 to 74 s (B), then stopped in every run, within a few seconds of its first ListX #101 call. I do not read anything into that difference with n=3.

Frames: I looked at the frame dumps of all six runs (XCL_FRAME_DUMP=60). They show a loading-screen artwork slideshow and black frames; same frame number is not the same moment of the slideshow. Picture not compared.

Not tested

  • Full workspace test suite. Only cargo test -p xcl --lib kernelx -- --test-threads=4: 60 passed, 0 failed, 1 ignored (scatter_timing), 0 skipped. That filter does not include the GPU mirror upload tests, which another tester reported failing with the switch on.
  • Picture (see above), AMD, runs longer than 300 s, anything past the loading screen.
  • Current main: it has moved by more than 100 commits since the base this branch was built on (568e7db); I ran the head as it is.
  • One machine, order fixed (not randomised), n=3 per variant.

Run and written with Claude Code (Claude Fable 5.2 and Claude Sonnet 5.5).

<!-- greyfinch-sync:ivall/xcl:comment:7167126612 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2307#issuecomment-7167126612). Originally posted by [tiagonleal](https://github.com/tiagonleal) on 2026-11-25T15:37:22Z. --- **Tested**: PR #2307 at head `f30ca3f037e474fe1ca1720835313db161b36004`, release build, Newer Retail Game, 6 guarded runs of 300 s on one Windows machine, `XCL_PAGE_ALIAS` unset (A) vs `XCL_PAGE_ALIAS=1` (B), n=3 each. In short: peak process commit 25.0 to 25.7 GB with the switch against 30.2 to 32.4 GB without, total system commit only about 1 GB lower, no device removal or crash in either, and the one run my memory guard cut was without the switch. **Setup** - Windows 11 Pro 10.0.26300, Developer Mode on, NVIDIA GeForce RTX 5070 Ti 16 GB, driver 617.42 (32.0.16.1742), Ryzen 7 9800X3D, 32 GB RAM. - One binary (`cargo build --release -p xcl` at the head above), copied under a new exe name for every run (the driver keeps a shader cache per exe name). - Env, the same for all six except the switch: `XCL_DIRECT_DXIL=1 XCL_PSO_PRELOAD=0 XCL_FRAME_DUMP=60 XCL_PRESS_A_AT=15,22,25,30,35,40,50,60,80,100`, `XCL_DXIL_CACHE` = the same warm cache folder; B adds `XCL_PAGE_ALIAS=1`. The log also shows `XCL_NETWORK=0`. - Memory guard (my own, outside XCL): it kills the process if free physical RAM drops below 1.0 GB, process commit goes above 70 GB, free commit below 6 GB, or the NVIDIA driver logs a reset event. - Order: A1, B1, B2, A2, A3, B3. An earlier attempt was discarded because of a bug in my launcher; it is not in the table. Read-only sampler every 1 to 2 s (memory, GPU memory), process census every 5 s. **Results** (MB unless noted; times are seconds from the start of the run; "process commit" = the `memory:` log line, "private" and "WS" = sampler) | Run | Free RAM at start | System commit at start | Peak process commit | Peak private | Peak WS | Min free RAM (at s) | Peak system commit | Peak local VRAM | Ended | Frames shown | Presents/s, 60 s to end | Last present (s) | First ListX #101 (s) | |---|---|---|---|---|---|---|---|---|---|---|---|---|---| | A1 | 17948 | 24688 | 31269 | 31298 | 16479 | 1467 (303) | 56604 | 13891 | 300 s | 1362 | 0.61 | 68 | 65.9 | | B1 | 18821 | 24709 | 25160 | 25113 | 14928 | 1940 (293) | 55648 | 12726 | 300 s | 1480 | 0.99 | 74 | 71.5 | | B2 | 19106 | 24810 | 25041 | 25112 | 15101 | 1649 (291) | 56356 | 12544 | 300 s | 1419 | 0.75 | 70 | 67.8 | | A2 | 19016 | 24843 | 30171 (to 156 s) | 30211 | 15559 | 974 (155) | 57701 | 13889 | cut by guard at 156 s | n/a | 1.49 (60 to 150 s) | 66 | 49.2 | | A3 | 19414 | 24352 | 32401 | 32147 | 17289 | 1401 (294) | 57007 | 13820 | 300 s | 1318 | 0.38 | 66 | 64.2 | | B3 | 19756 | 24273 | 25659 | 25694 | 15738 | 1978 (301) | 55791 | 12484 | 300 s | 1413 | 0.77 | 70 | 65.0 | All six: 0 device removals, 0 crashes, 0 driver events, no ERROR lines. Peak private working set (not in the table): A 16317 / 15400 / 17122, B 11315 / 11595 / 12091. Not a measure of "world entry": the title never got past loading in any run. All six stop presenting between about 66 and 74 s and show 0 presents for the rest of the 300 s. I use the first ListX `#101` stub line as the marker; the log's "target pages above 5 GB" line is at 48.0 s in all six runs, so it does not separate anything. Log content: the same 25 to 26 WARN types in every run, no type present only in A or only in B. Counts: 80 / 77 (cut at 156 s) / 79 WARN lines in A, 77 / 79 / 77 in B. 40 "mesh pipeline ... refused" lines in each run. DirectStorage "request failed" lines: A 3 / 0 / 2, B 0 / 2 / 0 (different files each run). No log line mentions the switch; the 16 "CreatePlacedResourceX ... aliases an earlier resource" lines are in A and B alike. **Reading** - With the switch, peak process commit was 25.0 to 25.7 GB against 30.2 to 32.4 GB without; the ranges do not overlap (n=3 each). Private working set and local VRAM peak were also lower (VRAM 12.5 to 12.7 GB against 13.8 to 13.9 GB). - Total system commit only dropped by about 1 GB (55.6 to 56.4 GB against 56.6 to 57.7 GB). The one process census I looked at with the switch on (B1) shows about 188,000 mapped section views holding about 12.4 GB of commit, so part of the process saving moves into mapped sections. - Lowest free RAM was 1.65 to 1.98 GB with the switch and 0.97 to 1.47 GB without. Run A2 was cut by my guard at 156 s because free RAM fell to 0.94 GB, under my own 1 GB threshold on this 32 GB machine; that says nothing about a machine with more RAM or a different threshold. - The title kept presenting until 66 to 68 s (A) and 70 to 74 s (B), then stopped in every run, within a few seconds of its first ListX `#101` call. I do not read anything into that difference with n=3. **Frames**: I looked at the frame dumps of all six runs (`XCL_FRAME_DUMP=60`). They show a loading-screen artwork slideshow and black frames; same frame number is not the same moment of the slideshow. Picture not compared. **Not tested** - Full workspace test suite. Only `cargo test -p xcl --lib kernelx -- --test-threads=4`: 60 passed, 0 failed, 1 ignored (`scatter_timing`), 0 skipped. That filter does not include the GPU mirror upload tests, which another tester reported failing with the switch on. - Picture (see above), AMD, runs longer than 300 s, anything past the loading screen. - Current `main`: it has moved by more than 100 commits since the base this branch was built on (568e7db); I ran the head as it is. - One machine, order fixed (not randomised), n=3 per variant. Run and written with Claude Code (Claude Fable 5.2 and Claude Sonnet 5.5).
DavidM1911 commented 2026-11-25 18:04:38 +00:00 (Migrated from github.com)

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


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

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7169856243 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2307#issuecomment-7169856243). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T17:41:13Z. --- 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!
claudetools-gh commented 2026-11-25 22:06:39 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by claudetools-gh on 2026-11-25T21:16:19Z.


@adiologydev a data point from the retail title on an RTX 5070 Ti that may point at this PR. With XCL_PAGE_ALIAS=1, the title hits an int3 in its resource pointer fix-up; without it, the same run got past that point. One run each, so treat it as a lead, not a proof.

What the int3 is. It is at game_scarlett_master.exe+0x4da6315. The function there takes a table of {base, size, delta} ranges and one pointer value. It returns the delta of the range the pointer falls in. If the pointer falls in none of them, it executes int3 and returns 0.

Its caller fixes up a pointer that sits inside a loaded resource. Its value should be a resource-relative address: 0x5xxxxxxx for virtual or 0x6xxxxxxx for physical. At the crash, r11 is the first range's base (0x50000000 or 0x60000000). The pointer being fixed up was garbage:

run crashed at pointer value
1 197 s 0xCBCBCBCB… (in rdx and rdi)
2 129.7 s 0x799171
3 158 s 0xb2ac626837eab3e

So the resource's bytes are not what was read from the file when the title walks them. Either they were never written, or they were written where the CPU is not looking. Our game crash logs put it during the intro's streaming ("Prestream").

The A/B. The tree is main 2898511 + #2372 + #2404 + #2426 + #2384 + local GPU-view windows. Common settings: XCL_DIRECT_DXIL=1 XCL_UMA_SHADOW=1 XCL_NETWORK=0; RT resolve programs refused.

XCL_PAGE_ALIAS=1 XCL_TEXTURE_LEVEL_PAGES=1 neither switch
int3 above at 129.7 s, right after world geometry first reached the depth target none by 265 s
world on the 2560×1440 targets depth 50 %, G-buffer 38–41 % (122 s) depth 84 %, G-buffer 66 % (151 s)
local video memory also over budget: 21 GB at 120 s, peaks of 29 GB (two later runs with the same settings; I first wrote "in budget" here without having checked) 27 GB at 116 s, 36 GB at 256 s, against a 14.7 GB budget

Without the switches, the over-budget video memory went into system RAM. I stopped the run at 265 s with 0.4 GB of RAM free; a repeat was stopped at 134 s at 35 GB. With the switches the run is over budget too, but system RAM held: a later run lasted 304 s.

The earlier runs with the same int3 (158 s and 197 s) also had XCL_PAGE_ALIAS=1.

Update: a later run with XCL_PAGE_ALIAS=1 XCL_TEXTURE_LEVEL_PAGES=1 and the same settings went 304 s with no int3. It ended in a different title crash, a write to address 0. Two more stopped earlier, on device removals at 88 s and 120 s. So the int3 comes and goes, and one run without the switches is not enough to pin it on this PR. I am logging the page history at the crash and will post that when the int3 shows again.

What I have not checked:

  • which of the two switches matters;
  • whether the bad resource came in through DirectStorage (its requests here go to "physical pages" destinations) or through a plain file read;
  • whether the CPU sees a page that was mapped again after the request was queued.

If you have a trace switch for "a page shown at an address got new contents through another mapping", I can run it.

AI-assisted.

<!-- greyfinch-sync:ivall/xcl:comment:7174846273 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2307#issuecomment-7174846273). Originally posted by [claudetools-gh](https://github.com/claudetools-gh) on 2026-11-25T21:16:19Z. --- @adiologydev a data point from the retail title on an RTX 5070 Ti that may point at this PR. **With `XCL_PAGE_ALIAS=1`, the title hits an `int3` in its resource pointer fix-up; without it, the same run got past that point.** One run each, so treat it as a lead, not a proof. **What the `int3` is.** It is at `game_scarlett_master.exe+0x4da6315`. The function there takes a table of `{base, size, delta}` ranges and one pointer value. It returns the delta of the range the pointer falls in. If the pointer falls in none of them, it executes `int3` and returns 0. Its caller fixes up a pointer that sits inside a loaded resource. Its value should be a resource-relative address: `0x5xxxxxxx` for virtual or `0x6xxxxxxx` for physical. At the crash, `r11` is the first range's base (`0x50000000` or `0x60000000`). The pointer being fixed up was garbage: | run | crashed at | pointer value | |---|---|---| | 1 | 197 s | `0xCBCBCBCB…` (in `rdx` and `rdi`) | | 2 | 129.7 s | `0x799171` | | 3 | 158 s | `0xb2ac626837eab3e` | So the resource's bytes are not what was read from the file when the title walks them. Either they were never written, or they were written where the CPU is not looking. Our game crash logs put it during the intro's streaming ("Prestream"). **The A/B.** The tree is `main` `2898511` + #2372 + #2404 + #2426 + #2384 + local GPU-view windows. Common settings: `XCL_DIRECT_DXIL=1 XCL_UMA_SHADOW=1 XCL_NETWORK=0`; RT resolve programs refused. | | `XCL_PAGE_ALIAS=1 XCL_TEXTURE_LEVEL_PAGES=1` | neither switch | |---|---|---| | `int3` above | at 129.7 s, right after world geometry first reached the depth target | none by 265 s | | world on the 2560×1440 targets | depth 50 %, G-buffer 38–41 % (122 s) | depth 84 %, G-buffer 66 % (151 s) | | local video memory | also over budget: 21 GB at 120 s, peaks of 29 GB (two later runs with the same settings; I first wrote "in budget" here without having checked) | 27 GB at 116 s, 36 GB at 256 s, against a 14.7 GB budget | Without the switches, the over-budget video memory went into system RAM. I stopped the run at 265 s with 0.4 GB of RAM free; a repeat was stopped at 134 s at 35 GB. With the switches the run is over budget too, but system RAM held: a later run lasted 304 s. The earlier runs with the same `int3` (158 s and 197 s) also had `XCL_PAGE_ALIAS=1`. **Update:** a later run with `XCL_PAGE_ALIAS=1 XCL_TEXTURE_LEVEL_PAGES=1` and the same settings went 304 s with no `int3`. It ended in a different title crash, a write to address 0. Two more stopped earlier, on device removals at 88 s and 120 s. So the `int3` comes and goes, and one run without the switches is not enough to pin it on this PR. I am logging the page history at the crash and will post that when the `int3` shows again. **What I have not checked:** - which of the two switches matters; - whether the bad resource came in through DirectStorage (its requests here go to "physical pages" destinations) or through a plain file read; - whether the CPU sees a page that was mapped again after the request was queued. If you have a trace switch for "a page shown at an address got new contents through another mapping", I can run it. AI-assisted.
Decodere commented 2026-11-27 06:56:35 +00:00 (Migrated from github.com)

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


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

Environment

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

Targeted release tests & build (f30ca3f0)

Command Result
cargo test --release -p xcl --lib hle::kernelx::alias:: -- --test-threads=1 --nocapture (default env, 3 runs) 5 passed; 0 failed; 0 ignored; 1139 filtered out × 3 (0.02s × 3, 0 skipped: a_page_mapped_into_two_spaces_is_one_page_and_writes_reach_both, a_page_moved_outside_the_spaces_goes_and_comes_back_with_its_bytes, a_page_not_from_the_title_is_refused, pages_read_and_written_by_number_are_the_pages_the_title_sees, remapping_an_address_shows_the_new_page_and_keeps_the_old_one)
cargo test --release -p xcl --lib hle::kernelx:: -- --test-threads=1 (default env, 3 runs) 58 passed; 0 failed; 1 ignored; 1085 filtered out × 3 (1.15s, 1.14s, 1.15s, 0 skipped)
XCL_PAGE_ALIAS=1 cargo test --release -p xcl --lib hle::kernelx:: -- --test-threads=1 (opt-in env, 3 runs) 49 passed; 9 failed; 1 ignored; 1085 filtered out × 3 (0.97s, 0.98s, 0.98s; all 5 alias::, 8 guards::, 7 sections::, and 2 lazy:: tests pass; see note below on the 9 pre-existing UMA-home unit tests)
cargo build --release -p xcl Clean build (1m 14s, exit 0, 0 new warnings in non-test build; inherits 1 unused_assignments #[cfg(test)] warning from stacked #2294 at crates/xcl/src/hle/kernelx/guards.rs:366:9)

Observation on hle::kernelx:: under process-wide XCL_PAGE_ALIAS=1: All 58/58 tests pass 3/3 in the default environment. With XCL_PAGE_ALIAS=1 set process-wide, all 22 alias::/guards::/sections::/lazy:: tests pass 3/3, while 9 pre-existing UMA-home tests in hle::kernelx::tests:: fail deterministically (3/3): 7 (a_home_decommitted_in_the_same_call_is_asked_again, a_page_away_at_another_home_goes_home_with_it, a_page_away_from_home_is_committed_once, mapping_fresh_pages_does_not_query_each_page, mapping_lazy_pages_again_does_not_query_each_page, pages_mapped_again_at_another_address_keep_what_was_written, pages_mapped_again_at_the_same_address_keep_what_was_written) panic on page_home(...).unwrap() returning None (because XCL_PAGE_ALIAS=1 backs physical pages with section slices instead of UMA homes), and 2 (physical_pages_in_uma at kernelx.rs:2371 and scatter_matches_a_model_of_physical_pages at kernelx.rs:2624) expect MapTitlePhysicalPages(NULL, ...) to return a UMA-home address.

Paired quiet 60 s retail smoke (title: 29640639)

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

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

PR #2307 (f30ca3f037e474fe1ca1720835313db161b36004, default flags — XCL_PAGE_ALIAS unset):

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

PR #2307 (f30ca3f037e474fe1ca1720835313db161b36004, opt-in XCL_PAGE_ALIAS=1):

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

Observations & limits of coverage

  • Both default (XCL_PAGE_ALIAS unset) and opt-in (XCL_PAGE_ALIAS=1) 60 s retail smokes on title: 29640639 exited 0x0 with 0 device removals, 0 crashes, and steady 60 60 60 presents per 2 s; under XCL_PAGE_ALIAS=1, peak process commit dropped from 14515 MB to 13150 MB (-1365 MB, -9.4% vs. default run on the same commit f30ca3f0).
  • Frame-count variance (1558 vs. 1608) between single 60 s runs was not multi-run profiled; visual texture correctness under extended gameplay beyond the 60 s startup/streaming window was not separately inspected.

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

<!-- greyfinch-sync:ivall/xcl:comment:7211991239 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2307#issuecomment-7211991239). Originally posted by [Decodere](https://github.com/Decodere) on 2026-11-27T06:56:35Z. --- Independent desktop NVIDIA verification of **PR #2307** at head `f30ca3f037e474fe1ca1720835313db161b36004` (`4` commits stacked on PR #2293 + PR #2294: `03ceddb0be3d06287ca21ae800dbb0d7f98049e7` -> `6602a7020122f508f72fed942286f488e3bd1bb9` -> `d660e3070bef6e3ae095393dc134ecd517ab4a35` -> `f30ca3f037e474fe1ca1720835313db161b36004`; exact parent & merge-base: `568e7db7729c8fa6c8f0f4b32d798faaf11462bb`, pre-`#2555` ancestor of `main`). ### Environment - **GPU:** NVIDIA GeForce RTX 4060 (8 GB / `7956 MiB` reported by D3D12), driver `32.0.16.2114` (NVIDIA `621.14`, WDDM 3.2) - **CPU / RAM / OS:** Intel Core i5-11400F (6C / 12T), 32 GB RAM (`31.9 GiB` usable), Windows 11 Home `26200` (Developer Mode off) - **Toolchain:** `rustc 1.100.0 (0ef1bc386 2026-11-09)` MSVC, DXC `1.9.2609.5`, `--release` ### Targeted release tests & build (`f30ca3f0`) | Command | Result | | --- | --- | | `cargo test --release -p xcl --lib hle::kernelx::alias:: -- --test-threads=1 --nocapture` (default env, 3 runs) | `5 passed; 0 failed; 0 ignored; 1139 filtered out` × 3 (`0.02s` × 3, `0` skipped: `a_page_mapped_into_two_spaces_is_one_page_and_writes_reach_both`, `a_page_moved_outside_the_spaces_goes_and_comes_back_with_its_bytes`, `a_page_not_from_the_title_is_refused`, `pages_read_and_written_by_number_are_the_pages_the_title_sees`, `remapping_an_address_shows_the_new_page_and_keeps_the_old_one`) | | `cargo test --release -p xcl --lib hle::kernelx:: -- --test-threads=1` (default env, 3 runs) | `58 passed; 0 failed; 1 ignored; 1085 filtered out` × 3 (`1.15s`, `1.14s`, `1.15s`, `0` skipped) | | `XCL_PAGE_ALIAS=1 cargo test --release -p xcl --lib hle::kernelx:: -- --test-threads=1` (opt-in env, 3 runs) | `49 passed; 9 failed; 1 ignored; 1085 filtered out` × 3 (`0.97s`, `0.98s`, `0.98s`; all `5` `alias::`, `8` `guards::`, `7` `sections::`, and `2` `lazy::` tests pass; see note below on the `9` pre-existing UMA-home unit tests) | | `cargo build --release -p xcl` | Clean build (`1m 14s`, exit `0`, `0` new warnings in non-test build; inherits 1 `unused_assignments` `#[cfg(test)]` warning from stacked #2294 at `crates/xcl/src/hle/kernelx/guards.rs:366:9`) | **Observation on `hle::kernelx::` under process-wide `XCL_PAGE_ALIAS=1`:** All `58/58` tests pass `3/3` in the default environment. With `XCL_PAGE_ALIAS=1` set process-wide, all `22` `alias::`/`guards::`/`sections::`/`lazy::` tests pass `3/3`, while `9` pre-existing UMA-home tests in `hle::kernelx::tests::` fail deterministically (`3/3`): `7` (`a_home_decommitted_in_the_same_call_is_asked_again`, `a_page_away_at_another_home_goes_home_with_it`, `a_page_away_from_home_is_committed_once`, `mapping_fresh_pages_does_not_query_each_page`, `mapping_lazy_pages_again_does_not_query_each_page`, `pages_mapped_again_at_another_address_keep_what_was_written`, `pages_mapped_again_at_the_same_address_keep_what_was_written`) panic on `page_home(...).unwrap()` returning `None` (because `XCL_PAGE_ALIAS=1` backs physical pages with section slices instead of UMA homes), and `2` (`physical_pages_in_uma` at `kernelx.rs:2371` and `scatter_matches_a_model_of_physical_pages` at `kernelx.rs:2624`) expect `MapTitlePhysicalPages(NULL, ...)` to return a UMA-home address. ### Paired quiet 60 s retail smoke (`title: 29640639`) Exact parent & merge-base (`568e7db7729c8fa6c8f0f4b32d798faaf11462bb`, cached baseline on the same machine): ``` xcl-smoke v1 commit: 568e7db7729c8fa6c8f0f4b32d798faaf11462bb gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1587 (PresentX 1587) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14527 MB ``` PR #2307 (`f30ca3f037e474fe1ca1720835313db161b36004`, default flags — `XCL_PAGE_ALIAS` unset): ``` xcl-smoke v1 commit: f30ca3f037e474fe1ca1720835313db161b36004 gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1608 (PresentX 1608) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14515 MB ``` PR #2307 (`f30ca3f037e474fe1ca1720835313db161b36004`, opt-in `XCL_PAGE_ALIAS=1`): ``` xcl-smoke v1 commit: f30ca3f037e474fe1ca1720835313db161b36004 gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1558 (PresentX 1558) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 13150 MB ``` ### Observations & limits of coverage - Both default (`XCL_PAGE_ALIAS` unset) and opt-in (`XCL_PAGE_ALIAS=1`) 60 s retail smokes on `title: 29640639` exited `0x0` with `0` device removals, `0` crashes, and steady `60 60 60` presents per 2 s; under `XCL_PAGE_ALIAS=1`, peak process commit dropped from `14515 MB` to `13150 MB` (`-1365 MB`, `-9.4%` vs. default run on the same commit `f30ca3f0`). - Frame-count variance (`1558` vs. `1608`) between single 60 s runs was not multi-run profiled; visual texture correctness under extended gameplay beyond the 60 s startup/streaming window was not separately inspected. *AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).*
ZekkJJ commented 2026-11-27 21:44:32 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ZekkJJ on 2026-11-27T21:44:32Z.


Independent test on Windows 11 build 26200, Ryzen 7 8845HS, RTX 4060 Laptop 8 GiB (driver 32.0.16.1656), 16 GiB RAM, Rust 1.98.1 MSVC. I integrated the exact #2307 head f30ca3f037e474fe1ca1720835313db161b36004 with main 6089122a1c96dff16e93b6fdf04c8ed20cfb6102. Two small follow-ups use the original dependency commits.

  • #3074 restores the null scatter-unmap behavior of #495 on the section-backed branch. The merge otherwise preserves the null check in the conventional path while the alias path still advances the pointer. The historical retail crash resolved to map_aliased <- XMemMapPhysicalPagesScatter. The new two-entry regression and 22 other focused checks passed with aliases enabled. I reproduced the write-watch fixture setup failure reported above with aliasing enabled. The same GPU fixture passed byte-exact readback in conventional mode.
  • #3075 recognizes section-backed page IDs when DirectStorage validates the updated destination list. The existing regression failed on 785d7dc5 with aliasing enabled: the request returned success and the intended 256 bytes remained zero. On cfe04f43 it passed byte-for-byte, including the stack snapshot case. The 7 alias and 19 DirectStorage tests passed with no explicit skips.

Historical evidence from a separate earlier integration on this RTX 4060 Laptop at an exact matched Series S checkpoint (4,200 DirectStorage requests, 262 MiB, zero storage failures on both):

MiB Conventional Section aliases
Private process commit 14,558 6,727
System commit growth since first sample 9,426 1,985
DXGI local 4,551 767
DXGI non-local 5,172 5,265
Native sparse backing 3,846 289

The system commit growth difference was 7,441 MiB. Both historical runs subsequently crashed in separate paths, one during a concurrent texture decommit and the other in the null scatter-unmap. World entry was unverified. These measurements belong to that integration. No fresh smoke block was generated. The clean Series S preflight expired at 3205 MiB free RAM and 13200 MiB free commit. The guarded runner requires 6,600 MiB RAM and 18,000 MiB free commit at startup. The last idle check still showed 4129 MiB RAM and 13941 MiB free commit. Series X was deferred.

AI use: Codex (GPT-6 family, exact runtime variant unavailable) recovered the private historical artifacts, compared sources, ran the focused tests, and drafted this comment.

<!-- greyfinch-sync:ivall/xcl:comment:7228713617 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2307#issuecomment-7228713617). Originally posted by [ZekkJJ](https://github.com/ZekkJJ) on 2026-11-27T21:44:32Z. --- Independent test on Windows 11 build 26200, Ryzen 7 8845HS, RTX 4060 Laptop 8 GiB (driver 32.0.16.1656), 16 GiB RAM, Rust 1.98.1 MSVC. I integrated the exact #2307 head `f30ca3f037e474fe1ca1720835313db161b36004` with main `6089122a1c96dff16e93b6fdf04c8ed20cfb6102`. Two small follow-ups use the original dependency commits. - #3074 restores the null scatter-unmap behavior of #495 on the section-backed branch. The merge otherwise preserves the null check in the conventional path while the alias path still advances the pointer. The historical retail crash resolved to `map_aliased <- XMemMapPhysicalPagesScatter`. The new two-entry regression and 22 other focused checks passed with aliases enabled. I reproduced the write-watch fixture setup failure reported above with aliasing enabled. The same GPU fixture passed byte-exact readback in conventional mode. - #3075 recognizes section-backed page IDs when DirectStorage validates the updated destination list. The existing regression failed on `785d7dc5` with aliasing enabled: the request returned success and the intended 256 bytes remained zero. On `cfe04f43` it passed byte-for-byte, including the stack snapshot case. The 7 alias and 19 DirectStorage tests passed with no explicit skips. Historical evidence from a separate earlier integration on this RTX 4060 Laptop at an exact matched Series S checkpoint (4,200 DirectStorage requests, 262 MiB, zero storage failures on both): | MiB | Conventional | Section aliases | | --- | ---: | ---: | | Private process commit | 14,558 | 6,727 | | System commit growth since first sample | 9,426 | 1,985 | | DXGI local | 4,551 | 767 | | DXGI non-local | 5,172 | 5,265 | | Native sparse backing | 3,846 | 289 | The system commit growth difference was 7,441 MiB. Both historical runs subsequently crashed in separate paths, one during a concurrent texture decommit and the other in the null scatter-unmap. World entry was unverified. These measurements belong to that integration. No fresh smoke block was generated. The clean Series S preflight expired at 3205 MiB free RAM and 13200 MiB free commit. The guarded runner requires 6,600 MiB RAM and 18,000 MiB free commit at startup. The last idle check still showed 4129 MiB RAM and 13941 MiB free commit. Series X was deferred. AI use: Codex (GPT-6 family, exact runtime variant unavailable) recovered the private historical artifacts, compared sources, ran the focused tests, and drafted this comment.
KOLESNiii commented 2026-11-28 21:26:52 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-28T21:26:52Z.


Review finding for f30ca3f0 (#3211 workstream B), with a regression test that fails here and passes with a one-line fix. I tested it at #3075's head 4fdd2824, where map_one has the same branch.

With XCL_PAGE_ALIAS=1, a page that already holds bytes is not uploaded when it is mapped at a new address.

  • map_one calls guards::watch(page, at), which guards the view but marks nothing dirty. Only a page that was never committed gets lazy::mark.
  • Views cannot be write-watched, so title_textures::refresh learns about that address only through guards::take_dirty.
  • So a second view of a written page, or an address remapped from one page to another, keeps whatever its textures and sparse GPU tiles held before, until the page is written again.
  • The conventional path copies the bytes into place, and the write watch catches that copy.
  • Related: guards::forget drops the page's dirty record when its last view goes. A write, an unmap and a remap all before the next submit are therefore never uploaded either. The fix below covers that case too, because the remap marks the page again.

Test (alias.rs):

  1. Map p0 at s and write to it.
  2. Write p1 by number.
  3. Take the dirty list.
  4. Map p0 at s + PAGE and expect s + PAGE in take_dirty.
  5. Map p1 at s and expect s.

Results:

  • At 4fdd2824 it fails: the new view of a written page is uploaded.
  • With guards::written(page) for a committed page in map_one it passes. That marks every view of the page; marking only at would upload less.
Patch (fix + test)
@@ unsafe fn map_one(at: usize, page: usize, _mapping: &std::sync::MutexGuard<'_, (
         if !committed(page) {
             // a page never used: committed at its first touch here (or through its home)
             lazy::mark(at);
+        } else {
+            // the address shows the page's bytes from now on: uploaded there like a write
+            guards::written(page);
         }
         return Ok(());
     }
@@ mod tests {
+    #[test]
+    fn a_page_with_bytes_mapped_at_a_new_view_is_uploaded_there() {
+        let _g = SERIAL.lock().unwrap_or_else(|e| e.into_inner());
+        let p = pages(2);
+        let s = reserve_space(3 * PAGE).unwrap();
+        unsafe {
+            assert!(map(s, &[p[0]]));
+            write64(s, 11);
+            assert!(write(&[p[1]], 0, &22u64.to_le_bytes()));
+            dirty();
+            // a second view of a page that holds bytes: that address now shows them
+            assert!(map(s + PAGE, &[p[0]]));
+            assert_eq!(read64(s + PAGE), 11);
+            assert!(dirty().contains(&(s + PAGE)), "the new view of a written page is uploaded");
+            // an address that showed one page shows another that holds bytes
+            assert!(map(s, &[p[1]]));
+            assert_eq!(read64(s), 22);
+            assert!(dirty().contains(&s), "a view remapped to a written page is uploaded");
+            free_space(s, 0, mem::MEM_RELEASE);
+            free(&p);
+        }
+    }

Tested (RTX 2070 SUPER, Windows 11, debug, cargo test -p xcl --lib hle::kernelx:: -- --test-threads=1, with this patch and the one in my #3075 comment): 68 passed, 0 failed, 1 ignored. With XCL_PAGE_ALIAS=1: 59 passed, 9 failed. The same 9 conventional-path tests fail without the patch.

Whether this explains any of the zero-sampled textures in #505 is not established. This is a static finding plus a unit test, with no retail run.

Not tested: retail title, AMD, GPU-side readback (the test checks what is handed to the upload, not what the GPU holds).

AI use: Claude Code (Claude Opus 5.5) found the issue and wrote the test and fix; the comment was checked by @KOLESNiii before posting.

<!-- greyfinch-sync:ivall/xcl:comment:7246025171 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2307#issuecomment-7246025171). Originally posted by [KOLESNiii](https://github.com/KOLESNiii) on 2026-11-28T21:26:52Z. --- Review finding for f30ca3f0 (#3211 workstream B), with a regression test that fails here and passes with a one-line fix. I tested it at #3075's head 4fdd2824, where `map_one` has the same branch. **With `XCL_PAGE_ALIAS=1`, a page that already holds bytes is not uploaded when it is mapped at a new address.** - `map_one` calls `guards::watch(page, at)`, which guards the view but marks nothing dirty. Only a page that was never committed gets `lazy::mark`. - Views cannot be write-watched, so `title_textures::refresh` learns about that address only through `guards::take_dirty`. - So a second view of a written page, or an address remapped from one page to another, keeps whatever its textures and sparse GPU tiles held before, until the page is written again. - The conventional path copies the bytes into place, and the write watch catches that copy. - Related: `guards::forget` drops the page's dirty record when its last view goes. A write, an unmap and a remap all before the next submit are therefore never uploaded either. The fix below covers that case too, because the remap marks the page again. **Test** (alias.rs): 1. Map p0 at `s` and write to it. 2. Write p1 by number. 3. Take the dirty list. 4. Map p0 at `s + PAGE` and expect `s + PAGE` in `take_dirty`. 5. Map p1 at `s` and expect `s`. Results: - At 4fdd2824 it fails: `the new view of a written page is uploaded`. - With `guards::written(page)` for a committed page in `map_one` it passes. That marks every view of the page; marking only `at` would upload less. <details><summary>Patch (fix + test)</summary> ```diff @@ unsafe fn map_one(at: usize, page: usize, _mapping: &std::sync::MutexGuard<'_, ( if !committed(page) { // a page never used: committed at its first touch here (or through its home) lazy::mark(at); + } else { + // the address shows the page's bytes from now on: uploaded there like a write + guards::written(page); } return Ok(()); } @@ mod tests { + #[test] + fn a_page_with_bytes_mapped_at_a_new_view_is_uploaded_there() { + let _g = SERIAL.lock().unwrap_or_else(|e| e.into_inner()); + let p = pages(2); + let s = reserve_space(3 * PAGE).unwrap(); + unsafe { + assert!(map(s, &[p[0]])); + write64(s, 11); + assert!(write(&[p[1]], 0, &22u64.to_le_bytes())); + dirty(); + // a second view of a page that holds bytes: that address now shows them + assert!(map(s + PAGE, &[p[0]])); + assert_eq!(read64(s + PAGE), 11); + assert!(dirty().contains(&(s + PAGE)), "the new view of a written page is uploaded"); + // an address that showed one page shows another that holds bytes + assert!(map(s, &[p[1]])); + assert_eq!(read64(s), 22); + assert!(dirty().contains(&s), "a view remapped to a written page is uploaded"); + free_space(s, 0, mem::MEM_RELEASE); + free(&p); + } + } ``` </details> **Tested** (RTX 2070 SUPER, Windows 11, debug, `cargo test -p xcl --lib hle::kernelx:: -- --test-threads=1`, with this patch and the one in my #3075 comment): 68 passed, 0 failed, 1 ignored. With `XCL_PAGE_ALIAS=1`: 59 passed, 9 failed. The same 9 conventional-path tests fail without the patch. Whether this explains any of the zero-sampled textures in #505 is not established. This is a static finding plus a unit test, with no retail run. **Not tested:** retail title, AMD, GPU-side readback (the test checks what is handed to the upload, not what the GPU holds). AI use: Claude Code (Claude Opus 5.5) found the issue and wrote the test and fix; the comment was checked by @KOLESNiii before posting.
claudetools-gh commented 2026-11-29 11:01:59 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by claudetools-gh on 2026-11-29T11:01:59Z.


On main fa204595 with this series on top (#2307 f30ca3f0 → #3074 785d7dc5 → #3075 4fdd2824, unchanged except for conflict context), XCL_PAGE_ALIAS=1 leaves every GPU-view page that CopyPageMappingsBatchX names unmapped. Whatever the title reads through those views is zeros; in a retail title the loading-screen artwork comes out black.

The queue CopyPageMappingsBatchX: line at the end of each run (same exe, same title and scene):

run XCL_PAGE_ALIAS calls GPU-view pages mapped "named a pool page with no page mapped there" moved with their physical page upload pages "where the mapping put the page"
A 0 481 62931 0 13477 119589
B 1 328 0 50564 0 0
C 1 571 0 86088 0 0
D 0 1010 118373 0 31797 279094

My reading of the code:

  • mirrors::apply_batches resolves each pool page through Away::title (kernelx.rs, away.as_ref().and_then(|a| a.title.get(&pool))) and then calls place_of.
  • With the alias on, MapTitlePhysicalPages goes to map_aliased → alias::map. That keeps the mapping in alias's own state, but nothing fills Away::title: only map_pages, the non-alias path, inserts into it.
  • AllocateTitlePhysicalPages doesn't put the pages in PHYS_BLOCKS either, so page_home finds nothing.
  • So every page resolves to 0 and is counted as "named a pool page with no page mapped there", which ends up as Shows::Nothing.

The mirrors code reached main after this series was written, which would explain why the series never accounted for it.

What I think a fix needs:

  • in apply_batches, when alias::enabled(), resolve the pool address through alias: the physical page, and the address where its bytes live;
  • alias::map / unmap / move should call mirrors::page_at / page_placed the way the non-alias path does, so that GPU views follow their physical page;
  • a decision on whether those homes can be tiled or must be copied, since an alias home is a section view outside the GPU-visible windows.

Not tested: a fix; AMD. RTX 5070 Ti, driver 621.40, Windows 11.
AI use: Claude Code with Claude Opus 5.5 ran the runs, traced the code and wrote this. AI-assisted.

<!-- greyfinch-sync:ivall/xcl:comment:7254833033 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2307#issuecomment-7254833033). Originally posted by [claudetools-gh](https://github.com/claudetools-gh) on 2026-11-29T11:01:59Z. --- On `main` fa204595 with this series on top (#2307 f30ca3f0 → #3074 785d7dc5 → #3075 4fdd2824, unchanged except for conflict context), `XCL_PAGE_ALIAS=1` leaves every GPU-view page that `CopyPageMappingsBatchX` names unmapped. Whatever the title reads through those views is zeros; in a retail title the loading-screen artwork comes out black. The `queue CopyPageMappingsBatchX:` line at the end of each run (same exe, same title and scene): | run | `XCL_PAGE_ALIAS` | calls | GPU-view pages mapped | "named a pool page with no page mapped there" | moved with their physical page | upload pages "where the mapping put the page" | |---|---|---|---|---|---|---| | A | 0 | 481 | 62931 | 0 | 13477 | 119589 | | B | 1 | 328 | 0 | 50564 | 0 | 0 | | C | 1 | 571 | 0 | 86088 | 0 | 0 | | D | 0 | 1010 | 118373 | 0 | 31797 | 279094 | My reading of the code: - `mirrors::apply_batches` resolves each pool page through `Away::title` (`kernelx.rs`, `away.as_ref().and_then(|a| a.title.get(&pool))`) and then calls `place_of`. - With the alias on, `MapTitlePhysicalPages` goes to `map_aliased` → `alias::map`. That keeps the mapping in `alias`'s own state, but nothing fills `Away::title`: only `map_pages`, the non-alias path, inserts into it. - `AllocateTitlePhysicalPages` doesn't put the pages in `PHYS_BLOCKS` either, so `page_home` finds nothing. - So every page resolves to 0 and is counted as "named a pool page with no page mapped there", which ends up as `Shows::Nothing`. The mirrors code reached `main` after this series was written, which would explain why the series never accounted for it. What I think a fix needs: - in `apply_batches`, when `alias::enabled()`, resolve the pool address through `alias`: the physical page, and the address where its bytes live; - `alias::map` / unmap / move should call `mirrors::page_at` / `page_placed` the way the non-alias path does, so that GPU views follow their physical page; - a decision on whether those homes can be tiled or must be copied, since an alias home is a section view outside the GPU-visible windows. Not tested: a fix; AMD. RTX 5070 Ti, driver 621.40, Windows 11. AI use: Claude Code with Claude Opus 5.5 ran the runs, traced the code and wrote this. AI-assisted.
brainhay5 commented 2026-12-01 01:54:08 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by brainhay5 on 2026-12-01T01:54:08Z.


Triage note: this no longer merges with current main (mergeable=false), so it cannot be built or tested as it stands.

Why I am asking rather than just noting it: we have run fifteen mergeable candidates on the retail title on an RTX 5070 Ti, and every one still stops presenting at 50–80 s (device removed, surfacing ~88 s later on the next allocation). The PRs whose descriptions actually match that symptom are the ones that no longer apply — this is one of them. A rebase would make it testable again, and we will run it and report the numbers.

If it has been superseded by merged work, saying so is enough and it can be closed.

AI use: an agent posted this triage note.

<!-- greyfinch-sync:ivall/xcl:comment:7298020829 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2307#issuecomment-7298020829). Originally posted by [brainhay5](https://github.com/brainhay5) on 2026-12-01T01:54:08Z. --- Triage note: this no longer merges with current `main` (`mergeable=false`), so it cannot be built or tested as it stands. Why I am asking rather than just noting it: we have run fifteen mergeable candidates on the retail title on an RTX 5070 Ti, and every one still stops presenting at 50–80 s (device removed, surfacing ~88 s later on the next allocation). The PRs whose descriptions actually match that symptom are the ones that no longer apply — this is one of them. A rebase would make it testable again, and we will run it and report the numbers. If it has been superseded by merged work, saying so is enough and it can be closed. *AI use: an agent posted this triage note.*
Foniass commented 2026-12-01 07:48:03 +00:00 (Migrated from github.com)

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


Triage (#1607) – head f30ca3f

Stacked on #2294 / #2293 (only f30ca3f belongs here). #2308 builds on it, and #3074 / #3075 (another author) merge this branch and add fixes on top, so they are follow-ups, not duplicates.
Points to handle on rebase, both already fixed in #3074 / #3075:

  • main now accepts a null pages in XMemMapPhysicalPagesScatter (unmap). The alias branch's pages.add(i) would then pass 0x8, 0x10, … to map_aliased, which dereferences them.
  • alias::State::page only checks i < section.pages(), so a freed page ID in a block that still has live pages can still be mapped and read. Also, free can release a block's home while bytes_of / move_to copy from it on another thread, because they run outside the lock.
    The feature is off by default (XCL_PAGE_ALIAS).
    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:7304495498 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2307#issuecomment-7304495498). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T07:48:03Z. --- **Triage (#1607)** – head f30ca3f Stacked on #2294 / #2293 (only `f30ca3f` belongs here). #2308 builds on it, and #3074 / #3075 (another author) merge this branch and add fixes on top, so they are follow-ups, not duplicates. Points to handle on rebase, both already fixed in #3074 / #3075: - main now accepts a null `pages` in `XMemMapPhysicalPagesScatter` (unmap). The alias branch's `pages.add(i)` would then pass `0x8`, `0x10`, … to `map_aliased`, which dereferences them. - `alias::State::page` only checks `i < section.pages()`, so a freed page ID in a block that still has live pages can still be mapped and read. Also, `free` can release a block's home while `bytes_of` / `move_to` copy from it on another thread, because they run outside the lock. The feature is off by default (`XCL_PAGE_ALIAS`). 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/2307:upstream-pr/2307'
git switch 'upstream-pr/2307'

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