umem: declare the DMA-BUF handle type on sparse title windows #52

Manually merged
github merged 2 commits from github-bot/gh-52 into gh-pr/52/base 2026-12-01 08:38:21 +00:00 AGit
Owner

@⁠TheRifai on GitHub · 2026-12-01 08:16 UTC · original
TheRifai:umem-sparse-window-dma-buf → main · +32 −10 · 1 files · 2 commits · merged 2026-12-01 08:32 UTC

What

The chunks bound into a title window are exported as DMA-BUFs (make_chunk), but the window's sparse buffer was created without VkExternalMemoryBufferCreateInfo. Binding exported memory into a resource that did not declare a matching handle type is invalid: VUID-VkSparseMemoryBind-memory-02730 (issue #42, listed in docs/TASKS.md).

window() now queries vkGetPhysicalDeviceExternalBufferProperties for the same flags/usage with DMA_BUF_EXT and declares that handle type on the sparse buffer where the driver offers the combination. Where it does not, the window stays plain and the fallback is counted (Stats::windows_without_dma_buf) and logged — the same shape as #30's counted image fallback.

Evidence

  • cargo test -p umem: 14 unit tests + the sparse probes pass (they bind exported chunk memory through the window path).
  • On RADV (RX 9070 XT) the combination is offered, so no fallback fires and the window declares DMA_BUF_EXT.
  • House-scene validation run: no new VUIDs attributable to the change. (The run also happened to hit the intermittent exit, whose teardown surfaces the pre-existing UNASSIGNED-Threading-MultipleThreads-Write of issue #38; that is unrelated to this change and also occurs on main when a run exits.)

The house scene on main does not currently emit 02730 (it was reported on a contributor build), so this is a spec-correctness fix for the documented cause rather than a removed-VUID A/B in that scene; the declaration is required whenever exported memory is sparse-bound.

**@⁠TheRifai** on GitHub · 2026-12-01 08:16 UTC · [original](https://github.com/vktory6/VKtory/pull/52) `TheRifai:umem-sparse-window-dma-buf` → `main` · +32 −10 · 1 files · 2 commits · merged 2026-12-01 08:32 UTC ## What The chunks bound into a title window are exported as DMA-BUFs (`make_chunk`), but the window's sparse buffer was created **without** `VkExternalMemoryBufferCreateInfo`. Binding exported memory into a resource that did not declare a matching handle type is invalid: `VUID-VkSparseMemoryBind-memory-02730` (issue #42, listed in docs/TASKS.md). `window()` now queries `vkGetPhysicalDeviceExternalBufferProperties` for the same flags/usage with `DMA_BUF_EXT` and declares that handle type on the sparse buffer where the driver offers the combination. Where it does not, the window stays plain and the fallback is counted (`Stats::windows_without_dma_buf`) and logged — the same shape as #30's counted image fallback. ## Evidence - `cargo test -p umem`: 14 unit tests + the sparse probes pass (they bind exported chunk memory through the window path). - On RADV (RX 9070 XT) the combination is offered, so no fallback fires and the window declares `DMA_BUF_EXT`. - House-scene validation run: no new VUIDs attributable to the change. (The run also happened to hit the intermittent exit, whose teardown surfaces the pre-existing `UNASSIGNED-Threading-MultipleThreads-Write` of issue #38; that is unrelated to this change and also occurs on main when a run exits.) The house scene on main does not currently emit 02730 (it was reported on a contributor build), so this is a spec-correctness fix for the documented cause rather than a removed-VUID A/B in that scene; the declaration is required whenever exported memory is sparse-bound.
The chunks bound into a title window are exported as DMA-BUFs (make_chunk), but
the window's sparse buffer was created without VkExternalMemoryBufferCreateInfo,
so every bind of that memory was invalid (VUID-VkSparseMemoryBind-memory-02730,
issue #42). Query the external-buffer properties and declare DMA_BUF_EXT where
the driver offers the combination; where it does not, keep the plain window and
count the fallback, as #30 does for images.

Native umem tests pass (14 + sparse probes). RADV offers the combination, so no
fallback fires. House-scene validation: no new VUIDs from the change.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 08:22:10 +00:00
github-bot force-pushed github-bot/gh-52 from 793dbf279a to 2ec5c09243 2026-12-01 08:27:35 +00:00 Compare
Author
Owner

@⁠vktory6 on GitHub · 2026-12-01 08:31 UTC · original · edited 2026-12-01 08:33 UTC

Merged, thanks! The fix itself is right. umem needs the DMA-BUF export (it maps that fd into the title's address space), so declaring the handle type on the window is the correct fix, not dropping the export.

One commit of mine on top (d7706f2), for AGENTS.md rule 33/36 (less code; no fallback for a case we can't support): the per-window query, the counter and the log are gone. umem now checks once at setup, next to the other driver checks, that the driver offers DMA-BUF export for that kind of sparse buffer, and stops there with a "deliberately unhandled" error if not. Every window then declares the handle type unconditionally. Going on with an invalid bind on a driver that lacks it would only make a later failure harder to read. RADV offers it, so nothing changes on the target.

Check on the reference system (RX 9070 XT): umem and vkback tests and the policy pass, and the house-scene validation run shows no new error (02730 never fired in the house scene; its cause is gone by construction). It's off the validation list.

**@⁠vktory6** on GitHub · 2026-12-01 08:31 UTC · [original](https://github.com/vktory6/VKtory/pull/52#issuecomment-7305434139) · edited 2026-12-01 08:33 UTC Merged, thanks! The fix itself is right. umem needs the DMA-BUF export (it maps that fd into the title's address space), so declaring the handle type on the window is the correct fix, not dropping the export. One commit of mine on top (d7706f2), for AGENTS.md rule 33/36 (less code; no fallback for a case we can't support): the per-window query, the counter and the log are gone. umem now checks once at setup, next to the other driver checks, that the driver offers DMA-BUF export for that kind of sparse buffer, and stops there with a "deliberately unhandled" error if not. Every window then declares the handle type unconditionally. Going on with an invalid bind on a driver that lacks it would only make a later failure harder to read. RADV offers it, so nothing changes on the target. Check on the reference system (RX 9070 XT): umem and vkback tests and the policy pass, and the house-scene validation run shows no new error (02730 never fired in the house scene; its cause is gone by construction). It's off the validation list.
github-bot changed target branch from main to gh-pr/52/base 2026-12-01 08:38:18 +00:00
github manually merged commit d7706f2a14 into gh-pr/52/base 2026-12-01 08:38:21 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.