Skip to content

KernelX / title textures: a GPU view of the title's CPU memory reads the CPU view (retail intro video, no green screen) - #283

Merged
ivall merged 2 commits into
ivall:mainfrom
jessenic:fix/gpu-mirror-view
Nov 23, 2026
Merged

ivall merged 2 commits into
ivall:mainfrom
jessenic:fix/gpu-mirror-view

Conversation

@jessenic

Copy link
Copy Markdown
Contributor

Stacked on #252: this branch contains #252's commit (862a0d4) followed by this one (94bfcf0). Review/merge #252 first; this PR's own diff is the last commit.

What was wrong

After the first A press, a retail game showed a solid green screen (0x008700) for ~15 s before its menus. Green is what a YUV→RGB shader gives for zero luma and chroma. The draws in that stretch come from one pixel shader that samples three R8 planes (3840x2160 + 2x 1920x1080): the game's Bink video.

  • BinkRegisterFrameBuffers (traced with XCL_TRACE_IMPORTS) gets frame buffers in one reservation, which the CPU decoder writes.
  • The textures the shader samples (XCL_WATCH_SRV-style logging of the views) lie at the same addresses + 0x6_0000_0000, in a second reservation.
  • A readback showed both the textures and the memory at their own addresses all zero.

The game reserves 24 GB of 64 KiB pages twice in a row (flags 0x20402000): first PAGE_READWRITE, then PAGE_NOACCESS | PAGE_GRAPHICS_NOACCESS (0x801). It maps physical pages (XMemMapPhysicalPages, ~60k calls in the first minute) only into the first, never into the second, yet places GPU resources at the same offset in the second. On the console the second reservation is a GPU-only view of the first. Under XCL it was separate, empty memory.

Change

  • kernelx::mirrors: a no-access graphics reservation of 64 KiB pages is paired with the most recent CPU-readable reservation of the same size (dropped when either is released). source(va) names the CPU-view address behind a GPU-view address.
  • title_textures: a texture placed in a GPU view where nothing is mapped is kept in step with the same offset in the CPU view. Its bytes are read and its CPU writes watched there (Entry::src). Its title address (address(): GetGPUVirtualAddress, GPU copies into it) stays the GPU view's.

It needs the CPU view to be write-watched, which is what #252 adds for these fallback reservations.

Scope: only kept-in-step textures follow the CPU view. Buffers the title might place in such a GPU view are not covered. Mapping the same pages into both views (true aliasing through a section) would cover everything, but XCL's physical pages move between addresses by commit/decommit, and views of a section can neither be write-watched nor decommitted.

Testing

  • New unit test gpu_view_reservations_name_their_cpu_view (pairing, offsets, end of range, release).
  • cargo test --workspace: 653 passed, 0 failed, 40 ignored (RTX 5070 Ti, driver 32.0.16.1088).
  • Retail run (XCL_PRESS_AT=45:A, frame dumps): the intro video plays after the A press instead of the green screen. 512+ textures found in the GPU view within 90 s.
  • Cost: the 4K planes are uploaded (CPU detile) every video frame: 12.4 fps during the video vs 17 fps of green before. A GPU-side upload of planes that change every frame would be a follow-up.

🤖 Generated with Claude Code

@Kalmarv

Kalmarv commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

A physical page mapped into a GPU view before its first use is not seen as mapped. mirror_source decides "mapped" by VirtualQuery(va).State == MEM_COMMIT. A page whose home was never used is mapped into plain address space only as reserved memory, committed at its first access (kernelx::lazy, on main since 38b05b7). For such a page, mirror_source returns the CPU view's address instead of va. register computes src once, so a texture placed on that page then reads, and watches, the CPU view rather than the page mapped under it. The title's later writes to the page commit it, but they are not uploaded.

The test below, on main 9ab7d76 with this PR (94bfcf0) merged, CPU only:

  • It reserves two 16 MiB ranges and records them with mirrors::reserved the way the fallback path does (0x2040_2000 with PAGE_READWRITE, then with 0x801).
  • It maps one fresh physical page into the GPU view with MapTitlePhysicalPages.
  • mirror_source then gives the CPU view's address before the page's first touch, and at after it:
source before the first touch 0x138955c0000 (the CPU view), after 0x138965c0000 (at)
assertion failed: a page mapped at the address but not used yet is its source too
test (in title_textures.rs's tests)
#[test]
fn a_lazily_mapped_page_in_a_gpu_view_is_its_own_source() {
    use crate::hle::kernelx;
    use windows_sys::Win32::System::Memory::{VirtualAlloc, VirtualFree, MEM_RELEASE, MEM_RESERVE, PAGE_READWRITE};
    const VIEW: usize = 16 << 20;
    unsafe {
        let Some(_) = crate::gpu::uma::get() else { return };
        let cpu = VirtualAlloc(std::ptr::null(), VIEW, MEM_RESERVE, PAGE_READWRITE) as usize;
        let gpu = VirtualAlloc(std::ptr::null(), VIEW, MEM_RESERVE, PAGE_READWRITE) as usize;
        kernelx::mirrors::reserved(cpu, VIEW, 0x2040_2000, 0x04);
        kernelx::mirrors::reserved(gpu, VIEW, 0x2040_2000, 0x801);
        assert_eq!(mirror_source(gpu + 0x2_0000), cpu + 0x2_0000); // nothing mapped: the CPU view
        let (mut n, mut pages) = (1usize, [0usize; 1]);
        assert_eq!(kernelx::AllocateTitlePhysicalPages(std::ptr::null_mut(), 0, &mut n, pages.as_mut_ptr()), 1);
        let at = gpu + 0x2_0000;
        assert_eq!(kernelx::MapTitlePhysicalPages(at as *mut c_void, 1, 0, 4, pages.as_mut_ptr()) as usize, at);
        let before = mirror_source(at);
        (at as *mut u32).write_volatile(7); // its first use commits it
        let after = mirror_source(at);
        let mut none = [0usize; 1];
        kernelx::MapTitlePhysicalPages(at as *mut c_void, 1, 0, 4, none.as_mut_ptr());
        kernelx::FreeTitlePhysicalPages(std::ptr::null_mut(), 1, pages.as_mut_ptr());
        kernelx::mirrors::released(cpu);
        VirtualFree(cpu as *mut c_void, 0, MEM_RELEASE);
        VirtualFree(gpu as *mut c_void, 0, MEM_RELEASE);
        assert_eq!(after, at);
        assert_eq!(before, at, "a page mapped at the address but not used yet is its source too"); // fails
    }
}

A possible fix: ask kernelx whether a physical page is mapped at va (its away map, which holds lazy pages too), not whether the address is committed.

Your description says the retail game maps physical pages only into the CPU view, so this may not affect the intro video. It matters for any title that maps fresh pages into a GPU view and places textures there.

Tested

Not tested

  • A title, and whether any title maps pages into a GPU view.
  • What happens when a page is mapped or unmapped at va after the texture is registered (src is fixed at register). Not tested.
  • Any fix.

🤖 Claude Opus 5.5

theaustinayers added a commit to theaustinayers/xcl that referenced this pull request Nov 23, 2026
… memory reads the CPU view

Their work, merged as it is. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@jessenic
jessenic force-pushed the fix/gpu-mirror-view branch from 94bfcf0 to 2a64505 Compare November 23, 2026 22:35
@mariuslozo-boop

Copy link
Copy Markdown

Test report on NVIDIA. This PR fixes the green intro here. Tested at 94bfcf0 (with #252's 862a0d4 under it), merged onto main 9ab7d76. I also ran head 2a64505 once, by hand (last row).

Setup: RTX 5070 Ti (16 GB), driver 616.92 (32-lane waves), AMD Ryzen 7 7700X, 32 GB RAM, Windows 11 Pro 26300. Release build, DXC 1.8.2502.11, warm DXIL cache. Retail title 1.0.2.1. XCL_NETWORK=0 XCL_RUN_SECONDS=<n> XCL_ACTIVITY=1 XCL_FRAME_DUMP=30 xcl.exe run <game folder>, no input. One run per build.

build intro movie presents during the movie
main 9ab7d76 solid green: frames 320 to 740 are all 0xff008700×518400 ~30 a second (activity (2 s): 60 presents)
main + #236 (03d4a86) still green: frames 410 to 830 are all 0xff008700×518400 ~30 a second (60 in 2 s)
main + this PR 94bfcf0 the movie's picture: none of the 20 sampled frames (every 30th, up to 65 s) is green ~4 a second (7 to 9 in 2 s, e.g. activity (2 s): 7 presents); 592 frames in 65 s against about 1220 in the first 65 s on main
main + this PR at head 2a64505 + #244, a person watching the movie plays, visibly slow 900 frames presented, 4.6 fps over the last 300 (frames 600 to 900, 31 to 96 s)

On main with temporary logging (one 40 s run), the logs match your description:

  • the nine movie planes (three 3840×2160 and six 1920×1080 R8) are placed in the graphics range at +0x6_0000_0000, in memory that is only reserved (state 0x2000 protect 0x0);
  • each is uploaded once, as zeros: 0 of 8294400 bytes of level 0 not zero;
  • 30 of the run's 123 large textures sit in that range, and all of them upload zeros.

Not tested: head 2a64505 with frame dumps; the case Kalmarv raised (a page mapped into the GPU view before its first use); AMD; more than one run.

AI-assisted: Claude Code (Claude Fable 5.2 ran the builds and runs; Claude Opus 5.5 wrote this report). No game files attached.

@Cattn

Cattn commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Confirmed on Windows + NVIDIA: the retail title's intro video plays instead of solid green.

Setup: RTX 4070 12 GB (driver 617.42), Ryzen 7 7800X3D, 32 GB RAM, Windows 11, DXC 1.9.2609, release build, XCL_NETWORK=0.

Stack: main 7a033c8 + #203 7cbd008 + #187 c74b03a + #208 a7ffb2f + #244 77905f6 + #252 862a0d4 + this PR at 94bfcf0. No queue #31 handling.

Result:

  • The pairing is found once at start-up: kernelx: reservation 0x1fa22ba0000 (0x600000000 bytes, no CPU access) is the GPU view of 0x1f422ba0000.
  • The video's planes are kept in step through it: a texture at 0x1fe6556f000 lies in a GPU view of the title's CPU memory: kept in step with 0x1f86556f000.
  • Frame dumps (XCL_FRAME_DUMP=40) show full movie frames from ~78 s to ~148 s.
  • The same stack without this PR shows 0xff008700 for every movie frame.
  • After the movie: the first-boot screens, then a loading screen with its artwork. A 360 s run ended on XCL_RUN_SECONDS, with no crash or device removal. Video memory then grew from 8.8 to 17.6 GB during world loading, which is a separate issue (Title textures: a PC copy per placement, never shared or let go – video memory grows past the card while a retail game streams its world (0x887a0007) #248 and its PRs).

@gw1337x

gw1337x commented Nov 23, 2026

Copy link
Copy Markdown

Confirming on an AMD RX 7800 XT (16 GB, driver 32.0.32015.7029), GTA VI retail: with main 9ab7d76 + #244 + this PR the intro video plays instead of the green screen.

About the low frame rate you noted: on this machine it was 8–9 presents per 2 s during the video. Timing the upload path (a local counter around each step of title_textures::refresh / texture::upload_batch) put almost all of it in the detile:

per 2 s during the video before after the change below
subresources (read + Chain::detile_level) ~1 850 ms ~450 ms
staging + copy recording ~60 ms ~440 ms
submit + wait ~30 ms ~210 ms
bytes uploaded ~230 MB ~1 600 MB
presents 8–9 60 (the title's 30 fps)

detile_level computes offset_z (three divisions, six table lookups) and does a bounds-checked copy for every element – 8.3 M times for the 3840×2160 R8 plane, ~60 MB/s. The change below computes what the row and the block give once per row and once per block, and copies the rows of a linear level (the video planes are layout 0x100) whole. Levels in the mip tail (origin != (0, 0)) keep the element-by-element form. A unit test compares it with the element-by-element form for every mode, element size and pipe configuration, levels in and out of the tail, two array slices, a base swizzle and a source cut short.

It is a separate change from this PR (gpu/tiling.rs only) and it speeds up every kept-in-step upload, not only the video – here for anyone who wants to pick it up:

diff (gpu/tiling.rs, +86)
diff --git a/crates/xcl/src/gpu/tiling.rs b/crates/xcl/src/gpu/tiling.rs
index 7d9f4be..4074307 100644
--- a/crates/xcl/src/gpu/tiling.rs
+++ b/crates/xcl/src/gpu/tiling.rs
@@ -395,6 +395,61 @@ impl Chain {
     /// level `i` of array slice `slice` (`src` = the slice's bytes) → linear rows of elements;
     /// bytes past the end of `src` read as 0
     pub fn detile_level(&self, src: &[u8], i: usize, slice: usize) -> Vec<u8> {
+        let l = self.levels[i];
+        // a level in the mip tail starts inside a block: element by element (small levels)
+        if l.origin != (0, 0) {
+            return self.detile_level_slow(src, i, slice);
+        }
+        let lay = &self.layout;
+        let e = 1usize << lay.elem_log2;
+        let (w, h) = (l.width, l.height);
+        let mut out = vec![0u8; w * h * e];
+        let (bw, bh, bd) = (lay.block_w, lay.block_h, lay.block_d);
+        let pitch_blocks = l.pitch.div_ceil(bw);
+        let hi = |t: &[u32], c: usize, b: usize| t[(c / b) % t.len()];
+        // linear: each row is contiguous (blocks of 256 B one row high, side by side)
+        if lay.mode == 0 && lay.base_xor == 0 {
+            let row = w * e;
+            for y in 0..h {
+                let o = l.offset + y * pitch_blocks * lay.block_bytes;
+                if o < src.len() {
+                    let n = row.min((src.len() - o) / e * e);
+                    out[y * row..y * row + n].copy_from_slice(&src[o..o + n]);
+                }
+            }
+            return out;
+        }
+        // tiled: what the row and the block give, once per row and per block (`offset_z`)
+        let z = lay.oz[slice % bd] ^ hi(&lay.hz, slice, bd);
+        for y in 0..h {
+            let yo = lay.oy[y % bh] ^ hi(&lay.hy, y, bh) ^ z;
+            let row_base = l.offset + (y / bh) * pitch_blocks * lay.block_bytes;
+            for bx in 0..w.div_ceil(bw) {
+                let bo = yo ^ lay.hx[bx % lay.hx.len()];
+                let base = row_base + bx * lay.block_bytes;
+                let x0 = bx * bw;
+                let n = bw.min(w - x0);
+                let d0 = (y * w + x0) * e;
+                if base + lay.block_bytes <= src.len() {
+                    for xi in 0..n {
+                        let o = base + ((lay.ox[xi] ^ bo) as usize ^ lay.base_xor);
+                        out[d0 + xi * e..d0 + xi * e + e].copy_from_slice(&src[o..o + e]);
+                    }
+                } else {
+                    for xi in 0..n {
+                        let o = base + ((lay.ox[xi] ^ bo) as usize ^ lay.base_xor);
+                        if let Some(s) = src.get(o..o + e) {
+                            out[d0 + xi * e..d0 + xi * e + e].copy_from_slice(s);
+                        }
+                    }
+                }
+            }
+        }
+        out
+    }
+
+    /// `detile_level` element by element (`element_at` for each)
+    pub fn detile_level_slow(&self, src: &[u8], i: usize, slice: usize) -> Vec<u8> {
         let l = self.levels[i];
         let e = 1usize << self.layout.elem_log2;
         let mut out = vec![0u8; l.width * l.height * e];
@@ -488,6 +543,37 @@ mod tests {
         }
     }
 
+    /// The fast `detile_level` (per row and per block) gives what the element-by-element one
+    /// gives: every mode, element size and pipe configuration, levels in and out of the tail,
+    /// array slices, a base swizzle, and a source cut short.
+    #[test]
+    fn fast_detile_matches_element_by_element() {
+        let mut modes = vec![0u32];
+        modes.extend(MODES);
+        for mode in modes {
+            for e in 0..5u32 {
+                for cfg in configs() {
+                    let Some(mut lay) = Layout::new(mode, e, cfg) else { continue };
+                    if mode != 0 {
+                        lay.base_xor = (0x5a5 << e) & (lay.block_bytes - 1) & !((1 << e) - 1);
+                    }
+                    let c = Chain::new(lay, 70, 37, 1, 4);
+                    let mut src = vec![0u8; c.slice_bytes * 2];
+                    for (k, b) in src.iter_mut().enumerate() {
+                        *b = (k as u32).wrapping_mul(2654435761).rotate_right(13) as u8;
+                    }
+                    for i in 0..c.levels.len() {
+                        for slice in 0..2 {
+                            assert_eq!(c.detile_level(&src, i, slice), c.detile_level_slow(&src, i, slice), "mode {mode} e {e} {cfg:?} level {i} slice {slice}");
+                        }
+                        let short = &src[..c.slice_bytes / 3];
+                        assert_eq!(c.detile_level(short, i, 0), c.detile_level_slow(short, i, 0), "mode {mode} e {e} {cfg:?} level {i}, cut short");
+                    }
+                }
+            }
+        }
+    }
+
     /// Every level of a chain (with a mip tail) gets its own elements: tiling all levels with
     /// distinct values and detiling them gives each back unchanged.
     #[test]

Tested: cargo test --release -p xcl --lib tiling: 12 passed, 0 failed (incl. the new test); the retail runs above (40 s each, XCL_PRESS_A_AT=14, XCL_ACTIVITY=1), on main 9ab7d76 + #244 + #283 plus local timing counters.
Not tested: the whole workspace suite, NVIDIA, other titles; no smoke.ps1 blocks. After the video, while the title streams its world, the staging buffers created per batch and the synchronous wait become the larger cost – not addressed here.

AI-assisted (Claude Code, Claude Opus 5.5).

jessenic added a commit to jessenic/xcl that referenced this pull request Nov 23, 2026
… use, and later mappings move the source (review of PR ivall#283)

mirror_source decided "mapped" by MEM_COMMIT, but a physical page mapped at plain reserved
address space is committed only at its first access (kernelx::lazy): a texture on such a
page read the CPU view instead of the page mapped under it. kernelx::physical_page_at asks
the away map, which holds lazy pages too.

The source was also fixed at register. Mapping or unmapping physical pages inside a GPU view
(and freeing pages mapped there) now bumps kernelx::gpu_view_map_gen; at the next look the
textures in GPU views get their source again, and one whose source changed is uploaded from
the new one. Mappings elsewhere (all of a retail game's ~54,000 a minute) do not bump it, so
the check costs nothing there.

Test: a_lazily_mapped_page_in_a_gpu_view_is_its_own_source (Kalmarv's, extended with a
texture registered before the mapping).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jessenic

Copy link
Copy Markdown
Contributor Author

Thanks: both points are right. Fixed in a2bfbed (and the branch is rebased onto #252's updated head, 065be41).

Lazily mapped pages. mirror_source now asks kernelx::physical_page_at(va), which looks in the away map (lazy pages included), before falling back to VirtualQuery. Your test is in title_textures's tests as a_lazily_mapped_page_in_a_gpu_view_is_its_own_source, with credit. It fails on the "before" assertion without the fix and passes with it.

src fixed at register (your "not tested" item). map_pages and FreeTitlePhysicalPages bump kernelx::gpu_view_map_gen() when the address they touch lies in a GPU view. At the next look, title_textures rechecks the source of the textures in GPU views (Entry::in_gpu_view), and one whose source changed reads from the new one and is uploaded again. Mappings outside GPU views don't bump the generation, so the retail game's ~54,000 XMemMapPhysicalPages calls a minute (all into the CPU view) cost nothing extra. The test registers a texture before the page is mapped and checks that the recheck moves its source to the mapped page and marks it for upload.

Tests: cargo test --workspace 654 passed, 0 failed, 40 ignored (RTX 5070 Ti).

Not re-run with the game for this commit. The PC's free commit has since dropped below XCL's 17 GB threshold (UMA: 9542 MB of commit free), and in that mode the game stops on an assertion early even on main 7a033c8 without any of this. These changes don't alter this game's path: it maps nothing into the GPU view, so physical_page_at is false there and the generation never moves. I'll confirm with a run once there's memory again.

🤖 Claude Opus 5.5

jessenic and others added 2 commits November 24, 2026 00:45
…u text)

A retail game reserves 24 GB of 64 KiB pages (VirtualAlloc flags 0x20402000) and commits
2.2 GB of large pages with a graphics protection (flags 0x20003000, protection 0x2404).
Neither fits a sparse or the coherent window, so both fell through to plain memory without
MEM_WRITE_WATCH. Textures the title places there are kept in step with the memory
(d3d12x::title_textures), which relies on GetWriteWatch to see CPU writes: they were
uploaded once, empty, and never again (128+ textures in the first 45 s).

One of them is the game's 2048x2048 A8_UNORM glyph atlas, which the CPU fills as text is
laid out. Its GPU copy stayed zero, so every glyph drawn from it (the x-height letters:
a c e m n o r s u v w x z) was missing from the menus; letters drawn by the vector path
(ascenders, descenders, capitals) were fine. Found by a GPU readback of the atlas (zero)
against its CPU view (glyphs) while the menu was on screen.

The fallback VirtualAlloc now reserves GPU-visible memory (gpu_visible_fallback:
MEM_GRAPHICS, MEM_LARGE_PAGES / MEM_64K_PAGES, or a PAGE_GRAPHICS_* protection) with
MEM_WRITE_WATCH and records it with the graphics reservations (reserve_watched), whose
ranges title_textures watches.

Cost, measured on the game (RTX 5070 Ti): the write-watch scan goes from ~0.5 ms to
2.0-2.7 ms a submit once the menus have loaded, ~5-6 GB of kept-in-step textures now
being scanned; 1093 frames in 80 s against 1297.

Test: gpu_visible_fallback_memory_is_write_watched calls the fallback directly (through
VirtualAlloc the unified-memory windows take these sizes when they have room); it fails
without MEM_WRITE_WATCH.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…video)

A retail game reserves 24 GB of 64 KiB pages twice in a row (VirtualAlloc flags
0x20402000): once PAGE_READWRITE, once PAGE_NOACCESS | PAGE_GRAPHICS_NOACCESS (0x801). It
maps physical pages only into the first (XMemMapPhysicalPages, ~54,000 calls in the first
minute), yet places GPU resources at the same offset in the second: its Bink video planes
are decoded by the CPU into the first view (BinkRegisterFrameBuffers), and the video shader
samples R8 textures at those addresses plus the reservation's size. On the console the
second reservation is a GPU-only view of the first; here it was separate, empty memory, so
the video drew zero luma and chroma: a green screen for ~15 s after the first A press.

kernelx::mirrors pairs such a no-access graphics reservation of 64 KiB pages with the most
recent CPU-readable one of the same size (forgotten when either is released).
title_textures keeps a texture placed in the GPU view, where no physical page is mapped,
in step with the same offset in the CPU view: its bytes are read and its CPU writes watched
there (Entry::src), while its title address (GetGPUVirtualAddress, GPU copies into it)
stays the GPU view's. A page mapped at the address counts before its first use too
(kernelx::physical_page_at asks the away map, lazy pages included), and mapping or
unmapping pages inside a GPU view (gpu_view_map_gen) makes the textures there take their
source again at the next look, uploaded from the new one. Mappings elsewhere do not bump
it, so they cost nothing.

The 4K planes are now uploaded each video frame: 12.4 fps during the video against 17 fps
of green before (RTX 5070 Ti).

Tests: gpu_view_reservations_name_their_cpu_view;
a_lazily_mapped_page_in_a_gpu_view_is_its_own_source (by Kalmarv in the review, extended
with a texture registered before the mapping).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jessenic
jessenic force-pushed the fix/gpu-mirror-view branch from a2bfbed to 9bd7635 Compare November 23, 2026 22:47
josilo added a commit to josilo/xcl that referenced this pull request Nov 23, 2026
Apply XCL PRs ivall#283 (065be41 and 2a64505) and ivall#289 (d0b6079). Preserve placement-order uploads from ivall#269 while sourcing mirrored textures from the CPU view.
@theaustinayers

theaustinayers commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Test report on a retail title: with this PR the intro video shows a picture instead of solid green.

What was run

Result

main 0e946cf main + #244 + #283
Captured frames after the press (most common texel) 20 s – 32 s: 0xff008700 on all 518,400 samples (solid green) 44 s, 76 s: many colours, no texel on more than 0.6 % of the samples (video frames)
Crash 0xc0000005 at 87 s in title code, a write fault (2 crashes) none in 120 s
Exit 0xc0000005 0x0
Frames shown none logged (did not reach its end) 670
Peak commit 29,259 MB 15,265 MB

I did not open the captures of this particular run. On another run of the same two changes (in my fork, on top of 9ab7d76) I did look at a capture from this stretch, and it was the title's intro video with a normal picture.

main:

xcl-smoke v1
commit: 0e946cfc68244edee1fba6e0425371f687a05ccd
gpu: AMD Radeon(TM) Graphics
title: NYCMain
seconds: 120
exit: 0xc0000005
frames shown: none logged (the run did not reach its end)
presents per 2 s (last 3): 0 0 2
device removals: 0
crashes: 2
peak commit: 29259 MB

main + #244 + #283:

xcl-smoke v1
commit: f13d68de9111d69cea7f34e803415954d555707c
gpu: AMD Radeon(TM) Graphics
title: NYCMain
seconds: 120
exit: 0x0
frames shown: 670 (PresentX 670)
presents per 2 s (last 3): 8 7 8
device removals: 0
crashes: 0
peak commit: 15265 MB

Not tested

Both runs were on my machine; Claude Code (Claude Fable 5.2) ran the script and wrote this report.

@jfarre20

Copy link
Copy Markdown

On a GTX 1070 (8 GB, no mesh shaders), the texture alias handling ran on PR revision 2a64505. XCL logged at least 256 textures reading from the CPU view. The game hit the same null write as #232 before the intro, so video playback on Pascal is still unverified. The PR has advanced to 9bd7635 since these runs.

I compared two local release builds on the Series X profile. The control was a 40-PR integration branch based on 9ab7d76, including #267. Adding #283 required resolving a conflict in title_textures.rs to keep the existing placement registry and use the PR's CPU source address for uploads and write tracking.

Build Presents Captured frames First exception
Control, 119f4c4 1,436 59 black 115.590 s, 0xc0000005 writing to zero at game_scarlett_master.exe+0x2215c35
Control + #283, 18bbcad 1,151 48 black 114.940 s, same exception and offset

On the Series S profile, the same #283 binary reached 2,318 presents with 96 black captures before a different breakpoint at 151.932 s (0x80000003, title offset +0xb18de7). Each configuration ran once.

Ryzen 7 5800X, 64 GB RAM, Windows 10 IoT Enterprise LTSC 19044.7846, NVIDIA 581.80, DXC 1.8.2502.11, Agility SDK 1.619.6, title 1.0.2.1. Each run used a fresh title data directory with XCL_NETWORK=0, XCL_FRAME_DUMP=24, XCL_ACTIVITY=1, XCL_RUN_SECONDS=155 and XCL_PRESS_AT=45:A,115:A,135:Y.

Codex (GPT-6) ran the local tests and prepared this report.

@simnJS

simnJS commented Nov 23, 2026

Copy link
Copy Markdown

Tested on Linux (Wine, NVIDIA): the intro video is no longer solid green – it shows the picture – but it plays at about 5 fps.

Tested commit: 2a64505 (head of #283; stacked on #252, base 7a033c8, 4 commits behind main 0e946cf, none touching crates/). Compared with main at 0e946cf, same machine, same protocol.

Tested

  • Ubuntu 26.04, RTX 4080 SUPER (NVIDIA 595.99.02), Ryzen 9 7950X3D. Proton Experimental 11.0 Wine (not Windows), vkd3d-proton v3.1 (patched as in Linux: docs/linux.md, scripts/linux and Wine start-up checks for vkd3d-proton and DXVK (#154, #241) #257), DXVK 3.1.1, DXC 1.9.2609. Rust 1.99.1, release, x86_64-pc-windows-gnu.
  • cargo build --release --locked --target x86_64-pc-windows-gnu -p xcl: builds, both commits.
  • The retail game, XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_FRAME_DUMP=120, one 70 s run per build, the account prompt answered with a single A by hand (about 48 s into the main run, about 30 s into the KernelX / title textures: a GPU view of the title's CPU memory reads the CPU view (retail intro video, no green screen) #283 run).
  • Video: main dumps the intro as solid (0,135,0) (frames 980–1220, mean colour unchanged). 2a64505 dumps the real picture: frame 380 mean (88,100,27), a jungle scene with the video's lettering; frame 260 of a second run of the same build with temporary logging (83,78,80). So the GPU view of the title's CPU memory (kernelx::mirrors) works under Wine: the log has "a texture at 0x… lies in a GPU view of the title's CPU memory: kept in step with 0x…" (rate-limited: 10 lines, 512 textures by 36 s).
  • Frame rate: from the moment the video plays (36 s), presents per 2 s are 9–12 (median 11, about 5.5 fps; a second run of the same build: median 10.5). main shows the green video at 59 per 2 s (30 fps) and KernelX: GPU-visible title memory outside the windows is write-watched (retail menu text complete) #252 alone stays at 60 per 2 s (30 fps). Draws per 2 s are 54–72 during the video, so the GPU is not the limit. With a timer around title_textures::refresh (temporary, not in the PR) the title's submits spent 1.9–2.1 s of every 2 s in it, about 70 textures uploaded per 2 s (about 2 per submit, 60 ms a submit). GetWriteWatch is not the cost: the write-watch time the log reports for the sparse windows grew by 0.47 s over 20 s; the rest is in uploading the textures (I did not time upload_all apart).
  • Stability: no crash and no device removal in 70 s. New WARN / ERROR: none – 57 distinct lines against 57 on main (the same set once addresses are masked: the one DirectStorage: EnqueueRequest: refused line differs only in an address).
  • The run ends in the video (about 5 fps, 70 s): I did not see what follows it, and the title's menus were not reached with KernelX / title textures: a GPU view of the title's CPU memory reads the CPU view (retail intro video, no green screen) #283 in these runs.

Not tested

AI use

  • Written with an AI coding agent from real runs (a person pressed A), then checked by the author.

@ryosen0

ryosen0 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Data point from a different NVIDIA card (RTX 3060 Ti 8 GB, driver 32.0.16.1742, Ryzen 7 9800X3D, Windows 11, main 4017f8f + #300 + #294, release, XCL_NETWORK=0): the Bink intro here is not green - it is skipped/black, and after the settings menus the screen is a solid colour. bink2scarlett.dll loads and attaches; the audio of the intro plays (with #294). At the solid-colour point the log shows:

DirectStorage: BCPack BC7: mode 7 unsupported ... E_DECOMPRESSION
DirectStorage: BCPack BC5: mode 5 unsupported ... E_DECOMPRESSION
DirectStorage: BCPack BC1: mode 1 unsupported ... E_DECOMPRESSION
D3D12.X: CopyMemoryToMemoryX: 0x125bb60000 -> 0x72a1e44f0 (0x4000 bytes) is not in unified memory - not done

So on this card the visible failure may be one step earlier than the GPU-view aliasing (texture data never arrives, BCPack refused - #208/#273), or the same zero-read you describe with a different clear colour. Happy to run a build with this PR + #252 stacked and report what the intro does here.

AI use: GPT-6.2 Astra (API model selector) wrote this comment from our run's log; the human contributor observed the screen.

@mosin311aa

Copy link
Copy Markdown

Tested on Linux (Wine, NVIDIA): the intro video is no longer solid green – it shows the picture – but it plays at about 5 fps.

Can confirm the same, the 5 FPS might be a separate problem

@CodeByCon

Copy link
Copy Markdown

Tested on AMD (RDNA3), since the PR's numbers are from an NVIDIA card.

Build: main af20b4b + #211 + #218 + #252 (e93dc9c) + #283 (9bd7635) + #244 (77905f6), release, Rust 1.99.
Hardware: AMD RX 7800 XT (gfx1101), driver 32.0.32029.2010, Windows build 26300.9974.

Result: the intro video plays with its real picture. Without #283 the same build draws every movie frame as 0xff008700. Two runs with it: 45 s (263 presents) and 55 s (635 presents), both exit 0, no device removal. This also covers issue #280 on AMD, not just NVIDIA.

Frame rate: the video ran at ~6 fps on this card with the detile as it is now; Chain::detile_level copies a linear surface one element at a time, and a frame is three linear R8 planes (3840x2160 + 2x 1920x1080). A local change that copies a whole row for mode == 0 (rows are contiguous, padded to 256 B) took the detile from 32.7 ms to ~2 ms a frame and the video from ~6 to 14.4 fps over the last 300 frames. That is the "GPU-side upload" follow-up in the description, minus the GPU: most of the cost is the per-pixel loop, not the upload. Happy to test a version of it if you want it in this PR or a separate one.

One thing to avoid: skipping the read_committed copy and detiling straight from the CPU view (saving one 8 MB copy per plane) crashed this title at game+0x2215c35 (write at 0) 5-10 s in, on repeated runs; keeping the copy is fine.

Not tested: NVIDIA, other titles, whole workspace suite. cargo test -p xcl --lib gpu::tiling: 12 passed, 0 failed (includes a new test for the linear row path).

AI-assisted: DeepSeek V4.1 Flash wrote this report from our runs.

@ivall
ivall merged commit 21b8723 into ivall:main Nov 23, 2026
1 of 2 checks passed
forbesfields pushed a commit to forbesfields/xcl that referenced this pull request Nov 23, 2026
Handle 16-byte constant-buffer records, upload intro textures from their CPU view, and decode BC1 BCPack streams. Share bounded texture pages, batch upload staging, and tolerate pages decommitted during streaming reads.

Includes work from ivall/xcl ivall#208, ivall#244, ivall#252, ivall#254, ivall#269 and ivall#283. DirectStorage late destination pages are already in the base.

Assisted-by: OpenAI Codex (gpt-6.2-sol)
Prime1997 added a commit to Prime1997/xcl-compat-fixes that referenced this pull request Nov 23, 2026
…e regressions

Ported from ivall/xcl#283 (comment) by gw1337x. Preserve the old checked behavior for noncanonical base XORs and extend the contributor differential test with partial elements, truncated rows, zero/base swizzles, tails, modes and pipe configurations.
ivall added a commit that referenced this pull request Nov 23, 2026
@gw1337x

gw1337x commented Nov 23, 2026

Copy link
Copy Markdown

Follow-up to my detile comment above: with the detile fixed, the rest of the upload path showed up once the title streams its world after the video. Same machine (RX 7800 XT, GTA VI), XCL_PRESS_A_AT=14,17,21, XCL_ACTIVITY=1, timing counters around each step.

What it was: texture::upload_batch makes a new allocator, command list, fence and upload buffer for every batch, one upload buffer per texture (buffer(dev, total)), and then waits on the CPU (wait) before the title's submit continues. During world loading that became the cost:

before after
submit + CPU wait per 2 s, during the video ~210 ms ~5 ms
presents per 2 s, 32–44 s (loading after the video) 39, 1, 0, 0, 1, … 60, 60, 53, 60, 60, 60, 60
upload buffers made by 60 s 3 742 (5 GB) 6 (384 MB)

The change (gpu/texture.rs, title_textures.rs):

  • texture::Uploader, one per device: one command list, allocators and upload buffers reused once the GPU is past them, one fence. A batch's textures share one upload buffer (64 MiB and up), each at its own 512-aligned offset (record_upload_with takes the staging memory from the caller; record_upload_states keeps its behaviour).
  • No CPU wait: before the title's work, title_textures::refresh makes the title's queue Wait on the uploader's fence (only its own device's; a fence of another device left a queue's work unrun in the tests).
  • The textures copied into are held until the GPU is past the copy: the title can release one meanwhile, and a final release with the copy in flight removed the device (found with the debug layer – the CPU wait had hidden it).
  • XCL_SYNC_UPLOADS=1 keeps the old path.
diff on main 4017f8f (gpu/texture.rs, title_textures.rs: +215 −2)
diff --git a/crates/xcl/src/gpu/texture.rs b/crates/xcl/src/gpu/texture.rs
index 1008d76..cff3864 100644
--- a/crates/xcl/src/gpu/texture.rs
+++ b/crates/xcl/src/gpu/texture.rs
@@ -225,6 +225,146 @@ pub unsafe fn upload_batch(dev: &ID3D12Device, queue: &ID3D12CommandQueue, items
     Ok(failed)
 }
 
+/// Uploads that do not wait: one command list, allocators and upload buffers reused once the
+/// GPU is past them, a fence the title's queues wait for on the GPU (`upload`). Made for the
+/// title textures kept in step with its memory: re-uploaded every frame (a video's planes,
+/// streaming), a new allocator, list, upload buffer and fence and a CPU wait for each batch held
+/// a retail game's frames for seconds while it loaded its world.
+pub struct Uploader {
+    fence: ID3D12Fence,
+    value: u64,
+    list: Option<ID3D12GraphicsCommandList>,
+    /// allocators and the fence value their last list ran to
+    allocs: std::collections::VecDeque<(ID3D12CommandAllocator, u64)>,
+    /// upload buffers in use: (fence value, buffer, bytes)
+    busy: std::collections::VecDeque<(u64, ID3D12Resource, u64)>,
+    /// the textures copied into, held until the GPU is past the copy (the title may release
+    /// one meanwhile: a final release with the copy in flight removed the device)
+    dests: std::collections::VecDeque<(u64, ID3D12Resource)>,
+    /// upload buffers the GPU is done with: (bytes, buffer)
+    free: Vec<(u64, ID3D12Resource)>,
+    free_bytes: u64,
+}
+
+// D3D12 objects are free-threaded
+unsafe impl Send for Uploader {}
+
+/// an upload buffer's bytes at least: the textures of a batch are placed in one, one after another
+const UPLOADER_CHUNK: u64 = 64 << 20;
+
+/// upload buffers kept for reuse at most
+const UPLOADER_FREE_CAP: u64 = 512 << 20;
+
+impl Uploader {
+    pub unsafe fn new(dev: &ID3D12Device) -> Result<Uploader, String> {
+        let fence: ID3D12Fence = dev.CreateFence(0, D3D12_FENCE_FLAG_NONE).map_err(err)?;
+        Ok(Uploader { fence, value: 0, list: None, allocs: Default::default(), busy: Default::default(), dests: Default::default(), free: Vec::new(), free_bytes: 0 })
+    }
+
+    /// The fence and the value the title's queues wait for to see every upload so far.
+    pub fn done_at(&self) -> (&ID3D12Fence, u64) {
+        (&self.fence, self.value)
+    }
+
+    unsafe fn recycle(&mut self) -> u64 {
+        let done = self.fence.GetCompletedValue();
+        while self.dests.front().is_some_and(|d| d.0 <= done) {
+            self.dests.pop_front();
+        }
+        while self.busy.front().is_some_and(|b| b.0 <= done) {
+            let (_, buf, bytes) = self.busy.pop_front().unwrap();
+            if self.free_bytes + bytes <= UPLOADER_FREE_CAP {
+                self.free_bytes += bytes;
+                self.free.push((bytes, buf));
+            }
+        }
+        done
+    }
+
+    /// A free upload buffer of `size` bytes or more (not over twice), else a new one (a power
+    /// of two from `UPLOADER_CHUNK`, so they can be reused). A batch's textures share one
+    /// (`upload`): a buffer each, of 1 MiB at least, made 5 GB of upload buffers in 18 s while
+    /// a retail game streamed thousands of small textures.
+    unsafe fn take(dev: &ID3D12Device, free: &mut Vec<(u64, ID3D12Resource)>, free_bytes: &mut u64, size: u64) -> Result<(ID3D12Resource, u64), String> {
+        let size = size.max(UPLOADER_CHUNK);
+        let best = free.iter().enumerate().filter(|(_, f)| f.0 >= size && f.0 <= size * 2).min_by_key(|(_, f)| f.0).map(|(i, _)| i);
+        if let Some(i) = best {
+            let (bytes, buf) = free.swap_remove(i);
+            *free_bytes -= bytes;
+            return Ok((buf, bytes));
+        }
+        let bytes = size.next_power_of_two();
+        Ok((buffer(dev, bytes)?, bytes))
+    }
+
+    /// `upload_batch` without the wait: the work goes to `queue`, and the title's queues wait
+    /// for `done_at` on the GPU before work that samples the textures.
+    pub unsafe fn upload(&mut self, dev: &ID3D12Device, queue: &ID3D12CommandQueue, items: &[(ID3D12Resource, Vec<Subresource>, Vec<D3D12_RESOURCE_STATES>)]) -> Result<Vec<(usize, String)>, String> {
+        if items.is_empty() {
+            return Ok(Vec::new());
+        }
+        let done = self.recycle();
+        let alloc = match self.allocs.front() {
+            Some((_, v)) if *v <= done => {
+                let (a, _) = self.allocs.pop_front().unwrap();
+                a.Reset().map_err(err)?;
+                a
+            }
+            _ => dev.CreateCommandAllocator(D3D12_COMMAND_LIST_TYPE_DIRECT).map_err(err)?,
+        };
+        let list = match &self.list {
+            Some(l) => {
+                l.Reset(&alloc, None).map_err(err)?;
+                l.clone()
+            }
+            None => {
+                let l: ID3D12GraphicsCommandList = dev.CreateCommandList(0, D3D12_COMMAND_LIST_TYPE_DIRECT, &alloc, None).map_err(err)?;
+                self.list = Some(l.clone());
+                l
+            }
+        };
+        let mut used: Vec<(ID3D12Resource, u64)> = Vec::new();
+        let mut failed = Vec::new();
+        // the buffer being filled: (buffer, its bytes, bytes used)
+        let mut cur: Option<(ID3D12Resource, u64, u64)> = None;
+        for (k, (res, subs, states)) in items.iter().enumerate() {
+            let (free, free_bytes) = (&mut self.free, &mut self.free_bytes);
+            let r = record_upload_with(dev, &list, res, subs, states, states, &mut |size| {
+                let fits = cur.as_ref().is_some_and(|c| c.2.next_multiple_of(512) + size <= c.1);
+                if !fits {
+                    if let Some((b, bytes, _)) = cur.take() {
+                        used.push((b, bytes));
+                    }
+                    let (b, bytes) = Self::take(dev, free, free_bytes, size)?;
+                    cur = Some((b, bytes, 0));
+                }
+                let c = cur.as_mut().unwrap();
+                let at = c.2.next_multiple_of(512);
+                c.2 = at + size;
+                Ok((c.0.clone(), at))
+            });
+            if let Err(e) = r {
+                failed.push((k, e));
+            }
+        }
+        if let Some((b, bytes, _)) = cur.take() {
+            used.push((b, bytes));
+        }
+        list.Close().map_err(err)?;
+        queue.ExecuteCommandLists(&[Some(windows::core::Interface::cast(&list).map_err(err)?)]);
+        self.value += 1;
+        queue.Signal(&self.fence, self.value).map_err(err)?;
+        for (b, bytes) in used {
+            self.busy.push_back((self.value, b, bytes));
+        }
+        for (res, _, _) in items {
+            self.dests.push_back((self.value, res.clone()));
+        }
+        self.allocs.push_back((alloc, self.value));
+        Ok(failed)
+    }
+}
+
 /// Record the copy of `subs` into `res` on `list` (barriers from `before` and back to `after`);
 /// the staging buffer returned must live until the list has run.
 pub unsafe fn record_upload(dev: &ID3D12Device, list: &ID3D12GraphicsCommandList, res: &ID3D12Resource, subs: &[Subresource], before: D3D12_RESOURCE_STATES, after: D3D12_RESOURCE_STATES) -> Result<ID3D12Resource, String> {
@@ -241,6 +381,20 @@ pub unsafe fn record_upload_states(
     subs: &[Subresource],
     before: &[D3D12_RESOURCE_STATES],
     after: &[D3D12_RESOURCE_STATES],
+) -> Result<ID3D12Resource, String> {
+    record_upload_with(dev, list, res, subs, before, after, &mut |size| buffer(dev, size).map(|b| (b, 0)))
+}
+
+/// `record_upload_states` with the staging memory from `staging`: an upload heap buffer and
+/// the offset (a multiple of 512) of the bytes asked in it.
+pub unsafe fn record_upload_with(
+    dev: &ID3D12Device,
+    list: &ID3D12GraphicsCommandList,
+    res: &ID3D12Resource,
+    subs: &[Subresource],
+    before: &[D3D12_RESOURCE_STATES],
+    after: &[D3D12_RESOURCE_STATES],
+    staging: &mut dyn FnMut(u64) -> Result<(ID3D12Resource, u64), String>,
 ) -> Result<ID3D12Resource, String> {
     validate_subresources(subs)?;
     let rd = res.GetDesc();
@@ -264,7 +418,10 @@ pub unsafe fn record_upload_states(
             ));
         }
     }
-    let up = buffer(dev, total)?;
+    let (up, base) = staging(total)?;
+    for fp in fps.iter_mut() {
+        fp.Offset += base;
+    }
     let mut p = std::ptr::null_mut();
     up.Map(0, None, Some(&mut p)).map_err(err)?;
     for ((s, fp), &nrows) in subs.iter().zip(&fps).zip(&rows) {
diff --git a/crates/xcl/src/hle/d3d12x/title_textures.rs b/crates/xcl/src/hle/d3d12x/title_textures.rs
index 2d8194e..e3066b9 100644
--- a/crates/xcl/src/hle/d3d12x/title_textures.rs
+++ b/crates/xcl/src/hle/d3d12x/title_textures.rs
@@ -314,6 +314,9 @@ pub(super) unsafe fn refresh(queue: *mut c_void) {
     }
     let _refresh = REFRESH.lock().unwrap();
     own_work(|| refresh_once(queue));
+    if !sync_uploads() {
+        wait_for_uploads(queue);
+    }
 }
 
 unsafe fn refresh_once(queue: *mut c_void) {
@@ -457,7 +460,23 @@ unsafe fn upload_all(todo: Vec<(ID3D12Resource, Upload)>) {
                 continue;
             }
         };
-        match own_work(|| texture::upload_batch(dev, &queue, &batch)) {
+        let r = if sync_uploads() {
+            own_work(|| texture::upload_batch(dev, &queue, &batch))
+        } else {
+            let mut ups = UPLOADERS.lock().unwrap();
+            let up = match ups.get_mut(&device) {
+                Some(u) => u,
+                None => match texture::Uploader::new(dev) {
+                    Ok(u) => ups.entry(device).or_insert(u),
+                    Err(e) => {
+                        warn(&e);
+                        continue;
+                    }
+                },
+            };
+            own_work(|| up.upload(dev, &queue, &batch))
+        };
+        match r {
             Ok(failed) => {
                 for (_, e) in failed {
                     warn(&e);
@@ -469,6 +488,43 @@ unsafe fn upload_all(todo: Vec<(ID3D12Resource, Upload)>) {
     }
 }
 
+/// `XCL_SYNC_UPLOADS=1`: each batch of uploads waited for on the CPU (as before `Uploader`)
+fn sync_uploads() -> bool {
+    static ON: std::sync::OnceLock<bool> = std::sync::OnceLock::new();
+    *ON.get_or_init(|| std::env::var("XCL_SYNC_UPLOADS").is_ok_and(|v| v.trim() == "1"))
+}
+
+/// the uploaders, per device (`texture::Uploader`)
+static UPLOADERS: Mutex<BTreeMap<usize, texture::Uploader>> = Mutex::new(BTreeMap::new());
+/// title queue → the upload fence value it last waited for
+static UPLOAD_WAITED: Mutex<BTreeMap<usize, u64>> = Mutex::new(BTreeMap::new());
+
+/// Before the title's work on `queue`: it waits on the GPU for the uploads made so far on its
+/// device (a fence of another device cannot be waited for: with two devices in one process – the
+/// tests – that left a queue's work unrun).
+unsafe fn wait_for_uploads(queue: *mut c_void) {
+    let Some(q) = ID3D12CommandQueue::from_raw_borrowed(&queue) else { return };
+    let ups = UPLOADERS.lock().unwrap();
+    if ups.is_empty() {
+        return;
+    }
+    let mut dev: Option<ID3D12Device> = None;
+    if q.GetDevice(&mut dev).is_err() {
+        return;
+    }
+    let Some(dev) = dev else { return };
+    let Some(up) = ups.get(&(dev.as_raw() as usize)) else { return };
+    let (fence, value) = up.done_at();
+    if value == 0 {
+        return;
+    }
+    let mut w = UPLOAD_WAITED.lock().unwrap();
+    if w.get(&(queue as usize)).copied().unwrap_or(0) < value {
+        let _ = q.Wait(fence, value);
+        w.insert(queue as usize, value);
+    }
+}
+
 /// `XCL_TRACE_FRAME`: how much of a title texture's top level is not zero, each time it is
 /// uploaded (the first 48 uploads of textures of 64x64 and more).
 fn note_content(va: usize, r: &ID3D12Resource, subs: &[texture::Subresource]) {

Tested:

  • The diff above on main 4017f8f: cargo test --release -p xcl --lib -- --test-threads=4: 612 passed, 0 failed, 20 ignored.
  • The retail numbers are from my local stack (main 9ab7d76 + Lazy physical pages: a thread that loses the race to commit a page retries #244 + this PR + the detile change + these commits + timing counters): its lib suite 615 passed, 0 failed; 60–70 s runs, no device removal; the D3D12 debug layer shows no new message ids.

Not tested: the diff on its own with the title; no smoke.ps1 blocks; NVIDIA. From ~50 s the frames drop again, but with the upload work idle by then (a thread dump showed the render thread in the driver's pipeline compiler) – not addressed here.

It is separate from this PR; here for anyone who wants to pick it up.

AI-assisted (Claude Code, Claude Opus 5.5).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.