[PR #618] [MERGED] check_sparse_queue_family: skip CONCURRENT contract on single-family GPUs (OLD-7268) #659

Closed
opened 2026-11-26 20:18:37 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/618
Author: @KarolKurzyna
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/24/2026
Merged by: @ubiquitarianism

Base: main ← Head: fix/sparse-queue-family-single-family


📝 Commits (2)

  • 4ac9834 check_sparse_queue_family: skip CONCURRENT contract on single-family GPUs
  • b75d669 check_sparse_queue_family: mirror queue_families.h order and validate full property dump

📊 Changes

2 files changed (+325 additions, -3 deletions)

View changed files

📝 runtime/test/check_sparse_queue_family.py (+135 -3)
📝 tests/test_check_sparse_queue_family.py (+190 -0)

📄 Description

Claimed in the coordination issue as: OLD-7268 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7128154815)

Carried over from upstream ItsNotRexed/Leonida PR #7268 (b75d669b0a, incorporating @wasonidas's review suggestions), where it received 5/5 independent PASS reviews (@claudetools-gh, @rideinstead, @garuspl, @airp1ane, @lines9686-rgb).

What was wrong

  1. On single-queue-family GPUs with sparse binding (such as Intel UHD Graphics 770 on Windows, which exposes 1 queue family with GRAPHICS | COMPUTE | TRANSFER | SPARSE_BINDING), VulkanDevice selects the same family for graphics, compute, and DMA, so only 1 distinct sparse-capable family exists and VK_SHARING_MODE_EXCLUSIVE is valid per the Vulkan specification. However, runtime/test/check_sparse_queue_family.py unconditionally failed when VK_SHARING_MODE_CONCURRENT was absent from vkCreateBuffer / vkCreateImage in the VK_LAYER_LUNARG_api_dump output.
  2. When multiple queue families were present in the dump, the script needed to mirror runtime/src/queue_families.h (pick_queue_families followed by sparse_capable_queue_families) in exact selection order and strictly validate vkGetPhysicalDeviceQueueFamilyProperties against pQueueFamilyPropertyCount.

What changed

  • Mirror runtime/src/queue_families.h (pick_queue_families -> sparse_capable_queue_families) in runtime/test/check_sparse_queue_family.py: pick the first non-graphics async compute and fine-grained (1x1x1) DMA transfer families first, fall back to the graphics family if the chosen family lacks VK_QUEUE_SPARSE_BINDING_BIT, and require VK_SHARING_MODE_CONCURRENT only when >= 2 distinct sparse-capable families are selected.
  • Strictly validate vkGetPhysicalDeviceQueueFamilyProperties dumps against pQueueFamilyPropertyCount and contiguous indices 0..count-1 so truncated or malformed dumps are never silently ignored.
  • Add synthetic unit tests in tests/test_check_sparse_queue_family.py covering single-family GPUs, non-sparse compute/DMA ahead of sparse families, and incomplete/malformed property dumps (29/29 pass).

Tested

  • python -I -m unittest tests/test_check_sparse_queue_family.py -v: 29/29 PASS.
  • NVIDIA GeForce RTX 3070 Ti (621.24, 3 sparse-capable queue families, Windows 11): ctest -R d3d12_sparse_queue_family PASS (verifies VK_SHARING_MODE_CONCURRENT across 3 families).
  • Intel(R) UHD Graphics 770 (101.6129, 1 sparse-capable queue family, Windows 11): ctest -R d3d12_sparse_queue_family PASS (was failing before fix).

AI-assisted.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/618 **Author:** [@KarolKurzyna](https://github.com/KarolKurzyna) **Created:** 11/24/2026 **Status:** ✅ Merged **Merged:** 11/24/2026 **Merged by:** [@ubiquitarianism](https://github.com/ubiquitarianism) **Base:** `main` ← **Head:** `fix/sparse-queue-family-single-family` --- ### 📝 Commits (2) - [`4ac9834`](https://github.com/ubiquitarianism/leonida/commit/4ac98342f27f92dac55c0fd80f8ce93c6c183711) check_sparse_queue_family: skip CONCURRENT contract on single-family GPUs - [`b75d669`](https://github.com/ubiquitarianism/leonida/commit/b75d669b0ad5337fd3ffad8521d811856fd7e8ae) check_sparse_queue_family: mirror queue_families.h order and validate full property dump ### 📊 Changes **2 files changed** (+325 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `runtime/test/check_sparse_queue_family.py` (+135 -3) 📝 `tests/test_check_sparse_queue_family.py` (+190 -0) </details> ### 📄 Description Claimed in the coordination issue as: OLD-7268 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7128154815) Carried over from upstream `ItsNotRexed/Leonida` PR `#7268` (`b75d669b0a`, incorporating `@wasonidas`'s review suggestions), where it received **5/5 independent `PASS` reviews** (`@claudetools-gh`, `@rideinstead`, `@garuspl`, `@airp1ane`, `@lines9686-rgb`). ### What was wrong 1. On single-queue-family GPUs with sparse binding (such as Intel UHD Graphics 770 on Windows, which exposes 1 queue family with `GRAPHICS | COMPUTE | TRANSFER | SPARSE_BINDING`), `VulkanDevice` selects the same family for graphics, compute, and DMA, so only 1 distinct sparse-capable family exists and `VK_SHARING_MODE_EXCLUSIVE` is valid per the Vulkan specification. However, `runtime/test/check_sparse_queue_family.py` unconditionally failed when `VK_SHARING_MODE_CONCURRENT` was absent from `vkCreateBuffer` / `vkCreateImage` in the `VK_LAYER_LUNARG_api_dump` output. 2. When multiple queue families were present in the dump, the script needed to mirror `runtime/src/queue_families.h` (`pick_queue_families` followed by `sparse_capable_queue_families`) in exact selection order and strictly validate `vkGetPhysicalDeviceQueueFamilyProperties` against `pQueueFamilyPropertyCount`. ### What changed - Mirror `runtime/src/queue_families.h` (`pick_queue_families` -> `sparse_capable_queue_families`) in `runtime/test/check_sparse_queue_family.py`: pick the first non-graphics async compute and fine-grained (`1x1x1`) DMA transfer families first, fall back to the graphics family if the chosen family lacks `VK_QUEUE_SPARSE_BINDING_BIT`, and require `VK_SHARING_MODE_CONCURRENT` only when `>= 2` distinct sparse-capable families are selected. - Strictly validate `vkGetPhysicalDeviceQueueFamilyProperties` dumps against `pQueueFamilyPropertyCount` and contiguous indices `0..count-1` so truncated or malformed dumps are never silently ignored. - Add synthetic unit tests in `tests/test_check_sparse_queue_family.py` covering single-family GPUs, non-sparse compute/DMA ahead of sparse families, and incomplete/malformed property dumps (`29/29` pass). ### Tested - `python -I -m unittest tests/test_check_sparse_queue_family.py -v`: **29/29 PASS**. - **NVIDIA GeForce RTX 3070 Ti** (`621.24`, 3 sparse-capable queue families, Windows 11): `ctest -R d3d12_sparse_queue_family` **PASS** (verifies `VK_SHARING_MODE_CONCURRENT` across 3 families). - **Intel(R) UHD Graphics 770** (`101.6129`, 1 sparse-capable queue family, Windows 11): `ctest -R d3d12_sparse_queue_family` **PASS** (was failing before fix). AI-assisted. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:18:37 +01:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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
starred/leonida#659
No description provided.