vk_subgroup_info: per_vertex_inputs needs VK_KHR_fragment_shader_barycentric listed (OLD-10045) #624

Merged
jarvixaiassistant-glitch merged 2 commits from upstream-pr/624 into main 2026-11-25 21:19:23 +00:00
jarvixaiassistant-glitch commented 2026-11-24 10:05:39 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by jarvixaiassistant-glitch on 2026-11-24T10:05:39Z.


Claimed in the coordination issue as: OLD-10045

What and why

Carries forward old-pr/10045 (draft #311) onto main (21625bca8), preserving Matheus Fermiano's original commit verbatim per CONTRIBUTING.md and adding one focused hardening commit on top:

  1. Original commit (Matheus Fermiano): Updates tools/vk_subgroup_info.py so per_vertex_inputs requires VK_KHR_fragment_shader_barycentric to be listed in the device's extension list (in addition to fragmentShaderBarycentric and non-MoltenVK), preventing false positives on drivers like RADV (Mesa 26.2.6) on gfx90c Vega 8 (PCI 1002:15E7) that set the feature bit without exposing the extension; adds unit tests in tests/test_vk_subgroup_info.py and documents the measurement in docs/testing.md.
  2. Hardening commit (JARVIX): Avoids redundant vkEnumerateDeviceExtensionProperties calls during query():
    • Reuses the extensions set already enumerated for Vulkan 1.2 eligibility (VULKAN_12_REQUIRED_EXTENSIONS) instead of calling device_extensions(vk, d) a second time on the same device.
    • Defers the Vulkan 1.3 device_extensions() call until after the highest-ranked winning device is selected (avoiding extension enumeration on lower-ranked Vulkan 1.3 devices superseded later in the loop).
    • Adds test_per_vertex_inputs_reuses_vulkan12_extensions_and_defers_vulkan13 covering Vulkan 1.2 single-enumeration reuse (with and without VK_KHR_fragment_shader_barycentric) and Vulkan 1.3 deferred enumeration when an integrated GPU precedes a discrete GPU.

Tested

All synthetic unit/docs/CI checks and live dual-GPU Vulkan queries on Windows 11 x64, Python 3.12.14, Node v24.19.0 (no game files):

  • python -I tests/test_vk_subgroup_info.py -v — 55/55 passed
  • python -I tools/vk_subgroup_info.py (NVIDIA GeForce RTX 3090, driver 621.01, Vulkan 1.4.357): per_vertex_inputs: true, barycentric_fallback: false, max_push_constants_size: 256
  • LEONIDA_VK_DEVICE=AMD python -I tools/vk_subgroup_info.py (AMD Radeon(TM) Graphics gfx90c Cezanne 0x1638, driver 26.5.2, Vulkan 1.3.260): per_vertex_inputs: true, barycentric_fallback: true, max_push_constants_size: 128
  • python -I tests/test_ci_registration.py — 15/15 passed
  • python -I tests/test_runtime_paths.py — 5/5 passed
  • python -I scripts/check_no_game_data.py — passed (0 forbidden tracked extensions)
  • python -m compileall -q make_game.py tools tests — passed
  • python -I tests/test_text_write_line_endings.py, tests/test_report_paths.py, tests/test_i18n_index.py, and all tests/test_docs_*.py — passed
  • node --test tests/test_viewer_streaming.cjs — passed

GPUs tested: NVIDIA GeForce RTX 3090 (Windows 11, driver 621.01, Vulkan 1.4.357) and AMD Radeon(TM) Graphics gfx90c 0x1638 (Windows 11, driver 26.5.2, Vulkan 1.3.260) via tools/vk_subgroup_info.py

AI-assisted: yes (JARVIX multi-model team: Antigravity + DeepSeek-V4-Pro + NVIDIA NIM Nemotron-3-Ultra-550B)

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (N/A — Vulkan physical-device capability query only; no shader-translator rule changed.)
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5470070273 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/624). Originally posted by [jarvixaiassistant-glitch](https://github.com/jarvixaiassistant-glitch) on 2026-11-24T10:05:39Z. --- Claimed in the coordination issue as: OLD-10045 ### What and why Carries forward `old-pr/10045` (draft #311) onto `main` (`21625bca8`), preserving `Matheus Fermiano`'s original commit verbatim per `CONTRIBUTING.md` and adding one focused hardening commit on top: 1. **Original commit (`Matheus Fermiano`):** Updates `tools/vk_subgroup_info.py` so `per_vertex_inputs` requires `VK_KHR_fragment_shader_barycentric` to be listed in the device's extension list (in addition to `fragmentShaderBarycentric` and non-MoltenVK), preventing false positives on drivers like RADV (Mesa 26.2.6) on gfx90c Vega 8 (`PCI 1002:15E7`) that set the feature bit without exposing the extension; adds unit tests in `tests/test_vk_subgroup_info.py` and documents the measurement in `docs/testing.md`. 2. **Hardening commit (`JARVIX`):** Avoids redundant `vkEnumerateDeviceExtensionProperties` calls during `query()`: - Reuses the `extensions` set already enumerated for Vulkan 1.2 eligibility (`VULKAN_12_REQUIRED_EXTENSIONS`) instead of calling `device_extensions(vk, d)` a second time on the same device. - Defers the Vulkan 1.3 `device_extensions()` call until after the highest-ranked winning device is selected (avoiding extension enumeration on lower-ranked Vulkan 1.3 devices superseded later in the loop). - Adds `test_per_vertex_inputs_reuses_vulkan12_extensions_and_defers_vulkan13` covering Vulkan 1.2 single-enumeration reuse (with and without `VK_KHR_fragment_shader_barycentric`) and Vulkan 1.3 deferred enumeration when an integrated GPU precedes a discrete GPU. ### Tested All synthetic unit/docs/CI checks and live dual-GPU Vulkan queries on Windows 11 x64, Python 3.12.14, Node v24.19.0 (no game files): - `python -I tests/test_vk_subgroup_info.py -v` — 55/55 passed - `python -I tools/vk_subgroup_info.py` (NVIDIA GeForce RTX 3090, driver 621.01, Vulkan 1.4.357): `per_vertex_inputs: true`, `barycentric_fallback: false`, `max_push_constants_size: 256` - `LEONIDA_VK_DEVICE=AMD python -I tools/vk_subgroup_info.py` (AMD Radeon(TM) Graphics gfx90c Cezanne `0x1638`, driver 26.5.2, Vulkan 1.3.260): `per_vertex_inputs: true`, `barycentric_fallback: true`, `max_push_constants_size: 128` - `python -I tests/test_ci_registration.py` — 15/15 passed - `python -I tests/test_runtime_paths.py` — 5/5 passed - `python -I scripts/check_no_game_data.py` — passed (0 forbidden tracked extensions) - `python -m compileall -q make_game.py tools tests` — passed - `python -I tests/test_text_write_line_endings.py`, `tests/test_report_paths.py`, `tests/test_i18n_index.py`, and all `tests/test_docs_*.py` — passed - `node --test tests/test_viewer_streaming.cjs` — passed GPUs tested: NVIDIA GeForce RTX 3090 (Windows 11, driver 621.01, Vulkan 1.4.357) and AMD Radeon(TM) Graphics gfx90c `0x1638` (Windows 11, driver 26.5.2, Vulkan 1.3.260) via `tools/vk_subgroup_info.py` AI-assisted: yes (JARVIX multi-model team: Antigravity + DeepSeek-V4-Pro + NVIDIA NIM Nemotron-3-Ultra-550B) ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [x] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. *(N/A — Vulkan physical-device capability query only; no shader-translator rule changed.)*
PierreEbele commented 2026-11-25 00:57:28 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by PierreEbele on 2026-11-25T00:57:28Z.


Reviewed 95fb20d: python3 -I tests/test_vk_subgroup_info.py passes on the PR (55 tests; 54 on main), and a probe against the test's fake Vulkan shows the intended change only: a Vulkan 1.3 device that sets fragmentShaderBarycentric without listing VK_KHR_fragment_shader_barycentric now reports per_vertex_inputs=false (true on main), devices with both the feature and the extension stay true, and the 1.3 query is enumerated once for the chosen device (a 1.2 winner reuses the eligibility list). On a real driver, tools/vk_subgroup_info.py on Mesa llvmpipe (Linux arm64, Vulkan 1.4.305) prints byte-identical JSON on the PR and on main (b4b7756e), so nothing changes for a device without the extension. check_no_game_data.py is clean on the changed files and the branch merges cleanly into current main. The RADV gfx90c case itself needs that GPU to confirm. No findings.

AI-assisted review.

Recommendation: Merge

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7149062147 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/624#issuecomment-7149062147). Originally posted by [PierreEbele](https://github.com/PierreEbele) on 2026-11-25T00:57:28Z. --- Reviewed 95fb20d: `python3 -I tests/test_vk_subgroup_info.py` passes on the PR (55 tests; 54 on `main`), and a probe against the test's fake Vulkan shows the intended change only: a Vulkan 1.3 device that sets `fragmentShaderBarycentric` without listing `VK_KHR_fragment_shader_barycentric` now reports `per_vertex_inputs=false` (true on `main`), devices with both the feature and the extension stay true, and the 1.3 query is enumerated once for the chosen device (a 1.2 winner reuses the eligibility list). On a real driver, `tools/vk_subgroup_info.py` on Mesa llvmpipe (Linux arm64, Vulkan 1.4.305) prints byte-identical JSON on the PR and on `main` (b4b7756e), so nothing changes for a device without the extension. `check_no_game_data.py` is clean on the changed files and the branch merges cleanly into current `main`. The RADV gfx90c case itself needs that GPU to confirm. No findings. AI-assisted review. **Recommendation:** Merge
aslan2142 commented 2026-11-25 21:19:25 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-11-25T21:19:25Z.


Merged, thanks! It replaces the closed draft #311; the docs tests pass with it merged onto main.

  • Checked on main be2f4026c + 95fb20df0: the semantic suite passes (491 files, 6,312 tests, 0 files failed); test_vk_subgroup_info pass; the 15 docs and writer tests pass; check_no_game_data.py is clean on the 3 changed files.

AI-assisted (Claude Code, Claude Opus 5.5).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7174921485 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/624#issuecomment-7174921485). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-11-25T21:19:25Z. --- Merged, thanks! It replaces the closed draft #311; the docs tests pass with it merged onto `main`. - **Checked on `main` `be2f4026c` + `95fb20df0`:** the semantic suite passes (491 files, 6,312 tests, 0 files failed); `test_vk_subgroup_info` pass; the 15 docs and writer tests pass; `check_no_game_data.py` is clean on the 3 changed files. AI-assisted (Claude Code, Claude Opus 5.5).
Sign in to join this conversation.
No reviewers
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
ProjectLeonida/mandy!624
No description provided.