cpp-migration: pass captured heap view types into the in-runtime native compute route (#2958) #3023
Open
opened 2026-11-27 06:16:11 +00:00 by JB2WIN
·
22 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#3023
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 JB2WIN on 2026-11-27T06:16:11Z.
Target branch
cpp-migration. Follow-up to #2908 (#2972), part of #2935.Problem. The in-process native compute route of #2958 (
X2W_NATIVE_SHADERS,src/startup_stubs/d3d12_compute_dispatch.inl) translates slot 67 requests withx2w::translate_compute(read_compute_request(path), 0, true). That call takes noHeapViewContract, so a request that reads a GPU-selected global SRV heap slot is refused on this route, although #2972 can translate it offline when the view types are known.Plan.
classify_global_srv_viewfromsrc/startup_stubs/native_global_srv.h).prepare_direct_computerefuses a contract for non-container requests, andtranslate_computehas no contract parameter).gfx2hlsl.pyfallback.Test. A source-built compute workload through the stand-in that reads a buffer, a 2D texture and an empty slot through a GPU-selected index,
_warp(capability skip where needed) and_hardware, plus a negative control that indexes one slot off.I'm taking it; a PR follows. Environment: Windows 11 build 26200, NVIDIA GeForce RTX 3080, plus WARP.
AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by JB2WIN on 2026-11-27T07:24:34Z.
Update: the first step is #3025.
A census over a local start-up capture (
compile_dxil --refusals, 2,689 slot 67 requests, counts only) gives 941 first refusals of this kind. In those programs the heap index is read from buffer data per wave, so the runtime cannot resolve it at Dispatch. Behind the contract there are more walls:buffer_load_format_*) through the heap descriptor. With 1 done in a local prototype, 906 requests stop here.I'll continue with 2 next unless someone else is on it.
AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by JB2WIN on 2026-11-27T07:47:10Z.
Runtime acceptance criteria for stage 3 (from R0Y00's review of #3025). Before the runtime supplies a raw-view contract for GPU-selected slots, its fixture must check both of these:
num_records * stride), read through the byte-address rewrite;#3025 does not cover either: its descriptor words stay symbolic.
AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by JB2WIN on 2026-11-27T09:15:58Z.
Step 2a is #3034 (builds on #3025): formatted loads (
tbuffer_load_format_*) through the byte-address rewritten descriptor, table or GPU-selected heap slot, now read the same raw view as the raw load.Additions to the stage-3 runtime acceptance criteria from that change:
getDimensions), not with the guest window's byte count. The runtime must create the raw view for a GPU-selected heap window with exactly the guest window's byte count (num_records * max(stride, 1)). The startup manifest route already sizes a table window that way.Typed heap loads (
buffer_load_format_*) are the next step and need their own view contract.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by JB2WIN on 2026-11-27T10:27:52Z.
Typed heap loads: #3042 adds
HeapViewContract::typed_dwordfor one-channel 32-bit typed buffer slots (buffer_load_format_xwith anidxenindex through the GPU-selected heap descriptor), with.viewschannel metadata and a fixture section.On the local capture (counts only) the 906 typed heap loads all have that one-channel shape, but with
typed_dwordforced, 895 of those programs then stop at a raw read of another heap slot: they read the heap raw and typed through different selectors. Covering them needs more than one captured selection per dispatch (raw and typed contracts per load class), which I plan as the next step before the runtime contract.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by JB2WIN on 2026-11-27T13:22:04Z.
Translator side of the mixed case is in #3063:
HeapViewContract::raw_and_typed_dwordlets one program read some GPU-selected heap slots raw and others with one-channel typed loads (the kind of each load picks the path)..viewsgainsalso <slot> <type>lines for further selections of the same dispatch (selector word k = selection k).For stage 3 (runtime), additional acceptance points from this step:
alsolines), deduplicated; a slot named twice is refused;raw_bufferconditions hold, for every slot a typed load can select thetyped_dwordconditions; the translator cannot check which index feeds which load.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by RonLogic on 2026-11-28T00:04:54Z.
@JB2WIN I’m checking the ordered compiler prerequisites for retargeting #3063. I’ll start with a narrowly scoped carry of your merged #3034 byte-window MTBUF change onto
main, preserving authorship and rerunning its own controls. I found no openmaincarry in the PR search. The in-process heap contract stays with your existing work here.Imported from R0Y00/Xbox2Windows. Originally posted by RonLogic on 2026-11-28T00:17:19Z.
The first prerequisite is ready for review in #3232. Release and Debug passed the RTX 4070 replay, and the same four tests passed with Agility 1.620.2 and WARP 1.0.22. I have #3042 applied locally on top with its typed-slot replay passing in Release, and will hold its main PR until #3232 lands.
Imported from R0Y00/Xbox2Windows. Originally posted by JB2WIN on 2026-11-28T23:51:15Z.
Taking stage 3, the runtime side, now that the translator steps are open for
main(#3409, #3415). No runtime code writes.viewsyet, socompile_dxilgets no heap view contract for a title request. That leaves the 331 shaders / 4.37 M dispatches of "direct resource-heap load requires the selected GPU slot and its view type" in Leyukaka's latest census refused.The aim of stage 3: when the runtime captures a slot 67 request whose program reads the resource heap at a GPU-selected slot, it also records the selected slot(s) and their view types (the
.viewsformat of #2972/#3042/#3063). The contract then reaches the published and in-process routes. The acceptance points collected above (stride above 1, byte count mismatch, formatted element bounds, mixed selections) are the bar.I'll post the design here before building it.
Environment: Windows 11 26200, RTX 3080 (32.0.16.2124), WARP.
AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by JB2WIN on 2026-11-29T00:25:31Z.
Stage 3 design question before I build anything.
What the runtime has today (
main+ #3409/#3415):publish_compute_request,d3d12_draw.inl, as.c67). Nothing writes.views, andcompile_dxilreads.viewsonly for.cdxcontainer requests. So no title request reaches a heap contract.recordreads the selector back with a fence per dispatch. In a title run that would cost a sync on every dispatch, so I don't plan to copy it.resheap N. The translator proves the per-lane heap index is below N, and the dispatch binds heap records 0..N-1 from the title's view heap, refusing by name if any record is not a usable raw buffer (d3d12_compute_dispatch.inl, theheap_srvsloop). The view type is checked for every record the index can reach, not for one captured selection.Two ways for the C++ direct route:
A. Bounded heap range (the #2861 pattern). The direct translator only accepts a heap read when it can bound the slot index, and publishes the range plus, per load kind, the view type each record in it must have. The dispatch checks every record in the range before it binds, refusing with a name (for example "heap record 5 is a texture, the program reads it raw"). No
.viewsand no readback. It only covers programs whose index is boundable. How many of the 331 that is, I would measure first, before writing the runtime part.B. Per-dispatch selection. Capture the selected slot(s) per dispatch, either via a readback (expensive) or only where the index is a value the runtime already reads from upload memory or root constants (
word_param/root constant cases). Closer to the existing.viewscontract, but it covers a single dispatch, and a different selection later needs its own check.I'd start with A: measure how many of the 331 have a boundable index, then build the translator bound and the runtime record check, each as its own PR with a GPU fixture and controls. @R0Y00, since the contract rules are yours: does A fit what you want for #3023, or should the runtime capture selections (B)?
AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by JB2WIN on 2026-11-29T01:32:29Z.
Superseded: the provenance numbers below are wrong, see the correction further down (issuecomment-7249057172).
Measurement for the question above. Local cohort of 2,689 slot 67 requests,
compile_dxil --refusalson #3415 with temporary, uncommitted diagnostics at the heap refusal. Counts only.The refusal "direct resource-heap load requires the selected GPU slot and its view type" is the first refusal of 1,073 requests:
0xffffffe0. That mask is only 32-byte alignment, so the bound is 134,217,728 records, which in practice means no bound.So Plan A covers nothing here and I'm dropping it.
Where the index comes from (the last scalar write of the offset SGPR before the descriptor load):
s_lshl_b32of an SGPR the program never writes: an entry user-data words_lshl_b32ofs_and_b32s_lshl_b32ofs_mul_hi_u32/s_add_u32/s_or_b32/ other scalar ops603 of 1,053 index the heap with
entry word << 5. The runtime already has that word at dispatch, as a root constant or a table word that it reads for other bindings (pass.compute_constants, theword_parampath). So for those, the exact slot is known on the CPU before the dispatch, with no readback.Revised proposal (a narrow B): the translator accepts a heap descriptor load whose index is
user-data word << 5(later, maybe, simple scalar functions of user data), and publishes which word it is. At each dispatch the runtime reads that word, takes heap recordword, checks its view type against what the program reads (raw / typed, the existingglobal_srv_contractrules), and binds it as that view. If the record doesn't fit, it refuses by name before the dispatch, the same check the.viewsroute does but per dispatch. The 297s_andcases come next, once I see what is masked.@R0Y00 @Leyukaka does this narrow B work for you? I'll start on the translator side under that assumption and won't open a PR before one of you agrees.
AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by JB2WIN on 2026-11-29T01:51:18Z.
Correction to my previous comment: the "603 from an entry user-data word" was wrong. My provenance diagnostic missed the instruction that writes the source SGPR. With a corrected scan (same cohort, same build), the heap index
sN << 5comes from:s_buffer_load_dword{x2,x4,x8,x16}with an SGPR offsets_buffer_load_dword*with an immediate offsets_mov/s_mulMarking root constant SGPRs explicitly confirms it: no heap index in this cohort is a root constant shifted by 5. So the narrow B I proposed (index = root constant) covers almost nothing, and I'm withdrawing it.
What the data does point at: the index is a word the program reads from a constant buffer, mostly at an offset held in an SGPR. The runtime already reads such words at dispatch for
srv <i> buf heap word table <param> <byte> at <x> [rootconst <a> <b> times <n>](#2532). It refuses by name when the word is not in the list's upload memory. Whether these 1,027 match that shape depends on where the SGPR offset comes from (a root constant times a stride, or something GPU-dependent). I'm measuring that next and will post the numbers before proposing anything else.Sorry for the noise.
AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by JB2WIN on 2026-11-29T02:00:18Z.
The measurement I promised (same cohort and build, diagnostics still uncommitted). Of the 1,073 requests first refused at the heap descriptor load:
s_buffer_load_dword*at offset(v_readfirstlane(vN) & mask) * stride, a waterfall over lane valuess_buffer_load_dword*ats_add_u32(s_and_b32(<loaded word>), …)s_buffer_load_dword*at an immediate offsetFor all 998 waterfalls the mask is between 1,024 and 65,535, and the
s_mulk_i32stride is above 16 bytes.What that means for stage 3:
.views, or reading the word on the CPU) does not describe that.heap word table … at <x>runtime line, and only if their constant buffer is in upload memory.So neither A nor a narrow B covers this family. To me it looks like it needs a runtime that guarantees the view type of every record the program can reach. For example, desktop heap records that are always created as the view kind the title described (
note_view). The shader would then read them throughResourceDescriptorHeapand need no per-dispatch selection. That is a bigger design decision than the contract work so far, so I'll leave it for your input, @R0Y00 @Leyukaka, rather than guess. I'm not building anything for stage 3 until then.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-29T02:25:08Z.
The design choice is yours and R0Y00's. I have no data on the runtime side (how the desktop heap records are created), so nothing to add on whether a per-record guarantee is feasible. Two counts from a static trace of the 331 compute programs that stop at this refusal in the #3224 census (
main0614f68c; disassembly only, no build):Use of the descriptor returned by the refused load, i.e. the view kind a guaranteed record would have to be:
Index form: in 6 of the 331 the heap index itself is a per-lane value read through a
v_readfirstlane_b32waterfall and then thes_add_u32address form. In the other 325 it is a word froms_buffer_loadshifted left by 5; I did not trace where that load's offset comes from, so this neither confirms nor contradicts your waterfall count.The same refusal is also the first refusal of 370 of the 543 slot 57 mesh requests in #3416. I have not looked at the index shape of those.
Imported from R0Y00/Xbox2Windows. Originally posted by JB2WIN on 2026-11-29T02:26:11Z.
Thanks @Leyukaka, that count settles the direction for me: 318 of 331 read the selected record as a raw buffer only.
Concrete proposal (C), raw-only first, for @R0Y00 to accept or reject:
note_view, with its desktop destination). For each record that is a buffer view, the twin gets a raw SRV (R32_TYPELESS,RAW) over the same byte range at the same index. Any other record gets a null raw SRV, which reads 0. The twin follows view creation and the descriptor copies the stand-in already tracks..viewscontract. It readsResourceDescriptorHeap[i]from the twin, bound directly indexed (root flag 0x400).Steps would be (1) the twin heap with a fixture that creates, copies and overwrites views; (2) the translator acceptance; (3) a measurement on the census requests. Each would be its own PR. I won't start building before you say whether a twin heap fits the stand-in, since it changes how views are kept.
AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by JB2WIN on 2026-11-29T09:33:20Z.
I'm withdrawing Plan C (https://github.com/R0Y00/Xbox2Windows/issues/3023#issuecomment-7249426271). I measured it before building it, and it unlocks nothing on its own.
I ran
compile_dxil --refusalsonmain(1a0120ba) over the same local cohort of 2,689 compute requests. For the measurement only, requests without a.viewscontract were treated as if a heap twin existed:direct resource-heap load requires the selected GPU slot and its view typea GPU-selected heap slot is read as a raw buffer SRV only, all from atyped_buffer_srvloaddirect indexed descriptor load shape, 328unbound numeric SGPR sN, 164heap byte window loaded inside a loopSo in this cohort:
v_readfirstlane, then the heap load inside the loop), not to how the heap is bound.A heap twin would add runtime work and would not translate a single extra request. The next step is the waterfall loop itself. I'm looking at the 701
direct indexed descriptor load shapecases first and will post what they look like.The cohort is local only and was not committed. The measurement switch was a local
getenvoverride and is not part of any branch.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by JB2WIN on 2026-11-29T09:39:05Z.
Follow-up on the 701
direct indexed descriptor load shaperefusals in theraw_and_typed_dwordrun: all 701 ares_load_dwordx8from the resource heap with a GPU-selected SGPR offset. So they fetch an image descriptor by a GPU value, which is bindless texture access, not a buffer read. The direct path only accepts a GPU-selected heap load of one buffer descriptor (s_load_dwordx4).So for this bucket the blocker is GPU-selected heap textures, not raw versus typed buffers. For a texture,
ResourceDescriptorHeap[i]needs its dimension and format in the shader, and a heap slot can hold any view. A heap twin could still help there, as a texture twin: real views only for slots that match the type the shader declares, null for every other slot. I'll write that up as a design before building anything. The remaining refusals (328unbound numeric SGPR sN, 164heap byte window loaded inside a loop) come after it.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by JB2WIN on 2026-11-29T14:09:11Z.
Measured the bound view heap for the GPU-selected heap texture reads (the 696
s_load_dwordx8cases above). One launcher run (Series X preset, NVIDIA), sampled at the first compute dispatch and at dispatch 4096, with a temporary local counter (not committed):What follows for a design:
CreateDescriptorHeapind3d12_xs_device.cppnotes that the title copies descriptors between heaps with its own memory copies, so tracking API writes alone would miss copies.The direction I'm writing up (local design, nothing built yet): the translated shader reads the 32-byte record at the GPU-selected index from the title heap memory itself, through a raw SRV over that memory (the zero-copy alias
d3d12_memory_srv.inlalready uses). If word 0 is the view token magic and word 1 is a known view id, it indexesResourceDescriptorHeap[base_dim + id]. Otherwise it reads a null slot. The runtime fills one descriptor per view record id of the matching dimension when the record is created (about 5,000 textures in this run, not 1.2M). Copies made by the title are then handled because the shader reads the token that is in memory when it runs. Open points before code: resource lifetime of mirrored ids, the resource state of textures the shader may pick, and whether this belongs in the runtime the way you want it, @R0Y00.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by JB2WIN on 2026-11-29T16:26:06Z.
Result of a local prototype of the texture route, before any more design work. For measurement only, compute
s_load_dwordx8heap loads with an SGPR offset were routed like the pixel heap path, and a placeholderResourceDescriptorHeaphandle stood in for the token lookup. I then rancompile_dxil --refusalson the same 2,689-request cohort (main1a0120baplus the earlierraw_and_typed_dwordoverride):direct indexed descriptor load shape(the 701): gone;unbound numeric SGPR sN: 328 → 837, so about 500 of them stop there right after the texture load;gather through the sampler heap is not translated84,non-contiguous resource descriptor67,invalid pixel heap texture descriptor address55.So the texture route alone translates nothing extra in this cohort either. Two fresh design reviews of the view-id-token design also found gaps in PR 1 (symbol routing, consumer checks, dimension validity). I'm parking stage 3 here and not opening a PR. The measurements above, the heap-size numbers and the view-id-token direction stay on this issue for whoever takes the
unbound numeric SGPRchain next. The prototype was localgetenvswitches only, nothing pushed.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by JB2WIN on 2026-11-29T23:09:26Z.
Status of stage 3 (GPU-selected heap textures in compute). I'm now building PR 1, the translator part only.
The approach changed since my last update. A GPU-selected
s_load_dwordx8from the resource heap reads the 32-byte view token in title heap memory at the guest's own byte address. It checks the magic, the id range and the view dimension per id, and samplesResourceDescriptorHeap[base_dim + id]. A wrong token reads a null slot and bumps a per-wave miss counter. There is no slot mirror and no per-dispatch heap scan. The measured heap has about 1.25 M logical descriptors, of which about 15.5 k hold view tokens. It covers 1D, 2D and 2D array textures with loads,image_sample_l/_lz(literal or fixed sampler-heap samplers),gather4_lzwith a literal sampler, andget_resinfo. A load with any other use keeps today's refusal.PR 1 publishes manifest lines that the runtime reader still refuses by name (
heap token textures are not bound yet), so game runs do not change. The runtime part (a raw view over the bound heap's memory, per-dimension id tables, lifetime, states) is PR 2.@R0Y00, before I start PR 2, are you OK with that runtime outline? It is the one from issuecomment-7257080862, plus 1D and a dims table per view id.
Prerequisites already up: #3500 (image fields), #3524 (fold), #3526 (comparison CLAMP_BORDER). #3076 stage 2a (runtime sampler heap) is in progress.
AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by JB2WIN on 2026-11-30T04:26:48Z.
Measurement after #3544, so the next step goes to the right place. This is my local cohort of 2,689 slot-67 compute requests, counts only, with a temporary diagnostic that is not in any PR.
Why a GPU-selected texture load (
s_load_dwordx8from the heap at an SGPR offset) is still not eligible under #3544's rules. This is the first failing rule per program:s_add_u32address (the buffer route)The 289 case is overly strict: those registers are simply reused by a later table load. As a test I narrowed that rule to an
unboundjoin loss and applied the buffer-route rule per load instead of per program. With both changes, the census barely moves: the heap refusal goes from 1323 to 1320, and 831 compile either way. With the textures handled, these programs stop at their buffer loads through the resource heap (s_load_dwordx4at a GPU-selected offset, or thes_add_u32form). That agrees with @Leyukaka's static count above, where 318 of 331 are raw buffer reads.A follow-up to #3544 that makes image field reads of token textures eligible moves 0 requests. So I'm not opening it for now.
That makes the next lever GPU-selected buffer views through the same token route. The token records also cover buffer views (5,176 buffer records in the measured run), so a raw or typed buffer SRV per view id would be the buffer analogue of the per-dimension texture tables. I'll write that up as a design before building anything. @RonLogic, does this overlap the #3063 retarget work you mentioned above?
AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by lukaslw-lab on 2026-11-30T14:05:37Z.
@JB2WIN, slot 57 mesh programs hit the same GPU-selected heap pattern on the buffer side. It is the largest C++ refusal by refused
DispatchMeshcalls in a 360 s native run (1.13 M; #3416, claimed in #2413). The chain:s_load_dwordx4of a buffer SRV from a root descriptor table (an immediate offset);s_buffer_load_dwordof a dword from it, the selector;s_lshl_b32 … 5, thens_load_dwordx4from the resource heap at that SGPR offset;buffer_load_format_x … idxen: a one-channel typed read.The selector is not masked. A local prototype recognises the chain behind an opt-in
.mslayoutcontract and emitsResourceDescriptorHeap[selector]as aTypedBuffer<U32>read. A source-built fixture covers it, with six refusal controls. It trusts the caller like the #2908typed_dwordcontract, so an unmasked index stays unbounded.I would rather use your token guard than open that: read the token at the guest heap address, check the magic,
id < countand the view type, readResourceDescriptorHeap[base + id], otherwise read a null slot. For a typed buffer, the per-id record would hold the view type plus format or element size, not a texture dimension. Is the buffer route (your 874 programs) already planned on your side? If it is, I'll build the mesh variant on your helpers rather than a parallel one. If it isn't, I can take the typed-buffer check for mesh on top of #3544.Imported from R0Y00/Xbox2Windows. Originally posted by lukaslw-lab on 2026-11-30T15:37:21Z.
@JB2WIN, follow-up to my note above: I went ahead with the mesh side in #3619, translator only, using the same token shape as #3544.
0x56573258, view id, then a per-id kind table. A valid token readsResourceDescriptorHeap[base + id]as a typed U32 buffer; anything else reads the null slot, and the first lane counts a miss.base/count/nullin cbufferb1. They're opt-in (heap_tokensin.mslayout), and native preparation still refuses these programs.On the two top refused mesh programs (#3416), the refusal moves from the heap slot (+0x2a0 / +0x2a8) to
v_readfirstlane_b32(+0x470 / +0x474).When #3544 lands I'll switch to its helpers wherever they fit. The runtime binding for mesh comes next.