Skip to content

Swarm: eliminate redundant physical-page GPU backing without losing memory visibility #3211

Backlog

Description

@ZekkJJ

Goal

Reduce the native GPU backing and host commitment required to represent guest physical pages, without losing CPU/GPU visibility or compromising rendering correctness. Start with 16 GiB RAM / 6–8 GiB VRAM configurations; validate on NVIDIA and AMD.

Part of #1833 and #1773; coordinate with #1031. This is not a general memory, shader compilation or PSO optimization tracker.

Workstream status

ID Workstream Owner / existing work Tracking Status
A Deferred physical-home backing CallMeBrado / Prime1997 (existing PR authors) #1916, #3123 GPU first exposure passes locally; subsequent write fails
B Physical-page identity and dirty lifetime Section-alias contributors / ZekkJJ (existing work) #2293, #2294, #2307, #2308, #3074, #3075 Follow-ups and independent validation needed
C Unique backing attribution Unclaimed here #1773 Need ownership breakdown at matched milestones
D Redundant backing reclamation Claim after identifying a measured owner #2825, #2090, #3125 Evidence/dependency gated
E Independent hardware qualification Open to testers #42, #1607, relevant PRs Open

These are coordination statuses, not assignments. Existing PR authors retain ownership of their contributions. Check current heads and target branches before claiming anything. Use the existing issues/PRs for implementation discussion; open a child issue only for a distinct, reproduced defect not already tracked.

Why this deserves focused work

Metric Baseline Deferred backing
Sparse pool peak 896 MiB 320 MiB
Peak process commit 14,596 MiB 13,947 MiB
  • Independent results in #505 report approximately 2,600–4,400 active textures with all-zero sampled backing without aliasing, versus 690–790 with section aliasing and kernelx: preserve null scatter unmaps with physical aliases #3074/kernelx: check section page liveness for DirectStorage #3075. Visible scene content recovered. One run per configuration; zero samples are not automatically erroneous.
  • A local section-dependent correction (65d0d85e, not an upstream commit) preserved dirty records after all virtual views were removed. CPU/GPU regressions passed and previously flat-green intro frames recovered imagery. Upload staging high-water increased from 57 MB to 249 MB: lower upload volume can indicate missing required work.
  • Local qualification of the Memory: defer private physical-home GPU tiles on NVIDIA #3123 mechanism on an RTX 4060 Laptop GPU found an independent native copy/readback passes first exposure (A7 / 00 / 38), but a later CPU write to the middle page returns 0x5b on CPU and 0x00 on GPU. The apparent plain-commit/tile overlap is a hypothesis to verify against the normal upload and fence path. An attempted decommit/remap repair crashed and was reverted. Remap/destruction checks and retail savings are not yet established. This fixture is on the conventional path; the section dirty-record fix is orthogonal.

The invariant: guest physical identity, virtual mappings, native backing and content visibility are distinct. Unmapping is not destruction; backing allocation is not data synchronization; an API success is not proof of correct GPU contents.

How to claim

Comment claim: A/B/C/D/E — <specific mechanism> with the intended base/head, relevant existing PR, files, first experiment, hardware and whether you are implementing, reviewing or testing.

One implementation claim per contributor. If someone is already on the mechanism, test or review their work instead. A meaningful status update resets the 48-hour coordination window; inactive claims may be reopened after checking with the contributor. Link drafts/results here; keep detailed discussion in the corresponding PR or child issue.

Agent instructions by workstream

Give your agent the entire issue and the claimed ID. The following sections are intentionally collapsed for human readers. Agents should expand/read their claimed section and the common protocol before editing code.

A — Qualify deferred physical-home GPU backing (#1916 / #3123)

Inspect hle/kernelx.rs, hle/d3d12x/sparse.rs, hle/d3d12x/title_textures.rs and existing physical-page fixtures. Coordinate with the original PR authors; do not create another deferral implementation.

  1. Trace allocation, storage writes, dirty discovery, explicit exposure, tile mapping, upload, GPU use and subsequent writes. Identify the operation that actually requires native backing, including indirect shader accesses.
  2. Reproduce unnecessary allocations with deferral off and their absence with deferral on. Verify the exact post-exposure 0x5b discrepancy on the appropriate tree; do not attribute the local port's defect to an untested upstream head.
  3. Follow the failing physical ID through home/away resolution, CPU commitment, tile mapping, dirty discovery, native upload and fences. Run the production synchronization path before the independent GPU consumer. Establish the failing boundary before changing sparse::commit_range or sparse::committed; audit all callers. Do not blindly retry decommit/remap.
  4. Exercise populated, untouched and late-written pages, consumed write-watch state, disabled storage hints, first exposure, repeated writes, mixed ranges, remap, unmap, free and failure cleanup. Zero-only checks cannot distinguish an unmapped tile from a correctly initialized one.
  5. Copy the entire expected range into a separate native readback resource after real fence completion. Never modify an aliased source to manufacture a test distinction. Verify GPU writes and subsequent CPU visibility where applicable.

Exit: no unnecessary pre-exposure tiles, byte-exact first and later native GPU reads, lifecycle regressions passing, and guarded retail allocation measurements. Keep experimental behavior off by default until qualified. If the existing PR is superseded or retargeted, coordinate there.

B — Physical-page identity and dirty-record lifetime

Inspect the section dependency stack (#2293/#2294/#2307/#2308), #3074/#3075 and relevant kernelx/{alias,sections,guards,lazy}.rs, kernelx.rs, dstorage.rs, title_textures.rs paths. Some files do not exist on main without the stack. Separate conventional and section-backed contracts.

Trace physical ID, home, backing, view, mapping generation, dirty state, consumer visibility and release. Verify late DirectStorage destination resolution; multiple aliases; null scatter unmaps; source validation before destructive remaps; independently freed neighboring pages; last-view removal; repeated writes; mixed section/conventional dirty-watch ranges; concurrent map/write/free; and failed allocation cleanup.

Dirty records must survive unmapping of live pages, not destruction. A reused address cannot inherit a dead page's state. A consumer clearing a dirty record must not conceal writes from another required consumer. Audit fault-handler and mapping lock ordering, protection restoration and failure paths. Check available lawful API contracts; do not equate current implementation limitations with console behavior.

For rendering failures, locate the first divergence: producer bytes → physical identity → CPU source → upload source → native backing → descriptor → sampled values. Test multi-plane/tiled textures or GPU-produced contents when the affected path requires them.

Exit: one failing-parent/passing-candidate regression per confirmed defect, independent GPU evidence where relevant, and a documented dependency on the section stack. Coordinate the existing local write-preservation correction before duplicating it.

C — Attribute unique physical backing and native allocations

Start with diagnostics, not allocator changes. Inspect kernelx, sparse.rs, vram.rs, gpu/uma.rs and existing memory/activity counters. Reuse counters and allocation identities where possible.

At matched completed-storage and native-submit milestones, distinguish unique committed guest/section backing, conventional homes, CPU-only and GPU-exposed homes, alias references, sparse mapped tiles versus actual heap capacity, native placed resources, coherent UMA, parked/quarantined/fence-pinned allocations and active/idle staging. Count metadata separately where known; report native object counts and unattributed commitment.

Track owner, allocation identity, capacity, lifetime and physical-page ID where practical. Reserved virtual address space is not committed backing; multiple mappings do not imply multiple copies; partially occupied pools still cost capacity. Do not sum overlapping series or infer opaque driver allocations from a subtraction without accounting for overlap.

Exit: identify and quantify one avoidable allocation cohort, with evidence of which representation is redundant. Publish the measurement before implementing a policy change. Coordinate staging budgets with #2639 and native texture object retention with #2743.

D — Reclaim demonstrated redundant backing safely

Depends on C or equivalent measured attribution. Review #2825 (CPU-copy reclamation), #2090 (direct sparse access), #2663/#2695 (GPU-to-CPU visibility), and #2538/#3125 (retirement). Do not duplicate them. Inspect sparse.rs, vram.rs, title_textures.rs, gpu/uma.rs and late_release.rs as applicable.

For one allocation cohort, establish the authoritative representation, all writers/readers (including bindless/indirect accesses), required mapping and fence ordering, whether layout/metadata permits sharing, reconstruction cost, and where memory pressure moves. Test the smallest evidence-supported change: deferred allocation, compatible sharing, reconstructible copy removal or fence-safe reclamation.

Do not free or reuse backing while recorded/in-flight work can access it. Reject missing/failed signals and device-removal sentinel completion. Avoid waits under locks required by the signal producer. Test delayed completion, multiple queues, resource release before completion, remap, reuse, failed signals and subsequent access. If considering idle reclamation, show actual reusable capacity or heap release; a smaller object count alone is not sufficient.

Exit: measured reduction at matched work, byte-exact GPU and CPU visibility where applicable, no premature reuse, and quantified restoration/upload/fault/runtime overhead. If there is no meaningful reduction, publish the negative result.

E — Independent hardware qualification

Prefer 6–8 GiB NVIDIA, 16 GiB RAM, AMD RDNA2/3/4 and higher-memory controls. Test an exact PR head against its documented dependency parent. Verify configuration actually reaches the mechanism; distinguish skipped, unsupported and executed cases. Test individual changes before agreed integration candidates.

Report on the relevant PR, using Tested / Not tested and actual hardware/driver/commands. General GPU reports belong in #42; follow #1607 for independent triage/batch validation. Run only reviewed code on suitable hardware, and use host safeguards. A tester who cannot safely run retail can still provide synthetic GPU evidence. Do not present a capability skip as coverage.

Exit: independent positive or negative results for the exact tested revision, including native GPU evidence and guarded memory/progress comparison where feasible.

Common agent protocol — baseline, implementation, validation and reporting

Read AGENTS.md, CONTRIBUTING.md, CLAUDE.md and relevant HANDOFF/design sections. Repository rules prevail. Inspect branch, HEAD, staged/unstaged/untracked state; preserve other work. Search issues, PR diffs and #1607; confirm current dependencies/targets. Do not commit, push or post without contributor authorization.

Execution: (1) trace actual production functions and ownership, (2) measure/reproduce on the baseline, (3) implement the smallest complete fix, (4) audit lock ordering, ranges, lifetime, cancellation and failure paths, (5) run focused tests, native GPU tests, release build and required full suite/smoke, (6) report evidence and limitations. A disproved hypothesis is useful; stop or narrow it rather than rewriting unrelated code. Keep one mechanism per PR, follow size/provenance/model rules and split independent changes. Do not weaken assertions, fabricate smoke blocks or report unexecuted tests as passing. The human contributor reviews every line.

Comparison: Record exact commits and dependency stack, feature settings, hardware, OS/driver/Rust/DXC, cache state, starting host headroom, guard settings, commands and stop reason. Compare at equivalent completed storage/submit milestones, not only equal elapsed time. Repeat where practical; report time and completed work alongside memory. Keep the official smoke runs on the required clean revisions and report any limitations rather than fabricating a compliant block.

Metric Baseline Candidate
Peak process commit / resident memory
Minimum available RAM / system commit
Peak local / non-local GPU usage
Unique guest backing / sparse heap capacity
CPU-only / exposed home bytes
Active / idle / fence-pinned staging
Storage requests / confirmed native executions
Upload bytes / GPU readback mismatches
Runtime overhead / last verified stage / stop reason

Use consistent units; separate each component in paired metrics. Mark unavailable counters unmeasured; do not add overlapping categories. Report the original and corrected regression results, actual full-suite counts including skips, smoke blocks where required, and independent hardware still needed. See CONTRIBUTING.md for exact current merge gates; a smoke pass alone does not prove memory savings or GPU correctness.

Acceptance criteria

A contribution must prove either a concrete correctness defect or a measured avoidable allocation. Optimizations must preserve required data and work, show native GPU correctness where applicable, and compare memory at matched execution milestones. No skipped required draws, dispatches, copies or uploads; no fabricated fence completion; no guest-budget reduction or disabled host safeguards to improve counters. Loading art and Present counts are not proof of world rendering.

No game binaries, packages, keys, dumps, proprietary names, console SDK material or DRM-related work. Use synthetic fixtures, hashes and aggregate measurements. Follow the repository's licensing and attribution rules.

Success: fewer unnecessary native allocations, preserved physical-page contents throughout their lifetime, and measurable progress on constrained hardware without rendering or stability regressions.

AI use: ChatGPT (GPT-6.2) assisted with source review and drafting. Local experimental results are from contributor-reported AI-assisted engineering runs, not independently reproduced by ChatGPT.

Activity

  1. Anon64 commented on Nov 28, 2026

    @Anon64

    A data point for C (attribution) from a 12 GB card, no claim. RTX 3060 12 GB (driver 581.80), i9-14900KF, 64 GB RAM (above the 16 GiB target), Windows 11 26200. main b937fbab, release, a newer retail game, 300 s, XCL_PREPARE=0, warm shader cache, default settings otherwise. Numbers are #2697's memory by owner line at the run's peak commit (294 s); the run is still in the title's front end at that point, not a world-render milestone.

    Owner MB
    Process commit 37 547
    — UMA window 4 095
    — sparse CPU copy 838
    — other (unattributed) 32 613
    Video memory (of an 11 347 budget) 6 053
    — target pages / arenas 3 520 / 401
    — sparse tiles 838
    — tracked committed sampled textures 429
    — other 798
    Non-local 4 604 (all "other")

    Two more runs of other heads in the same cache state peak within 0.5 % of this (37 198 / 37 535 MB, the same 838 MB of sparse tiles). So on this title the physical-page sparse backing workstreams A/D target is under 1 GB here, and about 87 % of commit is in "other". Peak commit also swings between ~17 and ~37 GB from run to run on this machine with the cache state, so a C breakdown probably has to split "other" before deferral savings are measurable on this title. In world loading (a separate run on a main-based tree, reported on #3098) "other" grew from 27.3 to 41.8 GB in about 44 s while the pools stayed flat.

    Not measured: anything inside "other", world-render milestones, 16 GiB RAM, AMD.

    AI use: Claude Code (Claude Opus 5.5) ran the runs, read the logs and wrote this comment.

  2. cj-tomlin commented on Nov 28, 2026

    @cj-tomlin

    claim: C — what the process commit's other is made of

    @Anon64's run above has 32.6 of 37.5 GB of commit in other. On main (beeb81be) the commit side of memory by owner has two parts, the UMA window and the sparse CPU copy; #2750 / #2776 / #2999 add owners on the video-memory side. So I'm taking the commit side only, and building on the existing line rather than adding another.

    Plan, measurement first:

    1. No code: one run of a retail title on main with XCL_ACTIVITY=1, and at the peak a breakdown of the process's committed private memory by region (heap, stack, private data, regions XCL handed to the title, the rest), next to the memory by owner line. In particular: how much of other is video memory, which HANDOFF.md says WDDM charges to the process's commit, so it would be counted on both sides. Posted here as aggregates.
    2. Then, depending on 1: a diagnostics-only PR adding commit-side parts to memory_report.rs (e.g. the title's allocations through kernelx, process heaps), with the overlap with video memory stated rather than subtracted. No change to allocation. I'll coordinate with @joeypercia's stack first, since it touches the same file.

    Files I expect to touch in 2: hle/d3d12x/memory_report.rs, hle/kernelx.rs (counters only). Draft PR in 48 h if 1 shows an owner worth counting; otherwise I'll post the negative result and release the claim.

    Hardware: RTX 3080 10 GB (621.40), Ryzen 7 7800X3D, 32 GB RAM, Windows 11 26300. Above the 16 GB target, so this is attribution, not a constrained-hardware result.

    AI use: Claude Code (Claude Opus 5.5) did the source review and drafted this; I checked it.

  3. brainhay5 commented on Nov 28, 2026

    @brainhay5

    claim: E — independent qualification of #1916 (e2aa8560, parent 689f2db4)

    Testing only, no code changes.

    Hardware: RTX 5070 Ti 16 GB, driver 32.0.16.1088, Ryzen 7 5800X3D, 64 GB RAM, Windows 11 22631. Title 1.0.2.1 (TitleId 7952987A), release build of the exact PR head.

    First experiment: XCL_DEFER_PRIVATE_HOME_TILES off vs on, everything else identical, so the flag-off arm is the parent behaviour on the same binary rather than a second tree. Two 60 s runs per arm (matching #1916's own 60 s unit), reading sparse pools X MB (Y MB mapped) from the memory line, plus peak process commit and peak VRAM sampled from the same process. Repeating if the spread warrants it.

    Caveats I will state in the result, not discover later:

    • 16 GB VRAM is above this issue's 6–8 GiB target, so this is a higher-memory control, not target-hardware coverage. A small delta here does not disprove the mechanism and a large one does not generalise to 6–8 GiB.
    • This title does not reach a world-render milestone on this machine — it stops presenting around 230 s on current main and around 50 s on this older base. So the evidence is front-end memory at a matched elapsed milestone, explicitly not world rendering, and I will not present it as progress.
    • #1916 is CONFLICTING against current main, so I am testing the head against its documented parent 689f2db4 as-is, not a rebase. I will say so in the report and will not attribute anything about current main to it.

    I will report on #1916 with Tested / Not tested and the actual commands.

  4. cj-tomlin commented on Nov 28, 2026

    @cj-tomlin

    C, first result: on NVIDIA most of commit's other is video memory, which WDDM charges to the process's commit. So memory by owner counts it twice, once in commit other and once under video memory, and adding the two overstates use.

    Setup: main beeb81be, release; RTX 3080 10 GB, driver 621.40; Ryzen 7 7800X3D, 32 GB RAM, 15 GB page file; Windows 11 26300. A retail title, XCL_ACTIVITY=1 XCL_PREPARE=0 XCL_NETWORK=0, a copy of a warm DXIL cache, its own XCL_DATA_ROOT. The process's committed private memory taken apart with Sysinternals VMMap snapshots next to the memory by owner line.

    1. A synthetic check, no title. A small standalone D3D12 program (not part of XCL) creating 256 MB buffer heaps on the 3080, two runs with identical results:

    step commit write-combined private regions DXGI local DXGI non-local
    1 GB of DEFAULT heaps +1,026 +1,024 +1,024 0
    2 GB of DEFAULT heaps +2,052 +2,048 +2,048 0
    + 1 GB of UPLOAD heaps +3,078 +3,072 +2,048 +1,024
    all released 0 0 0 0

    (MB against the start.) Every byte of a heap, local or not, is a byte of PrivateUsage, and shows in the address space as a MEM_PRIVATE region with PAGE_WRITECOMBINE.

    2. The title, menus (300 s, no crash, 8,825 frames) and loading into the world. The run into the world reached 29.8 GB of commit in 92 s and was stopped by my guard (under 2 GB of system commit left), so its peak is not here. MB; the last VMMap snapshot (92 s) is incomplete and left out:

    menus 280 s world 18 s world 82 s
    commit (memory by owner) 16,296 16,441 27,735
    — UMA window 4,095 4,095 4,095
    — sparse CPU copy 838 838 1,852
    — write-combined private regions 6,594 6,546 13,791
    — heaps 1,684 1,388 2,087
    — other read/write private 2,810 3,311 5,811
    DXGI local 6,062 6,060 12,675
    DXGI non-local 4,765 4,720 5,122
    local + (non-local − UMA window) 6,732 6,685 13,702
    • The write-combined regions are within ~140 MB of local + the non-local beyond the UMA window at all three points, and grew with it while the world loaded (+7,245 MB against +7,017 MB). Taking the UMA window as part of non-local is my reading (its size is ~4 GB of the ~4.7 GB there), not something I checked in the code.
    • What grew: placed texture pages, 3,499 → 8,755 MB in a minute; local reached 13.7 GB against a ~9 GB budget on a 10 GB card, and every MB of it is commit too, which is what exhausted RAM + page file here.
    • VMMap's private total matches PrivateUsage (16,264 vs 16,296 MB at 280 s): nothing large is outside the address-space view.
    • What is left after the known parts and the video-memory charge: 4,962 MB at 18 s and 7,997 MB at 82 s, which is heaps plus other read/write private memory (a few large blocks of 400–900 MB and many smaller ones). That is the part still without an owner.

    The @Anon64 run above (37.5 GB, other 32.6 GB) should split the same way on NVIDIA; I have not checked AMD.

    Next: a diagnostics-only PR for memory_report.rs: show the video memory charged to commit as its own commit part (marked as the same bytes as the video side, not added), so other is what has no owner. I'll check with @joeypercia first, since #2750 / #2776 touch the same file. Then the remaining read/write blocks and heaps.

    Not tested: AMD, other NVIDIA drivers, the in-world peak (needs a higher commit limit than this machine's 32 GB RAM + 15 GB page file: more RAM, or possibly a larger page file, if the run still gets far enough while paging that much), whether the UMA window is all of the non-local base.

    AI use: Claude Code (Claude Opus 5.5) ran the runs, wrote the probe and the VMMap summary script, and drafted this; I checked it.

  5. cj-tomlin commented on Nov 28, 2026

    @cj-tomlin

    Correction to my update above: this is not new. #2697 already counted it as a D3D12 heaps commit part (both DXGI segments less the imported coherent window; 1 GiB heap = +1 GiB of commit, measured by @joeypercia on an RTX 4070 Ti and an RDNA2 iGPU). main's adaptation (d3e60ec) left it out, and #2697 was closed today with that piece and uma_imported_bytes() left for a small PR on main, after @thehollowedone asked for a current-main check for double counting first.

    So what my runs add is that check, on main beeb81be with a retail title on an RTX 3080 (621.40): the write-combined private regions match local + non-local less the 4 GB window to within ~140 MB at three points, up to 27.7 GB of commit. Credit for the mechanism is theirs.

    Next, as two PRs on main:

    1. bring the D3D12 heaps commit part and uma_imported_bytes() from D3D12.X: a memory line by owner, against DXGI's budget #2697 to main's report (authorship credited);
    2. separately, @thehollowedone's fix for snapshot() creating the UMA window through uma::get(), with their child-process regression, if it still applies on main.

    AI use: Claude Code (Claude Opus 5.5) found the overlap and drafted this; I checked it.

  6. Anon64 commented on Nov 28, 2026

    @Anon64

    @cj-tomlin the split of my 37.5 GB run (RTX 3060 12 GB, driver 581.80, 64 GB RAM, main b937fbab, XCL_PREPARE=0, idle at the title screen, no input; regions read with VirtualQueryEx from outside the process, MB):

    150 s 280 s
    private total 17,365 37,774
    write-combined private (0x404) 6,503 6,504
    UMA window (one 4 GiB private region) 4,096 4,096
    read/write private regions of 1–64 MB 2,792 (1,721 regions) 21,569 (20,130 regions)
    read/write private, other sizes 3,749 4,365

    So your video-memory reading holds here too (the write-combined part is flat at ~6.5 GB and matches local + non-local beyond the window), but on this machine there is a second, much bigger piece that is not video memory: 19,856 regions of exactly 0x101000 bytes (1 MiB plus a page) at random 4 KiB offsets inside their reservations, i.e. NT-heap large blocks of 1 MiB. They are nearly empty (5 sampled: 123–1,805 non-zero bytes of 1,048,576; one 193 KB) and not freed.

    They arrive in one burst: commit is flat at 17–19 GB, then rises ~19 GB in ~20 s, starting at 244 / 247 / 251 / 262 s in four runs, the same with XCL_NETWORK=0. XCL's activity (presents, submits, draws, write-watch) does not change during it, and XCL_TRACE_MEM shows no kernelx allocation ≥ 64 KiB after 1.5 s, so it is not XMemAlloc or the VirtualAlloc hooks. Each burst overlaps a ~20 s NVIDIA driver compile of a 1.2–1.4 MB-DXIL compute PSO (a different one each run; earlier compiles of the same size did not jump), so the driver's compiler is my main suspect, not confirmed. A run that logs PrivateUsage around each driver compile call is going now; I'll edit this with the result. Your 300 s menu runs peak at 16.3 GB, so they may end before this point, or the 3080's driver may not do it.

    This is also why my smoke runs swing between ~17 and ~37 GB of peak commit: a 300 s run either reaches the burst or not.

    AI use: Claude Code (Claude Opus 5.5) ran the runs and the region scans and wrote this.

    Edit, the probe result: it is inside the driver call. A local build of b937fbab that logs PrivateUsage right before and after each logged driver compile (local commit 2187f46c, not for upstream), same run: one CreateComputePipelineState of a 1,272,016-byte DXIL compute pipeline (no driver blob, 23.5 s in the driver) took process commit from 17,233 to 37,050 MB (+19,817 MB). The six huge compiles before it added +6 to +519 MB each, the one after +93 MB. Commit stays at ~37–38.5 GB to the end of the run, so the driver keeps it after the call returns. The pipeline is a different one in each run (each run saves the blobs it builds, so the next run compiles further down the list), yet every run has one such compile at ~240–260 s, so I can't yet say whether it is a property of certain programs or of the driver's state after N huge compiles. Either way it is not an XCL owner: NVIDIA 581.80's compiler, on this title's largest compute programs.

    Two more things from the logs: (1) a run with shader preparation on (a local main-based build, preparation done in 148 s by 28 workers) has the same burst, at ~250 s after play started, from a compile in the title process of a pipeline preparation had not built; so preparation's worker processes don't keep it out of the title here. (2) In both runs the compile right before the burst took ~50 s instead of the usual ~20 s (52.2 s, +519 MB; 50.3 s), and the large compiles ran strictly one after another, never two at once.

  7. brainhay5 commented on Nov 28, 2026

    @brainhay5

    E — result posted on #1916: #1916 (comment)

    Short version: RTX 5070 Ti 16 GB (Blackwell), #1916 e2aa856 against parent 689f2db, one release binary with XCL_DEFER_PRIVATE_HOME_TILES off vs on, arms interleaved, two repeats each, 70 s runs, retail title.

    Sparse pool 2,048 → 320 MB, identical in both repeats; mapped 2,020 → 314 MB; process commit and local video memory fall with it; target pages and pool capacity unchanged. Same direction as the PR's own 896 → 320 MB on a 5090, larger absolute drop here, and much larger than the 8 GiB laptop case in that thread.

    What this does not cover: AMD (still the outstanding dual-vendor requirement noted in #1916), world rendering (the title is in its front end at 70 s), and current main (#1916 is DIRTY and main has moved 514 commits). 16 GB is above this issue's 6–8 GiB target, so it is a higher-memory control rather than target coverage.

    Claim released — I have nothing else in flight on this issue.

  8. KOLESNiii commented on Nov 28, 2026

    @KOLESNiii
    Contributor

    Workstream B: review findings on the section-alias stack, posted on the PRs:

    Both are unit tests on Windows with an RTX 2070 SUPER; they do not run on the GPU. Not tested: a retail title, AMD, GPU readback. No link to #505 is claimed.

    AI use: Claude Code (Claude Opus 5.5); checked by @KOLESNiii before posting.

  9. oni-swr commented on Nov 28, 2026

    @oni-swr
    Contributor

    claim: E — AMD qualification of #1916 (e2aa8560, parent 689f2db4), testing only, no code changes. Complements @brainhay5's NVIDIA result above.

    Plan: RX 7800 XT 16 GB (RDNA3), native Windows 11; private_physical_pages_reach_the_gpu_on_mapping + focused tests, then one release binary with XCL_DEFER_PRIVATE_HOME_TILES off vs on, interleaved, on the same retail-title milestone; sparse pool / mapped / commit / local VRAM, aggregate numbers only. Results on #1916, ETA a few hours (our GPU is shared and queued). AI-assisted (Claude Sonnet 5.5 runs it, orchestrated by Claude).

  10. cj-tomlin commented on Nov 28, 2026

    @cj-tomlin

    @Anon64 on "or the 3080's driver may not do it": a 600 s run into the world here (main beeb81be, release, RTX 3080 10 GB, driver 621.40, XCL_PREPARE=0, save loaded by XCL_PRESS_AT=25:A) had no burst: 100 huge driver compiles after 100 s, including 1.21, 1.30 and 1.68 MB DXIL compute programs at 420–600 s (35–59 s each), and no single compile moved commit by more than ~2.6 GB. 0x101000 regions: 0–5 in every snapshot. Peak commit 37.9 GB, of which 15.1 GB is the video-memory charge (still matching DXGI within ~150 MB at the peak).

    Not your programs, so a program-specific trigger isn't ruled out, but "the driver's state after N huge compiles" doesn't happen on 621.40. One more difference: here several huge compiles often ran at once (many from the title's own threads, ungated), where yours ran strictly one after another; and this run was in the world, yours idle at the title screen. Could you update your graphics driver and run your probe again? If the burst goes, it's a driver bug rather than something XCL needs to own. If you post one or two record hashes, I'll run them through xcl shaders --measure-pso here with commit logged.

    AI use: Claude Code (Claude Opus 5.5) ran the run and drafted this; I checked it.

  11. Anon64 commented on Nov 28, 2026

    @Anon64

    @cj-tomlin thanks, that's a clean comparison: 621.40 with no burst over 100 huge compiles points at the driver (581.80 here) rather than XCL. The driver update needs the machine's owner, who is away; I'll rerun the probe on a current driver as soon as it's updated, and report here whether the burst goes.

    I'll keep the record hashes off the thread, sorry: we don't post identifiers from the title's data. One pitfall if you measure your own huge programs with --measure-pso: give it shaders.rpf, not the title folder. On main a folder makes record_by_hash read every file under it whole (here 72.8 GB of commit before translation, from the largest archive); #1338 fixes it and I've noted the numbers there.

    Also: this machine's release builds have started crashing rustc with random faults (access violation, illegal instruction, stack overrun) on an i9-14900KF, so I'm treating any new result from it as suspect until that's checked.

    AI use: Claude Code (Claude Opus 5.5) drafted this.

  12. Foniass commented on Nov 28, 2026

    @Foniass
    Contributor

    Data point for the driver-compile commit jump @Anon64 measured above: not seen on an RTX 5070 Ti with driver 621.14.

    Setup: main 765b2c5b, release; RTX 5070 Ti 16 GB (621.14), Ryzen 7 7800X3D, 32 GB RAM (97 GB commit limit), Windows 11 26300, Rust 1.100.0. A retail title idle at its front end, no input, 480 s per run. XCL_PREPARE=0 XCL_PSO_DISK_CACHE=0 XCL_ACTIVITY=1, so the title process asks the driver for every pipeline and XCL supplies no blob. PrivateUsage of the title process sampled from outside about twice a second (1,058 and 1,078 samples) and matched to the driver compile finish lines.

    Run Driver compiles ≥ 5 s Largest Commit change across each Peak commit
    1 8 1,012,476 B DXIL, 36.3 s −204 to +206 MB 18,263 MB
    2 16 1,869,572 B DXIL, 53.7 s −493 to +522 MB 19,054 MB
    control (defaults, prepared caches) 0 n/a n/a 17,698 MB at 30 s, then 16,610 MB

    Eight of the compiles were 1.0–1.87 MB of DXIL (two of them 1,214,668 and 1,195,048 B, close to the 1,272,016 B one above). The ranges leave out the first long compile of each run, which overlaps the title's own start-up rise to ~17 GB; the control shows the same rise without a long compile. Most other pipelines returned in milliseconds even with no blob supplied, so only the compiles that really took 5 s or more are counted.

    Not tested: driver 581.80, a 30-series card, b937fbab (this is the tree after #3203), anything past 480 s, the world, AMD. So this does not say whether the difference is the driver, the GPU or the tree.

    AI use: Claude Code (Claude Fable 5.2) ran the runs, wrote the sampler and drafted this; I checked it.

  13. cj-tomlin commented on Nov 28, 2026

    @cj-tomlin

    C, status: how much of the unowned read/write commit is the driver compiler. Short answer: a few GB at a time while huge compiles run, very little kept afterwards.

    Setup: main beeb81be, release, RTX 3080 10 GB, driver 621.40. xcl shaders shaders.rpf --measure-pso 062468c09af883b9 --repeat 10 (the 1.68 MB compute program from my in-world run, 1.60 MB DXIL on this path, driver cache off), process commit sampled every 0.5 s from outside.

    • Working memory: each compile (30–36 s, median 32.9 s) raised commit by ~3.1–3.3 GB at its peak (the first by ~1.6 GB) and released it at the end.
    • Kept: the baseline before each compile went 917 → 1,086 MB over 10 compiles, ~20 MB per compile. Over ~100 huge compiles that is ≤ ~2 GB, so at most part of the +5.7 GB climb over 100–600 s in my in-world run. This agrees with @Foniass's small start-to-finish changes above (±0.5 GB): the ~3 GB is a peak inside the compile, which a before/after comparison doesn't show.
    • In the run: compiles in flight at the snapshots were 1, 1 (small), 3, 3 at 100 / 245 / 455 / 583 s, against other read/write private of 8.3 / 9.1 / 9.9 / 11.9 GB. So compiler working memory plausibly covers ~3 GB at 583 s, but not the 8.3 GB already there at 100 s with one compile in flight.

    @Anon64 thanks: I hit the same folder pitfall first (72.8 GB here too), so +1 for #1338.

    Not tested: other programs, compiles inside the title (where the driver may behave differently than in a standalone process), other drivers, AMD. Next I'm looking at what owns the 8 GB present by 100 s.

    AI use: Claude Code (Claude Opus 5.5) ran the measurements and drafted this; I checked it.

  14. cj-tomlin commented on Nov 28, 2026

    @cj-tomlin

    C, status: owners for the whole commit at ~100 s into the world, from a VirtualAlloc trace with stacks. Nothing large is left without an owner.

    Setup: as before (main beeb81be, release, RTX 3080 10 GB, driver 621.40, a retail title into the world with XCL_PRESS_AT=25:A, XCL_PREPARE=0), 110 s, peak commit 34.1 GB. wpr -start VirtualAllocation -filemode, then xperf -a virtualalloc -frames soc (commit still outstanding at each time, grouped by the first frame outside ntoskrnl / ntdll / kernelbase / kernel32). Symbols for xcl.exe only, so driver and DXC rows are DLL names.

    commit outstanding, MB 20 s 45 s 70 s 102 s
    total 16,351 19,744 27,942 34,240
    dxgmms2.sys (video memory) 10,778 11,661 15,699 19,470
    title memory (kernelx / acphal / loader) 2,270 2,756 4,975 6,772
    nvwgf2umx.dll (NVIDIA user-mode driver) 1,931 2,732 2,988 3,646
    XCL's own allocations 988 1,210 1,829 2,058
    nvgpucomp64.dll (NVIDIA shader compiler) 268 1,212 1,472 874
    dxcompiler.dll – – 710 1,026
    ucrtbase.dll 103 161 258 383
    • Video memory: 19,470 MB from dxgmms2.sys against local 14,208 + non-local 5,260 = 19,468 MB in the memory by owner line at 110 s; the UMA window is inside it, so the D3D12 heaps commit part is local + non-local less the UMA window, as in D3D12.X: a memory line by owner, against DXGI's budget #2697 / D3D12.X: memory by owner on nvidia-dev: two-pass buffers, GPU-view tiles #2999.
    • Title memory, 6.8 GB: the title's allocations through XCL's console memory functions, largest kernelx::lazy::commit 3.5 GB, XMemMapPhysicalPagesScatter 1.1 GB, VirtualAlloc 0.65 GB, home_again 0.62 GB, ApuAlloc 0.4 GB. On main nothing counts these (kernelx keeps no committed-bytes total; lazy only tracks which pages are still uncommitted), so they could become a commit part counted where they're made. I haven't checked how much of it is the 2.0 GB sparse CPU copy.
    • NVIDIA driver, 3.6 GB, growing 1.9 → 3.6 GB over 20–102 s: the candidate for the slow climb I saw over 100–600 s (+5.7 GB). The compilers (DXC, nvgpucomp64) rise and fall with compiles, as with --measure-pso.
    • XCL's own, 2.1 GB: mostly vector growth, then dispatch_chain::build, shader::capture, sparse uploads.

    Not tested: past 110 s (the driver's growth after that is from the earlier run, not traced), what inside the driver or DXC holds it (no symbols for them), the split of title memory against the sparse CPU copy, AMD.

    AI use: Claude Code (Claude Opus 5.5) ran the trace and the analysis and drafted this; I checked it.

  15. vasanex commented on Nov 29, 2026

    @vasanex

    E and A for #3123 on a 10 GB card (RTX 3080, NVIDIA 621.40), head 6330fba1, details and the test diff here: #3123 (comment)

    • E: one binary, XCL_DEFER_PRIVATE_HOME_TILES off vs on, interleaved. Front end: sparse pool 896 → 320 MB, local video memory −576 MB at equal work. Loading the save: pool 3,072 → 320 MB, local −2.75 GB at the last presenting point, but on 10 GB neither setting reaches a rendering world (both stay ~2.8 GB or more over the 9.3 GB budget, no system-memory pools on this base). Process commit: no conclusion.
    • A: the fixture's 0xDD failure (3070 / 3090 / 3080) is the test, not the deferral: it reads the CPU home after land_page, which keeps chunks the CPU changed. A test-only change that reads the window natively after the fence passes 3/3 here, so first exposure is byte-exact on this card. The later-write case from the 4060 report is not covered by it.

    Not a claim; testing only. AI use: Claude Code (Claude Opus 5.5) ran the runs and tests and wrote this.

  16. andrewDoing commented on Nov 29, 2026

    @andrewDoing
    Contributor

    For workstream A's later write to the already-mapped middle page, I compared #3123 head 6330fba1 to its parent 54225f58 on an RTX 5070 (616.92). The middle tile started lazy in every run. The next ordinary queue submission made all 65,536 bytes of 0x5B visible on the GPU in each case.

    Separate fresh-process controls CPU pointer write to mapped home Storage helper write to same physical page
    Parent 65,536 matched 65,536 matched
    Head, deferral off 65,536 matched 65,536 matched
    Head, deferral on 65,536 matched 65,536 matched

    I allocated three consecutive physical pages, wrote A7/38 to the outer pages, explicitly mapped the three pages home, and submitted a closed empty DIRECT list through the production q_execute_command_lists hook on an adopted queue. After its fence both outer tiles matched on native readback and the untouched middle still had the lazy backing marker. I then filled the middle page on the CPU, checked its bytes, and submitted again through the same hook. The native readback checked all three tiles, A7/5B/38. Each copy required a concrete backing tile and no pending mapping. The fixture used XCL_SPARSE_LAZY=1, XCL_DS_KNOWN_WRITES=0, ordinary write-watch, and no forced refresh, explicit dirty range, or CPU overwrite after submission.

    This narrows the difference with the RTX 4060 observation: an initially lazy middle tile and a later write at its mapped home are insufficient by themselves to produce stale data here. Both write routes targeted the home throughout. The separate move-away control covered writing through a physical page while it was mapped elsewhere. The remaining useful comparison would be the 4060 fixture's submission hook, write-watch state, and concrete/pending mapping state before its copy. These runs establish no driver-specific cause.

    AI-assisted fixture and verification.

  17. cj-tomlin commented on Nov 29, 2026

    @cj-tomlin

    C, status: one avoidable cohort found and measured: XCL's in-memory driver blob stores keep ~0.5 GB of blobs that also exist on disk and in the driver, and almost none of it is read back. A second, smaller one: per-pipeline copies of the same shader bytecode. Two lines I expected to find something on came back empty. No policy change from me; both cohorts already have open PRs, linked below.

    Setup: release build of 0f0cc342 (#3344's head) plus uncommitted counters logged every 2 s, RTX 3080 10 GB, driver 621.40, a retail title into the world with XCL_PRESS_AT=25:A, XCL_PREPARE=0, 110 s per run, peak commit ~33 GB. Heap stacks come from xperf -heap -Pids attached to the running title process (0 lost events).

    Since the last update: the video-memory double count is in #3343 (a memory sample no longer creates the UMA window) and #3344 (stacked: memory by owner gets a D3D12 heaps commit part, local + non-local less the UMA windows read in place). With #3344, other lands within ~240 MB of VMMap at 64 s (6,857 vs 7,097 MB), against ~9.4 GB over before. Both are drafts until the flaky CI tests (#3183 / #3221) are fixed.

    1. Driver blob stores (GRAPHICS_BLOBS 256 MiB cap, COMPUTE_BLOBS 512 MiB cap)

    held in RAM blobs read back at least once lookups hit / miss disk loads
    28 s 474 MB (4,300 blobs) 8 MB (68) 174 / 13,035 3,053 (448 MB)
    110 s 553 MB (4,734 blobs) 22 MB (175) 684 / 14,149 3,308 (495 MB)
    • Almost every entry is a blob just read from the disk cache (driver_cache::load) and admitted after the driver accepted it. Each one exists three times: the file on disk, the pipeline the driver built from it, and this copy.
    • 96 % of the held bytes (531 of 553 MB) were not read back in 110 s. That's ~1.6 % of peak commit and about a third of the process heap at 28 s (1.76 GB committed).
    • 22 MB is an upper bound: the counter also counts the lookup made after a build. A longer session may read more back; I only measured 110 s.
    • D3D12.X: keep 128 MiB of compute and 64 MiB of graphics driver blobs, not 768 #3328 lowers the caps to 128 + 64 MiB and says the retail-world saving wasn't measured; these numbers are that measurement. On this run even 192 MiB would mostly hold blobs that are never read.

    2. Shader bytecode copied per pipeline (own_shader)

    • 114,741 copies (251 MB) over the run, but only 6,098 distinct shaders (79 MB, by hash and length). 68 % of the copied bytes repeat an earlier copy, and almost all copies are made in the first 10 s.
    • The heap trace from launch to 26 s found 156 MB of these copies still live. Sharing by content would hold at most 79 MB: an estimated 80–150 MB saving, ~0.3–0.5 % of peak commit.
    • Shaders: share owned bytecode across derived and pending pipelines #3091 shares these copies and lists the real-game saving as untested.

    Ruled out

    • Target pages and sparse tiles holding the same texture (the D3D12.X: video memory use is high, title memory and textures are mirrored into VRAM #1773 hypothesis): 0 MB overlap. The ~8.6 GB of target pages and ~9 GB of tracked texture tiles never sit on the title's own sparse tiles; this title places its textures outside the sparse windows.
    • Parsed console shaders kept alive: live decompressed shader code stays at 0 MB (at most 9 objects alive). The 743 MB the VirtualAlloc trace put under the parser is heap that parsing committed first and later allocations reused.
    • Heap fragmentation: the process heap holds 2.72 GB allocated in 2.92 GB committed at 108 s, only ~200 MB free. It grows ~1.6 GB in the first 21 s, then ~16 MB/s in the world.
    • Growth in the world (83–103 s heap trace): 166 MB of new live allocations, mostly per-resource tables (vram::place_on_pages, reserved resources, placements, sparse uploads).

    Not tested: sessions past 110 s (how much of the blob store is read back later), AMD (where the disk cache is off by default), other titles. The heap trace accounts for 702 MB live at 26 s, while HeapSummary showed ~1.7 GB in another run at that point. The traced run went slower and held fewer blobs by then, but I haven't shown that this explains the gap. The counters are scratch code, not a PR.

    AI use: Claude Code (Claude Opus 5.5) wrote the counters, ran the traces and runs, did the analysis and drafted this; I checked it.

  18. oni-swr commented on Nov 29, 2026

    @oni-swr
    Contributor

    E update for #1916, partial, under claim 7246503115. Not a completed qualification.

    Tested: e2aa856010a637d33adc2cf8b49766da91574747 built as it is on its documented parent 689f2db47 (not merged onto main). RX 7800 XT 16 GB (RDNA3), driver 32.0.31035.1003, Windows 11 build 26200, Ryzen 7 5700X3D, release build for the title runs, debug for the test.

    Focused test: private_physical_pages_reach_the_gpu_on_mapping ran on the 7800 XT: 1 passed, 0 failed, 0 ignored, no SKIPPED line.

    One off/on pair (one release binary, XCL_DEFER_PRIVATE_HOME_TILES unset vs 1, 70 s each, same retail title, XCL_PREPARE=0, fresh copy of the same cache and data per arm):

    sparse pools / mapped process commit video local presents DirectStorage failed
    off 1,792 / 1,732 MB 22,450 MB 10,322 MB 1,415 0
    on 320 / 314 MB 22,125 MB 10,202 MB 1,411 2,054

    No device removal or crash in either arm. The sparse pool drop matches the NVIDIA result, so the mechanism was reached.

    The failures: in the "on" arm all 2,054 failed requests fall in one 2 s sampling window near the end (66–68 s); the other windows show none. The first logged failure is 0x89240009 (E_ACCESS_VIOLATION). Only the first failure is logged, so the cause of the other 2,053 and their destinations are unknown. This is an association with the flag in one pair, not an attribution: the run has no repeat, and the two arms differ in timing (the "off" arm had a long driver compile at about 65 s).

    Not done: the grouped sparse/kernelx tests did not run (my script error), and the second off/on pair did not run (a competing build stopped the batch). I did not rerun them. Not covered: the repeat that would show whether the failures recur, and the failing destination.

    AI-assisted (Claude Sonnet 5.5): it prepared the build and run script, ran the test and arms, and wrote this report.

  19. tiagonleal commented on Nov 30, 2026

    @tiagonleal
    Contributor

    C: local video memory by owner at a matched milestone, RTX 5070 Ti 16 GB (driver 617.42), Series X profile (title memory 13824 MiB), a retail title in its open world. Release build of main 7a649b0e merged with #3304, so without #3343 / #3344. Switches: XCL_RAM_MB=12000 XCL_CS_PSO_WAIT_MS=200 XCL_UMA_DRIVER=mixed:1536:1792 XCL_TEXTURE_LEVEL_PAGES=1 XCL_PREPARE=0 after a full shader preparation. Default UMA layout: the log says 3 sparse VRAM windows, 1 coherent window (4095 MB) and 0 view windows, so this is not the 16-window setup. Eight runs, one per configuration: two-pass cap unset (2 runs), XCL_TWO_PASS_MB=3072, =1536 (3 runs, two of them with a diagnostic switch on), =1536 + XCL_VRAM_KEEP_SPARE_POOLS=0, =1536 + XCL_MIRROR_MB=512.

    Milestone: the last memory by owner line at or before 340 s of log time (338.2 to 339.9 s in every run). Ranges across the eight runs, MB:

    MB
    video memory (local) 16,816 to 18,519
    DXGI local budget 14,781 to 15,041
    target pages 5,568 to 5,713
    target pools free 1,126 to 1,535
    arenas 264
    sparse tiles 3,712 to 3,884
    tracked committed sampled textures 1,015 to 1,090
    other 4,867 to 6,254
    non-local 4,187 to 4,459
    • The named owners cover 66 to 71 % of local video memory; other is the rest.
    • sparse CPU copy in the commit part equals sparse tiles in every run (within 1 MB), so the sparse tiles exist once in video memory and once as committed CPU memory.
    • target pools free stays between 1.1 and 1.5 GB from about 210 s to the end in every run. No run logs a reclaimed N empty 64 MiB VRAM pool heap(s) line. With XCL_VRAM_KEEP_SPARE_POOLS=0 it is 1,475 MB at the end. The free pages sit in 64 MiB heaps that never become empty. D3D12.X: bound target-page pools by title and adapter VRAM budgets #2357 bounds pool growth and D3D12.X: reclaim cooling and idle tiles on pool heap OOM #1663 reclaims on OOM; I found no open PR that gives back partly used target pool heaps.
    • Local use is 1.8 to 3.7 GB over the budget at the milestone, and 1.9 to 3.5 GB at the end. XCL_MIRROR_MB=512 ends at 17,887 MB, inside the range of the other =1536 runs.

    Not tested: who owns other (this build has no D3D12 heaps part from #3344); which heaps Windows demotes to shared memory; the Series S profile; AMD; other titles; repeats of each configuration.

    AI use: Claude Code (Claude Fable 5.2 ran the runs; Claude Opus 5.5 read the logs and wrote this).

    • Tiago
  20. POMXARK commented on Nov 30, 2026

    @POMXARK

    Data point / clean-room silicon lab finding relevant to Workstream D (Redundant backing reclamation) and Workstream B (Physical-page identity & dirty-record lifetime) — no claim.

    Summary of Silicon Findings (T51 / T53 in POMXARK/victory-city-bench)

    While auditing redundant host/GPU backing and page-guard overhead on Windows 11 (NVIDIA GeForce RTX 5080 16 GB ReBAR ON, AMD Ryzen 7 5700X, 32 GB DDR4, DirectX 12 Agility SDK 1.614.1), we isolated two Win32 VM + D3D12 hardware contracts in a clean-room synthetic bench (victory-city-bench) and verified Phase 1 on a separate GPL-3.0 translator tree (POMXARK/victory-pc-opt@4e591de):

    1. ID3D12Device13::OpenExistingHeapFromAddress1 over MEM_PRIVATE | MEM_WRITE_WATCH (T53 / EXP-048):

      • Hardware probe (P1, --exp048): OpenExistingHeapFromAddress1 + CreatePlacedResource (D3D12_RESOURCE_FLAG_ALLOW_CROSS_ADAPTER | ALLOW_UNORDERED_ACCESS, L0 Write-Back UMA) succeeds directly over committed MEM_PRIVATE | MEM_WRITE_WATCH pages, while GetWriteWatch(WRITE_WATCH_FLAG_RESET) continues to detect 100% of subsequent CPU writes (64/64 pages, missed_writes == 0) with zero VirtualProtect calls and zero VEH page faults.
      • Synthetic 174 MiB buffer benchmark (24 MiB hot CPU ring + 2.0 GB/f GPU L1 reads, 14 real ExecuteCommandLists submits/f, 14 background contention threads, D3D12_QUERY_TYPE_TIMESTAMP):
        • MEM_MAPPED (SEC_RESERVE) + VirtualProtect(RO) + VEH + CPU memcpy -> L1: 16.12 ms CPU (224 VP/f, 224 VEH/f, 0.29 ms GPU, missed == 0)
        • MEM_PRIVATE | MEM_WRITE_WATCH + L0 Alias DMA -> L1: 5.96 ms (2.70× faster), 0 VP/f, 0 VEH/f, 0.00 ms CPU memcpy, 1.31 ms GPU, missed == 0
        • MEM_PRIVATE | MEM_WRITE_WATCH + staging -> L1: 6.59 ms (2.45× faster), 0 VP/f, 0 VEH/f, 0.29 ms GPU, missed == 0
        • Unguarded GPU Compute Diff over 24 MiB L0 Alias across 14 submits/f: refuted at 32.51 ms (27.56 ms GPU PCIe wall over 336 MiB/f reads)
        • D3D12_HEAP_TYPE_GPU_UPLOAD (WRITE_COMBINE) with 3 MiB/f CPU reads (EXP-046 / T51): refuted at 733.8–774.9 ms (4.2–10 MB/s uncached WC CPU read cliff).
      • Standalone translator validation (EXP-048B / EXP-048C, POMXARK/victory-pc-opt@4e591de, 24/24 unit tests passing, 0 errors): Moving an un-aliased 185 MiB 32-bit graphics reservation from SEC_RESERVE MEM_MAPPED to MEM_PRIVATE | MEM_WRITE_WATCH (with aliasing detection and DirectStorage write routing) cut VirtualProtect time by −86.6% (56.77 -> 7.62 ms/f), eliminated all 6 hot 32-bit VirtualProtect buckets (15–23×/f -> 0.00 ms), cut VEH guard faults by −71.3% (436 -> 125/f), cut GUARDS lock wait by −43.7% (77.86 -> 43.81 ms/f), cut copies by −26.0% (21.82 -> 16.15 ms), and improved --release steady 3D frame time across matched full-orbit runs from 66.70 ms (15.44 FPS) to 59.76 ms (17.19 FPS) (first 80 s 3D: 15.05 -> 18.14 FPS).
    2. Safe Lifetime & Size Guardrails for L0 Aliasing (T8 / T51):

      • Heavy GPU-read buffers (> 32 MiB, e.g., ~2 GB/f skinning/BVH) must remain in L1 DEFAULT VRAM (fed via GPU DMA from L0 alias), whereas hot CPU-written ranges <= 24–32 MiB stay resident in RTX 5080's 64 MiB L2 cache (0.14 ms GPU in EXP-046).
      • Freeing/unmapping an L0-aliased MEM_PRIVATE range requires explicit fence settlement before VirtualFree (otherwise Win32 returns error 87 while an OpenExistingHeap holds locked pages, or in-flight GPU work can fault on torn-down pages).

    References & Reproducibility

    Tested: Windows 11, NVIDIA RTX 5080 16 GB (ReBAR ON, Agility SDK 1.614.1), Ryzen 7 5700X, 32 GB DDR4, synthetic D3D12 lab + standalone GPL-3.0 tree (4e591de).
    Not tested: xcl-dev/xcl upstream main directly, AMD RDNA2/3/4, 6–8 GiB VRAM / 16 GiB RAM systems, Phase 2 (OpenExistingHeapFromAddress1 as live Card::staging).

    AI use: Antigravity assisted with building and running the synthetic lab benchmarks and local A/B runs, parsing telemetry, and drafting this summary; reviewed and authorized by @POMXARK before posting.

  21. cj-tomlin commented on Nov 30, 2026

    @cj-tomlin

    C, status: the driver blob store cohort from my last update is still there on current main, at about the same size, and still almost never read back. The shader copies are unchanged. #3343 and #3344 are closed as duplicates of #3229, which was merged first and does the same plus the mixed and legacy UMA modes.

    Setup: release build of main 9dfbe3ea plus the same uncommitted counters, RTX 3080 10 GB, driver 621.40, a retail title into the world with XCL_PRESS_AT=25:A, XCL_PREPARE=0, coherent window 4,095 MB, two 300 s runs back to back. The cache-key changes (#3450, #3495) made the driver disk cache cold again; I ran the title three times before these two, and it was still filling between them (2,914 and 3,420 disk loads by 108 s).

    old base 0f0cc342, 110 s 9dfbe3ea run 1 / run 2, ~108 s run 1 / run 2, 299 s
    driver blob stores held 553 MB 460 / 509 MB 530 / 564 MB
    blobs read back at least once 22 MB 17 / 18 MB 19 / 18 MB
    disk loads 3,308 (495 MB) 2,914 / 3,420 (420 / 489 MB) 2,930 / 3,445 (436 / 515 MB)
    own_shader copies / distinct 251 / 79 MB 251 / 79 MB 251 / 79 MB
    process heap, allocated / committed 2,266 / 2,471 MB 2,391 / 2,608, 2,453 / 2,667 MB 2,496 / 2,761, 2,537 / 2,754 MB
    • 96–97 % of the bytes the blob stores hold are never read back, as before. Most of it is in place by ~58 s (445 / 505 MB). On these runs D3D12.X: keep 128 MiB of compute and 64 MiB of graphics driver blobs, not 768 #3328's 128 + 64 MiB caps would have dropped ~270–320 MB at 108 s and ~340–370 MB at 299 s.
    • For @saintwolf's question on D3D12.X: keep 128 MiB of compute and 64 MiB of graphics driver blobs, not 768 #3328 (whether lower caps cost disk re-reads in a long session): in 299 s here, and in 586 s on the previous base, 18–24 MB of the stores was ever read back. The caveat is the next point.
    • On this machine the title stops presenting once in the world, on old and new main: at ~112 s on the previous base, at 105 and 87 s in these two runs, with draws waiting over 1 s on pipelines still being built. So everything after that is a stalled title with background builds still running, not gameplay. A long session with a working world may read more back.

    Not tested: gameplay past the stall (see above), AMD, other titles. Process commit at ~108 s was 33.9 / 34.4 GB here against 30.3 GB on the old base; the stall comes at a different point of the load, so I have not treated that as a regression or looked into it. In an earlier run of the same build and settings the coherent window came up at 512 MB; I have not looked into why. The counters are scratch code, not a PR.

    AI use: Claude Code (Claude Opus 5.5) ran the runs, did the analysis and drafted this; I checked it.

  22. cj-tomlin commented on Nov 30, 2026

    @cj-tomlin

    C, final status, releasing the claim. The exit condition was met by my last two updates: the driver blob RAM stores are an avoidable cohort (460–564 MB held, 17–24 MB of it ever read back, 96–97 % never; #3328 caps them), and the own_shader copies hold 251 MB for 79 MB of distinct code (#3091). Below is what I measured since and have not posted, for whoever picks up C or the policy change.

    Setup: RTX 3080 10 GB, driver 621.40, release builds of main 9dfbe3ea / abec7ce9 plus uncommitted memory counters, a retail title with XCL_PRESS_AT=25:A, XCL_PREPARE=0.

    The ~3 GB commit jump when the title stalls at its first in-engine cutscene (VMMap pairs around the stall in three runs, and a kernel VirtualAlloc trace with stacks from 60 to 125 s in a fourth):

    • NVIDIA user-mode driver memory for pipeline creation, about 1 GB live. It sits in 1 GB private RW reservations that fill in 1,500+ small commits around the stall and stay. The stacks are nvwgf2umx.dll under XCL's pipeline creation (driver_pso) and bind::set_pipeline_state. Gross commits in the 25 s around the stall: ~3.7 GB for pipeline creation, ~0.8 GB in the compiler (nvgpucomp64), even though only ~150 pipelines were built from 100 to 135 s.
    • XCL compute-split scratch, 386–602 MiB live. It was 8–60 MiB on the base before D3D12.X: indirect dispatches of a split program run its direct pieces #3499 (see the next section).
    • Two-pass ExecuteIndirect buffers at their cap, 276 MiB. Thousands of two-pass draws were not made past the cap.
    • Title memory, ~360 MB, and the sparse CPU copy, +160 MB.
    • The +3.6–4.1 GB of commit at ~108 s against the old base is not a regression. At the same amount of DirectStorage read (4,000 MB) and at the last present, commit is in the same range (27.5–28.8 GB at 4,000 MB, old and new base). The new runs stalled earlier, and commit keeps rising after the stall.

    Compute-split scratch since #3499: indirect dispatches of split programs always run the chain now. Since their group count is on the GPU, each recording claims the full XCL_SPLIT_SCRATCH_MB budget (256 MiB). The direct dispatches in these runs need 8–17 MiB at most. The 384 MiB total still gives each new recording a 2 MiB floor, so live scratch passes it. #3528 removes the claim once the whole forms are built: in one run with it, scratch fell to 23 MiB. While the forms are still building, which is when the stall happens, it stays the same. I tried to read the real indirect group counts back from the GPU, but the device was removed before any of those dispatches completed. So how much of the 256 MiB they need is still open.

    A caveat on all of my runs: the stall itself is pipelines still being built (title threads waiting over 1 s). As the shader and driver caches warm, main gets past it and the device is removed right after, at the same point as with #3528 (see my corrected report on #3528). So my measurements past ~110 s come from stalled runs, as status7 said, not from gameplay.

    Not done / open:

    • the real scratch need of indirect split dispatches;
    • whether the NVIDIA driver's pipeline-creation memory can be reduced from XCL's side;
    • gameplay past the cutscene;
    • AMD, other titles.

    The counters are scratch code, not a PR; I can share the patch if it helps someone.

    AI use: Claude Code (Claude Opus 5.5) ran the runs and traces, did the analysis and drafted this; I checked it.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions