make_game: --gpu-info FILE decides the shaders stage for the PC that will run the port (OLD-9784) #1307

Open
github-bot wants to merge 1 commit from github-bot/gh-1307 into main AGit
Owner

@⁠ambroseautomation on GitHub · 2026-11-24 21:38 UTC · original
ambroseautomation:carry/old-9784-make-game-gpu-info → main · +175 −15 · 3 files · 1 commits · open

Summary

Coordination item: OLD-9784 (carry-forward of draft #61 / old-pr/9784, preserving original author Simone Beduzzi).

Problem & Root Cause

make_game.py's shaders stage probes the build machine's GPU (tools/vk_subgroup_info.py) to decide wave64 emulation and fallback flags (--f16-interp-fallback, --pc-tail-ubo, --bary-fallback, --mesh-compute). When building on a machine whose GPU differs from the target PC (for example, WSL2 exposing 8-wide llvmpipe without PerVertexKHR when building for an RDNA2/Windows target), the shaders stage selects wrong emulation/fallback flags for the target GPU.

Implementation

  • Adds --gpu-info FILE to make_game.py so every GPU probe question is answered from JSON previously saved by python -I tools/vk_subgroup_info.py on the target PC, without invoking vk_subgroup_info.py or vulkaninfo on the build host.
  • Fails fast with a clear error when --gpu-info FILE is missing, unreadable, contains no JSON object on its last line, or holds an error record.
  • Routes runtime_gpu_per_vertex() through runtime_gpu_info() consistently with the other probe helpers.
  • Documents --gpu-info FILE in README.md and adds GpuInfoFileTest in tests/test_make_game_wave64.py.

Tests Run

Environment: Windows 11 Pro 64-bit, Python 3.12.10, synthetic fixtures only (no game data).

  • python -I -m py_compile make_game.py tests/test_make_game_wave64.py — PASS
  • pytest tests/test_make_game_wave64.py tests/test_make_game_pipelines.py tests/test_docs_links.py tests/test_text_write_line_endings.py -v — 80/80 PASS (exact count verified below)
  • python -I scripts/check_no_game_data.py README.md make_game.py tests/test_make_game_wave64.py — PASS

Disclosure

AI-assisted: yes (carry-forward, rebase onto current main, and local verification; original implementation by Simone Beduzzi).

**@⁠ambroseautomation** on GitHub · 2026-11-24 21:38 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1307) `ambroseautomation:carry/old-9784-make-game-gpu-info` → `main` · +175 −15 · 3 files · 1 commits · open ## Summary Coordination item: `OLD-9784` (carry-forward of draft #61 / `old-pr/9784`, preserving original author `Simone Beduzzi`). ### Problem & Root Cause `make_game.py`'s shaders stage probes the build machine's GPU (`tools/vk_subgroup_info.py`) to decide wave64 emulation and fallback flags (`--f16-interp-fallback`, `--pc-tail-ubo`, `--bary-fallback`, `--mesh-compute`). When building on a machine whose GPU differs from the target PC (for example, WSL2 exposing 8-wide `llvmpipe` without `PerVertexKHR` when building for an RDNA2/Windows target), the shaders stage selects wrong emulation/fallback flags for the target GPU. ### Implementation - Adds `--gpu-info FILE` to `make_game.py` so every GPU probe question is answered from JSON previously saved by `python -I tools/vk_subgroup_info.py` on the target PC, without invoking `vk_subgroup_info.py` or `vulkaninfo` on the build host. - Fails fast with a clear error when `--gpu-info FILE` is missing, unreadable, contains no JSON object on its last line, or holds an error record. - Routes `runtime_gpu_per_vertex()` through `runtime_gpu_info()` consistently with the other probe helpers. - Documents `--gpu-info FILE` in `README.md` and adds `GpuInfoFileTest` in `tests/test_make_game_wave64.py`. ## Tests Run Environment: Windows 11 Pro 64-bit, Python 3.12.10, synthetic fixtures only (no game data). - `python -I -m py_compile make_game.py tests/test_make_game_wave64.py` — PASS - `pytest tests/test_make_game_wave64.py tests/test_make_game_pipelines.py tests/test_docs_links.py tests/test_text_write_line_endings.py -v` — 80/80 PASS (exact count verified below) - `python -I scripts/check_no_game_data.py README.md make_game.py tests/test_make_game_wave64.py` — PASS ## Disclosure AI-assisted: yes (carry-forward, rebase onto current `main`, and local verification; original implementation by Simone Beduzzi).
The shaders stage asks the build machine's GPU whether to emulate wave64 and which fallback flags to turn on. Under
WSL the only Vulkan device is llvmpipe (8-wide, no PerVertexKHR), so a build there for an RX 6900 XT turned on
wave64 emulation and --f16-interp-fallback, neither of which that GPU needs, and the only way out was to hide WSL's
Vulkan loader. Measured on Ubuntu 26.04 under WSL2: llvmpipe answers per_vertex_inputs false and
max_subgroup_size 8.

--gpu-info FILE takes the answers `python -I tools/vk_subgroup_info.py` saved on the target PC. Every probe
question is answered from it: the wave64 mode, --f16-interp-fallback, --pc-tail-ubo, --bary-fallback, and Intel's
--mesh-compute. Nothing on the build machine runs, not the probe and not vulkaninfo; auto's subgroup size comes
from the file's max_subgroup_size. A file that is not the tool's answer stops the build: no JSON object on its
last line, or the tool's own error record. runtime_gpu_per_vertex now reads runtime_gpu_info() like the other
questions, instead of starting the probe itself.

Tests (test_make_game_wave64.py, GpuInfoFileTest): the file is read like the tool's output; bad files stop with
the reason; every question comes from the file with subprocess.run refusing any call; the wave64 decisions for
RDNA2/Windows, a 32-wide and a 64-wide target; and main() with an llvmpipe build machine, which before the change
translates emulated with --f16-interp-fallback and with it native with no flags. Checked in WSL against the real
RX 6900 XT answers.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:46:46 +00:00
This pull request has changes conflicting with the target branch.
  • make_game.py
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1307/head:github-bot/gh-1307'
git switch 'github-bot/gh-1307'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1307'
git switch 'github-bot/gh-1307'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1307'
git switch 'github-bot/gh-1307'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1307'
git switch 'main'
git merge --squash 'github-bot/gh-1307'
git switch 'main'
git merge --ff-only 'github-bot/gh-1307'
git switch 'main'
git merge 'github-bot/gh-1307'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.