Skip to content

D3D12.X: a texture in a GPU view reads the pages the page-mapping method put under it - #1102

Draft
Xeltax wants to merge 2 commits into
xcl-dev:mainfrom
Xeltax:page-mapped-textures
Draft

Xeltax wants to merge 2 commits into
xcl-dev:mainfrom
Xeltax:page-mapped-textures

Conversation

@Xeltax

@Xeltax Xeltax commented Nov 24, 2026

Copy link
Copy Markdown

Stacked on #1055: only the last commit (59042fd) is this PR. I'll rebase it once #1055 is merged.

A texture in a GPU view now reads each of its 64 KiB pages from what queue #31 (CopyPageMappingsBatchX) mapped there:

  • a mapped page reads the physical page, where XCL keeps it;
  • an unmapped page reads as zeros;
  • a page the method never mapped reads the CPU view, as before.

On the retail title of #505 about 43% of the mapped pages had their physical page at the pool address, while the texture read the CPU view's same offset. That offset is not committed, so those parts of textures went up as zeros (#1031, the correction there).

What is in it

  • crates/xcl/src/hle/d3d12x/title_textures.rs:
    • Source replaces the single address a texture was read from. It is either one address (At, as before) or runs of the texture's bytes from several addresses (Pages; address 0 means zeros). Uploads, the unchanged-content check, the detile and the write watch all go through it.
    • source_of(va, len) builds it. A texture whose pages form one run comes back as At, so it costs what it did before. A texture outside GPU views, or one whose pages the method never mapped, is At(mirror_source(va)) as before.
    • recheck_gpu_view_sources re-reads the source only of the textures on pages the method changed, or whose physical page moved (mirrors::take_changed, found through by_va). Looking at all of them took 225 ms on 64k textures, and the method is called hundreds of times. A change of gpu_view_map_gen (physical pages mapped into a GPU view directly) still looks at all of them, as before.
  • crates/xcl/src/hle/kernelx.rs, mirrors:
    • the page table also keeps physical page → GPU-view pages, and the ranges changed since the last look;
    • page_moved(page) is called where a physical page is mapped, unmapped (unmap_away) or freed, so a texture follows its page when the title maps it into the CPU view too.
  • Tests:
    • a_page_mapped_texture_is_read_page_by_page: runs, zeros, the CPU view for untouched pages, one run as one address, the watched ranges and the dirty check.
    • gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes gets three steps on the GPU, each read back from the PC texture:
      • the pool page under the texture;
      • the same physical page after the title maps it into the CPU view, and a CPU write there;
      • zeros after the method unmaps the page.
    • Both tests fail with source_of reduced to the old mirror_source (checked).

On the retail title (main 67a3735 + #1055, with and without this PR; RTX 4080; A pressed through XCL_PRESS_AT; one run each)

  • Textures whose memory is all zero. XCL_TRACE_FRAME=1 logs how many textures are all zero in 16 samples of 4 KiB over their memory. The snapshots don't fall at the same moments in the two runs:

    snapshot all zero
    without this PR 57 s 6,119 of 15,726 (39%)
    without this PR 73 s 6,139 of 21,775 (28%)
    with it 63 s 2,734 of 14,424 (19%)

    A texture can be zero on purpose, so this is a trend rather than a count of fixed textures.

  • Nothing slower. Over the whole run (presents / submits / draws), and when the first #101 and the watchdog come:

    presents submits draws first #101 watchdog
    without this PR 1,765 8,790 15,750 77 s 108 s
    with it 1,730 8,695 15,359 80 s 110 s
  • 32,768+ textures were kept in step "with its pages", most of them as one run.

  • The run still ends at the title's watchdog (+0x23cf683), as on main. That stop is about stalled GPU work (Newer retail title (TitleID 7952987A): reaches world loading, then the title's GPU watchdog ("GPU Loc Sig") after ListX #101 stub #505), not about textures.

Tested

  • NVIDIA GeForce RTX 4080 (driver 621.01), AMD Ryzen 9 9900X, Windows 11 Pro 26200, rustc 1.100.0, DXC 1.9.2609.5. Tests ran in debug, the title in release.
  • cargo test --workspace --no-fail-fast -- --test-threads=4 on 59042fd: 738 passed, 0 failed, 41 ignored. SKIPPED: gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware (no wave64).

Regression run

main:

xcl-smoke v1
commit: 67a3735177f42cf8e5c886e67a974da7f87541b3
gpu: NVIDIA GeForce RTX 4080
title: RetailTitle
seconds: 60
exit: 0x0
frames shown: 1582 (PresentX 1583)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16549 MB

PR:

xcl-smoke v1
commit: 59042fd2ec585767cb12a1c8ad21fcfefa836b72
gpu: NVIDIA GeForce RTX 4080
title: RetailTitle
seconds: 60
exit: 0x0
frames shown: 1658 (PresentX 1658)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15791 MB

Not tested

  • AMD and Intel GPUs.
  • Whether the world looks right: the run still ends at the title's watchdog on this machine before the world is shown.
  • A page mapped both by the method and directly at the GPU-view address (XMemMapPhysicalPages into the view): the method's mapping wins here, whichever came last.

AI use

  • Claude Code (Claude Opus 5.5) wrote the code, the tests and this description, ran the title and the tests, and read the logs.

🤖 Generated with Claude Code

@IvyNotFound

Copy link
Copy Markdown

Test report: RTX 5080 (wave32), head 59042fd (with #1055): suite green; on the retail title of #505 the method is decoded and textures read its pages, but the frames after world loading stay black / flat grey as on main; one of two runs ended in a device hang

Tested

  • NVIDIA GeForce RTX 5080 16 GB, driver 621.24 (32.0.16.2124); Ryzen 7 7800X3D; Windows 11 25H2 (26200.9974); rustc 1.100.0 MSVC; DXC 1.9.2602.17. PR head as is (base 67a3735).
  • cargo test --workspace --no-fail-fast -- --test-threads=4 (debug, XCL_SAMPLE_RPF, _DLLS, _TTPF, _BVH4, _BK2, _AWC set): 738 passed, 0 failed, 41 ignored; SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
  • Retail title 1.0.2.1, release, scripts/smoke.ps1 -Seconds 140 with XCL_PRESS_A_AT=15, XCL_PSO_WAIT_MS=50, XCL_FRAME_DUMP=2, two runs back to back. Same settings as my four main 47efa2e runs in Newer retail title (TitleID 7952987A): reaches world loading, then the title's GPU watchdog ("GPU Loc Sig") after ListX #101 stub #505 (comment).
run CopyPageMappingsBatchX at 256 calls textures in GPU views first queue.Wait timeout end
1 35 517 pages mapped (all to a page the title mapped), 2 218 unmapped, 0 elsewhere 65 536+ 111.6 s device removed 0x887a0006 at 131.0 s, then 0x80000003 at +0x2474606; nvlddmkm event 153 (TDR) logged; the process had to be killed
2 34 186 mapped, 2 300 unmapped, 0 elsewhere – 122.2 s 0xc0000409 at ~124 s; 0 device removals; peak commit 43 941 MB
  • Run 2 at 116 s: 15 461 draws with translated pipelines (9 725 skipped), 34 571 dispatches (1 632 skipped), in line with main.
  • Frames presented after world loading (both runs): the loading screen fading back, then all black (mean 0.0–0.2 / 255) or one flat grey (~32); never the world. Same as main.
  • The device hang in run 1 came after the same GPU queue.Wait … did not complete within 5000 ms and sparse: the queue has not reached fence value … stalls that main shows; none of my four main runs hung the device, but one hang in two runs is not enough to put it on this PR.

Not tested

  • the PR rebased onto current main; AMD; the debug layer
  • whether the textures this PR re-sources hold the right data (no PIX capture; the title presents no world frame here either way)

AI use

  • Claude Code, Claude Opus 5.5: ran the build, the tests and the runs, read the logs and frame dumps and wrote this report. The device hang was also seen by the person at the machine.

…GPU-view page shows

Queue method ivall#31 (ivall#29 of the older layout) maps pages of the title's
memory into GPU views; it was a stub. Its batches are now decoded and
checked against the batch count and the pool, and each 64 KiB page of
a GPU view records the pool page it was given and the physical page the
title had mapped there (kernelx::mirrors). A bad call records nothing;
releasing a view drops its pages.

XCL keeps a physical page's data where it was mapped last, and the
title maps most streamed pages into the CPU view behind the GPU view
too, so `mapped_source` answers where that page is now (`page_now`),
else the pool page itself. Each title mapping is remembered per address
(Away::title), written once the page is in place and forgotten when the
reservation goes; a page freed while its allocation lives is no longer
looked for (Away::freed).

Nothing reads the record yet: textures are unchanged; the queue logs its
counts. (ivall#1031)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hod put under it

Each 64 KiB page of a texture in a GPU view is read from what queue
XCL keeps it, zeros for an unmapped page, the CPU view for a page the
method never mapped (`source_of`, `Source::Pages`). The textures on
the pages a call changes, or whose physical page moved, are looked at
again at the next submit (`mirrors::take_changed`, `page_moved`), not
all of them. Their writes are watched where the pages are. (ivall#1031)

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

Xeltax commented Nov 24, 2026

Copy link
Copy Markdown
Author

Thanks for the run, @IvyNotFound. It matches what I see: textures in GPU views now read their pages, and the frames after loading stay black or flat grey, as on main.

AI use: Claude Code (Claude Opus 5.5) wrote this reply.

@MKmajster

Copy link
Copy Markdown

Confirming #1102 (with #1055) on an RTX 3070 (8 GB VRAM) / 16 GB RAM, Windows 11, applied on top of #605 (R9G9B9E5 → R11G11B10, needed so Series S does not assert at startup).

Series X (anaconda): with #1102 the retail title now renders fully visible 4K frames — 518400/518400 sampled pixels non-black, real scene colors (dark intro tones) — where before every sampled frame was black. CopyPageMappingsBatchX decode is active (e.g. 63632 pages of 64 KiB pool, 0 unmapped, 0 elsewhere) and the sparse windows upload ~3.8–5.4 GB of CPU writes / ~57k–69k tiles. It then hits the known 8 GB-VRAM device-removed (0x887a0007) at 4K after a few minutes — a separate VRAM-capacity limit, not this PR.

Series S (lockhart, 1080p — fits 8 GB): stable ~30 fps for 240 s+, no crash, but frames stay black on this setup even with #1102. The per-frame ID3D12GraphicsCommandList10 #126/#142 are still stubbed here, so a visible Series S frame appears to also need those (#616 / #1031 family).

Net: #1102 moves GTA VI from all-black to visible with correct textures in Series X. Thanks for this!

Tested with Claude Code (AI-assisted). No game data attached.

@3L1A5-1

3L1A5-1 commented Nov 24, 2026

Copy link
Copy Markdown

A note on overlap, from a local change that touches the same textures (not a PR, and I won't open it as it is because of this PR).

What I measured: GTA VI 1.0.2.1, RTX 2060 SUPER 8 GB, i5-9400F, 16 GB RAM, main 47efa2e + #1182, release, XCL_NETWORK=0. A local diagnostic sorted every live vram::Pages page during world loading. At ~245 s, 5.07 GB of the 7.9 GB of target pages belonged to page textures in a GPU view (kernelx::mirrors) whose CPU-view source had no physical page in kernelx's AWAY map.

The local change: keys a GPU-view page texture's owned pages by the physical page at its CPU-view source (the page_key of #1182), and leaves a tile NULL where no page is mapped. kernelx queues page map/unmap events, and vram applies them before the next submit. In one world-load run that took target pages from ~7.6 to 2.8 GB and local video memory from ~11.9 to 7.3 GB at the same point.

Why it collides with this PR: those "nothing behind" pages are very likely the ones the title maps with CopyPageMappingsBatchX. After #1055/#1102 they read a physical page, and my change would give them NULL tiles. So the change would have to take the physical page from your page-mapping table, and leave a tile empty only when neither MapTitlePhysicalPages nor queue #31 mapped it.

Question: does #1055 keep the GPU-view page → physical page mapping somewhere vram could read before a submit (and in GPU-timeline order)? If it does, I'd rebase the change onto it once both are in, rather than duplicate any of it.

AI use: Claude Code (Claude Opus 5.5) wrote the diagnostic and the change and ran the measurements on my PC; it also drafted this note.

@MKmajster

Copy link
Copy Markdown

Fresh xcl-smoke regression block for the current head c387de21fa81 — the PR description check wants one made on this commit (scripts/smoke.ps1, clean tree). Feel free to drop it into the Regression run section.

xcl-smoke v1
commit: c387de21fa81d09269bd311b3be6a3afe6598daf
gpu: NVIDIA GeForce RTX 3070
title: the game
seconds: 90
exit: 0x0
frames shown: 2404 (PresentX 2404)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14516 MB

Series X (anaconda) on an RTX 3070 (8 GB) / 16 GB RAM: steady 30 fps with visible, correctly-textured frames throughout the 90 s window (0 device removals, 0 crashes). On this 8 GB card the 4K path later hits the known device-removed, but not within the smoke window.

Tested with Claude Code (AI-assisted). No game data attached.

@Xeltax

Xeltax commented Nov 24, 2026

Copy link
Copy Markdown
Author

Thanks @MKmajster, that's the first report of visible world frames with these two PRs. I'll keep the 8 GB VRAM device removal and the Series S #126 / #142 stubs as separate questions.

@3L1A5-1, yes: the mapping is kept, and vram can read it.

Where it is (kernelx::mirrors, #1055):

  • For each 64 KiB GPU-view page, the method's record keeps the pool page it was given and the physical page the title had mapped there (Shown { pool, page }).
  • mapped_source(va) answers where that physical page's data is now (page_now).
    • It returns Some(None) for a page the method unmapped.
    • It returns None for a page the method never touched; your MapTitlePhysicalPages / AWAY rule still applies there.
  • D3D12.X: a texture in a GPU view reads the pages the page-mapping method put under it #1102 adds take_changed(): the GPU-view ranges whose page changed since the last call. That covers a map, an unmap, the physical page moving, or the page being freed. title_textures drains it before each submit.

Order: the record is made when the title calls queue #31, on the CPU, in the order of its queue calls. It is not deferred to the GPU timeline, as XCL runs other queue methods. So a submit sees the mappings of every call made before it, which I think is what your "before the next submit" needs. Nothing would tell you that a submit made earlier still reads the old pages.

So I'd say: rebase onto #1055/#1102 once they land. Give a NULL tile only where both are true:

  • mapped_source is None or Some(None);
  • no physical page is in AWAY.

Ask me anything about those calls.

AI use: Claude Code (Claude Opus 5.5) wrote this reply.

@Filip722

Copy link
Copy Markdown

Tested

  • PR D3D12.X: a texture in a GPU view reads the pages the page-mapping method put under it #1102 at c387de21fa81d09269bd311b3be6a3afe6598daf with kernelx: queue CopyPageMappingsBatchX records the physical page each GPU-view page shows #1055 at f532d33d695a360bf5701650374dd87a4566c499 on main 930e8b4 and the local 8 GB loading changes. Integrated tree 90d5dfe6ee8eb5229dcf63dbef8f60248c68ecb8, Windows x64 MSVC release.
  • RTX 5060 Laptop GPU with 8 GB VRAM, NVIDIA 615.78.08, Core 7 240H, 16 GB RAM, Bazzite 44, Proton Experimental 11.0-20261112. Local vkd3d-proton 3.1.0 based on 4522cc1 with dxil-spirv 1dc543f.
  • Two focused CPU tests passed under Wine. gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes passed on the RTX 5060 in a separate Proton prefix, with zero failures or skips.
  • On the offline Series X loading run the mapping path logged 18,517 mapped pages by 256 calls. The texture refresh sampled a GPU-view texture backed by two page runs. The title reached 2,156 sampled presents, then reproduced the GPU watchdog. The final window was black. No D3D12 device removal or NVIDIA Xid was observed during this run.

Not tested

Native Windows from this build, or rendered gameplay on this adapter.

AI use

OpenAI Codex with GPT-6.2-Sol high prepared the integration, ran the tests, and wrote the report.

@crosettiremi

crosettiremi commented Nov 24, 2026 •

Copy link
Copy Markdown

Tested #1055 (f532d33) and #1102 (c387de2) together on an RX 7900 XT, Windows, main 930e8b4 with the same downstream sparse-release, texture-budget and physical-page changes in both runs. The saved Series X profile and initial XCL caches matched. A was delivered on the rendered Player1 prompt at 33 s. Both runs had DRED and the same 28 GiB Windows job limit.

The comparison build called queue method 31 as a stub at 6.213 s and accessed a GPU-view texture at 10.648 s. With the two PRs applied the title exercised the new implementation: at 93.622 s the counters reported 256 calls, 35,111 pages mapped to title-mapped physical pages, 2,368 unmapped, zero elsewhere ignored. The four focused page-mapping and texture-source tests all passed.

The comparison run later logged device hung and a DRED page fault. The patched run instead logged command-list Close returning 0x8007000e at 133.130 s, followed by a breakpoint on the same thread. Peak sampled process commit was 28,329 MB, with zero logged device removals in that run. One run each under a memory cap verifies the title reaches the new mapping code; stable gameplay and correction of the comparison GPU fault are still unverified.

Follow-up on the same RX 7900 XT with #1422 also applied, a 2048 MB soft texture budget and timed in-process thread dumps disabled. The title again reached world loading. The external observer recorded Windows 0xc0000409 (subcode 7). The faulting thread stack contained Rust allocation-error handling, title_textures::Source::bytes, subresources_of and its worker. The mapped-page path allocates a contiguous scratch buffer for a slice. Peak sampled process commit was 28,294 MB under the same 28 GiB whole-job cap. This localizes an allocation failure under that cap. The allocation size and the rest of the process memory breakdown were not recorded.

Local follow-up: I tested a bounded mapped-texture reader that borrows contiguous spans and streams scattered or missing input through 64 KiB regions for detiling and hashing. A byte-for-byte test passed for mip chains, arrays and a volume with non-aligned runs and holes. On the next title run the original texture allocation abort did not recur; at about 180 s a different thread faulted in SDK dxcompiler.dll while XCL was compiling a shader. Peak sampled process commit was 28,416 MB under the same 28 GiB job limit. The scripted A was delivered at 33 s versus 20 s in the previous run, so elapsed time is not a controlled performance gain. World loading remains unresolved.

With two DXC workers the bounded-input build next failed allocating the decoded mip output. I then detiled mapped textures directly into checked D3D12 upload footprints. The focused regression verified exact pixel bytes, untouched row padding, and the short last row; the native GPU readback and upload-buffer reuse test passed. In the title, at least 256 direct batches ran. At 228.505 s it exited with DXGI_ERROR_DEVICE_HUNG, DRED GPU VA 0x1b0679000 and a partially completed command list whose next operation was Dispatch. No texture-allocation abort in that run. The playable world remains unverified.

@crosettiremi

crosettiremi commented Nov 24, 2026 •

Copy link
Copy Markdown

A follow-up from an RX 7900 XT on Windows. On a downstream XCL stack carrying this mapping work, I reproduced a texture ownership error after a GPU write and a backing change. The native-adapter fixture uses a 64×64 R8 texture and the public physical-page mapping path.

  1. The original mirrored texture followed CPU writes. A GPU upload then replaced its pixels, and that copy survived a subsequent submission.
  2. I mapped a different physical page under the texture. Its initial zeros reached the GPU. I wrote 0xC7 throughout that page and submitted again.
  3. GPU readback returned zero in all 4,096 texels. The expected value in all 4,096 was 0xC7.

On this stack the remap scheduled a full upload but kept the old gpu_written flag. The later CPU write was filtered out. My local prototype clears the previous ownership and cached content hash when the upload source changes. A newly recorded GPU copy checks its current backing before claiming ownership. The regression also exercises equal bytes in the old CPU mirror and the replacement page, and the inverse ordering where a GPU write recorded just after the remap must survive a later stale CPU write. All 16 title texture tests passed on the modified build. The game impact remains unverified.

Game follow-up, one run each with the same Series X save, controls, starting caches, and application build settings. With the texture fix the last positive present interval ended at 196.1 s; DRED reported a GPU page fault at 0xf000 at 198.0 s. The matching mesh-enabled control last presented at 186.1 s and faulted at 0x6000 at 191.1 s. No allocation was named at either address. The final captured images were dark. The native pixel regression is fixed; this pair does not show a world-loading fix.

@3L1A5-1

3L1A5-1 commented Nov 24, 2026

Copy link
Copy Markdown

Follow-up to my overlap note above: the local change that keys GPU-view page textures by the physical page is now rebuilt on this PR, as you described: a GPU-view page takes its key from the method's record (mirrors::shown), the ranges take_changed returns are forwarded to vram, and a tile stays NULL only where the method mapped nothing there and no physical page is mapped at the address or at its CPU-view source. On an 8 GB card it is what keeps the world load inside video memory with #1055/#1102 applied. Still not a PR: it waits for #1055/#1102, as agreed.

Tested

activity memory line with the change without
target pages at 80 / 90 / 100 s 2 940 / 3 184 / 3 382 MB 3 765 / 5 441 / 6 448 MB
local video memory at 100 s 7 372 MB 10 351 MB
end 0x887a0005 at 202 s (local 9 490 MB by then) CreateHeap(0x4000000 …) refused (0x8007000e), no video memory for more pages of title textures at 104.9 s, then the title's breakpoint

The two runs match within ~20 MB up to 70 s and split when world streaming starts.

Not tested

AI use

  • Claude Code (Claude Sonnet 5.5, then Claude Opus 5.5) ran the runs on my PC and wrote this comment.

@raylitebull

Copy link
Copy Markdown
Member

Code review on c387de2 (stacked on #1055):

  • Source::Pages + source_of + recheck_gpu_view_sources (mirrors::take_changed range lookup via by_va) + Pages::by_page / page_moved cleanly resolve GPU-view textures page-by-page without rescanning all 64k textures.

Items to address before undrafting / merging after #1055:

  1. Avoid unconditional vec![0u8; len] allocation in Source::bytes (title_textures.rs:79): when a requested off..off + len lies within a single contiguous run in Source::Pages (or during the 4 KiB content() probes in refresh_once), borrow title_bytes(...) directly so large streamed textures do not hit allocation failures under memory pressure (matching the Source::bytes OOM reported earlier on RX 7900 XT).
  2. Reset e.gpu_written (and the cached content hash for res) in recheck_source when e.src != src: recheck_source currently sets e.pending = true without clearing e.gpu_written, causing refresh_once (if e.gpu_written { return false; }) to ignore subsequent CPU writes to a newly mapped backing page.
  3. Rebase onto main after #1055 lands, update the PR body so PR description passes, and run Build and test (Windows, no GPU) + dual-vendor verification.

@ozimchuk

Copy link
Copy Markdown
Contributor

Measurements for raylitebull's point 1, and a second cost in the same path. At c387de2 with #1055, merged into a tree with #751, #455 and other changes; NVIDIA (32-lane waves), Linux, Wine + vkd3d-proton; a retail title, 300 s runs into the world.

  1. Source::bytes (point 1). Besides the memory, the time: per 300 s, reading Pages sources took 38.3 s for 6.7 GB (about 178 MB/s) and freeing the buffers about 20 s more (0.26 ms a free), on the title's submitting thread; hashing the same bytes took under 1 s. Large blocks come from the system each time. Reading into a buffer reused per thread, each page run read straight into it and the gaps zero-filled, took the same reads to 0.6 s for 13 GB, and the title did about twice the draws after its world load. Shape: Source::with_bytes(off, len, f), used by the hash and both detile readers; tested against bytes for ranges that start and end inside runs, with the buffer holding other bytes first.

  2. VirtualQuery per page in the recheck. source_of calls mirror_source for every page the method did not map, and mirror_source asks VirtualQuery: on main once per texture, here once per page of every texture the recheck looks at. VirtualQuery sizes the region around the address by walking it, and GPU views are reservations of many GB: about 80 µs a call under Wine. In a 300 s run the recheck made 474 822 calls, 37.9 s, nearly all of its 38.0 s. Keeping the last region answered (BaseAddress, RegionSize, committed) for one recheck pass and answering the pages inside it from there took it to 24 389 calls, 2.0 s, and the recheck to 7.0 s. The answers are those of one moment, as before: a mapping change after the pass is seen at the next one. Test: source_of_in with a shared region gives the same sources as source_of for page-mapped, unmapped and never-mapped pages, in any order.

Both times are what the "view-source recheck" and "hash" parts of the XCL_ACTIVITY line in #2144 show.

Not tested: Windows (VirtualQuery's region walk is slow there too: 20–25 ms a call in a 2 GB block, per the comment on gpu::shader::resident_and_readable); AMD; #1102 on its own without the other changes.

AI-assisted. Claude Code, Claude Opus 5.5.

@MKmajster

Copy link
Copy Markdown

The PR shows a conflict with main, so I merged current main (568e7db) into this branch on my fork: MKmajster/xcl page-mapped-textures-merged (merge commit 4c40528). It is a fast-forward of this branch's head c387de2, so it can be taken as it is:

git pull https://github.com/MKmajster/xcl.git page-mapped-textures-merged
  • One conflict, in kernelx.rs where a sparse reservation is released: this branch's forget_title_mappings(a, n) and main's mirrors::released(a) are both kept. The other release path in the same file already had both after the merge.
  • Against main, the diff is still only this PR's three files (+657 / −55).
  • cargo build --release -p xcl builds; cargo test --release -p xcl: 1102 passed, 0 failed, 26 ignored in the main suite, and the other test binaries pass. Not run in a game since the merge.

AI-assisted (Claude Code). No game data attached.

@DavidM1911

Copy link
Copy Markdown
Contributor

Verification on RTX 3060 Ti (Windows 11): merge conflict with current main — needs a rebase before it can be tested.

@throny throny added the goal:world-load Bears on the retail title getting past world loading label Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

goal:world-load Bears on the retail title getting past world loading

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants