startup-runtime: null read after the user privilege queries (about 75 s) #1153
Closed
opened 2026-11-24 02:04:15 +00:00 by rasptum
·
12 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#1153
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 rasptum on 2026-11-24T02:04:15Z.
Problem
With
tools/startup/run.ps1 -Render -FakeUser -GpuMirror -ContinueAsserts 5000on an NVIDIA GeForce RTX 3060 (driver 32.0.15.9636, Windows 10 22H2 19045.6466, debug layer off), one console executable stops at 74.2 s and again at 75.1 s (two runs, same instruction) with a second-chance access violation inside the executable: a read at address 0x68 through an object whose first pointer is null.What precedes it in both runs, from
stderr.txtandfiles.txt:0x0byX2W_FAKE_USER;QueryApiImplcalls for a second provider (answered0x0);The run in #1135 (RDNA4, Windows 11) reached its 150 s timeout, so this may depend on timing, on an answer that leaves an output argument unset, or on the two local changes needed to get this far here (drive mapping and a capped view heap, see the linked issues).
Where to start
S_OKwith an untouched out-pointer is the first suspect.X2W_TRAP_DUMPon the faulting object and--stop-first-chance 1give the caller chain.Done when
The call whose answer leaves the null pointer is identified and answered, or the cause is shown to be outside the runtime proxy and split into a narrower issue.
Context:
docs/startup-runtime.md(#1135). Do not attach game files, dumps or logs that contain addresses or names from an executable; describe results in terms of the component tested.AI-assisted (Claude Code).
Imported from R0Y00/Xbox2Windows. Originally posted by rasptum on 2026-11-24T02:04:52Z.
Claiming this. First step is logging the output arguments of the user-interface calls that precede the fault and getting the caller chain with
--stop-first-chance 1. I will post the answer that leaves the pointer unset, or narrow the issue if the cause is elsewhere.AI-assisted (Claude Code).
Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-24T05:26:30Z.
A second adapter reaches a null object in the same phase, at a different offset — possibly a second instance rather than the same one.
Measured with
tools/startup/run.ps1 -Render -FakeUser -GpuMirror -ContinueAsserts 1000 -InputScript 4@70on main at857d9731: NVIDIA GeForce GTX 1660 SUPER (driver 32.0.16.1074), Windows 11 build 26200, release build of the stand-ins. Two runs from a cold start stopped at the same instruction at 82.7 s and 86.9 s.What precedes it matches the sequence you describe: the save service is created, the gaming-runtime user-interface calls (method 19 once, then method 20 with small ids) are answered by
X2W_FAKE_USER, a second provider'sQueryApiImplcalls are answered, and the offline mode refuses socket opens. Then the executable reads through a null object.Our stop is a read at 0x10, not 0x68: a predicate test on a flags byte at offset 0x10 of an object whose pointer is null. The pointer arrives with no desktop call failing — I added a hook that logs every failed HRESULT returned through the device stand-in's forwarding paths (the per-slot probes stop after their first few calls, so a late failure was invisible), and in a full 90-second run the only forwarded call that failed was
CreateCommandSignature, which the stand-in already turns into a placeholder and which is not on this path.The null instead comes from inside the executable: a factory routine returns NULL after its own internal check fails, and its caller passes that NULL straight to the routine that then asserts (the run steps over the assert as a soft assert and faults on the second-chance pass). So the first suspect is whatever the factory is waiting for — consistent with your "an
S_OKwith an untouched out-pointer" hypothesis, but one step further back: something the factory queries returned a value it treats as "not ready" rather than an outright failure.Two details that may help distinguish adapters: with the view-heap fallback of #1159 and
s_setpriotreated as a hint (#1241) the run presents 1,852 frames at 28.5 fps with 5,378 translated draws and 4/4 pipelines before it stops, so this is not a translation or descriptor problem. Andtextures uploaded 0in the render totals at the same time, which suggests the texture-upload path never runs before this stop; whether that is a cause or another consequence of the same missing state is not established.An unrelated observation from the same runs, in case it matters to #1147 or #1160:
X2W_FAKE_USERanswers every user-interface method with0x0, including methods where the desktop expects the out-argument filled. That is exactly the shape you flagged, and our runs cannot tell whether the factory above is reading one of those unfilled outputs.Imported from R0Y00/Xbox2Windows. Originally posted by rasptum on 2026-11-24T06:16:51Z.
Progress, and a correction to this issue's framing: on Windows 10 the null read is not caused by the user privilege queries. They just precede it.
Cause, measured on the RTX 3060 / Windows 10 19045 setup above:
CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED | SAMPLER_HEAP_DIRECTLY_INDEXED(0xC00).D3D12SerializeVersionedRootSignature(reached through thed3d12_xsstand-in) returnsE_INVALIDARG.0x68about 75 s in.X2W_D3D12_PERMISSIVE=1), the same run continues past that point to the first-run menus. That's the only change.Fix, two parts, in one commit:
f32b22f2on rasptum/startup/win10-root-flags, on currentmain.0xC00and remembers, per returned blob, which bits it removed.s_load through s10 holding None.PR to follow once I've added a source-built check for the retry.
On the GTX 1660 SUPER report above: Windows 11's runtime accepts these flags, so that stop is probably a second, different cause in the same phase rather than this one.
AI-assisted (Claude Code).
Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-24T07:19:26Z.
Taking this, since it is the wall every run hits before the loading screen and I have a reproducible setup (offline stand-ins, view-heap clamp on main, 4/4 pipelines translated, run stops at the same instruction every time).
Plan, following the issue's own starting point: log the output arguments of the user-interface methods 19 and 20 and of the second provider's \QueryApiImpl\ calls, so an \S_OK\ with an untouched out-pointer is visible rather than guessed. Then dump the faulting object and walk its callers to name which factory returned NULL, and report whether the missing answer is a privilege value or a provider that never resolves.
One measured fact that narrows this: the stop is not adapter-specific — an RTX 3060 (your report) and a GTX 1660 SUPER (mine) stop at the same place, at ~74 s and ~85 s respectively, with the same 0x10-offset read through a NULL object and no desktop call failing. I will describe results in terms of the components tested and not attach dumps or logs containing executable addresses.
AI-assisted (Claude Code).
Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-24T07:21:46Z.
Follow-up with one correction to this issue's hypothesis, and a question about which way to take the fix.
Correction: the two user-interface methods this issue suspects do write their outputs. With
X2W_FAKE_USER=1both are implemented and fill the out-arguments:XUserGetAgeGroup) writes3(adult) to its out pointer;XUserCheckPrivilege) writeshas = trueanddeny reason = 0, and returnsS_OK.So "an
S_OKwith an untouched out-pointer" is not what happens on those two paths. Both write, and both were answered that way in every failing run I have. That removes the first suspect and points at whatever the factory gates on downstream of them.What I can see of the mechanism (reported as component behaviour, no addresses attached): the NULL is produced by the executable's own code, not by the runtime. A factory routine returns NULL after an internal boolean check fails; its caller passes that NULL straight into a helper that tests it and takes the soft-assert path, and the fault is a second-chance read through the NULL object when the assert is stepped over. Nothing on the desktop side failed in the same runs — I had every failed HRESULT through the device stand-in's forwarding paths logged, and the only one was
CreateCommandSignature(0x80070057), which is turned into a placeholder and is not on this path.Independent of adapter: RTX 3060 stops at ~74 s, GTX 1660 SUPER at ~85 s, same instruction, same null object, so this is not a timing or GPU quirk. It also survives all the view-heap and pipeline changes (clamp on main, 4/4 pipelines translated, 5,378 translated draws before the stop).
The question: which follow-up do you want, and is this already known?
I have no working x64 disassembler locally, so I would rather instrument the stop than guess at the call target. If you would prefer this stays with you and only wants the measurements, that is fine too — say so and I will stop here rather than open a PR.
The log path also stops before the loading screen, so anything you can tell me about what the factory is expected to have by then shortens this a lot.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T07:39:29Z.
Thanks for confirming both methods write their documented outputs. Please continue with observation first. A small source-built trace of the public stand-in calls, their return codes and whether an output was populated would be useful. On the two affected runs, compare the last successful provider call and the first downstream failure before the assertion. Keep build identifiers and a short call sequence, and leave addresses and raw traces local. If no provider call fails, record that result and keep the factory condition open. The current evidence does not establish a missing privilege or save response.
Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-24T07:47:24Z.
Observation done, as asked. Short answer: no provider call fails in the whole run, and the last thing before the assertion is a successful-but-not-
S_OKpoll that repeats thousands of times.How the trace was built. An opt-in switch (
X2W_TRACE_API=1) in the proxy dispatch logs one line per provider call: provider id, method slot, return code, whether the answer came from the stand-in or the real runtime, and which of the pointer-shaped arguments was written (compared by snapshotting arguments 1-8 before the call and re-reading after, so a write is seen rather than assumed). It is a small source-built change; I have not opened a PR for it because you asked for observation first — say the word and it goes up.Result over a full run to the assertion (GTX 1660 SUPER, Windows 11 build 26200, 11,478 provider calls):
0x80000000or above). Not one, across every provider.37e56907::slot2returned0x000000015,587 times and37e56907::slot15was answered locally 5,511 times; the last ~20 calls before the stop are that pair alternating. So the assertion is reached immediately after a poll that succeeded withS_FALSE, not after any failure.One hypothesis, explicitly not established: if the factory gates on
hr == S_OK, aS_FALSE(0x00000001) answers "not ready" while still being a success code, which would produce exactly the NULL-returning bool you would expect from the observed NULL. That fits the evidence and no failing call contradicts it, but the trace alone cannot show the comparison.One shape worth naming, also not confirmed: 30 calls answered by the real runtime returned
S_OKwith no sampled argument changed (073b7dcb::slot29,::slot6,::slot3). That is the "success without an output" pattern, but a call with no out-argument among arguments 1-8 cannot be judged by this method, so I am not calling those empty.Caveat on the method:
out=nonemeans none of the pointer-shaped arguments among 1-8 changed. Calls that pass handles and sizes rather than pointers cannot be assessed this way, which is why 5k successful calls showout=noneand it is not itself a finding.Per your instruction: since no provider call fails, I am recording that result and keeping the factory condition open. The question I would like answered to go further: is
37e56907::slot2expected to returnS_FALSEpermanently once its queue is empty, and does the caller treatS_FALSEas success? IfS_FALSEis the gate, the fix is on our side (answerS_OKor the expected item) rather than engine-internal.Addresses and raw traces stayed local; only provider ids, slots, codes and the call sequence are above.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T07:57:11Z.
Thanks for the follow-up. The repeated S_FALSE/S_OK pair narrows the trace, and the return codes alone do not establish which condition causes the null. Please keep the real provider result intact. The next useful evidence is a typed, source-built poll that distinguishes ready with an item, empty/not ready, and failure, plus the documented return and output contract if you can identify the interface. A small optional logging PR is welcome if it records declared outputs only and avoids reading arbitrary pointer-shaped arguments. Keep the factory diagnosis open until a call and the consuming condition can be tied together.
Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-24T08:04:51Z.
The optional logging PR you welcomed is up: #1324,
X2W_TRACE_API=1, one line per provider call with the return code, whether the answer came from the stand-in or the real runtime, and which declared output argument was written. It reads only the outputs in a small contract table (user add result, id, guest flag, state, gamertag buffer and used count, age group, privilege result and deny reason, connectivity hint); a slot with no declared contract reportsout=?and nothing is read. The real provider result is left intact — nothing overrides or rewrites it.One correction to my previous comment. My "5,555 successes with no sampled argument changed" figure should be withdrawn. With declared outputs, the connectivity hint reports
unchanged3,400 times simply because its four words are constant, so a repeat call leaves identical bytes. "Unchanged" is therefore not evidence that an output was skipped, and that number cannot be read as "anS_OKwith an untouched out-pointer". The new line distinguishes the cases per call instead of leaving it to be inferred.Interface identification, which you asked for: the poll pair is provider
37e56907-2f10-41e8-b72f-36edb185331a, interfacebf2346b2-39af-4658-b5ea-44713c7e83b3.none, cost unknown,initializedset — the "stack initialized, no connectivity" answer already in the code.S_FALSE(0x00000001) there — 5,587 times in the last run, immediately before the assertion.So the typed poll you asked for is the next step and the trace now gives it what it needs: a fixture that asks this interface for connectivity and distinguishes ready-with-item / empty-not-ready / failure, comparing what the real runtime returns for slot 2 against what our hint claims for slot 15.
What I still cannot state from the code is what slot 2 is meant to mean. If you can name the interface method, I will pin the documented return and output values into the fixture rather than inferring them from the code, which is the difference between "we saw S_FALSE" and "S_FALSE here means X".
Keeping the factory diagnosis open, as instructed: the trace ties the last call before the assertion to a
S_FALSEpoll, but has not tied that call to the consuming condition inside the factory.Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-24T08:30:03Z.
One experiment on the gate, since it is cheap and it changed the number: reporting full internet connectivity instead of "none" (level 3 in the hint words, everything else unchanged) moved the stop from 84-86 s to 106.36 s, at the same instruction, with the same NULL object and the same
0x10read.So connectivity state is a factor in how fast the run gets there, but it is not the gate: the assertion still fires, just later. That fits the S_FALSE poll loop being a wait rather than the trigger, and it means answering "connected" alone will not get past this.
I have reverted the experiment; nothing is committed. If it is useful I can keep it as a switch (for example
X2W_CONNECTIVITY=none|local|internet) so the two timings stay comparable across runs, but I did not want to add a knob with no confirmed meaning.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T08:44:27Z.
Thanks for reverting the timing experiment. The same failure at a later time is useful evidence. Please keep the connectivity override out of the diagnostic PR. Once the typed trace is available, prioritize the return that feeds the null-consuming branch and record its expected success/failure and output contract in a source-built control. A poll-loop frequency or a changed startup time alone cannot identify that producer.
Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-24T09:08:51Z.
Before building the typed trace, an observation that changes this issue's premise: the null-consuming branch no longer fires on current main.
On
c4966c64(which includes#1294 gpu/startup-slot57-blend-hookup) the title now runs past the old stop repeatedly:fac6a522)+0x6eb759after 84–86 s, NULL object,0x10readAnd it is not merely surviving: the flow now reaches the UI.
ACCOUNT PICKER→CONTINUE→UI TEXT SIZE→NAVIGATION EXPERIENCE→LEGAL NOTICES, with correct text rendering (the blend hookup in #1294 is what fixed the glyphs), navigable with A. So the factory that returned NULL either has been fixed or is no longer reached, and theS_FALSEconnectivity poll pair that preceded it is not followed by the assertion any more.Two points for the plan you set:
c4966c64" until someone sees it again.I would rather flag that than build a fixture that exercises a branch the current build never takes.