design: runtime model for the console's unified CPU/GPU memory (copies vs direct use of title memory) #1907
Closed
opened 2026-11-24 21:03:10 +00:00 by MasterDomino
·
16 comments
No Branch/Tag specified
main
codex/indirect-large-backed-views
codex/word3-preflight-check
codex/vertex-table-two-records
codex/live-index-alias
codex/copied-vertex-buffer-srv
codex/windows-stage-test-output
codex/preserve-live-srv-retirement
codex/share-render-target-tracking
codex/sgd5-negative-offset-fixture
coverage-dashboard
codex/mesh-loose-root
codex/mesh86-cache-padding
codex/xmem-scatter-preflight
codex/mesh-depth-ps
codex/indirect-dispatch-refresh
codex/compute-container-index
codex/startup-compute-formatted-load
codex/compute-indirect-producer
codex/compute-atomic-soffset
codex/mesh-dual-handoff
codex/startup-run-sh-watcher-control
codex/queue31-page-alias
codex/indexed-indirect-compute-root
codex/typed-buffer-view-metadata
codex/translated-indexed-address-alias
codex/fixed-mesh-create-result
codex/xmem-section-lease
codex/startup-slot86-mesh-cache
codex/restore-mesh-barrier-iteration
codex/translated-indirect-upload-index
codex/xapu-completion-opt-in
codex/translated-indexed-rect
codex/translated-indexed-indirect
codex/startup-mesh-lds-integration
codex/startup-console-ms24
codex/startup-slot57-mesh-request
codex/indirect-copy-provenance
codex/present-color-producer-trace
codex/compute-dispatch-binding-trace
codex/translated-indirect-table-buffers
codex/indirect-copy-provenance-base
codex/mix-half-literal-source
codex/translated-indirect-draw
codex/xmem-scatter-diagnostics
codex/slot148-recording-upload
codex/slot70-loading-art-verified
codex/command-list-upload-arena
codex/recover-failed-command-list
codex/startup-heap-timing-notes
codex/align-audio-input-timeline
codex/synthetic-depth-export-control
codex/startup-texture1d-on-windows
codex/1629-packed-position-fixture
codex/cpu-srv-refresh
codex/stream-root-srv-draw
codex/audio-mixer-timer
codex/startup-reload-published-shader
codex/priority-integrate-1284
codex/guest-sixteen-page-record
codex/aot-placed-dxr-batch
codex/guest-directory-selection
codex/gamesave-enumerate-read
codex/readme-archive-to-pixels
codex/pe-placed-view-draw
codex/archive-directory-gpu
codex/slot133-dxr-build
codex/materialize-placed-vertex-view
codex/dstorage-directory-offsets
codex/xg-nine-bc-copy
codex/xg-slot10-bc64-arrays
codex/dxr-guest-address-readback
codex/gpu-va-high-bits
codex/clarify-diagnostic-startup-scope
codex/xg-six-levels
codex/typed-derived-blend
codex/english-legal-text-progress
codex/address-bc-4ks
codex/dstorage-bounded-file-read
codex/wide-srv-offsets-menu
codex/startup-memory-srv
codex/bound-view-tail
codex/language-selector-readback
codex/setup-menu-progress
codex/cpu-plane-refresh
codex/startup-ubyte-vertex
codex/presenter-window-selection
codex/startup-uniform-buffer-lane
codex/intro-loop-timing
codex/static-clzero-loops
codex/document-rtx-intro
codex/startup-insertq
codex/nv12-startup-texture
codex/stream-stage-draw
codex/startup-null-uav-format
codex/startup-draw-capture
codex/shorten-windows-checks
codex/dstorage-rfc1950
codex/startup-dump-fence
codex/pr1135-review-base
codex/startup-stream-requests
codex/startup-chroma-view
codex/readme-graphics-pipeline-streams
codex/static-crt-free-tls
codex/arc-140t-rtx-5080-laptop-gpu-reports
codex/main-startup-progress-entry
codex/signed-dxil-catalogue
codex/reloc-free-preferred-base
codex/quad-dpp-bit-mask
codex/raw-srv-bounds
codex/rx9070-31044-hardware-report
codex/gpu-page-source-provenance
codex/runtime-placeholder-interior
codex/gpu-copy-queue-tile-order
codex/pe-pin-external-providers
codex/xmem-placeholder-reservations
codex/xmem-shared-physical-pages
codex/pe-package-startup
codex/xmem-tools-memory-query
codex/cpu-stack-output-import
codex/pe-load-security-cookie
codex/record-three-bvh-retests
codex/cpu-rbp-frame-anchor
codex/xmem-default-startup
codex/record-rtx-3050-ti-9597
codex/docs-readme-start-here
codex/check-compute-mad24-truncation
codex/docs-discord-community
codex/bound-rcx-branch-mutants
codex/rtx5060ti-bvh-62114
codex/837-neutral-readme-disclaimer
codex/record-rtx-3070-ti
codex/title-neutral-public-wording
codex/exe-shadow-frame-submissions
codex/exe-shadow-runtime-chain
codex/readme-polish
codex/gpu-coverage-nov23
codex/spirv-minlod
codex/shadow-shim-device
codex/exe-two-shadow-frames
codex/shim-dispatch-cleanup
codex/fix-spirv-cache-probe
codex/sampler-use
codex/ballot-bit-extract
codex/packed-fma-release
codex/cpu-packed-fma-o2
codex/publish-coverage-dashboard
codex/mesh-cbv-binding-order
codex/spirv-window-fixture
codex/ps-e32-float-uint
codex/ps-cbuffer-reads
codex/fixed-profile-rescan
codex/shim-compute-integration
codex/readme-visible-coverage
codex/readme-research-navigation
codex/integrate-pr-256
codex/indexed-mesh
codex/sampled-coverage
codex/first-ms
codex/dual-ps
codex/ps-attribute
codex/compute-first
codex/ps-export
codex/readme-research-status
codex/ps-layout
codex/blast-window
codex/chart-caption
codex/reviewer-roles
codex/blast-aot
codex/archive-program
codex/crc-stream-program
codex/exe-image-data-chain
codex/local-cpu-fixture-coverage
codex/exe-bound-frame-chain
codex/exe-mapped-comparison
codex/contribution-dependencies
codex/exe-entry-aot
codex/bink-frame-heap-integration
docs/hardware-seven-reports
codex/bink-custom-heap
codex/bink-heap-callers
codex/discussions-entry-points
codex/gpu-community-batch-64
codex/ffx-scratch-writers
codex/generic-project-documentation
codex/ffx-dispatch-rcas
codex/four-windows-gpu-reports
codex/title-neutral-project-wording
codex/community-coverage-provenance
codex/rcas-packed-texels
codex/community-gpu-retests
codex/community-build-and-gpu-reports
codex/ffx-provider-loop
codex/ffx-recurrent-views
codex/ffx-recurrent-resource
codex/amd-wave64-reports
codex/ffx-backend-slots
codex/upscaler-device-init
codex/ffx-context-lifecycle
codex/ffx-version-query
codex/ffx-provider-contract
codex/typed-object-callback
codex/cpu-ordinal-import
codex/chained-cpu-ranges
codex/cpu-import-call
codex/cpu-direct-call
codex/cpu-leaf-aot
codex/community-project-status
codex/script-state-path-replay
codex/script-state-evidence
codex/bc7-resident-tail
codex/bcpack-mip-tail
codex/bc7-texture-draw
codex/asset-ranges
codex/pixel-constants
codex/pixel-aot
codex/pre-exe-workloads
codex/root-signature-device-coverage
engineering/packed-bvh-leaves
engineering/bvh-build-and-update
engineering/intake-root-roundtrip
community/gpu-check-release
community/english-contributor-entry
gpu-check-v0.1.0
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Reference
R0Y00/Xbox2Windows#1907
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-24T21:03:10Z.
Background
The console has one physical memory shared by CPU and GPU. A title uses the same addresses for both, within a 40-bit range:
A title therefore writes GPU-visible data and GPU addresses straight into its own memory: vertex and constant data, descriptors, acceleration-structure inputs and destinations, upload memory from the command list (slot 148, #1758). It expects the GPU to see them, and expects to see what the GPU writes back.
How the runtime handles it today (measured on
maindf40e4bc, RX 9070 XT, the first-run UI and the post-confirm load)OpenExistingHeapFromAddress). Otherwise a separate committed desktop buffer is used.MEM_MAPPED), which this path refuses.upload_from_title)X2W_XMEM_GPU_MIRRORmaps each physical page section into both the CPU and GPU reservationsThe building blocks for direct use exist and are tested in isolation:
vm_translation_*:OpenExistingHeapFromAddressover a committed range, GPU reads and writes visible on both sides.vm_page_provenance_*andvm_translation_*exerciseOpenExistingHeapFromFileMapping. The RX 590 report in #874 passed Page Provenance and failed the separate reserved-buffer COPY-to-DIRECT tile remap. Source check and report distinction.d3d12_xs_range: a 32 GiB windowed GPU range with tile mapping.era_gpu_alias.Why the copy model is reaching its limits (observed)
-MemoryGiB 14cap is not enough.IsComplete(#1198). A copy taken from such a destination can carry stale data into GPU work without any error.Options to decide between
A. Keep copies, make them exact.
B. Back GPU-visible title memory directly (heap from file mapping or address, placed desktop resources over it).
OpenExistingHeapFromFileMappingbehaviour differs by adapter (RX 590 failsvm_copy_queue);C. Hybrid.
The choice also fixes who translates title addresses (the stand-in at bind time, the translators at lowering time, or both), and how the 40-bit address domain is kept on desktop.
Measurements that would inform the decision (proposed, aggregate only)
Ask
@R0Y00, which direction should the runtime take, and which measurements do you want first? The concrete #874 rows (placement, slot 148) stay as scoped; this issue is only for the overall model.
AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T21:12:35Z.
We'll use a hybrid model, starting with one ordinary linear CPU-written, GPU-read buffer. Keep the current production backing as the default. Opt-in eligibility depends on the allocation's use, mapped extent, the adapter actually creating the shared backing, and whether the path can meet the synchronization contract. Acceleration structures, textures and render targets are outside this first slice. If sharing fails, use a copy only when it can preserve the same visibility and lifetime guarantees. Otherwise return a diagnosable failure.
XMem owns guest allocation identity, mappings, byte offsets and lifetime. D3D12 owns desktop backing, resource state, queues and fences. Resolve each known address field to a desktop GPU VA through the same range- and generation-checked mapping. Translators declare the types of address fields they know, and the runtime binds or relocates them. Refuse dynamic layouts with unrecognized address fields. Storage publishes the range it actually wrote on success and preserves the error on failure. The 40-bit constraint stays with the specified guest address domain.
This first comparison is available to claim here. Reuse the source-built heap and cross-queue controls in #874. Run the same buffer through real sharing, forced copying and forced sharing failure. Bind A, write B before submission, and verify the GPU reads B. In a separate GPU-write case, wait for the fence and verify the CPU alias sees the result. Hold one submission in flight and check that its backing isn't reused. Missing refresh and readback before fence completion should expose stale data or a defined refusal. Report the commit, commands, adapter/driver, bytes copied, backing usage and actual HRESULTs, with skips separate. Unsynchronized concurrent writes are outside the contract.
Once both paths agree on bytes and lifetime, the first buffer change can be reviewed independently. The existing scoped placement work in #1860 and slot 148 ownership are unchanged.
Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-24T21:14:24Z.
Thanks for the direction. Claiming the first comparison as scoped: one ordinary linear CPU-written, GPU-read buffer, run source-built through real sharing, forced copying and forced sharing failure, reusing the heap and cross-queue controls from #874 (
vm_translation,vm_copy_queue,era_gpu_alias).Cases (each on all three paths):
Reported: commit, commands, adapter and driver (WARP and RX 9070 XT), bytes copied, backing used, the actual HRESULTs, and skips separately.
No change to the production default. Unsynchronized concurrent writes stay out of scope, and so do acceleration structures, textures and render targets. #1860 and slot 148 are unchanged. I'll post the comparison here before proposing the first buffer change.
AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-24T21:40:18Z.
A static read of
mainatba0449cagainst the issue text and the claimed first comparison. Nothing was built or run for this. Bare:Nrefers tosrc/startup_stubs/d3d12_xs_device.cppatba0449c.One correction to the background table.
OpenExistingHeapFromFileMappingis exercised byvm_page_provenance_*(SectionPage,tests/vm_copy_queue_check.cpp:191-221, dispatched at:706of that file) and bytests/vm_translation_check.cpp:522. Thevm_copy_queue_*tests order a tile remap of a reserved buffer across a COPY and a DIRECT queue, and open no file-mapping heap. The RX 590 failure in #874 is that remap row, and the same report has Page Provenance passing on the RX 590. So it is not evidence that file-mapping heaps differ by adapter.src/has no call toOpenExistingHeapFromFileMappingatba0449c.Rows the four cases can pass without exercising, depending on how the fixture is built:
src/xmem_mapped_pages.cpp:74-157), and slot 133 only aliasesMEM_PRIVATEranges (:2972). A fixture over a privateVirtualAllocrange, or over a fresh one-page section, does not cover:src/xmem_mapped_pages.cpp:83-91).upload_from_title,:2245) and at draw record (frame_copy,d3d12_draw.inl:615, called at:1098), both beforeExecuteCommandLists. A harness that copies at submit passes "bind A, write B" by construction. Naming the copy point under test, and using a bind-time copy as the "missing refresh" negative, would make the forced-copy row match production.reserve_upload_ring,:1719-1754, wrap at:1750-1751). A forced-copy path that allocates a fresh buffer per submission never reuses, so the in-flight case passes unless reuse is forced: a ring wrap for the copy path, and a free and slot reuse in XMem for the shared path.Wait/Signal, asvm_copy_queuedoes (tests/vm_copy_queue_check.cpp:152-158), removes the timing assumption. On the sharing path, a defined refusal is the stable oracle.not aliasedand returns success (:2996-3026), and it does not copy the title's bytes into that buffer. The failure row could tell this apart from a copy that preserves visibility: the outcome to catch is a success whose backing holds neither the title's bytes nor a refusal.Also from the code:
OpenExistingHeapFromAddress(:2982) without queryingD3D12_FEATURE_EXISTING_HEAPS;src/era_gpu_alias.cpp:41-42does query it.existing_heapscaches heaps by raw allocation base and has no removal (:2902,:2976-2985). A later allocation at the same base would be placed on the heap opened for the earlier one. That is read from the code, not observed. The range- and generation-checked mapping in the direction above would replace it.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-24T21:58:14Z.
The first comparison is up as #1942. It is test-only:
tests/unified_buffer_paths_check.cppchanges no production backing and changes no stand-in's default behaviour.Result (WARP 10.0.26100.9818 and RX 9070 XT, driver 32.0.31044.16, Windows 11 build 26300, debug layer off and on; identical on both, no skips): 40 cases pass on
share,copyandfallbackfor both pools.upload_from_title) or at draw record (frame_copy) hands the GPU the stale A, while sharing reads B. Today's copy points therefore can't stand in for sharing when the title writes between bind andExecuteCommandLists.S_OKwith zero-filled, non-aliased backing. The oracle catches it in both cases.How Leyukaka's review points are covered:
vm_page_provenance_*andvm_translation_range_*and makes no claim of an adapter difference.0x30000on a reused slot that must read zero first. The privateVirtualAllocpool runs alongside.bindandrecordare the missing-refresh negatives (d1b and d1r).0x887A000A. The shared path frees a slot and reallocates it while its submission is held.Waiton a CPU-signalled gate, with the0x887A000Arefusal as the oracle.Measured but not asserted:
OpenExistingHeapFromAddressaccepted aMEM_MAPPEDview of the section on both adapters, with CPU and GPU writes visible both ways. On the first view of a split run, it gives only a 64 KiB heap.VirtualFreeof that range fails with error 87 for both release and decommit. So with an unclearedexisting_heaps, the observed hazard is the title's free failing, not a stale read. The generation-checked mapping from the decision would remove it either way.The first buffer change will be proposed separately, against these rows.
AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by legacy-code-archaeologist on 2026-11-24T22:07:36Z.
Adapter-matrix data point for the first comparison: #1942 at its head
0e814819, run on two GPU families that are not covered yet, plus WARP. Windows 11 Pro 26100.9168, MSVC 19.52,devpreset,unified_buffer_paths_check <warp|hardware>. The adapter was selected withXBOX2WINDOWS_ADAPTER. The debug layer is not installed here (0x887a002d), so all runs are debug layer off.D3D12_FEATURE_EXISTING_HEAPSctest -R '^unified_buffer_paths_'passes 5/5 (hardware = the Quadro, the high-performance adapter). The three mutant controls fail as required.Quadro (Maxwell): it behaves like your WARP and RX 9070 XT runs.
OpenExistingHeapFromAddressaccepted the 128 KiBMEM_MAPPEDview of the 256 MiB section at +0x30000. The GPU read the CPU writes (1024/1024), and a GPU write was seen through the split run.0x80070057).VirtualFree(release and decommit) fails with error 87. After the heap is released, it succeeds.Intel HD 530 (Gen9) has no existing-heap support at all.
D3D12_FEATURE_EXISTING_HEAPSreports 0.sharerow, 6 for the section pool and 6 for the private pool, skips withopen=0x887a0004(DXGI_ERROR_UNSUPPORTED).OpenExistingHeapFromAddresson the section view returns0x80070057. The placement probes and the stale-heap probe do not run.copyandfallbackrows pass.The point for the model: the slot 133 stand-in falls back on this adapter even for private title memory. Both
private slot133rows are caught ascommitted default buffer, not aliased, no copy, withshare_hr=0x887a0004. On WARP, the Quadro and your adapters, slot 133 aliases private memory, and only the section rows are caught.So on a Gen9 Intel GPU, every slot 133 placement takes the silent-success path you described. The new backing holds zeros, not the title's bytes. This matches Leyukaka's note that slot 133 calls
OpenExistingHeapFromAddresswithout queryingD3D12_FEATURE_EXISTING_HEAPS.For the eligibility rule in the direction above, "the adapter actually creating the shared backing", this is a concrete adapter where the answer is always no. The copy path that preserves visibility, or a diagnosable failure, is then the only valid option. I have not run the production runtime here, so this is the fixture's model of slot 133, not a measured title run.
Full outputs per adapter are available if useful. I made no code change.
Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-24T22:10:03Z.
Thanks for the matrix. The Gen9 row is the most useful data point so far.
MEM_MAPPEDview acceptance, the 64 KiB first-view heap and theVirtualFreeerror 87 while the heap lives. That makes three hardware families plus WARP agreeing on those probes.D3D12_FEATURE_EXISTING_HEAPS= 0): this is an adapter where sharing is never available. On it the slot 133 model takes the silent-success path even for private memory, which today's adapters avoid. So the eligibility rule has to be decided per adapter from the feature query before any open is attempted. On a "no", the only valid outcomes are the copy path that keeps visibility or a diagnosable refusal. Slot 133's missing feature query (Leyukaka's note) is then not cosmetic. I'll carry that into the first buffer-change proposal as a requirement, with your Gen9 row as the case it must handle.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T23:48:45Z.
The test-only comparison in #1942 has merged at
cd5508e9. The Gen9 report gives the copy path a useful adapter without existing-heap support. The production slice is available for one contributor: wire the existing comparison to one ordinary linear CPU-written, GPU-read buffer, keeping the current backing as the default.Reuse #1942 for the A-to-B write before submit, GPU write and fence before alias readback, and backing reuse only after completion. Report real sharing, forced copying and host sharing refusal separately, with actual HRESULTs and bytes copied. If the copy path cannot meet the same visibility and lifetime guarantees on a case, report that refusal. Please claim the buffer here before changing the production path. Textures, acceleration structures and command-list slot 148 can continue in their existing threads.
Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-25T04:31:01Z.
I'll take the production slice: one ordinary linear CPU-written, GPU-read buffer, with the current backing kept as the default.
Plan:
D3D12_FEATURE_EXISTING_HEAPSbefore any open is attempted. The Gen9 row is the case where sharing must be refused. A copy that can't keep the same visibility and lifetime guarantees reports a refusal instead of returning success.Textures, acceleration structures and slot 148 stay out of scope. I'll post the PR here.
AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-25T05:42:31Z.
PR for the production slice: #2218. The switch is opt-in,
X2W_D3D12_LINEAR_BUFFERS=1; unset, slot 133 is unchanged. It covers slot 133 buffers inCOMMONstate with row-major or unknown layout.D3D12_FEATURE_EXISTING_HEAPSreports support.Why the last point: an earlier revision returned the refusal, and the title faulted at 1.76 s on its first GPU-written placement, because on the console
CreatePlacedResourceXdoesn't fail.On this revision, a matched title pair on the RX 9070 XT reached the same slot 148 stop: 294.1 s with the switch on, 290.1 s off. The frame rate was within 1% (29.6 against 29.8 fps). Placements: 3,094 copied at submit, 64 shared, 507 kept the default backing with the refusal recorded.
The fixture
linear_buffer_backing_*reuses #1942's cases over XMem pages and a private range. It covers six paths, the Gen9 refusal simulated with the feature forced to 0, and five mutants, on WARP and the RX 9070 XT with the debug layer off and on. 22/22 pass with the comparison tests.Not fixed by this slice: the 506 GPU-written XMem buffers (856 MiB in that run) still have the default backing, now recorded. They need a copy-back point or a releasable shared backing.
AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-25T06:47:04Z.
Heads-up for anyone running the #1942 fixture repeatedly:
unified_buffer_paths_checkleaves about 1.8 GiB of system commit per run until reboot. The cause isOpenExistingHeapFromFileMappingretaining its section after process exit, which I measured on Windows 11 build 26300 on WARP and the RX 9070 XT. The details and the fix are in #2234.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T10:06:13Z.
The shared XMem page lease is now on
mainin #2280. The source-built Release fixture passed on WARP and RTX 4060 Laptop. It checked byte visibility through both aliases, a stable lease across remapping, and page reuse only after the fence completed. Reproduce withctest --preset release --no-tests=error -R '^xmem_section_lease_' -V.For the mesh root SRV follow-up in #870, the remaining check is one consumed buffer range on the actual queue path. Record the page identity and offset at publication and at the root bind, then show that the consumer waits for the last writer's fence. A source-built control that uses a different page or omits that wait should be rejected or expose stale bytes. This can reuse the lease fixture without adding a second backing implementation.
Imported from R0Y00/Xbox2Windows. Originally posted by sydney-0o on 2026-11-25T11:11:14Z.
I opened #2303 for the bounded mesh root SRV handoff using the section lease from #2280. It tracks one GPU-written DWORD through the startup command-list and queue wrappers, matches the physical page and byte offset, and orders the DIRECT consumer after the COPY writer's fence. The lease is retained through consumer completion.
On app-local WARP 1.0.22 with Agility SDK 1.620.2 and the debug layer enabled, the ordered mesh draw reads the fresh word in all eight pixels. Omitting the wait reads the old word. A different page or offset leaves the target clear. The gated consumer holds the slot after unmapping, and the slot becomes reusable after its fence. The PR includes the exact reproduction commands. Release: 10 passed, 0 failed, 2 capability skips on GTX 1080 Ti.
Imported from R0Y00/Xbox2Windows. Originally posted by lukaslw-lab on 2026-11-26T00:33:44Z.
Field result for #2218's
X2W_D3D12_LINEAR_BUFFERS=1in a main-executable run: on this host the submit-time copy halves translated draws, shows brief visual glitches that the default backing does not, and does not reduce held memory.Windows 10 22H2, RTX 3080 Ti (driver 32.0.16.1047), release build of
maina6967446plus #2611, warm shader cache, same recorded input. All runs:X2W_D3D12_BUDGET=1 X2W_D3D12_RELEASE_RETIRED=1 X2W_D3D12_RELEASE_RETIRED_VIEWS=1 X2W_D3D12_RETIRE_REASONS=1, 600 s. The only difference is the switch.share=E_INVALIDARG), so on this title the copy path is the normal path.0x887a000astale refreshes, but only after ~510 s.ExecuteCommandListsand before the GPU reaches the work is visible with the default backing but missed by the copy taken at submit.LinearBuffersunder one mutex. I have not profiled this.Aggregate counts only; no addresses or title data. AI-assisted (Claude); I ran the runs and noted the glitch times.
Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-26T00:38:20Z.
Thanks, @lukaslw-lab. This is the field result #2218 needed, and both readings fit how the opt-in works:
mutex_, about 21 k records per submission across about 72 k submissions, whatever was written. That's far more likely to be the cost than the 16 MiB copied. A per-buffer dirty signal, such as a write watch on the title pages or a generation counter set by the XMem write paths, would make the walk proportional to what changed. I haven't profiled it either, so that's a hypothesis until a trace shows it.ExecuteCommandLists, which is the visibility rule agreed in #1914. A title that writes a buffer after submitting and before the GPU reaches the work relies on unified memory, and the aliasing backing gives it that, but a submit-time copy can't. Your bursts lining up with the glitches fit that. A deterministic case would settle it: submit a read gated on a fence, write B from the CPU, then signal. The aliased backing reads B, while the copy reads A by design.The default backing is unchanged, so nothing regresses without the switch. I'll take the two follow-ups:
Each would come as its own PR. Before I start: @R0Y00, is a write-after-submit gap acceptable for the opt-in as long as it's documented, or should that pattern be refused or warned about in the copy path?
AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-26T00:53:39Z.
Keep the current opt-in contract for this slice: the copy captures bytes at submission. A workload that depends on writes after submission needs a backing path that can provide that visibility. Please take the gated fixture and the separate profiling work. For the fixture, hold GPU consumption behind a queue wait, write B on the CPU, then signal and read back after completion. Report the measured shared and forced-copy results separately, and keep the write-before-submit control where both should read B. Document the confirmed limit with the fixture. Leave the default backing and fallback behavior in place. A runtime warning or refusal would need evidence that the implementation can actually identify the unsupported ordering.
Imported from R0Y00/Xbox2Windows. Originally posted by RomainROCH on 2026-11-30T03:59:29Z.
I put together an independent MIT-licensed CPU replay that may complement the WARP cases in #1942 and #2332. It records the backing generation captured at submit, the current mapping at read, and the last writer of each byte range.
In the synthetic case, compute waits for a copy ticket submitted later. The view is rebound while compute is blocked. Once the producer retires, the captured backing receives
10 20 30 40. A one-byte CPU overwrite leaves10 ee 30 40through the surviving alias, and the new backing remains zero. A separate test allows a CPU read while a disjoint write is still pending.From the pinned lab snapshot, run
python gpumemorylab.py examples/remap.json --explain. The replay reports one blocked step and the writer event for each returned range. It models backing capture at submission. Your gated WARP test can separately distinguish a submit-time byte snapshot from a later read of live backing. Would the mapping event and last-writer ranges help label mismatches in that fixture?