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

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

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


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.
<!-- greyfinch-sync:ivall/xcl:issue:5492239533 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2308). Originally posted by [adiologydev](https://github.com/adiologydev) on 2026-11-25T13:27:34Z. --- 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.
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:58Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7165578648 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2308#issuecomment-7165578648). Originally posted by [SlopTart](https://github.com/SlopTart) on 2026-11-25T14:37:58Z. --- **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.
nnonno91 commented 2026-11-25 15:07:59 +00:00 (Migrated from github.com)

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


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.

<!-- greyfinch-sync:ivall/xcl:comment:7165809511 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2308#issuecomment-7165809511). Originally posted by [nnonno91](https://github.com/nnonno91) on 2026-11-25T14:47:05Z. --- 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.
thiagocalile commented 2026-11-25 17:07:20 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thiagocalile on 2026-11-25T16:25:50Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7167966132 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2308#issuecomment-7167966132). Originally posted by [thiagocalile](https://github.com/thiagocalile) on 2026-11-25T16:25:50Z. --- 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.
safesearch77 commented 2026-11-25 17:07:22 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by safesearch77 on 2026-11-25T16:30:29Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7168091365 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2308#issuecomment-7168091365). Originally posted by [safesearch77](https://github.com/safesearch77) on 2026-11-25T16:30:29Z. --- 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.
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:14Z.


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:7169856778 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2308#issuecomment-7169856778). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T17:41:14Z. --- 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!
Foniass commented 2026-12-01 07:48:19 +00:00 (Migrated from github.com)

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


Triage (#1607) – head 64ad64c

Stacked on #2307 (XCL_PAGE_ALIAS) and #1055; only 31fe59c and 64ad64c are this PR's. #1055's decoding and record are on main since f9abe06, and main's kernelx.rs already has mirrors::decode_batches split from apply_batches, so 31fe59c is no longer needed. 64ad64c (alias::apply_page_mappings, the XCL_PAGE_ALIAS branch of q_copy_page_mappings in d3d12x/real.rs) is not on main; it is already in the amd-dev branch, which the amd-dev PRs build on. No other open PR makes it.
Notes from the diff: with the switch on, q_copy_page_mappings returns before main's record (apply_batches), which main's texture and tile code now reads, so those readers see no mappings under XCL_PAGE_ALIAS=1. And apply_page_mappings returns None after a failed map_one with the earlier pages of the call already remapped.
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:7304500922 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2308#issuecomment-7304500922). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T07:48:19Z. --- **Triage (#1607)** – head 64ad64c Stacked on #2307 (XCL_PAGE_ALIAS) and #1055; only `31fe59c` and `64ad64c` are this PR's. #1055's decoding and record are on main since f9abe06, and main's kernelx.rs already has `mirrors::decode_batches` split from `apply_batches`, so `31fe59c` is no longer needed. `64ad64c` (`alias::apply_page_mappings`, the XCL_PAGE_ALIAS branch of `q_copy_page_mappings` in d3d12x/real.rs) is not on main; it is already in the `amd-dev` branch, which the amd-dev PRs build on. No other open PR makes it. Notes from the diff: with the switch on, `q_copy_page_mappings` returns before main's record (`apply_batches`), which main's texture and tile code now reads, so those readers see no mappings under XCL_PAGE_ALIAS=1. And `apply_page_mappings` returns None after a failed `map_one` with the earlier pages of the call already remapped. 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/2308:upstream-pr/2308'
git switch 'upstream-pr/2308'

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