D3D12.X: XCL's own heaps get their residency priority by default #3582
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3582"
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?
Imported from ivall/xcl. Originally posted by throny on 2026-12-01T15:31:48Z.
XCL_RESIDENCY_PRIORITY(#3156) gives XCL's own heaps (render-target arenas, window tile pools, texture page pools holding targets)D3D12_RESIDENCY_PRIORITY_HIGH, so that over the video memory budget Windows demotes idle texture pages first. It was off unlessXCL_RESIDENCY_PRIORITY=1. This turns it on by default;XCL_RESIDENCY_PRIORITY=0turns it off. Part of #505.Evidence: on an RTX 4080 16 GB (Windows), four world runs on #3156 gave 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 (comment on #3156) shows no change. Missing: a Windows + AMD run. If you have one, please run the title in the world with and without
XCL_RESIDENCY_PRIORITY=0and post the presents/s here or on #3156.What is in it
crates/xcl/src/hle/d3d12x/vram.rs: an explicit parseswitch_value: unset is on; empty,0,off,falseandno(any case) are off;1,on,trueandyesare on; any other value stays on and is logged. Tests cover each class.XCL_UMA_UPLOAD_PRIORITYkeeps main's own parse and default (withXCL_UMA_DRIVER=mixed, the GPU_UPLOAD segment ranks below the HIGH heaps unless it is set to1; the README says so).README.md: one bullet for the heap priority and the switch.Tested
cargo build --workspace && cargo test --workspace -- --test-threads=4on head30ec035c(after bmjask's third review): 3006 passed, 0 failed, 52 ignored, 25SKIPPEDlines.SKIPPEDon this adapter: the wave64 variants of thegpu::recomp::lower/lower_dxiltests anddispatch_chain_native_wave64_builds_whole(no wave64);heap_window_out_of_memory_falls_back_to_the_switch_formandhle::d3d12x::bind::tests::two_pass_binds_set_the_shared_view_heap(no heap windows);shaders::tests::pso_measurement_compiles_an_exact_synthetic_record(driver cache cannot be disabled).Regression run
main
817eb1fc9:this PR's head:
Not tested
AI use
🤖 Generated with Claude Code
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T15:41:28Z.
merge-check
base:
b2b1f109d2head:
5b8ac52b3cmerge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2905 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 (+20/-4). #3156's residency priority (HIGH for XCL's render-target arenas, window tile pools and texture-page pools holding targets) is now on unless
XCL_RESIDENCY_PRIORITYis0(trimmed); any other value,false/offincluded, keeps it on, like the repo's other default-on switches. Findings: (1) The "HIGH only grows" point from #3156 now applies to everyone. Pools keep HIGH after their target pages are freed (vram.rs~2187; cleared only when the heap is reclaimed, ~1728), and the window tile pools hold the title's GPU-visible memory by default. Logged HIGH sets were about 12 GiB on a 5070 Ti and at least 7.6 GiB on lucsoft's AMD card, so on an 8 GB card the HIGH set alone would pass the budget (unverified) and the priority could only demote sampled textures. Nobody has an on / off run on the 8 GB card that motivated #3156. (2) Thin evidence for a default. The +50 % is from #3156 on an older base with a local input-timing patch on one RTX 4080, and the 5070 Ti result was a lab cherry-pick. AMD was run only on Linux with vkd3d-proton (no effect). Windows + AMD, 8-12 GB cards and Intel are missing. (3) Peak commit rises with it on in both runs that exist: 16355 -> 17926 MB in this PR's smoke, 17174 -> 18004 MB in my #3156 run with the switch. That's within the gate but unexplained, since neither run went over the budget. (4) The new test (vram.rs~4162) covers only the env parse; nothing checks thatplace_on_pages/remap_if_unmappedreachkeep_pools. (5) README ~420-422: page pools get HIGH when a target lands on them, not when they're made, and they keep it. Every non-target texture page is NORMAL, not only idle ones. Fine: a failingID3D12Device1cast orSetResidencyPriorityis logged once and the heap keeps the default (~1038). It never sets MAXIMUM and makes one call per heap, none per frame. Both smoke blocks are present (120 s, 3380 vs 3370 frames). A 60 s run here reaches the calls but stays under the 16 GB budget, so it shows that nothing breaks and the peak-commit delta, not the speed-up or a small-card regression.performance: 60 s smoke of a retail title, main
b2b1f109vs this merge (5b8ac52b): 1671 -> 1657 frames shown (99 %; last presents per 2 s: 60 60 60), peak commit 17394 -> 18126 MB, 0 device removals, 0 crashes. With the priority now on by default, the log shows window tile pools getting HIGH from 1 s in. On a 16 GB card a 60 s run stays under the budget, so this shows the calls break nothing (no device removal, frames at 99 %), not the speed-up or a small-card regression. Peak commit is 5.6 % above main here, smaller than the PR's own +9.6 %.verdict: not yet: the code is fine and passes here, but as a default it needs the evidence #3156 didn't have: an on / off run on an 8-12 GB card (where the HIGH set can pass the budget, finding 1) and a Windows + AMD run; with those it would be safe to merge
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.
Imported from ivall/xcl. Originally posted by throny on 2026-12-01T16:37:35Z.
One correction to the evidence above: the four runs behind "+50 %" used
XCL_TWO_PASS_MB=512, which makes XCL skip a share of mesh draws (13–21 % in those runs, similar with and without the switch, so the comparison holds). With the default two-pass reserve and no draws skipped: 1.90 presents/s withoutXCL_RESIDENCY_PRIORITY(run 362) vs 3.31 with it (run 389,main6bfb5c51+ #3395 built in, switch of #3395 unset), RTX 4080 16 GB, 900 s each, same save and inputs.AI use: Claude Code (Claude Opus 5.5).
Imported from ivall/xcl. Originally posted by throny on 2026-12-01T18:03:10Z.
Same-build check for the default flip:
main6bfb5c51+ #2987 (its switch unset), RTX 4080 16 GB, default two-pass reserve, no draws skipped: 2.19 presents/s withoutXCL_RESIDENCY_PRIORITY(run 395) against 3.31 with it on the samemain(run 389), and 3.04 / 2.97 with it plus #2987'sXCL_SPARSE_SYSMEM=1(runs 394, 396). No device removal in any of them.AI use: Claude Code (Claude Opus 5.5).
Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T14:59:01Z.
Code review location:
crates/xcl/src/hle/d3d12x/vram.rs; line 1016High: Turning XCL_RESIDENCY_PRIORITY on by default puts XCL's arenas, window pools and target pools at HIGH, while the UMA GPU_UPLOAD segment (
uma_driver.rs:336, XCL_UMA_UPLOAD_PRIORITY) still needs=1and stays at NORMAL by default, which inverts the order the design assumes. On a default run over the video memory budget, the GPU_UPLOAD segment every console program reads its buffers from becomes the lowest-priority XCL heap, so Windows demotes it to system memory before the HIGH render-target and window pools, and every shader read of title buffers goes over PCIe. The test comment at ~4170 ("nothing gets MAXIMUM (the UMA upload segment's...)") assumes that segment ranks above these heaps. Defaulting XCL_UMA_UPLOAD_PRIORITY on in the same change would keep the order.Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T14:59:01Z.
Code review location:
crates/xcl/src/hle/d3d12x/vram.rs; line 1017Medium: The parse has flipped for values other than
0/1: an empty value,falseoroffnow turn the feature on, where before only1did. A user or script that setXCL_RESIDENCY_PRIORITY=or=falseto keep it off (which worked before this PR) now silently gets HIGH priorities.residency_priority_is_on_by_defaultonly tests None, "1", "0" and " 0 ". Treating empty/false/offas off, or logging when an unrecognised value is read, would avoid the surprise.Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T14:59:01Z.
Review: COMMENTED
Review of
5b8ac52b: 3 finding(s) (1 high, 2 medium), most severe first.crates/xcl/src/hle/d3d12x/vram.rs:1016: Turning XCL_RESIDENCY_PRIORITY on by default puts XCL's arenas, window pools and target pools at HIGH, while the UMA GPU_UPLOAD segment (uma_driver.rs:336, XCL_UMA_UPLOAD_PRIORITY) still needs=1and stays at NORMAL by default, which.... (inline)crates/xcl/src/hle/d3d12x/vram.rs:2192: see below.crates/xcl/src/hle/d3d12x/vram.rs:1017: The parse has flipped for values other than0/1: an empty value,falseoroffnow turn the feature on, where before only1did. (inline)On lines outside the diff:
crates/xcl/src/hle/d3d12x/vram.rs:2192: A pool heap that gets HIGH inkeep_poolsstays HIGH (and inpools.high) until it's reclaimed, even after its target pages are released and their tiles reused by sampled textures. With the switch now on by default, HIGH spreads to more and more pools over a session. A long session that creates and frees many transient render targets returns their pages to the pool (cooling/idle), sampled textures take them, and the heaps stay HIGH. Eventually most 64 MiB pools are HIGH, so over budget the idle texture pages are no longer demoted first and the #3156 gain shrinks. Dropping a heap back to NORMAL when its last target page is released would keep the ordering meaningful.These findings come from an AI-assisted review (Claude Code) and focus on correctness. Each is a candidate; please check it before acting on it.
Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T14:59:04Z.
@Prime1997 could you take a look at this one for review and merge? My automated review notes are above, if any.
Imported from ivall/xcl. Originally posted by throny on 2026-12-02T18:56:43Z.
Thanks. Rebased onto current
mainand amended in6f5eb630.1. High: GPU_UPLOAD segment below the HIGH heaps. Fixed. The GPU_UPLOAD segments only exist with
XCL_UMA_DRIVER=mixed:..., which is opt-in. The default NVIDIA window is one CUSTOM L0 heap, and other vendors import the title's pages. Both of those are in system memory, so nothing changes for a default run. Withmixed, though, the segment would have stayed at NORMAL below the new HIGH heaps, as you say. WhenXCL_UMA_UPLOAD_PRIORITYis unset it now followsXCL_RESIDENCY_PRIORITY, so the segment gets MAXIMUM whenever the pools get HIGH. An explicit value still overrides it (uma_driver.rs:334-343). Test:upload_priority_follows_residency_priority(uma_driver.rs:721).2. Medium: pools stay HIGH after their target pages are freed. Not changed in this PR. This is how #3156 worked when it merged (a pool loses HIGH only in
take_heap,vram.rs:2069). Setting a pool back to NORMAL when its last target page goes needs a count of target pages per pool, kept up to date throughrelease_tiles, page sharing between aliases, and the idle and reuse paths. That is a separate change with its own test, so I'll open it as a follow-up rather than add it to the default flip. The README now says that a pool keeps HIGH until it is reclaimed.3. Medium: the parse flipped for values other than 0 and 1. Fixed. The parse is now explicit (
switch_value,vram.rs:1345):0,off,false,noand an empty value turn it off;1,on,trueandyesturn it on (trimmed, any case). Unset, or any other value, keeps it on, and an unrecognised value is logged as a warning. The testresidency_priority_is_on_by_default(vram.rs:4649) covers all of these. The README lists the off values.Tests:
cargo build --workspaceok;cargo test -p xcl --lib hle::d3d12x::vram: 86 passed, 0 failed, 1 ignored;hle::d3d12x::uma_driver: 9 passed, 0 failed.One side effect to know:
XCL_UMA_UPLOAD_PRIORITYnow readstrue/onas on (before, only1was on, andtrue/on/2meant off). Values it does not know followXCL_RESIDENCY_PRIORITY.Head is now
6f5eb630, rebased on main817eb1fc. The whole suite: 3006 passed, 0 failed. Smoke blocks are in the description. Could you re-check?AI use: Claude Code (Claude Opus 5.5).
Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T19:09:37Z.
Review: COMMENTED
Review of
6f5eb630: 2 finding(s) (2 medium), most severe first.crates/xcl/src/hle/d3d12x/uma_driver.rs:337: XCL_UMA_UPLOAD_PRIORITY follows XCL_RESIDENCY_PRIORITY when it's unset, so flipping the latter on by default also gives every mixed window's GPU_UPLOAD segment D3D12_RESIDENCY_PRIORITY_MAXIMUM by default. (inline)crates/xcl/src/hle/d3d12x/uma_driver.rs:341: The new parsing changes the meaning of existing settings without saying so. (inline)These findings come from an AI-assisted review (Claude Code) and focus on correctness. Each is a candidate; please check it before acting on it.
Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T19:09:37Z.
Code review location:
crates/xcl/src/hle/d3d12x/uma_driver.rs; line 337Medium: XCL_UMA_UPLOAD_PRIORITY follows XCL_RESIDENCY_PRIORITY when it's unset, so flipping the latter on by default also gives every mixed window's GPU_UPLOAD segment D3D12_RESIDENCY_PRIORITY_MAXIMUM by default. That change isn't in the PR description, and the #3156 evidence covers only XCL_RESIDENCY_PRIORITY. With XCL_UMA_DRIVER=mixed:1536:1792 and the upload switch unset, the segment was NORMAL before and is now pinned above the HIGH render-target arenas and tile pools, so when over budget Windows demotes the render targets first. Keeping the upload switch's own default (off unless set to 1) would limit the PR to what was measured.
Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T19:09:38Z.
Code review location:
crates/xcl/src/hle/d3d12x/uma_driver.rs; line 341Medium: The new parsing changes the meaning of existing settings without saying so. An unknown XCL_UMA_UPLOAD_PRIORITY value (e.g.
2, or a typo likedisable) was off before, since only1meant on, but now silently falls back to the residency switch, which is on, with no warning (the testupload_priority_enabled(Some("2"), || true)locks this in). And for XCL_RESIDENCY_PRIORITY an empty value counts as off (vram.rs:1347), although the description says 'on unless the value is0' and other switches (gpu_awake.rsparse_mode) treat empty as unset. A launcher passingXCL_RESIDENCY_PRIORITY=to mean default turns the feature off with nothing logged. Treating empty as unset, and warning and keeping the old meaning on unknown values, would avoid both.Imported from ivall/xcl. Originally posted by throny on 2026-12-02T21:39:01Z.
Thanks. Both points are addressed in
8ea8619c, which is amended into the PR's single commit.XCL_UMA_UPLOAD_PRIORITYfollowingXCL_RESIDENCY_PRIORITYgave mixed runsMAXIMUMby default, which was not measured. Agreed. The follow behaviour is removed:crates/xcl/src/hle/d3d12x/uma_driver.rsis back to exactly what it is onmain, so the segment getsMAXIMUMonly withXCL_UMA_UPLOAD_PRIORITY=1.switch_valueandresidency_priority_wantedinvram.rs(lines 1345 and 1360) are private again, asuma_driverno longer uses them. The PR now changes onlyXCL_RESIDENCY_PRIORITY, which is what #3156 measured.This brings back the interaction the earlier review raised: a
GPU_UPLOADsegment without the upload switch now ranks below theHIGHheaps.XCL_UMA_DRIVER=mixed:...is opt-in (decideinuma_driver.rs), so only runs that set it are affected. Neither order has been measured on a mixed run, so the README now says it directly (README.mdlines 418-424): withoutXCL_UMA_UPLOAD_PRIORITY=1those segments stay at the default priority and are demoted before theHIGHheaps. The commit message says the same.The parse changes the meaning of existing values. With the upload switch back to
main, its part of this finding is gone:2,disableand every other value except1are off again. Theupload_priority_enabled(Some("2"), ..)test is removed with it. ForXCL_RESIDENCY_PRIORITYI kept the current parse on purpose:mainan empty value was off (only1was on). Treating it as unset would silently turn the feature on for anyone who setXCL_RESIDENCY_PRIORITY=to keep it off, which is the opposite surprise the previous review raised.off,false,no. These are off.vram.rs,residency_priority_wanted).residency_priority_is_on_by_defaultall state this.The PR description is out of date: it says "on unless the value is
0" and lists only0/0as tested. I will update it to match the code.Tested on an RTX 4080 (debug build) with
cargo build --workspace(ok).cargo test -p xcl --lib uma_driver: 8 passed, 0 failed.cargo test -p xcl --lib residency_priority: 1 passed.cargo test -p xcl --lib vram -- --test-threads=4: 88 passed, 1 failed, 1 ignored. The failure istitle_textures::tests::placed_title_textures_share_vram_and_preserve_pixels, which the filter also matches. It fails the same way withXCL_RESIDENCY_PRIORITY=0, and passes alone and with--test-threads=1(89 passed, 0 failed, 1 ignored). That points to interference between tests running in parallel, not to this change.The whole suite was not rerun for this push.
Pushed as
8ea8619c. The whole suite passes there (see the description), and the smoke blocks are updated. @bmjask could you re-check?AI use: Claude Code (Claude Opus 5.5).
Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T21:57:28Z.
Review: COMMENTED
Review of
8ea8619c: 1 finding(s) (1 medium), most severe first.Re-review at
8ea8619c. XCL_UMA_UPLOAD_PRIORITY no longer follows XCL_RESIDENCY_PRIORITY, which addresses the unannounced MAXIMUM default from the6f5eb630review, but decoupling them causes the issue below.crates/xcl/src/hle/d3d12x/uma_driver.rs:336: see below.On lines outside the diff:
crates/xcl/src/hle/d3d12x/uma_driver.rs:336: With XCL_RESIDENCY_PRIORITY on by default and XCL_UMA_UPLOAD_PRIORITY still off by default, the XCL_UMA_DRIVER=mixed GPU_UPLOAD segments, which every console program reads its buffers from, now rank below the new HIGH heaps. With XCL_UMA_DRIVER=mixed, neither variable set, and the process over its video memory budget, all heaps used to be NORMAL. Now the arenas, window pools and target pools are HIGH while the GPU_UPLOAD segments stay NORMAL, so Windows demotes the console's UMA buffers first and every GPU read of title buffers goes over PCIe. That's the opposite of what therole_prioritytest comment says ('the UMA upload segment's, which every console program reads from'), and the README says it wasn't measured. Raising the upload segments at least to HIGH whenever residency priority is on, unless explicitly turned off, would keep them from being demoted first.These findings come from an AI-assisted review (Claude Code) and focus on correctness. Each is a candidate; please check it before acting on it.
Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T23:24:08Z.
Review: COMMENTED
Review of
e94f2dfe: 2 finding(s) (2 medium), most severe first.Re-review at
e94f2dfe. The GPU_UPLOAD segments now default to HIGH, which addresses the demotion order from the8ea8619creview. Two new items below.crates/xcl/src/hle/d3d12x/uma_driver.rs:362: Not certain about this one, because it depends on whether the driver allocates VA inside SetResidencyPriority: SetResidencyPriority now runs by default for every GPU_UPLOAD segment inside the critical window between VirtualFree of the pl.... (inline)crates/xcl/src/hle/d3d12x/uma_driver.rs:339: Any set value of XCL_UMA_UPLOAD_PRIORITY other than "1" (0,on,true,yes, empty) puts the GPU_UPLOAD segments at NORMAL, below XCL's now default-on HIGH heaps. (inline)These findings come from an AI-assisted review (Claude Code) and focus on correctness. Each is a candidate; please check it before acting on it.
Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T23:24:08Z.
Code review location:
crates/xcl/src/hle/d3d12x/uma_driver.rs; line 362Medium: Not certain about this one, because it depends on whether the driver allocates VA inside SetResidencyPriority: SetResidencyPriority now runs by default for every GPU_UPLOAD segment inside the critical window between VirtualFree of the placeholder and CreatePlacedResource/Map, and it also runs on segments that are then thrown away because Map lands at the wrong address. On every default mixed-window remake, after the placeholder at
wantis released, a driver call (the ID3D12Device1 cast plus SetResidencyPriority) runs before Map. If any driver-internal VA allocation in it takes the freed range, Map returns another address, so the segment is refused and becomes CUSTOM, or the remake fails and stops the process (the test module notes that anything landing in the window meanwhile stops the process). Before this PR it ran only with an opt-in variable. Setting the priority after thep == wantcheck would avoid both the race and the wasted call.Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T23:24:08Z.
Code review location:
crates/xcl/src/hle/d3d12x/uma_driver.rs; line 339Medium: Any set value of XCL_UMA_UPLOAD_PRIORITY other than "1" (
0,on,true,yes, empty) puts the GPU_UPLOAD segments at NORMAL, below XCL's now default-on HIGH heaps. That brings back the ordering this change removes and contradicts the README's 'any other value of it keeps them at the default' (the default is HIGH). With XCL_UMA_DRIVER=mixed and XCL_UMA_UPLOAD_PRIORITY=on/true (expecting more priority) or =0 (expecting the default without MAXIMUM),upload_priorityreturns None, so the segments every console program reads stay NORMAL while the arenas, window pools and target pools are HIGH, and over budget Windows demotes the title's buffers first. Nothing is logged, and the test assertingupload_priority(Some("on"), true) == Nonelocks this in. Parsing it withswitch_valuelike XCL_RESIDENCY_PRIORITY, and keeping HIGH for anything but an explicit off, would match the README.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-03T01:25:41Z.
merge-check
base:
078358a058head:
e94f2dfe52merge: clean
build: ok
tests: 3008 passed, 0 failed, 52 ignored; 28 skipped, the same as on main
review: 4 medium, 3 nits (below)
performance: 60 s smoke run: 1669 → 1650 frames (98 % of main), peak commit 17577 → 17526 MB, no device removal, no crash
title run: retail title on the RTX 5070 Ti (driver 621.14), into the world by scripted presses: 233 s there, 0 device removals, 0 crashes, 4.1 presents/s; run with
XCL_SKIP_CS=95cc13288a27a96e(the NVIDIA hang at the end of loading, #3541) and NVIDIA's 2048 MB shader heap (#2590)verdict: not yet:
PR descriptionis red; otherwise no blocking finding, the suite passes and the smoke run is cleanhardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5
In short: Turns XCL_RESIDENCY_PRIORITY on by default with an explicit parse (0/off/false/no/empty off, unknown values kept on and logged). At this head the GPU_UPLOAD segments of an XCL_UMA_DRIVER=mixed window also get HIGH by default while it is on (MAXIMUM with XCL_UMA_UPLOAD_PRIORITY=1). The code is correct for what it does. What held it at Foniass's last check is still open: no on/off run on an 8-12 GB card and no Windows + AMD run for a default-on change.
Medium
Nit
e94f2dfethey get HIGH by default. The test counts and both smoke blocks are from8ea8619c.Checked and fine
How this was tested
078358a0, thencargo build --workspaceandcargo test --workspace --no-fail-fast -- --test-threads=4.scripts/smoke.ps1: 60 s of a retail title on main078358a0and on this merge; presents per 2 s at the end: 60 60 60.XCL_RUN_SECONDS=300and scripted A presses counted from the first frame (XCL_PRESS_BASE=frame, #3712) into the world from an existing save; time in the world is counted from the first in-world draw call to the end of the run.Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by throny on 2026-12-03T01:44:04Z.
Thanks for the re-review. Both points are addressed in the PR's commit (amended locally to
30ec035c6, not pushed yet when this was written).1. Medium:
SetResidencyPrioritybetween the placeholder's release andMap. Moved. I found no sign that the call allocates VA. It is a residency hint, andCreateHeap/CreatePlacedResourcealready run in that window and do far more. Still, it runs by default now, so it does not belong in the critical window, and it was wasted on a segment that is then given up.mapped_segmentno longer sets it. A newset_upload_priority(crates/xcl/src/hle/d3d12x/uma_driver.rs:359) is called inremake_mixed(:540-546) for eachGPU_UPLOADsegment inplaced, after the loop,ungroomand the failure check. So it runs only for segments that landed atwant, with no free range in the window. The log line and the warning on failure are unchanged.2. Medium: any set
XCL_UMA_UPLOAD_PRIORITYother than1gives NORMAL. Changed as you suggest, and documented.upload_prioritynow parses the variable withvram::switch_value(madepub(super)), the same parser asXCL_RESIDENCY_PRIORITY:1,on,true,yes):MAXIMUM, as=1gave before0,off,false,no, empty): no call, soNORMAL, as on main; this is the explicit way back to main's behaviourHIGHwhileXCL_RESIDENCY_PRIORITYis on); an unknown value is logged once byupload_priority_wantedThe README entry and the commit message say this.
upload_segments_are_not_demoted_before_the_high_heapsnow checks all three groups, including mixed case,"", and an unknown value with residency priority on and off.Tests (Windows, debug, RTX 4080):
cargo test -p xcl --lib d3d12x::uma_driver -- --test-threads=4: 9 passed, 0 failed, 0 ignored, no SKIPPED. That includes the mixed-window remake tests, which now set the priority after placement.cargo test -p xcl --lib d3d12x::vram -- --test-threads=4: 86 passed, 0 failed, 1 ignored.The whole suite was not rerun for this amend.
The runtime code changed, so a merge check of
e94f2dfedoes not cover the new head.Each round has found new points so far. Would the remaining ones block the merge, or can they be follow-ups once this round is in?
Pushed as
30ec035c. The whole suite passes there (3006 passed, 0 failed), and the smoke block in the description is updated.AI use: Claude Code (Claude Opus 5.5).
Imported from ivall/xcl. Originally posted by throny on 2026-12-03T02:14:35Z.
@Foniass thanks. The red
PR descriptionisn't about the description: since about 22:47Z everypull_request_targetrun in this repository ends instartup_failurebefore it starts (reported on #3041;CI, which runs onpull_request, still passes). The repository's own checker (scripts/pr_check.py --local) passes on this description and head (30ec035c). Our script restarts the check once GitHub runs these workflows again.AI use: Claude Code (Claude Opus 5.5).
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-03T06:48:12Z.
merge-check
base:
078358a058head:
30ec035c68merge: clean
build: ok
tests: 3008 passed, 0 failed, 52 ignored; 28 skipped, the same as on main
review: 3 medium, 2 nits (below)
performance: 60 s smoke run: 1669 → 1678 frames (100 % of main), peak commit 17577 → 18126 MB, no device removal, no crash
title run: retail title on the RTX 5070 Ti (driver 621.14), into the world by scripted presses: 244 s there, 0 device removals, 0 crashes, 4 presents/s; run with
XCL_SKIP_CS=95cc13288a27a96e(the NVIDIA hang at the end of loading, #3541) and NVIDIA's 2048 MB shader heap (#2590)verdict: not yet:
PR descriptionis red; otherwise no blocking finding, the suite passes and the smoke run is cleanhardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5
In short: Turns XCL_RESIDENCY_PRIORITY on by default with an explicit on/off parse, and gives the GPU_UPLOAD segments of an opt-in XCL_UMA_DRIVER=mixed window HIGH while it is on (MAXIMUM with XCL_UMA_UPLOAD_PRIORITY on, NORMAL with it off). This push moves the upload segments' SetResidencyPriority until after every segment is mapped in place, and reads XCL_UMA_UPLOAD_PRIORITY with the same parse, which fixes two findings from my last merge-check. Nothing blocks it in the code; still open: no on/off run on an 8-12 GB card or on Windows + AMD for a default-on change, pools that keep HIGH, no test of the default call path, and an out-of-date description.
Medium
Nit
30ec035cthey get HIGH by default, on/true/yes give MAXIMUM, and 0/off/false/no/empty give NORMAL. The test counts and both smoke blocks are still from8ea8619c, and the runtime has changed twice since then (uma_driver.rs).Checked and fine
078358a0How this was tested
078358a0, thencargo build --workspaceandcargo test --workspace --no-fail-fast -- --test-threads=4.scripts/smoke.ps1: 60 s of a retail title on main078358a0and on this merge; presents per 2 s at the end: 60 60 60.XCL_RUN_SECONDS=300and scripted A presses counted from the first frame (XCL_PRESS_BASE=frame, #3712) into the world from an existing save; time in the world is counted from the first in-world draw call to the end of the run.Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-12-03T08:10:41Z.
A data point from an 8 GB NVIDIA card, where video memory runs well over budget, for this PR's default.
Setup: RTX 2070 SUPER 8 GB (driver 621.40, wave32; SM clock held at 1605 MHz for all runs below), Windows 11 26300, release build. Base 1b93a9f5 (775f6dce plus Prime1997's split-wave64 PRs) with
81377895and this PR's30ec035ccherry-picked (both applied cleanly),XCL_RESIDENCY_PRIORITY=1. Retail game, Series S device type,XCL_DIRECT_DXIL=0,XCL_TEXTURE_LEVEL_PAGES=1,XCL_TWO_PASS_MB=1536. 1300 s runs with scripted presses from a warm shader cache. Presents counted from theXCL_ACTIVITYlines over 500-1300 s (in the world).XCL_TWO_PASS_BATCH=1(no measurable effect)81377895+ this PR+20.6 % presents with residency priority: every 100 s bin 96-106, against 81-89 without. Local video memory is still ~11.4 GB against a 7.1 GB budget, and the start-up line gives HIGH to 1 window tile pool.
Not tested: AMD, other titles, the image (not compared), crashes. One baseline run (title crash at 223 s) and one priority run (device removal at 323 s) also stopped during the world load, like other configurations that night, so this says nothing about stability. Same-night runs only.
Tool: Claude Code (Claude Opus 5.5) built the branches, ran the timed runs and drafted this.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.