startup: a mesh request can miss the exit drain after #3664 (startup_indirect_mesh_cache_heap_wide_warp flaked) #3822
Closed
opened 2026-12-02 04:06:33 +00:00 by lukaslw-lab
·
7 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#3822
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 lukaslw-lab on 2026-12-02T04:06:33Z.
Since #3664, mesh pipeline requests are written by
RequestPublisheron a background thread. In one CI run the request file was never written, and the fixture failed:startup_indirect_mesh_cache_heap_wide_warp1620be9dmerged with main0dd65da10dd65da1(run later cancelled)edadb494, includes #3664)#3712 does not touch request publishing. I could not reproduce it locally: on this Windows 10 host the WARP variant skips with no mesh shaders, and the hardware variant fails before the draw.
One path that fits, from reading
src/startup_stubs/request_publisher.hat0dd65da1:ExitProcessends the writer thread beforeMeshRequestDrainruns (d3d12_draw.inl:651-654).drain()then writes what is still queued, but only afterTryAcquireSRWLockExclusive(&lock_). If that fails, it returns 0 and writes nothing (:135,:143).lock_outside the file writes: on entry torun()(:209) and while it pops each written request (:190). If the thread is ended in one of those windows, the lock stays held, and the queued request is dropped without a message.Possible fixes, for the owner of #3664 to choose:
flush()before returning, or have the drain report a skipped queue instead of returning 0 silently.req_*files immediately withX2W_SYNC_MESH_REQUESTS=1. This loses their coverage of the background path, whichstartup_request_publisher_checkstill covers.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-12-02T13:34:53Z.
Claiming this to try to reproduce it, since a one-off flake by definition resists the person who saw it once.
Slice: reproduction only. I will loop
startup_indirect_mesh_cache_heap_wide_warp's command and report how many runs produceValueError: not enough values to unpack (expected 1, got 0)onwork.glob('req_*.m86'). I am not proposing a fix until/unless it reproduces.How: build
startup_indirect_draw_indexedwith clang-cl and runtests/startup_indirect_mesh_cache_check.pyunder the Windows CPython inside Wine + vkd3d-proton, looping the same arguments ctest passes (--heap wide). Translation-layer timing is not Windows timing, so a reproduction here is evidence about the race's existence, not about its Windows probability — and a negative result bounds it, not exonerate it. I will say which of the two I got.Environment: Debian, clang-cl 19.1.1, xwin SDK 10.0.26100, Wine 11 + vkd3d-proton, GTX 1660 SUPER. No Windows host, no WARP.
Overlap: none — the issue has no comments and no assignee.
Note: my clang-cl build needs the
/W4 /WXclang fix from #3855 while I do this, so I will build from a tree that carries it locally.Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-12-02T13:38:51Z.
Reproduction attempt: negative, and the failures I did see are not this issue's signature.
I built
startup_indirect_draw_indexedwith clang-cl and ran the exact ctest command(
tests/startup_indirect_mesh_cache_check.py <dxc.exe> <fixture.exe> warp --heap wide) under theWindows CPython in Wine 11 + vkd3d-proton, 20 times.
Both failures are Wine process creation, not request publishing:
0x2dbis Wine failing toCreateProcessthe fixture intermittently under this prefix; the runhad zero fixture output, so it never reached
work.glob('req_*.m86')at all. The other failure wasthe same shape: 5 lines of output instead of 38, no final summary, no traceback in the file.
So on this host the check is stable, and my loop's flake is an environment artefact. That is not
evidence that the
RequestPublisherrace does or does not exist — only that a Wine loop is toonoisy to separate it from spawn failures here, and that anyone reproducing this needs a Windows
host or a quieter harness. I am not proposing a fix on this basis.
If it is useful I can re-run the loop with the fixture invoked once per process by a driver script
(one spawn, many iterations inside) to remove the Wine spawn noise — say the word and I will.
Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-12-02T15:56:52Z.
This flake just reproduced in CI on Windows, so it is not host-specific and not my Wine environment.
On PR #1536's Windows job (run 46916827968), tree with the current fixture fix merged in,
startup_indirect_mesh_cache_heap_warpfailed after 2.71 s:That is the same
marker, = work.glob('req_*.m86')as in the issue report. The shim log in the same block shows the request still pending at the point the fixture exited:So the pattern is: the request is recorded as pending, the process reaches the
glob()before anything wrotereq_*.m86, and the fixture exits. That is consistent with the exit-drain race described in the report rather than with anything the test does wrong.Why this matters for my earlier comment. I reported a negative result from looping the test under Wine (18/20 pass, failures were
WinError 731spawn errors). That result stands as "a Wine loop cannot separate the race from spawn noise" — it was never evidence that the race does not exist. This run is the positive evidence that it does, on the platform where it matters.I have not changed any code for it. Recording it here because it now has a CI reproduction with a timestamp, which is what a bisect of the drain needs.
Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-12-02T15:57:34Z.
Two details from that CI run that narrow it, from reading the publication path.
1. Publication is reached — the key exists. The only shim line in the failing block is
That key is the FNV chain over
ms,ps,rootandstreamparts (mesh86_cache.inl:262-267), and it is computed immediately before the fourpublish_shader_requestcalls (:270-273). So the request reached the publication step; the fixture then found noreq_*.m86in its work directory and died atglob().2.
publish_shader_requestis atomic per part, so a torn file is not the explanation: it writesreq_<key>.<ext>.<pid>.tmp,CloseHandles, thenMoveFileExWtoreq_<key>.<ext>(d3d12_draw.inl:572-583). A reader either sees the part or does not.Put together, the remaining explanations are narrow:
cache_pathresolves per process; if the fixture and theglob()disagree on the directory, the same symptom appears with no race at all.The way to separate those two is cheap on a Windows host: set the cache directory, run
startup_indirect_draw_indexed warp meshby hand, and check whetherreq_*.m86appears in the same directory the shim printed, with the process still running versus after it exits. If it appears only sometimes, it is the drain; if it never appears there but appears in the default location, it is the path.I have not changed code. Marking this as analysis rather than a diagnosis — I cannot run the fixture here, and I would rather not guess at the drain without seeing it.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-02T16:35:19Z.
The missing
.m86marker still reproduces on trees that include #3854. In #3827 atbae3a4c0(merged from main7eebdb44),startup_indirect_mesh_lease_warp_dualfailed at the marker lookup in Windows job 143601213253. The re-run is job 143617118802. Separately, the local #3728 trial merge onto6e3a181bpassed the hardware leg but failed in WARP before translation withexpected one pending slot 86 request, found [](test details). These results establish that the symptom survives #3854. The remaining failure mechanism is open. The original reproduction claim stays with triggered02.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-02T17:53:40Z.
I reproduced this on unmodified main
b68e954con Windows 11 build 26300, MSVC Debug, Microsoft Basic Render Driver 10.0.26100.9818, debug layer enabled. Command:ctest --preset dev --no-tests=error -j 1 --repeat until-fail:10 -R '^startup_indirect_mesh_(cache_heap(_wide)?_warp|lease_warp_dual(-trace)?)$' --output-on-failure.cache_heap_warpfailed on run 2 andcache_heap_wide_warpon run 5, both after the shim logged the expected request as pending and the fixture found zero.m86files.lease_warp_dualandlease_warp_dual-traceeach passed 10/10. The failure is now reproducible locally on main and independent of the PR changes used to surface it in CI.Imported from R0Y00/Xbox2Windows. Originally posted by mumba17 on 2026-12-02T19:03:24Z.
Mechanism for the remaining case, with a fix in #3883 (one commit on
1e2b0d52). triggered02 keeps the reproduction claim. I'm taking the fix, unless R0D4X wants it as a follow-up to #3854.Cause.
drain_at_process_exit(request_publisher.h:178) first checks whether the writer thread is alive and, if so, callsflush()and returns 0.ExitProcessends the other threads asynchronously, though. AtDLL_PROCESS_DETACHthe writer's handle can still read as alive, especially when the writer has not been scheduled yet: a fixture that exits right after its first slot 86 request.flush()then waits onidle_, which an ended writer never signals. It times out after the 2 s budget, and nothing is written. #3854 covers the other case: a writer ended while holdinglock_, with its handle already signalled.Evidence. A local-only diagnostic recorded the exit path in each run. Setup: Windows 11 26300, MSVC Debug, WARP, unmodified
b68e954c, the first fixture launch ofrun_heaplooped 100 times with every core busy. 21 runs had no.m86. All 21 hadterminating=1, writer alive at entry, queue not empty,flush()false after 2.0–2.1 s, the writer ended by then, and 0 requests written. Whenever the writer had already ended at entry and requests were queued (13 runs), the drain wrote them. This also matches the CI failure:cache_heap_warpdied at 2.71 s after a single fixture launch, while the whole test passes in 1.0–1.6 s.Fix. At process exit, wait (within the same timeout) for the writer thread's handle to signal, then drain on the detaching thread as before. The ordinary
drain()(FreeLibrary, writer really alive) is unchanged.Results
.m86)--repeat until-fail:30on the 4 testsstartup_request_publisher_check(writer ended 100 ms into the drain)--mutate inlinestill failsctest -j 1 -R "request_publisher|indirect_mesh|mesh86|mesh_request"AI-assisted (Claude Code).