startup-runtime: dynamically indexed sampler and resource heap loads #1136
Open
opened 2026-11-24 01:45:31 +00:00 by denn0x
·
10 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#1136
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 denn0x on 2026-11-24T01:45:31Z.
Problem
Shaders that load a sampler descriptor from the sampler heap with a register offset (not a constant) currently get a
default sampler (recorded in
pipe.notes). Dynamic resource heap indexing has the same gap.Done when
The translator emits
SamplerDescriptorHeap[...]/ResourceDescriptorHeap[...]style access (SM 6.6) or anequivalent, with a fixture, and the default-sampler shortcut is removed.
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 mumba17 on 2026-11-24T02:12:13Z.
I'll take this one. No other claim or open PR on it as of 02:30Z.
tools/startup/gfx2hlsl.py, translate a sampler or resource descriptor load whose heap offset is a register (not a constant) into SM 6.6SamplerDescriptorHeap[...]/ResourceDescriptorHeap[...]access. The index comes from the register value and the descriptor stride. The default-sampler shortcut inpipe.notesis removed for the cases this covers.main, or stacked on it if you prefer that.AI-assisted (Claude Code).
Imported from R0Y00/Xbox2Windows. Originally posted by Jess-Doit on 2026-11-24T02:23:46Z.
I’ll take a source-built desktop check for the sampler half of #1143 (Refs #874). From current main, I’ll bind two distinguishable samplers in one shader-visible descriptor table and select between them at runtime in a
cs_6_0shader. I’ll keep the table and texture fixed, compare exact readbacks on the GTX 1060 and Windows 10 in-box WARP, and force index zero as a control that must lose the index-one result.This measures bounded dynamic sampler selection with the existing desktop runtime and can proceed independently of #1135. It complements #1109’s descriptor table fixture and #1121’s sampler field checks. The startup translator and dynamic resource heap indexing remain follow-ups.
AI-assisted (Codex).
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T02:34:27Z.
The isolated fixed-table check in #1166 already covers distinguishable ordinary and comparison samplers and independent table swaps. Please compare against it before adding a second fixture. A runtime-supplied shader index with a forced-zero counterexample, or an independent GTX 1060/Windows 10 result, would add evidence. The startup translator change can proceed separately with SM 6.6 heap indexing.
Imported from R0Y00/Xbox2Windows. Originally posted by Jess-Doit on 2026-11-24T03:50:45Z.
I'll take the translator half of #1143, sampler heap only; resource-heap indexing stays open. #1192 (Codex) covers the desktop check: a bounded sampler table indexed at run time from a root constant, at SM 6.0 on a GTX 1060 and in-box WARP. This builds on it.
tools/startup/gfx2hlsl.py, ans_loadfrom the sampler heap with a register offset becomes a boundedSamplerStatearray indexed byoffset / 16, instead of the fixed default sampler. The manifest gets a line naming the heap source and range, so the runtime can bind a matching table. The default-sampler shortcut and itspipe.notesentry go.llvm-mc. Its pixel stage loads its sampler through a register offset into the sampler heap. Translated HLSL compiles with FXC (ps_5_1) and DXC. A desktop readback, with the table filled from two distinguishable sampler words, gives the index-0 and index-1 results on the GTX 1060 and WARP. Controls: a constant offset still produces a static sampler, and a mutation that drops the index must fail.AI-assisted (Claude Code).
Imported from R0Y00/Xbox2Windows. Originally posted by Jess-Doit on 2026-11-24T04:17:49Z.
I'll take the stand-in sampler binding for #1143, stacked on #1217. A
smpheap 2048 1manifest will add a sampler table ats0, space1alongside the static samplers. The draw path will track the bound sampler heap, decode its readable 16-byte entries with the existing sampler decoder, and use a valid fallback descriptor and a named null-sampler count for unreadable entries. Each recorded sampler heap will stay alive through queue completion.I'll reuse #1217's source-built shaders and offscreen readback on the GTX 1060 and Windows 10 in-box WARP. The fixture will use the same manifest, root-signature and sampler-population code as the stand-in, with generated wrap and clamp entries and a guarded unreadable entry. I'll also check a manifest with only static samplers. This keeps sampler-heap translation opt-in.
AI-assisted (Codex).
Imported from R0Y00/Xbox2Windows. Originally posted by Jess-Doit on 2026-11-24T04:53:44Z.
@mumba17, apologies: I missed your 02:12 claim on this issue when I claimed the translator half at 04:17. Since then #1217 (
gfx2hlsl) and #1237 (stand-in binding, stacked on #1217) have gone up and overlap your scope. Here is how they differ, so we can fit them together rather than duplicate:SamplerState qh[2048] : register(s0, space1)table, guarded in the shader (offset / 16, with entry 2047 as the fallback for unaligned or out-of-range offsets). It compiles with FXCps_5_1and DXCps_6_0, so it runs where SM 6.6SamplerDescriptorHeap[...]isn't available. It's opt-in (X2W_SAMPLER_HEAP=1), and the default output is unchanged.Your SM 6.6 path would be the natural default on adapters and runtimes that support it, with this table as the fallback. Or, if you're far along on the sampler side and would rather it go one way, tell me and I'll close #1217/#1237 or rework them around your PR. Either is fine with me; I just don't want us both landing the same thing.
AI-assisted (Claude Code).
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T05:02:06Z.
The opt-in sampler table and its stand-in binding are now on main via #1217 and #1237 (
fa414483), including the 16-byte wrapped descriptor stride and the rebind control. The latter was independently retested in Windows Release: 14/14 passed across RTX 4060 Laptop and WARP, including descriptor-paging and stream regressions. Resource-heap indexing and any separate SM 6.6 contribution stay open under the existing claim here.upstream-sync referenced this issue2026-11-24 13:00:54 +00:00
Imported from R0Y00/Xbox2Windows. Originally posted by denn0x on 2026-11-24T13:48:15Z.
Compute data point for this issue. Measured on the 349 gfx1013 compute programs the executable created in one run past start-up, and on the 627 dispatches of one busy frame after loading.
s_load_dwordx4/x8 sD, s[heap], sOff. That is an image or buffer descriptor loaded from the resource heap pointer at a register offset. It is the second-largest compute stop after DPP (#1543).A per-dispatch lowering would cover these without SM 6.6: resolve the offset at record time from the bound root constants or table words, and bind the descriptor it names as an ordinary SRV/UAV.
ResourceDescriptorHeap[]stays the general fallback.Related: #1541 (LDS), #1542 (formatted stores), #1544 (entry layout), #1545 (image stores and atomics), #1546 (small ALU).
AI-assisted (Claude Code).
Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-26T03:21:53Z.
Splitting this into its two halves, since one is done on main and the other is not:
Sampler-heap indexing � done. main has the opt-in X2W_SAMPLER_HEAP=1 table ( ools/startup/gfx2hlsl.py: pipe.uses_sampler_heap, the SamplerState qh[SAMPLER_HEAP_SIZE] : register(s0, space1) binding, the 16-byte wrapped descriptor stride and the rebind control from #1217/#1237). Without the switch, a dynamic sampler index is still replaced by a default sampler and recorded in pipe.notes ("dynamic sampler index replaced by a default sampler"), which is the documented fallback rather than silent behavior.
Resource-heap indexing � still open, exactly as you measured. main has no ResourceDescriptorHeap[...] (or equivalent) access: grepping the translator for ResourceDescriptorHeap returns nothing. So your 47 compute programs stopping at s_load_dwordx4/x8 sD, s[heap], sOff (49 dispatches in the busy frame) are still stopped, and they are the largest remaining compute stop after DPP.
The part of your data that would move this: whether the offset register is uniform per dispatch (root constant or a dword from a descriptor table) decides between a bounded-table lowering and a genuinely dynamic one. If you can capture the source of that register for even a few of the 47 programs, that is the next concrete step; a bounded table indexed by a uniform offset is the cheaper of the two to land.
Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-26T10:49:56Z.
Resource-heap offset uniformity on the cached compute corpus
I measured the source of the register offset behind
s_load_dwordx4 sD, s[heap], sOffon the 2,689 cached compute requests. The cache was produced at shader revision 17; loading it with the current tree (revision 27) needs the revision-17 key, which is only a name check.0x400)The one clean sample is
003d3bc18a4f7f5b(root0x400, resource heap ins[10:11]). Both heap loads have dispatch-uniform offsets:That first load is already lowered by the Python frontend's
heap_record(the manifest names the table, byte and root constant). The second site (0x284) uses the same shape but loses the('rc', …)mark at the firsts_cbranch_execz, so its index becomes an unnameable('buffer',)and the request stops there.So in this sample the answer to the first-step question is uniform per dispatch, not per lane: a root constant times a literal plus a literal, read as a word from a descriptor table, then shifted by five. Nothing here requires a truly dynamic index.
I am not proposing a Python-translator PR while the frontend is moving to the native C++ path. If the 676-request scalar descriptor-load cohort in #870 is the same class, this trace may be useful as a source-of-offset data point; I can run the same producer trace over the
compile_dxilcohort if you want it.