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

Open
opened 2026-11-26 20:20:54 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1307
Author: @ambroseautomation
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: carry/old-9784-make-game-gpu-info


📝 Commits (1)

  • 5ee6e22 make_game: --gpu-info FILE decides the shaders stage for the PC that will run the port

📊 Changes

3 files changed (+175 additions, -15 deletions)

View changed files

📝 README.md (+14 -0)
📝 make_game.py (+56 -15)
📝 tests/test_make_game_wave64.py (+105 -0)

📄 Description

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


🔄 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/1307 **Author:** [@ambroseautomation](https://github.com/ambroseautomation) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `carry/old-9784-make-game-gpu-info` --- ### 📝 Commits (1) - [`5ee6e22`](https://github.com/ubiquitarianism/leonida/commit/5ee6e22cf8c6c33fda7e3c6bedef19d8423e902b) make_game: --gpu-info FILE decides the shaders stage for the PC that will run the port ### 📊 Changes **3 files changed** (+175 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `README.md` (+14 -0) 📝 `make_game.py` (+56 -15) 📝 `tests/test_make_game_wave64.py` (+105 -0) </details> ### 📄 Description ## 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). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#1337
No description provided.