Memory: defer GPU tiles for private physical page storage #1906

Open
CallMeBrado wants to merge 1 commit from upstream-pr/1916 into main
CallMeBrado commented 2026-11-24 23:03:33 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by CallMeBrado on 2026-11-24T23:03:33Z.


A DirectStorage transfer can fill a physical page before the title maps it anywhere the GPU can use it. XCL currently allocates a GPU tile at the page's home address as soon as the CPU needs backing. In two 60-second runs on the same title, the sparse pool peaked at 896 MiB on main and 320 MiB with deferred tiles enabled. Peak process commit fell from 14,596 to 13,947 MiB.

What is in it

  • Add an opt-in setting, XCL_DEFER_PRIVATE_HOME_TILES=1. Keep CPU-only sparse page homes private until mapped. When exposing a page, upload its existing bytes even if an earlier write-watch scan already consumed the write.
  • Add a GPU regression test with two populated pages and an untouched page between them. It covers mapping a single page, then a mixed range, and checks the bytes after GPU readback.

Tested

  • Windows 11 Pro build 26200, Ryzen 9 9950X3D, GeForce RTX 5090, NVIDIA driver 621.24, rustc 1.96.0 MSVC. Release title runs and debug workspace tests.
  • cargo build --locked --workspace and cargo build --locked --release -p xcl passed. cargo test --locked --workspace --no-fail-fast -- --test-threads=4 --show-output reported 972 passed, 4 failed and 45 ignored.
  • The four failures were gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0 through _3. The same seeds (70, 545, 1019, 1507) fail on clean main 689f2db on this adapter. All four report 0x8007000E from CreateComputePipelineState.
  • With the option enabled for the entire process, the kernelx and sparse-memory test groups had 50 passes, 0 failures and 2 ignored.
  • The regression test failed against the old implementation at the first allocation check. Two writes had mapped two 64 KiB GPU tiles. The patch mapped zero before exposure. GPU readback matched the two payloads and zero-filled middle page after resetting write-watch.
  • Matching 60-second release runs, each with its own copy of the same title profile and an empty shader cache. Peak mapped sparse memory was 838 MiB on main and 314 MiB on this branch. Both had zero failed DirectStorage requests.
Adapter skips reported by the workspace tests
  • gpu::recomp::lower::tests::a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu (no wave64)
  • gpu::recomp::lower::tests::coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu (no wave64)
  • gpu::recomp::lower::tests::cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu (no wave64)
  • gpu::recomp::lower::tests::the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu (no wave64)
  • gpu::recomp::lower_dxil::tests::a_per_lane_2d_or_3d_group_runs_on_the_gpu (no wave64)
  • gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's)) / f16 arithmetic, wave64: no wave64 / f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's)) / f16 packed, wave64: no wave64)
  • gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu (f32 arithmetic, wave64: no wave64 / f32 compares, wave64: no wave64 / f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's)) / f32 conversions, wave64: no wave64 / f32 rounding, wave64: no wave64 / f32 three-source, wave64: no wave64 / f32 transcendentals, wave64: no wave64)
  • gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu (f64, wave64: no wave64)
  • gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu (integer arithmetic, wave64: no wave64 / integer carries, wave64: no wave64)
  • gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask (no wave64)
  • gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware (no wave64)
  • heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows)
  • test_title_draws_with_a_root_signature_under_the_debug_layer (no xgameruntime.dll)

Regression run

Main

xcl-smoke v1
commit: 689f2db477c3c062cf162649781640ef8a977c18
gpu: NVIDIA GeForce RTX 5090
title: 419239bf
seconds: 60
exit: 0x0
frames shown: 1553 (PresentX 1553)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14596 MB

This branch, with deferred tiles enabled

xcl-smoke v1
commit: e2aa856010a637d33adc2cf8b49766da91574747
gpu: NVIDIA GeForce RTX 5090
title: 419239bf
seconds: 60
exit: 0x0
frames shown: 1595 (PresentX 1595)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13947 MB

Not tested

AMD and Intel GPUs, Wine, title-specific XCL_SAMPLE_* fixtures, and gameplay beyond the 60-second startup run.

AI use

OpenAI Codex (GPT-6) isolated the change from a local build, wrote the test, ran the checks, and drafted this description.

<!-- greyfinch-sync:ivall/xcl:issue:5481808141 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1916). Originally posted by [CallMeBrado](https://github.com/CallMeBrado) on 2026-11-24T23:03:33Z. --- A DirectStorage transfer can fill a physical page before the title maps it anywhere the GPU can use it. XCL currently allocates a GPU tile at the page's home address as soon as the CPU needs backing. In two 60-second runs on the same title, the sparse pool peaked at 896 MiB on main and 320 MiB with deferred tiles enabled. Peak process commit fell from 14,596 to 13,947 MiB. **What is in it** - Add an opt-in setting, `XCL_DEFER_PRIVATE_HOME_TILES=1`. Keep CPU-only sparse page homes private until mapped. When exposing a page, upload its existing bytes even if an earlier write-watch scan already consumed the write. - Add a GPU regression test with two populated pages and an untouched page between them. It covers mapping a single page, then a mixed range, and checks the bytes after GPU readback. **Tested** - Windows 11 Pro build 26200, Ryzen 9 9950X3D, GeForce RTX 5090, NVIDIA driver 621.24, rustc 1.96.0 MSVC. Release title runs and debug workspace tests. - `cargo build --locked --workspace` and `cargo build --locked --release -p xcl` passed. `cargo test --locked --workspace --no-fail-fast -- --test-threads=4 --show-output` reported 972 passed, 4 failed and 45 ignored. - The four failures were `gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0` through `_3`. The same seeds (70, 545, 1019, 1507) fail on clean main `689f2db` on this adapter. All four report `0x8007000E` from `CreateComputePipelineState`. - With the option enabled for the entire process, the kernelx and sparse-memory test groups had 50 passes, 0 failures and 2 ignored. - The regression test failed against the old implementation at the first allocation check. Two writes had mapped two 64 KiB GPU tiles. The patch mapped zero before exposure. GPU readback matched the two payloads and zero-filled middle page after resetting write-watch. - Matching 60-second release runs, each with its own copy of the same title profile and an empty shader cache. Peak mapped sparse memory was 838 MiB on main and 314 MiB on this branch. Both had zero failed DirectStorage requests. <details> <summary>Adapter skips reported by the workspace tests</summary> - `gpu::recomp::lower::tests::a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu` (no wave64) - `gpu::recomp::lower::tests::coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu` (no wave64) - `gpu::recomp::lower::tests::cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu` (no wave64) - `gpu::recomp::lower::tests::the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu` (no wave64) - `gpu::recomp::lower_dxil::tests::a_per_lane_2d_or_3d_group_runs_on_the_gpu` (no wave64) - `gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu` (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's)) / f16 arithmetic, wave64: no wave64 / f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's)) / f16 packed, wave64: no wave64) - `gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu` (f32 arithmetic, wave64: no wave64 / f32 compares, wave64: no wave64 / f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's)) / f32 conversions, wave64: no wave64 / f32 rounding, wave64: no wave64 / f32 three-source, wave64: no wave64 / f32 transcendentals, wave64: no wave64) - `gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu` (f64, wave64: no wave64) - `gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu` (integer arithmetic, wave64: no wave64 / integer carries, wave64: no wave64) - `gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask` (no wave64) - `gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware` (no wave64) - `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows) - `test_title_draws_with_a_root_signature_under_the_debug_layer` (no xgameruntime.dll) </details> **Regression run** Main ``` xcl-smoke v1 commit: 689f2db477c3c062cf162649781640ef8a977c18 gpu: NVIDIA GeForce RTX 5090 title: 419239bf seconds: 60 exit: 0x0 frames shown: 1553 (PresentX 1553) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14596 MB ``` This branch, with deferred tiles enabled ``` xcl-smoke v1 commit: e2aa856010a637d33adc2cf8b49766da91574747 gpu: NVIDIA GeForce RTX 5090 title: 419239bf seconds: 60 exit: 0x0 frames shown: 1595 (PresentX 1595) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 13947 MB ``` **Not tested** AMD and Intel GPUs, Wine, title-specific `XCL_SAMPLE_*` fixtures, and gameplay beyond the 60-second startup run. **AI use** OpenAI Codex (GPT-6) isolated the change from a local build, wrote the test, ran the checks, and drafted this description.
Melow-code commented 2026-11-24 23:10:40 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Melow-code on 2026-11-24T23:10:40Z.

Review: APPROVED


896→320 MiB peak sparse pool is a strong win. The opt-in flag is the right approach since deferred allocation changes the fault pattern.

<!-- greyfinch-sync:ivall/xcl:review:6048873810 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1916#pullrequestreview-6048873810). Originally posted by [Melow-code](https://github.com/Melow-code) on 2026-11-24T23:10:40Z. **Review:** APPROVED --- 896→320 MiB peak sparse pool is a strong win. The opt-in flag is the right approach since deferred allocation changes the fault pattern.
Filip722 commented 2026-11-25 00:09:05 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Filip722 on 2026-11-24T23:52:58Z.


On an RTX 5060 Laptop GPU (8 GiB, driver 615.78.08), the Series S startup trace shows a smaller sparse pool with this option. Bazzite 44, Proton Experimental 11.0-20261112, XCL main 20cf130 plus the two-plane presenter from #615. The second executable added e2aa856 and used XCL_DEFER_PRIVATE_HOME_TILES=1. The runs started with separate copies of the same title settings and caches. No compiler ran alongside either title process.

Observed before the VRAM cutoff Control Deferred
Peak sparse pool 4,736 MiB 4,288 MiB
Peak mapped sparse memory 4,734 MiB 4,266 MiB
Storage requests 9,764 9,767
Failed requests 0 0

Both runs composited two planes. I stopped both when free VRAM stayed below 640 MiB for two samples. The window captures were still black. Neither run logged an NVIDIA Xid. This pair covers startup on one low-VRAM setup. Separately, the CPU-write / map / GPU-readback regression passed on this adapter in a composite build of the earlier main.

OpenAI Codex assisted with the builds, tests and report.

<!-- greyfinch-sync:ivall/xcl:comment:7147899195 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1916#issuecomment-7147899195). Originally posted by [Filip722](https://github.com/Filip722) on 2026-11-24T23:52:58Z. --- On an RTX 5060 Laptop GPU (8 GiB, driver 615.78.08), the Series S startup trace shows a smaller sparse pool with this option. Bazzite 44, Proton Experimental 11.0-20261112, XCL main `20cf130` plus the two-plane presenter from #615. The second executable added `e2aa856` and used `XCL_DEFER_PRIVATE_HOME_TILES=1`. The runs started with separate copies of the same title settings and caches. No compiler ran alongside either title process. | Observed before the VRAM cutoff | Control | Deferred | | --- | ---: | ---: | | Peak sparse pool | 4,736 MiB | 4,288 MiB | | Peak mapped sparse memory | 4,734 MiB | 4,266 MiB | | Storage requests | 9,764 | 9,767 | | Failed requests | 0 | 0 | Both runs composited two planes. I stopped both when free VRAM stayed below 640 MiB for two samples. The window captures were still black. Neither run logged an NVIDIA Xid. This pair covers startup on one low-VRAM setup. Separately, the CPU-write / map / GPU-readback regression passed on this adapter in a composite build of the earlier main. OpenAI Codex assisted with the builds, tests and report.
futurepro62 commented 2026-11-25 00:09:13 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T23:54:45Z.


Full-suite run, since this PR has no test report yet. Tested exact head e2aa856 (on its base 689f2db).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::dxil::fuzz_tests: 967 passed, 0 failed, 43 ignored. SKIPPED (no wave64): a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu, a_per_lane_2d_or_3d_group_runs_on_the_gpu, coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu, cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu, gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware, the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu.
  • The new tests ran and passed: private_physical_pages_reach_the_gpu_on_mapping.
  • Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1: 976 passed, 0 failed, 45 ignored. SKIPPED: f16_programs_on_the_gpu (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), f32_programs_on_the_gpu (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), f32_programs_on_the_gpu (f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • --skip leaves out tests that fail on main 62265d3 too, not because of this PR. On NVIDIA: heap_window_out_of_memory_falls_back_to_the_switch_form (#1651) and the four gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu tests (follow-up on #1651) fail because runner::skip_test turns their skips into failures under XCL_REQUIRE_GPU=mesh, and gpu::dxil::fuzz_tests seeds 70, 545, 1019 and 1507 fail CreateComputePipelineState with E_OUTOFMEMORY on this card (drivers 616.64 and 621.40). On AMD: fuzz_validate_and_gpu_1 fails on seed 540 (res[833] 0x7 vs CPU 0x6). The AMD run does not set XCL_REQUIRE_GPU.

Not tested

  • a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
<!-- greyfinch-sync:ivall/xcl:comment:7147930878 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1916#issuecomment-7147930878). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-24T23:54:45Z. --- Full-suite run, since this PR has no test report yet. Tested exact head `e2aa856` (on its base `689f2db`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::dxil::fuzz_tests`: **967 passed, 0 failed, 43 ignored**. SKIPPED (no wave64): `a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu`, `a_per_lane_2d_or_3d_group_runs_on_the_gpu`, `coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu`, `cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu`, `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`, `the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu`. - The new tests ran and passed: `private_physical_pages_reach_the_gpu_on_mapping`. - Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, `XCL_ADAPTER=radeon`), `cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1`: **976 passed, 0 failed, 45 ignored**. SKIPPED: `f16_programs_on_the_gpu` (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), `f16_programs_on_the_gpu` (f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), `f16_programs_on_the_gpu` (f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), `f16_programs_on_the_gpu` (f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), `f32_programs_on_the_gpu` (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), `f32_programs_on_the_gpu` (f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). - `--skip` leaves out tests that fail on main `62265d3` too, not because of this PR. On NVIDIA: `heap_window_out_of_memory_falls_back_to_the_switch_form` (#1651) and the four `gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu` tests ([follow-up on #1651](https://github.com/xcl-dev/xcl/issues/1651#issuecomment-7146069648)) fail because `runner::skip_test` turns their skips into failures under `XCL_REQUIRE_GPU=mesh`, and `gpu::dxil::fuzz_tests` seeds 70, 545, 1019 and 1507 fail `CreateComputePipelineState` with `E_OUTOFMEMORY` on this card (drivers 616.64 and 621.40). On AMD: `fuzz_validate_and_gpu_1` fails on seed 540 (`res[833]` 0x7 vs CPU 0x6). The AMD run does not set `XCL_REQUIRE_GPU`. **Not tested** - a release build, a game (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
thehollowedone commented 2026-11-25 01:10:39 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-25T00:19:05Z.


Independent check of e2aa856 on an RTX 3080 Ti (621.35), Windows 11 build 26300 and Rust 1.99.1 MSVC. I extended only the synthetic test. A 64 KiB storage write allocated no GPU tile before mapping. The first map used an explicit sparse address distinct from the page’s home, and all 65,536 bytes matched GPU readback there. I then wrote a different pattern through the mapped page, moved it home, reset write-watch there, and verified all 65,536 updated bytes by GPU readback again.

cargo test --offline --locked --release -p xcl --lib private_physical_pages_reach_the_gpu_on_mapping -- --nocapture --test-threads=1 passed 1/1 with zero skips. The original home-only assertions ran as well. This check used no retail input and did not measure title memory or world-load time.

AI-assisted. Codex (GPT-6 family, exact variant unavailable) extended the fixture, ran the test, and drafted this report.

<!-- greyfinch-sync:ivall/xcl:comment:7148382522 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1916#issuecomment-7148382522). Originally posted by [thehollowedone](https://github.com/thehollowedone) on 2026-11-25T00:19:05Z. --- Independent check of [`e2aa856`](https://github.com/xcl-dev/xcl/commit/e2aa856010a637d33adc2cf8b49766da91574747) on an RTX 3080 Ti (621.35), Windows 11 build 26300 and Rust 1.99.1 MSVC. I extended only the synthetic test. A 64 KiB storage write allocated no GPU tile before mapping. The first map used an explicit sparse address distinct from the page’s home, and all 65,536 bytes matched GPU readback there. I then wrote a different pattern through the mapped page, moved it home, reset write-watch there, and verified all 65,536 updated bytes by GPU readback again. `cargo test --offline --locked --release -p xcl --lib private_physical_pages_reach_the_gpu_on_mapping -- --nocapture --test-threads=1` passed 1/1 with zero skips. The original home-only assertions ran as well. This check used no retail input and did not measure title memory or world-load time. AI-assisted. Codex (GPT-6 family, exact variant unavailable) extended the fixture, ran the test, and drafted this report.
raylitebull commented 2026-11-25 01:10:56 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-25T00:55:47Z.


Code review on e2aa856:

  • DEFER_PRIVATE_HOME_TILES (XCL_DEFER_PRIVATE_HOME_TILES=1) cleanly tracks SparseHome::CpuOnly vs Exposed in Away::sparse_homes, commits tiles and queues title_textures::rescan_cpu_backing for contiguous private runs on MapTitlePhysicalPages, and deduplicates the rescanned dirty pages in refresh_once. Default behavior when unset is unchanged.
  • Both CI checks are green, @Melow-code has approved, and multiple NVIDIA GPUs have verified e2aa856.

What is still needed before merge: Independent AMD verification on e2aa856 (private_physical_pages_reach_the_gpu_on_mapping + smoke) to satisfy dual-vendor coverage.

<!-- greyfinch-sync:ivall/xcl:comment:7149034368 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1916#issuecomment-7149034368). Originally posted by [raylitebull](https://github.com/raylitebull) on 2026-11-25T00:55:47Z. --- Code review on `e2aa856`: - `DEFER_PRIVATE_HOME_TILES` (`XCL_DEFER_PRIVATE_HOME_TILES=1`) cleanly tracks `SparseHome::CpuOnly` vs `Exposed` in `Away::sparse_homes`, commits tiles and queues `title_textures::rescan_cpu_backing` for contiguous private runs on `MapTitlePhysicalPages`, and deduplicates the rescanned dirty pages in `refresh_once`. Default behavior when unset is unchanged. - Both CI checks are green, `@Melow-code` has approved, and multiple NVIDIA GPUs have verified `e2aa856`. **What is still needed before merge:** Independent **AMD** verification on `e2aa856` (`private_physical_pages_reach_the_gpu_on_mapping` + smoke) to satisfy dual-vendor coverage.
DavidM1911 commented 2026-11-25 03:05:39 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T02:24:56Z.


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:7150689215 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1916#issuecomment-7150689215). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T02:24:56Z. --- 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!
pickles976 commented 2026-11-25 15:08:10 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by pickles976 on 2026-11-25T15:06:53Z.


Independent Wine verification on unmodified PR head e2aa856010a637d33adc2cf8b49766da91574747. No other PRs or local source patches were included in this check.

Tested

  • RTX 4060 Laptop, 8 GiB VRAM; Intel i7-13620H; 16 GiB system RAM; NVIDIA 590.48.01; Linux 6.17.0-40-generic, Wine 11.0, DXVK 3.1.1-209 and stock vkd3d-proton 3.2.0 (2576c0b4adfae4a, vtable assertions not disabled).
  • Rust 1.98.1, debug test build, cross-compiled for x86_64-pc-windows-msvc with Windows SDK libraries and executed through the Wine Cargo runner:
    XCL_REQUIRE_GPU=mesh cargo +1.98.1 test -p xcl --lib --target x86_64-pc-windows-msvc private_physical_pages_reach_the_gpu_on_mapping -- --test-threads=1 --nocapture
    
  • 1 passed, 0 failed, 0 ignored; no GPU skip. The nested process reports the same test, not a second independent case. The NVIDIA adapter was selected. The fixture's deferred-allocation and GPU-readback assertions passed, including the populated pages/zero-filled middle page after consumed write-watch notifications.

Not tested
Full workspace suite, native Windows, AMD/Intel, or a title on this exact head. This is synthetic memory-correctness coverage, not a claim of title VRAM savings or playability.

AI use
omp with openai-codex/gpt-6-astra prepared the isolated checkout, cross-built and ran the test, and drafted this report from its output.

<!-- greyfinch-sync:ivall/xcl:comment:7166324267 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1916#issuecomment-7166324267). Originally posted by [pickles976](https://github.com/pickles976) on 2026-11-25T15:06:53Z. --- Independent Wine verification on **unmodified PR head `e2aa856010a637d33adc2cf8b49766da91574747`**. No other PRs or local source patches were included in this check. **Tested** - RTX 4060 Laptop, 8 GiB VRAM; Intel i7-13620H; 16 GiB system RAM; NVIDIA 590.48.01; Linux 6.17.0-40-generic, Wine 11.0, DXVK 3.1.1-209 and stock vkd3d-proton 3.2.0 (`2576c0b4adfae4a`, vtable assertions not disabled). - Rust 1.98.1, debug test build, cross-compiled for `x86_64-pc-windows-msvc` with Windows SDK libraries and executed through the Wine Cargo runner: ```sh XCL_REQUIRE_GPU=mesh cargo +1.98.1 test -p xcl --lib --target x86_64-pc-windows-msvc private_physical_pages_reach_the_gpu_on_mapping -- --test-threads=1 --nocapture ``` - **1 passed, 0 failed, 0 ignored; no GPU skip.** The nested process reports the same test, not a second independent case. The NVIDIA adapter was selected. The fixture's deferred-allocation and GPU-readback assertions passed, including the populated pages/zero-filled middle page after consumed write-watch notifications. **Not tested** Full workspace suite, native Windows, AMD/Intel, or a title on this exact head. This is synthetic memory-correctness coverage, not a claim of title VRAM savings or playability. **AI use** omp with `openai-codex/gpt-6-astra` prepared the isolated checkout, cross-built and ran the test, and drafted this report from its output.
crastinator commented 2026-11-25 16:25:43 +00:00 (Migrated from github.com)

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

Review: COMMENTED


AMD run, as asked: RX 6700 XT (RDNA2) under Wine. With XCL_DEFER_PRIVATE_HOME_TILES=1, the sparse pools stay at 320 MB through a retail title's world load. On main they grow from 896 MB to 1856 MB. The texture pages still fill the 12 GB card, so it alone does not get through.

main this PR, knob on
sparse pools at 24 s / 60 s / last 896 / 1152 / 1856 MB 320 / 320 / 320 MB
local at 60 s 8693 MB 8106 MB
card full 87 s 73 s (texture pages grew faster in this run; not from this PR as far as I can tell)

Stacked with #1182 and #2306, the load stays at 5.8 GB local. The README conflict with main was the only one, and I kept both texts. Head e2aa856.

Tested (head e2aa856, merged onto main 06c9f55, no conflicts unless noted)

  • AMD Radeon RX 6700 XT 12 GB (RDNA2, gfx1031, RADV, Mesa 26.3.1), Ryzen 7 5700X, 16 GB RAM, Linux 7.3.5 (CachyOS)
  • proton-cachyos 11.0-20261015 Wine, vkd3d-proton v3.1 + #257's patch (dxil-spirv 53aac418 from #775), DXVK v3.1.1-97 dxgi
  • release build, XCL_COHERENT_MB=512 (the 4095 MB learned window is ~1 fps here, #284), XCL_ACTIVITY=1
  • A retail title from a cold start: it goes from the menus into its world load at about 50 s. Numbers are the activity log's memory: line; "card full" means sysfs mem_info_vram_used reached 11.5 GB, where my guard stops the run (a full card has crashed the compositor here before).

Not tested

  • cargo test under Wine: these were title runs only.
  • Storage I/O correctness beyond "no new warning kinds compared with main".

AI use

  • Claude Code (Claude Opus 5.5) merged, built and ran this and wrote the report; I checked the results.
<!-- greyfinch-sync:ivall/xcl:review:6061125391 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1916#pullrequestreview-6061125391). Originally posted by [crastinator](https://github.com/crastinator) on 2026-11-25T16:25:43Z. **Review:** COMMENTED --- AMD run, as asked: RX 6700 XT (RDNA2) under Wine. With `XCL_DEFER_PRIVATE_HOME_TILES=1`, the sparse pools stay at 320 MB through a retail title's world load. On `main` they grow from 896 MB to 1856 MB. The texture pages still fill the 12 GB card, so it alone does not get through. | | `main` | this PR, knob on | |---|---|---| | sparse pools at 24 s / 60 s / last | 896 / 1152 / 1856 MB | 320 / 320 / 320 MB | | local at 60 s | 8693 MB | 8106 MB | | card full | 87 s | 73 s (texture pages grew faster in this run; not from this PR as far as I can tell) | Stacked with #1182 and #2306, the load stays at 5.8 GB local. The README conflict with `main` was the only one, and I kept both texts. Head `e2aa856`. **Tested** (head `e2aa856`, merged onto `main` `06c9f55`, no conflicts unless noted) - AMD Radeon RX 6700 XT 12 GB (RDNA2, gfx1031, RADV, Mesa 26.3.1), Ryzen 7 5700X, 16 GB RAM, Linux 7.3.5 (CachyOS) - proton-cachyos 11.0-20261015 Wine, vkd3d-proton v3.1 + #257's patch (dxil-spirv `53aac418` from #775), DXVK v3.1.1-97 `dxgi` - release build, `XCL_COHERENT_MB=512` (the 4095 MB learned window is ~1 fps here, #284), `XCL_ACTIVITY=1` - A retail title from a cold start: it goes from the menus into its world load at about 50 s. Numbers are the activity log's `memory:` line; "card full" means sysfs `mem_info_vram_used` reached 11.5 GB, where my guard stops the run (a full card has crashed the compositor here before). **Not tested** - `cargo test` under Wine: these were title runs only. - Storage I/O correctness beyond "no new warning kinds compared with `main`". **AI use** - Claude Code (Claude Opus 5.5) merged, built and ran this and wrote the report; I checked the results.
brainhay5 commented 2026-11-28 21:50:57 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by brainhay5 on 2026-11-28T21:50:57Z.


Independent retail memory check on RTX 5070 Ti 16 GB (Blackwell) — e2aa856, parent 689f2db

Not a duplicate of @futurepro62's run above: that was the workspace suite on the same GPU. This is a retail-title memory measurement with matched arms.

One release binary of the head, XCL_DEFER_PRIVATE_HOME_TILES off vs on, arms interleaved off/on/off/on, 70 s each via XCL_RUN_SECONDS=70. RTX 5070 Ti 16 GB, driver 32.0.16.1088, Ryzen 7 5800X3D, 64 GB RAM, Windows 11 22631. Title 1.0.2.1 (TitleId 7952987A), XCL_NETWORK=0, XCL_PREPARE=0, XCL_ACTIVITY=1, press-A every 3 s. Figures are the peak of the memory: line from host.rs over each run.

arm process commit video memory local target pages sparse pools mapped
off-1 30,376 MB 14,304 MB 9,514 MB 2,048 MB 2,020 MB
on-1 29,354 MB 12,581 MB 9,499 MB 320 MB 314 MB
off-2 31,152 MB 14,376 MB 9,538 MB 2,048 MB 2,021 MB
on-2 27,893 MB 12,330 MB 9,439 MB 320 MB 314 MB

The sparse pool falls 2,048 → 320 MB and lands on the same value in both repeats. Mapped follows it (2,020 → 314 MB). Process commit and local video memory fall with it, while target pages and pool capacity do not change — the allocation is postponed, not the accounting.

Worth setting next to the 8 GiB laptop case above (4,736 → 4,288 MiB): here the reduction is 1,728 MB. That is consistent with the deferral removing allocations the title would otherwise make, with the smaller case bounded by free-VRAM pressure (those runs were stopped below 640 MiB free) rather than by the mechanism.

Tested

  • Flag off vs on, one binary, two repeats each, interleaved.
  • Retail memory accounting at 70 s.

Not tested

  • World rendering. This title is still in its front end at 70 s on this base; loading art and present counts would not be evidence of it.
  • The GPU regression test in this PR, and #3123's write-after-exposure path (0x5b).
  • Any AMD GPU — which @raylitebull notes is still the outstanding requirement for dual-vendor coverage. This result does not fill that gap.

Limits

16 GB VRAM is above #3211's 6–8 GiB target, so this is a higher-memory control, not target coverage. The head is DIRTY against current main, which has since moved 514 commits and merged nvidia-dev, so this qualifies the head against its documented parent only and says nothing about current main.

Independent tester, no code changes.

<!-- greyfinch-sync:ivall/xcl:comment:7246317832 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1916#issuecomment-7246317832). Originally posted by [brainhay5](https://github.com/brainhay5) on 2026-11-28T21:50:57Z. --- **Independent retail memory check on RTX 5070 Ti 16 GB (Blackwell) — `e2aa856`, parent `689f2db`** Not a duplicate of @futurepro62's run above: that was the workspace suite on the same GPU. This is a retail-title memory measurement with matched arms. One release binary of the head, `XCL_DEFER_PRIVATE_HOME_TILES` off vs on, arms interleaved off/on/off/on, 70 s each via `XCL_RUN_SECONDS=70`. RTX 5070 Ti 16 GB, driver 32.0.16.1088, Ryzen 7 5800X3D, 64 GB RAM, Windows 11 22631. Title 1.0.2.1 (TitleId `7952987A`), `XCL_NETWORK=0`, `XCL_PREPARE=0`, `XCL_ACTIVITY=1`, press-A every 3 s. Figures are the peak of the `memory:` line from `host.rs` over each run. | arm | process commit | video memory local | target pages | sparse pools | mapped | | --- | ---: | ---: | ---: | ---: | ---: | | off-1 | 30,376 MB | 14,304 MB | 9,514 MB | **2,048 MB** | 2,020 MB | | on-1 | 29,354 MB | 12,581 MB | 9,499 MB | **320 MB** | 314 MB | | off-2 | 31,152 MB | 14,376 MB | 9,538 MB | **2,048 MB** | 2,021 MB | | on-2 | 27,893 MB | 12,330 MB | 9,439 MB | **320 MB** | 314 MB | The sparse pool falls 2,048 → 320 MB and lands on the same value in both repeats. Mapped follows it (2,020 → 314 MB). Process commit and local video memory fall with it, while **target pages and pool capacity do not change** — the allocation is postponed, not the accounting. Worth setting next to the 8 GiB laptop case above (4,736 → 4,288 MiB): here the reduction is 1,728 MB. That is consistent with the deferral removing allocations the title would otherwise make, with the smaller case bounded by free-VRAM pressure (those runs were stopped below 640 MiB free) rather than by the mechanism. **Tested** - Flag off vs on, one binary, two repeats each, interleaved. - Retail memory accounting at 70 s. **Not tested** - World rendering. This title is still in its front end at 70 s on this base; loading art and present counts would not be evidence of it. - The GPU regression test in this PR, and #3123's write-after-exposure path (`0x5b`). - Any AMD GPU — which @raylitebull notes is still the outstanding requirement for dual-vendor coverage. This result does not fill that gap. **Limits** 16 GB VRAM is above #3211's 6–8 GiB target, so this is a higher-memory control, not target coverage. The head is DIRTY against current `main`, which has since moved 514 commits and merged `nvidia-dev`, so this qualifies the head against its documented parent only and says nothing about current `main`. Independent tester, no code changes.
Foniass commented 2026-12-01 07:05:13 +00:00 (Migrated from github.com)

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


Triage (#1607) – head e2aa856

#3123 is a port of this PR (its description says so): the same XCL_DEFER_PRIVATE_HOME_TILES / SparseHome change, built on nvidia-dev. This PR came first and has test and smoke results, so #3123 is the duplicate. The 45-46 lines shared with #3099, #3111, #3112, #3335, #3361, #3547 and #3554 come from amd-dev, which already contains this change; main does not.
One point for the rebase: main now has kernelx.rs:commit_homes_ahead, which calls sparse::committed for homes it commits ahead. This branch does not handle it, so with the option on those homes would still get GPU tiles at once (#3123 handles it).
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:7303628836 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1916#issuecomment-7303628836). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T07:05:13Z. --- **Triage (#1607)** – head e2aa856 #3123 is a port of this PR (its description says so): the same `XCL_DEFER_PRIVATE_HOME_TILES` / `SparseHome` change, built on nvidia-dev. This PR came first and has test and smoke results, so #3123 is the duplicate. The 45-46 lines shared with #3099, #3111, #3112, #3335, #3361, #3547 and #3554 come from amd-dev, which already contains this change; main does not. One point for the rebase: main now has `kernelx.rs`:`commit_homes_ahead`, which calls `sparse::committed` for homes it commits ahead. This branch does not handle it, so with the option on those homes would still get GPU tiles at once (#3123 handles it). 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/1916:upstream-pr/1916'
git switch 'upstream-pr/1916'

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