vkback: probe one mutable descriptor set binding #68

Manually merged
github merged 5 commits from github-bot/gh-68 into gh-pr/68/base 2026-12-01 18:50:11 +00:00 AGit
Owner

@⁠TheRifai on GitHub · 2026-12-01 10:22 UTC · original
TheRifai:vkback-mutable-layout-probe → main · +145 −0 · 3 files · 5 commits · merged 2026-12-01 18:46 UTC

What

A native probe test for issue #57's first design question: can the card make set 0 as one mutable-descriptor binding instead of seven typed ones? It asks for a VK_DESCRIPTOR_TYPE_MUTABLE_VALVE binding of heap_slots + RAW_TWIN with the seven resource types in its mutable type list, then prints the layout size, binding offset and stride. It skips cleanly when the driver does not offer the combination.

This does not change the run's layout, translator or descriptor writer — it is the feasibility evidence for the port, kept as a regression guard per rule 21.

Evidence

On the reference card (RX 9070 XT, RADV 26.3):

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

So the layout is accepted, the descriptor stride is 32 bytes (the max of the seven typed sizes), and one array of 3,342,336 descriptors fits well under maxPerStageResources 8,388,606 — against 12,910,592 today (01688/01687/03428).

cargo test -p vkback --test mutable_layout_probe and cargo clippy -p vkback --test mutable_layout_probe pass.

The remaining work is in greenfield/vkback/tools/probe.cpp (remap all heap bindings to 0), layout.rs (mutable binding), descjob.rs (records into one array, 32-byte stride) and SlotMasks (one binding), plus a translator version bump, whole-store diff, validation and picture gate.

**@⁠TheRifai** on GitHub · 2026-12-01 10:22 UTC · [original](https://github.com/vktory6/VKtory/pull/68) `TheRifai:vkback-mutable-layout-probe` → `main` · +145 −0 · 3 files · 5 commits · merged 2026-12-01 18:46 UTC ## What A native probe test for issue #57's first design question: can the card make set 0 as **one** mutable-descriptor binding instead of seven typed ones? It asks for a `VK_DESCRIPTOR_TYPE_MUTABLE_VALVE` binding of `heap_slots + RAW_TWIN` with the seven resource types in its mutable type list, then prints the layout size, binding offset and stride. It skips cleanly when the driver does not offer the combination. This does **not** change the run's layout, translator or descriptor writer — it is the feasibility evidence for the port, kept as a regression guard per rule 21. ## Evidence On the reference card (RX 9070 XT, RADV 26.3): ``` one mutable binding: count 3342336, layout size 106954752, binding offset 0, stride 32 ``` So the layout is accepted, the descriptor stride is 32 bytes (the max of the seven typed sizes), and one array of 3,342,336 descriptors fits well under `maxPerStageResources` 8,388,606 — against 12,910,592 today (`01688`/`01687`/`03428`). `cargo test -p vkback --test mutable_layout_probe` and `cargo clippy -p vkback --test mutable_layout_probe` pass. The remaining work is in `greenfield/vkback/tools/probe.cpp` (remap all heap bindings to 0), `layout.rs` (mutable binding), `descjob.rs` (records into one array, 32-byte stride) and `SlotMasks` (one binding), plus a translator version bump, whole-store diff, validation and picture gate.
A native test that asks RADV for set 0 as a single VK_DESCRIPTOR_TYPE_MUTABLE_VALVE
binding of heap_slots + RAW_TWIN with the seven resource types in its mutable
type list, and prints the layout size and stride. Skips cleanly on drivers that
do not offer the combination.

Reference card result: accepted, 3,342,336 descriptors, layout 106,954,752 bytes,
binding offset 0, 32-byte stride. That is the feasibility evidence for the
one-array port; it does not change the run's layout.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 10:24:40 +00:00
Author
Owner

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

Thanks! The probe records a useful fact. I am holding it, not merging or closing it, until the design in #57 is decided: if the mutable-binding route is chosen, this becomes the first piece of the port; if a raw-address or descriptor-heap route is chosen, it would test a layout we do not use.

**@⁠vktory6** on GitHub · 2026-12-01 10:26 UTC · [original](https://github.com/vktory6/VKtory/pull/68#issuecomment-7308201758) Thanks! The probe records a useful fact. I am holding it, not merging or closing it, until the design in #57 is decided: if the mutable-binding route is chosen, this becomes the first piece of the port; if a raw-address or descriptor-heap route is chosen, it would test a layout we do not use.
Issue #57's second design question: dxil-spirv emits one OpVariable per (kind,
format, descriptor type), so remapping all heap bindings to 0 puts differently
typed variables on one set/binding. vkd3d-proton does exactly that with a
mutable layout; prove it on our card.

A synthetic compute module has a sampled image and a storage buffer both
decorated binding 0 (spirv-val clean). Creating a compute pipeline against a
VK_DESCRIPTOR_TYPE_MUTABLE_VALVE layout naming both types succeeds with the
validation layer on and an empty validation log. So the port likely only needs
the remapper's binding constants pointed at the one binding, not a lowering
change.
The .spv fixture is gitignored, so the test would not compile from the PR. A
928-byte byte array in the test source keeps the test self-contained and
policy-friendly; validation log stays empty.
github-bot changed target branch from main to gh-pr/68/base 2026-12-01 18:50:10 +00:00
github manually merged commit 058ede36ab into gh-pr/68/base 2026-12-01 18:50:11 +00:00
Author
Owner

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

Thank you, merged. These two probes are the evidence the decision on #57 rests on: the one-binding layout fits the per-stage limit on the reference card, and two differently typed variables can share one mutable binding. They stay in the tree as regression probes.

What I changed on your branch before merging:

  • a // SAFETY: comment on each unsafe block (public rule 36),
  • one line in each test's doc comment: the decided shape is two mutable family bindings (image family, buffer family; #57), and the probe records the one-binding layout and the aliasing fact behind that decision,
  • the type-list comment in mutable_layout_probe.rs said "seven typed bindings" over a list of six types; it now names the descriptor types of today's typed bindings,
  • merged current main into the branch.

The decision: two mutable family bindings now. VK_EXT_descriptor_heap is used where the device offers it, once the new shader translator can target it (public rule 38).

**@⁠vktory6** on GitHub · 2026-12-01 18:47 UTC · [original](https://github.com/vktory6/VKtory/pull/68#issuecomment-7321541763) Thank you, merged. These two probes are the evidence the decision on #57 rests on: the one-binding layout fits the per-stage limit on the reference card, and two differently typed variables can share one mutable binding. They stay in the tree as regression probes. What I changed on your branch before merging: - a `// SAFETY:` comment on each `unsafe` block (public rule 36), - one line in each test's doc comment: the decided shape is two mutable family bindings (image family, buffer family; #57), and the probe records the one-binding layout and the aliasing fact behind that decision, - the type-list comment in `mutable_layout_probe.rs` said "seven typed bindings" over a list of six types; it now names the descriptor types of today's typed bindings, - merged current main into the branch. The decision: two mutable family bindings now. VK_EXT_descriptor_heap is used where the device offers it, once the new shader translator can target it (public rule 38).
This discussion has been locked. Commenting is limited to contributors.
No description provided.