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

Manually merged
github merged 2 commits from gh-pr/624/head into gh-pr/624/base 2026-11-26 09:12:30 +00:00
Owner

@⁠jarvixaiassistant-glitch on GitHub · 2026-11-24 10:05 UTC · original
jarvixaiassistant-glitch:fix/old-10045-vk-barycentric-ext → main · +59 −9 · 3 files · 2 commits · merged 2026-11-25 21:19 UTC

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.)
**@⁠jarvixaiassistant-glitch** on GitHub · 2026-11-24 10:05 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/624) `jarvixaiassistant-glitch:fix/old-10045-vk-barycentric-ext` → `main` · +59 −9 · 3 files · 2 commits · merged 2026-11-25 21:19 UTC 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.)*
RADV (Mesa 26.2.6) sets fragmentShaderBarycentric on a gfx90c iGPU (Vega 8,
PCI 1002:15E7) that doesn't list VK_KHR_fragment_shader_barycentric, so
per_vertex_inputs read true there. run_gpu_tests.py then didn't turn on
--f16-interp-fallback and ps_interp_f16_high skipped; make_game.py reads the
same field and would keep PerVertexKHR inputs the device can't run.

The feature now counts only with its extension in the device's list. The
gfx90c/RADV measurement goes into docs/testing.md.

AI-assisted (Claude Code).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Commit de286bf79 checked VK_KHR_fragment_shader_barycentric via
device_extensions(vk, d) inside the device-selection loop, which enumerated
extensions a second time on Vulkan 1.2 devices (already queried for
VULKAN_12_REQUIRED_EXTENSIONS) and on lower-ranked Vulkan 1.3 devices later
superseded by a higher-ranked GPU.

Reuse the cached Vulkan 1.2 extension set and defer the Vulkan 1.3
device_extensions() call until after the winning device is final. Add unit
tests verifying Vulkan 1.2 single-enumeration reuse and Vulkan 1.3 deferred
enumeration when an iGPU precedes a dGPU.

AI-assisted: yes (JARVIX: Antigravity + DeepSeek-V4-Pro + NVIDIA NIM Nemotron-3-Ultra-550B).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:12:29 +00:00
github manually merged commit 95fb20df04 into gh-pr/624/base 2026-11-26 09:12:30 +00:00
Author
Owner

@⁠PierreEbele on GitHub · 2026-11-25 00:57 UTC · original

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

**@⁠PierreEbele** on GitHub · 2026-11-25 00:57 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/624#issuecomment-7149062147) 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
Author
Owner

@⁠aslan2142 on GitHub · 2026-11-25 21:19 UTC · original

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).

**@⁠aslan2142** on GitHub · 2026-11-25 21:19 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/624#issuecomment-7174921485) 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).
This discussion has been locked. Commenting is limited to contributors.
No description provided.