You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cpp-migration: pass captured heap view types into the in-runtime native compute route (#2958) #3023
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 with x2w::translate_compute(read_compute_request(path), 0, true). That call takes no HeapViewContract, 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.
Record each heap slot's view type when the stand-in creates the SRV (classify_global_srv_view from src/startup_stubs/native_global_srv.h).
At Dispatch, resolve the slots the request can select and build the contract from the recorded types.
Pass the contract into the translation of the slot 67 request (today prepare_direct_compute refuses a contract for non-container requests, and translate_compute has no contract parameter).
Before the Dispatch, check that the live heap still matches the contract; otherwise refuse and keep the gfx2hlsl.py fallback.
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.
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:
Typed loads (buffer_load_format_*) through the heap descriptor. With 1 done in a local prototype, 906 requests stop here.
Runtime: a shader-visible heap with title slot k at desktop index k as raw views, plus a contract check over all selectable slots at Dispatch (one captured slot is not enough for per-wave selection).
I'll continue with 2 next unless someone else is on it.
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:
a selectable slot whose guest descriptor has a stride above 1 (byte count num_records * stride), read through the byte-address rewrite;
a slot whose guest byte count does not match the desktop view: the dispatch must refuse it before the shader runs, not read past or short of the view.
#3025 does not cover either: its descriptor words stay symbolic.
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:
A formatted load bounds its whole element with the desktop raw view's size (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.
The descriptor's DST_SEL (word 3) is not applied; only the identity channel order is translated. The runtime contract should either check identity DST_SEL on every selectable slot or the translator has to apply it.
Typed heap loads (buffer_load_format_*) are the next step and need their own view contract.
Typed heap loads: #3042 adds HeapViewContract::typed_dword for one-channel 32-bit typed buffer slots (buffer_load_format_x with an idxen index through the GPU-selected heap descriptor), with .views channel 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_dword forced, 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.
I'm withdrawing Plan C (#3023 (comment)). I measured it before building it, and it unlocks nothing on its own.
I ran compile_dxil --refusals on main (1a0120b) over the same local cohort of 2,689 compute requests. For the measurement only, requests without a .views contract were treated as if a heap twin existed:
Heap contract assumed
Requests that translate
Next refusal after the heap one
none (main)
487
1073 direct resource-heap load requires the selected GPU slot and its view type
raw_buffer (Plan C as posted)
487
1013 a GPU-selected heap slot is read as a raw buffer SRV only, all from a typed_buffer_srv load
701 direct indexed descriptor load shape, 328 unbound numeric SGPR sN, 164 heap byte window loaded inside a loop
So in this cohort:
most of these requests read their heap slot with a formatted (typed) load, not raw. My earlier "mostly raw" assumption was wrong for them.
even with both raw and typed heap reads allowed, not one more request translates. The next blockers are tied to the per-lane waterfall loop around the heap index (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 shape cases first and will post what they look like.
The cohort is local only and was not committed. The measurement switch was a local getenv override and is not part of any branch.
Follow-up on the 701 direct indexed descriptor load shape refusals in the raw_and_typed_dword run: all 701 are s_load_dwordx8 from 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 (328 unbound numeric SGPR sN, 164 heap byte window loaded inside a loop) come after it.
Measured the bound view heap for the GPU-selected heap texture reads (the 696 s_load_dwordx8 cases 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):
dispatch 1
dispatch 4096
logical descriptors in the bound CBV/SRV/UAV heap
1,245,184
1,245,184
slots holding a registered SRV token: Texture2D
565
2,000
Texture2DArray
6
2,839
other texture dimensions
129
213
buffer SRVs
296
5,176
other views (CBV/UAV)
558
5,286
one full scan of the heap records
12.8 ms
10.3 ms
What follows for a design:
A 1:1 mirror of the title heap is not possible. 1,245,184 is above the desktop shader-visible limit of 1,000,000.
Any per-dispatch walk over the heap costs ~10 ms, so validation at dispatch time is out.
CreateDescriptorHeap in d3d12_xs_device.cpp notes 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.inl already uses). If word 0 is the view token magic and word 1 is a known view id, it indexes ResourceDescriptorHeap[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.
Result of a local prototype of the texture route, before any more design work. For measurement only, compute s_load_dwordx8 heap loads with an SGPR offset were routed like the pixel heap path, and a placeholder ResourceDescriptorHeap handle stood in for the token lookup. I then ran compile_dxil --refusals on the same 2,689-request cohort (main1a0120b plus the earlier raw_and_typed_dword override):
requests that translate: still 487, no change;
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;
smaller next stops: gather through the sampler heap is not translated 84, non-contiguous resource descriptor 67, invalid pixel heap texture descriptor address 55.
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 SGPR chain next. The prototype was local getenv switches only, nothing pushed.
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_dwordx8 from 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 samples ResourceDescriptorHeap[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_lz with a literal sampler, and get_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.
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_dwordx8 from the heap at an SGPR offset) is still not eligible under #3544's rules. This is the first failing rule per program:
Rule
Programs
the same program also reads the heap through an s_add_u32 address (the buffer route)
874
a word of the load's registers is read later with another symbol
289
a token word read by a non-image instruction
34
T# above s105
21
unsupported image op
4
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 unbound join 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_dwordx4 at a GPU-selected offset, or the s_add_u32 form). 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?
@JB2WIN, slot 57 mesh programs hit the same GPU-selected heap pattern on the buffer side. It is the largest C++ refusal by refused DispatchMesh calls in a 360 s native run (1.13 M; #3416, claimed in #2413). The chain:
s_load_dwordx4 of a buffer SRV from a root descriptor table (an immediate offset);
s_buffer_load_dword of a dword from it, the selector;
s_lshl_b32 … 5, then s_load_dwordx4 from 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 .mslayout contract and emits ResourceDescriptorHeap[selector] as a TypedBuffer<U32> read. A source-built fixture covers it, with six refusal controls. It trusts the caller like the #2908typed_dword contract, 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 < count and the view type, read ResourceDescriptorHeap[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.
@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.
Route: a heap descriptor at a GPU-computed byte offset (a value shifted left by 5 or more) is read through its view token: magic 0x56573258, view id, then a per-id kind table. A valid token reads ResourceDescriptorHeap[base + id] as a typed U32 buffer; anything else reads the null slot, and the first lane counts a miss.
Kind value 16 marks a one-channel 32-bit typed buffer. Your dimension table uses 1 + image dimension (at most 8), so one table could serve both routes. Could you keep 16 free for this?
Bindings: token memory and kind table (raw SRVs), a miss UAV, and base/count/null in cbuffer b1. They're opt-in (heap_tokens in .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.
Activity
coordination: claim native/compute-heap-view-contract (R0Y00#3023 hea…
JB2WIN commentedon Nov 27, 2026
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.
JB2WIN commentedon Nov 27, 2026
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.
native: refuse a heap byte window only for a loop around its heap load
coordination: claim native/heap-typed-load (R0Y00#3023 stage 2 typed …
JB2WIN commentedon Nov 27, 2026
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.
native: read the byte-address rewrite of a GPU-selected heap descript…
native: read formatted loads through a byte-address rewritten descriptor
coordination: claim native/heap-typed-dword-load (R0Y00#3023 typed he…
native: read formatted loads through byte-address rewritten descripto…
JB2WIN commentedon Nov 27, 2026
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.
coordination: release native/heap-typed-load (R0Y00#3023 stage 2 type…
native: read single-channel typed buffers from GPU-selected heap slots (
coordination: release native/heap-typed-dword-load (R0Y00#3023 typed …
coordination: claim native/heap-mixed-raw-typed (R0Y00#3023 mixed raw…
12 remaining items
native: read single-channel typed buffers from GPU-selected heap slots (
native: read GPU-selected heap slots raw and typed in one program
JB2WIN commentedon Nov 29, 2026
I'm withdrawing Plan C (#3023 (comment)). I measured it before building it, and it unlocks nothing on its own.
I ran
compile_dxil --refusalsonmain(1a0120b) 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.
JB2WIN commentedon Nov 29, 2026
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.
JB2WIN commentedon Nov 29, 2026
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.
JB2WIN commentedon Nov 29, 2026
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 (main1a0120b plus 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.
coordination: claim native/heap-token-textures (R0Y00#3023 stage 3 PR…
JB2WIN commentedon Nov 29, 2026
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.
coordination: claim native/heap-token-fields (R0Y00#3023 stage 3 PR 1…
JB2WIN commentedon Nov 30, 2026
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.
coordination: claim native/heap-token-buffers (R0Y00#3023 stage 3 PR …
lukaslw-lab commentedon Nov 30, 2026
@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.lukaslw-lab commentedon Nov 30, 2026
@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.
shader: read GPU-selected mesh heap buffers through view tokens