D3D12.X: a texture in a GPU view reads the pages the page-mapping method put under it #1102
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1102
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1102"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Xeltax on GitHub · 2026-11-24 11:35 UTC · original
Xeltax:page-mapped-textures→main· +657 −55 · 3 files · 2 commits · draftStacked 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: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:Sourcereplaces 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 asAt, so it costs what it did before. A texture outside GPU views, or one whose pages the method never mapped, isAt(mirror_source(va))as before.recheck_gpu_view_sourcesre-reads the source only of the textures on pages the method changed, or whose physical page moved (mirrors::take_changed, found throughby_va). Looking at all of them took 225 ms on 64k textures, and the method is called hundreds of times. A change ofgpu_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: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.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_changesgets three steps on the GPU, each read back from the PC texture:source_ofreduced to the oldmirror_source(checked).On the retail title (
main67a3735+ #1055, with and without this PR; RTX 4080; A pressed throughXCL_PRESS_AT; one run each)Textures whose memory is all zero.
XCL_TRACE_FRAME=1logs 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: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
#101and the watchdog come:#10132,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 onmain. That stop is about stalled GPU work (#505), not about textures.Tested
cargo test --workspace --no-fail-fast -- --test-threads=4on59042fd: 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:
PR:
Not tested
XMemMapPhysicalPagesinto the view): the method's mapping wins here, whichever came last.AI use
🤖 Generated with Claude Code
@IvyNotFound on GitHub · 2026-11-24 12:24 UTC · original
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 onmain; one of two runs ended in a device hangTested
67a3735).cargo test --workspace --no-fail-fast -- --test-threads=4(debug,XCL_SAMPLE_RPF,_DLLS,_TTPF,_BVH4,_BK2,_AWCset): 738 passed, 0 failed, 41 ignored;SKIPPED(no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.scripts/smoke.ps1 -Seconds 140withXCL_PRESS_A_AT=15,XCL_PSO_WAIT_MS=50,XCL_FRAME_DUMP=2, two runs back to back. Same settings as my fourmain47efa2eruns in https://github.com/ivall/xcl/issues/505#issuecomment-7130913073.CopyPageMappingsBatchXat 256 calls0x887a0006at 131.0 s, then0x80000003at+0x2474606;nvlddmkmevent 153 (TDR) logged; the process had to be killed0xc0000409at ~124 s; 0 device removals; peak commit 43 941 MBmain.main.GPU queue.Wait … did not complete within 5000 msandsparse: the queue has not reached fence value …stalls thatmainshows; none of my fourmainruns hung the device, but one hang in two runs is not enough to put it on this PR.Not tested
main; AMD; the debug layerAI use
@Xeltax on GitHub · 2026-11-24 12:56 UTC · original
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.c387de2. A freed page also counts as a change there, so the textures on it are read again.AI use: Claude Code (Claude Opus 5.5) wrote this reply.
@MKmajster on GitHub · 2026-11-24 13:14 UTC · original
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 on GitHub · 2026-11-24 13:36 UTC · original
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,
main47efa2e+ #1182, release,XCL_NETWORK=0. A local diagnostic sorted every livevram::Pagespage 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'sAWAYmap.The local change: keys a GPU-view page texture's owned pages by the physical page at its CPU-view source (the
page_keyof #1182), and leaves a tile NULL where no page is mapped. kernelx queues page map/unmap events, andvramapplies 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 neitherMapTitlePhysicalPagesnor queue #31 mapped it.Question: does #1055 keep the GPU-view page → physical page mapping somewhere
vramcould 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 on GitHub · 2026-11-24 13:38 UTC · original
Fresh
xcl-smokeregression block for the current headc387de21fa81— thePR descriptioncheck wants one made on this commit (scripts/smoke.ps1, clean tree). Feel free to drop it into the Regression run section.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 on GitHub · 2026-11-24 13:48 UTC · original
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/#142stubs as separate questions.@3L1A5-1, yes: the mapping is kept, and
vramcan read it.Where it is (
kernelx::mirrors, #1055):Shown { pool, page }).mapped_source(va)answers where that physical page's data is now (page_now).Some(None)for a page the method unmapped.Nonefor a page the method never touched; yourMapTitlePhysicalPages/AWAYrule still applies there.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_texturesdrains 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_sourceisNoneorSome(None);AWAY.Ask me anything about those calls.
AI use: Claude Code (Claude Opus 5.5) wrote this reply.
@Filip722 on GitHub · 2026-11-24 14:11 UTC · original
Tested
c387de21fa81d09269bd311b3be6a3afe6598dafwith #1055 atf532d33d695a360bf5701650374dd87a4566c499on main930e8b4and the local 8 GB loading changes. Integrated tree90d5dfe6ee8eb5229dcf63dbef8f60248c68ecb8, Windows x64 MSVC release.4522cc1with dxil-spirv1dc543f.gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changespassed on the RTX 5060 in a separate Proton prefix, with zero failures or skips.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 on GitHub · 2026-11-24 15:47 UTC · original · edited 2026-11-24 16:23 UTC
Tested #1055 (
f532d33) and #1102 (c387de2) together on an RX 7900 XT, Windows, main930e8b4with 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 on GitHub · 2026-11-24 17:15 UTC · original · edited 2026-11-24 17:20 UTC
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.
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 on GitHub · 2026-11-24 17:32 UTC · original
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 rangestake_changedreturns are forwarded tovram, 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
XCL_NETWORK=0.main930e8b4+ #1182 + #1055 (f532d33) + this PR (c387de2) + #759 + #1273 + #1278 + #562 + #1288 + revert ofb8b1f49(#1307) + local logging diagnostics. A/B: the same tree with and without the one local commit of the change (436 lines,title_textures.rs,vram.rs,kernelx.rs).scripts/smoke.ps1 -Seconds 600,XCL_ACTIVITY=1 XCL_PSO_WAIT_MS=50 XCL_PRESS_A_AT=40,45,…,120, same caches. One run each.0x887a0005at 202 s (local 9 490 MB by then)CreateHeap(0x4000000 …) refused (0x8007000e),no video memory for more pages of title texturesat 104.9 s, then the title's breakpointThe two runs match within ~20 MB up to 70 s and split when world streaming starts.
Not tested
AI use
@raylitebull on GitHub · 2026-11-25 00:58 UTC · original
Code review on
c387de2(stacked on#1055):Source::Pages+source_of+recheck_gpu_view_sources(mirrors::take_changedrange lookup viaby_va) +Pages::by_page/page_movedcleanly resolve GPU-view textures page-by-page without rescanning all 64k textures.Items to address before undrafting / merging after
#1055:vec![0u8; len]allocation inSource::bytes(title_textures.rs:79): when a requestedoff..off + lenlies within a single contiguous run inSource::Pages(or during the 4 KiBcontent()probes inrefresh_once), borrowtitle_bytes(...)directly so large streamed textures do not hit allocation failures under memory pressure (matching theSource::bytesOOM reported earlier on RX 7900 XT).e.gpu_written(and the cached content hash forres) inrecheck_sourcewhene.src != src:recheck_sourcecurrently setse.pending = truewithout clearinge.gpu_written, causingrefresh_once(if e.gpu_written { return false; }) to ignore subsequent CPU writes to a newly mapped backing page.mainafter#1055lands, update the PR body soPR descriptionpasses, and runBuild and test (Windows, no GPU)+ dual-vendor verification.@ozimchuk on GitHub · 2026-11-25 06:51 UTC · original
Measurements for raylitebull's point 1, and a second cost in the same path. At
c387de2with #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.Source::bytes(point 1). Besides the memory, the time: per 300 s, readingPagessources 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 againstbytesfor ranges that start and end inside runs, with the buffer holding other bytes first.VirtualQueryper page in the recheck.source_ofcallsmirror_sourcefor every page the method did not map, andmirror_sourceasksVirtualQuery: onmainonce per texture, here once per page of every texture the recheck looks at.VirtualQuerysizes 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_inwith a shared region gives the same sources assource_offor page-mapped, unmapped and never-mapped pages, in any order.Both times are what the "view-source recheck" and "hash" parts of the
XCL_ACTIVITYline 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 ongpu::shader::resident_and_readable); AMD; #1102 on its own without the other changes.AI-assisted. Claude Code, Claude Opus 5.5.
@MKmajster on GitHub · 2026-11-25 08:20 UTC · original
The PR shows a conflict with
main, so I merged currentmain(568e7db) into this branch on my fork:MKmajster/xclpage-mapped-textures-merged(merge commit4c40528). It is a fast-forward of this branch's headc387de2, so it can be taken as it is:kernelx.rswhere a sparse reservation is released: this branch'sforget_title_mappings(a, n)andmain'smirrors::released(a)are both kept. The other release path in the same file already had both after the merge.main, the diff is still only this PR's three files (+657 / −55).cargo build --release -p xclbuilds;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 on GitHub · 2026-11-25 08:21 UTC · original
Verification on RTX 3060 Ti (Windows 11): merge conflict with current
main— needs a rebase before it can be tested.@moombathepilot on GitHub · 2026-11-25 10:49 UTC · original
Tested on RX 7800 XT (RDNA3), Windows 11
Compared clean release builds of parent #1055 at
f532d33d695a360bf5701650374dd87a4566c499and #1102 atc387de21fa81d09269bd311b3be6a3afe6598daf. AMD driver32.0.32029.2010, Ryzen 7 5700X3D, Rust 1.100.0 MSVC, DXC 1.9.2602.17.title_texturestests on #1102: 14 passed, 0 failed, 0 ignored, 0 skips, including the GPU readback test for remapping, CPU writes, and unmapping.mklink /Jwas unavailable.Both runs reached loading artwork, ended at the time limit with exit
0x0, and had zero crashes or device removals. The last captured frame on #1102 still showed loading artwork. The texture snapshots came from different moments, and some textures can legitimately be zero. The lower share is an observation from this pair. It does not establish how many textures were fixed or a performance gain.Not tested: Playable-frame output, repeated runs, or isolated texture-upload performance.
AI use: OpenAI Codex (GPT-6 family, exact variant unavailable) built both revisions, ran the tests and scripted retail comparison, checked the logs and captured frames, and drafted this report.
@CharlyRien on GitHub · 2026-11-25 19:41 UTC · original
Test report, RTX 3090: with #1055 + #1102 ported, the block-compressed textures the title's material records name hold the title's bytes on the GPU; those still zero were all evicted by the page budget. This agrees with @MKmajster's textured frames on the RTX 3070 above, checked here texture by texture.
Setup
main689f2db+ #1329, #1448, #1323, #889, #684, #929, #640, #1850, #765, #541, #724 (rebased,3442b58), #1887, #1803, #1982, #1405, #1464, #1989 (197b104), #2229 (039a363), plus a local frame capture and replay. "After" adds #1055 (f532d33) and #1102 (c387de2), ported, and three local changes: @raylitebull's point 2 above (a texture whose source changes forgetsgpu_writtenand its hash), title memory read withReadProcessMemory, andXCL_LOCAL_TEX_OVERLAP=1(a newer texture that overlaps an older one no longer unmaps the older one's tiles; I cannot separate its share of the result).XCL_HEAP_WINDOWS=1 XCL_UMA_SHADOW=1 XCL_NETWORK=0 XCL_PAGE_BUDGET_MB=2048 XCL_GPU_WAIT_RELEASE_MS=250. One capture of one world frame per tree, two runs.Measured in the captures (block-compressed textures named by the material records of the frame's mesh draws):
queue CopyPageMappingsBatchX: 256 calls; GPU-view pages so far: 35127 mapped (35127 to a physical page the title mapped there), 2290 unmapped; every non-evicted material texture (156, all formats) equals byte for byte the title's bytes at the method's pages, detiled.XCL_DIRECT_DXIL=1,XCL_PAGE_BUDGET_MB=4096): the G-buffer albedo shows characters and a street with signs, over 7-8 % of the screen. Other fixes are in that run, so it is not this PR's alone.title_textures16 passed.a_gpu_view_page_shows_the_physical_page_where_it_is_keptora_freed_page_is_read_at_its_pool_pagefails about 1 run in 3 with parallel threads (physical: 0), never with--test-threads=1; likely the sharedkernelx::mirrorsstate between those tests (not checked).AI use: Claude Code (Claude Opus 5.5 coordinating; Claude Opus 5.5 agents ported the two PRs, wrote the capture fields and the replay, and ran the tests and replays; the base tree was assembled earlier by Claude Fable 5.2 agents). The coordinating session ran the in-title runs, looked at the albedo image, and checked the log lines and per-class texture counts quoted here; the byte-for-byte comparison is from the agent's notes.
@CowboyBingus on GitHub · 2026-11-25 20:31 UTC · original
Test report: with #1055 + #1102 the title's
0x887a0005/ DRED VA 0 removal did not happen in 4 runs; without them it came back in 2 of 2. RTX 5070 Ti 16 GB, driver 621.24, Windows 11 (build 26300). Retail title, one exe path.Base:
main2898511a+ #2326, withXCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_DIRECT_SPLIT_INSTRUCTIONS=100000000 XCL_HUGE_PSO_CONCURRENCY=4 XCL_DRED=1, plusXCL_PRESS_AT(scripted A presses 14–140 s),XCL_FRAME_DUMP=2,XCL_NETWORK=0,XCL_ACTIVITY=1. #1055/#1102 is MKmajster's merge4c40528, plus one local commit: onmain, #1102'sSourcedoes not build against the stream recheck (#2029), so onlySource::Attextures take part in it there (page-mapped ones are left out of the recheck).0x887a0005, DRED page fault at VA 0x0XCL_PSO_WAIT_MS=50XCL_PSO_WAIT_MS=50Each run reached the opening credits (credit text in dumped frames). Runs 48 and 50–52 presented until 237–299 s, at the end of their time limit. On
main68a284a+ #2326 without either PR, three earlier runs (no #1803) were removed the same way at 142–214 s.Not established: how the page mappings prevent the removal, and whether they prevent it or only delay it past 300 s. Small samples (4 runs with, 2 without), one GPU and driver. No 3D world scene appeared in any dumped frame behind the credits; the background was grey (run 50 at 106 s showed a garbled tile mosaic, run 52 at 261 s a title art card).
AI use: Claude Code (Claude Opus 5.5) built the trees, ran the title on the machine above, read the logs and wrote this report.
@bmjask on GitHub · 2026-11-25 21:19 UTC · original · reviewed
P1: recheck_source changes e.src but leaves gpu_written and LAST_CONTENT. After a GPU-written texture remaps, refresh_once filters a subsequent CPU write to the replacement page as GPU-owned, leaving GPU data stale/zero. Clear ownership/hash on source change and bind GPU-write claims to current source. P1: Source::Pages::bytes unconditionally allocates vec![0;len] even for contiguous runs, on hashing/detiling submit paths; large streamed textures caused reported allocation aborts/severe allocator cost. Add borrowed contiguous fast path and bounded/scatter-gather scratch for fragmented spans. Also consider caching mirror_source/VirtualQuery across a recheck pass.
@veyn-sudo on GitHub · 2026-11-26 09:34 UTC · original
@Xeltax, two things about
Source::Pagesreads, from running this PR merged into a local tree onmain(RTX 2070 SUPER, retail title, world load). Both are in the same few lines, so they may be worth handling when you rebase.1. A crash when the title frees a page during the read. At
c387de21, each run is read withtitle_bytes, which checksgpu::shader::readableand then reads the pages in place. In one run the title freed pool pages between the check and the copy, and XCL faulted (0xc0000005inmemcpy). Since #751,mainreads title memory withread_committed_into(oneReadProcessMemory, zeros for what can't be read), which can't fault this way.2.
readableis slow for page runs. A run is usually longer than the 16 pagesreadablechecks in one call. So it falls through toVirtualQuery, which walks the whole region. With timers around the read in the world load,readabletook 24–676 ms of every 2 s, and page runs were read at 1.3 GB/s (10.3 GB in 7.9 s). Reading each run with justread_committed_intogave 2.9 GB/s (8.6 GB in 2.9 s), with no crash.What we run locally, in
Source::with_bytes(orbytesin your tree):A test for 1, which faults on
c387de21's read:With the change, the whole suite passes on our tree:
cargo test --workspace --no-fail-fast -- --test-threads=4: 1542 passed, 0 failed, 47 ignored.Not checked: your tree as it is (the crash and the timings are from our merge); AMD.
AI use: Claude Code (Claude Opus 5.5) found and measured both on my PC and wrote this.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.