Repository navigation
GPU tests: skip mesh_dispatch test when no SM 6.6 GPU is available - #74
Merged
ivall merged 1 commit intoNov 23, 2026
Merged
Conversation
Collaborator
|
Merged. Tested on Windows 11 with an RX 9070 (RDNA4): |
Ahmet-Dedeler
added a commit
to Ahmet-Dedeler/xcl
that referenced
this pull request
Nov 23, 2026
… page pool are kept; title textures placed in the GPU's range read their pages where the CPU has them
The method (as a retail game calls it, image +0xf2cc7f: queue vtable +0xf8 = slot 31):
(queue, batch count, batches, page pool address, pages in the pool, 0)
- batches: records of 0x18 bytes { GPU-view address u64, range count u32, ranges pointer at +0x10 }
- ranges: 12 bytes { flags u32 (1 = map, 2 = unmap), pool page u32, page count u32 }, one after
the other from the batch's address; the title writes one map range a page (image +0xf2c6bc)
and one unmap range { 2, 0, n } a run (+0xf2c8ca)
- page pool address: the address the title gave RegisterPagePoolX (device xcl-dev#74, image
+0x1e6c2bb) right after it mapped all the pool's pages there in order
(XMemMapPhysicalPages(pool, n, pages), +0x1e6c295): pool page k is the physical page that was
mapped at pool + k * 64 KiB
- 4th argument: the pool's byte size >> 16 (0x185c0 = the 99,776 pages the title allocates)
Seen over a run (XCL_TRACE_PAGE_VIEWS=1): pool 0xd20000000, batch addresses 0x7440000000 and
up; after 65 calls, in the front end's loading screens, 4,793 pages had been mapped and 952
unmapped, no view mapped twice without an unmap between, none unmapped that showed nothing.
What the console does with it (inferred from the title's code, +0x1e6c110 and +0xf2c560): the
title reserves two ranges of 24 GiB for its resource memory, one PAGE_READWRITE and one with
protection 0x801. Pages are mapped for the CPU in the first with XMemMapPhysicalPagesScatter
and for the GPU in the second with this call, at the same virtual page number; resources are
created at addresses in the second, and the title's texture lock rebases such an address into
the first (+0x5121690). So the GPU's page table for the second range is what this call says.
What XCL does: `gpu_views` keeps GPU-view page -> physical page. The pool page is found by the
address it had in the pool (`kernelx::page_of_view`: a page mapped at a second address is now
remembered by its first, `Away::ghost` - XCL keeps a page at one address at a time).
`title_textures::read_committed` reads pages that are unreadable at a texture's address where
the CPU has the page the view shows.
Verified live (D3DMetal, the retail game): its Bink planes - nine R8 textures at 0x744c400000 ...
0x744f000000, written by the decoder at 0xb6c400000 ... 0xb6f000000 - upload the decoded
picture (with the Bink commit that says when they were written); the loading screens' artwork
shows. Of the 4,793 pages mapped, 4,092 were at GPU address = CPU address + 0x68e0000000 (the
start of the GPU range minus the start of the CPU range) when the call came; 701, at 16 other
distances, were not in the CPU's range then (by the distances the page was still at its place
in the pool, 0xd4b790000 and up): a rule that pairs the two reservations by offset reads
nothing for those. In two runs that ended earlier (33 and 17 calls) all pages were at the one
distance.
Unit tests: kernelx::tests::a_page_is_found_by_an_earlier_view, gpu_views::tests (3).
Co-Authored-By: Claude Mythos 5.2 <[email protected]>
Ahmet-Dedeler
added a commit
to Ahmet-Dedeler/xcl
that referenced
this pull request
Nov 24, 2026
…pings of a page pool are kept; a GPU view's page is read where they show it, else by the pairing A retail game maps its page pool's 64 KiB pages twice: for the CPU with XMemMapPhysicalPagesScatter in one 24 GiB reservation, and for the GPU with command queue xcl-dev#31 of the newer layout in the other (PAGE_NOACCESS | PAGE_GRAPHICS_NOACCESS), where it places its streamed textures and video planes. The method was a logged no-op; the pairing of the two reservations (kernelx::mirrors) reads such a texture at the same offset of the CPU view. That holds for most pages only: in one traced run through the front end 4,092 of 4,793 pages mapped by xcl-dev#31 were at that offset when the call came and 701 were not in the CPU view at all (mapped for the GPU only, from where they were in the pool) – textures over those read zeros (the front end's menu images). The method (queue vtable +0xf8; image +0xf2cc7f): (queue, batch count, batches, page pool address, pages in the pool, 0) - batches: 0x18 bytes { GPU-view address u64, range count u32, ranges pointer at +0x10 } - ranges: 12 bytes { flags u32 (1 = map, 2 = unmap), pool page u32, page count u32 }, one after the other from the batch's address - page pool address: what RegisterPagePoolX (device xcl-dev#74) got, where the title had mapped all the pool's pages in order: pool page k is the physical page that was mapped at pool + k * 64 KiB d3d12x::gpu_views keeps GPU-view page -> physical page. A pool page is found by the address it had in the pool (kernelx::page_of_view: a page mapped at a second address is remembered by its first, Away::ghost – XCL keeps a page at one address at a time), its data where the title last mapped it or at its home (kernelx::page_address). title_textures reads a texture's bytes page by page (TitleMemory, for uploads and for the content comparison): where the queue's mapping shows the page; else at the address itself if a page is mapped there; else at the same offset of the paired CPU view; any other address where it is. Uploads take the title's address (Entry::va); Entry::src stays what is write-watched. The frame-rate line is followed by how the pages of GPU views were found so far (title_textures::view_sources), XCL_TRACE_PAGE_VIEWS=1 counts what the calls ask for. Tests: kernelx::tests::a_page_is_found_by_an_earlier_view, gpu_views::tests (3), title_textures::tests::a_gpu_view_page_is_read_by_the_queues_mapping_before_the_pairing. Co-Authored-By: Claude Mythos 5.2 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
gpu::recomp::mesh_dispatch::tests::gpu_dispatch_matches_native_wave64_referencecheckeddxc::location()before compiling, then calledrunner::dispatch(...).unwrap()without checkingrunner::adapter().On a machine without an SM 6.6 D3D12 runtime (for example Windows 10 22H2 build 19045 with inbox
D3D12Core.dll10.0.19041.5794, even with an RTX 5070, or a headless runner), every other recompiler GPU test skips cleanly viarunner::skip_test("no GPU")while this test panics:This adds the same
runner::adapter()check before DXC compilation (matchinggpu_ready_wave32()ingpu/recomp/tests.rs) so it printsSKIPPED ...: no GPUand honorsXCL_REQUIRE_GPU.Validation
Windows 10 Pro
10.0.19045, RTX 5070 (XCL_ADAPTER=0), Rust 1.100.0x86_64-pc-windows-msvc, DXC 1.9.2602.17:cargo test --workspace -- --test-threads=2failed ongpu_dispatch_matches_native_wave64_reference(no SM 6.6).cargo test --workspace -- --test-threads=2passed (372 passed, 0 failed, 34 ignored,43SKIPPED ...: no GPU).XCL_REQUIRE_GPU=mesh cargo test -p xcl --lib gpu_dispatch_matches_native_wave64_referencefails as expected (no GPU, but XCL_REQUIRE_GPU=mesh).