[PR #61] make_game: --gpu-info FILE decides the shaders stage for the PC that will run the port #113

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

📋 Pull Request Information

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

Base: main ← Head: old-pr/9784


📝 Commits (1)

  • f247681 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

Carried over from old PR 9784 by Bruce1419 in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/9784, exactly that PR's last commit. All carried-over PRs are listed in #17.
Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it.
Bruce1419: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one.


Original description (mentions and #N references are disabled; the numbers refer to the old repository):

Claimed in the coordination issue as: https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7116525882 (new item)

Depends on: #5530, #8068 (both change runtime_gpu_per_vertex / wave64_settings, which this PR also touches; whichever lands second rebases)

What and why

The shaders stage asks the build machine's GPU whether to emulate wave64 and which fallback flags to turn on. When
the shaders are translated somewhere other than the PC that will run the port, it answers for the wrong GPU. Under
WSL the only Vulkan device is llvmpipe, which reports max_subgroup_size 8 and per_vertex_inputs false (measured
on Ubuntu 26.04 under WSL2). A WSL build for an RX 6900 XT therefore turned on wave64 emulation and
--f16-interp-fallback, though that GPU needs neither, and the only workaround was hiding WSL's Vulkan loader
(VK_DRIVER_FILES) and passing --wave64-emulate off.

--gpu-info FILE takes the answers python -I tools/vk_subgroup_info.py > gpu.json saved on the target PC.

  • Every probe question comes from the file:
    • the wave64 mode, with auto's subgroup size taken from the file's max_subgroup_size;
    • --f16-interp-fallback;
    • --pc-tail-ubo;
    • --bary-fallback;
    • Intel's --mesh-compute.
  • Nothing runs on the build machine: neither the probe nor vulkaninfo.
  • A file that is not the tool's answer stops the build with the reason: a missing file, no JSON object on its
    last line, or the tool's own {"error": ...} record.
  • One probe path: runtime_gpu_per_vertex() now reads runtime_gpu_info() like the other questions, instead
    of starting the probe itself.
  • README: documents the option next to --wave64-emulate.

Tested

Windows 11 Pro (build 26100), AMD Radeon RX 6900 XT, AMD driver 32.0.21045.29003, Python 3.14.7; WSL2 Ubuntu
26.04 with Python 3.14.4.

  • New tests in tests/test_make_game_wave64.py (GpuInfoFileTest, 5 tests), all failing before the change:
    • the file is read like the tool's output;
    • each kind of bad file stops the build;
    • every probe question is answered from the file while subprocess.run refuses any call;
    • the wave64 decisions for RDNA2 on AMD's Windows driver, a 32-wide target, a 64-wide target and a file without
      a size;
    • main() with an llvmpipe build machine: without the option it translates emulated with
      --f16-interp-fallback, and with the RX 6900 XT's file it translates native with no flags and asks the build
      machine nothing.
  • Existing tests pass on this branch: python -I on test_make_game_wave64, test_make_game_argparse,
    test_make_game_preflight, test_make_game_translator_flags and test_vk_subgroup_info.
  • Unrelated guard failures: test_docs_cli_flags, test_docs_links, test_docs_env_vars,
    test_text_write_line_endings and test_docs_repo_paths fail with the same messages on clean main. The change
    adds no entry to any of them.
  • In real WSL: I saved the RX 6900 XT's answers on Windows and loaded them in WSL with llvmpipe visible.
    • Without the file: llvmpipe, per_vertex False, wave64 emulation on.
    • With the file: RX 6900 XT, per_vertex True, max_push_constants 256, no mesh crash, native wave64.
    • No subprocess was started.

AI-assisted: yes (Claude Code)

Checklist

  • 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. (Not applicable: no translator change.)

🤖 Generated with Claude Code


🔄 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/61 **Author:** [@Andretuta](https://github.com/Andretuta) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `old-pr/9784` --- ### 📝 Commits (1) - [`f247681`](https://github.com/ubiquitarianism/leonida/commit/f24768124175984c59498047d6553d1d3bde9f3e) 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 > Carried over from **old PR 9784** by `Bruce1419` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/9784`, exactly that PR's last commit. All carried-over PRs are listed in #17. > Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it. > `Bruce1419`: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one. --- Original description (mentions and `#N` references are disabled; the numbers refer to the old repository): Claimed in the coordination issue as: https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7116525882 (new item) Depends on: `#5530`, `#8068` (both change `runtime_gpu_per_vertex` / `wave64_settings`, which this PR also touches; whichever lands second rebases) ### What and why The shaders stage asks the build machine's GPU whether to emulate wave64 and which fallback flags to turn on. When the shaders are translated somewhere other than the PC that will run the port, it answers for the wrong GPU. Under WSL the only Vulkan device is llvmpipe, which reports `max_subgroup_size` 8 and `per_vertex_inputs` false (measured on Ubuntu 26.04 under WSL2). A WSL build for an RX 6900 XT therefore turned on wave64 emulation and `--f16-interp-fallback`, though that GPU needs neither, and the only workaround was hiding WSL's Vulkan loader (`VK_DRIVER_FILES`) and passing `--wave64-emulate off`. `--gpu-info FILE` takes the answers `python -I tools/vk_subgroup_info.py > gpu.json` saved on the target PC. - **Every probe question comes from the file:** - the wave64 mode, with `auto`'s subgroup size taken from the file's `max_subgroup_size`; - `--f16-interp-fallback`; - `--pc-tail-ubo`; - `--bary-fallback`; - Intel's `--mesh-compute`. - **Nothing runs on the build machine:** neither the probe nor `vulkaninfo`. - **A file that is not the tool's answer stops the build with the reason:** a missing file, no JSON object on its last line, or the tool's own `{"error": ...}` record. - **One probe path:** `runtime_gpu_per_vertex()` now reads `runtime_gpu_info()` like the other questions, instead of starting the probe itself. - **README:** documents the option next to `--wave64-emulate`. ### Tested Windows 11 Pro (build 26100), AMD Radeon RX 6900 XT, AMD driver 32.0.21045.29003, Python 3.14.7; WSL2 Ubuntu 26.04 with Python 3.14.4. - **New tests in `tests/test_make_game_wave64.py` (`GpuInfoFileTest`, 5 tests), all failing before the change:** - the file is read like the tool's output; - each kind of bad file stops the build; - every probe question is answered from the file while `subprocess.run` refuses any call; - the wave64 decisions for RDNA2 on AMD's Windows driver, a 32-wide target, a 64-wide target and a file without a size; - `main()` with an llvmpipe build machine: without the option it translates emulated with `--f16-interp-fallback`, and with the RX 6900 XT's file it translates native with no flags and asks the build machine nothing. - **Existing tests pass on this branch:** `python -I` on test_make_game_wave64, test_make_game_argparse, test_make_game_preflight, test_make_game_translator_flags and test_vk_subgroup_info. - **Unrelated guard failures:** test_docs_cli_flags, test_docs_links, test_docs_env_vars, test_text_write_line_endings and test_docs_repo_paths fail with the same messages on clean `main`. The change adds no entry to any of them. - **In real WSL:** I saved the RX 6900 XT's answers on Windows and loaded them in WSL with llvmpipe visible. - Without the file: llvmpipe, `per_vertex` False, wave64 emulation on. - With the file: RX 6900 XT, `per_vertex` True, `max_push_constants` 256, no mesh crash, native wave64. - No subprocess was started. AI-assisted: yes (Claude Code) ### Checklist - [x] 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. (Not applicable: no translator change.) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <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#113
No description provided.