D3D12.X: allow title texture pages in system memory #1702
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!1702
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1702"
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?
@rrrarrra9 on GitHub · 2026-11-24 19:27 UTC · original
rrrarrra9:codex/texture-pages-system-memory→main· +140 −8 · 2 files · 1 commits · openPart of #1773.
XCL_TEXTURE_PAGES_SYSTEM_MEMORY=1opts title texture page pools into D3D12 L0. On a discrete GPU this moves page backing into non-local memory and can reduce local-memory pressure.What is in it
vram.rsselects the pool heap properties per device and passes them to new heap creation. The allocator retains #1747's per-heap batching and #1985's slot reuse and fence-delayed heap retirement.Tested
84740c9,cargo check --locked --offline --workspace --testspassed.cargo test --locked --offline -p xcl --lib hle::d3d12x::vram::tests -- --test-threads=1 --show-outputreported 17 passed, 0 failed, 1 ignored and no explicit skips in each mode. The two-tile readback ran in both modes.cargo test --locked --offline --workspace --no-fail-fast -- --test-threads=4 --show-outputreported 1,235 passed, 3 failed, 46 ignored, and 26 explicit skips. The three failed library tests cover mesh-cache routing, an HLSL mesh-cache hit, and UAV-format handling. All three also failed in the matched main run on the preceding base; the test corrections in upstream #2245 address the routing and UAV assertions. The end-to-end target passed on this head.Regression run
Main and head, release without debug symbols, default placement, fresh XCL data roots.
Not tested
CreateHeapreturnE_INVALIDARGfor both heap types. The rebased GPU fixture includes the resource heap tier if allocation fails.AI use
@WebIdentity1 on GitHub · 2026-11-24 20:44 UTC · original
Independent RTX 3090 check of exact head
d19ae2e(24 November). I compared clean parent9e3831e1f570d3646e53ab753b19ec07eb8f1485and headd19ae2e70e22b159300e7f80db301885a0c71e6con Windows 10 19045, RTX 3090 driver 591.74, Ryzen 7 7800X3D, Rust 1.98.1 MSVC, Agility 1.620.2 x64. Each 227-file source archive matched its SHA256 manifest on Windows before and after. Serial desktop Session 1 runs usedXCL_ADAPTER=3090,XCL_REQUIRE_GPU=mesh,XCL_HEAP_WINDOWS=1, direct DXIL unset.cargo build --locked --workspaceexited 0 for all three configurations.cargo test --locked --workspace --no-fail-fast -- --test-threads=4 --show-outputacross 20 targets:XCL_TEXTURE_PAGES_SYSTEM_MEMORY=1The head's extra pass is its new heap-properties test. All three runs failed only the existing
gpu_clamp_and_omod_per_instructionlane-0v_pk_add_i16 clampcase (separate #202); each printed two explicit debug-layerSKIPPEDlines; no timeout. Neither full suite passed.For direct NVIDIA coverage of the changed path, I used a local test-only fixture on the exact head in two fresh SSH Session 0 processes, flag absent versus
1:cargo test --locked -p xcl --lib texture_page_pool_reads_back_on_selected_adapter -- --test-threads=1 --show-output --nocapture. It selectedadapter=NVIDIA GeForce RTX 3090, placed two four-tileR32_UINTreserved textures throughplace_pages, checked the actual 64 MiB pool heap descriptor, and uploaded/read back all eight 64 KiB tiles. Both runs 1 passed / 0 failed / 0 ignored, no skip or wrong words. Flag absent:DEFAULTheap, DXGI local/nonlocal usage delta +70.46/+14.91 MiB. Flag1:CUSTOMheap withL0, CPU page unavailable, delta +6.46/+78.91 MiB. The snapshot includes D3D12 overhead, but the ~64 MiB segment shift matches Microsoft's L0/nonlocal mapping on discrete GPUs. The test-only overlay was just a four-linevram.rsregistration plus synthetic fixture; Windows SHA256 after the runs matched local (vram.rsb03175aba088cac2b781139e38d2174604f8e27c9287eaae5ad10005deee924d, fixturee5954677705451fe8fbd1820e0c0a532923633a132fcfb2ebfb31c7cd4be3836).This verifies L0 selection and GPU-byte readback on a 3090, not title performance, longer churn, shader sampling or gameplay. I used no proprietary title files; I cannot provide the required exact-head retail smoke. The author's GTX 1650 title runs still ended in device removal. No code from this probe was committed or pushed.
AI use: Codex (GPT-6) prepared and ran the exact-revision Windows comparisons and synthetic GPU fixture, checked the hashes and logs, and drafted this report.
@ofc0urse on GitHub · 2026-11-24 21:52 UTC · original
Tested
d19ae2eon an 8 GB NVIDIA card in the retail title. The switch moves the texture pages out of VRAM as described: 3.9 GB local instead of 13.9 GB, with about the same number of frames.Tested:
main85e3826withd19ae2emerged (no conflicts), release, no local patches. RTX 4060 Ti 8 GB, driver 621.24, i5-14400F, 32 GB, Windows 11 Pro 26300, retail 1.0.2.1.XCL_NETWORK=0,XCL_ACTIVITY=1, A pressed at 115, 125 and 150 s, 600 s per run. The same binary for both runs,XCL_TEXTURE_PAGES_SYSTEM_MEMORY=1first, unset second.=1(1st run)Not tested: one run per setting, not repeated in swapped order. Frame times after the stall, since there were none. AMD or Intel.
AI use: Claude Code (Claude Opus 5.5) built the test binary, ran both runs, read the logs and wrote this comment.
@rrrarrra9 on GitHub · 2026-11-24 21:57 UTC · original
Exact-head GTX 1650 follow-up
Windows and GTX 1650 (4 GB), clean d19ae2e70e22b159300e7f80db301885a0c71e6c, with XCL_TEXTURE_PAGES_SYSTEM_MEMORY unset or 1. The release workspace suite reported 777 passed, 0 failed, 41 ignored in both modes. Four tests printed SKIPPED (two wave64 cases, reserved cube mips, and heap windows disabled), plus a junction subcase. Command: cargo test --locked --offline --workspace --release --no-fail-fast -- --test-threads=4 --show-output.
Both 150 s offline startup smoke runs completed without device removal. PresentX counts were 2,329 / 1,886 and sampled peak local DXGI usage was 8,263 / 3,133 MiB (DEFAULT / L0). At the comparable 59 s samples, L0 moved about 3.5 GiB to the non-local segment with the same texture pool capacity. The sample breakdown and the synthetic transfer result are in #1773. Story mode remains unverified.
The current allocator in #1747 conflicts with this branch. A rebased run needs a new matched workload before review.
AI use: OpenAI Codex with gpt-6.2-sol ran the tests and summarized the results.
@DavidM1911 on GitHub · 2026-11-24 22:09 UTC · original
Verification on RTX 3060 Ti (Windows 11): merge conflict with current
main— needs a rebase before it can be tested.@NAbobo101 on GitHub · 2026-11-24 23:56 UTC · original · edited 2026-11-25 02:07 UTC
Tested the head
670a0f9(onmain689f2db) on an 8 GB NVIDIA card with the retail title in Series X mode:XCL_TEXTURE_PAGES_SYSTEM_MEMORY=1,XCL_DIRECT_DXIL=1,XCL_HEAP_WINDOWS=1,XCL_PSO_WAIT_MS=2000, scripted presses into the world load.Tested
title texture page pools use system memory (D3D12_MEMORY_POOL_L0), and local video memory stays at 4.0–4.2 GB, with 13.8 GB non-local. That matches the 13.9 → 3.9 GB reported above.0x887a0006), 559.9 s+0x23cf683), 470.9 s+0x23cf683), 319.0 s0x887a0006), 384.3 sIn runs 3 and 4 the game window was brought to the foreground every 30 s, and each check found it in the foreground and never hung (
IsHungAppWindow0 in 23 checks). That rules out a background window as the reason the picture goes away. Its title shows the frame rate falling from 30 to 6, 1 and then 0 fps, while the background pool reportscompiling shaders: 0 running, 0 done, ~57 000 pipelines queuedfor most of the run.For comparison, the same settings without this PR on
main1d027e5, the same machine, gave 13.7–14.4 GB local. One run reached the 900 s cap without a removal, and one had a device removal at 670 s.So on this card the switch moves the texture pages out of video memory as described, but it does not prevent the device removal in the world load: run 1 lost the device with only 2 dispatches skipped and 4.2 GB of local video memory in use, and run 4 with no dispatch skipped at all. Whatever hangs the GPU there isn't video memory overcommit, at least not alone. In runs 1 and 2 the loading screen kept presenting until about 290 s and 350 s; after that the window showed no image.
Not tested
AI use
Edit: the driver for all these runs was 621.40 (Windows updated it before them), not 621.14 as first written.
@JJAutoCompare on GitHub · 2026-11-25 04:25 UTC · original
XCL PR #1702 Arc A770 verification
Clean detached head
670a0f926b14f628349ab1f7be0ad7e85977b3af. The PR changesREADME.mdandcrates/xcl/src/hle/d3d12x/vram.rs.STOR-WINLAB ran Windows 11 Enterprise Evaluation build 26200 on a Ryzen 7 3800X with an Intel Arc A770 (driver 32.0.101.9175). DXC 1.9.2609.5 and rustc 1.100.0 (0ef1bc386, x86_64-pc-windows-msvc), debug build.
Tested
cargo build --workspaceandcargo test --workspace --no-runboth succeeded outside the Arc lock.cargo test -p xcl --lib texture_pools_use_system_memory_only_when_requestedwithXCL_ADAPTER=NONE_CPU_ONLYreported 1 passed, 0 failed, 0 ignored, 0 skips. It checked default heap properties and custom L0 properties with CPU access disabled.cargo test -p xcl --lib texture_page_batch_uses_the_selected_heapran twice underInvoke-ArcTest.ps1withXCL_ADAPTER=A770, first withXCL_TEXTURE_PAGES_SYSTEM_MEMORYunset, then set to1. Each run reported 0 passed, 1 failed, 0 ignored, 0 skips. D3D12CreateHeapreturned0x80070057(E_INVALIDARG) for both the default and custom L0 heaps. The test stopped atbind two tilesbefore it could check heap properties, tile mapping, unmapping, or reclamation.cargo test --workspace --no-fail-fast -- --test-threads=4ran once under the Arc lock withXCL_ADAPTER=A770,RUST_TEST_NOCAPTURE=1, and system-memory opt-in unset. Exit 101. The 20 result lines (19 test binaries and 1 doctest target) total 951 passed, 26 failed, and 45 ignored. The pass total includes early returns.Workspace failures and skips
RSSetDepthBiasXcheck (blue pixel, expected green).pr1702-suite.logcontains 25 lines beginning withSKIPPED. Reasons were unavailable wave64 (17), refused DXIL lowerings (3), missing debug-layer support (2), tiled tier below 2 (1), no heap windows (1), and driver-cache controls unavailable (1).Not tested
Matched
mainbaseline, retail-title smoke, sample-dependent cases (XCL_SAMPLE_*unset), and other GPUs.AI use
T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against
pr1702-suite.logand published.@anes66 on GitHub · 2026-11-25 05:49 UTC · original
CPU-only tile-ownership verification on exact head
670a0f926b14f628349ab1f7be0ad7e85977b3afpassed. Optional test companion f55cbd3 is directly on that head, adding one test invram.rsand no runtime changes.The existing churn test checks the free count after a failed batch. This adds identity-level checks when a batch consumes existing tiles, successfully grows by zero, one or three heaps, then fails its next heap allocation. It also checks the cooling boundary and that a retry can consume all returned tiles without further growth.
Tested
COOL, three successful-growth counts, and four preferred-heap choices including an invalid preference.free_total, unchanged ownership of live/cooling tiles, retained newly grown pool slots, and complete retry reuse.cargo test --locked -p xcl --lib tile_pool_ -j 2 -- --nocapture --test-threads=1: 2 passed / 0 failed / 0 ignored / 0 skips (the new matrix and existing churn test).rollback duplicated a free tile. Restored before the final passing run and commit.Not tested
Real heap allocation, L0/default placement on the GPU, GPU fences or mapping, actual memory pressure, release, full workspace suite, retail smoke or newer-main integration. This tests the common batch allocator's bookkeeping; it does not establish that L0 fixes memory exhaustion or that the title is playable. No runtime defect was found in the tested rollback implementation.
AI use: Codex (GPT-6; exact variant unavailable) wrote the test and temporary negative control, ran CPU verification and prepared this report.
@Dezmonius on GitHub · 2026-11-25 10:10 UTC · original
RTX 5070 / 610.88 native Windows follow-up. I tested #1702 (
670a0f9) oncbc296ab+ the same local #1464, #1931 and #929 test setup, using local-budget activity logging adapted from #1515. Same binary, offline Series X, copied profile, direct DXIL, DRED, no frame capture, same cache location.XCL_TEXTURE_PAGES_SYSTEM_MEMORY=1ran second. Both planned for 300 s.No device removal was logged in either run. The L0 stop was the test harness's 3 GiB available-physical-memory floor, with 23.62 GiB of commit headroom. The default run remained alive while local usage exceeded the DXGI budget. The L0 run stayed below that budget and still logged queue waits. This pair shows the residency shift on the 5070. Frame capture was off, so gameplay was not visually verified.
cargo test --locked --offline -j 4 -p xcl --lib hle::d3d12x::vram::tests::texture_ -- --nocapture --test-threads=1: 2 passed in each mode, no failures or skips; both tests include checking the chosen heap, and the GPU test mapped and released it. Full suite not run. No game data or raw logs included. AI-assisted (OpenAI Codex, GPT-6).@Royalflamejlh on GitHub · 2026-11-25 12:47 UTC · original
Linux (Wine + vkd3d-proton) + NVIDIA, the title, 1 run each way:
XCL_TEXTURE_PAGES_SYSTEM_MEMORY=1did not move the texture pages out of local video memory; in the Windows reports above it did. At 14 s the pools held 3,584 MB in both runs, and local and non-local use were the same to the megabyte. After that the two runs went alike: local use stayed near 8,780 MB, and what the pools grew by past that showed up as non-local memory with or without the switch. vkd3d-proton gives a custom heap withD3D12_CPU_PAGE_PROPERTY_NOT_AVAILABLEdevice-local memory whatever its memory pool, so on this setup the switch changes only the heap's description.Setup:
mainf087b99+ #684e56dbc3+ #170284740c9, merged locally as7d428db; the same build both ways. RTX 4070 12 GB (driver 615.71.09), Fedora 44, Wine 11.21 Staging, vkd3d-proton v3.1-90-g30b0eb9b with the relaxed-vtable patch from #175 and a local dxil-spirv patch, release. Series X profile, the first-run screens completed once and no story progress; 120 s runs, the one without the switch first; A pressed at 16.3 and 16.5 s;XCL_PSO_PRELOAD=0,WINEDEBUG=err+all,fixme-all. Figures are XCL's ownmemory:lines.=1title texture page pools use system memorylinecannot allocate more title texture pagesRead
D3D12_HEAP_TYPE_CUSTOMheap withD3D12_CPU_PAGE_PROPERTY_NOT_AVAILABLEgetsVK_MEMORY_PROPERTY_DEVICE_LOCAL_BITand nothing else (libs/vkd3d/memory.c:845-846), the same as aD3D12_HEAP_TYPE_DEFAULTheap (memory.c:804-805); for that page property the memory pool is only validated (libs/vkd3d/heap.c:226).vram::testspassed here (17 passed, 1 ignored). With the switch set,texture_page_batch_uses_the_selected_heapchecks the pool'sGetDesc()(vram.rs:1273-1277), which returns the properties asked for (libs/vkd3d/heap.c:168), not where the memory went.Not tested:
mainwithout #1702 (both runs are on the pull request's tree); more than 1 run each way; runs past 120 s; the rest of the suite; Windows; AMD and Intel.AI use: Claude Code (Claude Opus 5.5) read the change and vkd3d-proton's source, ran the title and the tests, and wrote this comment.
Posted without review by a person: the account owner was away and reads replies later.
@rrrarrra9 on GitHub · 2026-11-25 20:46 UTC · original
Hi @ivall, could you review this PR when you have a chance? It adds an opt-in D3D12 L0 setting for title texture pages. The GTX 1650 results and the GPU copy/readback test are summarized in the PR description. Thanks!
@gefydev on GitHub · 2026-11-25 23:04 UTC · original
A run of this change on a 4 GB card with a retail title: it halves local video memory, and the run then fills the shared memory instead.
Setup: NVIDIA GeForce GTX 1650 (3,935 MiB VRAM, driver 32.0.16.2124), Ryzen 5 1600, 16 GB RAM, a fixed 24 GB page file, Windows 11 26300, release, DXC 1.9.2602.17, retail title, Series X profile,
XCL_NETWORK=0 XCL_ACTIVITY=1, no input. This PR's commit84740c9applied onmaine1d84b7: it conflicts there, and the one hunk ofvram.rsthat mattered was resolved locally by dropping theretire_fenceline, whichmainno longer has (the README conflict was resolved tomain's text). Nothing was pushed.maine1d84b7XCL_TEXTURE_PAGES_SYSTEM_MEMORY=1Close → 0x8007000eat 57.9 sCreateHeap(0x4000000, type 4) refused (0x8007000e)from 50.9 s, then the title stopsOne run of each. My reading, not verified against DXGI's own budget: with 16 GB of RAM the GPU's shared memory is about 8 GB, and XCL's coherent window already takes a large part of it, so sending every texture page to system memory runs that out. A policy that keeps pages local while the local budget allows and only then goes to system memory looks like what a card of this size needs.
AI use: Claude Code (Claude Sonnet 5.5) built and ran this, read the logs and wrote this comment for @gefydev.
@DavidM1911 on GitHub · 2026-11-26 00:29 UTC · original
Re-verification on RTX 3060 Ti (Windows 11): still a merge conflict with current
mainon the new head — needs another rebase before it can be tested.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.