shader: make compile_dxil consume startup requests and publish runtime cache entries #2933
Closed
opened 2026-11-26 21:59:45 +00:00 by sydney-0o
·
4 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#2933
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 sydney-0o on 2026-11-26T21:59:45Z.
Target branch:
cpp-migrationProblem
The startup runtime and its cache tools use revision 28 keys for graphics and compute requests. The C++ reader in
compile_dxil --requestsstill validates revision 14 keys. Graphics requests with existing ASCII.psinmetadata also differ from the native reader's 12-byte binary pixel-entry record. Updating the revision string alone does not align the input and hash formats.The batch CLI writes
req_<key>.csofor compute andreq_<key>.vs.cso/req_<key>.ps.csofor a graphics pair. The runtime looks for<key>.cs.csoor<key>.vs.cso/<key>.ps.csoand a matching<key>.txtmanifest.This was found by source inspection at
7f951fd3. Runtime key writer and graphics cache loader · C++ request reader · Batch CLIDone when
.psinmetadata and a source-built.c67compute request use the current startup request format and keys. Both compile throughcompile_dxil --requestswith the relevant native profile.A simple VS/PS pair is sufficient for the graphics check. Cross-quad WQM and EXECZ behavior is tracked in #2907.
Imported from R0Y00/Xbox2Windows. Originally posted by consolelogkyo on 2026-11-26T22:17:41Z.
Claiming #2933 on
cpp-migration.10.0.26100), MSVC 19.44, Windows SDK10.0.26100.0DXC, AMD Radeon RX 9070 XT (1002:7550, driver32.0.32029.2010) + Microsoft WARP (1414:008c), D3D12 debug layer enabled.src/shader_compute_request.cpp/direct_compute_cache.cppwith the startup runtime's revision-28 graphics (x2w-startup-shader-28+ optional ASCIIpsin1 <key> ena=0x... addr=0x...inreq_<key>.psin) and compute (x2w-startup-shader-28csover.c67,.data,.root,.desc,.sa,.sb) request formats and keys, rejecting key mismatches or stale/malformed.psinfiles without publishing a loadable entry.compile_dxil --requests(tools/startup/compile_dxil.cpp) to publish<key>.cs.csoor<key>.vs.cso/<key>.ps.csoand atomically publish the matching<key>.txtx2w-manifestlast in the format expected by the startup runtime cache loaders (d3d12_draw.inl/d3d12_compute_dispatch.inl)..psin) and compute (.c67) batch publication, runtime cache acceptance without renaming, and mismatched-key / stale-.psinrefusal controls.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by Not-Saii on 2026-11-26T22:34:16Z.
@consolelogkyo I had started reading for this before your claim landed, so here is what I found, in case it saves you the same reading. It is all from the source of
cpp-migrationate97c5c7c. Nothing was built or run, so please check each point against a build.The points that would change the plan:
psin1line does not carry (section 1)..psinpair by its key (section 3). @sydney-0o, what should "the runtime accepts the entries" mean for that pair? One reading: the stand-in accepts a pair without a description, and the.psinpair's files are checked against the loader's line forms.1. Request keys
src/startup_stubs/d3d12_draw.inl) andtools/startup/gfx2hlsl.pysrc/shader_compute_request.cpp)x2w-startup-shader-28cs, then code, data, root, desc, sa, sb, each after its length as a u64 (:495-498,compute_key):77-84). Only the string differs (-14cs).x2w-startup-shader-28, then.a,.b,.root, then.iaif there is one (:374-378). With a description,pipeline_keythen hashesb'psin1'and the two masks as little-endian u32 (gfx2hlsl.py:10950-10959).-14, then a, b, root, ia and the raw bytes of.psin(:52-56).So compute needs the revision string and nothing else. Graphics has more:
part(marker, ".psin", 12)(:51) caps the file at 12 bytes. Apsin1line is 39 bytes or more, so today it fails withmissing or oversized .psinbefore anything is hashed.psin1plus<II(ena, addr), not the bytes of the file.read_ps_inputs(gfx2hlsl.py:11355-11374) shows what to accept: the regex, the key in the line equal to the request's key, and both masks present._init_pixel_context(:10197) also refusesena & ~addr."PSI1", the address mask and an interpolant count (src/gfx1013_compute_native.cpp:1779-1786,src/direct_compute_cache.cpp:543-558).addris the mask word.enahas no place in the native stage model, and the count has no source in apsin1line.:1784-1785zeroes the whole record unless it is0x8080with count 0 or passesraw_center_inputs(:1674-1680). Two things follow::1705-1708), and it bounds thev_interpattribute (:1712). Deriving it from the pixel stage, as the highestv_interpattribute plus one, gives 0 for a stage that interpolates nothing, and the mask is then dropped. Three existing fixtures pass count 1 for such a stage:terminal-discard(tests/native_direct_container_check.py:946) and the twocenter-position-zwcases (:960-963). The other way is to treat a key-verified description as the proof that the entry layout is known, and to bound attributes by the table size of 7 (:1689). The pair linker already refuses a pixel input with no vertex output (:1812-1819).0x8003fromtests/startup_packed_position_provenance_check.pyis one such mask. For the third "Done when" item that should be a named refusal.:1780, the!rawtest). For container requests the description can only be compared with the container's ownpixel_input_address. It cannot be passed down.Every revision-14 key in the tests comes from two helpers:
write_request(tests/native_compute_clear_check.py:16) andpublish(tests/native_direct_container_check.py:167). The other native tests import them. Three call sites pass a binarypixel_entry=(:906,:946,:978).To keep this from drifting again, the fixture could take its keys from
gfx2hlsl.pipeline_keyandcompute_key(imported the waytests/startup_stream_check.pydoes), and a pure-Python check could compare the reader's two literals with the runtime's.tests/startup_gfx2hlsl_fract_check.py:166-174already pinsgfx2hlsl.pyto the runtime like that.2. Output names and the manifest
tools/startup/compile_dxil.cpp:192buildsreq_<key>.cso, and:253-256derivereq_<key>.vs.csoandreq_<key>.ps.csofrom it. The loaders read<key>.txt, then<key>.cs.cso(src/startup_stubs/d3d12_compute_dispatch.inl:75,:158) or<key>.vs.csoand<key>.ps.cso(d3d12_draw.inl:266,:353-354).What each loader needs:
d3d12_compute_dispatch.inl:87-150): first linex2w-manifest 2, second linestage cs,ud Nequal to the number ofudsrclines, and only the line forms listed there. Any other line makes the translation unavailable.smpcandsmpheapare refused by name.d3d12_draw.inl:281-347): at least oneudsrcline, because:347rejects an empty list. A pair with no root constants still needs one. Other unknown lines are ignored.create_translated_root(src/startup_stubs/translated_sampler_bindings.h:117): constants at b0, one table with t0.. followed by u0.., static samplers from s0.tests/native_recording_check.cpp:150already creates a native graphics root with it, so the native register allocation should fit.How the native result maps onto lines, as far as I traced it:
constantsblocks in order (src/gfx1013_direct_compute.inl:226-248). For a.c67request a block is a whole root parameter.udsrc n rootconst <root_parameter> <word>GraphicsConstantLayout, in parameter order (src/gfx1013_compute_native.h:77-93)offset(parameter) + wordbuffer_srvat t_isrv i buf table <root_parameter> <byte_offset>raw_buffer_uavat u_i, compute onlyuav i table <root_parameter> <byte_offset>texture_srvwithimage_dimension1 (I only checked the kind)srv i tex2d table <root_parameter> <byte_offset>samplers[i]smp, orsmplforexplicit_lod, orsmpcforcomparison, with the four wordsThe runtime binds table buffers as raw
R32_TYPELESSviews (d3d12_draw.inl:1281-1291,d3d12_compute_dispatch.inl:424,:433-439). That matches the raw native kinds only. I would refuse to publish, and name the binding, wherever no line is exact:indexed_atomic_uav, which needs two more root constants at b(register+1) (src/native_compute_pipeline.cpp:79-84);array_count > 1;pass.constants[a][b]only forb < 8and passes 0 otherwise (d3d12_draw.inl:2663);I did not trace
raw_vector_srv,byte_window_srv,heap_stride_srvorroot_buffer_srvfar enough to say whether abufline is exact for them.For the publication order,
gfx2hlsl.translate_to(gfx2hlsl.py:11186-11218) is the model: compile both stages under a staging name, withdraw the old manifest, move the stage files, then write the manifest through a temporary file. Today the graphics job writes.vs.csounder its final name before the pixel stage compiles (compile_dxil.cpp:253-256), so a pixel failure leaves half a pair, and an older manifest could pair it with an old pixel stage. On a key or description refusal,translate_requestalso removes a manifest published earlier (:11491-11495).3. Three things that shape the end-to-end fixture
.psin.cached_translationhashes a, b, root and the layout (d3d12_draw.inl:369-391). Nothing undersrc/ortools/produces a first description:shader_cache_rekey.pyonly rewrites an existing one under its new key, and the tests write theirs by hand. A key that includes the masks is therefore one the stand-in never looks up, andstartup_stream_consumercan show acceptance only for a pair without a description.startup_stream_check.container()writesXBCHwith a zero version word.read_guest_shader_containerneeds version 3 and the FSSM slot table (src/guest_shader_container.cpp:104-122), so a consumer round trip needs the containers thatnative_direct_container_check.pybuilds (vertex(),patched_pixel()).d3d12_compute_dispatch.inl:163-167), and a direct compute module declares wave size 32 (src/dxil_module.h:202-207). #2935 reports 4-lane waves on WARP, so I expectpipeline creation failedthere. The compute acceptance check then needs a_hardwarevariant with a capability skip. The graphics loader stops at the root signature, so that half can run on WARP.4. Loaded is not the same as drawn
The draw path was written for the
gfx2hlsl.pyvertex model:pipeline_forsets no input layout (d3d12_draw.inl:941-986), so a pair withvertex_fetchcannot create its PSO.basevertexentry value (:2661,:2739,:2745).rectentry value (:2660).:1741-1743), so it is refused for a 6.6 pair.A native vertex stage reads
SV_VertexIDdirectly, and its rectangle expansion is a separate.gs.csothat the loader never reads. A published native pair can therefore load and still draw wrong for a non-zero start vertex or a rectangle list. That reads to me like the "Graphics through the runtime" item of #2935 and not this issue. It may still be worth refusingvertex_fetchpairs here and saying so in the PR.AI-assisted (Claude Code).
Imported from R0Y00/Xbox2Windows. Originally posted by consolelogkyo on 2026-11-26T23:12:55Z.
Opened https://github.com/R0Y00/Xbox2Windows/pull/2955 for #2933 (verified across all 40
^native_checks on WARP and AMD Radeon RX 9070 XT withX2W_D3D12_DEBUG=1). Thanks @Not-Saii for the detailed notes above — incorporated staged VS/PS bytecode publication and revision-literal pinning in the controls check as well.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by MasterDomino on 2026-11-26T23:23:48Z.
Closed by #2955 (@consolelogkyo), merged into
cpp-migrationase3670100.compile_dxil --requestsnow reads revision-28 requests, including ASCII.psindescriptions, and publishes<key>.{cs,vs,ps}.csoplus a<key>.txtmanifest that the runtime loaders parse. Follow-ups (silent manifest refusals, buffer-array check, a sampler word-1 difference, and drawing native pairs through the runtime) are listed in the #2955 review. AI-assisted.