Repository navigation
Conversation
…mory A retail title places streamed textures over reserved-only graphics address space and maps physical pages only where tiles are resident. Every 64 KiB page of each such texture got its own page of video memory anyway: on spawn 22,808 textures held 6 GB, 4.3 GB of it over addresses with no title memory, and local video memory went 2 GB past the budget (title_memory_mb does not bound it, xcl-dev#646). An owned page of a placed texture in a graphics reservation is now mapped only while the title has memory there (committed, a physical page, or one mapped and not yet touched). Commits, decommits, releases and physical-page maps/unmaps there are noted (title_memory_changed) and the pages follow before the title's next submit: one UpdateTileMappings per texture and heap, then the pages fence. Unmapped tiles read zero (tier 2). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The title's GPU views (kernelx::mirrors: its Bink video planes and more, placed in the no-access twin of a CPU reservation) are never committed themselves; title_textures fills them from the CPU view. The followed pages there were left unmapped and read zero: no intro video, missing textures. title_backed looks through mirrors::source, and changes in a CPU view are noted for its GPU view too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
RX 7900 XT on Windows, retail Series X profile. I compared parent 930e8b4 and head 73b6001 with matching controller instrumentation, separate cold application caches, DRED enabled and a 28 GiB job limit. I verified distinct executable hashes at launch. Both recorded two presents and stopped before the account picker. The last activity samples were 6.004 s and 8.006 s respectively. In both process snapshots, waiting-thread stack scans contained sparse statistics, resource release in This pair cannot evaluate world-stage residency on this machine. The same startup signature on the parent previously cleared with the #789/#968 combination (earlier comparison). The controller script waits for two matching account-picker frames, so it sent no input in either run. Integration follow-up: I added #1514 to the local #789/#968 stack on the same Series X profile. This time it passed the account picker, displayed loading artwork and streamed assets. Near 90 seconds, target pages were 2,467 MB (3,648 MB pooled), with process commit 18,623 MB. The older #789/#968 run without #1514 at 90.5 s recorded 7,949 MB target pages (8,448 MB pooled) and 26,638 MB process commit. Application cache state, preload settings and input timing differed between these two runs, so the difference is descriptive only. The new run ended in device removal at 159.309 s (0x887a0006), DRED fault VA 0x1f0480000, no matching existing or recently freed allocation. Peak process commit 26,866 MB. No visible playable scene. The standalone parent/head comparison above remains the matched startup comparison. Run 88 repeated the cold-cache residency integration on main 9e3831e with #789 and #1514 (#968 is in main). RX 7900 XT, 28 GiB whole-job commit limit, saved Series X profile. Scripted A selected Player1 at about 41 s. The last positive present interval ended at 188.538 s. The last capture (frame 1640) was flat green. Peak sampled process commit was 28,088 MB. No DRED removal was logged. Exit was 0xc0000409. The faulting XCL thread's stack scan contained the Rust allocation failure handler, miniz zlib inflate, and the DirectStorage queue worker. This identifies another failure during streaming under the test limit. Multiple changes separate this build from the previous comparison, so I cannot attribute this outcome to #1514. |
|
Native NVIDIA/AMD follow-up for exact head Tested
At the failing AMD phase, Not tested: retail/world loading, the count and cost of NULL mapping calls across thousands of textures, discrete AMD GPUs, release build, shader sampling, or any other driver. The test directly invokes the public kernel memory hooks and VRAM placement; it does not run a game or title executable. The local fixture and diagnostic are uncommitted. The first fixture used a 128 KiB reservation and accidentally exercised XCL's sparse window; that setup error was corrected to 24 GiB virtual reservations before these results. AI use: Codex (GPT-6) wrote the synthetic fixture and diagnostic, ran the native tests, checked the outputs, and prepared this report. Complete test fixture and diagnostic
//! Local PR1514 diagnostic. Run alone in a fresh process: owns graphics reservations/global VRAM state.
use super::*;
use windows::Win32::Graphics::{Direct3D::D3D_FEATURE_LEVEL_12_0, Dxgi::*, Dxgi::Common::*};
use crate::hle::kernelx;
unsafe fn drain(queue: &ID3D12CommandQueue, dev: &ID3D12Device) {
let fence: ID3D12Fence = dev.CreateFence(0, D3D12_FENCE_FLAG_NONE).unwrap();
queue.Signal(&fence, 1).unwrap();
let start = std::time::Instant::now();
while fence.GetCompletedValue() == 0 && start.elapsed().as_secs() < 10 {
std::thread::sleep(std::time::Duration::from_millis(1));
}
assert_eq!(fence.GetCompletedValue(), 1, "queue drained");
dev.GetDeviceRemovedReason().unwrap();
}
unsafe fn buffer(dev: &ID3D12Device, heap: D3D12_HEAP_TYPE, state: D3D12_RESOURCE_STATES) -> ID3D12Resource {
let desc = D3D12_RESOURCE_DESC { Dimension: D3D12_RESOURCE_DIMENSION_BUFFER, Width: (2 * PAGE) as u64,
Height: 1, DepthOrArraySize: 1, MipLevels: 1, SampleDesc: DXGI_SAMPLE_DESC { Count: 1, Quality: 0 },
Layout: D3D12_TEXTURE_LAYOUT_ROW_MAJOR, ..Default::default() };
let mut out = None;
dev.CreateCommittedResource(&D3D12_HEAP_PROPERTIES { Type: heap, ..Default::default() }, D3D12_HEAP_FLAG_NONE,
&desc, state, None, &mut out).unwrap();
out.unwrap()
}
fn transition(resource: &ID3D12Resource, from: D3D12_RESOURCE_STATES, to: D3D12_RESOURCE_STATES) -> D3D12_RESOURCE_BARRIER {
D3D12_RESOURCE_BARRIER { Type: D3D12_RESOURCE_BARRIER_TYPE_TRANSITION,
Anonymous: D3D12_RESOURCE_BARRIER_0 { Transition: std::mem::ManuallyDrop::new(D3D12_RESOURCE_TRANSITION_BARRIER {
pResource: unsafe { std::mem::transmute_copy(resource) }, Subresource: D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES,
StateBefore: from, StateAfter: to }) }, ..Default::default() }
}
unsafe fn roundtrip(dev: &ID3D12Device, queue: &ID3D12CommandQueue, a: &ID3D12Resource, b: &ID3D12Resource,
upload: &ID3D12Resource, readback: &ID3D12Resource, write: Option<[u32; 2]>, expected: [u32; 2], phase: &str) -> usize {
// Distinguish a NULL tile read from a copy that leaves the previous readback bytes untouched.
let mut sentinel = std::ptr::null_mut();
readback.Map(0, None, Some(&mut sentinel)).unwrap();
std::ptr::write_bytes(sentinel as *mut u8, 0xA5, 2 * PAGE);
readback.Unmap(0, None);
before_execute(queue);
if let Some(values) = write {
let mut p = std::ptr::null_mut();
upload.Map(0, None, Some(&mut p)).unwrap();
let words = std::slice::from_raw_parts_mut(p as *mut u32, 2 * PAGE / 4);
words[..PAGE / 4].fill(values[0]); words[PAGE / 4..].fill(values[1]);
upload.Unmap(0, None);
}
let alloc: ID3D12CommandAllocator = dev.CreateCommandAllocator(D3D12_COMMAND_LIST_TYPE_DIRECT).unwrap();
let list: ID3D12GraphicsCommandList = dev.CreateCommandList(0, D3D12_COMMAND_LIST_TYPE_DIRECT, &alloc, None).unwrap();
let alias = D3D12_RESOURCE_BARRIER { Type: D3D12_RESOURCE_BARRIER_TYPE_ALIASING,
Anonymous: D3D12_RESOURCE_BARRIER_0 { Aliasing: std::mem::ManuallyDrop::new(D3D12_RESOURCE_ALIASING_BARRIER::default()) }, ..Default::default() };
list.ResourceBarrier(&[alias.clone()]);
let coord = D3D12_TILED_RESOURCE_COORDINATE::default();
let region = D3D12_TILE_REGION_SIZE { NumTiles: 2, UseBox: false.into(), ..Default::default() };
if write.is_some() {
list.ResourceBarrier(&[transition(a, D3D12_RESOURCE_STATE_COMMON, D3D12_RESOURCE_STATE_COPY_DEST)]);
list.CopyTiles(a, &coord, ®ion, upload, 0, D3D12_TILE_COPY_FLAG_LINEAR_BUFFER_TO_SWIZZLED_TILED_RESOURCE);
list.ResourceBarrier(&[transition(a, D3D12_RESOURCE_STATE_COPY_DEST, D3D12_RESOURCE_STATE_COMMON), alias]);
}
list.ResourceBarrier(&[transition(b, D3D12_RESOURCE_STATE_COMMON, D3D12_RESOURCE_STATE_COPY_SOURCE)]);
let src = D3D12_TEXTURE_COPY_LOCATION { pResource: std::mem::transmute_copy(b),
Type: D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX,
Anonymous: D3D12_TEXTURE_COPY_LOCATION_0 { SubresourceIndex: 0 } };
let dst = D3D12_TEXTURE_COPY_LOCATION { pResource: std::mem::transmute_copy(readback),
Type: D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT,
Anonymous: D3D12_TEXTURE_COPY_LOCATION_0 { PlacedFootprint: D3D12_PLACED_SUBRESOURCE_FOOTPRINT {
Offset: 0, Footprint: D3D12_SUBRESOURCE_FOOTPRINT { Format: DXGI_FORMAT_R32_UINT,
Width: 256, Height: 128, Depth: 1, RowPitch: 1024 } } } };
list.CopyTextureRegion(&dst, 0, 0, 0, &src, None);
list.ResourceBarrier(&[transition(b, D3D12_RESOURCE_STATE_COPY_SOURCE, D3D12_RESOURCE_STATE_COMMON)]);
list.Close().unwrap();
super::super::title_textures::own_work(|| queue.ExecuteCommandLists(&[Some(list.cast().unwrap())]));
drain(queue, dev);
let mut p = std::ptr::null_mut();
readback.Map(0, None, Some(&mut p)).unwrap();
let words = std::slice::from_raw_parts(p as *const u32, 2 * PAGE / 4);
let mut shape = D3D12_TILE_SHAPE::default();
dev.GetResourceTiling(b, None, None, Some(&mut shape), None, 0, std::ptr::null_mut());
let tw = shape.WidthInTexels as usize;
let th = shape.HeightInTexels as usize;
assert_eq!(tw * th * 4, PAGE);
let tile_index = |i: usize| ((i / 256) / th) * (256 / tw) + ((i % 256) / tw);
let wrong = words.iter().enumerate().filter(|&(i, &v)| v != expected[tile_index(i)]).count();
let observed = [words[0], words[if tw < 256 { tw } else { th * 256 }]];
println!("tile_shape={tw}x{th}");
readback.Unmap(0, None);
let g = PAGES.lock().unwrap();
let pages = g.get(&(dev.as_raw() as usize)).unwrap().as_ref().unwrap();
let active = pages.pages.values().filter(|p| p.users > 0).count();
println!("phase={phase} expected={expected:x?} observed={observed:x?} words_checked={} wrong={wrong} active_pages={active} pool_bytes={}", 2 * PAGE / 4, pages.pools.len() * POOL_PAGES as usize * PAGE);
wrong
}
#[test]
fn paired_graphics_texture_tiles_follow_cpu_backing() {
unsafe {
let factory: IDXGIFactory6 = CreateDXGIFactory2(DXGI_CREATE_FACTORY_FLAGS(0)).unwrap();
let selector = crate::gpu::adapter::Selector::from_env_or("auto");
let Some((adapter, desc)) = crate::gpu::adapter::candidates(&factory, &selector).into_iter().next() else {
return crate::gpu::recomp::runner::skip_test("no GPU");
};
println!("adapter={}", crate::gpu::adapter::name(&desc));
let dev = crate::gpu::agility::create_device(&adapter, D3D_FEATURE_LEVEL_12_0).unwrap();
let mut options = D3D12_FEATURE_DATA_D3D12_OPTIONS::default();
dev.CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS, &mut options as *mut _ as *mut c_void, std::mem::size_of_val(&options) as u32).unwrap();
assert!(options.TiledResourcesTier.0 >= 2 && options.ResourceHeapTier.0 >= 2, "native tier2 tiled resources and heaps");
super::super::real::adopt(dev.as_raw(), super::super::real::Kind::Device);
// Reserve 24 GiB of VA per view, beyond the UMA windows, to exercise the graphics fallback.
// Only two 64 KiB pages are ever committed; the large ranges themselves consume no backing.
let cpu = kernelx::VirtualAlloc(std::ptr::null(), 24usize << 30, 0x2040_2000, 0x4);
let gpu = kernelx::VirtualAlloc(std::ptr::null(), 24usize << 30, 0x2040_2000, 0x801);
assert!(!cpu.is_null() && !gpu.is_null());
assert!(kernelx::in_graphics_reservation(cpu as usize) && kernelx::in_graphics_reservation(gpu as usize));
assert_eq!(kernelx::mirrors::source(gpu as usize), Some(cpu as usize));
let desc = D3D12_RESOURCE_DESC { Dimension: D3D12_RESOURCE_DIMENSION_TEXTURE2D, Width: 256, Height: 128,
DepthOrArraySize: 1, MipLevels: 1, Format: DXGI_FORMAT_R32_UINT,
SampleDesc: DXGI_SAMPLE_DESC { Count: 1, Quality: 0 }, ..Default::default() };
let make = || {
let mut p = std::ptr::null_mut();
let hr = place_pages(dev.as_raw(), gpu as usize, &desc, D3D12_RESOURCE_STATE_COMMON.0 as u32, std::ptr::null(),
Some((2 * PAGE) as u64), &ID3D12Resource::IID as *const _ as *const windows_sys::core::GUID, &mut p);
assert!(hr.is_some_and(|hr| hr >= 0) && !p.is_null(), "reserved texture placed");
let res = ID3D12Resource::from_raw(p);
let mut count = 0;
dev.GetResourceTiling(&res, Some(&mut count), None, None, None, 0, std::ptr::null_mut());
assert_eq!(count, 2, "two 64 KiB texture tiles");
res
};
let (a, b) = (make(), make());
let queue: ID3D12CommandQueue = dev.CreateCommandQueue(&D3D12_COMMAND_QUEUE_DESC::default()).unwrap();
let upload = buffer(&dev, D3D12_HEAP_TYPE_UPLOAD, D3D12_RESOURCE_STATE_GENERIC_READ);
let readback = buffer(&dev, D3D12_HEAP_TYPE_READBACK, D3D12_RESOURCE_STATE_COPY_DEST);
let mut wrong = roundtrip(&dev, &queue, &a, &b, &upload, &readback, Some([0x11111111, 0x22222222]), [0, 0], "reserved");
assert_eq!(kernelx::VirtualAlloc(cpu, PAGE, 0x1000, 0x4), cpu);
wrong += roundtrip(&dev, &queue, &a, &b, &upload, &readback, Some([0x33333333, 0x44444444]), [0x33333333, 0], "first-committed");
let second = (cpu as usize + PAGE) as *mut c_void;
assert_eq!(kernelx::VirtualAlloc(second, PAGE, 0x1000, 0x4), second);
wrong += roundtrip(&dev, &queue, &a, &b, &upload, &readback, Some([0x55555555, 0x66666666]), [0x55555555, 0x66666666], "both-committed");
assert_ne!(kernelx::VirtualFree(cpu, PAGE, 0x4000), 0);
wrong += roundtrip(&dev, &queue, &a, &b, &upload, &readback, None, [0, 0x66666666], "first-decommitted");
{ let g = PAGES.lock().unwrap(); let ps = g.get(&(dev.as_raw() as usize)).unwrap().as_ref().unwrap();
let f = ps.follow.get(&(gpu as usize)).unwrap();
println!("decommit_tracking mapped={} users={} page_present={} fence={}/{}", f.mapped, f.users.len(), ps.pages.contains_key(&(gpu as usize)), ps.fence.GetCompletedValue(), ps.value);
assert!(!f.mapped);
drain(&ps.queue, &dev);
}
wrong += roundtrip(&dev, &queue, &a, &b, &upload, &readback, None, [0, 0x66666666], "first-decommitted-again");
assert_eq!(kernelx::VirtualAlloc(cpu, PAGE, 0x1000, 0x4), cpu);
wrong += roundtrip(&dev, &queue, &a, &b, &upload, &readback, Some([0x77777777, 0x88888888]), [0x77777777, 0x88888888], "recommitted");
assert_ne!(kernelx::VirtualFree(cpu, 0, 0x8000), 0);
wrong += roundtrip(&dev, &queue, &a, &b, &upload, &readback, None, [0, 0], "cpu-released");
drop((a, b));
drain(&queue, &dev);
assert_ne!(kernelx::VirtualFree(gpu, 0, 0x8000), 0);
println!("phases=6 total_words_checked={} total_wrong={wrong}", 6 * 2 * PAGE / 4);
assert_eq!(wrong, 0, "GPU alias bytes must follow the paired CPU reservation's backing");
}
}Local diagnostic change to diff --git a/crates/xcl/src/hle/d3d12x/vram.rs b/crates/xcl/src/hle/d3d12x/vram.rs
index 7e99996..6321f38 100644
--- a/crates/xcl/src/hle/d3d12x/vram.rs
+++ b/crates/xcl/src/hle/d3d12x/vram.rs
@@ -612,8 +612,17 @@ impl Pages {
.into_iter()
.map(|h| (Some(h), update_ranges(total, D3D12_TILE_RANGE_FLAG_NONE, |i| at.get(&i).copied().flatten().filter(|t| t.0 == h).map(|t| t.1))))
.collect();
+ // Local diagnostic: issue NULL updates per changed tile, without a SKIP range.
if at.values().any(|t| t.is_none()) {
- calls.push((None, update_ranges(total, D3D12_TILE_RANGE_FLAG_NULL, |i| at.get(&i).filter(|t| t.is_none()).map(|_| 0))));
+ for (&i, value) in &at {
+ if value.is_some() { continue; }
+ let coord = D3D12_TILED_RESOURCE_COORDINATE { X: i, ..Default::default() };
+ let region = D3D12_TILE_REGION_SIZE { NumTiles: 1, UseBox: false.into(), ..Default::default() };
+ let flag = D3D12_TILE_RANGE_FLAG_NULL;
+ let offset = 0u32; let count = 1u32;
+ self.queue.UpdateTileMappings(res, 1, Some(&coord), Some(®ion), None, 1,
+ Some(&flag), Some(&offset), Some(&count), D3D12_TILE_MAPPING_FLAG_NONE);
+ }
}
for (h, ranges) in calls {
let coord = D3D12_TILED_RESOURCE_COORDINATE::default();
@@ -1254,3 +1263,7 @@ mod tests {
}
}
}
+
+#[cfg(test)]
+#[path = "texture_residency_probe.rs"]
+mod texture_residency_probe; |
gut0to
left a comment
There was a problem hiding this comment.
The focused VRAM results do not replace the full workspace GPU suite required by CONTRIBUTING.md. The Tested section reports only the focused tests (including failures also seen on main); please report the full suite on this PR head with pass/fail/ignored counts and skipped-test names before merge. AI-assisted review; I checked the report against the guide.
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
Follow-up to my paired-residency result: the AMD stale tile reproduces with native D3D12 mapping and no XCL reservation, mirror, I added a local test-only native control using the same
Fresh process for each entry:
Microsoft's The local probe source is included below for reproduction. It reuses the small AI use: Codex (GPT-6) wrote and ran this test, checked the logs and source hashes, and prepared this report. Native control test source//! Local diagnostic: a native D3D12 NULL/SKIP tile mapping without XCL residency hooks.
use super::*;
use windows::Win32::Graphics::{Direct3D::D3D_FEATURE_LEVEL_12_0, Dxgi::*, Dxgi::Common::*};
unsafe fn drain(queue: &ID3D12CommandQueue, dev: &ID3D12Device) {
let fence: ID3D12Fence = dev.CreateFence(0, D3D12_FENCE_FLAG_NONE).unwrap();
queue.Signal(&fence, 1).unwrap();
let start = std::time::Instant::now();
while fence.GetCompletedValue() == 0 && start.elapsed().as_secs() < 10 {
std::thread::sleep(std::time::Duration::from_millis(1));
}
assert_eq!(fence.GetCompletedValue(), 1);
dev.GetDeviceRemovedReason().unwrap();
}
unsafe fn tile_copy(dev: &ID3D12Device, queue: &ID3D12CommandQueue, texture: &ID3D12Resource,
buffer: &ID3D12Resource, upload: bool) {
let allocator: ID3D12CommandAllocator = dev.CreateCommandAllocator(D3D12_COMMAND_LIST_TYPE_DIRECT).unwrap();
let list: ID3D12GraphicsCommandList = dev.CreateCommandList(0, D3D12_COMMAND_LIST_TYPE_DIRECT, &allocator, None).unwrap();
let state = if upload { D3D12_RESOURCE_STATE_COPY_DEST } else { D3D12_RESOURCE_STATE_COPY_SOURCE };
list.ResourceBarrier(&[super::texture_residency_probe::transition(texture, D3D12_RESOURCE_STATE_COMMON, state)]);
let coord = D3D12_TILED_RESOURCE_COORDINATE::default();
let region = D3D12_TILE_REGION_SIZE { NumTiles: 2, UseBox: false.into(), ..Default::default() };
let flags = if upload { D3D12_TILE_COPY_FLAG_LINEAR_BUFFER_TO_SWIZZLED_TILED_RESOURCE }
else { D3D12_TILE_COPY_FLAG_SWIZZLED_TILED_RESOURCE_TO_LINEAR_BUFFER };
list.CopyTiles(texture, &coord, ®ion, buffer, 0, flags);
list.ResourceBarrier(&[super::texture_residency_probe::transition(texture, state, D3D12_RESOURCE_STATE_COMMON)]);
list.Close().unwrap();
queue.ExecuteCommandLists(&[Some(list.cast().unwrap())]);
drain(queue, dev);
}
#[test]
fn native_mixed_null_skip_mapping_returns_zero() {
unsafe {
let factory: IDXGIFactory6 = CreateDXGIFactory2(DXGI_CREATE_FACTORY_FLAGS(0)).unwrap();
let selector = crate::gpu::adapter::Selector::from_env_or("auto");
let Some((adapter, desc)) = crate::gpu::adapter::candidates(&factory, &selector).into_iter().next() else {
return crate::gpu::recomp::runner::skip_test("no GPU");
};
println!("adapter={}", crate::gpu::adapter::name(&desc));
let dev = crate::gpu::agility::create_device(&adapter, D3D_FEATURE_LEVEL_12_0).unwrap();
let mut opts = D3D12_FEATURE_DATA_D3D12_OPTIONS::default();
dev.CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS, &mut opts as *mut _ as *mut c_void,
std::mem::size_of_val(&opts) as u32).unwrap();
assert!(opts.TiledResourcesTier.0 >= 2 && opts.ResourceHeapTier.0 >= 2);
let texture_desc = D3D12_RESOURCE_DESC { Dimension: D3D12_RESOURCE_DIMENSION_TEXTURE2D,
Width: 256, Height: 128, DepthOrArraySize: 1, MipLevels: 1, Format: DXGI_FORMAT_R32_UINT,
SampleDesc: DXGI_SAMPLE_DESC { Count: 1, Quality: 0 },
Layout: D3D12_TEXTURE_LAYOUT_64KB_UNDEFINED_SWIZZLE, ..Default::default() };
let mut texture = None;
dev.CreateReservedResource(&texture_desc, D3D12_RESOURCE_STATE_COMMON, None, &mut texture).unwrap();
let texture: ID3D12Resource = texture.unwrap();
let mut count = 0;
dev.GetResourceTiling(&texture, Some(&mut count), None, None, None, 0, std::ptr::null_mut());
assert_eq!(count, 2);
let heap_desc = D3D12_HEAP_DESC { SizeInBytes: 2 * PAGE as u64,
Properties: D3D12_HEAP_PROPERTIES { Type: D3D12_HEAP_TYPE_DEFAULT, ..Default::default() },
Flags: D3D12_HEAP_FLAG_NONE, ..Default::default() };
let mut heap = None;
dev.CreateHeap(&heap_desc, &mut heap).unwrap();
let heap: ID3D12Heap = heap.unwrap();
let queue: ID3D12CommandQueue = dev.CreateCommandQueue(&D3D12_COMMAND_QUEUE_DESC::default()).unwrap();
let coord = D3D12_TILED_RESOURCE_COORDINATE::default();
let region = D3D12_TILE_REGION_SIZE { NumTiles: 2, UseBox: false.into(), ..Default::default() };
let map_flag = D3D12_TILE_RANGE_FLAG_NONE;
let offset = 0u32;
let count = 2u32;
queue.UpdateTileMappings(&texture, 1, Some(&coord), Some(®ion), &heap, 1,
Some(&map_flag), Some(&offset), Some(&count), D3D12_TILE_MAPPING_FLAG_NONE);
drain(&queue, &dev);
let upload = super::texture_residency_probe::buffer(&dev, D3D12_HEAP_TYPE_UPLOAD, D3D12_RESOURCE_STATE_GENERIC_READ);
let readback = super::texture_residency_probe::buffer(&dev, D3D12_HEAP_TYPE_READBACK, D3D12_RESOURCE_STATE_COPY_DEST);
let mut p = std::ptr::null_mut();
upload.Map(0, None, Some(&mut p)).unwrap();
let words = std::slice::from_raw_parts_mut(p as *mut u32, 2 * PAGE / 4);
words[..PAGE / 4].fill(0x55555555);
words[PAGE / 4..].fill(0x66666666);
upload.Unmap(0, None);
tile_copy(&dev, &queue, &texture, &upload, true);
let single = std::env::var_os("XCL_PROBE_SINGLE_NULL").is_some();
if single {
let one = D3D12_TILE_REGION_SIZE { NumTiles: 1, UseBox: false.into(), ..Default::default() };
let flag = D3D12_TILE_RANGE_FLAG_NULL;
let offset = 0u32;
let count = 1u32;
queue.UpdateTileMappings(&texture, 1, Some(&coord), Some(&one), None, 1,
Some(&flag), Some(&offset), Some(&count), D3D12_TILE_MAPPING_FLAG_NONE);
} else {
let range_flags = [D3D12_TILE_RANGE_FLAG_NULL, D3D12_TILE_RANGE_FLAG_SKIP];
let offsets = [0u32, 0u32];
let counts = [1u32, 1u32];
queue.UpdateTileMappings(&texture, 1, Some(&coord), Some(®ion), None, 2,
Some(range_flags.as_ptr()), Some(offsets.as_ptr()), Some(counts.as_ptr()), D3D12_TILE_MAPPING_FLAG_NONE);
}
println!("mapping={}", if single { "single-null" } else { "mixed-null-skip" });
drain(&queue, &dev);
readback.Map(0, None, Some(&mut p)).unwrap();
std::ptr::write_bytes(p as *mut u8, 0xA5, 2 * PAGE);
readback.Unmap(0, None);
tile_copy(&dev, &queue, &texture, &readback, false);
readback.Map(0, None, Some(&mut p)).unwrap();
let words = std::slice::from_raw_parts(p as *const u32, 2 * PAGE / 4);
let wrong0 = words[..PAGE / 4].iter().filter(|&&v| v != 0).count();
let wrong1 = words[PAGE / 4..].iter().filter(|&&v| v != 0x66666666).count();
println!("first={:x} second={:x} wrong0={wrong0} wrong1={wrong1}", words[0], words[PAGE / 4]);
readback.Unmap(0, None);
assert_eq!((wrong0, wrong1), (0, 0));
}
} |
|
Packed-mip array follow-up — 24 November: I added a synthetic, test-only GPU-byte control at the unchanged #1514 head On Windows 10 19045, integrated AMD Radeon(TM) Graphics driver 32.0.21030.2001 and RTX 3090 driver 591.74, Rust 1.98.1 MSVC, Agility 1.620.2, each in a fresh SSH Session 0 process:
The baseline fixture uses a local packed-coordinate helper because the unchanged PR has no production helper; otherwise its allocation, upload, decommit and readback sequence matches the candidate fixture. The candidate calls its production Full-suite follow-up for the local NULL-region candidate — 24 November. The PR head is still This complements the earlier AMD result below: the integrated four-tile test failed on the unchanged head and passed with explicit NULL regions on both AMD integrated and RTX 3090. Limits: the frozen local tree includes a native mixed-NULL/SKIP negative control that intentionally fails on the AMD driver, so it is not a mergeable cross-adapter suite. The coordinate helper has structural packed-mip/array checks but no packed-mip GPU-byte test; D3D12 leaves partially mapped packed-mip behavior vendor-specific. Its unusual-tiling fallback still uses the original mixed NULL/SKIP call shape. World-scale cost, discrete AMD, retail smoke, and interaction with #1747 remain untested. I would treat the explicit-region path as a validated direction for standard tiles, with those cases still to resolve before a runtime PR is merge-ready. AI use: Codex (GPT-6) ran the exact-head/candidate pair, checked hashes and logs, and prepared this update. Integrated four-tile negative control — 24 November, 20:14 UTC: I exercised XCL's The baseline and candidate fixtures share the same allocation/upload/decommit/readback sequence; the baseline only substitutes known Update — local XCL integration diagnostic, 24 November: I translated changed tile indices with On Windows 10, AMD Radeon integrated driver 32.0.21030.2001 and RTX 3090 driver 591.74, the paired 24 GiB CPU/GPU reservation and two aliased two-tile texture fixture passed 1/0/0 on each adapter, with 0 wrong out of 196,608 GPU-readback words across six phases, including partial decommit/recommit. In a separate native four-tile D3D12 control, the candidate helper generated coordinates This makes the stale tile a GPU-observable behavior of the mixed mapping call shape on this AMD driver, not a test bookkeeping failure. I still cannot assign driver versus subtler API/resource responsibility. The candidate's packed-mip coordinate check is structural only; no packed-mip GPU remap, world-scale overhead, discrete AMD, full suite or retail title was tested. Microsoft's packed-mip documentation says partial packed-mip mappings have vendor-specific undefined read/write behavior, which needs separate handling. I am keeping the code local so the PR author can decide whether this mapping strategy fits the branch. AI use: Codex (GPT-6) wrote the candidate and fixtures, ran the native tests, checked the logs and prepared this update. Further native D3D12 control for the AMD stale-tile finding: one The local test uses a 256×256 Fresh native test processes, same source SHA256
No skips, harness timeouts, or device removals. The documented AI use: Codex (GPT-6) built the synthetic control, caught and corrected the coordinate mistake, ran the native tests, checked source hashes and logs, and prepared this report. Four-tile native control source//! Local diagnostic: a native D3D12 NULL/SKIP tile mapping without XCL residency hooks.
use super::*;
use windows::Win32::Graphics::{Direct3D::D3D_FEATURE_LEVEL_12_0, Dxgi::*, Dxgi::Common::*};
unsafe fn drain(queue: &ID3D12CommandQueue, dev: &ID3D12Device) {
let fence: ID3D12Fence = dev.CreateFence(0, D3D12_FENCE_FLAG_NONE).unwrap();
queue.Signal(&fence, 1).unwrap();
let start = std::time::Instant::now();
while fence.GetCompletedValue() == 0 && start.elapsed().as_secs() < 10 {
std::thread::sleep(std::time::Duration::from_millis(1));
}
assert_eq!(fence.GetCompletedValue(), 1);
dev.GetDeviceRemovedReason().unwrap();
}
unsafe fn tile_copy(dev: &ID3D12Device, queue: &ID3D12CommandQueue, texture: &ID3D12Resource,
buffer: &ID3D12Resource, pages: u32, upload: bool) {
let allocator: ID3D12CommandAllocator = dev.CreateCommandAllocator(D3D12_COMMAND_LIST_TYPE_DIRECT).unwrap();
let list: ID3D12GraphicsCommandList = dev.CreateCommandList(0, D3D12_COMMAND_LIST_TYPE_DIRECT, &allocator, None).unwrap();
let state = if upload { D3D12_RESOURCE_STATE_COPY_DEST } else { D3D12_RESOURCE_STATE_COPY_SOURCE };
list.ResourceBarrier(&[super::texture_residency_probe::transition(texture, D3D12_RESOURCE_STATE_COMMON, state)]);
let coord = D3D12_TILED_RESOURCE_COORDINATE::default();
let region = D3D12_TILE_REGION_SIZE { NumTiles: pages, UseBox: false.into(), ..Default::default() };
let flags = if upload { D3D12_TILE_COPY_FLAG_LINEAR_BUFFER_TO_SWIZZLED_TILED_RESOURCE }
else { D3D12_TILE_COPY_FLAG_SWIZZLED_TILED_RESOURCE_TO_LINEAR_BUFFER };
list.CopyTiles(texture, &coord, ®ion, buffer, 0, flags);
list.ResourceBarrier(&[super::texture_residency_probe::transition(texture, state, D3D12_RESOURCE_STATE_COMMON)]);
list.Close().unwrap();
queue.ExecuteCommandLists(&[Some(list.cast().unwrap())]);
drain(queue, dev);
}
unsafe fn buffer_pages(dev: &ID3D12Device, pages: usize, heap: D3D12_HEAP_TYPE,
state: D3D12_RESOURCE_STATES) -> ID3D12Resource {
let desc = D3D12_RESOURCE_DESC { Dimension: D3D12_RESOURCE_DIMENSION_BUFFER,
Width: (pages * PAGE) as u64, Height: 1, DepthOrArraySize: 1, MipLevels: 1,
SampleDesc: DXGI_SAMPLE_DESC { Count: 1, Quality: 0 },
Layout: D3D12_TEXTURE_LAYOUT_ROW_MAJOR, ..Default::default() };
let mut out = None;
dev.CreateCommittedResource(&D3D12_HEAP_PROPERTIES { Type: heap, ..Default::default() },
D3D12_HEAP_FLAG_NONE, &desc, state, None, &mut out).unwrap();
out.unwrap()
}
#[test]
fn native_mixed_null_skip_mapping_returns_zero() {
unsafe {
let factory: IDXGIFactory6 = CreateDXGIFactory2(DXGI_CREATE_FACTORY_FLAGS(0)).unwrap();
let selector = crate::gpu::adapter::Selector::from_env_or("auto");
let Some((adapter, desc)) = crate::gpu::adapter::candidates(&factory, &selector).into_iter().next() else {
return crate::gpu::recomp::runner::skip_test("no GPU");
};
println!("adapter={}", crate::gpu::adapter::name(&desc));
let dev = crate::gpu::agility::create_device(&adapter, D3D_FEATURE_LEVEL_12_0).unwrap();
let mut opts = D3D12_FEATURE_DATA_D3D12_OPTIONS::default();
dev.CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS, &mut opts as *mut _ as *mut c_void,
std::mem::size_of_val(&opts) as u32).unwrap();
assert!(opts.TiledResourcesTier.0 >= 2 && opts.ResourceHeapTier.0 >= 2);
let disjoint = std::env::var_os("XCL_PROBE_DISJOINT").is_some();
let pages = if disjoint { 4usize } else { 2usize };
let texture_desc = D3D12_RESOURCE_DESC { Dimension: D3D12_RESOURCE_DIMENSION_TEXTURE2D,
Width: 256, Height: if disjoint { 256 } else { 128 }, DepthOrArraySize: 1,
MipLevels: 1, Format: DXGI_FORMAT_R32_UINT,
SampleDesc: DXGI_SAMPLE_DESC { Count: 1, Quality: 0 },
Layout: D3D12_TEXTURE_LAYOUT_64KB_UNDEFINED_SWIZZLE, ..Default::default() };
let mut texture = None;
dev.CreateReservedResource(&texture_desc, D3D12_RESOURCE_STATE_COMMON, None, &mut texture).unwrap();
let texture: ID3D12Resource = texture.unwrap();
let mut count = 0;
let mut shape = D3D12_TILE_SHAPE::default();
dev.GetResourceTiling(&texture, Some(&mut count), None, Some(&mut shape), None, 0, std::ptr::null_mut());
assert_eq!(count, pages as u32);
assert_eq!((shape.WidthInTexels, shape.HeightInTexels), (128, 128));
let heap_desc = D3D12_HEAP_DESC { SizeInBytes: (pages * PAGE) as u64,
Properties: D3D12_HEAP_PROPERTIES { Type: D3D12_HEAP_TYPE_DEFAULT, ..Default::default() },
Flags: D3D12_HEAP_FLAG_NONE, ..Default::default() };
let mut heap = None;
dev.CreateHeap(&heap_desc, &mut heap).unwrap();
let heap: ID3D12Heap = heap.unwrap();
let queue: ID3D12CommandQueue = dev.CreateCommandQueue(&D3D12_COMMAND_QUEUE_DESC::default()).unwrap();
let coord = D3D12_TILED_RESOURCE_COORDINATE::default();
let region = D3D12_TILE_REGION_SIZE { NumTiles: pages as u32, UseBox: false.into(), ..Default::default() };
let map_flag = D3D12_TILE_RANGE_FLAG_NONE;
let offset = 0u32;
let count = pages as u32;
queue.UpdateTileMappings(&texture, 1, Some(&coord), Some(®ion), &heap, 1,
Some(&map_flag), Some(&offset), Some(&count), D3D12_TILE_MAPPING_FLAG_NONE);
drain(&queue, &dev);
let upload = buffer_pages(&dev, pages, D3D12_HEAP_TYPE_UPLOAD, D3D12_RESOURCE_STATE_GENERIC_READ);
let readback = buffer_pages(&dev, pages, D3D12_HEAP_TYPE_READBACK, D3D12_RESOURCE_STATE_COPY_DEST);
let mut p = std::ptr::null_mut();
upload.Map(0, None, Some(&mut p)).unwrap();
let words = std::slice::from_raw_parts_mut(p as *mut u32, pages * PAGE / 4);
let values = [0x55555555u32, 0x66666666, 0x77777777, 0x88888888];
for (i, chunk) in words.chunks_mut(PAGE / 4).enumerate() { chunk.fill(values[i]); }
upload.Unmap(0, None);
tile_copy(&dev, &queue, &texture, &upload, pages as u32, true);
let single = std::env::var_os("XCL_PROBE_SINGLE_NULL").is_some();
let batch = std::env::var_os("XCL_PROBE_BATCH_NULL").is_some();
let contiguous = std::env::var_os("XCL_PROBE_CONTIGUOUS_NULL").is_some();
let per_tile = std::env::var_os("XCL_PROBE_PER_TILE_NULL").is_some();
let drain_each = std::env::var_os("XCL_PROBE_DRAIN_EACH").is_some();
if disjoint && contiguous {
let two = D3D12_TILE_REGION_SIZE { NumTiles: 2, UseBox: false.into(), ..Default::default() };
let flag = D3D12_TILE_RANGE_FLAG_NULL;
let count = 2u32;
queue.UpdateTileMappings(&texture, 1, Some(&coord), Some(&two), None, 1,
Some(&flag), None, Some(&count), D3D12_TILE_MAPPING_FLAG_NONE);
} else if disjoint && per_tile {
let one = D3D12_TILE_REGION_SIZE { NumTiles: 1, UseBox: false.into(), ..Default::default() };
let flag = D3D12_TILE_RANGE_FLAG_NULL;
let count = 1u32;
for (x, y) in [(0, 0), (0, 1)] {
let coord = D3D12_TILED_RESOURCE_COORDINATE { X: x, Y: y, ..Default::default() };
queue.UpdateTileMappings(&texture, 1, Some(&coord), Some(&one), None, 1,
Some(&flag), None, Some(&count), D3D12_TILE_MAPPING_FLAG_NONE);
if drain_each { drain(&queue, &dev); }
}
} else if disjoint && batch {
let coords = [D3D12_TILED_RESOURCE_COORDINATE { X: 0, ..Default::default() },
D3D12_TILED_RESOURCE_COORDINATE { X: 0, Y: 1, ..Default::default() }];
let flag = D3D12_TILE_RANGE_FLAG_NULL;
let count = 2u32;
queue.UpdateTileMappings(&texture, 2, Some(coords.as_ptr()), None, None, 1,
Some(&flag), None, Some(&count), D3D12_TILE_MAPPING_FLAG_NONE);
} else if disjoint {
let flags = [D3D12_TILE_RANGE_FLAG_NULL, D3D12_TILE_RANGE_FLAG_SKIP,
D3D12_TILE_RANGE_FLAG_NULL, D3D12_TILE_RANGE_FLAG_SKIP];
let offsets = [0u32; 4];
let counts = [1u32; 4];
queue.UpdateTileMappings(&texture, 1, Some(&coord), Some(®ion), None, 4,
Some(flags.as_ptr()), Some(offsets.as_ptr()), Some(counts.as_ptr()), D3D12_TILE_MAPPING_FLAG_NONE);
} else if single {
let one = D3D12_TILE_REGION_SIZE { NumTiles: 1, UseBox: false.into(), ..Default::default() };
let flag = D3D12_TILE_RANGE_FLAG_NULL;
let offset = 0u32;
let count = 1u32;
queue.UpdateTileMappings(&texture, 1, Some(&coord), Some(&one), None, 1,
Some(&flag), Some(&offset), Some(&count), D3D12_TILE_MAPPING_FLAG_NONE);
} else {
let range_flags = [D3D12_TILE_RANGE_FLAG_NULL, D3D12_TILE_RANGE_FLAG_SKIP];
let offsets = [0u32, 0u32];
let counts = [1u32, 1u32];
queue.UpdateTileMappings(&texture, 1, Some(&coord), Some(®ion), None, 2,
Some(range_flags.as_ptr()), Some(offsets.as_ptr()), Some(counts.as_ptr()), D3D12_TILE_MAPPING_FLAG_NONE);
}
println!("mapping={}", if disjoint && contiguous { "contiguous-two-null" }
else if disjoint && per_tile && drain_each { "disjoint-per-tile-drain" }
else if disjoint && per_tile { "disjoint-per-tile-null" }
else if disjoint && batch { "disjoint-batch-null" }
else if disjoint { "disjoint-mixed-null-skip" }
else if single { "single-null" } else { "mixed-null-skip" });
drain(&queue, &dev);
readback.Map(0, None, Some(&mut p)).unwrap();
std::ptr::write_bytes(p as *mut u8, 0xA5, pages * PAGE);
readback.Unmap(0, None);
tile_copy(&dev, &queue, &texture, &readback, pages as u32, false);
readback.Map(0, None, Some(&mut p)).unwrap();
let words = std::slice::from_raw_parts(p as *const u32, pages * PAGE / 4);
let wrong: Vec<usize> = words.chunks(PAGE / 4).enumerate()
.map(|(i, chunk)| chunk.iter().filter(|&&v| v != if (contiguous && i < 2) || (!contiguous && i % 2 == 0) { 0 } else { values[i] }).count())
.collect();
let first: Vec<u32> = words.chunks(PAGE / 4).map(|chunk| chunk[0]).collect();
println!("first={first:x?} wrong={wrong:?}");
readback.Unmap(0, None);
assert!(wrong.iter().all(|&n| n == 0), "NULL tiles should read zero");
}
} |
|
I independently reproduced the two-standard-tile result from the native control above on another Windows machine with an integrated Radeon. The GTX 1650 (4 GB) also provides a low-VRAM NVIDIA control. This was a standalone D3D12 test with a synthetic 256×128
The second tile retained all 16,384 original words in all eight runs. This confirms that single-region AI use: OpenAI Codex (gpt-6.2-sol) wrote and ran this independent control and drafted the report. |
|
RTX 5060 Laptop GPU (8 GB), Bazzite 44, NVIDIA 615.78.08, Proton Experimental 11.0-20261112, vkd3d-proton I tested a synthetic 64 KiB RGBA tile placed in a watched graphics reservation. The test uploads a pattern and reads back every byte through reserve, commit, decommit and re-commit. The baseline failed the first zero-read check. The test passed on PR head In two Series X runs starting with matching cache and title state, the nearest samples to 75,000 storage requests showed 8,512 MiB of texture pools before the port and 3,584 MiB after (74,963 and 74,876 requests respectively). Reported non-local memory was 6,518 and 1,526 MiB. The port reached 78,537 requests with zero reported storage failures. The previous system journal ends during that run, so its exit status and the cause are unknown. Loading artwork was the furthest verified scene. The local port also retained explicit GPU views and eviction tracking, which limits attribution of the title measurements. OpenAI Codex (GPT-6.2-Sol high) assisted with the test, port and runs. OpenAI Codex (GPT-6.2-astra) checked the retained results and posted this report. |
|
I reproduced a second-placement case on the exact I ran the same filter serially on the RTX 5060 Laptop GPU with Bazzite 44, NVIDIA 615.78.08, Proton Experimental 11.0-20261112 and vkd3d-proton
The earlier one-texture commit/decommit test still passed on OpenAI Codex (GPT-6) assisted with the fix, synthetic fixture, builds and report. |
|
A result from an 8 GB card in Series X mode ( Setup: RTX 3070 Laptop 8 GB, driver 32.0.16.2124, i7-11800H, 32 GB RAM, Windows 10 19045, rustc 1.100.0, release. The base is
Tests on that tree: Run: a retail title with
Not tested: the HLSL path; Series S mode; more than one run; AMD; this PR without the other PRs listed above. AI use: Claude Code (Claude Opus 5.5) merged the PR locally, ran the builds, tests and the run, read the logs and wrote this comment. |
|
Result on Test: 1024×1024 RGBA8, 11 levels, 64KB_S layout (
So with only the tail there, one tile of the empty largest level is kept and the tail's own levels read zero. How common it is: on a retail title during world loading (local tree: A second point: I have a by-level version in my local tree. @3L1A5-1, does your change on top of #1102 go by level too? I don't want to duplicate it; otherwise I can send the test or the code. Tested: RTX 2070 SUPER (driver 617.14), Windows 11 26300, debug; the test ran twice with the same result (control passed, tail case failed). Not tested: other GPUs, the full suite, the title with this PR. AI use: Claude Code (Claude Opus 5.5) wrote and ran the test and wrote this. |
|
Independent native D3D12 check of Filip722’s alias regression on Windows 11 build 26300, RTX 3080 Ti / 621.35, Rust 1.99.1 MSVC, debug. I ran Coverage was limited to the single-tile alias case. Packed mips, retail, and the workspace suite remain untested here. AI use: OpenAI Codex (GPT-6) ran the comparison and drafted this report. |
|
Independent packed-mip check following veyn-sudo’s report. On 73b60019, I used a synthetic 256×256 RGBA8
Two fresh processes per path gave identical results on Windows 11 build 26300, RTX 3080 Ti / 621.35, Rust 1.99.1 MSVC, debug. Both native controls passed. Both draft runs failed the partial-backing assertion. Graphics Tools reported zero D3D12 errors or corruption messages. No skips. Coverage is one texture format and one packed tile; arrays, retail and the workspace suite remain untested here. If the by-level patch is ready to share, I can run this fixture against it. AI use: OpenAI Codex (GPT-6) wrote the synthetic fixture, ran it, and drafted this report. |
|
A data point for this approach from an 8 GB NVIDIA card, from a local change of mine that does the same for textures in GPU views (no video memory where nothing is mapped), so not this PR's code. Details in my comment on #1102:
So I'm not opening that change: this PR covers it and was here first. What it adds on top, keying a GPU-view page's video memory by the physical page it shows (so a GPU view and its CPU view, or two aliases, share one tile), needs #1102. I'll offer that as a small follow-up once this PR and #1102 are in. My version pairs the PC's tile AI use: Claude Code (Claude Opus 5.5) wrote this. |
|
@3L1A5-1 thanks, then I won't be duplicating it. @thehollowedone thanks for the independent check; your direct D3D12 control shows the same thing. My by-level version works on GPU-view textures and needs #1102. It is one commit of about 420 lines on a local tree with other changes ( AI use: Claude Code (Claude Opus 5.5) wrote this. |
For #646. A retail title places streamed textures over reserved-only graphics address space and maps physical pages only where tiles are resident. XCL gave every 64 KiB page of each such texture its own page of video memory anyway: on spawn, 22 808 textures held 6 GB, 4.3 GB of it over addresses with no title memory, and local video memory went 2 GB past the budget (
title_memory_mbdoes not bound it).An owned page of a placed texture in a graphics reservation is now mapped only while the title has memory there: committed, a physical page, or one mapped and not yet touched. Commits, decommits, releases and physical-page maps and unmaps there are noted (
title_memory_changed), and the pages follow before the title's next submit: oneUpdateTileMappingsper texture and heap, then the pages' fence. Unmapped tiles read zero (resource heap tier 2).The second commit covers the title's GPU views (
kernelx::mirrors, placed in the no-access twin of a CPU reservation): they are never committed themselves, so their followed pages stayed unmapped and read zero (no intro video, missing textures).title_backednow looks throughmirrors::source, and a change in a CPU view is noted for its GPU view too.What is in it
crates/xcl/src/hle/d3d12x/vram.rs: followed pages per texture,update_ranges(only the changed tiles: the rest is skipped, consecutive heap tiles merge, unmapped ones become NULL ranges), testupdate_ranges_set_only_the_changed_tilescrates/xcl/src/hle/kernelx.rs: the title's commit, decommit, release and physical-page changes in graphics reservations calltitle_memory_changedcrates/xcl/src/hle/kernelx/lazy.rs:is_lazy, a page mapped and not touched yet (counted as the title's memory)Tested
cargo test -p xcl --lib vram -- --test-threads=1: 8 passed, 2 failed. The 2 (placed_title_textures_share_vram_and_preserve_pixels,d32s8_targets_take_their_own_size_of_video_memory) fail the same way onmain(1ec4c98, before the rebase: 7 passed, 2 failed); the newupdate_ranges_set_only_the_changed_tilespasses. Run before the rebase onto 930e8b4, which had no conflictsRegression run
main:
PR (this PR's head commit; the title is run through a folder named RetailTitle):
Not tested
UpdateTileMappingscalls while the title loads on NVIDIA: 7f94c6f measured ~0.13 ms a call there. This PR makes one call per texture and heap per submit, not one per tile, but how many textures change per submit during loading was not counted.AI use
🤖 Generated with Claude Code