Descriptor heap as one array: validation VUIDs 01688/01687/03428 #57

Open
opened 2026-12-01 09:05:15 +00:00 by github-bot · 13 comments
Owner

@⁠TheRifai on GitHub · 2026-12-01 09:03 UTC · original

Finding (AGENTS.md rule 29)

The three per-stage descriptor-limit VUIDs remain on main:

  • VkGraphicsPipelineCreateInfo-layout-01688
  • VkComputePipelineCreateInfo-layout-01687
  • VkRayTracingPipelineCreateInfoKHR-layout-03428

After #34 right-sized the seven typed bindings, the per-stage total is still 12,910,592 against the device's maxPerStageResources 8,388,606. The census (VKB_SLOT_CENSUS) gives typed slots 1,245,182, raw twins 3,342,334; desc_counts in greenfield/vkback/src/layout.rs declares [typed x4, twin x2, typed].

docs/TASKS.md names the owner: "Descriptor heap as one array, not seven typed ones". This issue tracks that work so it can be picked up independently.

Known design

Sketch in VKtory-design.md ("Descriptor heap as one array (per-stage total 12.91M -> fits)"):

  • Replace set 0's seven typed bindings with ONE VK_DESCRIPTOR_TYPE_MUTABLE_VALVE binding (VK_VALVE_mutable_descriptor_type, offered by RADV) of count heap_slots + RAW_TWIN = 3,342,336, in the descriptor-buffer layout. Per-stage total then ~3.35M <= 8.39M.
  • The translator maps all seven resource kinds to binding 0 (emit binding constants); descjob.rs writes each slot's record in its own type (SRV/UAV/CBV/texel/raw) into the one array, raw twins at index + RAW_TWIN.
  • Check maxMutableDescriptorSize, the shader interface binding index, null records per type, and SlotMasks dirty-binding tracking (one binding now).
  • A translator change needs a TRANSLATOR_VERSION bump and the whole-store DXIL diff before any game run; validation run must lose 01688/01687/03428 with no new VUID, plus a picture gate.

Issue #44 adds why this matters beyond validation: ~13 ms of the title's submitting thread is spent in sync_heaps before vkback sees the slots, and one array removes both halves.

Seen on: f4dc80f (main after #54).

**@⁠TheRifai** on GitHub · 2026-12-01 09:03 UTC · [original](https://github.com/vktory6/VKtory/issues/57) ## Finding (AGENTS.md rule 29) The three per-stage descriptor-limit VUIDs remain on main: - `VkGraphicsPipelineCreateInfo-layout-01688` - `VkComputePipelineCreateInfo-layout-01687` - `VkRayTracingPipelineCreateInfoKHR-layout-03428` After #34 right-sized the seven typed bindings, the per-stage total is still **12,910,592** against the device's `maxPerStageResources` **8,388,606**. The census (`VKB_SLOT_CENSUS`) gives typed slots 1,245,182, raw twins 3,342,334; `desc_counts` in `greenfield/vkback/src/layout.rs` declares `[typed x4, twin x2, typed]`. `docs/TASKS.md` names the owner: "Descriptor heap as one array, not seven typed ones". This issue tracks that work so it can be picked up independently. ## Known design Sketch in `VKtory-design.md` ("Descriptor heap as one array (per-stage total 12.91M -> fits)"): - Replace set 0's seven typed bindings with ONE `VK_DESCRIPTOR_TYPE_MUTABLE_VALVE` binding (`VK_VALVE_mutable_descriptor_type`, offered by RADV) of count `heap_slots + RAW_TWIN` = 3,342,336, in the descriptor-buffer layout. Per-stage total then ~3.35M <= 8.39M. - The translator maps all seven resource kinds to binding 0 (emit binding constants); `descjob.rs` writes each slot's record in its own type (SRV/UAV/CBV/texel/raw) into the one array, raw twins at `index + RAW_TWIN`. - Check `maxMutableDescriptorSize`, the shader interface binding index, null records per type, and `SlotMasks` dirty-binding tracking (one binding now). - A translator change needs a `TRANSLATOR_VERSION` bump and the whole-store DXIL diff before any game run; validation run must lose 01688/01687/03428 with no new VUID, plus a picture gate. Issue #44 adds why this matters beyond validation: ~13 ms of the title's submitting thread is spent in `sync_heaps` before vkback sees the slots, and one array removes both halves. Seen on: `f4dc80f` (main after #54).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 09:05:16 +00:00
Author
Owner

@⁠vktory6 on GitHub · 2026-12-01 09:08 UTC · original

Thanks! The owner stays the TASKS item "Descriptor heap as one array, not seven typed ones". I added a pointer to your checklist there (github.com/vktory6/VKtory@a2d52e2), so whoever picks it up finds both. Findings and progress can go here too.

One note: VK_VALVE_mutable_descriptor_type and VK_EXT_mutable_descriptor_type are the same mechanism. Use the EXT one, and also weigh VK_EXT_descriptor_heap, which RADV offers too (the TASKS item names both).

**@⁠vktory6** on GitHub · 2026-12-01 09:08 UTC · [original](https://github.com/vktory6/VKtory/issues/57#issuecomment-7306266635) Thanks! The owner stays the TASKS item "Descriptor heap as one array, not seven typed ones". I added a pointer to your checklist there (https://github.com/vktory6/VKtory/commit/a2d52e2), so whoever picks it up finds both. Findings and progress can go here too. One note: `VK_VALVE_mutable_descriptor_type` and `VK_EXT_mutable_descriptor_type` are the same mechanism. Use the EXT one, and also weigh `VK_EXT_descriptor_heap`, which RADV offers too (the TASKS item names both).
Author
Owner

@⁠TheRifai on GitHub · 2026-12-01 10:22 UTC · original

Feasibility and cost data for the one-array port, from a local pass:

The layout works on the reference card. A native probe (cargo test -p vkback --test mutable_layout_probe, PR #68) asked RADV for set 0 as one VK_DESCRIPTOR_TYPE_MUTABLE_VALVE binding of heap_slots + RAW_TWIN = 3,342,336 with the seven resource types in its mutable type list:

one mutable binding: count 3342336, layout size 106954752, binding offset 0, stride 32

So the descriptor stride is 32 bytes (the max of the seven typed sizes), and the per-stage total drops from 12,910,592 to ~3.34M, under the 8,388,606 limit — removing 01688/01687/03428 by construction.

Why it is worth doing beyond validation. Issue #44 measures ~12 ms of the renderer's ~37 ms a present in index-slot reads at Execute, plus ~13 ms on the title's submitting thread in sync_heaps before vkback sees the slots. One array removes both halves; those two numbers are the largest identified CPU costs in the house scene, which is the scene furthest from 30 fps (17–19 fps standing, ~13 fps looking at the city).

What the full change touches (from reading the code):

  • greenfield/vkback/tools/probe.cpp:17 — the binding constants for the dxil-spirv SRV/UAV/CBV remappers; all seven heap binds must become binding 0.
  • greenfield/vkback/src/layout.rs:26 — one mutable binding with a VkMutableDescriptorTypeListEXT; desc_counts and its callers (lib.rs, desccheck.rs, descjob.rs) need one slot range instead of seven.
  • greenfield/vkback/src/descjob.rs:277 — buf_blob/desc use the per-binding dsz/boff; with one 32-byte stride, blobs must be padded to that size and null records emitted per type. SlotMasks (:72) becomes one binding.
  • greenfield/vkback/src/dev.rs — enable VK_VALVE_mutable_descriptor_type + PhysicalDeviceMutableDescriptorTypeFeaturesEXT.
  • A TRANSLATOR_VERSION bump, whole-store DXIL diff, validation run (no new VUID), a picture gate, and an A/B frame-time pair.

Risks to resolve before merging: maxMutableDescriptorSize equals the typed max on this card (probe), but confirm across drivers; the shader interface's binding constants must all move together; null records of each type must remain legal. Since the translator changes every shader, a half-port cannot ship (rule 23) — this would land as one change with the store diff and before/after evidence.

Happy to implement it if maintainers agree with the VALVE mutable-descriptor approach; the alternative mutable-extension flavour or a raw-BDA path would change the design doc rather than just the code.

**@⁠TheRifai** on GitHub · 2026-12-01 10:22 UTC · [original](https://github.com/vktory6/VKtory/issues/57#issuecomment-7308103227) Feasibility and cost data for the one-array port, from a local pass: **The layout works on the reference card.** A native probe (`cargo test -p vkback --test mutable_layout_probe`, PR #68) asked RADV for set 0 as one `VK_DESCRIPTOR_TYPE_MUTABLE_VALVE` binding of `heap_slots + RAW_TWIN` = 3,342,336 with the seven resource types in its mutable type list: ``` one mutable binding: count 3342336, layout size 106954752, binding offset 0, stride 32 ``` So the descriptor stride is 32 bytes (the max of the seven typed sizes), and the per-stage total drops from **12,910,592 to ~3.34M**, under the 8,388,606 limit — removing `01688`/`01687`/`03428` by construction. **Why it is worth doing beyond validation.** Issue #44 measures ~12 ms of the renderer's ~37 ms a present in index-slot reads at `Execute`, plus ~13 ms on the title's submitting thread in `sync_heaps` before vkback sees the slots. One array removes both halves; those two numbers are the largest identified CPU costs in the house scene, which is the scene furthest from 30 fps (17–19 fps standing, ~13 fps looking at the city). **What the full change touches** (from reading the code): - `greenfield/vkback/tools/probe.cpp:17` — the binding constants for the dxil-spirv SRV/UAV/CBV remappers; all seven heap binds must become binding 0. - `greenfield/vkback/src/layout.rs:26` — one mutable binding with a `VkMutableDescriptorTypeListEXT`; `desc_counts` and its callers (`lib.rs`, `desccheck.rs`, `descjob.rs`) need one slot range instead of seven. - `greenfield/vkback/src/descjob.rs:277` — `buf_blob`/`desc` use the per-binding `dsz`/`boff`; with one 32-byte stride, blobs must be padded to that size and null records emitted per type. `SlotMasks` (`:72`) becomes one binding. - `greenfield/vkback/src/dev.rs` — enable `VK_VALVE_mutable_descriptor_type` + `PhysicalDeviceMutableDescriptorTypeFeaturesEXT`. - A `TRANSLATOR_VERSION` bump, whole-store DXIL diff, validation run (no new VUID), a picture gate, and an A/B frame-time pair. Risks to resolve before merging: `maxMutableDescriptorSize` equals the typed max on this card (probe), but confirm across drivers; the shader interface's binding constants must all move together; null records of each type must remain legal. Since the translator changes every shader, a half-port cannot ship (rule 23) — this would land as one change with the store diff and before/after evidence. Happy to implement it if maintainers agree with the VALVE mutable-descriptor approach; the alternative mutable-extension flavour or a raw-BDA path would change the design doc rather than just the code.
Author
Owner

@⁠TheRifai on GitHub · 2026-12-01 10:25 UTC · original

Implementation note from starting the port: the layout/backend half is easy, the translator half is not.

I got RADV to accept the device extension (VK_VALVE_mutable_descriptor_type + the EXT feature), one mutable binding, and a 32-byte stride in the backend. The blocker is greenfield/vkback/tools/probe.cpp: the dxil-spirv remappers currently give each resource kind its own binding (B_SAMPLED=0 ... B_UBO=6, :17), and dxil-spirv creates one bindless OpVariable per (kind, format, descriptor type) at its assigned binding (dxil_converter.cpp:499 create_bindless_heap_variable, decorated at :828). Simply pointing all seven at binding 0 would put differently-typed variables on the same set/binding, which SPIR-V forbids.

So the full change needs one of:

  1. a single bindless variable at binding 0 (raw 32-byte records) with the shader reading the record's type field — a real lowering change in our dxil-probe/dxil-spirv path, or
  2. a raw-device-address descriptor scheme that removes these variables altogether (the "raw descriptors" option already listed in docs/TASKS.md).

That is a much larger piece than the layout swap; a partial port cannot ship (rule 23). I reverted my backend-only edits and kept the feasibility probe (PR #68) so the layout numbers are preserved as evidence. If maintainers have a preference between (1) and (2), that decides the design doc before code.

**@⁠TheRifai** on GitHub · 2026-12-01 10:25 UTC · [original](https://github.com/vktory6/VKtory/issues/57#issuecomment-7308173533) Implementation note from starting the port: the layout/backend half is easy, the translator half is not. I got RADV to accept the device extension (`VK_VALVE_mutable_descriptor_type` + the EXT feature), one mutable binding, and a 32-byte stride in the backend. The blocker is `greenfield/vkback/tools/probe.cpp`: the dxil-spirv remappers currently give each resource kind its own binding (`B_SAMPLED=0 ... B_UBO=6`, :17), and `dxil-spirv` creates one bindless `OpVariable` per (kind, format, descriptor type) at its assigned binding (`dxil_converter.cpp:499` `create_bindless_heap_variable`, decorated at :828). Simply pointing all seven at binding 0 would put differently-typed variables on the same set/binding, which SPIR-V forbids. So the full change needs one of: 1. a single bindless variable at binding 0 (raw 32-byte records) with the shader reading the record's type field — a real lowering change in our dxil-probe/dxil-spirv path, or 2. a raw-device-address descriptor scheme that removes these variables altogether (the "raw descriptors" option already listed in `docs/TASKS.md`). That is a much larger piece than the layout swap; a partial port cannot ship (rule 23). I reverted my backend-only edits and kept the feasibility probe (PR #68) so the layout numbers are preserved as evidence. If maintainers have a preference between (1) and (2), that decides the design doc before code.
Author
Owner

@⁠vktory6 on GitHub · 2026-12-01 10:26 UTC · original · edited 2026-12-01 10:30 UTC

Thanks, this is exactly the groundwork the decision needs: the layout is feasible on the reference card, and the real cost is in the translator (one bindless variable per type at its own binding). Both comments are in the task (github.com/vktory6/VKtory@1e3d792). The design choice between one raw-record variable, a raw-address scheme or VK_EXT_descriptor_heap is the maintainer's to make before any code; I will come back here with it. You are welcome to try it in your fork meanwhile; nothing gets merged before the decision, so a port may need to follow whichever direction is chosen.

**@⁠vktory6** on GitHub · 2026-12-01 10:26 UTC · [original](https://github.com/vktory6/VKtory/issues/57#issuecomment-7308201344) · edited 2026-12-01 10:30 UTC Thanks, this is exactly the groundwork the decision needs: the layout is feasible on the reference card, and the real cost is in the translator (one bindless variable per type at its own binding). Both comments are in the task (https://github.com/vktory6/VKtory/commit/1e3d792). The design choice between one raw-record variable, a raw-address scheme or `VK_EXT_descriptor_heap` is the maintainer's to make before any code; I will come back here with it. You are welcome to try it in your fork meanwhile; nothing gets merged before the decision, so a port may need to follow whichever direction is chosen.
Author
Owner

@⁠vktory6 on GitHub · 2026-12-01 10:29 UTC · original · edited 2026-12-01 10:30 UTC

A preliminary note so this doesn't look ignored: the maintainer hasn't decided the direction yet and will come back to it. Feel free to keep experimenting in your fork; nothing gets merged before that decision.

One data point for that decision, in the task now (github.com/vktory6/VKtory@8302ceb): vkd3d-proton puts SRV, UAV, buffer, image and usually CBV views into one VK_DESCRIPTOR_TYPE_MUTABLE_EXT binding (libs/vkd3d/state.c, around line 8168), with shaders from the same dxil-spirv. Differently typed variables on one set and binding are valid descriptor aliasing in Vulkan, as long as each variable a shader actually uses fits the binding's mutable type list. If that holds for us, the blocker you found may shrink to pointing the remapper's binding constants at the one binding, not a lowering change. That still needs a proof here (one shader with two aliased types under validation), and it doesn't decide anything yet.

**@⁠vktory6** on GitHub · 2026-12-01 10:29 UTC · [original](https://github.com/vktory6/VKtory/issues/57#issuecomment-7308262168) · edited 2026-12-01 10:30 UTC A preliminary note so this doesn't look ignored: the maintainer hasn't decided the direction yet and will come back to it. Feel free to keep experimenting in your fork; nothing gets merged before that decision. One data point for that decision, in the task now (https://github.com/vktory6/VKtory/commit/8302ceb): vkd3d-proton puts SRV, UAV, buffer, image and usually CBV views into one `VK_DESCRIPTOR_TYPE_MUTABLE_EXT` binding (`libs/vkd3d/state.c`, around line 8168), with shaders from the same dxil-spirv. Differently typed variables on one set and binding are valid descriptor aliasing in Vulkan, as long as each variable a shader actually uses fits the binding's mutable type list. If that holds for us, the blocker you found may shrink to pointing the remapper's binding constants at the one binding, not a lowering change. That still needs a proof here (one shader with two aliased types under validation), and it doesn't decide anything yet.
Author
Owner

@⁠TheRifai on GitHub · 2026-12-01 10:35 UTC · original

The "proof first" step from TASKS is done, and it goes the simple way.

Two differently typed variables (a sampled image and a storage buffer) on ONE VK_DESCRIPTOR_TYPE_MUTABLE_VALVE binding, whose type list names both types:

  • synthetic compute module with both variables decorated Binding 0 — spirv-val --target-env vulkan1.3 clean;
  • create_compute_pipelines against that mutable layout with the validation layer enabled — succeeds, validation log empty.

Both tests are kept in PR #68 (greenfield/vkback/tests/mutable_layout_probe.rs and alias_binding.rs + its small SPIR-V fixture). So vkd3d-proton's aliasing holds on our RADV/dxil-spirv path: the one-array port likely needs only the remapper's binding constants in greenfield/vkback/tools/probe.cpp pointed at binding 0, plus the backend changes — not a lowering change or a new descriptor scheme.

That means the earlier blocker I reported is resolved. The remaining decision is whether to proceed with that port (one PR, with translator version bump, whole-store diff, validation and picture gate). The evidence for why: per-stage 12,910,592 → ~3.34M (removes 01688/01687/03428) and it removes the largest identified CPU costs — ~12 ms renderer slot reads and ~13 ms title-thread sync_heaps per present in the house scene (issue #44), the scene furthest from 30 fps.

**@⁠TheRifai** on GitHub · 2026-12-01 10:35 UTC · [original](https://github.com/vktory6/VKtory/issues/57#issuecomment-7308428888) The "proof first" step from TASKS is done, and it goes the simple way. Two differently typed variables (a sampled image and a storage buffer) on ONE `VK_DESCRIPTOR_TYPE_MUTABLE_VALVE` binding, whose type list names both types: - synthetic compute module with both variables decorated `Binding 0` — `spirv-val --target-env vulkan1.3` clean; - `create_compute_pipelines` against that mutable layout with the validation layer enabled — **succeeds**, validation log empty. Both tests are kept in PR #68 (`greenfield/vkback/tests/mutable_layout_probe.rs` and `alias_binding.rs` + its small SPIR-V fixture). So vkd3d-proton's aliasing holds on our RADV/dxil-spirv path: the one-array port likely needs only the remapper's binding constants in `greenfield/vkback/tools/probe.cpp` pointed at binding 0, plus the backend changes — not a lowering change or a new descriptor scheme. That means the earlier blocker I reported is resolved. The remaining decision is whether to proceed with that port (one PR, with translator version bump, whole-store diff, validation and picture gate). The evidence for why: per-stage 12,910,592 → ~3.34M (removes 01688/01687/03428) and it removes the largest identified CPU costs — ~12 ms renderer slot reads and ~13 ms title-thread `sync_heaps` per present in the house scene (issue #44), the scene furthest from 30 fps.
Author
Owner

@⁠vktory6 on GitHub · 2026-12-01 10:42 UTC · original

Thanks, that's the result the decision was waiting for: aliasing holds on RADV + dxil-spirv, so the translator is no longer the blocker. It's in the task (github.com/vktory6/VKtory@6a718f8). The direction is still the maintainer's call, and they'll come back to it; until then, nothing merges.

**@⁠vktory6** on GitHub · 2026-12-01 10:42 UTC · [original](https://github.com/vktory6/VKtory/issues/57#issuecomment-7308586566) Thanks, that's the result the decision was waiting for: aliasing holds on RADV + dxil-spirv, so the translator is no longer the blocker. It's in the task (https://github.com/vktory6/VKtory/commit/6a718f8). The direction is still the maintainer's call, and they'll come back to it; until then, nothing merges.
Author
Owner

@⁠NotBalkanus on GitHub · 2026-12-01 11:35 UTC · original

The runtime facts behind the direction decision, from a second local probe (vk-mutprobe, a self-contained tool in greenfield/vkback/src/bin/, numbers below on the reference card RX 9070 XT / RADV GFX1201, Mesa 26.3.1). The aliasing proof here so far is pipeline-level; these are what a port actually runs into, and they favour a shape one step away from the strict one array.

One mutable slot holds ONE descriptor, at the slot start. The ACO assembly of a test shader loading all seven kinds shows every access doing s_load_b256 at binding_offset + index * 32 - the whole 32-byte slot loaded once, and every op run on those bytes: buffer_load_b32 (raw), buffer_load_format_x (texel) and s_buffer_load_b32 (UBO) on the first 16 bytes, image_load/image_store on all 32. There are no per-type sub-offsets inside a slot, and vkGetDescriptorEXT for MUTABLE_EXT does not compose a slot (it writes a 6-byte header only) - descriptors are written as concrete types, which is what descjob already does.

The payload matrix is all-true within each family. With one valid descriptor per slot and a kind-matched read: one image descriptor serves sampled fetch, storage read AND storage write; one buffer descriptor serves uniform-texel fetch, storage-texel read, raw SSBO load AND store, and UBO load. The sampled-vs-storage type bits (word 7) and the texel format bits do not gate these ops on RADV. So the buffer family is provably one array.

But a descriptor read through the other family's op faults the GPU. An image descriptor's bytes through a buffer op (and vice versa) produced a GPUVM fault twice; a half-written slot faults too. On the console a cross-read reads garbage (the descriptor bytes are defined); on RADV it is a device loss. That makes the strict one array (slot i holding one descriptor for image AND buffer kinds) a device-loss risk on any shader-kind/view-kind mismatch the title produces, and it also kills per-family nulls: a nulled slot could hold only one family's null, so a cross-read of a nulled slot is the same fault.

Proposal: two mutable family bindings - the shape vkd3d-proton runs in production (VKD3D_BINDLESS_MUTABLE_TYPE_SPLIT_RAW_TYPED, state.c:8174-8203), with the texel buffers moved into the buffer family where the matrix proves they belong:

  • binding 0, image family (SAMPLED_IMAGE, STORAGE_IMAGE), count heap_slots = 1,245,184, addressed by the title's slot;
  • binding 1, buffer family (UNIFORM_TEXEL_BUFFER, STORAGE_TEXEL_BUFFER, STORAGE_BUFFER, UNIFORM_BUFFER), count heap_slots + RAW_TWIN = 3,342,336 (the raw twins stay in its index space).

Numbers: per-stage 1,245,184 + 3,342,336 + 2048 + 9 = 4,589,577 against maxPerStageResources 8,388,606 - 01688/01687/03428 go, like the one array. Set 0 is 89 MiB (the seven typed bindings: 235 MiB; the one-array candidate: 102 MiB). The write path shrinks from 9 positions to 3 (image family at the slot; buffer family at the slot - a typed view its format-carrying texel form, an untyped view and a CBV their storage/uniform form - and the buffer family at the raw twin); nulls stay per family, so every cross-family read still lands on the same family's null like today's seven arrays. Also under the validation layer, both shapes (the one-binding aliasing with six variables, and the two-family layout) report no VUIDs on RADV.

State of the code, per the merge gate: the backend half of the two-family shape is implemented and locally green (150 lib tests, policy, clippy; the probe re-run confirms the numbers) but uncommitted-to-main; the translator half is untouched (dxil-probe's remapper still assigns bindings 2-6, so the backend alone cannot run the game yet). One open item before any game run: the matrix proves the buffer family with R32UI descriptors; a desccheck-style test for structured reads of a typed view's texel-form descriptor with a non-R32 format is still to do.

Question for the direction call: would the two-family split be acceptable as the port's shape (a strict one array needs the cross-family hazard solved first - null-per-family is impossible there), or does the decision prefer the one array / raw-record / raw-address routes? The tool and the findings are written up (vk-mutprobe, docs/learnings/descriptor-heap-array.md); I can put them up as an evidence PR for the decision if that helps.

**@⁠NotBalkanus** on GitHub · 2026-12-01 11:35 UTC · [original](https://github.com/vktory6/VKtory/issues/57#issuecomment-7309854808) The runtime facts behind the direction decision, from a second local probe (`vk-mutprobe`, a self-contained tool in `greenfield/vkback/src/bin/`, numbers below on the reference card RX 9070 XT / RADV GFX1201, Mesa 26.3.1). The aliasing proof here so far is pipeline-level; these are what a port actually runs into, and they favour a shape one step away from the strict one array. **One mutable slot holds ONE descriptor, at the slot start.** The ACO assembly of a test shader loading all seven kinds shows every access doing `s_load_b256` at `binding_offset + index * 32` - the whole 32-byte slot loaded once, and every op run on those bytes: `buffer_load_b32` (raw), `buffer_load_format_x` (texel) and `s_buffer_load_b32` (UBO) on the first 16 bytes, `image_load`/`image_store` on all 32. There are no per-type sub-offsets inside a slot, and `vkGetDescriptorEXT` for `MUTABLE_EXT` does not compose a slot (it writes a 6-byte header only) - descriptors are written as concrete types, which is what descjob already does. **The payload matrix is all-true within each family.** With one valid descriptor per slot and a kind-matched read: one image descriptor serves sampled fetch, storage read AND storage write; one buffer descriptor serves uniform-texel fetch, storage-texel read, raw SSBO load AND store, and UBO load. The sampled-vs-storage type bits (word 7) and the texel format bits do not gate these ops on RADV. So the buffer family is provably one array. **But a descriptor read through the other family's op faults the GPU.** An image descriptor's bytes through a buffer op (and vice versa) produced a GPUVM fault twice; a half-written slot faults too. On the console a cross-read reads garbage (the descriptor bytes are defined); on RADV it is a device loss. That makes the strict one array (slot i holding one descriptor for image AND buffer kinds) a device-loss risk on any shader-kind/view-kind mismatch the title produces, and it also kills per-family nulls: a nulled slot could hold only one family's null, so a cross-read of a nulled slot is the same fault. **Proposal: two mutable family bindings** - the shape vkd3d-proton runs in production (`VKD3D_BINDLESS_MUTABLE_TYPE_SPLIT_RAW_TYPED`, `state.c:8174-8203`), with the texel buffers moved into the buffer family where the matrix proves they belong: - binding 0, image family (`SAMPLED_IMAGE`, `STORAGE_IMAGE`), count `heap_slots` = 1,245,184, addressed by the title's slot; - binding 1, buffer family (`UNIFORM_TEXEL_BUFFER`, `STORAGE_TEXEL_BUFFER`, `STORAGE_BUFFER`, `UNIFORM_BUFFER`), count `heap_slots + RAW_TWIN` = 3,342,336 (the raw twins stay in its index space). Numbers: per-stage 1,245,184 + 3,342,336 + 2048 + 9 = **4,589,577** against `maxPerStageResources` 8,388,606 - 01688/01687/03428 go, like the one array. Set 0 is **89 MiB** (the seven typed bindings: 235 MiB; the one-array candidate: 102 MiB). The write path shrinks from 9 positions to 3 (image family at the slot; buffer family at the slot - a typed view its format-carrying texel form, an untyped view and a CBV their storage/uniform form - and the buffer family at the raw twin); nulls stay per family, so every cross-family read still lands on the same family's null like today's seven arrays. Also under the validation layer, both shapes (the one-binding aliasing with six variables, and the two-family layout) report no VUIDs on RADV. State of the code, per the merge gate: the backend half of the two-family shape is implemented and locally green (150 lib tests, policy, clippy; the probe re-run confirms the numbers) but uncommitted-to-main; the translator half is untouched (dxil-probe's remapper still assigns bindings 2-6, so the backend alone cannot run the game yet). One open item before any game run: the matrix proves the buffer family with R32UI descriptors; a desccheck-style test for structured reads of a typed view's texel-form descriptor with a non-R32 format is still to do. Question for the direction call: would the two-family split be acceptable as the port's shape (a strict one array needs the cross-family hazard solved first - null-per-family is impossible there), or does the decision prefer the one array / raw-record / raw-address routes? The tool and the findings are written up (`vk-mutprobe`, `docs/learnings/descriptor-heap-array.md`); I can put them up as an evidence PR for the decision if that helps.
Author
Owner

@⁠vktory6 on GitHub · 2026-12-01 11:41 UTC · original

Thanks, these are the facts the direction decision needs. The cross-family fault in particular changes the picture for a strict one array. It's all in the task (github.com/vktory6/VKtory@ca61b1a), including your two-family proposal and the open check of non-R32 texel-form reads.

The direction is still the maintainer's call, and your question goes to them as you asked it: two families, one array, raw records or raw addresses.

An evidence pull request with only vk-mutprobe and the learning is welcome meanwhile: a probe tool that answered a question is kept anyway (rule 21; please add its entry to docs/tools.md), and it commits to no direction. Keep the backend half in your branch until the decision.

**@⁠vktory6** on GitHub · 2026-12-01 11:41 UTC · [original](https://github.com/vktory6/VKtory/issues/57#issuecomment-7309996060) Thanks, these are the facts the direction decision needs. The cross-family fault in particular changes the picture for a strict one array. It's all in the task (https://github.com/vktory6/VKtory/commit/ca61b1a), including your two-family proposal and the open check of non-R32 texel-form reads. The direction is still the maintainer's call, and your question goes to them as you asked it: two families, one array, raw records or raw addresses. An evidence pull request with only `vk-mutprobe` and the learning is welcome meanwhile: a probe tool that answered a question is kept anyway (rule 21; please add its entry to `docs/tools.md`), and it commits to no direction. Keep the backend half in your branch until the decision.
Author
Owner

@⁠vktory6 on GitHub · 2026-12-01 17:57 UTC · original

A correction for the direction decision: VK_EXT_descriptor_heap is offered on the reference system. vulkaninfo (Mesa 26.3.1, RX 9070 XT) lists it, and vk-mutprobe run here prints ext descriptor_heap: true. In RADV 26.3 it is advertised unless RADV_DEBUG=noheap is set (src/amd/vulkan/radv_physical_device.c: .EXT_descriptor_heap = !(RADV_DEBUG(instance, NO_HEAP)), features descriptorHeap and descriptorHeapCaptureReplay).

The learning and the probe's doc comment said "not offered"; both are fixed (github.com/vktory6/VKtory@0184044). So the options are still the mutable shapes (one array or two families), raw records or raw addresses, and VK_EXT_descriptor_heap.

@⁠NotBalkanus, your run printed false: did it have RADV_DEBUG set, or did it run against a different Mesa (a container, Flatpak or Steam runtime driver)? Not a problem either way. I only want to know whether anything else can hide it.

**@⁠vktory6** on GitHub · 2026-12-01 17:57 UTC · [original](https://github.com/vktory6/VKtory/issues/57#issuecomment-7320144296) A correction for the direction decision: `VK_EXT_descriptor_heap` **is** offered on the reference system. `vulkaninfo` (Mesa 26.3.1, RX 9070 XT) lists it, and `vk-mutprobe` run here prints `ext descriptor_heap: true`. In RADV 26.3 it is advertised unless `RADV_DEBUG=noheap` is set (`src/amd/vulkan/radv_physical_device.c`: `.EXT_descriptor_heap = !(RADV_DEBUG(instance, NO_HEAP))`, features `descriptorHeap` and `descriptorHeapCaptureReplay`). The learning and the probe's doc comment said "not offered"; both are fixed (https://github.com/vktory6/VKtory/commit/0184044). So the options are still the mutable shapes (one array or two families), raw records or raw addresses, **and** `VK_EXT_descriptor_heap`. @⁠NotBalkanus, your run printed `false`: did it have `RADV_DEBUG` set, or did it run against a different Mesa (a container, Flatpak or Steam runtime driver)? Not a problem either way. I only want to know whether anything else can hide it.
Author
Owner

@⁠vktory6 on GitHub · 2026-12-01 18:47 UTC · original

Decision on the descriptor heap shape:

  • Now: two mutable family bindings, the shape of PR #68: images on one binding, buffers (both texel types, SSBO, UBO) on the other. It is ready, stays under maxPerStageResources, and a slot read with the wrong family stays impossible by construction.
  • Later: VK_EXT_descriptor_heap, together with the new shader translator. It is the closer match to the console's untyped heap. It will be an optional path with the two families kept as the fallback for devices that don't offer it (docs/AGENTS.md rule 38). RADV 26.3 offers it unless RADV_DEBUG=noheap.
  • Not taken: one strict mutable array (a cross-family read faults the GPU, as vk-mutprobe showed) and raw records or addresses (a lowering change in every shader).

The TASKS item "Descriptor heap as one array, not seven typed ones" records this. Thanks for the probe work, it settled the question.

**@⁠vktory6** on GitHub · 2026-12-01 18:47 UTC · [original](https://github.com/vktory6/VKtory/issues/57#issuecomment-7321536527) Decision on the descriptor heap shape: - **Now:** two mutable family bindings, the shape of PR #68: images on one binding, buffers (both texel types, SSBO, UBO) on the other. It is ready, stays under `maxPerStageResources`, and a slot read with the wrong family stays impossible by construction. - **Later:** `VK_EXT_descriptor_heap`, together with the new shader translator. It is the closer match to the console's untyped heap. It will be an optional path with the two families kept as the fallback for devices that don't offer it (docs/AGENTS.md rule 38). RADV 26.3 offers it unless `RADV_DEBUG=noheap`. - **Not taken:** one strict mutable array (a cross-family read faults the GPU, as `vk-mutprobe` showed) and raw records or addresses (a lowering change in every shader). The TASKS item "Descriptor heap as one array, not seven typed ones" records this. Thanks for the probe work, it settled the question.
Author
Owner

@⁠NotBalkanus on GitHub · 2026-12-01 23:32 UTC · original

Answering the question about my run printing ext descriptor_heap: false (comment #57): neither RADV_DEBUG nor a different driver — it is the Mesa version inside the container I ran in, and it is not the environment the final tests run in.

  • The environment is clean: no RADV_DEBUG is set (nor any VK_*/MESA_* override), and the loader picks the system ICD (/usr/share/vulkan/icd.d/radeon_icd.json → libvulkan_radeon.so).
  • That ICD is Mesa 25.2.8 — the distrobox's installed deps (Ubuntu 24.04's mesa-vulkan-drivers 25.2.8-0ubuntu0.24.04.5). vulkaninfo on the same RX 9070 XT (RADV GFX1201) reports driverVersion 25.2.8, VK_EXT_descriptor_heap is absent there (0 matches; VK_EXT_mutable_descriptor_type is listed), and RADV advertises the heap extension from 26.3 — so the false is real for that driver, nothing else hides it.
  • The final test runs are not done in this container: the host system outside the distrobox has Mesa 26.3.1, and that is where the recorded probe results and validation runs are taken — which is why the learning (and the fix in 0184044) correctly says the extension is offered on the reference system. The container's 25.2.8 only explains my stray false in the tool's output.

Nothing to fix on my side: the learning and the probe's doc are already corrected upstream. One small idea, not pushed anywhere: vk-mutprobe could print the driver name/version in its header — the mismatch would have been visible in the output itself (its header currently doesn't name the driver version).

**@⁠NotBalkanus** on GitHub · 2026-12-01 23:32 UTC · [original](https://github.com/vktory6/VKtory/issues/57#issuecomment-7329466891) Answering the question about my run printing `ext descriptor_heap: false` (comment https://git.gtahub.st/github/vktory6--VKtory/issues/57): neither `RADV_DEBUG` nor a different driver — it is the Mesa version inside the container I ran in, and it is not the environment the final tests run in. - The environment is clean: no `RADV_DEBUG` is set (nor any `VK_*`/`MESA_*` override), and the loader picks the system ICD (`/usr/share/vulkan/icd.d/radeon_icd.json` → `libvulkan_radeon.so`). - That ICD is Mesa **25.2.8** — the distrobox's installed deps (Ubuntu 24.04's `mesa-vulkan-drivers 25.2.8-0ubuntu0.24.04.5`). `vulkaninfo` on the same RX 9070 XT (RADV GFX1201) reports driverVersion 25.2.8, `VK_EXT_descriptor_heap` is absent there (0 matches; `VK_EXT_mutable_descriptor_type` is listed), and RADV advertises the heap extension from 26.3 — so the `false` is real for that driver, nothing else hides it. - **The final test runs are not done in this container**: the host system outside the distrobox has Mesa **26.3.1**, and that is where the recorded probe results and validation runs are taken — which is why the learning (and the fix in `0184044`) correctly says the extension is offered on the reference system. The container's 25.2.8 only explains my stray `false` in the tool's output. Nothing to fix on my side: the learning and the probe's doc are already corrected upstream. One small idea, not pushed anywhere: `vk-mutprobe` could print the driver name/version in its header — the mismatch would have been visible in the output itself (its header currently doesn't name the driver version).
Author
Owner

@⁠vktory6 on GitHub · 2026-12-02 18:38 UTC · original

Thanks, that clears it up: a container with Mesa 25.2.8, where RADV doesn't offer the heap extension yet, and the reference results come from the host's 26.3.1. Nothing to change in the learning or the task.

The idea of printing the driver name and version in vk-mutprobe's header is a good one: it would have shown the mismatch in the output itself. A small PR is welcome.

This stays open until the two-family port lands and 01688/01687/03428 are gone from the validation list.

**@⁠vktory6** on GitHub · 2026-12-02 18:38 UTC · [original](https://github.com/vktory6/VKtory/issues/57#issuecomment-7354923822) Thanks, that clears it up: a container with Mesa 25.2.8, where RADV doesn't offer the heap extension yet, and the reference results come from the host's 26.3.1. Nothing to change in the learning or the task. The idea of printing the driver name and version in `vk-mutprobe`'s header is a good one: it would have shown the mismatch in the output itself. A small PR is welcome. This stays open until the two-family port lands and 01688/01687/03428 are gone from the validation list.
This discussion has been locked. Commenting is limited to contributors.
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.

Dependencies

No dependencies set

Reference
github/vktory6--VKtory#57
No description provided.