D3D12.X: texture pages in graphics reservations follow the title's memory #1514
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!1514
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1514"
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?
@oishigeso on GitHub · 2026-11-24 17:10 UTC · original
oishigeso:vram-pages-follow→main· +254 −8 · 3 files · 2 commits · draftFor #646. A retail title places streamed textures over reserved-only graphics address space and maps physical pages only where tiles are resident. XCL gave every 64 KiB page of each such texture its own page of video memory anyway: on spawn, 22 808 textures held 6 GB, 4.3 GB of it over addresses with no title memory, and local video memory went 2 GB past the budget (
title_memory_mbdoes not bound it).An owned page of a placed texture in a graphics reservation is now mapped only while the title has memory there: committed, a physical page, or one mapped and not yet touched. Commits, decommits, releases and physical-page maps and unmaps there are noted (
title_memory_changed), and the pages follow before the title's next submit: oneUpdateTileMappingsper texture and heap, then the pages' fence. Unmapped tiles read zero (resource heap tier 2).The second commit covers the title's GPU views (
kernelx::mirrors, placed in the no-access twin of a CPU reservation): they are never committed themselves, so their followed pages stayed unmapped and read zero (no intro video, missing textures).title_backednow looks throughmirrors::source, and a change in a CPU view is noted for its GPU view too.What is in it
crates/xcl/src/hle/d3d12x/vram.rs: followed pages per texture,update_ranges(only the changed tiles: the rest is skipped, consecutive heap tiles merge, unmapped ones become NULL ranges), testupdate_ranges_set_only_the_changed_tilescrates/xcl/src/hle/kernelx.rs: the title's commit, decommit, release and physical-page changes in graphics reservations calltitle_memory_changedcrates/xcl/src/hle/kernelx/lazy.rs:is_lazy, a page mapped and not touched yet (counted as the title's memory)Tested
cargo test -p xcl --lib vram -- --test-threads=1: 8 passed, 2 failed. The 2 (placed_title_textures_share_vram_and_preserve_pixels,d32s8_targets_take_their_own_size_of_video_memory) fail the same way onmain(1ec4c98, before the rebase: 7 passed, 2 failed); the newupdate_ranges_set_only_the_changed_tilespasses. Run before the rebase onto930e8b4, which had no conflictsRegression run
main:
PR (this PR's head commit; the title is run through a folder named RetailTitle):
Not tested
UpdateTileMappingscalls while the title loads on NVIDIA:7f94c6fmeasured ~0.13 ms a call there. This PR makes one call per texture and heap per submit, not one per tile, but how many textures change per submit during loading was not counted.AI use
🤖 Generated with Claude Code
@crosettiremi on GitHub · 2026-11-24 17:29 UTC · original · edited 2026-11-24 18:10 UTC
RX 7900 XT on Windows, retail Series X profile. I compared parent
930e8b4and head73b6001with matching controller instrumentation, separate cold application caches, DRED enabled and a 28 GiB job limit. I verified distinct executable hashes at launch.Both recorded two presents and stopped before the account picker. The last activity samples were 6.004 s and 8.006 s respectively. In both process snapshots, waiting-thread stack scans contained sparse statistics, resource release in
sparse::forget_buffer, and a sparse upload around the native command allocator reset. I ended each process after more than 100 seconds without another log entry. Neither logged device removal. The isolatedupdate_ranges_set_only_the_changed_tilestest passed on the head.This pair cannot evaluate world-stage residency on this machine. The same startup signature on the parent previously cleared with the #789/#968 combination (earlier comparison). The controller script waits for two matching account-picker frames, so it sent no input in either run.
Integration follow-up: I added #1514 to the local #789/#968 stack on the same Series X profile. This time it passed the account picker, displayed loading artwork and streamed assets. Near 90 seconds, target pages were 2,467 MB (3,648 MB pooled), with process commit 18,623 MB. The older #789/#968 run without #1514 at 90.5 s recorded 7,949 MB target pages (8,448 MB pooled) and 26,638 MB process commit. Application cache state, preload settings and input timing differed between these two runs, so the difference is descriptive only.
The new run ended in device removal at 159.309 s (0x887a0006), DRED fault VA 0x1f0480000, no matching existing or recently freed allocation. Peak process commit 26,866 MB. No visible playable scene. The standalone parent/head comparison above remains the matched startup comparison.
Run 88 repeated the cold-cache residency integration on main
9e3831ewith #789 and #1514 (#968 is in main). RX 7900 XT, 28 GiB whole-job commit limit, saved Series X profile. Scripted A selected Player1 at about 41 s. The last positive present interval ended at 188.538 s. The last capture (frame 1640) was flat green. Peak sampled process commit was 28,088 MB. No DRED removal was logged. Exit was 0xc0000409. The faulting XCL thread's stack scan contained the Rust allocation failure handler, miniz zlib inflate, and the DirectStorage queue worker. This identifies another failure during streaming under the test limit. Multiple changes separate this build from the previous comparison, so I cannot attribute this outcome to #1514.@DavidM1911 on GitHub · 2026-11-24 18:53 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~21 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodifiedmain.)Thanks!
@WebIdentity1 on GitHub · 2026-11-24 17:38 UTC · original · edited 2026-11-24 19:08 UTC
Native NVIDIA/AMD follow-up for exact head
73b60019ad4a414ef4a2e51e87e3524cb1d2e4c8(parent930e8b49c1c2ec683d22c724a398b39111cd0e56): the new graphics-reservation residency path works in the six-phase RTX 3090 test, but a partial decommit leaves the first texture tile readable with stale data on this AMD integrated adapter. This is a GPU-byte finding, not just an allocation-counter mismatch. The direct NULL mapping control clears it.Tested
cargo test --locked -p xcl --lib paired_graphics_texture_tiles_follow_cpu_backing -- --test-threads=1 --show-output --nocapture, withXCL_ADAPTER=3090orAMD. Counts: exact head + identical final fixture: RTX 3090 1 passed / 0 failed / 0 ignored; AMD 0 / 1 / 0. Diagnostic with only the NULL mapping call changed: AMD 1 / 0 / 0. No SKIPPED lines, harness timeouts, or device-removal errors. Earlier exact parent with the same setup lacked dynamic residency: both adapters 0 / 1 / 0 with 98,304 wrong words, including tiles readable before CPU commit.R32_UINTreserved textures alias those pages. RealCopyTilesuploads and standardCopyTextureRegionreadbacks check all 32,768 words per phase; the test queries the driver tile shape (128×128) for the linear readback oracle. A sentinel fills the readback buffer before every copy. Native queue fences drain and the device-removal check succeeds. Phases: no backing; first page committed; both committed; first decommitted; first recommitted; CPU view released. A repeated read after draining the mapping queue checks persistence.0x55555555rather than zero)At the failing AMD phase,
follow.mapped=false, one active page remains, and the mapping fence is already complete (5/5). The same stale first tile also appears with one texture instead of an alias pair and withCopyTilesreadback. Issuing a direct one-tileUpdateTileMappings(NULL)after the failed read clears it. In a local diagnostic only, replacing this PR's full-resource NULL/SKIP call with one NULL call per changed tile made the identical two-texture fixture pass all phases on AMD, 1/0/0 with zero wrong words. The unmodified PR sends a NULL range followed by SKIP for the still-backed second tile. This comparison isolates the problematic call shape on this driver; I cannot yet say whether the driver mishandles a valid mixed range or XCL violates a more subtle mapping requirement. A per-tile workaround may cost too many calls during world loading, so I have not pushed it as a fix.Not tested: retail/world loading, the count and cost of NULL mapping calls across thousands of textures, discrete AMD GPUs, release build, shader sampling, or any other driver. The test directly invokes the public kernel memory hooks and VRAM placement; it does not run a game or title executable. The local fixture and diagnostic are uncommitted. The first fixture used a 128 KiB reservation and accidentally exercised XCL's sparse window; that setup error was corrected to 24 GiB virtual reservations before these results.
AI use: Codex (GPT-6) wrote the synthetic fixture and diagnostic, ran the native tests, checked the outputs, and prepared this report.
Complete test fixture and diagnostic
crates/xcl/src/hle/d3d12x/texture_residency_probe.rs(test module appended tovram.rs; SHA256f7d1800e0c70a01d66678f6e795c73789a796d73755ef13cacc057222b3b43ea):Local diagnostic change to
vram.rs(not proposed for merge as-is):@WebIdentity1 on GitHub · 2026-11-24 19:21 UTC · original
Follow-up to my paired-residency result: the AMD stale tile reproduces with native D3D12 mapping and no XCL reservation, mirror,
Pages, orbefore_executehooks. This rules out a bookkeeping-only test failure and narrows the problem to this D3D12 call sequence on the tested AMD driver. It does not establish whether the driver violates the API contract or an additional resource/synchronization requirement is missing.I added a local test-only native control using the same
R32_UINT256×128, two-tile reserved texture, a two-tile default heap,CopyTilesupload/readback, queue fences, and GPU device-removal check. It maps both tiles to the heap, uploads0x55555555and0x66666666, drains, then changes only the first tile mapping. The readback buffer is filled with a sentinel before each read. The only run-time switch chooses the remapping call:UpdateTileMappingsover two tiles,pHeap=NULL, flags[NULL, SKIP], counts[1, 1], offsets[0, 0].UpdateTileMappingsover the first tile only,pHeap=NULL, flag[NULL], count[1].Fresh process for each entry:
cargo test --locked -p xcl --lib native_mixed_null_skip_mapping_returns_zero -- --test-threads=1 --show-output --nocapture, withXCL_ADAPTER=AMDor3090; setXCL_PROBE_SINGLE_NULL=1only for the single call. Windows 10 Home 19045, AMD Radeon integrated driver 32.0.21030.2001, RTX 3090 driver 591.74, Agility 1.620.2. All three used the same source (SHA25697f9ec24ed9eb7756d2cdc73e6e0f4e41c545e02ffeeb78b068dda1b680c64de, matching the Windows copy), debug build, and explicit adapter selection. No harness timeouts or device removals.0x55555555words0x66666666)0x66666666)0x66666666)Microsoft's
UpdateTileMappingscontract describes mixed NULL/SKIP ranges and says their counts must sum to the region; this call uses one plus one for two tiles. Tier 2 specifies zero reads from NULL mapped texture tiles. The test checks Tier 2 before running. The independent native control reinforces a real GPU-visible compatibility bug on this AMD adapter. A narrow call shape workaround is supported by these tests, but its mapping-call overhead at world scale is unmeasured. The PR author still owns the implementation; I have not pushed a competing fix.The local probe source is included below for reproduction. It reuses the small
bufferandtransitiontest helpers in the prior report's fixture (madepub(super)locally) and adds a#[cfg(test)]module declaration tovram.rs. This is a synthetic GPU test; no retail title, discrete AMD GPU, shader sampling, or driver version other than the one above was tested.AI use: Codex (GPT-6) wrote and ran this test, checked the logs and source hashes, and prepared this report.
Native control test source
@WebIdentity1 on GitHub · 2026-11-24 19:25 UTC · original · edited 2026-11-24 21:00 UTC
Packed-mip array follow-up — 24 November: I added a synthetic, test-only GPU-byte control at the unchanged #1514 head
73b6001and the uncommitted local NULL-region candidate. This covers a complete one-tile packed-mip set per array slice, avoiding D3D12's undefined partial packed-set case. The 256×256R32_UINTtwo-slice/9-mip reserved texture has 12 overall tiles on both drivers; packed tiles 5 and 11 correspond to subresources 2 and 11 at(X=0,Y=0,Z=0). I wrote distinct values into each slice's 64×64 mip 2 withCopyTextureRegion, decommitted slice 0's packed tile via XCL's mirrored graphics reservation, then checked all 4,096 pixels per slice with a sentinel-filledCopyTextureRegionreadback.CopyTileswas not used for packed mips.On Windows 10 19045, integrated AMD Radeon(TM) Graphics driver 32.0.21030.2001 and RTX 3090 driver 591.74, Rust 1.98.1 MSVC, Agility 1.620.2, each in a fresh SSH Session 0 process:
cargo test --locked -p xcl --lib xcl_packed_mip_decommit_keeps_other_array_slice -- --test-threads=1 --show-output --nocapture, withXCL_ADAPTER=AMDor3090.The baseline fixture uses a local packed-coordinate helper because the unchanged PR has no production helper; otherwise its allocation, upload, decommit and readback sequence matches the candidate fixture. The candidate calls its production
tile_coordinates. A separate native D3D12 packed-set control also passed 1/0/0 on each adapter with the candidate helper. All tests had no skip, timeout or device removal. Frozen baseline/candidate source snapshots matched 222/222 and 224/224 SHA256 files on Windows after testing; candidatevram.rsSHA2564fc2d2329f962921d31ad0c69017a49cd410ba80ba0697965279a8553bd699d5, packed fixture0cf99ccab80370d5b47028710c18db554426d3a4b22bf32ef7639f00677f7431; baseline fixtured5cc3f5a63d85514c02575bfb6a8f564e7dd1c5b4ea4c60e15ff4a29c6efc5b4. This extends the earlier failing-without-fix AMD control to one complete packed set per slice. Multi-tile packed sets, partial mappings, unusual-tiling fallback, discrete AMD, world-scale cost and retail smoke remain untested. The author still owns the fix; no code was committed, pushed or proposed as a competing PR. AI use: Codex (GPT-6) wrote and ran the synthetic fixtures, verified source hashes/logs, and prepared this follow-up.Full-suite follow-up for the local NULL-region candidate — 24 November. The PR head is still
73b60019ad4a414ef4a2e51e87e3524cb1d2e4c8; this is uncommitted local validation, not a competing implementation. I compared a clean exact-head archive (221 tracked files) with my candidate at that head (the same 221 files plus two local diagnostic modules). All Windows source hashes matched before and after. On Windows 10 19045, RTX 3090 driver 591.74, Ryzen 7 7800X3D, Rust 1.98.1 MSVC, Agility 1.620.2 x64,XCL_ADAPTER=3090,XCL_REQUIRE_GPU=mesh,XCL_HEAP_WINDOWS=1, direct DXIL unset, desktop Session 1:cargo build --locked --workspaceexited 0 on both.cargo test --locked --workspace --no-fail-fast -- --test-threads=4 --show-outputacross 19 targets: untouched head 751 passed / 1 failed / 41 ignored; local candidate 754 / 1 / 41. The extra three passes are exactly the candidate's diagnostic tests, including integrated disjoint decommit. Both runs failed only the same known #202v_pk_add_i16 clamplane-0 check; two explicit debug-layerSKIPPEDlines each; no timeout or device removal. Neither whole suite passed.This complements the earlier AMD result below: the integrated four-tile test failed on the unchanged head and passed with explicit NULL regions on both AMD integrated and RTX 3090. Limits: the frozen local tree includes a native mixed-NULL/SKIP negative control that intentionally fails on the AMD driver, so it is not a mergeable cross-adapter suite. The coordinate helper has structural packed-mip/array checks but no packed-mip GPU-byte test; D3D12 leaves partially mapped packed-mip behavior vendor-specific. Its unusual-tiling fallback still uses the original mixed NULL/SKIP call shape. World-scale cost, discrete AMD, retail smoke, and interaction with #1747 remain untested. I would treat the explicit-region path as a validated direction for standard tiles, with those cases still to resolve before a runtime PR is merge-ready. AI use: Codex (GPT-6) ran the exact-head/candidate pair, checked hashes and logs, and prepared this update.
Integrated four-tile negative control — 24 November, 20:14 UTC: I exercised XCL's
VirtualAlloc/VirtualFreemirror tracking,place_pages,before_executeandPages::apply_backingwith one reserved 256×256R32_UINTtexture. After committing and uploading four distinct 64 KiB tiles, I decommitted disjoint tiles 0 and 2 before the next GPU read. On the unchanged PR head73b6001plus test-only fixture, the AMD integrated adapter failed 0/1/0: both decommitted tiles retained all 16,384 old words; tiles 1 and 3 were correct. The RTX 3090 passed 1/0/0, with both decommitted tiles zero. On the uncommitted local candidate that sends explicitly addressed NULL regions in one call, AMD and RTX 3090 each passed 1/0/0, zero wrong words in all four tiles. I repeated the candidate runs after switching the shared Cargo build target back from the baseline: both still passed 1/0/0. Every run used a fresh process, sentinel-filledCopyTilesreadback, queue fences and device-removal checks; no skips, harness timeouts or removal occurred. Command:cargo test --locked -p xcl --lib xcl_disjoint_decommits_unmap_both_texture_tiles -- --test-threads=1 --show-output --nocapture, withXCL_ADAPTER=AMDor3090.The baseline and candidate fixtures share the same allocation/upload/decommit/readback sequence; the baseline only substitutes known
(0,0),(0,1)tile coordinates for the candidate helper and a local copy of the same barrier helper. Baselinevram.rshas only a test-module registration; its 221-file PR-head source archive had zero hash mismatches before the fixture overlay. Final fixture SHA256: baseline521159dc01b0ec6195d971c2a82f8f5b3ac43d4af5d4044556569a5f5409a976; candidateaff04b6e37d3b6d52999a4a8625644cb1cfc29388fc1e2cc4a3fd9765dea3c80. This supplies an integrated GPU test that fails without the local mapping change and passes with it. The existing PR author still owns implementation. Full suite, retail smoke, packed-mip GPU behavior, and mapping cost remain untested; I have not committed, pushed, or opened a competing PR. AI use: Codex (GPT-6) wrote the synthetic test, ran the native comparisons, verified hashes/logs, and prepared this update.Update — local XCL integration diagnostic, 24 November: I translated changed tile indices with
GetResourceTilingand changed onlyPages::apply_backing's NULL path on an uncommitted worktree at this PR's exact head73b6001. OneUpdateTileMappingscall now receives one explicitly addressed resource region per changed tile and a single NULL range; the existing heap mapping path remains. This is a candidate, not a proposed or merge-ready fix.On Windows 10, AMD Radeon integrated driver 32.0.21030.2001 and RTX 3090 driver 591.74, the paired 24 GiB CPU/GPU reservation and two aliased two-tile texture fixture passed 1/0/0 on each adapter, with 0 wrong out of 196,608 GPU-readback words across six phases, including partial decommit/recommit. In a separate native four-tile D3D12 control, the candidate helper generated coordinates
(0,0)and(0,1)for disjoint tiles 0 and 2; a single two-region NULL call passed 1/0/0 on both adapters, all four tiles correct. In the same control source and AMD environment, switching back to one full-resource mixedNULL, SKIP, NULL, SKIPcall failed 0/1/0, leaving 16,384 stale words in each unmapped tile. Fresh process per test; no skips, harness timeouts or device removals. Command filter:cargo test --locked -p xcl --lib <filter> -- --test-threads=1 --show-output --nocapture;XCL_ADAPTER=AMDor3090, plusXCL_PROBE_DISJOINT=1and (for the passing native batch)XCL_PROBE_BATCH_NULL=1. Final local source SHA256:vram.rs3ce4018798085b117668effdb2883c54826c184ff1c683b7067afdab18331251, native probea137baf420ce84f2891c9b5a707aa337c2f645fd2905f9b1bc0436cb42c31e62, paired probe0dbe7807762a3948a040ed1288eee48a109940735d3dc604797241be78fe6b85; all matched the Windows copies before the native run.This makes the stale tile a GPU-observable behavior of the mixed mapping call shape on this AMD driver, not a test bookkeeping failure. I still cannot assign driver versus subtler API/resource responsibility. The candidate's packed-mip coordinate check is structural only; no packed-mip GPU remap, world-scale overhead, discrete AMD, full suite or retail title was tested. Microsoft's packed-mip documentation says partial packed-mip mappings have vendor-specific undefined read/write behavior, which needs separate handling. I am keeping the code local so the PR author can decide whether this mapping strategy fits the branch. AI use: Codex (GPT-6) wrote the candidate and fixtures, ran the native tests, checked the logs and prepared this update.
Further native D3D12 control for the AMD stale-tile finding: one
UpdateTileMappingscall can NULL two disjoint texture tiles on the tested AMD adapter if they are supplied as two correctly addressed resource regions, with no SKIP ranges. This is a candidate for reducing mapping-call overhead versus one call per tile; I have not measured world-scale cost or integrated it into XCL.The local test uses a 256×256
R32_UINTreserved texture with four 64 KiB tiles (driver-reported tile shape 128×128), one four-tile default heap,CopyTilesupload/readback, queue fences, a sentinel-filled readback buffer, and device-removal checks. All four tiles initially contain distinct values. It tries to unmap tiles 0 and 2 while retaining tiles 1 and 3. The correctly addressed tile-2 coordinate is(X=0, Y=1), since this is a two-dimensional, two-tiles-wide texture. D3D12's region description saysUseBox=falsetraverses linearly from the starting x/y/z coordinate; a flat index is not generally a validXcoordinate for a nonpacked 2D texture. An early local exploratory run mistakenly used(X=2, Y=0)for tile 2; I discarded those results and did not publish them.Fresh native test processes, same source SHA256
1a7b25f1be8f0ffc7755a18d4f279c558ba15475742110ae6cf84d7e0a1eca39on Mac and Windows. Command:cargo test --locked -p xcl --lib native_mixed_null_skip_mapping_returns_zero -- --test-threads=1 --show-output --nocapture.XCL_PROBE_DISJOINT=1in all runs;XCL_ADAPTER=AMDor3090.XCL_PROBE_BATCH_NULL=1selects the batch,XCL_PROBE_PER_TILE_NULL=1selects separate calls; neither selects one full-resource mixed NULL/SKIP call. The source contains no XCL reservation/mirror/Pages/before_execute invocation. AMD Radeon integrated driver 32.0.21030.2001, RTX 3090 driver 591.74, Windows 10 Home 19045, Agility 1.620.2, debug build.NULL, SKIP, NULL, SKIP(0,0)and(0,1), one NULL range of count 2No skips, harness timeouts, or device removals. The documented
UpdateTileMappingscontract permits multiple resource regions and a range of NULL mappings whose count covers their total tiles. The result supports batching changed NULL tiles without SKIP ranges, provided production code translates its linear tile indices into correct resource/subresource coordinates, including packed-mip cases. These four-tile synthetic tests do not establish that such translation or the integration is correct, or that performance improves at world scale. The author owns the PR; this is validation input, not a competing fix.AI use: Codex (GPT-6) built the synthetic control, caught and corrected the coordinate mistake, ran the native tests, checked source hashes and logs, and prepared this report.
Four-tile native control source
title_memory_budget_mbis 13,824 MB regardless of the adapter's memory #1337@rrrarrra9 on GitHub · 2026-11-24 22:06 UTC · original
I independently reproduced the two-standard-tile result from the native control above on another Windows machine with an integrated Radeon. The GTX 1650 (4 GB) also provides a low-VRAM NVIDIA control.
This was a standalone D3D12 test with a synthetic 256×128
R32_UINTreserved texture and two populated tiles. It verified both patterns before unmapping, then fenced and read back both tiles. Each adapter ran both variants twice in fresh processes, in mixed/single/single/mixed order.NULL, SKIPNULLThe second tile retained all 16,384 original words in all eight runs. This confirms that single-region
NULLclears the requested standard tile on both tested adapters. XCL integration, packed mips, and retail behavior need separate validation.AI use: OpenAI Codex (gpt-6.2-sol) wrote and ran this independent control and drafted the report.
@Filip722 on GitHub · 2026-11-24 22:44 UTC · original
RTX 5060 Laptop GPU (8 GB), Bazzite 44, NVIDIA 615.78.08, Proton Experimental 11.0-20261112, vkd3d-proton
4522cc1a8b1347f+with local allocation changes.I tested a synthetic 64 KiB RGBA tile placed in a watched graphics reservation. The test uploads a pattern and reads back every byte through reserve, commit, decommit and re-commit. The baseline failed the first zero-read check. The test passed on PR head
73b60019ad4a414ef4a2e51e87e3524cb1d2e4c8and on a local port to9e3831ewith the same residency and storage changes as the baseline. Each focused test invocation ran one test with zero skips.In two Series X runs starting with matching cache and title state, the nearest samples to 75,000 storage requests showed 8,512 MiB of texture pools before the port and 3,584 MiB after (74,963 and 74,876 requests respectively). Reported non-local memory was 6,518 and 1,526 MiB. The port reached 78,537 requests with zero reported storage failures. The previous system journal ends during that run, so its exit status and the cause are unknown. Loading artwork was the furthest verified scene. The local port also retained explicit GPU views and eviction tracking, which limits attribution of the title measurements.
OpenAI Codex (GPT-6.2-Sol high) assisted with the test, port and runs. OpenAI Codex (GPT-6.2-astra) checked the retained results and posted this report.
@Filip722 on GitHub · 2026-11-24 23:22 UTC · original
I reproduced a second-placement case on the exact
73b60019head. When a second texture is placed after committing a title page but before the next submit, placement can mark the shared page as mapped while the original texture still has a NULL tile. The fix lets the new alias inherit the existing mapping so the queued backing update reaches both textures. Fix and synthetic regressionI ran the same filter serially on the RTX 5060 Laptop GPU with Bazzite 44, NVIDIA 615.78.08, Proton Experimental 11.0-20261112 and vkd3d-proton
4522cc1a8b1347f+, using the Windows MSVC release test binary.--test-threads=1 --exact hle::d3d12x::vram::tests::reserved_texture_follows_pending_commit_when_an_alias_is_placed73b60019with the fixture failed at the post-commit readback (0.70 s). The first byte was0x00, expected0xa5.9c553339with the same fixture passed (0.67 s, zero skips).The earlier one-texture commit/decommit test still passed on
73b60019(1.45 s). The alias and commit/decommit fixture also passed on a local port based on689f2dbwith #1747 (0.68 s).OpenAI Codex (GPT-6) assisted with the fix, synthetic fixture, builds and report.
@Raul-Paiva on GitHub · 2026-11-25 00:34 UTC · original
A result from an 8 GB card in Series X mode (
device_type = "anaconda"). This PR cuts video memory a lot here. Counts only.Setup: RTX 3070 Laptop 8 GB, driver 32.0.16.2124, i7-11800H, 32 GB RAM, Windows 10 19045, rustc 1.100.0, release. The base is
main80f4819+ #684, #501, #1592, #1803, #1914, #1697, plus local logging. I applied this PR's two commits (4a9e8e5,73b6001) on top. The first one conflicts with #1747 invram.rs, so I merged it by hand:maptakes&[Option<Tile>]in #1747's scratch-buffer form;bindgives the pool tiles taken for pages it leaves unmapped back withreturn_tiles;take_tileis rebuilt ontake_batch(1, …).Tests on that tree:
cargo test --workspace --no-fail-fast -- --test-threads=4: 1010 passed, 1 failed, 45 ignored. The failure isvram::tests::d32s8_targets_take_their_own_size_of_video_memory, which fails under load and passes alone (3 of 3). The wave64 GPU tests are SKIPPED (no wave64).Run: a retail title with
XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_DRED=1and warm caches, one 420 s run. I read the peak from thememory:log lines.0x887a0006at 99.5 sNot tested: the HLSL path; Series S mode; more than one run; AMD; this PR without the other PRs listed above.
AI use: Claude Code (Claude Opus 5.5) merged the PR locally, ran the builds, tests and the run, read the logs and wrote this comment.
@veyn-sudo on GitHub · 2026-11-25 00:53 UTC · original
Result on
73b6001: with memory under only part of a mip chain, the wrong tiles stay mapped.bindpairs the PC's tileiwith console pagei, but the two orders differ: the console keeps the mip tail in a slice's first block and the largest level at its end, while the PC's tiles start with the largest level and end with the packed mips.Test: 1024×1024 RGBA8, 11 levels, 64KB_S layout (
0x109), placed withplace_pagesin a 24 GB GPU view; every level written with a pattern, then read back withCopyTextureRegion. The console's tail block (levels of 64×64 and smaller) is page 0. The driver reports 86 tiles, with the packed mips in tile 85.So with only the tail there, one tile of the empty largest level is kept and the tail's own levels read zero.
How common it is: on a retail title during world loading (local tree:
main+ #1055 + #1102), 1,336 streamed textures had memory under only part of their chain; 1,305 of them had none under their largest level. Going by level instead (a level's tiles are mapped once any of its console bytes have memory), 605 MB of the 3,491 MB of pages were needed. The console offsets come fromxg::Textureand the PC tiles fromGetResourceTiling.A second point:
title_backedasks the CPU view. With #1055 / #1102 a GPU-view page can have memory without any there (pages mapped by queue #31), so it would have to askmirrors::mapped_sourcefirst.I have a by-level version in my local tree. @3L1A5-1, does your change on top of #1102 go by level too? I don't want to duplicate it; otherwise I can send the test or the code.
Tested: RTX 2070 SUPER (driver 617.14), Windows 11 26300, debug; the test ran twice with the same result (control passed, tail case failed). Not tested: other GPUs, the full suite, the title with this PR.
AI use: Claude Code (Claude Opus 5.5) wrote and ran the test and wrote this.
@thehollowedone on GitHub · 2026-11-25 05:15 UTC · original
Independent native D3D12 check of Filip722’s alias regression on Windows 11 build 26300, RTX 3080 Ti / 621.35, Rust 1.99.1 MSVC, debug.
I ran
reserved_texture_follows_pending_commit_when_an_alias_is_placedtwice per build in fresh processes. 73b60019 with only the test fixture failed both times at step 2. The first byte read back as0x00after the alias was placed, with0xa5expected. 9c553339 passed both runs and verified all 65,536 tile bytes. Zero skips or ignores across the four runs.Coverage was limited to the single-tile alias case. Packed mips, retail, and the workspace suite remain untested here. AI use: OpenAI Codex (GPT-6) ran the comparison and drafted this report.
@thehollowedone on GitHub · 2026-11-25 05:34 UTC · original
Independent packed-mip check following veyn-sudo’s report. On 73b60019, I used a synthetic 256×256 RGBA8
64KB_Stexture with nine mips. Native D3D12 reports six tiles, with the seven packed mips sharing tile 5. I compared XCL placement with a direct D3D12 control that maps the expected native tile groups and uses the same upload and readback.Two fresh processes per path gave identical results on Windows 11 build 26300, RTX 3080 Ti / 621.35, Rust 1.99.1 MSVC, debug. Both native controls passed. Both draft runs failed the partial-backing assertion. Graphics Tools reported zero D3D12 errors or corruption messages. No skips. Coverage is one texture format and one packed tile; arrays, retail and the workspace suite remain untested here.
If the by-level patch is ready to share, I can run this fixture against it. AI use: OpenAI Codex (GPT-6) wrote the synthetic fixture, ran it, and drafted this report.
@3L1A5-1 on GitHub · 2026-11-25 07:50 UTC · original
A data point for this approach from an 8 GB NVIDIA card, from a local change of mine that does the same for textures in GPU views (no video memory where nothing is mapped), so not this PR's code. Details in my comment on #1102:
CreateHeap→0x8007000eand the title's+0x193e00f; with it the run went on to 202 s.So I'm not opening that change: this PR covers it and was here first. What it adds on top, keying a GPU-view page's video memory by the physical page it shows (so a GPU view and its CPU view, or two aliases, share one tile), needs #1102. I'll offer that as a small follow-up once this PR and #1102 are in.
My version pairs the PC's tile
iwith console pageithe same way, so @veyn-sudo's mip-order finding above applies to it too.AI use: Claude Code (Claude Opus 5.5) wrote this.
@veyn-sudo on GitHub · 2026-11-25 10:14 UTC · original
@3L1A5-1 thanks, then I won't be duplicating it. @thehollowedone thanks for the independent check; your direct D3D12 control shows the same thing.
My by-level version works on GPU-view textures and needs #1102. It is one commit of about 420 lines on a local tree with other changes (
main, #1055, #1102), so not a patch for this head. A level's tiles are mapped once any of its console bytes have memory; the packed mips are one group. One retail title reaches its world with it, then loses the device for a reason I haven't found, so I can't call it ready. I can push it to a branch if it helps you or @oishigeso.AI use: Claude Code (Claude Opus 5.5) wrote this.
@3L1A5-1 on GitHub · 2026-11-25 21:21 UTC · original
Follow-up to my 8 GB A/B above: #1055 + #1102 + this PR ported onto current
main68a284a, with a game run.Branch: https://github.com/3L1A5-1/xcl/tree/port/vram-stack-1182 (each PR cherry-picked with
-x, authorship kept).vram.rshad moved a lot (TilePool/take_batch, #2306 level pages, #1985canonical_va), so this PR is re-applied by hand on main's file. No redesign was needed.c7c7b2c(ours): #1102 makes a texture'ssrcaSource, but main's #2029 stream recheck still passes an address. AddsSource::fully_watched/Source::fingerprint.d656862(ours, with a test):title_backedonly checked the CPU view behind a GPU-view address. Sincecanonical_vaplaces an unmapped GPU-view texture at the CPU-view address, a page the title maps directly in the GPU view (physical page or the page-mapping method) read as "no memory" and the texture stayed NULL. It now asks the method mapping, then the physical page, then the CPU view. Test:a_page_the_page_mapping_method_mapped_in_a_gpu_view_is_backed.Run (RTX 2060 SUPER 8 GB, driver 617.14, 16 GB RAM, Windows 11 26300, retail 1.0.2.1,
XCL_PAGE_BUDGET_MB=3072, one 600 s run each):main68a284aCreateHeap0x8007000eClose0x8007000e0x887a0005Tests on the stack:
cargo test -p xcl1229 passed, 1 failed (lower_dxil::…a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier, fails the same way onmain), 26 ignored.The game reaches the intro cutscene with this stack. It then sits there at 0.2-0.5 fps on cold driver compiles of large compute programs, which is a separate problem. The removal at 457 s came with ~14.7 GB of total (local + non-local) video memory; the growth after world load is in the sparse pools.
AI-assisted: yes (Claude Code, Claude Opus 5.5) — the port, the two adaptation commits and the runs.
@jessenic on GitHub · 2026-11-25 23:24 UTC · original
A port onto a #1055 / #1102 / #640 / #1182 tree, on an RTX 5070 Ti (newer retail title of #505, Series S profile): target pages 6.5 → 2.3 GB, local video memory 17.4 → 13.6 GB against a 15.2 GB DXGI budget, and world frame rate up about a quarter. Two runs each way, same binary for the last pair.
What was ported. The port is behind a switch,
XCL_TEXTURE_FOLLOW=1, and is off without it. It is built from:take_batch,heap_ranges_trimmed);title_backedasks the page-mapping method (mirrors::mapped_source), then the physical page, then the CPU view, and notes changes in both views. This is needed on a tree with #1055 / #1102: without it, method-mapped GPU-view textures stay NULL;mapped = shared || title_backed(a).Things done differently on this tree:
evict_lru(#640) unfollows what it evicts.apply_backingcallsbudget_roomonce before taking tiles.recheck_gpu_view_sourcesfeedstake_changedtotitle_memory_changed.The mip-order gap @veyn-sudo found (tile i paired with page i) is not addressed.
Tested. RTX 5070 Ti 16 GB (driver 610.88), 32 GB RAM, Windows 11 26300, release. The tree is
main0829441plus about 40 open PRs. Settings:XCL_HEAP_WINDOWS=1 XCL_UMA_SHADOW=1 XCL_COHERENT_MB=1024 XCL_COHERENT_HEAPS=sparse:256 XCL_PAGE_BUDGET_MB=5120, with the 1000CS_RaytracingResolveprograms refused (#2403). Scripted timed input, 480 s runs. Frame rate is counted from the world's first#101+ 60 s.cargo test --release -p xcl --lib hle::d3d12x::vram -- --test-threads=1: 30 passed, 0 failed, 1 ignored. That includesupdate_ranges_set_only_the_changed_tiles, a newno_tile_is_skipped_by_every_heap, and d656862a'sa_page_the_page_mapping_method_mapped_in_a_gpu_view_is_backed.XCL_TEXTURE_FOLLOW#101+60 to +160 sR2, F1 and F2 are the same binary. B2 is an earlier build of the same tree, without two local buffer-pool changes and with fewer diagnostics.
apply_backinghad mapped and unmapped about 500,000 tiles each as the title's memory changed.Not tested: AMD (WebIdentity1's mixed NULL/SKIP finding applies there); a run with world geometry visible, so mip-tail correctness is unchecked; the whole workspace suite.
AI use: Claude Code (Claude Opus 5.5) ported the change (a subagent wrote it from the commits named above; I have read its summary, not every line of the diff), ran the tests and runs, and wrote this comment.
@jessenic on GitHub · 2026-11-25 23:44 UTC · original
Follow-up to my comment above: the gain there comes from mipmapped textures, where @veyn-sudo's mip-order problem applies, so don't read those numbers as a safe win.
An independent review of my port confirmed two defects that matter for anyone carrying it:
LAST_CONTENT's unchanged-hash check skips a later rewrite of the same bytes. So the texture samples another texture's old texels. In my tree I now record the texturesapply_backingmaps tiles for, callforget_contenton them and mark them pending, so the submit uploads them whole.To avoid the second, I let only textures with one level and one slice follow. On this title that leaves almost nothing (one 480 s run, same setup as above):
The run also ended in the code-heap removal (#2403) at 437 MB of bound code.
So on this title the saving is in mipmapped textures. It needs the console page → PC subresource / tile translation, or following at whole-texture granularity: map every tile once any of the texture's pages has memory, and none when none does. I'm trying the second next; it only saves on textures with no memory at all, and I'll report how much that is.
AI use: Claude Code (Claude Opus 5.5): review workflow, run and this comment.
@jessenic on GitHub · 2026-11-26 00:56 UTC · original · edited 2026-11-26 01:13 UTC
Follow-up 2, on the mip-order problem: following per subresource keeps nearly all of the saving. Same RTX 5070 Ti, same tree and setup as my first comment. Two runs each way.
What mode 3 does. It is a third value of my local switch,
XCL_TEXTURE_FOLLOW=3, used instead of pairing tile i with page i:GetResourceTiling(subresource tilings plusD3D12_PACKED_MIP_INFO) groups a texture's PC tiles per standard subresource. All packed mips form one group.xg::Texture→gpu::tiling::Chain): tail levels[0, block_bytes), level i[levels[i].offset, levels[i-1].offset), mip 0 toslice_bytes, per slice.forget_contentso the unchanged-hash check can't skip it.#101+60 to +160 sTwo defects that a review of mode 3 found, fixed for F7:
vram::before_execute, including the texture-upload queue's own calls. A group turned on there was sampled from a recycled tile until the next look. It is now applied only before the title's own submit, which uploads the turned-on textures in the same pass.evict_lruwas called far too often. It now counts only the missing tiles.Not tested: AMD; the world with geometry visible (the scene behind the credits is flat with RT resolve refused); console modes beyond the three exercised by the unit test of the range formula (
0x105,0x119,0x11B).This is all on a local tree with #1055 / #1102 / #640 / #1182, so it is not a patch for this PR's head. Reference branch (not for merge, with local diagnostics mixed in): https://github.com/jessenic/xcl/tree/local/story5-fps (
92cb999); the follow code is invram.rs(follow_modeand below), the hooks inkernelx.rs, and the re-upload intitle_textures.rs.AI use: Claude Code (Claude Opus 5.5). Subagents wrote modes 2 and 3; a multi-agent review checked mode 3 and its findings were verified before fixing; I ran the unit tests (
hle::d3d12x::vram: 36 passed, 0 failed, 1 ignored) and the runs, and wrote this comment.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.