Skip to content

D3D12.X: the page budget sees textures in use by their T# in the view heaps - #782

Open
albertoglvn wants to merge 2 commits into
xcl-dev:mainfrom
albertoglvn:tsharp-use
Open

albertoglvn wants to merge 2 commits into
xcl-dev:mainfrom
albertoglvn:tsharp-use

Conversation

@albertoglvn

Copy link
Copy Markdown

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_index records which shared-heap SRV index a view of a placed texture was made at. referenced reads 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_x notes 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_heaps marks 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_lru takes textures whose T# is in no view heap first (any size, once 2 s old).
    • It passes over a texture whose pages are all shared with other mapped textures, since unmapping it frees nothing.
    • After a round that freed fewer tiles than wanted, the next waits 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).
  • Tests: 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

  • RTX 4060 Laptop 8 GB (driver 621.24), Ryzen 9 7940HS, Windows 11 build 26300, rustc 1.100.0, debug for the suite, release for the game
  • cargo test --workspace -- --test-threads=4 --skip test_title_runs_and_game_folder_is_untouched: 689 passed, 0 failed, 41 ignored
  • SKIPPED: gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware (no wave64)
  • Retail title, 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)):
    • Without the use signal, every eviction round freed 0 MB.
    • With it, 5547 textures were evicted and 1977 mapped again, with no missing or flickering textures while frames were drawn.
    • The out-of-memory stop moved from 63 s to 94 s. Frames still stopped at about 62 s: on 8 GB the pages that can't be freed are above what the card has room for, so this doesn't make the title fit an 8 GB card.
  • On this head commit, same budget:
    • Rounds freed 20, 32 and 32 MB between 36 s and 52 s, passing over about 100 textures each.
    • 3123 textures were evicted and 323 mapped again.
    • With EVICT_RETRY there was no pass-over storm: 60 presents per 2 s until 50 s.
    • Presents fell to under 5 per 2 s by 60 s, and the title stopped out of memory at 64.7 s, with target pages at 5903 MB. The earlier build's later stop (94 s) most likely came from submits slowed by the pass-overs, not from more memory freed.

Regression run

main:

xcl-smoke v1
commit: 64b3f35599bb7102f55d640e1a791e7d6dd3b175
gpu: NVIDIA GeForce RTX 4060 Laptop GPU
title: title-7952987A
seconds: 45
exit: 0x0
frames shown: 1068 (PresentX 1068)
presents per 2 s (last 3): 53 60 60
device removals: 0
crashes: 0
peak commit: 16533 MB

this PR's head:

xcl-smoke v1
commit: 4928ce58a33cc884c2dd448720b16ea8b5a5f2d5
gpu: NVIDIA GeForce RTX 4060 Laptop GPU
title: title-7952987A
seconds: 45
exit: 0x0
frames shown: 1092 (PresentX 1092)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16522 MB

Not tested

AI use

  • Claude Code with Claude Opus 5.5: wrote the patch, the tests and this description, and read the logs. I ran the game and checked the textures on screen.

🤖 Generated with Claude Code

LeonardoS11 and others added 2 commits November 23, 2026 23:43
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>
@mastrr9

mastrr9 commented Nov 24, 2026

Copy link
Copy Markdown

Independent native Windows NVIDIA RTX 5080 (16 GB) build/test run and code review at head 4928ce58a33cc884c2dd448720b16ea8b5a5f2d5.

Code Review Findings

Nice to see map_again now skipping released textures and re-inserting into EVICTED on remap failure! Two remaining edge cases spotted in the diff:

  1. Stale INDEX_RES mapping when a descriptor slot is reused for a non-placed resource (crates/xcl/src/hle/d3d12x/console_heap.rs, INDEX_RES / real.rs:1997):
    • dev_create_srv_x only calls console_heap::note_index(&slot, res as usize) when vram::is_placed_texture(res as usize) is true, and INDEX_RES has no removal path when a slot is overwritten or a resource is freed.
    • If a shared-heap SRV slot s.index previously held a placed texture R1 and is later overwritten with a non-placed image SRV R2 (or R1 is released and its COM address reused), w[3] >> 28 >= 8 still matches an image T# and referenced() continues mapping w[0] (s.index) back to R1.
    • Fix: When vram::tracking() is on and dev_create_srv_x creates a view for a non-placed or null resource, remove slot.index from INDEX_RES (and/or prune entries for resource in forget_pages).
  2. refresh_once still drops failed remaps from EVICTED (crates/xcl/src/hle/d3d12x/title_textures.rs, refresh_once):
    • Unlike map_again, the CPU-write revive loop in refresh_once calls super::vram::remap_if_unmapped(r) without checking its bool return value. If remapping fails, r was already removed from EVICTED by take_evicted, is never put back via evicted_again, and upload_all(todo) proceeds to upload into the still-unmapped reserved texture.
    • (Minor concurrency note in map_again: checking is_placed_texture(res) before ID3D12Resource::from_raw_borrowed(&p) still leaves a narrow TOCTOU window if another thread runs final Release between the check and remap_if_unmapped; grabbing a strong ID3D12Resource clone from TEXTURES under lock before calling remap_if_unmapped eliminates raw-pointer borrowing completely.)

Tested

  • Environment: NVIDIA GeForce RTX 5080 (16 GB, wave32, driver 617.42 / 32.0.16.1742), Windows 11 Pro 25H2 (26200.9974), rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC, DXC from Windows SDK 10.0.26100.0, debug build.
  • Command: cargo build --workspace && cargo test --workspace -- --test-threads=4
  • Result: 690 passed, 0 failed, 41 ignored (0 new warnings, 0 flakes).
  • PR-specific tests (4/4 ok):
    • hle::d3d12x::console_heap::tests::textures_are_referenced_by_the_heaps_their_t_is_in
    • hle::d3d12x::vram::tests::page_budget_takes_unseen_textures_first_and_passes_over_shared_pages
    • hle::d3d12x::vram::tests::page_budget_evicts_the_least_recently_touched_cpu_filled_texture
    • hle::d3d12x::title_textures::tests::a_texture_mapped_again_after_eviction_is_uploaded_even_if_unchanged
  • SKIPPED (2):
    • gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask (no wave64)
    • gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware (no wave64)

Not tested

  • D3D12 debug layer (d3d12SDKLayers.dll not installed on this host), AMD/wave64 hardware, XCL_PAGE_BUDGET_MB under a retail title, and release build.

AI use: Antigravity (Gemini 4 Neon) performed the code review, ran the RTX 5080 workspace tests, and drafted this comment.

@MesshM

MesshM commented Nov 24, 2026

Copy link
Copy Markdown

Test run of 4928ce58a33cc884c2dd448720b16ea8b5a5f2d5 on AMD RDNA4. I merged it onto current main d208e14 locally (clean merge) and tested that tree.

Tested

  • AMD Radeon RX 9060 XT 16 GB (RDNA4), driver 32.0.32029.2010; Ryzen 7 5700X, 64 GB RAM, Windows 11 Pro build 26200, Rust 1.100.0 stable-x86_64-pc-windows-msvc, debug
  • cargo build --workspace + cargo test --workspace -- --test-threads=4 on the merge: 708 passed, 0 failed, 41 ignored, exit code 0; xcl lib tests 667 passed, 0 failed, 21 ignored
  • 0 SKIPPED; page_budget_takes_unseen_textures_first_and_passes_over_shared_pages, page_budget_evicts_the_least_recently_touched_cpu_filled_texture and the T# tests pass.

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 XCL_SAMPLE_* tests, release build; the PR's head on its old base was not run, only its merge onto main.

Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.

@crosettiremi

crosettiremi commented Nov 24, 2026 •

Copy link
Copy Markdown

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:

Last sampled metric Baseline without #782 With #782
Cumulative texture evictions / remaps 5,214 / 663 4,709 / 56
Target pages / allocated pools, MB as logged 4,669 / 6,144 8,633 / 8,704
Process commit, MB as logged 24,885 28,117
Queued/active shader bytes, MiB 589 589

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.

@ArturoWolff

Copy link
Copy Markdown

Linux / RTX 4060 8 GB — what still occupies the texture-page pool

Tested: XCL beaa245ca04e212f064efc7cafcdce104bc5c0a2 plus the #640/#782 diff from head 4928ce58a33cc884c2dd448720b16ea8b5a5f2d5 and local, opt-in counting diagnostics. This was a local integration, not an unmodified PR-head build. GE-Proton 11-14, vkd3d-proton v3.1 with #775's dxil-spirv update, DXC 1.9.2609.5, RTX 4060 (8 GB), unpacked title 1.0.2.1. Cross-built the locked workspace for x86_64-pc-windows-gnullvm in release. Ran the title offline in the default Series X profile with XCL_PAGE_BUDGET_MB=4096, XCL_PSO_PRELOAD=0, XCL_ACTIVITY=1, and A scripted at 52 s.

  • The budget triggered and returned tiles, but the title still stopped advancing on the world-loading screen. The run with the pin-reason counter reached a 7,168 MiB pool snapshot and ended at the 205 s outer wall-clock limit. No controllable gameplay.
  • The pin-reason counter counted each physical page once, with precedence GPU-owned placement > GPU-written > untracked-view-only. At the 7,168 MiB pool snapshot, 3,171 MiB were pinned by GPU-owned placements, 5.4 MiB by GPU writes without a GPU-owned owner, and 0 MiB solely by untracked views. Untracked-view-only was zero in all seven snapshots. Loosening that pin alone would not have recovered pages in this run.
  • In a separate run with the owner counter, about 1,486 MiB of pages were temporarily shared exclusively by eviction candidates at a 6,656 MiB pool snapshot, but only 9 MiB were in that class at 7,168 MiB. At that later snapshot, pinned pages and pages referenced by shader-visible heaps accounted for 99.4% of the pool. A visible descriptor is not proof of sampling; the numbers are a census, not expected savings from collective eviction.

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 (gpt-6.2-sol) wrote and ran the local counting diagnostics and drafted this report from the verified measurements.

@iggyvilla

Copy link
Copy Markdown
Collaborator

Test run of 4928ce58a33cc884c2dd448720b16ea8b5a5f2d5 on AMD RDNA2 8 GB. Its merge base with main
is 3db536eb; I also built the top commit's parent 38bf6a32 (#640 alone) for the page-budget runs.

Tested

  • AMD Radeon RX 6650 XT (8 GB, RDNA2), driver 32.0.21045.29003; Ryzen 7 5700X, 32 GB, Windows 11 build
    26300; rustc 1.100.0 stable-x86_64-pc-windows-msvc
  • cargo build --release -p xcl and cargo build --workspace on the head: both exit 0 (one warning,
    a pre-existing fetch_update deprecation in xgameruntime)
  • cargo test --workspace --no-fail-fast -- --test-threads=4 on the head: 685 passed, 5 failed,
    41 ignored
    across 16 test targets (xcl lib: 645 / 5 / 21). 0 SKIPPED, so no GPU test was
    skipped on this card.
    • The 5 failures are placed_title_textures_share_vram_and_preserve_pixels (the known D3D12.X: map a one-slice title texture's packed mips where D3D12 addresses them #470
      mismatch: 3D 64x64x64 4 mips: subresource 2 mismatch; it fails alone too) and four PoisonError
      cascades that follow its panic: transitions_apply_when_their_list_is_submitted,
      d32s8_targets_take_their_own_size_of_video_memory,
      page_budget_evicts_the_least_recently_touched_cpu_filled_texture and
      page_budget_takes_unseen_textures_first_and_passes_over_shared_pages. Each of the four passes
      when rerun alone (--exact --test-threads=1); the new T# test passes on RDNA2.
  • Regression run, head first, then its merge base, 60 s each, XCL_NETWORK=0, no page budget. Both were
    built from clean detached worktrees of the same commit the block names.
xcl-smoke v1
commit: 4928ce58a33cc884c2dd448720b16ea8b5a5f2d5
gpu: AMD Radeon RX 6650 XT
title: retail
seconds: 60
exit: 0x0
frames shown: 406 (PresentX 410)
presents per 2 s (last 3): 0 55 45
device removals: 0
crashes: 0
peak commit: 10506 MB
xcl-smoke v1
commit: 3db536ebe231418d76e8d6e52ccee0b47330a522
gpu: AMD Radeon RX 6650 XT
title: retail
seconds: 60
exit: 0x0
frames shown: 387 (PresentX 391)
presents per 2 s (last 3): 0 46 22
device removals: 0
crashes: 0
peak commit: 10724 MB
xcl-smoke v1
commit: 38bf6a324ac3d11387b81592f3dd5fd6fe38ddac
gpu: AMD Radeon RX 6650 XT
title: retail
seconds: 60
exit: 0x0
frames shown: 398 (PresentX 403)
presents per 2 s (last 3): 0 46 27
device removals: 0
crashes: 0
peak commit: 10789 MB
xcl-smoke v1
commit: 4928ce58a33cc884c2dd448720b16ea8b5a5f2d5
gpu: AMD Radeon RX 6650 XT
title: retail
seconds: 60
exit: 0x0
frames shown: 403 (PresentX 407)
presents per 2 s (last 3): 1 44 29
device removals: 0
crashes: 0
peak commit: 10716 MB

The budget never engaged in either run: target pages peaked around 287 MB, pools at 320 MB, local
video memory around 1.8 GB, 0 evictions and 0 remaps in both logs, and the frame counts are within
noise of each other. This title (28872443D20A7) does not fill the placed pages in 60 s, unlike the
7952987A title in the description, so at 4096 MB the new code stays idle here.

  • To exercise the path in-game anyway, one more pair with an artificial XCL_PAGE_BUDGET_MB=256 (four
    pools), parent first, then the head, 60 s each:
xcl-smoke v1
commit: 38bf6a324ac3d11387b81592f3dd5fd6fe38ddac
gpu: AMD Radeon RX 6650 XT
title: retail
seconds: 60
exit: 0x0
frames shown: 305 (PresentX 310)
presents per 2 s (last 3): 0 0 0
device removals: 0
crashes: 0
peak commit: 11780 MB
xcl-smoke v1
commit: 4928ce58a33cc884c2dd448720b16ea8b5a5f2d5
gpu: AMD Radeon RX 6650 XT
title: retail
seconds: 60
exit: 0x0
frames shown: 404 (PresentX 408)
presents per 2 s (last 3): 0 48 32
device removals: 0
crashes: 0
peak commit: 10784 MB
  • D3D12.X: an optional page budget evicts CPU-filled title textures LRU #640 alone: two eviction rounds, 23 textures (11 MB back) at 45.5 s and 103 (33 MB back) at 56.3 s,
    215 textures evicted and 0 mapped again; the last three present samples are 0 0 0; pages 586 MB
    (pools 640 MB), local video memory 2588 MB.
  • This head: no eviction round fired at all (the textures the title samples are now seen in a
    shader-visible heap, so none is old enough to take), pages 287 MB (pools 320 MB), local video memory
    1841 MB, and still 48 and 32 presents per 2 s at the end.
  • So with the second use signal the title keeps presenting at a tight budget instead of stalling, and
    stays about 750 MB lower in local video memory (1841 vs 2588 MB); the budget is a soft cap in both
    (the pools go past it). It is one run each, so the frame difference is indicative rather than a
    repeated measurement. Since the head had no evictions here, the remap path (map_again) was not
    exercised in-game on this machine, only by the unit test.

Review

I read the top commit (4 files, +284/-24) line by line and checked each point below against the code at
this head. The structure is good: the second signal is derived at one place (referenced), the eviction
order change is one filter in evict_lru, and the map_again extraction removes a duplicate without
changing the submitted path.

  1. A T# copied into a view heap by CopyDescriptors(Simple) is not followed. console_heap.rs:436
    copy_words renumbers word 0 for an image to the destination's own PC index (w[0] = dst.index),
    but note_index is only called from dev_create_srv_x for placed textures (real.rs:1997). So after
    dev_copy_descriptors_simple_x/dev_copy_descriptors_x -> copy_console_slots -> copy_words, the
    destination slot names dst.index, which INDEX_RES has no entry for, and referenced() misses it.
    The texture is then seen only through its source slot; if that one is in a CPU-only heap it is
    Seen::CpuOnly, and seen (vram.rs:715) refreshes touched only for Visible, so it stays on the
    5 s / 4-tile rule and can be evicted while sampled; if the source slot is reused it becomes
    Seen::None and goes at 2 s. The module comment says titles copy views into the shader-visible heap,
    and this is exactly the sample-only case the PR targets, so I would add the destination index to
    INDEX_RES in copy_words (from the source index's entry) and in publish_range's path. It costs
    one map insert per copied image T#.
  2. EVICT_RETRY can take the pools past the budget. vram.rs:311 take_tile, at the budget, calls
    evict_lru, then pops free, then pops the oldest cooling tile, and only when both are empty falls
    through to CreateHeap; that last CreateHeap has no cap check. While the new 1 s hold
    (vram.rs:483) makes evict_lru return at once, a run that keeps allocating can create a new 64 MB
    pool during the hold. It is a soft cap today anyway (the 256 MB run's head reached 5 pools without
    one eviction round), but the retry makes the overshoot avoidable; consider a cap check before that
    CreateHeap, or reusing only cooled tiles.
  3. The hold is also set when the round passed over nothing. vram.rs:483 sets evict_after whenever
    freed < want, including a round with no candidates (everything younger than 2 s/5 s) or with
    shared == 0. Then the next second cannot evict although a texture may have crossed the age
    threshold. The cost the retry avoids is walking the same shared-passed-over candidates, so gating it
    on shared > 0 keeps the benefit and drops the needless hold.
  4. INDEX_RES has no removal path. The earlier review comment about this is right; the concrete
    gaps I confirmed: note_index is not called (and does not remove) when the same slot gets a view of
    a non-placed or null resource, and nothing prunes the index on release (vram::forget removes the
    target and the EVICTED entry only). A stale index keeps the old texture "in use" and can make
    seen pull it out of EVICTED and remap+upload it although the title no longer uses it, and the map
    grows for the whole session. Removing the entry when a slot is rewritten for a non-placed resource,
    and on release, closes it.
  5. The upload path ignores a failed remap. title_textures.rs:840 (D3D12.X: an optional page budget evicts CPU-filled title textures LRU #640 code, not this diff)
    take_evicted then remap_if_unmapped with the result dropped, and no evicted_again. That is the
    same failure this commit now handles in map_again: if the remap fails (out of memory - the 8 GB
    case), the texture leaves EVICTED unmapped and is never retried, so it reads as zeros for the rest
    of the run. Using evicted_again here too would make it consistent.

Checked and found fine: lock order - referenced takes INDEX_RES then HEAPS and there is no reverse
path (slot() takes HEAPS then GLOBAL; note_index takes only INDEX_RES); seen drops PAGES
before taking EVICTED; map_again never holds PAGES and TEXTURES at once. Reading the heap
shadows while title threads write them can tear a T#, but a texture seen at the previous look is at most
about 1 s old when evict_lru runs, below EVICT_UNSEEN_AGE (2 s), so one missed look does not evict a
texture that is in use. The Seen::CpuOnly handling itself is conservative: a T# in a CPU-only heap
cannot be sampled as it is, and it protects that texture from the 2 s rule only.

One limitation worth stating in the description: without the shared heap every placed texture that gets
an SRV is pinned (pin when note_index returns false), so the budget can evict almost nothing in that
mode. That is the safe choice, but it is a mode where the budget does not work.

Not tested

  • The retail title (7952987A) the description measures, where the budget and the remap actually engage;
    this machine's title does not fill the pages in 60 s.
  • Cards with more than 8 GB, Intel GPUs, and any other title.
  • The release build of the suite (the suite above is a debug build) and XCL_SAMPLE_* data.
  • Visual quality: the runs above are 60 s and read from logs only; I did not inspect frames for missing
    or flickering textures.

AI use

opencode with DeepSeek V4.1 Flash (opencode-go/deepseek-v4.1-flash) built the commits, ran the suite and
the smoke runs, read the logs, and wrote this report. It did not write or change any code.

@iggyvilla

Copy link
Copy Markdown
Collaborator

Code read of 4928ce5; nothing built or run. One point beyond the RDNA2 test report above (which covers the copy_words path, the failed remap in refresh_once and the INDEX_RES removal):

The stack is not a stack. The branch carries 38bf6a3, an older revision of #640 (current head 808a8a4: EVICT_IDLE instead of the older retry logic). git merge-tree of #640's head with this head conflicts in vram.rs and title_textures.rs, in either order. Please rebase 4928ce5 on #640's head so only the T# commit is left here.

AI use: Claude Code, Claude Sonnet 5.5, read the code at the head above and drafted this; a person checked it before posting.

burber added a commit to burber/xcl that referenced this pull request Nov 24, 2026
…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>
@Filip722

Filip722 commented Nov 24, 2026 •

Copy link
Copy Markdown

I independently reproduced the descriptor-copy issue reported above on the exact head 4928ce5. The synthetic test copies a tracked image SRV into a slot that already tracks a different texture. copy_words rewrites T# word 0 to the destination index, and the table still returns the old destination texture. The case then overwrites that slot with a buffer and checks that its image tracking is cleared.

I cross-built two isolated Windows MSVC release test binaries and ran hle::d3d12x::console_heap::tests::copied_texture_views_follow_the_destination_index --exact --nocapture under Proton Experimental 11.0-20261112 on Bazzite 44. The head with the added test recorded 0 passed and 1 failed. A local variant that copies the source index's tracking to the destination for an image and removes the destination tracking for a non-image recorded 1 passed and 0 failed. The test uses synthetic descriptor words and does not require a GPU.

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 47efa2e with #640, #793 and #820, Proton Experimental 11.0-20261112, vkd3d-proton v3.1 with #257 and dxil-spirv 1dc543f. Both used a 2,048 MiB page budget and 512 MiB coherent memory. The first run recorded 1,386 texture evictions and 21 remaps. Adding #782's top commit to the second build gave 3,951 evictions and 935 remaps, and the window displayed full loading artwork. Both runs still exited with a vkAllocateMemory access violation during loading. This was one pair of sequential runs using the same prefix and caches.

@RodrigoTorreao

Copy link
Copy Markdown

AMD RDNA2, retail title: with this PR the story loading artwork stays on screen under XCL_PAGE_BUDGET_MB=3072; without it (#640 alone) it goes black within seconds and never comes back. Same tree, same budget, same path through the menus. This confirms @requiemsnkrp's finding on #640 on a second vendor, and that this PR fixes it. @iggyvilla's RDNA2 runs above were 60 s in the menus, so they did not reach the loading screens.

Tested

run build, budget loading frames dumped with artwork black page pools at the end evicted / mapped again
A this PR + #640, 3072 MB 187 165 2 (fades) 9.6 GB 4,448 / 807
C #640 alone, 3072 MB 230 36 146 8.0 GB 3,907 / 77
B the same build as A, budget 0 90 74 2 (fades) 3.7 GB (ended at 170 s) –
  • In C the artwork appears, then the whole card turns black about 20 s into the load. It never comes back in the remaining ~3 min, which matches the 77 remaps.
  • In A it stays on until the run ends at 300 s, still in the load, where the title waits on driver compiles of compute pipelines.

What the budget does not do here

  • The cap is soft on this title, as @albertoglvn found.
    • The pools reached 9.6 GB against a 3 GB cap with this PR, and 8.0 GB with D3D12.X: an optional page budget evicts CPU-filled title textures LRU #640 alone.
    • Local video memory was 14.6 GB and 13.3 GB on a 12 GB card; peak commit was 42.7 GB and 40.7 GB.
    • With this PR, most candidates in each round were passed over because their pages were shared (up to 83 per round).
    • That agrees with @crosettiremi's pools above the budget. Remaps went the other way here, though: 807 with this PR against 77 without (theirs: 56 against 663). Here the artwork was mapped back again and again while it stayed on screen.
  • Menu frame rate: it was lower than usual in all three runs (about 14 – 29 fps), including B with the budget off, so I don't attribute it to either PR.

Not tested

  • Your heads as they are (they no longer merge with main).
  • More than one run per arm.
  • The world itself: no run got past the compile wait.
  • 8 GB cards.

AI use

  • Claude Code (Claude Opus 5.5) ported both commits onto main, built and tested the tree, ran the runs, and compared the dumped frames and the logs.
  • I played the runs and watched the screen.
  • The figures are copied from each run's xcl.log; the frame counts come from a script over the frame dumps, which I don't attach (game renders).

@DavidM1911

Copy link
Copy Markdown
Contributor

Verification on RTX 3060 Ti (Windows 11): merge conflict with current main — needs a rebase before it can be tested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

goal:world-load Bears on the retail title getting past world loading

Projects

None yet

Development

Successfully merging this pull request may close these issues.