Repository navigation
D3D12.X: the page budget sees textures in use by their T# in the view heaps - #782
albertoglvn wants to merge 2 commits into
Conversation
The title-texture pages (vram.rs) grow with every 64 KiB page of title memory a texture has ever covered: pool heaps are never released, and a title that recycles texture memory inside its own allocator gives no signal that the old textures are dead. On a retail title that streams its world this reached 9.7 GB of pages (13.7 GB of local video memory on a 12 GB card) and the driver paging stalls set off the title's watchdog. XCL_PAGE_BUDGET_MB caps the pool heaps. At the cap, take_tile evicts the least recently touched textures the CPU fills (placed through place_pages; never GPU-owned targets, never textures the GPU wrote, none under 4 tiles or touched in the last 5 s) and reuses their tiles. An evicted texture is mapped again and uploaded whole when its memory is written again or a submitted transition names it; its content hash is forgotten so the unchanged-upload skip does not leave it out. Unset or 0 keeps the current behaviour. Tests: page_budget_evicts_the_least_recently_touched_cpu_filled_texture (vram.rs, GPU) and a_texture_mapped_again_after_eviction_is_uploaded_even_if_unchanged (title_textures.rs). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… heaps A title that only samples a texture submits no transition for it, so the LRU order saw every such texture as unused since its placement. Once a second the console view heaps are looked at: a texture whose T# is in a shader-visible heap is recent, and an evicted one there is mapped again and uploaded before the title's next work. Textures whose T# is in no heap are evicted first; one whose pages are all shared with other mapped textures is passed over, and after a round that fell short the next waits a second. A texture that cannot be mapped again stays evicted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Independent native Windows NVIDIA RTX 5080 (16 GB) build/test run and code review at head Code Review FindingsNice to see
Tested
Not tested
AI use: Antigravity (Gemini 4 Neon) performed the code review, ran the RTX 5080 workspace tests, and drafted this comment. |
|
Test run of Tested
Review: Using the T# in the view heaps as a second use signal covers textures a title only samples and never transitions, which the budget of #640 otherwise saw as unused. At 517 lines I reviewed the structure, not every line; I could not check the eviction order on a title. Not tested: no retail title or regression run (I have no unpacked game), no Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code. |
|
Windows / RX 7900 XT results for 4928ce5 on a local integration with #640, #610 and the same compact compute preloader as the baseline. Both runs used device_type=anaconda, the same saved player profile and initial application caches, XCL_PAGE_BUDGET_MB=6144, and a 28 GiB Windows job private-commit cap. The driver cache was shared between runs. The #782 integrated workspace suite reported 741 passed, 0 failed, 41 ignored. One counted pass self-skipped for missing xgameruntime.dll. The two new heap-reference and eviction tests both ran and passed. At approximately 75 seconds after Player1's A press, while the title was still streaming:
With #782 the title exited at about 151 s process uptime with 0xc0000409, with zero device removals and no explicit allocation failure in the game log. The smoke summary's crash counter was zero despite that exit status. Without #782 the game continued longer and DRED later reported a GPU page fault at 0xd000. The new run ended before that point, so it cannot establish whether #782 changes the GPU fault. This is one run per configuration, with elapsed time aligned to the account selection rather than an identical stream of title requests. The data shows substantially fewer remaps in this workload, along with target pages above the configured budget under a constrained process. It may help to distinguish bytes pinned by visible references from other unevictable pages when evaluating the budget. The completed Windows job wrapper recorded a peak of 28,672 MiB for the #782 run, equal to its configured total limit. This is a whole-job high-water mark across the game and harness. The game log does not identify a failed allocation or the origin of 0xc0000409. |
|
Linux / RTX 4060 8 GB — what still occupies the texture-page pool Tested: XCL
Not tested: With-budget vs. no-budget performance under identical input and timing, visual correctness of a different eviction policy, full workspace test suite, or native Windows. All seven pin-reason snapshots reconciled to the physical tile total; four focused counting tests passed. AI use: Hermes Agent ( |
|
Test run of Tested
The budget never engaged in either run: target pages peaked around 287 MB, pools at 320 MB, local
ReviewI read the top commit (4 files, +284/-24) line by line and checked each point below against the code at
Checked and found fine: lock order - One limitation worth stating in the description: without the shared heap every placed texture that gets Not tested
AI useopencode with DeepSeek V4.1 Flash (opencode-go/deepseek-v4.1-flash) built the commits, ran the suite and |
|
Code read of The stack is not a stack. The branch carries AI use: Claude Code, Claude Sonnet 5.5, read the code at the head above and drafted this; a person checked it before posting. |
…t the budget; the GPU hang reproduced; unbounded compute waits compile on the title thread Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
I independently reproduced the descriptor-copy issue reported above on the exact head I cross-built two isolated Windows MSVC release test binaries and ran OpenAI Codex with GPT-6.2-Sol high assisted with the reproduction and report. Retail follow-up on the RTX 5060 Laptop GPU (8 GB, NVIDIA 615.78.08). I ran two offline Series X sessions on main |
|
AMD RDNA2, retail title: with this PR the story loading artwork stays on screen under Tested
What the budget does not do here
Not tested
AI use
|
|
Verification on RTX 3060 Ti (Windows 11): merge conflict with current |
The page budget of #640 orders CPU-filled textures by their last transition. A title that only samples a texture never submits a transition for it, so on the newer retail title (TitleID 7952987A) every CPU-filled texture on the pages looked unused since it was placed (measured in #640 (comment)). This gives the budget a second use signal: the T# in the console view heaps. Part of #333.
Stacked on #640; only the top commit belongs here.
What is in it
console_heap.rs:note_indexrecords which shared-heap SRV index a view of a placed texture was made at.referencedreads word 0 of every image T# in the view heaps and returns the textures named by a shader-visible heap, and those named only by CPU-only heaps. A T# keeps that index wherever the title copies it.real.rs:dev_create_srv_xnotes the index when the budget is on. A view in a heap outside the shared heap can't be followed, so its texture is pinned (never evicted).title_textures.rs: about once a second, before the title's work,look_at_view_heapsmarks those textures as used. Evicted ones found in a shader-visible heap are mapped again and uploaded whole.map_again(shared with the transition path) skips a texture released since it was taken from the evicted set, and keeps one that can't be mapped again evicted, so a later use retries it.vram.rs:evict_lrutakes textures whose T# is in no view heap first (any size, once 2 s old).EVICT_RETRY(1 s). Without this, every tile taken at the budget sorted and walked the same shared textures again (33 million pass-overs in one run).textures_are_referenced_by_the_heaps_their_t_is_in,page_budget_takes_unseen_textures_first_and_passes_over_shared_pages.Nothing changes without
XCL_PAGE_BUDGET_MB.Tested
cargo test --workspace -- --test-threads=4 --skip test_title_runs_and_game_folder_is_untouched: 689 passed, 0 failed, 41 ignoredSKIPPED:gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware(no wave64)XCL_PAGE_BUDGET_MB=4096, on an earlier local build of the same two changes plus measurement logging (details in D3D12.X: an optional page budget evicts CPU-filled title textures LRU #640 (comment)):EVICT_RETRYthere was no pass-over storm: 60 presents per 2 s until 50 s.Regression run
main:
this PR's head:
Not tested
Releaseand the hook forgetting its pages, a look at the heaps could still name itAI use
🤖 Generated with Claude Code