Repository navigation
D3D12.X: sparse tiles outside the GPU heaps can live in system memory - #2987
treybertram06 wants to merge 1 commit into
Conversation
|
Independent RTX 3080 Ti check of I extended the existing synthetic lazy first-write test to first verify L0 support with an eager control tile and then assert the lazy tile's pool class. On Windows 11 build 26300, RTX 3080 Ti (621.35), Ryzen 7 9800X3D, Rust 1.99.1 MSVC, I set Candidate fix and focused regression diffdiff --git a/crates/xcl/src/hle/d3d12x/sparse.rs b/crates/xcl/src/hle/d3d12x/sparse.rs
index 979b4d04..4f161733 100644
--- a/crates/xcl/src/hle/d3d12x/sparse.rs
+++ b/crates/xcl/src/hle/d3d12x/sparse.rs
@@ -1301,6 +1301,11 @@ impl State {
Some(((h, 0), false))
}
+ /// Choose backing by the title reservation that owns this tile.
+ unsafe fn take_tile_for(&mut self, t: usize) -> Option<((u32, u32), bool)> {
+ if sysmem_tiles() && !is_hot(t) { self.take_sys_tile() } else { self.take_tile() }
+ }
+
/// The heap of pool index `h` (video memory, or a system-memory pool with `SYS`).
fn pool_heap(&self, h: u32) -> ID3D12Heap {
if h & SYS != 0 {
@@ -1607,7 +1612,7 @@ impl State {
if self.mapped.get(&t).is_some_and(|e| e.pool == LAZY) {
let at_hand = !self.free.is_empty() || cooled(&self.cooling, std::time::Instant::now()) || !self.retired.is_empty();
let wait = left > 0 || (!force && self.short_of_memory() && !at_hand);
- match if wait { None } else { self.take_tile() } {
+ match if wait { None } else { self.take_tile_for(t) } {
Some((tile, used)) => {
if let Some(e) = self.mapped.get_mut(&t) {
e.pool = tile;
@@ -1665,7 +1670,7 @@ impl State {
self.to_zero.insert((t, TILE));
unparked = true;
} else {
- let got = if sysmem_tiles() && !is_hot(t) { self.take_sys_tile() } else { self.take_tile() };
+ let got = self.take_tile_for(t);
let Some((tile, reused)) = got else { break };
self.mapped.insert(t, TileEntry::with_holes(tile, initial_holes(t)));
early_add(&mut self.runs, t, t + TILE);
@@ -6083,7 +6088,10 @@ mod tests {
fn a_lazy_tile_gets_memory_at_its_first_bytes_and_keeps_them() {
let lazy = Lazy::on(true);
unsafe {
- let Some((base, mut s, queue)) = lazy_state(2) else { return crate::gpu::recomp::runner::skip_test("no GPU with tiled resources tier 2") };
+ let Some((base, mut s, queue)) = lazy_state(3) else { return crate::gpu::recomp::runner::skip_test("no GPU with tiled resources tier 2") };
+ let cold_control = base + 2 * TILE;
+ s.ensure_mapped(cold_control, TILE, |_| 0);
+ assert_ne!(s.mapped[&cold_control].pool.0 & SYS, 0, "eager cold tile uses system memory on this adapter");
s.commit_range(base, 2 * TILE);
assert_eq!(s.mapped[&base].pool, LAZY, "committed: listed with no video memory");
assert_eq!(s.mapped[&(base + TILE)].pool, LAZY);
@@ -6092,6 +6100,7 @@ mod tests {
let dirty = write_tile(base, 7);
s.before_execute_on(&queue, &dirty, PAGE);
assert_ne!(s.mapped[&base].pool, LAZY, "its first bytes gave it a pool tile");
+ assert_ne!(s.mapped[&base].pool.0 & SYS, 0, "lazy cold tile also uses system memory");
assert_eq!(s.mapped[&(base + TILE)].pool, LAZY, "the tile never written has none");
let cpu = std::slice::from_raw_parts(base as *const u8, TILE).to_vec();
assert!(window_bytes(&mut s, base, TILE) == cpu, "the bytes reached the GPU");The broader policy still needs the lazy path's |
|
8 GB VRAM / 16 GB RAM data point with Tested
Results
Not tested: repeats, AI use: build, run and log analysis by Claude Code agents (Claude Sonnet 5.5), report written and checked against the run logs by Claude Code (Claude Opus 5.5). |
|
RX 9070 / Wine: an eager sparse-window system-memory readback works in a focused native GPU fixture at Tested RX 9070 16 GB, RADV GFX1201 / Mesa 26.3.1, Ryzen 7 7700, CachyOS 7.3.0-5, GE-Proton11-12 / Wine 11.0 Staging, vkd3d-proton Compared the exact head with its actual parent
The fixture maps eagerly through
These are actual pool tags and native Every window word was checked after CPU upload, after partial native GPU writes with untouched regions retained, and after an owned wave64 shader loaded, transformed and stored every word through the same window. A separate width buffer verified lane count 64 and its 15 untouched guards. Independent Python verification checked all 10,223,872 readback words, including 39 MiB of window payload, across 64 native readbacks and 16 wave64 dispatches. Data, guards and shader containers match across sources, switches and fresh repeats. No device removal occurred. Not tested Lazy first-write materialization, including the bypass already reported here, the full kernelx AI use OpenAI Codex (GPT-6; exact serving variant not exposed) reviewed the public change, wrote and ran the fixture and independent verifier, and drafted this report. Publication authorized by the account owner. |
|
New, separate finding on #2987 head I added a synthetic one-tile GPU regression that commits cold, flushes the mapping, verifies the SYS pool bit, decommits, calls The candidate acquires a video-memory replacement before touching the parked mapping, then unmaps and quarantines the old tile behind the existing queue fences. It leaves pinned tiles on their existing backing so placed-buffer aliases remain intact. It is a focused local candidate, not a full proof of safe retirement under every queue schedule; the author should review and extend the pinned/blocked-queue tests before merging. Candidate correction and regression diffdiff --git a/crates/xcl/src/hle/d3d12x/sparse.rs b/crates/xcl/src/hle/d3d12x/sparse.rs
index 979b4d04..cae3e6a3 100644
--- a/crates/xcl/src/hle/d3d12x/sparse.rs
+++ b/crates/xcl/src/hle/d3d12x/sparse.rs
@@ -1658,8 +1658,26 @@ impl State {
let mut t = first;
while t < end {
if !self.mapped.contains_key(&t) && !self.mirror_src.contains_key(&t) && self.window_index(t).is_some() {
- // still mapped there: no new mapping, what it held is cleared
- if let Some(tile) = self.parked.remove(&t).or_else(|| self.kept.remove(&t)) {
+ // A new GPU heap at this address cannot inherit a parked system-memory tile.
+ // Acquire its replacement first; keep the old mapping if video memory is unavailable.
+ if let Some(old) = self.parked.get(&t).copied().filter(|tile| is_hot(t) && tile.0 & SYS != 0 && !self.pinned.contains_key(tile)) {
+ let Some((tile, reused)) = self.take_tile() else { break };
+ let wi = self.window_index(t).expect("mapped window");
+ let (b, r) = (self.windows[wi].0, self.windows[wi].1.clone());
+ self.unmap_tiles(&r, b, &[t]);
+ TILE_WORK[2].fetch_add(1, Ordering::Relaxed);
+ self.signal();
+ self.quarantine_tiles(vec![old]);
+ self.parked.remove(&t);
+ self.mapped.insert(t, TileEntry::with_holes(tile, initial_holes(t)));
+ early_add(&mut self.runs, t, t + TILE);
+ if reused {
+ self.to_zero.insert((t, TILE));
+ }
+ self.pending.push(t);
+ new = true;
+ } else if let Some(tile) = self.parked.remove(&t).or_else(|| self.kept.remove(&t)) {
+ // still mapped there: no new mapping, what it held is cleared
self.mapped.insert(t, TileEntry::with_holes(tile, initial_holes(t)));
early_add(&mut self.runs, t, t + TILE);
self.to_zero.insert((t, TILE));
@@ -5506,6 +5524,38 @@ mod tests {
assert_eq!(system.0 & !SYS, video.0);
}
+ #[test]
+ fn a_parked_cold_tile_does_not_back_a_new_hot_heap() {
+ use windows_sys::Win32::System::Memory::MEM_RELEASE;
+
+ if !sysmem_tiles() {
+ return crate::gpu::recomp::runner::skip_test("XCL_SPARSE_SYSMEM=1 required");
+ }
+ let _lazy = Lazy::on(false);
+ unsafe {
+ let (base, mut s) = test_state_with_reserved(1);
+ s.commit_range(base, TILE);
+ s.flush_pending();
+ let cold = s.mapped[&base].pool;
+ if cold.0 & SYS == 0 {
+ s.wait_for(s.value);
+ drop(s);
+ assert_ne!(VirtualFree(base as *mut c_void, 0, MEM_RELEASE), 0);
+ return crate::gpu::recomp::runner::skip_test("system-memory pool unavailable");
+ }
+ s.decommit_range(base, TILE);
+ assert_eq!(s.parked.get(&base), Some(&cold));
+ note_hot(base, TILE);
+ s.commit_range(base, TILE);
+ assert_eq!(s.mapped[&base].pool.0 & SYS, 0, "a hot heap must use video memory");
+ s.flush_pending();
+ s.wait_for(s.value);
+ drop(s);
+ HOT.lock().unwrap().retain(|&(a, n)| a != base || n != TILE);
+ assert_ne!(VirtualFree(base as *mut c_void, 0, MEM_RELEASE), 0);
+ }
+ }
+
#[test]
fn aligned_tile_addresses_spread_across_hash_buckets() {
use std::hash::BuildHasher;Separate test-coverage note: with No game files or title executable were used. AI use: Codex (GPT-6.2 Sol) wrote and ran the red/green test and candidate; Codex (GPT-6.2 Astra) checked the mapping and fence sequence. |
|
Independent desktop NVIDIA verification of PR #2987 at head Environment
Targeted release tests & build (
|
| Command | Result |
|---|---|
cargo test --release -p xcl --lib -- hle::d3d12x::sparse::tests::the_title_gpu_heaps_are_hot_and_nothing_around_them --exact --nocapture (3 consecutive runs) |
1 passed; 0 failed; 0 ignored; 1727 filtered out × 3 (0.00s × 3, 0 skipped) |
cargo test --release -p xcl --lib -- hle::d3d12x::sparse:: --test-threads=1 --nocapture (3 consecutive runs) |
67 passed; 0 failed; 1 ignored; 1660 filtered out × 3 (5.20s, 4.74s, 4.98s, 0 skipped; 1 #[ignore]: early_commit_timing) |
cargo test --release -p xcl --lib -- hle::kernelx:: --test-threads=1 --nocapture (3 consecutive runs) |
61 passed; 0 failed; 1 ignored; 1666 filtered out × 3 (1.25s, 1.25s, 1.26s, 0 skipped; 1 #[ignore]: scatter_timing) |
cargo build --release -p xcl |
Clean build (2m 16s, exit 0, 0 new warnings in sparse.rs / kernelx.rs; pre-existing rbq_value warning unchanged from a5e2d851) |
Paired quiet 60 s retail smokes (title: 29640639, XCL_PREPARE=0 XCL_NETWORK=0)
Exact parent & merge-base (a5e2d851a503fc0e04609f773ea53f2d2c4e3269, XCL_PREPARE=0 XCL_NETWORK=0):
xcl-smoke v1
commit: a5e2d851a503fc0e04609f773ea53f2d2c4e3269
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1556 (PresentX 1556)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14755 MB
PR #2987 default (6c5904f9426ffdfd4772399c92bfa84ddf29f6e2, XCL_SPARSE_SYSMEM unset, XCL_PREPARE=0 XCL_NETWORK=0):
xcl-smoke v1
commit: 6c5904f9426ffdfd4772399c92bfa84ddf29f6e2
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1568 (PresentX 1568)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14740 MB
PR #2987 opt-in (6c5904f9426ffdfd4772399c92bfa84ddf29f6e2, XCL_SPARSE_SYSMEM=1, XCL_PREPARE=0 XCL_NETWORK=0):
xcl-smoke v1
commit: 6c5904f9426ffdfd4772399c92bfa84ddf29f6e2
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1541 (PresentX 1541)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14637 MB
Runtime memory & sparse-pool telemetry (xcl.log steady-state ~48–58 s)
| Run | Local VRAM | Non-local | Sparse VRAM pools (mapped) | Peak commit | Avg submit cost |
|---|---|---|---|---|---|
Parent a5e2d851 (default) |
6115 MB |
4741 MB |
896 MB (838 MB mapped) |
14755 MB |
0.17–0.18 ms |
PR #2987 default (XCL_SPARSE_SYSMEM unset) |
6116 MB |
4782 MB |
896 MB (838 MB mapped) |
14740 MB |
0.18–0.19 ms |
PR #2987 opt-in (XCL_SPARSE_SYSMEM=1) |
5218 MB (-898 MB / -14.7%) |
5597 MB (+815 MB) |
0 MB (0 MB mapped) |
14637 MB |
0.15–0.16 ms |
Under XCL_SPARSE_SYSMEM=1, the runtime log confirmed activation (sparse windows: XCL_SPARSE_SYSMEM=1 - tiles outside the title's GPU heaps in system memory) and system-memory pool heap growth (64 -> 128 -> 256 -> 512 MB logged at power-of-two checkpoints), keeping VRAM sparse pools at 0 MB and reducing RTX 4060 local VRAM usage by 898 MB with 0 device removals and 0 crashes.
Limits of coverage
- Verified the
note_hot/is_hotrange boundary predicate (the_title_gpu_heaps_are_hot_and_nothing_around_them3/3),hle::d3d12x::sparse::(67/0/1× 3),hle::kernelx::(61/0/1× 3), default-off non-regression, and liveXCL_SPARSE_SYSMEM=1L0 pool routing (-898 MBlocal VRAM) on RTX 4060 (8 GB). - The opt-in 60 s smoke ran with
XCL_SPARSE_SYSMEM=1alone (withoutXCL_COHERENT_HEAPS=sparse); did not run a combinedXCL_COHERENT_HEAPS=sparse+XCL_SPARSE_SYSMEM=1multi-minute post-menu world-load stress test. - Paired 60 s retail smokes ran with
XCL_PREPARE=0(XCL_NETWORK=0), bypassing startupprepare_for_launch, and the 2#[ignore]timing tests (early_commit_timing,scatter_timing) were not executed.
AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).
|
The Windows no-GPU CI run for head
On Windows 11 build 26300, RTX 3080 Ti / driver 621.35, the new Candidate test-only diffdiff --git a/crates/xcl/src/hle/d3d12x/sparse.rs b/crates/xcl/src/hle/d3d12x/sparse.rs
index 979b4d04..0605a02f 100644
--- a/crates/xcl/src/hle/d3d12x/sparse.rs
+++ b/crates/xcl/src/hle/d3d12x/sparse.rs
@@ -4943,12 +4943,25 @@ mod tests {
dev.expect("D3D12 device")
}
+ fn software_flags(flags: Option<u32>) -> bool {
+ use windows::Win32::Graphics::Dxgi::DXGI_ADAPTER_FLAG_SOFTWARE;
+ flags.map_or(true, |f| f & DXGI_ADAPTER_FLAG_SOFTWARE.0 as u32 != 0)
+ }
+
+ #[test]
+ fn unknown_adapter_uses_the_small_gpu_view_case() {
+ use windows::Win32::Graphics::Dxgi::DXGI_ADAPTER_FLAG_SOFTWARE;
+ assert!(software_flags(None));
+ assert!(software_flags(Some(DXGI_ADAPTER_FLAG_SOFTWARE.0 as u32)));
+ assert!(!software_flags(Some(0)));
+ }
+
/// Whether `dev` is a software device (WARP).
unsafe fn software(dev: &ID3D12Device) -> bool {
use windows::Win32::Graphics::Dxgi::*;
- let Ok(factory) = CreateDXGIFactory1::<IDXGIFactory4>() else { return false };
+ let Ok(factory) = CreateDXGIFactory1::<IDXGIFactory4>() else { return true };
let adapter: windows::core::Result<IDXGIAdapter1> = factory.EnumAdapterByLuid(dev.GetAdapterLuid());
- adapter.and_then(|a| a.GetDesc1()).is_ok_and(|d| d.Flags & DXGI_ADAPTER_FLAG_SOFTWARE.0 as u32 != 0)
+ software_flags(adapter.and_then(|a| a.GetDesc1()).ok().map(|d| d.Flags))
}
/// The small ones of an upload's runs go up in dispatches: each lands where it belongs (farAI use: Codex (GPT-6.2 Sol) traced the CI and source, wrote the candidate, and ran the focused tests. |
|
Tested PR #2987 ( Environment
Unit test
Paired A/B 240 s World Runs (
|
| Run | Commit / Env | Exit | Crashes / Removals | Frames (PresentX) |
Heavy world start (>=700 draws/2s) | Peak Commit | Peak Local VRAM | Peak Non-Local | Peak Target Pages | Peak Sparse Pools |
|---|---|---|---|---|---|---|---|---|---|---|
Base (180 s, default heaps) |
a5e2d851 |
0x0 |
0 / 0 |
1861 |
151.36 s |
25770 MB |
8974 MB |
4677 MB |
3880 MB |
2560 MB (2393 MB mapped) |
Base (240 s, default heaps) |
a5e2d851 |
0xc0000005 (188.46 s) |
2 / 0 |
— | 126.29 s |
25909 MB |
9351 MB |
4768 MB |
3864 MB |
2624 MB (2423 MB mapped) |
#2987 unset (240 s) |
6c5904f9, XCL_COHERENT_HEAPS=sparse |
0x0 |
0 / 0 |
1999 (0 1 3 last 3/2s) |
138.55 s |
31745 MB |
13121 MB |
2019 MB |
4380 MB |
5568 MB (5344 MB mapped) |
#2987 + XCL_SPARSE_SYSMEM=1 (240 s) |
6c5904f9, XCL_COHERENT_HEAPS=sparse, XCL_SPARSE_SYSMEM=1 |
0x0 |
0 / 0 |
1896 (1 2 2 last 3/2s) |
120.65 s |
31726 MB |
10560 MB |
4915 MB |
4518 MB |
2944 MB (2892 MB mapped) |
Summary
- Both
240 sruns underXCL_COHERENT_HEAPS=sparsereached the world cleanly and exited0x0with0device removals and0crashes on this 8 GB card. - Enabling
XCL_SPARSE_SYSMEM=1loggedsparse windows: XCL_SPARSE_SYSMEM=1 - tiles outside the title's GPU heaps in system memoryand reduced peak local VRAM by2,561 MB(13,121 MB->10,560 MB), shifting~2.6 GBof sparse pool allocations (5,568 MB->2,944 MBlocal; non-local2,019 MB->4,915 MB) into system memory while keeping the hot GPU heaps in local VRAM.
|
Follow-up on PR head
Tested: Windows 11 build 26300, RTX 3080 Ti / 621.35, Ryzen 7 9800X3D, rustc 1.99.1 MSVC. The revised synthetic tests force the feature on their own thread and include GPU readback, L0 capability checks, failed-allocation preservation, batched replacement, pinned backing, and release cleanup. Not tested: A clean-commit paired title smoke, AMD/Intel, and a live placed-buffer alias. The diff is uncommitted and is a candidate for the author to review; it is not merge-ready evidence. The separate lazy first-write finding still needs its allocator-path fix. Revised candidate fix and focused regressions (uncommitted diff)diff --git a/crates/xcl/src/hle/d3d12x/sparse.rs b/crates/xcl/src/hle/d3d12x/sparse.rs
index 979b4d04..d29f3b30 100644
--- a/crates/xcl/src/hle/d3d12x/sparse.rs
+++ b/crates/xcl/src/hle/d3d12x/sparse.rs
@@ -388,15 +388,30 @@ struct SysPools {
unsafe impl Send for SysPools {}
static SYS_POOLS: Mutex<Option<SysPools>> = Mutex::new(None);
-/// the title's GPU heaps in the sparse windows (`XCL_COHERENT_HEAPS=sparse`): (start, bytes)
-static HOT: Mutex<Vec<(usize, usize)>> = Mutex::new(Vec::new());
+/// The title's GPU heaps in the sparse windows (`XCL_COHERENT_HEAPS=sparse`): start -> bytes.
+/// UMA reservations do not overlap; lookup is per tile, so keep it logarithmic.
+static HOT: Mutex<BTreeMap<usize, usize>> = Mutex::new(BTreeMap::new());
/// `[a, a + n)` is a GPU heap of the title: its tiles keep video memory under `XCL_SPARSE_SYSMEM`.
pub fn note_hot(a: usize, n: usize) {
- HOT.lock().unwrap().push((a, n));
+ HOT.lock().unwrap().insert(a, n);
+}
+
+/// A released reservation no longer determines the pool class at this address.
+pub fn forget_hot(a: usize, n: usize) {
+ let mut hot = HOT.lock().unwrap();
+ if hot.get(&a) == Some(&n) {
+ hot.remove(&a);
+ #[cfg(test)]
+ tests::FORGOT_HOT_FOR_TEST.with(|c| c.set(a));
+ }
}
fn sysmem_tiles() -> bool {
+ #[cfg(test)]
+ if let Some(on) = tests::SYSMEM_TILES_FOR_TEST.with(|c| c.get()) {
+ return on;
+ }
static ON: std::sync::OnceLock<bool> = std::sync::OnceLock::new();
*ON.get_or_init(|| {
let on = std::env::var("XCL_SPARSE_SYSMEM").is_ok_and(|v| v.trim() == "1");
@@ -408,7 +423,7 @@ fn sysmem_tiles() -> bool {
}
fn is_hot(a: usize) -> bool {
- HOT.lock().unwrap().iter().any(|&(s, n)| a >= s && a < s + n)
+ HOT.lock().unwrap().range(..=a).next_back().is_some_and(|(&start, &len)| a - start < len)
}
/// Bytes of the system-memory pool heaps.
@@ -1265,7 +1280,11 @@ impl State {
}
/// `take_tile` from the system-memory pools (`XCL_SPARSE_SYSMEM`).
- unsafe fn take_sys_tile(&mut self) -> Option<((u32, u32), bool)> {
+ unsafe fn take_sys_tile(&mut self, strict: bool) -> Option<((u32, u32), bool)> {
+ #[cfg(test)]
+ if tests::SYS_FALLBACK_FOR_TEST.with(|c| c.get()) {
+ return if strict { None } else { self.take_tile() };
+ }
self.drain_quarantined();
let mut g = SYS_POOLS.lock().unwrap();
let p = g.get_or_insert_with(SysPools::default);
@@ -1285,9 +1304,11 @@ impl State {
};
let mut heap: Option<ID3D12Heap> = None;
if let Err(e) = super::title_textures::own_work(|| self.dev.CreateHeap(&desc, &mut heap)) {
- crate::xlog_warn!("sparse windows: no system-memory pool heap ({e}) - video memory instead");
+ if !strict {
+ crate::xlog_warn!("sparse windows: no system-memory pool heap ({e}) - video memory instead");
+ }
drop(g);
- return self.take_tile();
+ return if strict { None } else { self.take_tile() };
}
let heap = heap?;
let _ = heap.SetName(windows::core::w!("xcl sparse system-memory pool"));
@@ -1574,10 +1595,11 @@ impl State {
let end = a.saturating_add(n);
let mut t = a & !(TILE - 1);
let mut new = false;
+ let mut parked = false;
while t < end {
if !self.mapped.contains_key(&t) && !self.mirror_src.contains_key(&t) && self.window_index(t).is_some() {
if self.parked.contains_key(&t) || self.kept.contains_key(&t) {
- self.ensure_mapped(t, TILE, |_| 0xFFFF);
+ parked = true;
} else {
self.mapped.insert(t, TileEntry::with_holes(LAZY, 0xFFFF));
early_add(&mut self.runs, t, t + TILE);
@@ -1592,6 +1614,9 @@ impl State {
if new {
MAPPED_GEN.fetch_add(1, Ordering::Release);
}
+ if parked {
+ self.ensure_mapped(a, n, |_| 0xFFFF);
+ }
}
/// The `LAZY` tiles of `[a, a + n)` get their video memory now (their mapping is pending,
@@ -1655,25 +1680,43 @@ impl State {
let end = a.saturating_add(n);
let mut new = false;
let mut unparked = false;
+ let mut replaced = Vec::new();
let mut t = first;
while t < end {
if !self.mapped.contains_key(&t) && !self.mirror_src.contains_key(&t) && self.window_index(t).is_some() {
- // still mapped there: no new mapping, what it held is cleared
- if let Some(tile) = self.parked.remove(&t).or_else(|| self.kept.remove(&t)) {
- self.mapped.insert(t, TileEntry::with_holes(tile, initial_holes(t)));
- early_add(&mut self.runs, t, t + TILE);
- self.to_zero.insert((t, TILE));
- unparked = true;
- } else {
- let got = if sysmem_tiles() && !is_hot(t) { self.take_sys_tile() } else { self.take_tile() };
- let Some((tile, reused)) = got else { break };
- self.mapped.insert(t, TileEntry::with_holes(tile, initial_holes(t)));
- early_add(&mut self.runs, t, t + TILE);
- if reused {
+ let want_sys = sysmem_tiles() && !is_hot(t);
+ let mut replaced_here = false;
+ if let Some(&old) = self.parked.get(&t).filter(|tile| (tile.0 & SYS != 0) != want_sys && !self.pinned.contains_key(tile)) {
+ let replacement = if want_sys { self.take_sys_tile(true) } else { self.take_tile() };
+ if let Some((tile, _)) = replacement {
+ self.parked.remove(&t);
+ self.mapped.insert(t, TileEntry::with_holes(tile, initial_holes(t)));
+ early_add(&mut self.runs, t, t + TILE);
self.to_zero.insert((t, TILE));
+ self.pending.push(t);
+ replaced.push(old);
+ new = true;
+ replaced_here = true;
+ }
+ }
+ if !replaced_here {
+ // A failed replacement keeps its existing backing, which is cleared on reuse.
+ if let Some(tile) = self.parked.remove(&t).or_else(|| self.kept.remove(&t)) {
+ self.mapped.insert(t, TileEntry::with_holes(tile, initial_holes(t)));
+ early_add(&mut self.runs, t, t + TILE);
+ self.to_zero.insert((t, TILE));
+ unparked = true;
+ } else {
+ let got = if want_sys { self.take_sys_tile(false) } else { self.take_tile() };
+ let Some((tile, reused)) = got else { break };
+ self.mapped.insert(t, TileEntry::with_holes(tile, initial_holes(t)));
+ early_add(&mut self.runs, t, t + TILE);
+ if reused {
+ self.to_zero.insert((t, TILE));
+ }
+ self.pending.push(t);
+ new = true;
}
- self.pending.push(t);
- new = true;
}
}
match t.checked_add(TILE) {
@@ -1684,7 +1727,10 @@ impl State {
if new || unparked {
MAPPED_GEN.fetch_add(1, Ordering::Release);
}
- if self.pending.len() >= PENDING_MAX {
+ if !replaced.is_empty() {
+ self.flush_pending();
+ self.quarantine_tiles(replaced);
+ } else if self.pending.len() >= PENDING_MAX {
self.flush_pending();
} else if !self.pending.is_empty() {
pending_soon();
@@ -2528,6 +2574,9 @@ pub unsafe fn alloc_as(size: usize, align: usize, hot: bool) -> Option<(usize, u
note_hot(addr, rounded);
}
if VirtualAlloc(addr as *const c_void, rounded, MEM_COMMIT, PAGE_READWRITE).is_null() {
+ if hot {
+ forget_hot(addr, rounded);
+ }
u.sparse_release(addr);
return None;
}
@@ -2559,6 +2608,7 @@ pub unsafe fn free(p: usize) -> bool {
let Some((start, len)) = u.sparse_reservation(p).filter(|&(start, _)| start == p) else { return false };
decommitted(start, len);
VirtualFree(p as *mut c_void, len, MEM_DECOMMIT);
+ forget_hot(start, len);
u.sparse_release(p).is_some()
}
@@ -4837,6 +4887,9 @@ mod tests {
pub(super) static LAZY_COMMITS_FOR_TEST: std::cell::Cell<Option<bool>> = const { std::cell::Cell::new(None) };
/// `take_tile` finds no video memory on this thread
pub(super) static NO_TILES: std::cell::Cell<bool> = const { std::cell::Cell::new(false) };
+ pub(super) static SYSMEM_TILES_FOR_TEST: std::cell::Cell<Option<bool>> = const { std::cell::Cell::new(None) };
+ pub(super) static SYS_FALLBACK_FOR_TEST: std::cell::Cell<bool> = const { std::cell::Cell::new(false) };
+ pub(super) static FORGOT_HOT_FOR_TEST: std::cell::Cell<usize> = const { std::cell::Cell::new(0) };
}
/// The runs of the tiles mapped, made from all of them (but those over a CPU view: their
@@ -5506,6 +5559,45 @@ mod tests {
assert_eq!(system.0 & !SYS, video.0);
}
+ #[test]
+ fn releasing_a_hot_sparse_reservation_clears_its_placement_class() {
+ let Some(u) = crate::gpu::uma::get() else {
+ return crate::gpu::recomp::runner::skip_test("no unified memory");
+ };
+ if !u.has_sparse() {
+ return crate::gpu::recomp::runner::skip_test("no sparse window");
+ }
+ unsafe {
+ FORGOT_HOT_FOR_TEST.with(|c| c.set(0));
+ let (p, _) = alloc_as(TILE, TILE, true).expect("hot sparse allocation");
+ assert!(is_hot(p));
+ assert!(free(p));
+ assert_eq!(FORGOT_HOT_FOR_TEST.with(|c| c.get()), p, "release must remove the hot marker before publishing the address");
+ let (q, _) = alloc(TILE, TILE).expect("cold sparse allocation");
+ if q == p {
+ assert!(!is_hot(q), "a cold allocation reusing the address must use the cold class");
+ }
+ assert!(free(q));
+ }
+ }
+
+ #[test]
+ fn kernelx_release_clears_a_hot_sparse_reservation() {
+ let Some(u) = crate::gpu::uma::get() else {
+ return crate::gpu::recomp::runner::skip_test("no unified memory");
+ };
+ if !u.has_sparse() {
+ return crate::gpu::recomp::runner::skip_test("no sparse window");
+ }
+ unsafe {
+ FORGOT_HOT_FOR_TEST.with(|c| c.set(0));
+ let (p, _) = alloc_as(TILE, TILE, true).expect("hot sparse allocation");
+ assert!(is_hot(p));
+ assert_eq!(crate::hle::kernelx::VirtualFree(p as *mut c_void, 0, windows_sys::Win32::System::Memory::MEM_RELEASE), 1);
+ assert_eq!(FORGOT_HOT_FOR_TEST.with(|c| c.get()), p, "kernelx release must remove the hot marker before publishing the address");
+ }
+ }
+
#[test]
fn aligned_tile_addresses_spread_across_hash_buckets() {
use std::hash::BuildHasher;
@@ -6020,14 +6112,38 @@ mod tests {
fn no_tiles(&self, none: bool) {
NO_TILES.with(|c| c.set(none));
}
+ fn sysmem(&self, on: bool) {
+ SYSMEM_TILES_FOR_TEST.with(|c| c.set(Some(on)));
+ }
+ fn sys_fallback(&self, on: bool) {
+ SYS_FALLBACK_FOR_TEST.with(|c| c.set(on));
+ }
}
impl Drop for Lazy {
fn drop(&mut self) {
LAZY_COMMITS_FOR_TEST.with(|c| c.set(None));
NO_TILES.with(|c| c.set(false));
+ SYSMEM_TILES_FOR_TEST.with(|c| c.set(None));
+ SYS_FALLBACK_FOR_TEST.with(|c| c.set(false));
}
}
+ unsafe fn custom_l0_heap_supported(dev: &ID3D12Device) -> bool {
+ let desc = D3D12_HEAP_DESC {
+ SizeInBytes: POOL_TILES as u64 * TILE as u64,
+ Properties: D3D12_HEAP_PROPERTIES {
+ Type: D3D12_HEAP_TYPE_CUSTOM,
+ CPUPageProperty: D3D12_CPU_PAGE_PROPERTY_WRITE_BACK,
+ MemoryPoolPreference: D3D12_MEMORY_POOL_L0,
+ ..Default::default()
+ },
+ Alignment: 0,
+ Flags: D3D12_HEAP_FLAG_DENY_RT_DS_TEXTURES | D3D12_HEAP_FLAG_DENY_NON_RT_DS_TEXTURES,
+ };
+ let mut heap: Option<ID3D12Heap> = None;
+ dev.CreateHeap(&desc, &mut heap).is_ok() && heap.is_some()
+ }
+
/// A state of `tiles` tiles for the lazy tests, its window's CPU pages committed and the title's
/// queue. None: no GPU whose unmapped tiles read zeros (the lazy path is left out there).
unsafe fn lazy_state(tiles: usize) -> Option<(usize, State, ID3D12CommandQueue)> {
@@ -6075,6 +6191,150 @@ mod tests {
(t..t + TILE).step_by(PAGE).collect()
}
+ #[test]
+ fn a_cold_system_pool_tile_is_visible_through_the_gpu_window() {
+ let eager = Lazy::on(false);
+ eager.sysmem(true);
+ unsafe {
+ let Some((base, mut s, queue)) = lazy_state(1) else {
+ return crate::gpu::recomp::runner::skip_test("no GPU with tiled resources tier 2");
+ };
+ if !custom_l0_heap_supported(&s.dev) {
+ drop(s);
+ assert_ne!(VirtualFree(base as *mut c_void, 0, windows_sys::Win32::System::Memory::MEM_RELEASE), 0);
+ return crate::gpu::recomp::runner::skip_test("no custom L0 heap");
+ }
+ s.commit_range(base, TILE);
+ let pool = s.mapped[&base].pool.0;
+ assert_ne!(pool & SYS, 0, "cold tile must use the system-memory pool");
+ assert_eq!(s.pool_heap(pool).GetDesc().Properties.MemoryPoolPreference, D3D12_MEMORY_POOL_L0);
+ let dirty = write_tile(base, 23);
+ s.before_execute_on(&queue, &dirty, PAGE);
+ let cpu = std::slice::from_raw_parts(base as *const u8, TILE);
+ assert!(window_bytes(&mut s, base, TILE) == cpu, "GPU window must contain the uploaded tile bytes");
+ s.wait_for(s.value);
+ drop(s);
+ assert_ne!(VirtualFree(base as *mut c_void, 0, windows_sys::Win32::System::Memory::MEM_RELEASE), 0);
+ }
+ }
+
+ #[test]
+ fn a_parked_cold_tile_is_replaced_when_the_address_becomes_hot() {
+ let eager = Lazy::on(false);
+ eager.sysmem(true);
+ unsafe {
+ let Some((base, mut s, _queue)) = lazy_state(1) else {
+ return crate::gpu::recomp::runner::skip_test("no GPU with tiled resources tier 2");
+ };
+ if !custom_l0_heap_supported(&s.dev) {
+ drop(s);
+ assert_ne!(VirtualFree(base as *mut c_void, 0, windows_sys::Win32::System::Memory::MEM_RELEASE), 0);
+ return crate::gpu::recomp::runner::skip_test("no custom L0 heap");
+ }
+ s.ensure_mapped(base, TILE, |_| 0);
+ assert_ne!(s.mapped[&base].pool.0 & SYS, 0, "initial cold tile uses system memory");
+ s.decommit_range(base, TILE);
+ assert_ne!(s.parked[&base].0 & SYS, 0, "cold tile remains parked at its address");
+ note_hot(base, TILE);
+ s.ensure_mapped(base, TILE, |_| 0);
+ assert_eq!(s.mapped[&base].pool.0 & SYS, 0, "new hot reservation needs video memory");
+ s.decommit_range(base, TILE);
+ assert_eq!(s.parked[&base].0 & SYS, 0, "hot tile remains parked at its address");
+ forget_hot(base, TILE);
+ s.ensure_mapped(base, TILE, |_| 0);
+ assert_ne!(s.mapped[&base].pool.0 & SYS, 0, "new cold reservation needs system memory");
+ assert!(window_bytes(&mut s, base, TILE).iter().all(|&b| b == 0), "new cold mapping starts clear");
+ s.wait_for(s.value);
+ drop(s);
+ assert_ne!(VirtualFree(base as *mut c_void, 0, windows_sys::Win32::System::Memory::MEM_RELEASE), 0);
+ }
+ }
+
+ #[test]
+ fn a_parked_video_fallback_survives_when_system_memory_and_video_allocation_fail() {
+ let eager = Lazy::on(false);
+ eager.sysmem(true);
+ eager.sys_fallback(true);
+ unsafe {
+ let Some((base, mut s, _queue)) = lazy_state(1) else {
+ return crate::gpu::recomp::runner::skip_test("no GPU with tiled resources tier 2");
+ };
+ s.ensure_mapped(base, TILE, |_| 0);
+ let old = s.mapped[&base].pool;
+ assert_eq!(old.0 & SYS, 0, "cold allocation falls back to video memory");
+ s.flush_pending();
+ s.decommit_range(base, TILE);
+ eager.no_tiles(true);
+ s.ensure_mapped(base, TILE, |_| 0);
+ assert_eq!(s.mapped[&base].pool, old, "failed replacement must keep usable backing");
+ assert!(window_bytes(&mut s, base, TILE).iter().all(|&b| b == 0));
+ eager.no_tiles(false);
+ s.wait_for(s.value);
+ drop(s);
+ assert_ne!(VirtualFree(base as *mut c_void, 0, windows_sys::Win32::System::Memory::MEM_RELEASE), 0);
+ }
+ }
+
+ #[test]
+ fn parked_pool_changes_remap_together_without_disturbing_the_next_address() {
+ let eager = Lazy::on(false);
+ eager.sysmem(true);
+ unsafe {
+ let Some((base, mut s, _queue)) = lazy_state(3) else {
+ return crate::gpu::recomp::runner::skip_test("no GPU with tiled resources tier 2");
+ };
+ if !custom_l0_heap_supported(&s.dev) {
+ drop(s);
+ assert_ne!(VirtualFree(base as *mut c_void, 0, windows_sys::Win32::System::Memory::MEM_RELEASE), 0);
+ return crate::gpu::recomp::runner::skip_test("no custom L0 heap");
+ }
+ s.ensure_mapped(base, 3 * TILE, |_| 0);
+ let old: Vec<_> = (0..3).map(|i| s.mapped[&(base + i * TILE)].pool).collect();
+ s.flush_pending();
+ s.decommit_range(base, 3 * TILE);
+ note_hot(base, 2 * TILE);
+ s.ensure_mapped(base, 2 * TILE, |_| 0);
+ assert_eq!(s.parked.get(&(base + 2 * TILE)), Some(&old[2]));
+ assert!((0..2).all(|i| s.mapped[&(base + i * TILE)].pool.0 & SYS == 0));
+ assert!(s.pending.is_empty(), "replacements must be published before old tiles are retired");
+ assert_eq!(s.quarantined.back().map(|b| b.tiles.len()), Some(2), "old tiles share one fence batch");
+ forget_hot(base, 2 * TILE);
+ s.wait_for(s.value);
+ drop(s);
+ assert_ne!(VirtualFree(base as *mut c_void, 0, windows_sys::Win32::System::Memory::MEM_RELEASE), 0);
+ }
+ }
+
+ #[test]
+ fn a_pinned_parked_tile_keeps_its_pool_for_a_placed_buffer() {
+ let eager = Lazy::on(false);
+ eager.sysmem(true);
+ unsafe {
+ let Some((base, mut s, _queue)) = lazy_state(1) else {
+ return crate::gpu::recomp::runner::skip_test("no GPU with tiled resources tier 2");
+ };
+ if !custom_l0_heap_supported(&s.dev) {
+ drop(s);
+ assert_ne!(VirtualFree(base as *mut c_void, 0, windows_sys::Win32::System::Memory::MEM_RELEASE), 0);
+ return crate::gpu::recomp::runner::skip_test("no custom L0 heap");
+ }
+ s.ensure_mapped(base, TILE, |_| 0);
+ let old = s.mapped[&base].pool;
+ s.flush_pending();
+ s.pinned.insert(old, 1);
+ s.decommit_range(base, TILE);
+ note_hot(base, TILE);
+ s.ensure_mapped(base, TILE, |_| 0);
+ assert_eq!(s.mapped[&base].pool, old, "placed-buffer alias must keep its existing pool tile");
+ assert!(s.quarantined.is_empty());
+ forget_hot(base, TILE);
+ s.pinned.remove(&old);
+ s.wait_for(s.value);
+ drop(s);
+ assert_ne!(VirtualFree(base as *mut c_void, 0, windows_sys::Win32::System::Memory::MEM_RELEASE), 0);
+ }
+ }
+
/// With `XCL_SPARSE_LAZY` a committed tile gets no video memory until the CPU's first bytes
/// go up to it; they reach the GPU, and a later submit with nothing written leaves them there
/// (a tile cleared one submit after its bytes went up would read zeros). A tile never written
diff --git a/crates/xcl/src/hle/kernelx.rs b/crates/xcl/src/hle/kernelx.rs
index 913b7fd1..569da074 100644
--- a/crates/xcl/src/hle/kernelx.rs
+++ b/crates/xcl/src/hle/kernelx.rs
@@ -1199,6 +1199,7 @@ pub unsafe extern "system" fn VirtualFree(addr: *mut c_void, size: usize, t: u32
mirrors::released(a);
forget_title_mappings(a, n);
let gone = mirrors::place_gone(a, n);
+ crate::hle::d3d12x::sparse::forget_hot(a, n);
u.sparse_release(a);
// (tiles may show pages kept here)
if mirrors::any_mapped() {AI use: Codex (GPT-6.2 Sol) revised the candidate and ran the tests; Codex (GPT-6.2 Astra) independently reviewed the replacement invariant. |
|
4 GB data point: GTX 1650 (driver 621.24), 16 GB RAM, Ryzen 5 1600, Windows 11 26300, head
Not tested: the same run with the switch unset. AI use: Claude Code (Claude Sonnet 5.5) built, ran and wrote this for @gefydev. |
|
Test of this PR's exact diff (
So on this card the switch moves about 2.9 GB out of video memory as intended, with no cost in commit and no stability problem in 10 minutes. It does not raise the present rate here (1.5-1.6 either way, one run each, so the difference is noise), and the process is still 3.6 GB over the budget; Not tested: the picture (the world is black on this machine on every build, see #505), a run longer than 10 minutes, AMD, default heap placement. Numbers are from the logs of these two runs. AI use: Claude Code (Claude Fable 5.2) ran the tests and wrote this. |
|
Follow-up, not a test of this PR alone: the same head plus b6fd1f2, texture pool pages in system memory past the budget, and the upload queue created with the device (local build). Local at the failing point 4.4 GB instead of 6.85 GB, no system-memory pool failures, but a AI use: Claude Code (Claude Sonnet 5.5) built, ran and wrote this for @gefydev. |
|
@thehollowedone thanks, all three are right. Fixed in
New tests (each fails on
The no-GPU CI failure ( @gefydev the Thanks to @3L1A5-1, @LocranKing and @throny for the runs. throny's numbers match mine: this switch moves memory out of video memory, and the frame-rate gain on a 10 GB card comes with the texture-level part, which I'll open next as a PR stacked on this one. AI use: Claude Code (Claude Opus 5.5) wrote the fixes and tests, ran them, and wrote this reply. |
6c5904f to
f8e75bc
Compare
|
I retested the stale hot-range lifecycle from my prototype report on head Three fresh-process controls passed with zero skips: normal This verifies reservation bookkeeping and policy selection. It does not allocate a GPU backing heap or measure physical residency, a retail workload, or performance. AI use: OpenAI Codex with GPT-6.2 Astra ran the controls; Codex reviewed and prepared this report. |
|
AMD run for the Not tested line. Tested: pass, head
The sparse tests make their device on the first adapter ( Not tested: AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report. |
|
merge-check Not tested here: a new retail-title run, AMD, Intel, a full suite on the local candidate, or a production L0-heap retirement change. Local retry candidate and isolated forced-failure regressiondiff --git a/crates/xcl/src/hle/d3d12x/sparse.rs b/crates/xcl/src/hle/d3d12x/sparse.rs
index 9a868283..80a9d2c9 100644
--- a/crates/xcl/src/hle/d3d12x/sparse.rs
+++ b/crates/xcl/src/hle/d3d12x/sparse.rs
@@ -572,6 +572,8 @@ struct State {
retired: Vec<(ID3D12Heap, u64, std::time::Instant)>,
/// when `retire_free_pools` last ran (`retire_due`)
retire_tried: std::time::Instant,
+ /// Delay another L0 heap request after the driver refuses one; existing L0 tiles remain reusable.
+ sys_retry_after: Option<std::time::Instant>,
/// tile address → pool tile + uncommitted page hole mask + per-page sent chunk hashes
mapped: FxHashMap<usize, TileEntry>,
/// pool tiles also used by placed buffers (not freed while they are)
@@ -1125,6 +1127,7 @@ unsafe fn new_state(dev: &ID3D12Device, windows: Vec<(usize, ID3D12Resource)>) -
cooling: VecDeque::new(),
retired: Vec::new(),
retire_tried: std::time::Instant::now(),
+ sys_retry_after: None,
mapped: FxHashMap::default(),
pinned: FxHashMap::default(),
parked: FxHashMap::default(),
@@ -1279,9 +1282,23 @@ impl State {
self.drain_quarantined();
let mut g = SYS_POOLS.lock().unwrap();
let p = g.get_or_insert_with(SysPools::default);
- if let Some(t) = reuse_tile(&mut p.free, &mut p.cooling, std::time::Instant::now()) {
+ let now = std::time::Instant::now();
+ if let Some(t) = reuse_tile(&mut p.free, &mut p.cooling, now) {
return Some((t, true));
}
+ if self.sys_retry_after.is_some_and(|at| now < at) {
+ drop(g);
+ return self.take_tile();
+ }
+ #[cfg(test)]
+ {
+ tests::SYS_HEAP_ATTEMPTS.with(|v| v.set(v.get() + 1));
+ if tests::REFUSE_SYS_HEAP.with(|v| v.get()) {
+ self.sys_retry_after = Some(now + std::time::Duration::from_secs(1));
+ drop(g);
+ return self.take_tile();
+ }
+ }
let desc = D3D12_HEAP_DESC {
SizeInBytes: POOL_TILES as u64 * TILE as u64,
Properties: D3D12_HEAP_PROPERTIES {
@@ -1295,10 +1312,12 @@ impl State {
};
let mut heap: Option<ID3D12Heap> = None;
if let Err(e) = super::title_textures::own_work(|| self.dev.CreateHeap(&desc, &mut heap)) {
+ self.sys_retry_after = Some(now + std::time::Duration::from_secs(1));
crate::xlog_warn!("sparse windows: no system-memory pool heap ({e}) - video memory instead");
drop(g);
return self.take_tile();
}
+ self.sys_retry_after = None;
let heap = heap?;
let _ = heap.SetName(windows::core::w!("xcl sparse system-memory pool"));
p.heaps.push(heap);
@@ -4877,6 +4896,8 @@ mod tests {
pub(super) static NO_TILES: std::cell::Cell<bool> = const { std::cell::Cell::new(false) };
/// `sysmem_tiles` (`XCL_SPARSE_SYSMEM`) for the test on this thread (`Lazy::sysmem`)
pub(super) static SYSMEM_FOR_TEST: std::cell::Cell<bool> = const { std::cell::Cell::new(false) };
+ pub(super) static REFUSE_SYS_HEAP: std::cell::Cell<bool> = const { std::cell::Cell::new(false) };
+ pub(super) static SYS_HEAP_ATTEMPTS: std::cell::Cell<usize> = const { std::cell::Cell::new(0) };
}
/// The runs of the tiles mapped, made from all of them (but those over a CPU view: their
@@ -5141,6 +5162,7 @@ mod tests {
cooling: VecDeque::new(),
retired: Vec::new(),
retire_tried: std::time::Instant::now(),
+ sys_retry_after: None,
mapped: FxHashMap::default(),
pinned: FxHashMap::default(),
parked: FxHashMap::default(),
@@ -5472,6 +5494,7 @@ mod tests {
cooling: VecDeque::new(),
retired: Vec::new(),
retire_tried: std::time::Instant::now(),
+ sys_retry_after: None,
parked: FxHashMap::default(),
kept: FxHashMap::default(),
pending: Vec::new(),
@@ -5726,6 +5749,7 @@ mod tests {
cooling: VecDeque::new(),
retired: Vec::new(),
retire_tried: std::time::Instant::now(),
+ sys_retry_after: None,
mapped: FxHashMap::default(),
pinned: FxHashMap::default(),
parked: FxHashMap::default(),
@@ -5852,6 +5876,7 @@ mod tests {
cooling: VecDeque::new(),
retired: Vec::new(),
retire_tried: std::time::Instant::now(),
+ sys_retry_after: None,
mapped: FxHashMap::default(),
pinned: FxHashMap::default(),
parked: FxHashMap::default(),
@@ -6175,6 +6200,46 @@ mod tests {
drop(lazy);
}
+ #[test]
+ fn refused_system_heap_is_not_retried_for_every_cold_tile() {
+ const CHILD: &str = "XCL_TEST_SYS_HEAP_REFUSAL_CHILD";
+ if std::env::var_os(CHILD).is_none() {
+ unsafe {
+ let dev = test_device();
+ let mut o = D3D12_FEATURE_DATA_D3D12_OPTIONS::default();
+ if software(&dev)
+ || dev.CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS, &mut o as *mut _ as *mut c_void, std::mem::size_of_val(&o) as u32).is_err()
+ || o.TiledResourcesTier.0 < D3D12_TILED_RESOURCES_TIER_2.0
+ {
+ return crate::gpu::recomp::runner::skip_test("no GPU with tiled resources tier 2");
+ }
+ }
+ let output = std::process::Command::new(std::env::current_exe().unwrap())
+ .args(["--exact", "hle::d3d12x::sparse::tests::refused_system_heap_is_not_retried_for_every_cold_tile", "--nocapture"])
+ .env(CHILD, "1")
+ .output()
+ .unwrap();
+ assert!(output.status.success(), "{}\n{}", String::from_utf8_lossy(&output.stdout), String::from_utf8_lossy(&output.stderr));
+ return;
+ }
+ let eager = Lazy::on(false);
+ eager.sysmem(true);
+ unsafe {
+ let Some((base, mut s, _)) = lazy_state(5) else { return crate::gpu::recomp::runner::skip_test("no GPU with tiled resources tier 2") };
+ REFUSE_SYS_HEAP.with(|v| v.set(true));
+ SYS_HEAP_ATTEMPTS.with(|v| v.set(0));
+ s.ensure_mapped(base, 4 * TILE, |_| 0);
+ REFUSE_SYS_HEAP.with(|v| v.set(false));
+ assert_eq!(s.mapped.len(), 4, "fallback maps every tile");
+ assert!(s.mapped.values().all(|e| e.pool.0 & SYS == 0), "fallback uses video memory");
+ assert_eq!(SYS_HEAP_ATTEMPTS.with(|v| v.get()), 1, "one failed L0 allocation should suppress repeats in the same burst");
+ s.sys_retry_after = Some(std::time::Instant::now() - std::time::Duration::from_millis(1));
+ s.ensure_mapped(base + 4 * TILE, TILE, |_| 0);
+ assert_eq!(SYS_HEAP_ATTEMPTS.with(|v| v.get()), 2, "the L0 request is retried after the delay");
+ }
+ drop(eager);
+ }
+
/// A system-memory tile parked at an address that is a GPU heap of the title by its next commit
/// gives way to a video-memory tile, mapped there before the old one goes (behind the fences),
/// and the heap's bytes reach the GPU through the new one. |
|
merge-check claim |
|
merge-check |
|
Independent native validation of #2987 Tested A native 3 passed, 0 failed, 0 ignored, 0 explicit skips. Not tested A detached #2987-only build, load-time VRAM savings, or sustained retail use. AI use Codex GPT-6.2 ran the focused validation, checked the results, and prepared this report. |
|
AnyPS5 #27991 tests keeping sparse read-only address uploads current across backing changes. An XCL-specific check could move one tile from local to system backing while leaving a neighboring tile on the original heap, then compare both bytes and bytes re-uploaded. It separates always re-reading everything from refreshing only the mapping that actually changed. Existing capacity and pressure results are independent of this control. |
|
I checked the implemented system-to-local transition on RTX 5070 / NVIDIA 616.92 at head A test-only native fixture initialized two adjacent 64 KiB tiles, promoted and rewrote only the first from parked system backing to local VRAM, and read both back. All 65,536 bytes of the promoted tile matched the new value; the neighbor retained its original pool mapping and all 65,536 original bytes. Instrumented upload selection recorded one 65,536-byte dirty upload and no clears for that submit. A subsequent clean submit recorded zero upload bytes and both tiles remained correct. The focused test passed with no skips. The fixture supplies the dirty-page list directly. It checks upload selection and GPU contents for this transition, not Windows dirty-page discovery, the reverse transition, or retail bandwidth/performance. AI use: OpenAI Codex with GPT-6.2 Astra built and ran the fixture; Codex reviewed and prepared this report. |
|
Rebased onto
AI use: Claude Code (Claude Opus 5.5) did the rebase, the fixes and the runs. |
With XCL_COHERENT_HEAPS=sparse the title's GPU heaps (committed memory with a PAGE_GRAPHICS_* protection, ~4.5 GB in a retail title) live in the sparse windows. Those are the data the title's shaders read and write every frame; in the coherent window (system memory, read over PCIe) one retail compute program took 1,364 ms a frame on an RTX 3080, under 33 ms in video memory. With them in video memory the windows hold ~7.5 GB of tiles and the device ran out of its budget (19 GB in use against 8.9 GB, removed at 659 s). XCL_SPARSE_SYSMEM=1 (off by default): kernelx registers a GPU heap's range as hot before its commit maps its tiles (sparse::alloc_as); every other sparse-window tile takes a pool tile in system-memory pool heaps (custom heaps, L0, write-back), which the GPU reads over PCIe. A pool tile of those heaps has SYS in its pool index; freed ones cool in their own lists, kept by the heap's number without SYS (the free table is indexed by heap number). RTX 3080, retail title, 400 s of its world after the menus: heaps in video memory alone 0.98 presents/s and 19 GB of video memory; with this and the texture-level counterpart 1.70 presents/s, 12.7 GB, no device removal in 900 s. An RTX 4080 report on xcl-dev#2688 found the same with a port of it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
merge-check cargo test -p xcl --lib -- uma_driver: main 9dfbe3e 3x with --test-threads=1 and 1x with 4: 8 passed, 0 failed each time; merge of this head 3x with 1 and 1x with 4: 8 passed, 0 failed each time. The same two tests failed the same way in our suite run of #2041 (an acphal-only change) on 2026-11-29, so they are the parallel-run flake of #3187, not this PR (which does not touch uma_driver). (25 SKIPPED lines). Base alone at 9dfbe3e: gpu_direct_image_get_resinfo_d16 fails there too (#3533).review: no new finding. Compared with our earlier check (f8e75bc): rebased onto main and onto #2898's per-heap FreePools; the system-memory pools now keep their own FreePools indexed by the heap number without SYS (SYS is masked before add_heap and in cool()), so a SYS tile never reaches the video-memory free table (which would size its table by 1<<31); the replaced-tile test now checks that. pool_bytes no longer counts quarantined SYS tiles as video memory (our earlier point). The swap path now uses initial_state() and quarantine_tiles_for with the queue completion snapshot, as main does. Lock order is one way (sparse state, then SYS_POOLS; take_sys_tile drains the quarantine before taking SYS_POOLS and drops it before falling back to take_tile). Mirrors (new_mirror) keep video memory. Still open from the earlier check, opt-in path only: system-memory pool heaps are never retired, take_sys_tile retries CreateHeap for every tile after a refusal without backoff, and the activity counter undercounts mapped bytes. Default path: every new branch first checks XCL_SPARSE_SYSMEM; the only default change is that kernelx notes each GPU heap in the small HOT table (and forgets it on release). performance: no default cost beyond one OnceLock read per tile taken (reasoned); the PR's own smoke runs (RTX 3080, switch off) show 1583 frames vs main's 1578. verdict: safe to merge (default path; the opt-in follow-ups above stay open) hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite). |
|
Independent RTX 3080 Ti regression check of PR #2987 at head The new regression fails on the unmodified PR head: after the test disables video-memory pool allocations, the hot tile remains Tested: Windows 11 build 26300, NVIDIA GeForce RTX 3080 Ti (12,288 MiB; driver 621.40), rustc 1.99.1 MSVC. On the unmodified head, the focused regression reported 0 passed, 1 failed, 0 ignored. With the candidate applied, A separate Candidate runtime fix and regressiondiff --git a/crates/xcl/src/hle/d3d12x/sparse.rs b/crates/xcl/src/hle/d3d12x/sparse.rs
index c9c38d37..22736d1b 100644
--- a/crates/xcl/src/hle/d3d12x/sparse.rs
+++ b/crates/xcl/src/hle/d3d12x/sparse.rs
@@ -3914,13 +3914,15 @@ impl State {
let end = a.saturating_add(n);
let mut t = a & !(TILE - 1);
let (mut got, mut left) = (0, 0);
+ let (mut video_failed, mut sys_failed) = (false, false);
while t < end {
if self.mapped.get(&t).is_some_and(|e| e.pool == LAZY) {
let at_hand = !self.free.is_empty() || cooled(&self.cooling, std::time::Instant::now()) || !self.retired.is_empty();
// (short of video memory: a tile of the system-memory pools does not wait for it)
let sys = sysmem_tiles() && !is_hot(t);
- let wait = left > 0 || (!force && !sys && self.short_of_memory() && !at_hand);
- match if wait { None } else { self.take_tile_for(t) } {
+ let failed = if sys { sys_failed } else { video_failed };
+ let wait = failed || (!force && !sys && self.short_of_memory() && !at_hand);
+ match if wait { None } else if sys { self.take_sys_tile() } else { self.take_tile() } {
Some((tile, used)) => {
if let Some(e) = self.mapped.get_mut(&t) {
e.pool = tile;
@@ -3933,7 +3935,12 @@ impl State {
}
None => {
if !wait {
- self.no_memory = Some(std::time::Instant::now());
+ if sys {
+ sys_failed = true;
+ } else {
+ video_failed = true;
+ self.no_memory = Some(std::time::Instant::now());
+ }
}
left += 1;
}
@@ -11545,6 +11552,47 @@ mod tests {
drop(lazy);
}
+ /// A failed video-memory allocation for a hot tile must not prevent an adjacent cold tile
+ /// from using the available system-memory pool for its upload.
+ #[test]
+ fn a_hot_tile_without_video_memory_does_not_block_a_cold_system_memory_tile() {
+ let lazy = Lazy::on(true);
+ lazy.sysmem(true);
+ unsafe {
+ let Some((base, mut s, queue)) = lazy_state(3) else { return crate::gpu::recomp::runner::skip_test("no GPU with tiled resources tier 2") };
+ let probe = base + 2 * TILE;
+ s.ensure_mapped(probe, TILE, |_| (0, 0));
+ let probe_uses_sys = s.mapped.get(&probe).is_some_and(|entry| entry.pool != LAZY && entry.pool.0 & SYS != 0);
+ if !probe_uses_sys {
+ return crate::gpu::recomp::runner::skip_test("no system-memory pool heap");
+ }
+
+ note_hot(base, TILE);
+ struct ForgetHot(usize);
+ impl Drop for ForgetHot {
+ fn drop(&mut self) { forget_hot(self.0); }
+ }
+ let _hot = ForgetHot(base);
+
+ s.commit_range(base, 2 * TILE);
+ let cold = base + TILE;
+ assert_eq!(s.mapped[&base].pool, LAZY);
+ assert_eq!(s.mapped[&cold].pool, LAZY);
+
+ lazy.no_tiles(true);
+ s.give_memory(&[(base, 2 * TILE)]);
+ assert_eq!(s.mapped[&base].pool, LAZY, "the hot tile remains unbacked without video memory");
+ assert_ne!(s.mapped[&cold].pool, LAZY, "the adjacent cold tile still gets a pool tile");
+ assert_ne!(s.mapped[&cold].pool.0 & SYS, 0, "the cold tile uses system memory");
+
+ let dirty = write_tile(cold, 29);
+ s.before_execute_on(&queue, &dirty, PAGE);
+ let cpu = std::slice::from_raw_parts(cold as *const u8, TILE).to_vec();
+ assert_eq!(window_bytes(&mut s, cold, TILE), cpu, "the GPU sees the cold tile's bytes");
+ }
+ drop(lazy);
+ }
+
/// A system-memory tile parked at an address that is a GPU heap of the title by its next commit
/// gives way to a video-memory tile, mapped there before the old one goes (behind the fences),
/// and the heap's bytes reach the GPU through the new one.AI use: OpenAI Codex (GPT-6.2 Sol) wrote the regression and candidate and ran the GPU tests; OpenAI Codex (GPT-6.2 Astra) reviewed the allocation-class design and identified the class-selection and unsupported-adapter corrections. |
|
#3039 contains all of this PR's added lines because it is stacked on it: its first commit is this PR's 15b7431, and only its top commit ( AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human. |
| } | ||
| let heap = heap?; | ||
| let _ = heap.SetName(windows::core::w!("xcl sparse system-memory pool")); | ||
| p.heaps.push(heap); |
There was a problem hiding this comment.
Each 64 MiB heap added to SYS_POOLS.heaps remains there for the process lifetime; unlike the video pools, the system-memory pools have no all-free retirement path. A workload that temporarily grows this pool can therefore retain its peak L0 allocation after all tiles are cooled and freed. Could empty system heaps be retired once their tiles are unmapped and the sparse-queue fence has passed, with a test that sys_pool_bytes() decreases? AI-assisted static review: I used an AI assistant to inspect the allocation and release paths.
There was a problem hiding this comment.
Confirmed from the diff: SYS_POOLS.heaps only grows (sys_pool_bytes() is heaps.len() * POOL_TILES * TILE, and nothing removes a heap), while the video pools have their retired path. Our world runs show the size it reaches: with XCL_SPARSE_SYSMEM=1 the process's non-local (system) video memory went from 3.9 GB at the start to 8.7 GB at the end of a 900 s run (run 398), against 3.6 → 4.9 GB without it (run 397), RTX 4080, same build. So about 3.8 GB of system-memory pool, which with this code stays for the rest of the process even if the tiles cool. Since the switch is off by default it does not affect the default path (that is what our merge check above covers), but retirement of all-free system heaps after the sparse-queue fence, with a test that sys_pool_bytes() drops, would be needed before it could ever be turned on by default. @treybertram06
AI use: Claude Code (Claude Opus 5.5) read the diff and the run logs.
|
In-world result, RTX 4080 16 GB (621.40), current
So it takes about 3.5 GB off video memory (nearly down to the budget) at no measurable cost in presents/s. One earlier run with it (393) lost the device at 130 s; the three since ran 900 s clean, so I can't tie that loss to the switch. No other device removal or crash. AI use: Claude Code (Claude Opus 5.5). |
|
merge-check |
|
AMD / Wine data point for Not a test of this PR alone. Environment: RX 7800 XT 16 GB (RADV NAVI32), Ryzen 7 7800X3D, 30 GB RAM, NixOS, kernel 7.3.5, Wine. Release build. Same save, 600 s each, one run per arm. Result: exit 0x0, 2527 frames shown, 0 device removals, 0 page faults, 0 ring timeouts, 0 resets.
About 3.5 GB of sparse tiles did leave video memory, but the DXGI local charge only fell by 253 MiB: So on a 16 GB AMD card with the trimmed stack it is stable and correct as far as this run shows, but it is not a lever for the budget. I did not look into where the Not tested: NVIDIA / Windows, the unit tests of this PR, other hardware, more than one run per arm, a longer run than 600 s. AI-assisted (Claude Code, Claude Opus 5.5): the build, the runs and the numbers come from an agent; the owner reviewed this before posting. |
|
@treybertram06 @gut0to: #3613 carries this PR's commit unchanged (rebased on current AI use: Claude Code (Claude Opus 5.5). |
…mory With XCL_TEXTURE_LEVEL_PAGES=1 a streamed texture's levels get video memory pages as their texels arrive. On a 10 GB card a retail world holds 1.5-2 GB of them beside 3 GB of render targets and the title's GPU heaps, past the budget Windows gives the process, which then pages whatever it likes. XCL_TEXTURE_SYSMEM=1 (off by default, with level pages): those levels take their pages from pool heaps in system memory (custom heaps, L0, write-back), which the GPU samples over PCIe. Render targets and every other texture keep video memory: they are written every frame (xcl-dev#1702 moves all pages instead). A page of those heaps has SYS_TILE in its heap index; freed ones cool in their own pool. RTX 3080 10 GB, retail title, XCL_COHERENT_HEAPS=sparse with XCL_SPARSE_SYSMEM=1 (xcl-dev#2987), 610 s: video memory at the end 15.1 -> 11.9 GB local, presents in the 400 s after the menus 0.72 -> 1.35 a second (one run each). Without the sparse part it is slower (0.15): the heaps the GPU reads over PCIe share the bus with the levels. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…re pools to L0 Add opt-in XCL_L0_VRAM_MARGIN_MB (default 0 = disabled) to dynamically spill new sparse tile pools (sparse.rs) and sampled-only texture tile pools (vram.rs) to D3D12_MEMORY_POOL_L0 (system memory) once DXGI local VRAM usage is within the configured headroom margin of budget. Render targets, depth buffers, and UAV textures (!evictable) always stay in local DEFAULT VRAM, never share L0-backed pages (isolated via ExtraKey = (va, tile_index, local_only)), and keep_pools skips L0 heaps. Non-OOM adapter refusals of custom L0 heaps are cached per heap class so subsequent allocations go straight to DEFAULT. Distinct from xcl-dev#3614 (two-pass UAV buffers in bind.rs, untouched here), xcl-dev#3112 (stale draft on amd-dev), xcl-dev#2987 (static sparse cap), and xcl-dev#3039 (unconditional streamed texture sysmem).
…re pools to L0 Add opt-in XCL_L0_VRAM_MARGIN_MB (default 0 = disabled) to dynamically spill new sparse tile pools (sparse.rs) and sampled-only texture tile pools (vram.rs) to D3D12_MEMORY_POOL_L0 (system memory) once DXGI local VRAM usage is within the configured headroom margin of budget. Render targets, depth buffers, and UAV textures (!evictable) always stay in local DEFAULT VRAM, never share L0-backed pages (isolated via ExtraKey = (va, tile_index, local_only)), and keep_pools skips L0 heaps. Non-OOM adapter refusals of custom L0 heaps are cached per heap class so subsequent allocations go straight to DEFAULT. Distinct from xcl-dev#3614 (two-pass UAV buffers in bind.rs, untouched here), xcl-dev#3112 (stale draft on amd-dev), xcl-dev#2987 (static sparse cap), and xcl-dev#3039 (unconditional streamed texture sysmem).
…re pools to L0 Add opt-in XCL_L0_VRAM_MARGIN_MB (default 0 = disabled) to dynamically spill new sparse tile pools (sparse.rs) and sampled-only texture tile pools (vram.rs) to D3D12_MEMORY_POOL_L0 (system memory) once DXGI local VRAM usage is within the configured headroom margin of budget. Render targets, depth buffers, and UAV textures (!evictable) always stay in local DEFAULT VRAM and keep_pools skips L0 heaps. When a non-evictable target binds a console page currently backed by an L0 heap (DENY_RT_DS_TEXTURES), bind_range promotes the page in-place to a local VRAM tile, cools the old L0 tile, and remaps any live mapped aliases in Pages::targets onto the promoted local tile so aliased reads never observe stale data. Non-OOM adapter refusals of custom L0 heaps are cached per heap class. Distinct from xcl-dev#3614 (two-pass UAV buffers in bind.rs, untouched here), xcl-dev#3112 (stale draft on amd-dev), xcl-dev#2987 (static sparse cap), xcl-dev#3039 / xcl-dev#1702 (unconditional sysmem opt-ins), and xcl-dev#3587 (amd-dev).
…re pools to L0 Add opt-in XCL_L0_VRAM_MARGIN_MB (default 0 = disabled) to dynamically spill new sparse tile pools (sparse.rs) and sampled-only texture tile pools (vram.rs) to D3D12_MEMORY_POOL_L0 (system memory) once DXGI local VRAM usage is within the configured headroom margin of budget. Render targets, depth buffers, and UAV textures (!evictable) always stay in local DEFAULT VRAM and keep_pools skips L0 heaps. When a non-evictable target binds a console page currently backed by an L0 heap (DENY_RT_DS_TEXTURES), bind_range promotes the page in-place to a local VRAM tile, cools the old L0 tile, and remaps any live mapped aliases in Pages::targets onto the promoted local tile so aliased reads never observe stale data. Non-OOM adapter refusals of custom L0 heaps are cached per heap class. Distinct from xcl-dev#3614 (two-pass UAV buffers in bind.rs, untouched here), xcl-dev#3112 (stale draft on amd-dev), xcl-dev#2987 (static sparse cap), xcl-dev#3039 / xcl-dev#1702 (unconditional sysmem opt-ins), and xcl-dev#3587 (amd-dev).
Target:
main. This was opened againstnvidia-dev; #3203 merged that intomain, and this is rebased ontomaind52ff48c. Part of #2688. Related: gefydev's planned budget-triggered L0 sparse pools (#2688), and #1702 (texture pages in system memory).With
XCL_COHERENT_HEAPS=sparsethe title's GPU heaps live in the sparse windows instead of the coherent window. These heaps are committed memory with aPAGE_GRAPHICS_*protection, about 4.5 GB in a retail title. Shaders read and write them every frame. In the coherent window (system RAM, read over PCIe), one retail compute program took 1,364 ms per frame on an RTX 3080; with the heaps in video memory it falls under 33 ms (XCL_GPU_TIMES). An RTX 4080 report on #2688 found the same factor. But with the heaps in video memory, the sparse windows hold about 7.5 GB of tiles. On a 10 GB card the device runs out of budget: 19 GB in use against 8.9 GB, removed at 659 s.XCL_SPARSE_SYSMEM=1(off by default) keeps the GPU heaps' tiles in video memory and puts every other sparse-window tile in system memory:sparse::alloc_as) before its commit maps its tiles;MEMORY_POOL_L0, write-back), which the GPU reads over PCIe.gefydev's plan moves new pools past the budget. This one decides by what a range holds, so the heaps the shaders depend on are never the ones moved.
What is in it
D3D12.X: sparse tiles outside the GPU heaps can live in system memory(hle/d3d12x/sparse.rs,hle/kernelx.rs):note_hot/is_hot/alloc_asmark the hot ranges;SysPools, pool index tagged withSYS) with their own free and cooling lists. Since the rebase onto D3D12.X: pack sparse pool tile reuse into the fullest heap #2898, these lists are aFreePoolsof their own, kept by the heap's number withoutSYS, because the free table is indexed by heap number;pool_heapresolves either kind;take_tile_for);forget_hot, fromsparse::freeand kernelx'sMEM_RELEASE);pool_bytesno longer counts quarantined system-memory tiles as video memory (throny's merge-check).the_title_gpu_heaps_are_hot_and_nothing_around_them,a_lazy_tile_outside_the_gpu_heaps_gets_system_memory,a_parked_system_memory_tile_gives_way_to_a_gpu_heap. The last two fail without their fixes. Since the rebase, the last one also checks that the replaced tile cools among the system-memory pools and not in the video-memory free table; that check fails when the index is not masked. Undercfg(test)the switch follows a thread-local a test sets, not the environment.Tested
xcl.exe(xcl run:xcl nvprofileputs xcl.exe in an NVIDIA profile with a bigger shader heap (#2403) #2590). Debug tests, release title runs.cargo test --workspace --no-fail-fast -- --test-threads=4, withXCL_DXC_DIRset to DXC 1.9, at this PR's head15b74314: 2879 passed, 1 failed, 51 ignored.gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16, also fails onmaind52ff48cwithout this change (2876 passed, 1 failed, 51 ignored there).SKIPPED: 22no wave64, 2no heap windows. The same onmain.cargo test -p xcl --lib system_memory: 2 passed, 0 failed, no skips.6c5904f9(before the review fixes and the rebase ontomain; not rerun since),XCL_COHERENT_HEAPS=sparse XCL_SPARSE_SYSMEM=1 XCL_TEXTURE_LEVEL_PAGES=1 XCL_PREPARE_WORKERS=6, scripted presses. Over the 400 s after the menus: 0.72 presents/s, video memory 15.1 GB local / 5.0 GB non-local (budget 9.2 GB), commit 41.5 GB, no device removal.XCL_GPU_TIMESwith the heaps in the coherent window: the top programcs 10eaefe801508781took 1,364 ms per frame. With them in video memory, the top program is under 70 ms.Regression run
Base, a commit of
main:d52ff48c.smoke.ps1now setsXCL_PREPARE=0, somain's launch preparation gate no longer holds the run, and the base is currentmainagain. The switch is off in both runs. A 60 s warm-up run ofmaincame first.This PR's head:
Not tested
XCL_COHERENT_HEAPS=sparseisn't onamd-dev. A 16 GB RDNA3 card stays under its budget anyway (oni-swr on [OFFICIAL] Swarm: RAM and VRAM use down, towards stable 30 FPS on AMD and NVIDIA #2688).0x887a0006, at 48 s and 202 s); the cause is not known. Runs without these switches also lose it on this title ([OFFICIAL] Swarm: RAM and VRAM use down, towards stable 30 FPS on AMD and NVIDIA #2688).0x8007000E) at 805 s.AI use