Skip to content

D3D12.X: XCL's render-target arenas and window pools get a residency priority - #3156

Merged
throny merged 1 commit into
xcl-dev:mainfrom
Raul-Paiva:d3d12x/residency-priorities
Dec 1, 2026
Merged

throny merged 1 commit into
xcl-dev:mainfrom
Raul-Paiva:d3d12x/residency-priorities

Conversation

@Raul-Paiva

@Raul-Paiva Raul-Paiva commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

On an 8 GB card a retail title's world holds about 16 GB of local video memory against a 7.25 GB DXGI budget (10 GB with XCL_TEXTURE_LEVEL_PAGES=1 XCL_SPARSE_LAZY=1). Windows then demotes allocations to system memory with no hint which ones matter, so per-frame render targets and the title's buffers can be paged out while idle texture pages stay resident. XCL never calls ID3D12Device1::SetResidencyPriority on its own heaps; #3007 does it only for the GPU_UPLOAD segment under XCL_UMA_DRIVER=mixed, and this builds on the rest.

With XCL_RESIDENCY_PRIORITY=1 (off by default so it can be measured first) XCL's own heaps get a priority by role, once; nothing runs per frame. By default vram::place puts a render target or depth buffer on texture pages, not in an arena (andrewDoing's measurement), so a 64 MiB texture page pool gets HIGH once it holds pages of a render target, depth buffer or UAV texture; a pool of only sampled textures stays at the default. Related: the "residency under a budget" work in #2688 and #3098 (evicting texture mips): this does not evict anything, it only tells Windows what to demote last.

What is in it

  • crates/xcl/src/hle/d3d12x/vram.rs:
    • HeapRole (target arena, window pool, texture pages holding a target, other texture pages), pages_role and the pure mapping role_priority: the first three HIGH, other texture pages NORMAL (the default, no call); nothing MAXIMUM, which stays D3D12.X: XCL_UMA_UPLOAD_PRIORITY=1 keeps a mixed window's GPU_UPLOAD segment resident (nvidia-dev) #3007's.
    • set_heap_priority behind the switch, called from arena_heap and alloc_pool_heap; a failure is logged once and leaves the default; the heaps given HIGH are counted by role and logged at each power of two of the total.
    • Pages::keep_pools: when a target is mapped onto texture pages (place_on_pages, and remap_if_unmapped when a superseded target comes back), the pools holding its pages get HIGH, each pool once (newly_high); a reclaimed pool's slot forgets it.
    • unit tests role_priority_keeps_targets_and_windows_over_texture_pages and a_target_on_texture_pages_gets_its_pools_high_once.
  • crates/xcl/src/hle/d3d12x/sparse.rs: a new sparse-window tile pool gets HIGH; a retired pool taken back keeps the priority it got.

Tested

  • Hardware: RTX 3070 Laptop GPU 8 GB, driver 621.40, i7-11800H, 32 GB, Windows 10 19045, rustc 1.100.0, release build.
  • Base for the comparison: main 5b0d5fa (same commands, same machine). The head pushed here is the same change rebased onto main 9dfbe3e without conflicts; main's newer commits also change vram.rs, which the rebase merged. CI on this head stopped with an access violation (0xc0000005) in the lib test binary while eh::tests::the_process_ends_while_another_thread_holds_the_heap was running, a test of code this PR does not touch (it changes only sparse.rs and vram.rs); I cannot rerun it from my side. The test counts below were measured before that rebase.
  • On the previous head 2a96db1 (the same change on main d52ff48), the lib tests of the modules this PR touches (hle::d3d12x::sparse, hle::d3d12x::vram), release, serial, with the 20 skips: 199 passed, 0 failed, 2 ignored.
  • cargo test --release --workspace --no-fail-fast -- --test-threads=4: the lib test binary ends early on main too (exit 0x80004005 after sparse upload preparation still failed after bounded retries), so the lib was also run alone, serially (--test-threads=1), with --skip for the 20 tests that end the binary on main (6 list_x, 12 sparse, 1 texture_upload, 1 uma_driver; each passes alone).
  • This PR tested at 7cf99beb (on main 5b0d5fa):
    • integration tests: 138 passed, 1 failed, 20 ignored; main: 139 passed, 0 failed, 20 ignored. The failure, gpu_two_pass_cache_e2e::two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs ("releasing the title PSOs releases their two-pass state", 1 vs 0), is intermittent on main too: run 8 times alone, it failed 2 times on this head and 2 times on main.
    • lib, serial with the 20 skips: 2605 passed, 13 failed, 29 ignored; main: 2604 passed, 13 failed, 29 ignored. The 13 failures are main's except that vram::d32s8_targets_take_their_own_size_of_video_memory (which fails on main in the long run) ended the binary here instead and was skipped, and alloc_pool::tests::a_reset_that_puts_the_allocator_aside_keeps_what_the_gpu_still_reads failed. The first passes alone 2/2 on this head and on main; the second passes alone 3/3 on main and failed the same way in the serial run of D3D12.X: DRED's VA 0 output follows the device state it comes with #3119, whose change does not reach it. The first needs about 1 GB of depth targets and depends on what the run before left in video memory.
    • The suite does not set XCL_RESIDENCY_PRIORITY, so the change is off there; the two new unit tests pass.
  • SKIPPED on this adapter (same on main): the wave64 forms (no wave64), three f16/f32 per-lane forms refused by the recompiler, and the heap-window tests (no heap windows).

Regression run
scripts/smoke.ps1 -Seconds 120 -Title 'retail title A', release builds of clean trees, one after the other on the machine in Tested, with XCL_DEVICE_TYPE=lockhart XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_WATCH_HOT=0 XCL_DRED=1 XCL_GPU_WAIT_TIMEOUT_MS=60000. The title is left on its own, with no input; the shader cache was warmed by two runs of main before.

main:

xcl-smoke v1
commit: 9dfbe3ea6653a9c76ef3ea0d66187a4b5407483b
gpu: NVIDIA GeForce RTX 3070 Laptop GPU
title: retail title A
seconds: 120
exit: 0x0
frames shown: 3362 (PresentX 3362)
presents per 2 s (last 3): 60 61 60
device removals: 0
crashes: 0
peak commit: 16519 MB

This PR:

xcl-smoke v1
commit: 813778957e7acdb610e7d79fdddf682a4a899716
gpu: NVIDIA GeForce RTX 3070 Laptop GPU
title: retail title A
seconds: 120
exit: 0x0
frames shown: 3360 (PresentX 3360)
presents per 2 s (last 3): 61 60 61
device removals: 0
crashes: 0
peak commit: 16556 MB

Not tested

  • A world run with the switch on vs off, and how many heaps get HIGH in it.
  • Eviction under a budget, frame times.
  • AMD and Intel GPUs, cards with more than 8 GB.

AI use

  • Claude Code (Claude Opus 5.5) wrote the change, the tests and this description, and ran the tests; I read the diff.

🤖 Generated with Claude Code

@andrewDoing

Copy link
Copy Markdown
Contributor

On an RTX 5070, enabling residency priority alone issued no HIGH request for the three target placements I tested. All three went through tiled texture pages under the default backing policy. Forcing arena backing supplied a positive control: the native driver accepted HIGH for each of the three arena heaps.

I tested exact head 599a31dc95214c06f3f6d71e93318bb17fa76532, native Windows, RTX 5070 12 GB, NVIDIA 616.92. Each fresh process called production vram::place for three live, nonoverlapping 256×256 single-sample targets: RGBA8 render target, D32_FLOAT depth target, and R32_UINT UAV. Test-only logging recorded the heap role on creation and the result of each actual SetResidencyPriority call. I also checked the arena registry and individual tile mappings after each placement.

Backing policy Priority switch Observed backing Native HIGH calls
Default 0 All three in texture pages, four tiles each 0
Default 1 Same; one new pool classified TexturePages 0
XCL_VRAM_ARENAS=1 0 Three distinct target arenas 0
XCL_VRAM_ARENAS=1 1 Three distinct target arenas 3 successful

For the proposed world-load comparison, counting target placements by actual backing would help interpret an on/off result: a hot render or depth target can share a default-priority texture-page pool on this adapter. This was a bounded placement test, four passes and zero skips. It did not exercise sparse-window buffer pools or measure OS eviction order, residency under pressure, frame time, or a retail workload.

AI use: OpenAI Codex (GPT-6) prepared the test-only fixture, ran the native controls, and wrote this report.

@Prime1997
Prime1997 changed the base branch from nvidia-dev to main November 28, 2026 20:13
@Raul-Paiva
Raul-Paiva force-pushed the d3d12x/residency-priorities branch from 599a31d to a067891 Compare November 30, 2026 00:12
@github-actions github-actions Bot added area:d3d12 D3D12.X runtime, command lists, resources, sparse memory area:memory Virtual/physical memory, arenas, VRAM budget, UMA gpu:both Code affects both AMD and NVIDIA GPUs (scope tag; see needs:*-test for remaining checks) labels Nov 30, 2026
@Raul-Paiva

Copy link
Copy Markdown
Contributor Author

Thanks @andrewDoing, the placement test and the arena control made this clear. Confirmed: vram::place puts a target on texture pages (place_on_pages) unless XCL_VRAM_ARENAS=1 is set or the target cannot be reserved, and those 64 MiB pools were NORMAL, so with the default backing the switch gave HIGH to no target.

What changed (amended into the single commit; rebased onto main, head now a067891d):

  • a texture page pool holding pages of a render target, depth buffer or UAV texture now gets HIGH when the target is mapped onto it (place_on_pages, and remap_if_unmapped when a superseded target comes back), once per pool and never per frame; a pool of only sampled textures stays NORMAL, and a reclaimed pool's slot forgets it
  • nothing changes with the switch off, and no placement moves; still no MAXIMUM (that stays D3D12.X: XCL_UMA_UPLOAD_PRIORITY=1 keeps a mixed window's GPU_UPLOAD segment resident (nvidia-dev) #3007's)
  • the heaps given HIGH are counted by role (arenas, window tile pools, texture page pools holding targets) and logged at each power of two of the total, as you suggested, so a world run can say how many got it
  • unit tests: role_priority covers the new role, and a new test checks that render, depth and UAV flags give their pools HIGH, each pool once

The full suite was run against main (counts in the description, no new failure); the world run with the switch off/on and the smoke runs are still to come.

Written with Claude Code (Claude Opus 5.5).

@Raul-Paiva
Raul-Paiva force-pushed the d3d12x/residency-priorities branch 2 times, most recently from 15d8246 to 2a96db1 Compare November 30, 2026 07:31
@github-actions github-actions Bot added the needs-pr-check Failing the PR description check (CONTRIBUTING.md) label Nov 30, 2026
@Raul-Paiva
Raul-Paiva marked this pull request as ready for review November 30, 2026 08:10
@github-actions github-actions Bot removed the needs-pr-check Failing the PR description check (CONTRIBUTING.md) label Nov 30, 2026
…priority

On an 8 GB card a retail title's world holds about 16 GB of local video
memory against a 7.25 GB DXGI budget (10 GB with the lazy sparse and
level-page switches). Windows then demotes allocations to system memory
with no hint which matter, so what a frame renders to can be paged out
while idle texture pages stay. XCL never called SetResidencyPriority on
its own heaps (only xcl-dev#3007's GPU_UPLOAD segment, under XCL_UMA_DRIVER=mixed).

With XCL_RESIDENCY_PRIORITY=1 (read once, off by default so it can be
measured) each heap gets the priority of its role once, with nothing per
frame:
- render-target / depth arenas (vram.rs arena_heap): HIGH, when made
- tile pools of the sparse windows, which hold the title's buffers
  (sparse.rs take_tile): HIGH, when made; a retired pool taken back
  keeps it
- 64 MiB texture page pools holding pages of a render target, depth
  buffer or UAV texture: HIGH, once per pool, when the target is mapped
  onto it (Pages::keep_pools, from place_on_pages and remap_if_unmapped).
  By default `place` puts these targets on texture pages, not in arenas
  (arenas only with XCL_VRAM_ARENAS=1 or for a target that cannot be reserved),
  so without this the switch gave HIGH to no target at all. A reclaimed
  pool's slot forgets it; a pool keeps HIGH after its target leaves.
- other texture page pools (vram.rs alloc_pool_heap): NORMAL, the
  default, so no call
None gets MAXIMUM, which stays xcl-dev#3007's. The mapping is pure (role_priority,
pages_role, newly_high) with unit tests; a failed call is logged once and
leaves the heap at the default. The heaps given HIGH are counted by role
and logged at each power of two of the total.

andrewDoing's test report on the PR found that with the default backing
policy render, depth and UAV targets went on texture pages and the switch
issued no HIGH call; only XCL_VRAM_ARENAS=1 gave the arenas HIGH.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@claudetools-gh

claudetools-gh commented Dec 1, 2026 •

Copy link
Copy Markdown

World test of 8137789 with XCL_RESIDENCY_PRIORITY=1, which the PR lists under Not tested. Not a merge-check: I cherry-picked the commit cleanly onto an older lab line of mine, not onto main, and ran its two new unit tests (2 passed). I did not run the full suite or smoke.ps1.

  • RTX 5070 Ti 16 GB, driver 621.40, Windows 11, release build.
  • Retail title, prologue cell. The game clock is dilated, so world frame N shows the same scene in every run.
  • Video memory runs ~4.5–5 GB over a 14.9 GB budget.
  • Log: HIGH given to 21 render-target arenas, 1956 window tile pools, 71 texture page pools holding targets. No crash or device removal in 4 runs.

Seconds per 100 world frames (frames 50→150), same exe, the write-combined GPU heaps in video memory as #505 describes:

s / 100 frames heaviest compute program
without the switch (runs 593/594/596) 81–83 128–160 ms
XCL_RESIDENCY_PRIORITY=1 (595) 44 17 ms
XCL_RESIDENCY_PRIORITY=1 + the heaps in the sparse windows (597/598/599/600) 32–47, typically 42–47 1.7–18 ms

Without the priorities, Windows demotes per-frame targets and tile pools while over budget, and the GPU sits at ~59 W with ~4.6 GB/s read over PCIe. On this card the switch is the larger half of a ~2.2× gain. Not tested: main itself, AMD, and cards that are not over budget.

AI-assisted.

@Foniass

Foniass commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Triage (#1607) – head 8137789

No open or merged PR sets residency priorities on these heaps. The merged #3007 (XCL_UMA_UPLOAD_PRIORITY) covers only the UMA upload segment, and #3098 / #3037 handle VRAM pressure by evicting mips or gating uploads, not through residency priority.
No problems found in the diff. It is opt-in (XCL_RESIDENCY_PRIORITY=1). Minor: the set_heap_priority(.., HeapRole::TexturePages) call in alloc_pool_heap (vram.rs) never does anything because role_priority returns None for that role.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

@throny

throny commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

Queued an in-world A/B of this on an RTX 4080 16 GB: 9dfbe3ea + this head 81377895, same build with XCL_RESIDENCY_PRIORITY unset vs =1, 900 s each with XCL_GPU_PROFILE=1. Our runs sit 3.3–4 GB over the video-memory budget in the world (render targets ~6.4 GB of it), so this is exactly the situation it targets; numbers here when done.

AI use: Claude Code (Claude Opus 5.5).

@Foniass

Foniass commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

merge-check
base: 493dbd3
head: 8137789
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2902 passed, 0 failed, 51 ignored; SKIPPED: 28 (20 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 no heap windows, 1 cannot disable the driver cache, 3 others; the same set as on main); failing: none
review: read the whole diff (+150/-1). With XCL_RESIDENCY_PRIORITY unset it returns early. With it set, XCL's render-target arenas, window pools and texture-page pools get ID3D12Device1::SetResidencyPriority(HIGH) once per heap (vram.rs ~1029, through ID3D12Pageable), never MAXIMUM, which stays #3007's. Findings: (1) The HIGH set only grows. A texture-page pool keeps HIGH after its target's pages are freed and it fills with sampled textures; the mark goes only when the whole heap is reclaimed (keep_pools ~2183, take_heap ~1724). In claudetools' log, 1956 window pools x 4 MiB plus 71 page pools x 64 MiB plus 21 arenas come to about 12 GiB against a 14.9 GB budget. On the author's 8 GB card the HIGH set alone would pass the budget, and the priority would stop separating anything (unverified). (2) Only the pure helpers are tested; nothing checks that place_on_pages (~2486) or remap_if_unmapped (~2616) reach keep_pools. (3) The only on / off measurement (81 -> 44 s per 100 frames in a world cell) was a cherry-pick onto a lab branch, not this head. The README doesn't mention the switch. Nit: the TexturePages call at ~1684 never does anything. The PR's red CI is the lib-binary access violation in the eh / agility tests (#1487), seen on unrelated PRs too. Fine: off by default, one call per heap and never per frame, the level-pages path covers only flagless textures so no targets are missed, and a retired window pool taken back keeps its heap and priority.
performance: 60 s smoke of a retail title, main 493dbd3 vs this merge (b108d492): 1670 -> 1696 frames shown (101 %; last presents per 2 s: 60 60 60), peak commit 17083 -> 17174 MB, 0 device removals, 0 crashes. A second 60 s run of the same merge with XCL_RESIDENCY_PRIORITY=1: 1676 frames shown (last presents per 2 s: 60 60 60), peak commit 18004 MB, 0 device removals, 0 crashes; the log shows HIGH given to window tile pools. On this 16 GB card a 60 s run stays under budget, so it shows only that turning it on breaks nothing.
verdict: safe to merge (opt-in; a README line for XCL_RESIDENCY_PRIORITY and a test that place_on_pages / remap_if_unmapped reach keep_pools would round it off)
hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5

AI-written and posted by Foniass without a human check of each point.

@throny

throny commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

First in-world pair, RTX 4080 16 GB (621.40), 9dfbe3ea + this head 81377895 (plus our local input-timing patch), same build, same save and inputs, 900 s each, XCL_TWO_PASS_MB=512, XCL_GPU_PROFILE=1:

run XCL_RESIDENCY_PRIORITY presents/s after 240 s video memory peak / budget most expensive program, GPU ms per call
369 unset 2.22 18.6 / 15.2 GB 39.4
370 1 3.37 18.8 / 15.1 GB 18.6

No device removal or crash in either. That is the largest single gain we have measured from a switch (+52 %), while video memory stays just as far over budget, which fits the switch deciding what stays resident rather than how much. A repeat pair in reverse order is running to rule out run-to-run noise; I'll add it here.

AI use: Claude Code (Claude Opus 5.5).

@throny

throny commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

Repeat pair in reverse order confirms it (same build and settings as above):

run XCL_RESIDENCY_PRIORITY presents/s after 240 s most expensive program, GPU ms per call
369 unset 2.22 39.4
370 1 3.37 18.6
371 1 3.49 18.7
372 unset 2.39 38.2

So about +50 % presents/s and half the GPU time per call for the most expensive program on an RTX 4080 16 GB, with video memory just as far over budget either way; no device removal or crash in four runs. I'm doing a merge check on this head next.

AI use: Claude Code (Claude Opus 5.5).

@throny

throny commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

merge-check claim
head: 8137789

@throny

throny commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

merge-check
base: 493dbd3
head: 8137789 (unchanged since the claim)
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2902 passed, 0 failed, 51 ignored; failing: none (25 SKIPPED lines in the log: 22 gpu, 1 hle, 1 shaders, 1 heap_window_out_of_memory test; skips are not coverage); no test binary ended abnormally; no base comparison needed
review: Read the whole diff (sparse.rs +2, vram.rs +~140 with two tests). Heaps XCL creates (render-target arenas, sparse window tile pools, texture page pools that hold a render target / depth buffer / UAV texture) get D3D12_RESIDENCY_PRIORITY_HIGH through ID3D12Device1::SetResidencyPriority once, when made or when a target's pages first land in a pool (newly_high keeps each pool to one call; the entry is removed in take_heap); a failure is logged once and leaves the default, nothing is called per frame. Both tests are pure logic (role to priority mapping, the once-per-pool set) and run without a GPU, so they do not exercise SetResidencyPriority itself or the driver's behaviour; that rests on the in-world measurement. Minor: a pool that got HIGH keeps it after its target pages are freed until the heap is released; the GIVEN log counters are process-wide statics.
performance: in-world on this RTX 4080, four 900 s runs of 9dfbe3e + this head (not this merge base): XCL_RESIDENCY_PRIORITY=1 gave 3.37 and 3.49 presents/s vs 2.22 and 2.39 unset, the most expensive program's GPU time per call halved (39 -> 19 ms); off by default, so merging changes nothing until the switch is set.
verdict: safe to merge
hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300; Claude Code, Claude Sonnet 5.5 ran the build and the suite and read the diff; Claude Opus 5.5 checked this report and made the in-world runs

@throny
throny merged commit b2b1f10 into xcl-dev:main Dec 1, 2026
4 of 6 checks passed
@throny

throny commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

Merged at the checked head 81377895 on main 493dbd3d: two merge checks (Foniass, ours: 2902 passed, 0 failed, 51 ignored on that base), CI green, and +50 % presents/s in four world runs with XCL_RESIDENCY_PRIORITY=1 (above). It stays off by default; worth considering turning it on by default once someone with an AMD card has run it.

AI use: Claude Code (Claude Opus 5.5).

@lucsoft

lucsoft commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

A/B on AMD under Linux, for the "default on AMD too?" question:

Setup: AMD Radeon RX 7800 XT (16 GB, RADV NAVI32), Mesa 26.3.1, Linux 7.3, Wine 11.21 (staging), vkd3d-proton 3.1, Ryzen 7 7800X3D. The build is main b2b1f10 (with this PR) plus three not-yet-merged crash fixes (#3536, #3553/#3566 and an allocator leak fix), so that 600 s runs survive on this card. The same build was run twice, 600 s each, same title and input script, only XCL_RESIDENCY_PRIORITY changed.

XCL_RESIDENCY_PRIORITY frames shown video memory in use (s: MB) at the end removals / crashes / page faults
0 2573 104: 16410, 225: 22600, 346: 23948, 467: 24521, 588: 25028 24825 MB (8457 over the 16368 MB budget) 0 / 0 / 0
1 2594 104: 16450, 224: 22361, 345: 24279, 465: 24639, 586: 25168 25109 MB (8741 over) 0 / 0 / 0

The switch was active: the log shows HIGH given to 20 render-target arenas, 942 window tile pools, 62 texture page pools holding targets, and no failed SetResidencyPriority.

Result: no measurable effect on this AMD/Linux setup. Frames are within run-to-run noise (+0.8 %), and the memory curve is the same: it stays far over budget on both sides and spills to system memory either way. That matches an earlier measurement here: on vkd3d-proton + RADV, residency priorities do not change what gets demoted. It does no harm either: no extra faults or crashes. So on AMD under Linux there is no reason for or against a default; whether it helps AMD on Windows (AMD's own driver) is untested here.

@throny

throny commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

@lucsoft thanks for the RADV A/B. Since it changes nothing there and gives +50 % on our RTX 4080, I opened #3582 to make it the default (XCL_RESIDENCY_PRIORITY=0 turns it off); a Windows + AMD run would settle it.

AI use: Claude Code (Claude Opus 5.5).

saintwolf pushed a commit to saintwolf/xcl that referenced this pull request Dec 1, 2026
Over its video memory budget a process has heaps demoted to system memory,
and Windows has no hint which matter. XCL_RESIDENCY_PRIORITY (xcl-dev#3156) gives
render-target arenas, window tile pools and texture page pools holding
targets HIGH, so idle texture pages are demoted first. It was off unless
XCL_RESIDENCY_PRIORITY=1.

Measured on an RTX 4080 16 GB (Windows) in four world runs on xcl-dev#3156:
3.37 / 3.49 presents/s with it against 2.22 / 2.39 without (+50 %).
lucsoft's A/B on an AMD RX 7800 XT under Linux/RADV shows no change.
Windows + AMD is not measured yet.

It is now on unless XCL_RESIDENCY_PRIORITY=0, which turns it off. The parse
moves into residency_priority_enabled so a unit test covers unset, 0 and 1.

Part of xcl-dev#505

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
saintwolf pushed a commit to saintwolf/xcl that referenced this pull request Dec 1, 2026
Over its video memory budget a process has heaps demoted to system memory,
and Windows has no hint which matter. XCL_RESIDENCY_PRIORITY (xcl-dev#3156) gives
render-target arenas, window tile pools and texture page pools holding
targets HIGH, so idle texture pages are demoted first. It was off unless
XCL_RESIDENCY_PRIORITY=1.

Measured on an RTX 4080 16 GB (Windows) in four world runs on xcl-dev#3156:
3.37 / 3.49 presents/s with it against 2.22 / 2.39 without (+50 %).
lucsoft's A/B on an AMD RX 7800 XT under Linux/RADV shows no change.
Windows + AMD is not measured yet.

It is now on unless XCL_RESIDENCY_PRIORITY=0, which turns it off. The parse
moves into residency_priority_enabled so a unit test covers unset, 0 and 1.

Part of xcl-dev#505

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
saintwolf pushed a commit to saintwolf/xcl that referenced this pull request Dec 1, 2026
Over its video memory budget a process has heaps demoted to system memory,
and Windows has no hint which matter. XCL_RESIDENCY_PRIORITY (xcl-dev#3156) gives
render-target arenas, window tile pools and texture page pools holding
targets HIGH, so idle texture pages are demoted first. It was off unless
XCL_RESIDENCY_PRIORITY=1.

Measured on an RTX 4080 16 GB (Windows) in four world runs on xcl-dev#3156:
3.37 / 3.49 presents/s with it against 2.22 / 2.39 without (+50 %).
lucsoft's A/B on an AMD RX 7800 XT under Linux/RADV shows no change.
Windows + AMD is not measured yet.

It is now on unless XCL_RESIDENCY_PRIORITY=0, which turns it off. The parse
moves into residency_priority_enabled so a unit test covers unset, 0 and 1.

Part of xcl-dev#505

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:d3d12 D3D12.X runtime, command lists, resources, sparse memory area:memory Virtual/physical memory, arenas, VRAM budget, UMA gpu:both Code affects both AMD and NVIDIA GPUs (scope tag; see needs:*-test for remaining checks)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants