runtime: mark UAV writes before refreshing coherent placed buffers #3890
Open
Leyukaka wants to merge 12 commits from
upstream-pr/3890 into main
pull from: upstream-pr/3890
merge into: R0Y00:main
R0Y00:main
R0Y00:codex/indirect-large-backed-views
R0Y00:codex/word3-preflight-check
R0Y00:codex/vertex-table-two-records
R0Y00:codex/live-index-alias
R0Y00:codex/copied-vertex-buffer-srv
R0Y00:codex/windows-stage-test-output
R0Y00:codex/preserve-live-srv-retirement
R0Y00:codex/share-render-target-tracking
R0Y00:codex/sgd5-negative-offset-fixture
R0Y00:coverage-dashboard
R0Y00:codex/mesh-loose-root
R0Y00:codex/mesh86-cache-padding
R0Y00:codex/xmem-scatter-preflight
R0Y00:codex/mesh-depth-ps
R0Y00:codex/indirect-dispatch-refresh
R0Y00:codex/compute-container-index
R0Y00:codex/startup-compute-formatted-load
R0Y00:codex/compute-indirect-producer
R0Y00:codex/compute-atomic-soffset
R0Y00:codex/mesh-dual-handoff
R0Y00:codex/startup-run-sh-watcher-control
R0Y00:codex/queue31-page-alias
R0Y00:codex/indexed-indirect-compute-root
R0Y00:codex/typed-buffer-view-metadata
R0Y00:codex/translated-indexed-address-alias
R0Y00:codex/fixed-mesh-create-result
R0Y00:codex/xmem-section-lease
R0Y00:codex/startup-slot86-mesh-cache
R0Y00:codex/restore-mesh-barrier-iteration
R0Y00:codex/translated-indirect-upload-index
R0Y00:codex/xapu-completion-opt-in
R0Y00:codex/translated-indexed-rect
R0Y00:codex/translated-indexed-indirect
R0Y00:codex/startup-mesh-lds-integration
R0Y00:codex/startup-console-ms24
R0Y00:codex/startup-slot57-mesh-request
R0Y00:codex/indirect-copy-provenance
R0Y00:codex/present-color-producer-trace
R0Y00:codex/compute-dispatch-binding-trace
R0Y00:codex/translated-indirect-table-buffers
R0Y00:codex/indirect-copy-provenance-base
R0Y00:codex/mix-half-literal-source
R0Y00:codex/translated-indirect-draw
R0Y00:codex/xmem-scatter-diagnostics
R0Y00:codex/slot148-recording-upload
R0Y00:codex/slot70-loading-art-verified
R0Y00:codex/command-list-upload-arena
R0Y00:codex/recover-failed-command-list
R0Y00:codex/startup-heap-timing-notes
R0Y00:codex/align-audio-input-timeline
R0Y00:codex/synthetic-depth-export-control
R0Y00:codex/startup-texture1d-on-windows
R0Y00:codex/1629-packed-position-fixture
R0Y00:codex/cpu-srv-refresh
R0Y00:codex/stream-root-srv-draw
R0Y00:codex/audio-mixer-timer
R0Y00:codex/startup-reload-published-shader
R0Y00:codex/priority-integrate-1284
R0Y00:codex/guest-sixteen-page-record
R0Y00:codex/aot-placed-dxr-batch
R0Y00:codex/guest-directory-selection
R0Y00:codex/gamesave-enumerate-read
R0Y00:codex/readme-archive-to-pixels
R0Y00:codex/pe-placed-view-draw
R0Y00:codex/archive-directory-gpu
R0Y00:codex/slot133-dxr-build
R0Y00:codex/materialize-placed-vertex-view
R0Y00:codex/dstorage-directory-offsets
R0Y00:codex/xg-nine-bc-copy
R0Y00:codex/xg-slot10-bc64-arrays
R0Y00:codex/dxr-guest-address-readback
R0Y00:codex/gpu-va-high-bits
R0Y00:codex/clarify-diagnostic-startup-scope
R0Y00:codex/xg-six-levels
R0Y00:codex/typed-derived-blend
R0Y00:codex/english-legal-text-progress
R0Y00:codex/address-bc-4ks
R0Y00:codex/dstorage-bounded-file-read
R0Y00:codex/wide-srv-offsets-menu
R0Y00:codex/startup-memory-srv
R0Y00:codex/bound-view-tail
R0Y00:codex/language-selector-readback
R0Y00:codex/setup-menu-progress
R0Y00:codex/cpu-plane-refresh
R0Y00:codex/startup-ubyte-vertex
R0Y00:codex/presenter-window-selection
R0Y00:codex/startup-uniform-buffer-lane
R0Y00:codex/intro-loop-timing
R0Y00:codex/static-clzero-loops
R0Y00:codex/document-rtx-intro
R0Y00:codex/startup-insertq
R0Y00:codex/nv12-startup-texture
R0Y00:codex/stream-stage-draw
R0Y00:codex/startup-null-uav-format
R0Y00:codex/startup-draw-capture
R0Y00:codex/shorten-windows-checks
R0Y00:codex/dstorage-rfc1950
R0Y00:codex/startup-dump-fence
R0Y00:codex/pr1135-review-base
R0Y00:codex/startup-stream-requests
R0Y00:codex/startup-chroma-view
R0Y00:codex/readme-graphics-pipeline-streams
R0Y00:codex/static-crt-free-tls
R0Y00:codex/arc-140t-rtx-5080-laptop-gpu-reports
R0Y00:codex/main-startup-progress-entry
R0Y00:codex/signed-dxil-catalogue
R0Y00:codex/reloc-free-preferred-base
R0Y00:codex/quad-dpp-bit-mask
R0Y00:codex/raw-srv-bounds
R0Y00:codex/rx9070-31044-hardware-report
R0Y00:codex/gpu-page-source-provenance
R0Y00:codex/runtime-placeholder-interior
R0Y00:codex/gpu-copy-queue-tile-order
R0Y00:codex/pe-pin-external-providers
R0Y00:codex/xmem-placeholder-reservations
R0Y00:codex/xmem-shared-physical-pages
R0Y00:codex/pe-package-startup
R0Y00:codex/xmem-tools-memory-query
R0Y00:codex/cpu-stack-output-import
R0Y00:codex/pe-load-security-cookie
R0Y00:codex/record-three-bvh-retests
R0Y00:codex/cpu-rbp-frame-anchor
R0Y00:codex/xmem-default-startup
R0Y00:codex/record-rtx-3050-ti-9597
R0Y00:codex/docs-readme-start-here
R0Y00:codex/check-compute-mad24-truncation
R0Y00:codex/docs-discord-community
R0Y00:codex/bound-rcx-branch-mutants
R0Y00:codex/rtx5060ti-bvh-62114
R0Y00:codex/837-neutral-readme-disclaimer
R0Y00:codex/record-rtx-3070-ti
R0Y00:codex/title-neutral-public-wording
R0Y00:codex/exe-shadow-frame-submissions
R0Y00:codex/exe-shadow-runtime-chain
R0Y00:codex/readme-polish
R0Y00:codex/gpu-coverage-nov23
R0Y00:codex/spirv-minlod
R0Y00:codex/shadow-shim-device
R0Y00:codex/exe-two-shadow-frames
R0Y00:codex/shim-dispatch-cleanup
R0Y00:codex/fix-spirv-cache-probe
R0Y00:codex/sampler-use
R0Y00:codex/ballot-bit-extract
R0Y00:codex/packed-fma-release
R0Y00:codex/cpu-packed-fma-o2
R0Y00:codex/publish-coverage-dashboard
R0Y00:codex/mesh-cbv-binding-order
R0Y00:codex/spirv-window-fixture
R0Y00:codex/ps-e32-float-uint
R0Y00:codex/ps-cbuffer-reads
R0Y00:codex/fixed-profile-rescan
R0Y00:codex/shim-compute-integration
R0Y00:codex/readme-visible-coverage
R0Y00:codex/readme-research-navigation
R0Y00:codex/integrate-pr-256
R0Y00:codex/indexed-mesh
R0Y00:codex/sampled-coverage
R0Y00:codex/first-ms
R0Y00:codex/dual-ps
R0Y00:codex/ps-attribute
R0Y00:codex/compute-first
R0Y00:codex/ps-export
R0Y00:codex/readme-research-status
R0Y00:codex/ps-layout
R0Y00:codex/blast-window
R0Y00:codex/chart-caption
R0Y00:codex/reviewer-roles
R0Y00:codex/blast-aot
R0Y00:codex/archive-program
R0Y00:codex/crc-stream-program
R0Y00:codex/exe-image-data-chain
R0Y00:codex/local-cpu-fixture-coverage
R0Y00:codex/exe-bound-frame-chain
R0Y00:codex/exe-mapped-comparison
R0Y00:codex/contribution-dependencies
R0Y00:codex/exe-entry-aot
R0Y00:codex/bink-frame-heap-integration
R0Y00:docs/hardware-seven-reports
R0Y00:codex/bink-custom-heap
R0Y00:codex/bink-heap-callers
R0Y00:codex/discussions-entry-points
R0Y00:codex/gpu-community-batch-64
R0Y00:codex/ffx-scratch-writers
R0Y00:codex/generic-project-documentation
R0Y00:codex/ffx-dispatch-rcas
R0Y00:codex/four-windows-gpu-reports
R0Y00:codex/title-neutral-project-wording
R0Y00:codex/community-coverage-provenance
R0Y00:codex/rcas-packed-texels
R0Y00:codex/community-gpu-retests
R0Y00:codex/community-build-and-gpu-reports
R0Y00:codex/ffx-provider-loop
R0Y00:codex/ffx-recurrent-views
R0Y00:codex/ffx-recurrent-resource
R0Y00:codex/amd-wave64-reports
R0Y00:codex/ffx-backend-slots
R0Y00:codex/upscaler-device-init
R0Y00:codex/ffx-context-lifecycle
R0Y00:codex/ffx-version-query
R0Y00:codex/ffx-provider-contract
R0Y00:codex/typed-object-callback
R0Y00:codex/cpu-ordinal-import
R0Y00:codex/chained-cpu-ranges
R0Y00:codex/cpu-import-call
R0Y00:codex/cpu-direct-call
R0Y00:codex/cpu-leaf-aot
R0Y00:codex/community-project-status
R0Y00:codex/script-state-path-replay
R0Y00:codex/script-state-evidence
R0Y00:codex/bc7-resident-tail
R0Y00:codex/bcpack-mip-tail
R0Y00:codex/bc7-texture-draw
R0Y00:codex/asset-ranges
R0Y00:codex/pixel-constants
R0Y00:codex/pixel-aot
R0Y00:codex/pre-exe-workloads
R0Y00:codex/root-signature-device-coverage
R0Y00:engineering/packed-bvh-leaves
R0Y00:engineering/bvh-build-and-update
R0Y00:engineering/intake-root-roundtrip
R0Y00:community/gpu-check-release
R0Y00:community/english-contributor-entry
No reviewers
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!3890
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3890"
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 Leyukaka on 2026-12-02T21:00:53Z.
Fixes the main regression from #3776. This is a follow-up to that work: it keeps the coherent refresh as merged and adds the write sources that the refresh did not know about yet. Thanks to @Holastor for the refresh and its provenance marker, which this change reuses unchanged.
Problem
Since #3776,
indirect_table_bufferand the compute root SRV path refresh a non-aliased placed buffer from guest memory unless the resource is marked GPU-written. Only copies set that mark (mark_gpu_writteninlist_copy.inl). A write made by a guest shader through a UAV did not, so a buffer written that way could be overwritten with the stale guest bytes before the draw read it.Five tests fail on current
main, confirmed on unmodifiedmainon Windows:startup_indirect_translated_draw_warpstartup_indirect_translated_draw_hardwarestartup_indirect_translated_refusal_census_warpstartup_indirect_translated_refusal_census_hardwarestartup_indirect_translated_refusal_census_control_warpThe refusal census tests report:
Change
Resources written through a guest UAV are now marked with the same marker as copies:
ExecuteIndirect, which go throughdraw_translatedClearUnorderedAccessViewUintandClearUnorderedAccessViewFloat)ResolveQueryDatadestinationsA buffer the GPU never wrote keeps the refresh from #3776.
The mark is per resource and is set when the command is recorded, as for copies. It has the same limitation as copies: a list recorded before the write and executed after it can still upload guest bytes.
The
ResolveQueryDatamark changes no result today. That slot only accepts a readback buffer without guest memory, which the refresh never handles. It is marked so that every GPU write follows the same rule.Tests in
tests/startup_indirect_draw_indexed.cpp:Validation
On Windows (MSVC), WARP and hardware: 19/19 passed on base
0d00d996f, including the five tests that fail on unmodifiedmainthere. The branch was then rebased onto25f8ebec5without conflicts; I will rerun the same set on the new base and post the result here.Not covered
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-02T21:12:06Z.
Review: CHANGES_REQUESTED
Independent MSVC Debug on
0cce5d07passed the full 19-case WARP/RTX 4060 Laptop matrix. Removing only the mark inlist_clear_uavreproduced all five translated-draw/census failures. There is also a newly exposed lifetime regression: I used the newrefreshed_buffercase, recorded the same slot-53 clear against it on a second wrapped DIRECT list, closed and released that list without submitting it, and then submitted the ordinary translated read from the original list. On both adapters, head returned 0/8 red pixels (0xff000000, expected0xff0000ff). Removing just the record-time mark made that read pass 8/8 on both; the later submitted-clear case then failed as expected. The global mark prevents the guest-backed read even though no GPU write ran. Please retain a list-local mark for same-list reads after a write, commit it only when the write is submitted, and discard pending marks when the list is reset or released. Keep both the submitted-clear and abandoned-list cases.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-02T21:29:01Z.
Review: COMMENTED
I pushed
73f3f639for re-review. New UAV and query writes are visible to reads in the same recording. Submission commits the mark, and Reset/release drops a pending mark. The legacy copy paths keep their existing behavior. On Windows 11 build 26300, MSVC Debug passed all 19 targeted cases on WARP 10.0.26100.9818 and RTX 4060 Laptop 32.0.16.1656. The submitted-clear and abandoned-list readback cases both pass. In the standalone coherence test, removing only submission promotion fails both adapters withsubmit did not commit the pending GPU write; restoring it gives 2/2. The indirect-draw fixture runs with the debug layer enabled. Please independently review the new recording/submit transition before landing.Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-12-02T21:56:25Z.
Thanks for
73f3f639. I reviewed the recording/submit transition at that commit. This was checked by reading the diff and the surrounding code, not built or run here.Checked, looks right
record_gpu_write/is_gpu_written(resource, list)key the pending mark on the native list, the same keyrefresh_rangeandcommit_listsuse, and on the whole buffer (coherent_placed_buffer.inl:164-181). Whole-resource tracking matches the old global mark and is the conservative choice for a UAV.d3d12_draw.inl:3092), the compute root SRV path (d3d12_compute_dispatch.inl:1004), andrefresh_rangeitself (coherent_placed_buffer.inl:307).commit_listsruns inside thesubmitlambda after the nativeExecuteCommandLists(d3d12_xs_device.cpp:5981), so it covers the plain batch, the per-list split path and the draw-dump / red-producer wrappers. A refused submission (linear_refreshfailure) returns before it, and lists skipped for a failed Close or recycled chunks are not in the committed set.d3d12_xs_device.cpp:2500), failed Close (:2555) and final release (:1536) all calldiscard_list, which erases the list entry, so a reused list address cannot inherit stale marks.erase(resource)also clearsgpu_writes(coherent_placed_buffer.inl:256).is_gpu_written(resource, list)releaseslist_cache_lockbefore the registry lookup, andcommit_listsreleases it beforemark_gpu_writtentakesregistry_lock. No new nesting.One remaining gap: a write still pending on another list
The refresh decision is made when the reader is recorded, but the mark only becomes global at submission:
is_gpu_written(X, B)is false, sorefresh_rangerecords a copy of the guest bytes into B.ExecuteCommandLists(2, {A, B}), or A then B in two calls.At
0cce5d07, step 2 was refused because the mark was already global. This is not a regression againstmain, which does not mark the clear at all, but it reopens part of what the previous commit closed, for lists recorded in sequence or on worker threads and submitted together.One option that keeps your abandoned-list case passing: in
is_gpu_written(resource, list), also return true when any other live entry inlist_cache()holds the resource ingpu_writes. Released, Reset and failed-Close lists drop their entries, so an abandoned writer stops blocking as soon as it is released or Reset. The cost is a conservative refusal while an unsubmitted writer list is still alive, which is the previous behavior limited to that window.Tests
copied_buffer(clear and read in the same recording),discarded_clear_buffer(abandoned list), andstartup_coherent_placed_srv.cpp(mark visible only to the recording list, dropped on Reset, committed only by submission).Minor, and older than this change: the non-render
ExecuteCommandListspath (d3d12_xs_device.cpp:6027) does not callcommit_lists. Harmless as long as nothing records these marks outside render mode.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-02T22:55:14Z.
Review: COMMENTED
I independently reproduced @Leyukaka’s cross-list case on
73f3f639. The unmodifiedstartup_coherent_placed_srv_(warp|hardware)selection passes 2/2. In a local source-built extension, list A copies0xcafebabeto a default-heap backing and registers its pending GPU write. List B records the normal guest refresh and a readback before either list is submitted. Both lists are submitted in order in one batch. After the fence, WARP and RTX 4060 Laptop both read0x77777777from the guest shadow, and B had staged 65,536 bytes. Omitting only B's refresh for this control gives0xcafebabeon both adapters. Please cover the ordered two-list case along with the existing abandoned-list case. We should also exercise recording B first and then submitting A before B, because a recording-time lookup of pending writers would not cover that order.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-02T23:10:24Z.
I also ran the other recording order on
73f3f639: record B's guest refresh and readback first, then record A's GPU write, then submit A before B in the same batch. WARP and RTX 4060 Laptop both read the stale0x77777777after the fence. With only B's refresh omitted, both read A's0xcafebabe. A check for existing pending writers at B's record time cannot catch this order, so please include it when choosing where to guard the refresh.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-03T08:06:07Z.
Related verification on #3914 (
9af44a3f): all 13 affected startup cases passed with refresh disabled. With the same binaries andX2W_COHERENT_PLACED_REFRESH=1, both WARP and RTX reproduced the key3 refusal-census mismatch at pixel(0,0)(0xff00ff00vs0xff000000). Once #3914 lands, please set that switch explicitly in the cross-list fixture and rerun both record/submit orders so the default-off path cannot mask the issue under review here.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-03T08:13:24Z.
On
maind2e6a4ed, the rebase conflicts are limited to the two refresh callers. Keep #3914’s default-off guard in both, then use this PR’sis_gpu_written(native, cmd_list)on the enabled path. I found no reader of the new pending write marks outside the two refresh callers andrefresh_range, so the newly addedrecord_gpu_writecan also return early when refresh is disabled. The existing copy tracking should keep its current behavior. Please check the default-off regression suite alongside the opt-in cross-list cases.Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-12-03T09:35:30Z.
Rebased on
main(d2e6a4ed), new headebb5df0b. I will force-push the branch: the history is rebased, your commita0460f13is kept with its authorship, and the merge commit is gone.Conflicts. Only the two refresh callers, as you found. Both keep the #3914 guard first (
refresh_enabled()incompute_root_srv_buffer, the&& refresh_enabled()branch condition inindirect_table_buffer), then callis_gpu_written(native, cmd_list)on the enabled path.Added on top
record_gpu_writereturns before taking the list lock when the refresh is off, so no list entry is created andcommit_listscommits nothing. The linear-buffer copy tracking is unchanged.is_gpu_written(resource, list)now also checks the pending marks of every other live list. This covers the order where list A records the clear and list B, recorded later, would refresh. Reset, failed Close and release still drop A's mark.startup_coherent_placed_srvchecks thatlist_bis refused whilelist_aholds the mark and refreshes afterlist_ais reset.startup_indirect_translated_coherent_{warp,hardware}run the translated mode withX2W_COHERENT_PLACED_REFRESH=1set by the test, and fail if the switch is not on, so the default-off path cannot mask the cases under review.Known limitation: your second order. B records its refresh before A records the write, and A is submitted first. This branch does not handle that case. The check runs when B records, before A's write exists. When A is submitted, B's copy is already in its closed list. Handling this would need a conditional or indirect copy, which is out of scope here. The
X2W_COHERENT_PLACED_REFRESHrow indocs/startup-runtime.mdnow describes the case. There is no fixture for it, because it would fail against the current code. With the switch off (the default) the case cannot happen, because nothing is refreshed.Tests
Windows, MSVC, WARP and a hardware adapter: 32/32 passed in this set.
startup_indirect_translated_draw_{warp,hardware},startup_indirect_translated_refusal_census_{warp,hardware,control_warp}, the eightstartup_compute_*cases,startup_coherent_placed_srv_switch_off,startup_indirect_copy_provenance*,startup_clear_uav_*,startup_mesh86_material_backing*.X2W_COHERENT_PLACED_REFRESH=1):startup_coherent_placed_srv_{warp,hardware},startup_indirect_translated_coherent_{warp,hardware}.A full-length application run with the switch unset also completed its 360 s window without a stall.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-03T10:52:18Z.
Independent MSVC Debug run at
ebb5df0bon Windows build 26300, inbox WARP and RTX 4060 Laptop 32.0.16.1656. The 10 focused CTests passed without skips: startup_coherent_placed_srv (both adapters and switch-off), translated draw and refusal census (both adapters), explicit coherent-refresh (both adapters), and the WARP refusal-census mutation control.The new tests cover a writer that is already recorded when the second list checks refresh, and a pending mark discarded by Reset. The remaining order in the review is still open on this head: record the refresh list first, record the writer second, then submit writer before refresh. The documentation now names that limitation. Please keep the default-off guard and leave the review open while the opt-in path can still overwrite a submitted GPU write in that order.
Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-12-03T11:33:16Z.
Thank you for the independent run at
ebb5df0band for keeping the review open on the second order. That order (refresh list recorded first, writer recorded second, writer submitted first) is now decided at submission, on the opt-in path only. New head7580ef80: two commits on top ofebb5df0b(8046aa33runtime and docs,7580ef80tests). I will push the branch;ebb5df0band the commits below it are unchanged.Change
refresh_rangeno longer records its copy into the guest list. It keeps a request on the list: the resource, the copy ranges, and the upload filled with the guest bytes when the list records. The record-time refusals are unchanged (a write pending on any live list, a committed write, Reset, failed Close and release).queue_executecallsx2w_coherent_placed::prepare_refreshesfor each submission, afterbefore_submit. In submission order, each list's requests run from an internal list created on the same queue and executed just before that list, in the sameExecuteCommandLists. The internal list carries the COMMON to COPY_DEST barriers the guest list used to carry.x2w-coherent-refresh skipped, first 8) and counted (x2w_d3d12_coherent_refresh_skips), and its page hashes are not committed. No guest list is dropped. A list submitted before the writer keeps its copy, so the write lands last.CopyBufferRegion,CopyResource) now also record a pending write mark, so a submitted copy counts as an earlier write. Their record-time mark and the copy provenance tracking are unchanged.Known difference. If one list refreshes the same buffer twice with different guest bytes in between, both copies now run before that list, so its earlier reads also see the later bytes.
Cost, with the switch on. Each submitted list that has refresh copies to run gets a new allocator and command list, created at that submission and released after its fence. There is no pooling yet.
Unchanged with the switch off (#3914 guard). No list carries a request,
prepare_refreshesreturns before taking a lock, and lists are submitted as before.Docs. The
X2W_COHERENT_PLACED_REFRESHrow indocs/startup-runtime.mdno longer lists this order as a known gap. It describes the submission-time copies, the skip and the known difference above.Tests
startup_coherent_placed_srv_{warp,hardware}(switch on): the existing sections submit through the same preparation as the runtime. New section 7: one list records a refresh and a consumer copy, then another list records a GPU write to the same buffer. (a) Writer first in the same call: the copy is skipped, the refreshing list still runs, its consumer reads the written word, and the page hash is not committed. A resubmission skips it again. (b) Writer in an earlier call: same result. (c) Control, refreshing list first: its copy runs from the internal list placed just before it, the consumer reads the guest word, and the written word lands last.startup_indirect_translated_coherent_{warp,hardware}(switch on): the refreshing cases submit through a guest queue. Two new cases record a UAV clear on another guest list after the draw and submit it first, in the same call or an earlier one. The draw's copy is skipped (one skip each), the draw shows the cleared value, and the table buffer keeps the clear.startup_indirect_translated_draw_{warp,hardware}(switch unset): the same two cases refuse the draw at record time, skip nothing at submission, and keep the clear.Validation
Windows, MSVC, WARP and a hardware adapter: 32/32 passed in the same focused set as before.
startup_indirect_translated_draw_{warp,hardware},startup_indirect_translated_refusal_census_{warp,hardware,control_warp}, the eightstartup_compute_*cases,startup_coherent_placed_srv_switch_off,startup_indirect_copy_provenance*,startup_clear_uav_*,startup_mesh86_material_backing*.X2W_COHERENT_PLACED_REFRESH=1):startup_coherent_placed_srv_{warp,hardware}including the new section 7, andstartup_indirect_translated_coherent_{warp,hardware}.A full-length application run with the switch unset also completed its 360 s window without a stall.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-03T11:59:37Z.
I independently rebuilt
7580ef80in MSVC Debug on Windows build 26300. The 10 targeted tests all passed on inbox WARP and RTX 4060 Laptop, including reversed recording/submission order, default-off, and the refusal-census control. There were no skips.I also reproduced the disclosed same-list limitation with the source-built startup_coherent_placed_srv fixture. In one list, refresh [0,4) on a fresh page containing 0x12345678 and copy the first word to readback. Change the guest word to 0x89abcdef, refresh [4,8) so the updated 64 KiB page is staged again, then copy the first word to a separate readback offset. After the fence, both adapters returned 0x89abcdef for both reads. The first should still observe 0x12345678. Please keep the cross-list fix and preserve the refresh point inside the guest list, or explicitly refuse a conflicting second snapshot before it can silently change the first read. The current docs and tests make clear that the default-off path stays covered.
Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-12-03T13:19:14Z.
Thank you for the reproduction. A conflicting second snapshot in one list is now refused when it is recorded, so it can no longer change the first read. New head
ea0d9b05: two commits on top of7580ef80(1abb4c8bruntime and docs,ea0d9b05test). The cross-list fix and the order-2 handling at submission are unchanged.Change
All of a list's refresh copies run before that list, so a list holds one snapshot of each 64 KiB page.
refresh_rangenow refuses a later consumer in the same list (RefreshRefusal::conflicting_snapshot, counted) when a page changed in guest memory since the list copied or read it:The first snapshot is kept, so the earlier read keeps its bytes. Identical bytes share the snapshot and add no copy. The draw input and compute root SRV callers refuse with a specific reason:
... changed in guest memory after its list refreshed it for an earlier read. Nothing changes with the switch off.Docs. The
X2W_COHERENT_PLACED_REFRESHrow indocs/startup-runtime.mdreplaces the known difference with this rule.Test
startup_coherent_placed_srv_{warp,hardware}(switch on), new section 8, follows your scenario:[0, 4)of a fresh page holding0x12345678and copies the first word to readback.0x89abcdefand the list refreshes[4, 8)for a second consumer. That refresh is refused as a conflicting snapshot and counted.[8, 12)shares the staged page without a copy.0x12345678.Validation
Windows, MSVC, WARP and a hardware adapter: 32/32 passed in the same focused set as before, including section 8 of
startup_coherent_placed_srvon both adapters andstartup_coherent_placed_srv_switch_off.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-03T13:42:11Z.
I independently rebuilt
ea0d9b05with Windows MSVC Debug and ranctest --preset dev --no-tests=error -j 1 -V -R '^startup_coherent_placed_srv_(warp|hardware)$'. Both WARP and RTX passed, including the conflicting snapshot refusal and preservation of the first read. I also independently reproduced the two remaining CI regressions on this head:Please register both reasons and reconcile the export inventory with current main. The GPU fixture result is good, and the two CI checks still need to pass on the revised head.
Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-12-03T14:18:22Z.
Both CI regressions are fixed in
57d2968a. The branch was rebased onto currentmain(7b3212a9) without conflicts, so it is force-pushed.COMPUTE_DISPATCH_REASONS(tools/startup/triage_run.py) now lists the two refusal reasons for a page that changed after its list refreshed it:a compute root SRV changed in guest memory after its list refreshed it for an earlier read(compute) andan input changed in guest memory after its list refreshed it for an earlier read(draw).x2w_d3d12_coherent_refresh_skips. Withmain's Mesh86 upload export,d3d12_xsnow has 87 entries, 52 of them unmeasured.standin_exports_check.pypins the new entry's source to itsdllexportline, as #3885 did for the Mesh86 export.Validation
Windows, MSVC, WARP and a hardware adapter: 35/35 passed in the focused set.
standin_exports_check,startup_triage_run,startup_triage_run_cli_check.X2W_COHERENT_PLACED_REFRESH=1):startup_coherent_placed_srv_{warp,hardware}.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-03T14:43:23Z.
Windows and Linux CI are green at
57d2968a. A trial merge against mainadfc0d94conflicts in tests/startup_indirect_draw_indexed.cpp after #3935. Please preserve the snapshot_stale corruption before Submit and snapshot_index in the translated-indexed selector alongside the coherent refresh controls. The runtime source merges cleanly. Rerun both the coherent placed SRV and translated indexed snapshot checks on the refreshed head.Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-12-03T15:17:18Z.
Rebased on
main(adfc0d94), new headed89d267. The history is rebased again, so I will force-push. Your commit is kept with its authorship. The runtime source merged without conflicts.Conflicts. Both were in
tests/startup_indirect_draw_indexed.cpp. Each side's lines are kept as they are:translated_indexedkeepssnapshot_indexfrom #3935. Thetranslated-coherentmode and theX2W_COHERENT_PLACED_REFRESHcheck follow it unchanged.run(): thesnapshot_stalecorruption (0x4d) runs first. The UAV clear recorded on another list after the draw (writer_recorded_after_draw) comes after it. Both still run before any list is closed or submitted.Validation
On Windows (MSVC), WARP and a hardware adapter, on the rebased head: 37/37 passed in the focused set, including startup_indirect_translated_indexed_snapshot_{warp,hardware} from #3935, startup_coherent_placed_srv_{warp,hardware,switch_off}, startup_indirect_translated_coherent_{warp,hardware}, the default-off indirect and compute regression tests, startup_triage_run and standin_exports_check.
startup_indirect_translated_indexed_snapshot_{warp,hardware}.startup_coherent_placed_srv_{warp,hardware}(switch on) andstartup_coherent_placed_srv_switch_off.startup_indirect_translated_coherent_{warp,hardware}.startup_indirect_translated_draw_{warp,hardware},startup_indirect_translated_refusal_census_{warp,hardware,control_warp},startup_compute_{dispatch_input,input_view_token,root_srv_dispatch,snapshot_order}_{warp,hardware}.startup_triage_run,runtime_startup_triage_run_cli_check,standin_exports_check.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.