UMA: support 8/16 heap windows (5/13 coherent) with 3-sparse (12 GiB) cap #1998
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1998
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1998/head"
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?
@raylitebull on GitHub · 2026-11-25 00:32 UTC · original
raylitebull:feat/heap-windows-16-v2→main· +341 −66 · 8 files · 2 commits · merged 2026-11-25 01:49 UTCAdds multi-coherent 8- and 16-window UMA layouts (
XCL_HEAP_WINDOWS=1withXCL_UMA_WINDOWS=8|16), while capping runtime sparse VRAM windows at 3 (12 GiB) so expanded layouts keep 5 or 13 committed coherent windows (max_coherent_windows), alongside sparse 64 KiB GPU-view mirror cleanup on release.Part of #1833.
What is in it
crates/xcl/src/gpu/uma.rs: addMAX_HEAP_WINDOWS = 16, multi-coherent pool sizing (max_coherent_windows,max_coherent_bytes,coherent_window_sizes), 3-window (12 GiB) sparse cap on runtime 8/16-window layouts, anduma::tests(runtime_layout_supports_eight_and_sixteen_heap_windows,expanded_runtime_layout_splits_large_coherent_heaps_across_multiple_windows).crates/xcl/src/gpu/dxil/kernel.rs,crates/xcl/src/gpu/recomp/emit.rs,mod.rs,runner.rs: shader translation & DXIL validation support for expanded heap-window layouts (expanded_heap_window_shaders_translate_and_validate).crates/xcl/src/hle/d3d12x/console_heap.rs&real.rs: expanded descriptor heap/window view registration.crates/xcl/src/hle/kernelx.rs: register and clean up sparse 64 KiB GPU-view mirrors (sparse_64k_reservation_registers_gpu_view_mirror_and_releases_cleanly).Tested
rustc 1.99.1 (58cf8f9c3 2026-10-13), rebased cleanly onto6567c5f(06308bc).cargo check --workspace --tests: passed.cargo test -p xcl --lib runtime_layout_supports_eight_and_sixteen_heap_windows: 1 passed, 0 failed.cargo test -p xcl --lib expanded_heap_window_shaders_translate_and_validate: 1 passed, 0 failed.cargo test -p xcl --lib expanded_runtime_layout_splits_large_coherent_heaps_across_multiple_windows: 1 passed, 0 failed.cargo test -p xcl --lib sparse_64k_reservation_registers_gpu_view_mirror_and_releases_cleanly: 1 passed, 0 failed.06308bc:@WebIdentity1(NVIDIA RTX 3090, HLSL + Direct DXIL):3/0/0passed on 8- and 16-window tests (plus negative control2/1/0).@futurepro62(NVIDIA RTX 5070 Ti:990 passed, 0 failed, 43 ignored; AMD Radeon RDNA2 iGPU:1000 passed, 0 failed, 45 ignored), including all 4 new#1998tests.@Anon64(NVIDIA RTX 3060, 60 sscripts/smoke.ps1pair vsmain80f4819):1606vs1588frames (101%),0device removals,0crashes,24883MB vs25184MB peak commit (98%).Regression run
60 s
scripts/smoke.ps1pair on exact head06308bcvsmain80f4819(NVIDIA GeForce RTX 3060 12 GB, driver 581.80, Windows 11 26200, release,XCL_NETWORK=0, A pressed every 4 s from 20 s on a retail title), contributed by@Anon64:main
80f4819:this PR:
Not tested
AI use
6567c5f, and unit tests; the author reviewed the diff and test output.@WebIdentity1 on GitHub · 2026-11-25 00:56 UTC · original · edited 2026-11-25 01:00 UTC
Verified expanded-window GPU access at
06308bc61a16a1cd4fb395f8e3704f3aba41b757on RTX 3090. Adapted the existing high-window regression from #822 (e9705bb935c4a4e2064127d3f5bfa26fab89e674, same XCL GPL-2.0-only code) to check both 8 windows / window 7 and 16 windows / window 15, with 1 MiB committed per window. The test exercises scalar and buffer loads, global loads/stores/atomic-add, and a window-0 sentinel.One coverage trap:
tests::direct_oraccepts at most four windows and otherwise returns HLSL, even withXCL_DIRECT_DXIL=1. The attached test explicitly calls the direct translator for expanded layouts, so these results cover both paths.Tested — native Windows 10 19045, Ryzen 7 7800X3D, RTX 3090 driver 591.74, Rust 1.98.1 MSVC, DXC 1.8.2502.11, debug. Exact head plus the test-only patch below; no runtime changes in positive runs.
Common environment:
XCL_ADAPTER=3090,XCL_REQUIRE_GPU=wave64,mesh,XCL_SPLIT_WAVE64=1.XCL_DIRECT_DXILunsetXCL_DIRECT_DXIL=1kernel::mem_windowsrestored to.clamp(1, 4), Direct DXIL(0, 0)instead of(0xC0FFEE, 0x1234); both controls still passZero skips in all three runs. All 311 source-file hashes matched before/after, with XCL rebuilt at each source switch. The negative control changes only
gpu/dxil/kernel.rs; the positive source manifests are identical. The inherited assertion text still says “window 1”; in the failing expanded case the actual target is window 7.Not tested — full workspace suite, retail smoke/gameplay, runtime sparse/coherent allocation and mirror cleanup, multi-GiB memory pressure, graphics stages, AMD, or performance improvement. These results establish the high-window access path, not that this PR resolves world loading or reduces total memory. #822 remains relevant overlapping layout work; this is complementary test coverage for the current author-owned PR, not another implementation.
AI use — Codex (GPT-6) reviewed the paths, adapted the test with provenance, ran native tests and prepared this report.
Test-only patch (26 additions, 8 deletions)
@futurepro62 on GitHub · 2026-11-25 01:26 UTC · original
Full-suite run, since this PR has no test report yet. Tested exact head
06308bc(on its base6567c5f).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests: 990 passed, 0 failed, 43 ignored. SKIPPED (no wave64):a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu,a_per_lane_2d_or_3d_group_runs_on_the_gpu,coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu,cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu,gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware,the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu.runtime_layout_supports_eight_and_sixteen_heap_windows,expanded_heap_window_shaders_translate_and_validate,expanded_runtime_layout_splits_large_coherent_heaps_across_multiple_windows,sparse_64k_reservation_registers_gpu_view_mirror_and_releases_cleanly.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1: 1000 passed, 0 failed, 45 ignored. SKIPPED:f16_programs_on_the_gpu(f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))),f32_programs_on_the_gpu(f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))),f32_programs_on_the_gpu(f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).--skipleaves out tests that fail on main7994cd1too, not because of this PR. On NVIDIA:heap_window_out_of_memory_falls_back_to_the_switch_form(#1651), the fourgpu::recomp::lower_dxil::tests::*_programs_on_the_gputests andconst_and_null_mask_operands_agree_with_hlsl_on_the_gpu(follow-up on #1651) fail becauserunner::skip_testturns their skips into failures underXCL_REQUIRE_GPU=mesh, andgpu::dxil::fuzz_testsseeds 70, 545, 1019 and 1507 failCreateComputePipelineStatewithE_OUTOFMEMORYon this card (drivers 616.64 and 621.40). On AMD:fuzz_validate_and_gpu_1fails on seed 540 (res[833]0x7 vs CPU 0x6). The AMD run does not setXCL_REQUIRE_GPU.Not tested
AI use
@Anon64 on GitHub · 2026-11-25 01:47 UTC · original
Regression run for this PR: head
06308bc, based onmain80f4819. RTX 3060 12 GB (581.80, wave32), Windows 11 26200, release,XCL_NETWORK=0, A pressed every 4 s from 20 s,scripts/smoke.ps1on a retail title for 60 s, in one batch with themainrun.main
80f4819:this PR:
No device removals or crashes; 101 % of main's frames, 98 % of its peak commit.
Not tested: the whole suite; world loading; whether the title reaches all of the changed code in these 60 s (default settings:
XCL_DIRECT_DXILandXCL_HEAP_WINDOWSunset).Written with Claude Code (Claude Opus 5.5) from runs on this machine.
@raylitebull on GitHub · 2026-11-25 01:48 UTC · original
Thanks @Anon64 for running and sharing the 60 s
scripts/smoke.ps1pair on06308bcvs80f4819(1606vs1588frames,0device removals,0crashes,24883MB vs25184MB peak commit) — added to the PR description! Thanks also to @futurepro62 (RTX 5070 Ti + AMD Radeon RDNA2 iGPU full suite) and @WebIdentity1 (RTX 3090 8/16-window GPU verification) for verifying exact head06308bc.@DavidM1911 on GitHub · 2026-11-25 03:42 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!