startup-d3d12: run compute pipelines that are already desktop DXIL #1434
Open
triggered02 wants to merge 4 commits from
upstream-pr/1441 into main
pull from: upstream-pr/1441
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!1434
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1441"
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 triggered02 on 2026-11-24T11:33:45Z.
First slice of #1412: compute pipelines whose bytecode is publishable to the desktop become real, and
Dispatchrecords them behind an explicit gate.Today compute is inert twice over — the bound compute pipeline is a placeholder and command-list slot 14 is a no-op — so every dispatch is dropped. This change adds the publication path and the recording path, and leaves both inert unless a validated module exists and the gate is on.
What changed
tools/startup/compute_cache.py— publishes a validated compute module under the key the runtime looks it up by (<key>.cs.cso), so the offline retarget/sign/gate step decides usability and the runtime does no bytecode inspection.src/startup_stubs/d3d12_xs_device.cpp, device slot 62 — with render mode on, a validated module is loaded from the shader cache for the container's hash and a realCreateComputePipelineStateis created from it (pRootSignatureunwrapped from the console handle,CachedPSOcleared so a console cached-PSO blob never reaches the desktop runtime). Without a module the result stays a placeholderPipelineState, exactly as before, and the log line says which reason applied.Dispatch) — recorded on the desktop list whenX2W_COMPUTE_DISPATCH=1and the bound pipeline is a real desktop compute pipeline; otherwise slot 14 stays the no-op it has always been.tests/startup_compute_cache_check.py(CTeststartup_compute_cache) — nine checks over the publisher and the key/manifest behaviour.Verified on
e133bf6a(rebased ontoorigin/mainb976e8bc)cmake --preset dev+cmake --build --preset dev --target d3d12_xs_shim(MSVC) → exit 0,d3d12_xs.dlllinks.tests/startup_compute_cache_check.py→ PASS;docs_links_check.py(469 links),bidi_controls_check.py(1739 files),startup_tools_lint_check.py(10 files),dependency_paths_check.py→ exit 0;git diff --checkclean.Not established
<key>.cs.csoand slot-14 recording withX2W_COMPUTE_DISPATCH=1are compile-checked by CI, not measured.startup_compute_binding_trace_warpcovers slot-14 observation with the gate off.readable_window/upload_from_titlefallback has no compute equivalent, so a title-memory window read is refused where graphics accepts it.X2W_COMPUTE_DISPATCHis undocumented and sampled once inbuild_tables()at device creation.The fixture shader built from checked-in HLSL through
DXC_EXECUTABLE, published with the existing validator/signer (tools/dxil_retarget.py::sign_container→root_probe --sign), plus the two-arm readback (zero forwarded dispatches and an unchanged UAV after the fence; exact words including untouched sentinels) is the next change, not this one.Refs #1412, #1975.
AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T11:36:20Z.
Review: CHANGES_REQUESTED
Please keep the production dispatch path pending the source-built GPU readback already called out in the PR. The classifier checks only that the initial signature is readable, then reads the whole scan range, so it must validate the entire inspected range before touching it. The byte scan also accepts incidental DXIL text and rejects incidental xbox. metadata, and it can miss names outside the fixed prefix. Use a structurally checked container and the existing validated final-module path from #584. Keep the bound-pipeline check specific to compute, and exercise an unresolved/invalid artifact with zero recorded desktop dispatches followed by a normal accepted dispatch with nonzero UAV readback.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T11:38:15Z.
Review: COMMENTED
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
dbebfbc6b8ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T11:52:43Z.
Review: COMMENTED
Reviewed commit
94731520e15f4f90587b22a44ef1597a9827ae74(git diff origin/main...HEAD).Checks
python3 tests/docs_links_check.py,python3 tests/bidi_controls_check.py, andgit diff --check origin/main..HEADpassed. Title-neutrality clean.--preset dev):startup_compute_dxil_check,d3d12_xs_shim,startup_stub_consumerbuilt (26.61s);ctest -R '^(startup_compute_dxil|startup_stubs)$'2/2 passed (startup_compute_dxil0.02s,startup_stubs0.52s)./O2(--preset release): built (39.27s); 2/2 passed (startup_compute_dxil0.01s,startup_stubs0.37s).Findings
src/startup_stubs/compute_dxil.h:48:if (readable && !readable(code, 4)) return false;only checks the first 4 bytes, while the loop reads up tolimit = bytes < 0x40000 ? bytes : 0x40000. If a caller passes a buffer readable for 4 bytes but unmapped/shorter beforelimit,std::memcmpwill read past the readable region. Checkingreadable(code, limit)(after computinglimit) fixes this, andtests/startup_compute_dxil_check.cppcan cover it with a callback that accepts4bytes and rejectslimit.src/startup_stubs/compute_dxil.h:51-56: Scanning raw bytes up to0x40000means a container larger than 256 KiB with"xbox."past0x40000will passdesktop_dxil(and fall back viaCreateComputePipelineStatefailure), and a non-DXIL payload containing"DXIL"or"xbox."could false-positive/false-negative. Worth either parsing the DXBC part table or noting the0x40000bound as a pre-filter.CachedPSOforwarding insrc/startup_stubs/d3d12_xs_device.cpp:compute.CachedPSO = desc->CachedPSO;forwards any title-supplied cached PSO blob to desktopCreateComputePipelineState. ZeroingCachedPSO({}) avoids passing a console cached blob to the desktop runtime.startup_compute_dxilandstartup_stubsverify the classifier and DLL exports;device_create_compute_pipeline_x'sCreateComputePipelineStatepath itself is not exercised by an end-to-end test here (as noted in the PR description).Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T11:33:53Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
dbebfbcℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-24T11:38:35Z.
Taken, and the first part is already pushed as
94731520: the production dispatch path is now inert — the slot 14 installation and the handler are removed, so placeholder compute behaviour is exactly what it was. I will not re-add it until the source-built GPU readback exists and shows a dispatch landing.On the classifier you are right on all three counts, and the byte scan was the weak part:
bytes— so it must validate the whole inspected range before touching it, which it does not;DXILtext and rejects any incidentalxbox.text, so a string in metadata decides the outcome;Replacement I intend to build, in this order:
X2W_SHADER_CACHElayout graphics already uses,<key>.cs.cso), build a real pipeline only when that artifact is present, and otherwise keep the placeholder with the reason "no validated module". The structural check then happens once, in the tool, not per run in a hot path.tools/probe_roots.pyalready does this), run the module through the existing validated-module path, and emit the artifact only for modules that pass — no byte scanning anywhere.pipeline_realflag I used.I have removed the unsound classifier from this branch's runtime path rather than leaving it in with a note, because leaving it would keep the objection open. The classifier test file goes with it until it tests the structural path instead.
I will report back with the artifact layout, the structural-check results and the fixture's two arms; if the cache-based design is not what you want for the runtime side, say so before I build the tool, since that choice decides where the validation lives.
Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-24T11:42:34Z.
Both findings are correct; here is where each stands after the rework.
P1 — bind compute root state before recording dispatch. Correct and not covered by this branch: a real compute PSO still needs
SetComputeRootSignatureand theSetComputeRoot*slots, which are separate from the graphics setters mapped inbuild_tables()and currently fall through totrap_slot(or are dropped underX2W_D3D12_LIST_NOOP=1). Since the dispatch installation is reverted in94731520, nothing can currently reach that state — but the point stands for the follow-up: the compute root setters have to be mapped and forwarded before a dispatch can be recorded, otherwise the pipeline builds and the dispatch still cannot run. I am treating it as a prerequisite for re-adding slot 14, not as a separate issue.P2 — probe the full bytecode span before scanning. Correct, and it is why the byte-scan classifier is gone rather than patched: a 4-byte probe followed by raw
memcmpacross up to 256 KiB can fault on a descriptor whose declared length runs into an unmapped page. The replacement design removes the scan entirely — device slot 62 will look up an offline-validated artifact for the container key and either build from those bytes (which came from a validated file, bounded by its own length) or keep the placeholder. No runtime byte inspection, so no scan span to validate.Both are recorded against the rework: compute root bindings first, then the validated-artifact lookup, then the two-arm readback fixture (invalid artifact → zero recorded dispatches, then accepted artifact → nonzero UAV readback).
Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-24T11:53:40Z.
The branch is now at parity with
mainon purpose:493404c4withdrew the byte-scan classifier and its test, and device slot 62 is back to a placeholder, so the approach you objected to is fully gone rather than left in place with a note.Converting this to draft rather than leaving an empty change under review. The rework I will build on this branch, in the order you set:
SetComputeRootSignatureand theSetComputeRoot*slots forwarded to the desktop list (the Codex P1 point: without these a built PSO still cannot dispatch);Marking ready for review when step 4 exists, so the dispatch path is never live without the readback that proves it.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T11:38:15Z.
Code review location:
src/startup_stubs/d3d12_xs_device.cpp; line 1701In
render_mode, a real compute PSO still needsSetComputeRootSignatureand any usedSetComputeRoot*resources or constants set on the command list before dispatch; these methods are separate from the graphics root setters mapped inbuild_tables(), so their slots still hittrap_slotby default or are dropped whenX2W_D3D12_LIST_NOOP=1. A normal compute pass therefore traps before reaching this call or reaches it without valid compute bindings, so this path cannot run real work; route the compute-root methods before forwardingDispatch.Useful? React with 👍 / 👎.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T11:38:15Z.
Code review location:
src/startup_stubs/compute_dxil.h; line 19For a malformed or truncated descriptor whose first 32 bytes are mapped but whose declared
BytecodeLengthextends into an unmapped or guard page, this 4-byte probe passes and the loop below uses rawmemcmpreads across up to 256 KiB. The shim can therefore fault instead of retaining the placeholder; check the entire scanned prefix or probe each read window before scanning.Useful? React with 👍 / 👎.
Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-24T12:23:24Z.
Thanks — and apologies for the churn you reviewed against
94731520: I closed this PR by mistake at 11:54 and have reopened it. The branch has moved on since your review; here is where each finding stands.1. Incomplete readability probe (compute_dxil.h:48) — fixed by removal. The whole byte-scan classifier and its test are withdrawn (
493404c4), not patched: the runtime no longer inspects bytecode at all, so there is no partial probe to widen.2. Byte-scan boundary / 0x40000 pre-filter — same answer. Your point that a
"DXIL"or"xbox."string anywhere in the payload decides the outcome is exactly why it is gone rather than bounded.The replacement is the design R0Y00 asked for: device slot 62 hashes the container the same way the graphics path does (
fnv_bytes, 16 hex digits) and loads<key>.cs.csofromX2W_SHADER_CACHE(d2f05ba0);tools/startup/compute_cache.pyproduces those files by delegating retarget/gate/validate/sign totools/dxil_retarget.py(eca9a67e), so the structural check happens once, offline.startup_compute_cachepins the key in both directions and the refusal path (9/9).3.
CachedPSOforwarding — you were right, and it was still live in the new code. Fixed in6dcb79eb: the compute description now zeroesCachedPSOwith a comment saying why. A console cached blob must not be handed to desktopCreateComputePipelineState.4. No end-to-end coverage of the
CreateComputePipelineStatepath — still true, and it is the remaining work rather than something I am claiming. The production dispatch path stays inert (slot 14 is not installed) until the two-arm fixture exists: an unresolved/invalid artifact must record zero desktop dispatches, then a normal accepted artifact must produce a nonzero UAV readback. Compute root bindings (SetComputeRootSignatureandSetComputeRoot*) have to be forwarded first, since a built PSO still cannot dispatch without them — that is the Codex P1 on this PR and the next thing I am wiring.One note that may matter for the review: the
fnv_bytesseed ind3d12_draw.inlis1469598103934665603, one digit short of the canonical FNV-1a 64 basis (14695981039346656037). The cache is keyed by whatever the runtime computes, so the publisher matches the runtime instead of the spec; worth a deliberate decision some time, since correcting it would invalidate existing cached translations.Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-24T12:32:27Z.
Progress summary, and the fixture design I intend to build next — flagging it before I write it, since the two-arm shape is the condition on this PR.
Landed since your review
d2f05ba0— slot 62 hashes the container withfnv_bytes(same helper and%016llxformat as the graphics path) and loads<key>.cs.csofromX2W_SHADER_CACHE; a hit builds a realCreateComputePipelineState, a miss keeps the placeholder and logsno validated module. No byte inspection anywhere.eca9a67e—tools/startup/compute_cache.pypublishes those files by delegating retarget/gate/validate/sign totools/dxil_retarget.py;startup_compute_cachepins the key in both directions plus the refusal path (9/9).6dcb79eb— tedin7's finding:CachedPSOis zeroed instead of forwarding a console cached blob to desktopCreateComputePipelineState.c9e185a3— compute root bindings. The slot numbers are measured, not inferred: a title run's per-frame command-list census is… 13:35 14:1 … 33:1 34:25 35:2 36:37 … 44:2 …, so the title callsDispatch(slot 14) once per frame, and slots 33/35 sit one below the known graphics twins 34 (SetGraphicsRootSignature) and 36 (descriptor table). Slot 33 →SetComputeRootSignatureand slot 43 →SetComputeRootShaderResourceVieware forwarded. Slot 35 is left unwired because its graphics twin at 36 is not forwarded either — I'd rather ask than invent a convention.Fixture design (the condition for marking this ready)
Two arms, in one test, in that order:
<key>.failand no.cs.cso; withX2W_SHADER_CACHEpointed at that directory the stand-in builds no compute pipeline, and the fixture asserts zero recorded desktop dispatches. This is the arm that proves the placeholder path does not quietly dispatch.compute_cache.pyso the module goes through the real validated path, then bound and dispatched through the stand-in; the fixture copies the UAV to a readback buffer and asserts a nonzero result.I would drive it the way
tests/startup_stream_consumer.cpp+startup_stream_draw_check.pydrive the graphics path (device viaD3D12XboxCreateDevice, list through the stand-in, python-side orchestration and assertions).Two things I want your call on before I build:
compute_cache.pythe right "accepted" arm, or would you rather the fixture write<key>.cs.csodirectly and keep the publisher out of the GPU test?SetComputeRootDescriptorTable): mirror the graphics side (which does not forward tables) or forward compute tables only? The census says the title calls it twice per frame, so silence here is a guess either way.Dispatchitself stays uninstalled until arm 2 passes, so nothing can dispatch in production before the readback proves it.Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-24T13:18:34Z.
The three hard-coded keys check out against the runtime helper — and one thing worth a comment
Independent reviewer, not the author. Reviewed
14352e25; nothing pushed to the branch.Environment: Windows 11 build 26300.9974, MSVC 14.44.35207, SDK 10.0.26100, Python from
out/pe-env.3 of 3 pass, and the two shim compute cases are unchanged (they still report the
size=18446744073709551615 attr=0xa8004000refusal path and exit 17 in that probe, as before this change).
I recomputed the three keys independently
Writing FNV-1a myself with the seed and prime taken from
fnv_bytesinsrc/startup_stubs/d3d12_draw.inl:All three match, so the fixture's hard-coded oracle is the same function the pipeline lookup uses, which is the property
that makes the file name correct rather than merely plausible.
One observation, worth one line of comment
That seed is not the canonical FNV-1a 64 offset basis. Canonical is
14695981039346656037;fnv_bytesuses1469598103934665603, i.e. one digit shorter, andtools/startup/compute_cache.pyinherits it deliberately. It worksfine as an internal key, but it is exactly the kind of constant someone later "corrects" after checking it against a
reference implementation — which would silently invalidate every
.cs.csoand.failfile already on disk.A comment on the C++ default argument saying the value is intentional and shared with the Python tool would remove that
risk. I am not asking for it in this PR; it is equally fine as a follow-up if you prefer.
Verdict
Reviewed
14352e25. Builds clean, the new case passes, the shim compute cases are unaffected, and the key constants areverifiably the runtime's own function rather than a copy of a reference implementation. No objection from me.
Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-24T14:23:12Z.
Taking the readback arm you asked for. Two design points I want to pin down before I build it, because they decide what the fixture can honestly prove on this machine.
What I plan to do. A fixture that drives the shim's console-side objects (not the desktop D3D12 API directly), in two arms on WARP:
X2W_SHADER_CACHEpoints at a directory with no<key>.cs.csofor the container, so slot 62 takes the placeholder path. Bind that pipeline and dispatch, then assert zero desktop dispatches were recorded and that the UAV buffer still reads as the initial contents.origin/main, create the pipeline again (realCreateComputePipelineState), bind, dispatch, and assert nonzero UAV readback with the expected pattern.Question 1 — how should "zero recorded desktop dispatches" be observable? I can add a small counter to the shim and export it (
x2w_d3d12_dispatch_count(), incremented only where the forward toID3D12GraphicsCommandList::Dispatchactually happens). That is direct evidence rather than inferring from the trap log. It adds one export that exists only for this check — is that acceptable, or would you rather the fixture read the existingX2W_TRAP_LOG/diagnostic counters and I infer from those?Question 2 — the accepted arm needs a real accepted module.
tools/startup/compute_cache.pypublishes one by shelling out todxil_retarget.pywith retarget + intrinsic gate + validation + signing. Can the fixture call that tool at test time (it needs the dxc/validator environment the build already sets up), or should the fixture embed a fixed pre-validated.cs.csoas a checked-in test asset? The second is hermetic but means a binary blob in the tree; the first proves the published path end to end but makes the test depend on the toolchain being present.What this will not establish. That the title's own compute shader dispatches correctly, or anything about the game's compute workload — only that this shim refuses an unrecognised artifact without dispatching, and forwards a validated one that writes a UAV. Those are the two behaviours tied to the dispatch gate.
The production dispatch path stays gated on
X2W_COMPUTE_DISPATCH=1and on the bound pipeline having come through slot 62, as it is in this branch.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T22:35:24Z.
Please build the fixture shader from checked-in HLSL with the existing DXC dependency, then run the normal compute-cache publication path using the validator and signer. This covers the deployed artifact path and keeps the fixture source-built. Reuse the existing dispatch accounting or add a counter only in a test build of the shim if the existing diagnostic cannot distinguish a recorded call. The negative arm should assert both zero forwarded dispatches and an unchanged UAV after the fence. The positive arm should compare the exact output, including untouched sentinel words.
Keep the existing opt-in dispatch and slot 62 provenance checks. #1974/#1975 are working on the command-list state and root constants. Please link the fixture or its interface there so we can reuse the same two-arm readback instead of adding a second production slot 14 handler.
Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-25T17:59:52Z.
Understood — the fixture has to exercise the deployed artifact path, not a hand-placed
.cso. Plan for the fixture, keeping your constraints:DXC_EXECUTABLEin the build (no prebuilt blob, no game data), sops_6_0/cs_6_0bytecode is produced by the same toolchain the build already requires..csowrite the slot 67 compute request path uses — and the container is validated and signed the way the tree already does it:tools/dxil_retarget.py::sign_container, which callsroot_probe --sign(dxil.dll) after validation, instead of copying a bytecode file into the cache directory. If any part of the manifest must be hand-built for a fixture-only key, I will say so explicitly in the fixture header rather than hide it.mainfirst — if it distinguishes a recorded dispatch, reuse it; if it cannot, add a counter in a test build of the shim only, never in the shipping path.Two things about the state of this PR:
bcf24db8is CONFLICTING withmain(the conflict list in the review is againstcf97bee1;origin/mainis now1a0e506d). First step is re-creating the branch as one clean commit on currentmain, then building the fixture on top — I will not keep a merge chain in the history.mainnow, while #1975 is still open. For "link the fixture or its interface there so we can reuse the same two-arm readback": I will expose the two-arm readback (UAV sentinel words + forwarded-dispatch count, with the fence) as one reusable helper in the fixture, and link it from #1975. If the intent is instead to hang it off the slot 14 handler's accounting, point me at the symbol you want referenced and I will link that instead of a second interface.I will post the re-created sha here, then the fixture sha with the arm results. If you would rather this wait until #1975 lands the root-constant path, say so and I will hold the rebase until then.
Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-25T18:53:59Z.
Correction to my previous comment, and the rebase result.
My earlier reply described the wrong code. I described a
compute_dxil.hclassifier and atests/startup_compute_dxil_check.cppboundary fixture — neither exists at this branch head (bcf24db8) or in any ref in the fork. This PR's head is the earlier slice: a publisher for<key>.cs.cso, real slot-62 compute-PSO creation from that published module, and slot-14DispatchbehindX2W_COMPUTE_DISPATCH=1; its own CTest isstartup_compute_cache(tests/startup_compute_cache_check.py+tools/startup/compute_cache.py). The PR body described a revision that was never pushed; I have updated the body to describe this head instead of leaving it wrong. Sorry for the noise.Rebased onto
mainb976e8bc, head is nowe133bf6a(wasbcf24db8), MERGEABLE. Four commits replayed:One commit was dropped because
mainsuperseded it:e9ef89af("forward the compute root signature and compute root SRV") replayed empty.mainnow has a richer slot 33 (deferred heap-indexed root + binding trace) and a slot 43 that binds upload-page-backed compute root SRVs after indexed-indirect validation. The PR version also readpass.root(the graphics root set at slot 34) rather than the compute root, so replaying it verbatim would have been a defect. I did not replace it.Conflict resolutions (all in
src/startup_stubs/d3d12_xs_device.cppplus CMake): slot 62 keepsmain'snote_pipeline/note_compute_binding_pipelinecalls and adds the cache load, wrappingreal_pipelineinstead ofnullptrand settingown().compute_pipeline; the PR's parallelcompute_pipeline_realwas dropped becausemain'scompute_pipelinecovers it; slot 14 keepsmain's barrier/root handlers and addslist_dispatchgated onpass.compute_pipeline; the PR's duplicatelist_typed[33]/[43]registrations were removed becausemainalready registers both. TheCachedPSO = {}fix replayed cleanly.CMakeLists.txtkeepsmain'sstartup_live_viewblock and inserts thestartup_compute_cacheCTest beside it.Verified on
e133bf6a:cmake --preset dev+cmake --build --preset dev --target d3d12_xs_shimwith MSVC → exit 0,d3d12_xs.dlllinks, so the rebased slot-62/14 code compiles against currentmain.tests/startup_compute_cache_check.py→ PASS (9 checks),docs_links_check.py(469 links),bidi_controls_check.py(1739 files),startup_tools_lint_check.py(10 files),dependency_paths_check.py→ all exit 0;git diff --checkclean.What CI can and cannot prove here. CI can compile the shim and run
ctest -R '^startup_compute_cache$'(pure Python). There is no device-level fixture in this head for the runtime path — real slot-62 PSO creation from<key>.cs.csoand slot-14 recording withX2W_COMPUTE_DISPATCH=1are unmeasured.startup_compute_binding_trace_warpstill covers slot-14 observation with the gate off.Two real gaps this head leaves, stated rather than hidden: (1) compute root SRVs are limited to upload-page pointers; the graphics slot-44
readable_window/upload_from_titlefallback has no compute equivalent, so a title-memory window read would be refused where graphics accepts it; (2)X2W_COMPUTE_DISPATCHis undocumented and sampled once inbuild_tables()at device creation.What I plan next, unless you want it differently: implement the DXC-built fixture shader and the two-arm readback you asked for (checked-in HLSL compiled by
DXC_EXECUTABLE, published through the normal compute-cache path withtools/dxil_retarget.py::sign_containervalidating and signing viaroot_probe --sign, negative arm zero forwarded dispatches plus unchanged UAV after the fence, positive arm exact words including untouched sentinels), and expose that readback as one reusable helper for #1975. That is what turns this from compile-checked into evidenced. Say if you want the compute root SRV fallback (1) folded into the same change or handled separately.Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-26T03:30:48Z.
Rebased onto current main (
e46d336c); head is nowc7a6ed3a(wase133bf6a). Clean replay.Verified on
c7a6ed3a: startup_compute_cache_check PASS; docs_links_check 523 links; startup_tools_lint_check 11 files; dependency_paths_check; git diff --check clean; diff vs main is the PR's own 4 files (+241/-9). Main's newer slot-14 Dispatch (#1974) is kept and the PR's duplicate registration stays dropped, pipeline_root interop is in place, and the .cs.cso load plus X2W_COMPUTE_DISPATCH gate survive.CI can compile-check this head; the runtime half (real slot-62 PSO from a published module, slot-14 recording) still has no device-level fixture, which the description lists as outstanding.
Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-26T03:32:03Z.
Answering the two Codex findings and @R0Y00's change request against the current head
c7a6ed3a, because the reviewed revision is no longer what this branch contains.P1 � "Bind compute root state before recording dispatch": no longer applies to this head. This branch no longer records a dispatch at all. Main landed #1974 (src/startup_stubs/list_dispatch.h, decide_dispatch) while this PR was in flight, and the rebase dropped this PR's list_dispatch and its list_typed[14] registration as a duplicate � main installs slot 14 unconditionally and its handler already forwards compute-root state. What this PR keeps is the PSO side: it builds the real compute pipeline and sets both own().compute_pipeline and own().pipeline_root, so decide_dispatch's pipeline-root match (pass.compute_pipeline_root, set from slot 33 list_compute_root) has a root to compare. Verifying: grep -n 'list_dispatch|list_compute_root|pipeline_root' src/startup_stubs/d3d12_xs_device.cpp shows one list_dispatch definition (main's), one list_typed[14], and the slot-62 pipeline_root assignment.
P2 � "Probe the full bytecode span before scanning": that file is not in this head. src/startup_stubs/compute_dxil.h does not exist on this branch � the DXIL-classifier design was never pushed here; the head is the earlier cache-publisher slice ( ools/startup/compute_cache.py, .cs.cso load at slot 62). The P2 is a real finding for that future classifier revision, and I have not marked it fixed; it simply has no code to apply to in
c7a6ed3a.@R0Y00's change request � keep the production dispatch path pending the source-built GPU readback: satisfied by construction on this head. Dispatch recording is main's, not this PR's, and the only new runtime behavior is gated: without X2W_COMPUTE_DISPATCH=1 the slot-62 path keeps the placeholder pipeline and no module is loaded, so nothing can dispatch from this PR's change until the readback fixture turns it on. The description's "not established" section lists that fixture as still outstanding.
Verified on
c7a6ed3a: startup_compute_cache_check PASS, docs 523 links, translator/lint/dependency-path checks clean, git diff --check clean; diff vs main is the PR's 4 files (+241/-9).Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-12-01T16:14:55Z.
Taking this over since there has been no activity for 48 h; will hand back if you resume. Your commits stay as they are and keep your authorship; I will rebase onto current
main, address the open review points and report the test results here.Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-12-01T17:42:35Z.
Continued in #3768 (rebased onto
main, review points addressed, local test results in the description). Your commits are kept with your authorship; if you resume, say so there and I will hand it back.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.