startup-runtime: dynamically indexed sampler and resource heap loads #1136

Open
opened 2026-11-24 01:45:31 +00:00 by denn0x · 10 comments
denn0x commented 2026-11-24 01:45:31 +00:00 (Migrated from github.com)
Contributor

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 an
equivalent, 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).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6572713422 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1143). Originally posted by [denn0x](https://github.com/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 an equivalent, 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).
mumba17 commented 2026-11-24 06:50:08 +00:00 (Migrated from github.com)
Author
Contributor

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.

  • Scope: in tools/startup/gfx2hlsl.py, translate a sampler or resource descriptor load whose heap offset is a register (not a constant) into SM 6.6 SamplerDescriptorHeap[...] / ResourceDescriptorHeap[...] access. The index comes from the register value and the descriptor stride. The default-sampler shortcut in pipe.notes is removed for the cases this covers.
  • Fixture: hand-assembled gfx1013 source for a pixel shader that loads its sampler and texture with register offsets, translated and drawn on hardware and WARP. Two descriptors with distinct outputs mean that a wrong index or a default sampler changes the readback. Plus a constant-offset control that must keep its current path.
  • Base: this builds on #1135, so I'll open it once #1135 is in main, or stacked on it if you prefer that.
  • Environment: RTX 3090 (driver 32.0.16.1664) and WARP, Windows 11 build 26300.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7119860814 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1143#issuecomment-7119860814). Originally posted by [mumba17](https://github.com/mumba17) on 2026-11-24T02:12:13Z. --- I'll take this one. No other claim or open PR on it as of 02:30Z. - **Scope:** in `tools/startup/gfx2hlsl.py`, translate a sampler or resource descriptor load whose heap offset is a register (not a constant) into SM 6.6 `SamplerDescriptorHeap[...]` / `ResourceDescriptorHeap[...]` access. The index comes from the register value and the descriptor stride. The default-sampler shortcut in `pipe.notes` is removed for the cases this covers. - **Fixture:** hand-assembled gfx1013 source for a pixel shader that loads its sampler and texture with register offsets, translated and drawn on hardware and WARP. Two descriptors with distinct outputs mean that a wrong index or a default sampler changes the readback. Plus a constant-offset control that must keep its current path. - **Base:** this builds on #1135, so I'll open it once #1135 is in `main`, or stacked on it if you prefer that. - **Environment:** RTX 3090 (driver 32.0.16.1664) and WARP, Windows 11 build 26300. AI-assisted (Claude Code).
Jess-Doit commented 2026-11-24 06:50:09 +00:00 (Migrated from github.com)
Author
Contributor

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_0 shader. 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).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7120096201 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1143#issuecomment-7120096201). Originally posted by [Jess-Doit](https://github.com/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_0` shader. 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).
R0Y00 commented 2026-11-24 06:50:10 +00:00 (Migrated from github.com)
Author
Contributor

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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7120277670 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1143#issuecomment-7120277670). Originally posted by [R0Y00](https://github.com/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.
Jess-Doit commented 2026-11-24 06:50:16 +00:00 (Migrated from github.com)
Author
Contributor

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.

  • Scope, first PR: in tools/startup/gfx2hlsl.py, an s_load from the sampler heap with a register offset becomes a bounded SamplerState array indexed by offset / 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 its pipe.notes entry go.
  • Evidence: a source-built gfx1013 vertex+pixel pair, assembled with 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.
  • Follow-up PR: the stand-in runtime builds the sampler table from the title's sampler-heap entries (decoded like today's static samplers), plus the null-sampler count when an entry can't be read.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7121475629 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1143#issuecomment-7121475629). Originally posted by [Jess-Doit](https://github.com/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. - **Scope, first PR:** in `tools/startup/gfx2hlsl.py`, an `s_load` from the sampler heap with a register offset becomes a bounded `SamplerState` array indexed by `offset / 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 its `pipe.notes` entry go. - **Evidence:** a source-built gfx1013 vertex+pixel pair, assembled with `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. - **Follow-up PR:** the stand-in runtime builds the sampler table from the title's sampler-heap entries (decoded like today's static samplers), plus the null-sampler count when an entry can't be read. AI-assisted (Claude Code).
Jess-Doit commented 2026-11-24 06:50:18 +00:00 (Migrated from github.com)
Author
Contributor

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 1 manifest will add a sampler table at s0, space1 alongside 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).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7121888672 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1143#issuecomment-7121888672). Originally posted by [Jess-Doit](https://github.com/Jess-Doit) on 2026-11-24T04:17:49Z. --- I'll take the stand-in sampler binding for #1143, stacked on #1217. A `smpheap 2048 1` manifest will add a sampler table at `s0, space1` alongside 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).
Jess-Doit commented 2026-11-24 06:50:22 +00:00 (Migrated from github.com)
Author
Contributor

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:

  • They cover the sampler heap only. Resource-heap indexing isn't touched, so that part is yours as planned.
  • They don't use SM 6.6 heap indexing. A register-offset sampler load becomes a bounded 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 FXC ps_5_1 and DXC ps_6_0, so it runs where SM 6.6 SamplerDescriptorHeap[...] 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).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7122434964 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1143#issuecomment-7122434964). Originally posted by [Jess-Doit](https://github.com/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: - They cover the **sampler heap only**. Resource-heap indexing isn't touched, so that part is yours as planned. - They don't use SM 6.6 heap indexing. A register-offset sampler load becomes a bounded `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 FXC `ps_5_1` and DXC `ps_6_0`, so it runs where SM 6.6 `SamplerDescriptorHeap[...]` 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).
R0Y00 commented 2026-11-24 06:50:23 +00:00 (Migrated from github.com)
Author
Contributor

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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7122561646 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1143#issuecomment-7122561646). Originally posted by [R0Y00](https://github.com/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.
denn0x commented 2026-11-24 14:03:26 +00:00 (Migrated from github.com)
Author
Contributor

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.

  • 47 programs (49 of the busy frame's dispatches) stop at 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).
  • Not yet checked: where the offset register comes from. If it is a root constant or a dword loaded from a descriptor table, it is uniform per dispatch.

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).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7133360723 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1143#issuecomment-7133360723). Originally posted by [denn0x](https://github.com/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. - 47 programs (49 of the busy frame's dispatches) stop at `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). - Not yet checked: where the offset register comes from. If it is a root constant or a dword loaded from a descriptor table, it is uniform per dispatch. 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).
triggered02 commented 2026-11-26 04:04:37 +00:00 (Migrated from github.com)
Author
Contributor

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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7181652234 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1143#issuecomment-7181652234). Originally posted by [triggered02](https://github.com/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.
lambirou commented 2026-11-26 11:03:01 +00:00 (Migrated from github.com)
Author
Contributor

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], sOff on 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.

Step Result
Compute requests 2,689
Root signature with the view-heap flag (0x400) 1,653
Sampled (first 28 in key order) 28
First refusal is the resource-heap record 3
Of those, already blocked by 550 / 649 other refusals 2

The one clean sample is 003d3bc18a4f7f5b (root 0x400, resource heap in s[10:11]). Both heap loads have dispatch-uniform offsets:

0038 s_mulk_i32 s9, 0x150            ; s9 is a root constant word (s6..s9 for this root)
003c s_add_u32 s8, s9, 0x120
0048 s_buffer_load_dword s8, s[16:19], s8   ; table 0 descriptor at byte 0x2a0, word at rc*0x150+0x120
005c s_lshl_b32 s8, s8, 5            ; 32-byte descriptor records
0060 s_load_dwordx4 s[20:23], s[10:11], s8

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 first s_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_dxil cohort if you want it.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7189896012 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1143#issuecomment-7189896012). Originally posted by [lambirou](https://github.com/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], sOff` on 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. | Step | Result | | --- | ---: | | Compute requests | 2,689 | | Root signature with the view-heap flag (`0x400`) | 1,653 | | Sampled (first 28 in key order) | 28 | | First refusal is the resource-heap record | 3 | | Of those, already blocked by 550 / 649 other refusals | 2 | The one clean sample is `003d3bc18a4f7f5b` (root `0x400`, resource heap in `s[10:11]`). Both heap loads have **dispatch-uniform** offsets: ```text 0038 s_mulk_i32 s9, 0x150 ; s9 is a root constant word (s6..s9 for this root) 003c s_add_u32 s8, s9, 0x120 0048 s_buffer_load_dword s8, s[16:19], s8 ; table 0 descriptor at byte 0x2a0, word at rc*0x150+0x120 005c s_lshl_b32 s8, s8, 5 ; 32-byte descriptor records 0060 s_load_dwordx4 s[20:23], s[10:11], s8 ``` 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 first `s_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_dxil` cohort if you want it.
Sign in to join this conversation.
No labels
No milestone
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
No description provided.