Memory: defer GPU tiles for private physical page storage #1916
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1916
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1916"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@CallMeBrado on GitHub · 2026-11-24 23:03 UTC · original
CallMeBrado:perf/defer-private-home-tiles→main· +126 −18 · 4 files · 1 commits · openA 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
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.Tested
cargo build --locked --workspaceandcargo build --locked --release -p xclpassed.cargo test --locked --workspace --no-fail-fast -- --test-threads=4 --show-outputreported 972 passed, 4 failed and 45 ignored.gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0through_3. The same seeds (70, 545, 1019, 1507) fail on clean main689f2dbon this adapter. All four report0x8007000EfromCreateComputePipelineState.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
This branch, with deferred tiles enabled
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.
@Filip722 on GitHub · 2026-11-24 23:52 UTC · original
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
20cf130plus the two-plane presenter from #615. The second executable addede2aa856and usedXCL_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.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 on GitHub · 2026-11-24 23:54 UTC · original · edited 2026-11-25 00:09 UTC
Full-suite run, since this PR has no test report yet. Tested exact head
e2aa856(on its base689f2db).Tested
cargo build --workspace, thenXCL_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.private_physical_pages_reach_the_gpu_on_mapping.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).--skipleaves out tests that fail on main62265d3too, not because of this PR. On NVIDIA:heap_window_out_of_memory_falls_back_to_the_switch_form(#1651) and the fourgpu::recomp::lower_dxil::tests::*_programs_on_the_gputests (follow-up on #1651) fail becauserunner::skip_testturns their skips into failures underXCL_REQUIRE_GPU=mesh, andgpu::dxil::fuzz_testsseeds 70, 545, 1019 and 1507 failCreateComputePipelineStatewithE_OUTOFMEMORYon this card (drivers 616.64 and 621.40). On AMD:fuzz_validate_and_gpu_1fails on seed 540 (res[833]0x7 vs CPU 0x6). The AMD run does not setXCL_REQUIRE_GPU.Not tested
AI use
@thehollowedone on GitHub · 2026-11-25 00:19 UTC · original
Independent check of
e2aa856on 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=1passed 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 on GitHub · 2026-11-25 00:55 UTC · original
Code review on
e2aa856:DEFER_PRIVATE_HOME_TILES(XCL_DEFER_PRIVATE_HOME_TILES=1) cleanly tracksSparseHome::CpuOnlyvsExposedinAway::sparse_homes, commits tiles and queuestitle_textures::rescan_cpu_backingfor contiguous private runs onMapTitlePhysicalPages, and deduplicates the rescanned dirty pages inrefresh_once. Default behavior when unset is unchanged.@Melow-codehas approved, and multiple NVIDIA GPUs have verifiede2aa856.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 on GitHub · 2026-11-25 02:24 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
@pickles976 on GitHub · 2026-11-25 15:06 UTC · original
Independent Wine verification on unmodified PR head
e2aa856010a637d33adc2cf8b49766da91574747. No other PRs or local source patches were included in this check.Tested
2576c0b4adfae4a, vtable assertions not disabled).x86_64-pc-windows-msvcwith Windows SDK libraries and executed through the Wine Cargo runner: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-astraprepared the isolated checkout, cross-built and ran the test, and drafted this report from its output.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.