Memory: the 16-window layout keeps 4 runtime sparse windows #3517
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3517"
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 CharlyRien on 2026-11-30T10:48:58Z.
The 16-window layout (
XCL_UMA_WINDOWS=16) now keeps 4 runtime sparse windows instead of 3. The 4- and 8-window layouts keep 3.XCL_SPARSE_WINDOWS=<n>(1 to 8) overrides the count for any layout.Why: a retail title's BVH builder works in a 3.39 GB
MEM_RESERVE | MEM_64K_PAGESreservation (0xd4920000bytes, protect0x2404), made once sparse windows 1..2 are taken. With 3 sparse windows it finds no room and becomes plain write-watched memory, which shaders read as zeros, so every acceleration structure the title builds stays empty. With 4 it lands in window 3, where the GPU sees it. The 16-window layout already leaves 5 of its windows empty (3 sparse + 1 coherent + 6 view), so the 4th sparse window costs no address space: 4 + 1 + 6 = 11 of 16.claudetools-gh found this and proposed the same
XCL_SPARSE_WINDOWSswitch on #505 (comment 7273597036): withmain's root-constant clamp82b7cb3eand a 4th sparse window, the title builds real BVHs without crashing and the room gets bounce light, on an RTX 5070 Ti. This PR is his switch with 4 as the 16-window default.mainalready has82b7cb3e(#1319), so this PR needs nothing else.Part of #505.
What is in it
One commit:
crates/xcl/src/gpu/uma.rs:SIXTEEN_WINDOW_SPARSE_WINDOWS = 4, next toMAX_RUNTIME_SPARSE_WINDOWS = 3(now the 4- and 8-window value);runtime_sparse_windows(windows):XCL_SPARSE_WINDOWS(parsed and clamped to 1..=8), else the layout's default. It replaces the constant at the only two places that bound the sparse windows:max_coherent_windows(throughmax_coherent_windows_for) andreserve_runtime;committed_window()/is_sparse_window()/is_view_window(). A coherent plan in the 16-window layout can now take 6 windows instead of 7.uma.rs):sparse_windows_setting_parses_clamps_and_fits_the_layout(parse, clamp, per-layout default; for 1..=8 sparse windows the 16-window layout still fits),sixteen_windows_keep_four_sparse_windows(the 16-window layout's windows, the whole aperture reserved, the write-watch regions),a_bvh_scratch_reservation_lands_in_the_fourth_sparse_window(with windows 1..2 taken, a0xd4920000reservation lands in window 3, and 6.09 GB more takes no other window). The last two use only APIsmainhas, and fail onmain, where the reservation gets no room;runtime_layout_supports_eight_and_sixteen_heap_windows,the_series_x_plan_is_pinned,sparse_alloc_above_keeps_window_0_for_the_title,sparse_reserve_keeps_single_window_reservations_inside_one_window,view_windows_hold_gpu_views,expanded_runtime_layout_splits_large_coherent_heaps_across_multiple_windows).crates/xcl/src/hle/d3d12x/console_heap.rs(test only):title_memory_holds_a_heap_only_in_window_0probes the coherent window and a view window at their new indices.crates/xcl/src/gpu/recomp/tests.rs(test only):gpu_sparse_vram_descriptors_buffers_and_xmemruns a 4-root-UAV program that expects the coherent window at window 3. WithXCL_UMA_WINDOWS=16that is now window 4, so the test skips there (SKIPPED …: the coherent window is not window 3);XCL_SPARSE_WINDOWS=3runs it with 16 windows. The default 4-window run is unchanged.README.md:XCL_SPARSE_WINDOWSin the switch list.+148 / −36 in 4 files; about 30 of them are runtime lines, the rest tests and docs.
Tested
Head
0b4283d1onmain9dfbe3ea. RTX 3090 24 GB (Resizable BAR off), driver 616.56, Ryzen 9 5950X, 32 GB RAM, Windows 11 22631; Rust 1.100.0, release.cargo check --release -p xcl --lib --bins --tests: 0 errors, no warning in the changed files.cargo test --release -p xcl --lib -- gpu::uma:: title_memory_holds_a_heap_only_in_window_0 gpu_sparse_vram_descriptors_buffers_and_xmem root_views_in_a_gpu_view_are_wanted_with_their_bytes d3d12x::real::gpu_view_tests:: a_gpu_view_buffer_reaches_the_pc_at_its_windows_address a_view_across_a_window_end_is_bound_up_to_it a_wait_on_a_gpu_view_reads_its_cpu_view physical_home expanded_heap_window --test-threads=1(XCL_REQUIRE_GPU=mesh): 35 passed, 0 failed, 0 ignored; SKIPPED: none. The two new layout tests fail withXCL_SPARSE_WINDOWS=3(main's layout): 0 passed, 2 failed.Not run: the whole suite (
cargo test --workspace).On the retail title, on our lab tree (not this PR's head), same binary, same shader cache, same switches except
XCL_SPARSE_WINDOWS(two runs with 4 windows, one with 3):64K pagesreservation0x1300000000), at 59.5 smain53e85fb1+ 42 of our commits (ports of #3089, #2798 / #2799 and the stencil part of #3290; #3094; #3281) +82b7cb3echerry-picked + a lab version of this switch (uma.rsonly; default 3, so the A/B is the switch alone). Switches:XCL_UMA_WINDOWS=16 XCL_HEAP_WINDOWS=1 XCL_ALIAS_COPY=1 XCL_PLACE_RETIRE=0 XCL_DEPTH_UAV_TWIN=1 XCL_PAIR_PAGES=1 XCL_OUTSIDE_VIEW_USE=1 XCL_OUTSIDE_ONLY_BYTES=0x3200000,0x1900000 XCL_TWO_PASS_MB=2048 XCL_VIEW_REACH_MB=36 XCL_PREPARE=0 XCL_DRED=1 XCL_HUGE_PSO_CONCURRENCY=8 XCL_HUGE_PSO_WANTED_CONCURRENCY=8 XCL_PSO_WAIT_MS=5000 XCL_TRACE_MEM=5000.Regression run
Same machine as under Tested, same title, 60 s each, both through
maind52ff48'sscripts/smoke.ps1,XCL_PREPARE=0, the same scripted A presses (XCL_PRESS_A_AT), every otherXCL_*unset (so the default 4-window layout, which this PR does not change: see Not tested). Each run started from its own copy of the same shader cache, made by anothermaincommit, so cold for both. The head is onmain9dfbe3ea; themainrun is ofmaind52ff48(8 commits earlier): the check asks for a commit ofmain.maind52ff48:This PR's head
0b4283d1:Not tested
XCL_UMA_WINDOWS=16: the A/B above is on our lab tree, not on this head, and the regression runs use the default 4-window layout, which this PR does not touch.MEM_64K_PAGESreservations now fit in 16 GiB of sparse windows gets them in video memory, which is what the cap of 3 was there to avoid.acceleration structure at …: 0 nodes) said 0 nodes in both runs; claudetools-gh's GPU-side read-back on an RTX 5070 Ti shows real trees, and that the CPU-side walk does not see the GPU's writes.XCL_UMA_WINDOWS=16 XCL_HEAP_WINDOWS=1; Windows 10 and Wine.AI use
AI use: the port of the switch, the new default, the tests, the A/B runs and their readings, and this description were done with Claude Code (Claude Opus 5.5), checked and posted by me. The switch itself is claudetools-gh's (#505).
🤖 Generated with Claude Code
Imported from ivall/xcl. Originally posted by andresd-cerebras on 2026-11-30T21:49:28Z.
Review: COMMENTED
Withdrawn.
Imported from ivall/xcl. Originally posted by andresd-cerebras on 2026-11-30T21:49:29Z.
Code review location:
crates/xcl/src/gpu/uma.rs; line 48With 4 sparse windows the coherent window moves from 3 to 4, out of the switch form's reach (root UAVs cover windows 0..3; see
with_switch_fallbackin real.rs). Pipelines rebuilt in the switch form after an E_OUTOFMEMORY (#156) would then read 0 from spilled root arguments and per-draw data. Could the 4th sparse window go after the coherent window instead?Imported from ivall/xcl. Originally posted by andresd-cerebras on 2026-11-30T21:49:29Z.
Code review location:
crates/xcl/src/gpu/recomp/tests.rs; line 5273This skip is the regression from uma.rs L48 showing up: the 16-window GPU coverage of this path is gone rather than fixed.
Imported from ivall/xcl. Originally posted by andresd-cerebras on 2026-11-30T21:49:29Z.
Code review location:
crates/xcl/src/gpu/uma.rs; line 1713These tests go through
runtime_sparse_windows, which readsXCL_SPARSE_WINDOWS. With theXCL_SPARSE_WINDOWS=3the PR recommends for the GPU test, this and the BVH/expanded-layout tests fail. Pass the sparse count explicitly (asmax_coherent_windows_fordoes) so the tests don't depend on the environment.Imported from ivall/xcl. Originally posted by andresd-cerebras on 2026-11-30T21:49:29Z.
Code review location:
crates/xcl/src/gpu/uma.rs; line 60clamp(1, 8)regardless of layout: with 4 windows 4..8 silently become 3, and 1..2 leave root-UAV windows empty. Clamp to what the layout can hold, and say so in the README.Imported from ivall/xcl. Originally posted by thehollowedone on 2026-12-01T00:15:05Z.
Focused follow-up on head
0b4283d: the default 16-window layout puts coherent memory in window 4, whilepso::in_switch_formtranslates only windows 0–3. That fallback is used when the driver refuses a heap-window pipeline withE_OUTOFMEMORY. It cannot access both the new sparse window 3 and coherent window 4; swapping their positions would only change which one it loses.I added the test-only regression below to a clean merge of this head onto
maind0832e6.cargo test --offline --locked -p xcl --lib first_coherent_window_remains_reachable_by_switch_fallback -- --test-threads=1failed 0 passed, 1 failed, 0 ignored with the default 16-window layout: “the switch fallback translates 4 windows but coherent memory starts in window 4.” On the same merged code withXCL_SPARSE_WINDOWS=3, it passed 1 passed, 0 failed, 0 ignored. This checks the layout and translation reach; I did not force a GPU pipeline fallback or run the full suite or a title.For the intended four-sparse-window behavior, the fallback needs a path that can address both sparse window 3 and coherent window 4. Please carry the wider reach through translation, root signature and binding, and test a forced fallback that reads distinct nonzero sentinels from both in one dispatch. Keeping three sparse windows as the default until that path works would avoid introducing the gap while the wider fallback is developed.
Test-only regression diff
AI use: OpenAI Codex (GPT-6.2 Sol) wrote and ran the focused test and drafted this report; OpenAI Codex (GPT-6.2 Astra) reviewed the fallback design.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T08:45:02Z.
merge-check
base:
7d86c5d2b7head:
0b4283d147merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2899 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 (uma.rs +137/-35, console_heap.rs and recomp/tests.rs tests, README). Nothing changes by default: only
XCL_UMA_WINDOWS=16(which needsXCL_HEAP_WINDOWS=1) gets 4 sparse windows, with the coherent window moving to 4, the views to 5..10, and the coherent cap dropping from 7 to 6 windows; runtime users find windows by kind (committed_window()/is_sparse_window()/is_view_window()), so nothing is hard-wired to window 3. Findings: (1) nothing measures this head withXCL_UMA_WINDOWS=16: the PR's smoke pair uses the default 4-window layout this doesn't touch, and the retail A/B is from a lab tree. (2) #2905 places physical page homes from the top of the last sparse window (sparse_end()) down, which with this PR is window 3, the window the BVH reservation needs; both also editthe_series_x_plan_is_pinned, so whichever merges second needs a rebase that keeps both in mind. (3)recomp/tests.rs~5273 suggestsXCL_SPARSE_WINDOWS=3to run that test with 16 windows, but that setting makes the new uma.rs layout tests fail in the same run. (4) On main,a_bvh_scratch_reservation_lands_in_the_fourth_sparse_windowfails because the reservation fits in window 0, not because there's no room; the test doesn't fill window 0 as the retail title does. (5) With 4 windows,XCL_SPARSE_WINDOWSabove 3 does nothing, while the README says 1 to 8. Fine: the layout fits 16 windows for 1..=8 sparse windows and the whole aperture stays reserved; no conflict with #3546.performance: no smoke run (the default path doesn't reach this change); not measured. Nothing changes by default (the 16-window layout needs
XCL_UMA_WINDOWS=16andXCL_HEAP_WINDOWS=1), so no smoke run; the opt-in layout is unmeasured on this head.verdict: 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 brainhay5 on 2026-12-01T09:38:10Z.
merge-check claim
head:
0b4283d147Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T10:07:53Z.
Triage (#1607) – head
0b4283dNo other open PR changes the number of sparse windows. #3521/#3522 also target XboxBvhBuilder memory, but under
XCL_SPARSE_LAZY=1(tiles with no video memory), not a reservation that finds no room in the sparse windows; they do not overlap.Notes on the diff:
uma.rs:max_coherent_windowsfor 16 windows drops from 7 to 6, so a coherent need above 6 windows is now cut to 6 unlessXCL_SPARSE_WINDOWS=3. The doc comment onMAX_RUNTIME_SPARSE_WINDOWSwarns that more sparse VA pulls large startupMEM_64K_PAGESheaps into sparse VRAM (tile-mapping stalls); a 4th window brings that risk back for 16 windows. Inrecomp/tests.rs,gpu_sparse_vram_descriptors_buffers_and_xmemnow callsskip_testwhenever the coherent window is not window 3, so it skips by default with 16 windows: that is a configuration skip, not a missing-hardware skip. The README says 1 to 8, but with 4 windows more than 3 has no effect.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Imported from ivall/xcl. Originally posted by brainhay5 on 2026-12-01T11:48:18Z.
merge-check claim withdrawn
Our automated merge-check loop claimed this PR and then stopped before posting a check — two loops were running at once and both are now shut down. No check from us is coming, so this claim is void and the head is free for someone else to take.
AI use: an agent posted this withdrawal.
Imported from ivall/xcl. Originally posted by Hurtibabi on 2026-12-01T16:39:01Z.
merge-check
base:
6bfb5c5153head:
0b4283d147merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2907 passed, 0 failed, 51 ignored; SKIPPED: 28 (22 no wave64, 2 no d3d12SDKLayers.dll, 2 no heap windows, 1 no D3D12 debug layer, 1 cannot disable the driver cache without Developer Mode); failing: none
review: read the whole diff (uma.rs, recomp/tests.rs, console_heap.rs, README). (1) With
XCL_UMA_WINDOWS=16the coherent window moves from 3 to 4, but the switch form thatwith_switch_fallback(real.rs~5175) uses when the driver refuses a heap-window pipeline (#156) reaches only windows 0..3 (pso::windows_for_mode,emit.rs~5079). Such pipelines lose the coherent window (title coherent memory, per-draw args, readback buffers) and read it as 0. This confirms thehollowedone's finding; I ran their test-only regression (first_coherent_window_remains_reachable_by_switch_fallback, added to the merge and removed again, not part of the counts above):cargo test -p xcl --lib first_coherent_window_remains_reachable_by_switch_fallback -- --test-threads=1-> 0 passed, 1 failed ("the switch fallback translates 4 windows but coherent memory starts in window 4"); withXCL_SPARSE_WINDOWS=3-> 1 passed, 0 failed. The PR does not mention this, andgpu_sparse_vram_descriptors_buffers_and_xmemnow skips exactly this case with a configuration reason, not a missing-hardware one. (2) The new layout tests readXCL_SPARSE_WINDOWSthroughfor_runtime_windows, so theXCL_SPARSE_WINDOWS=3run suggested inrecomp/tests.rsmakessixteen_windows_keep_four_sparse_windowsanda_bvh_scratch_reservation_lands_in_the_fourth_sparse_windowfail in that run (from the code, not run). (3) With 4 windows, values above 3 have no effect (reserve_runtimetakes(windows - coh_wins).min(n)), while the README says 1 to 8. Nothing changes in the default 4-window layout. No duplicate: no open or merged PR changes the sparse window count (#1998 introduced the cap of 3; #3097 was closed), and #1607 has no group for it. Not tested: this head withXCL_UMA_WINDOWS=16 XCL_HEAP_WINDOWS=1on a title, a forced switch-form fallback on the GPU, AMD.performance: default layout unchanged, so no frame-time or memory cost by default (reasoned, no smoke run). With
XCL_UMA_WINDOWS=16more title memory can land in sparse VRAM; not measured here (the PR reports about 420 MB more video memory at the peak on its lab tree).verdict: not yet: with 16 windows the switch-form fallback (#156) no longer reaches the coherent window (finding 1, reproduced with a test); not covered by the PR's tests or description
hardware / tool and model: NVIDIA GeForce RTX 4090 (driver 621.40 / 32.0.16.2140), Intel Core i7-14700K, Windows 11 Pro 10.0.26200.9974, rustc 1.100.1, debug / Claude Code, Claude Opus 5.5 (claude-opus-5-5)
Imported from ivall/xcl. Originally posted by Decodere on 2026-12-02T08:46:36Z.
Diff review (head
0b4283d14, read-only code review — not a test report):Clean layout math in
uma.rsfor adding a 4th sparse window to the 16-window aperture without disturbing the default 4-window layout. Two concrete issues remain on0b4283d14:with_switch_fallbackstill caps shaders at 4 windows (0..3), cutting off coherent window4in the 16-window layout (crates/xcl/src/gpu/uma.rs:48,:59,:360-362;crates/xcl/src/hle/d3d12x/real.rs:5146-5159;crates/xcl/src/gpu/recomp/pso.rs:147-161,:176-185;crates/xcl/src/hle/d3d12x/bind.rs:5287-5290):With
XCL_UMA_WINDOWS=16(MAX_HEAP_WINDOWS), raising the default sparse window count toSIXTEEN_WINDOW_SPARSE_WINDOWS = 4(uma.rs:48,:59) moves the first coherent window from window3to window4(uma.rs:360-362,:379). Whenever the driver refuses a heap-window pipeline withE_OUTOFMEMORY,with_switch_fallback(real.rs:5146-5159) rebuilds it insidepso::in_switch_form(pso.rs:176-185), wherewindows_for_mode(n, false)(pso.rs:148,:155-160) caps translation toMAX_WINDOWS = 4(root UAVs0..3bound atbind.rs:5287-5290). Any pipeline taking switch fallback in the 16-window layout can no longer address coherent memory in window4(reads return0), which is also whygpu_sparse_vram_descriptors_buffers_and_xmemhad to skip whenu.committed_window() != Some(3)(crates/xcl/src/gpu/recomp/tests.rs:5270-5275). Either keeping the coherent window within switch-fallback reach or extending fallback addressing to cover window4avoids silent data loss on driver OOM fallback.Unit tests are sensitive to ambient
XCL_SPARSE_WINDOWS(crates/xcl/src/gpu/uma.rs:52-54,:77-79,:96-97,:349-362,:1507-1587,:1713-1755,:1810-1830):Uma::for_runtime_windows,max_coherent_windows, andcoherent_window_sizesall callruntime_sparse_windows(windows)(uma.rs:52-54), which reads livestd::env::var("XCL_SPARSE_WINDOWS"). However, the updated/new tests (runtime_layout_supports_eight_and_sixteen_heap_windowsatuma.rs:1507,the_series_x_plan_is_pinnedat:1558,sixteen_windows_keep_four_sparse_windowsat:1713,a_bvh_scratch_reservation_lands_in_the_fourth_sparse_windowat:1741, andexpanded_runtime_layout_splits_large_coherent_heaps_across_multiple_windowsat:1810) assert the default4-sparse-window layout. Runningcargo testwithXCL_SPARSE_WINDOWS=3(as suggested incrates/xcl/src/gpu/recomp/tests.rs:5271) therefore fails those 5 unit tests in the same run. Passing an explicit sparse-window count intoreserve_runtime/ test helpers (readingXCL_SPARSE_WINDOWSonly inuma::get()) decouples unit tests from the environment.Minor note:
README.md:360-363documentsXCL_SPARSE_WINDOWSas1 to 8, whereas in the 4-window layoutreserve_runtimecapssparse_winsatwindows - coh_wins = 3(uma.rs:362), so values above 3 have no effect with 4 windows (and values above 7 have none with 8).AI use: Antigravity (Gemini 4 Neon) audited the full diff against
mainand drafted this review.Imported from ivall/xcl. Originally posted by Gevroska on 2026-12-02T10:46:45Z.
I compared the production sparse allocator on main
1c8b5514and head0b4283d1using native WindowsVirtualAlloc. With the 16-window layout active, I held windows 1 and 2 and requested a 3.32 GiB reservation.Setting
XCL_SPARSE_WINDOWS=3on the PR restored the main result in both cases. An independent repeat reproduced all six process-level controls.This identifies a case where the fourth sparse window preserves a reservation that main cannot satisfy. The fixture exercised the CPU allocator only. The separate question raised above about a fallback shader reaching coherent window 4 still needs GPU validation.
OpenAI Codex GPT-6.2 Sol ran the test, a separate GPT-6.2 Sol agent repeated it, and GPT-6.2 Astra drafted this comment.
I reviewed and approved this comment before posting.
Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T10:46:55Z.
Code review location:
crates/xcl/src/gpu/uma.rs; line 47With 4 sparse windows, the 16-window layout's coherent window moves from window 3 to window 4, which pipelines in the switch form (4 root UAVs, windows 0..3 only) can't reach. With XCL_UMA_WINDOWS=16 and XCL_HEAP_WINDOWS=1 on NVIDIA, a big program that gets E_OUTOFMEMORY with heap windows is rebuilt in the switch form by
real::with_switch_fallback(real.rs:5145-5158). The same happens to every pipeline whenconsole_heap::window_views_failed()turnspso::heap_windows()off. Window 3 is now an empty sparse window, so per-draw arguments, readback buffers, spilled root tables and coherent-window GPU heaps read 0 in those pipelines, and their writes are dropped. The skip added togpu_sparse_vram_descriptors_buffers_and_xmem("4 root-UAV windows do not reach" window 4) shows the regression rather than testing it.Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T10:46:55Z.
Code review location:
crates/xcl/src/gpu/uma.rs; line 60XCL_SPARSE_WINDOWSis clamped to 1..=8, so 7 or 8 sparse windows give the title 27.5+ GiB of sparse space, and its 24 GiB MEM_64K_PAGES CPU view then lands in sparse VRAM. With XCL_UMA_WINDOWS=16 (or 8) and XCL_SPARSE_WINDOWS=7,kernelx::VirtualAllocsends the retail title's 24 GiB CPU-view reservation tosparse_reserve, which now finds room, so 24 GiB becomes tiled video memory, which the view windows were built to prevent (see thesparse_enddoc). The upper bound has to depend on the layout (below 6 for 16 windows, similar for 8). Values outside it are clamped or ignored with no log line.Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T10:46:55Z.
Code review location:
crates/xcl/src/gpu/uma.rs; line 86Not certain about this one: the 16-window coherent cap drops from 7 to 6 windows, so stored coherent needs between ~24 and ~28 GB are now cut down. A title whose
coherent_fileholds a ~26 GB need (with enough commit) used to get 7 coherent windows. Nowcoherent_window_sizesstops at 6 x 4095 MB, and the GPU heaps past that leave the coherent window.note_coherent_need/settle_coherent_needalso report the smaller cap.Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T10:46:55Z.
Review: COMMENTED
Review of
0b4283d1: 3 finding(s). 3 are 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 Pipodi on 2026-12-02T11:23:37Z.
merge-check
base:
1c8b551475head:
0b4283d147merge: clean
build: cargo build --workspace -> ok (and
cargo build --release -p xcl-> ok)tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2912 passed, 0 failed, 51 ignored; SKIPPED: 25 (22 no wave64, 2 no heap windows, 1 cannot disable the driver cache); failing: none. Fail-without: on the merge with
XCL_SPARSE_WINDOWS=3(main's 3-window layout),cargo test -p xcl --lib gpu::uma::tests-> 15 passed, 7 failed, including the newsixteen_windows_keep_four_sparse_windowsanda_bvh_scratch_reservation_lands_in_the_fourth_sparse_window.review: read the whole diff (uma.rs, recomp/tests.rs, console_heap.rs, README). (1) Confirmed, and it is what the two checks weigh differently: with
XCL_UMA_WINDOWS=16the coherent window moves from 3 to 4, and the switch form thatwith_switch_fallback(real.rs ~5178) builds when the driver refuses a heap-window pipeline reaches only windows 0..3 (pso::windows_for_mode), so such a pipeline reads title coherent memory, per-draw args and readback buffers as 0. thehollowedone's test-only regression on this merge (added, then removed; not in the counts above): default -> 0 passed, 1 failed ("the switch fallback translates 4 windows but coherent memory starts in window 4");XCL_SPARSE_WINDOWS=3-> 1 passed. In the runs below and in earlier 16-window runs here the fallback never fired (0 "building it in the switch form" lines on the RTX 4090), so it bites only where the driver returns E_OUTOFMEMORY, but then silently. Both earlier checks agree nothing changes by default; the PR exists for the 16-window layout, and there it opens this gap, which its tests skip (gpu_sparse_vram_descriptors_buffers_and_xmemskips with a configuration reason). (2) The 4th window takes more than the BVH scratch: with 16 windows the title's 99776-page (6236 MiB) physical-page block now fits the sparse windows, so its homes go there instead of plain memory (the run withXCL_SPARSE_WINDOWS=3logs "AllocateTitlePhysicalPages(99776): no room in unified memory – their home is plain memory"; the default 16-window run does not). Every home committed there also takes a video-memory tile. (3) The layout tests readXCL_SPARSE_WINDOWSfrom the environment: a suite run withXCL_SPARSE_WINDOWS=3, as recomp/tests.rs suggests for that GPU test, fails 7 uma.rs tests (measured above). (4) README "1 to 8": with 4 windows values above 3 change nothing.performance: default 4-window layout unchanged (measured: smoke pair below). Opt-in 16-window layout costs memory: 60 s smoke runs of this merge on the retail title with
XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_UMA_WINDOWS=16 XCL_UMA_SHADOW=1 XCL_COHERENT_HEAPS=sparse:16: default (4 sparse) vsXCL_SPARSE_WINDOWS=3, at 60 s sparse CPU copy 6722 vs 6085 MB and sparse tiles (video) 6768 vs 6131 MB (+637 MB each); peak commit 25104 vs 27072 MB and frames 1522 vs 1605, both within noise of one run each, no removal or crash. In an earlier local run on the retail title's intro cinematic (older base, same 16-window settings) the same change grew from there to about +4 GB sparse CPU copy and +4 GB video tiles (27 GB of video memory against a 23 GB budget), a 24 % dearer write-watch look, and peak commit reaching our 52 GB kill cap;XCL_SPARSE_WINDOWS=3avoided it. Not measured on this head past 60 s.verdict: not yet: (1) with 16 windows the switch-form fallback no longer reaches the coherent window (reproduced with a test, not covered by the PR's tests or description); (2) the 4th window also takes the title's 6.2 GB physical-page homes into video memory, which needs a measurement past the menu or a limit to the BVH scratch case
hardware / tool and model: NVIDIA GeForce RTX 4090 24 GB, driver 621.40; Intel Core i9-13900K, 32 GB; Windows 11 build 26300; rustc 1.100.0, debug (tests) / release (smoke) / Claude Code, Claude Opus 5.5
Regression run (default layout, 60 s, standard presses, gamesave moved aside, one warm-up first)
main:
this merge (main
1c8b5514+ head0b4283d1):AI-written (Claude Code, Claude Opus 5.5) and posted by Pipodi.
Imported from ivall/xcl. Originally posted by bmjask on 2026-12-02T14:12:09Z.
@Prime1997 could you take a look at this one for review and merge? My automated review notes are above, if any.
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.