[PR #1219] test: run the device-filter tools through wine on a non-Windows host (#1150) #1250

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

📋 Pull Request Information

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

Base: main ← Head: fix/device-filter-wine


📝 Commits (1)

  • 9a04373 test: run the device-filter tools through wine on a non-Windows host (#1150)

📊 Changes

2 files changed (+100 additions, -3 deletions)

View changed files

📝 runtime/test/check_device_filter_tools.py (+29 -3)
➕ tests/test_check_device_filter_tools.py (+71 -0)

📄 Description

Claim: https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7143617202 (ID VK-DEVICE-FILTER-WINE; from #1150)

vk_device_filter_tools runs a host Python that started vk_descriptor_bench.exe directly, so a ctest run on Linux got OSError: [Errno 8] Exec format error (PierreEbele, #1150) -- a runner bug, not a tool bug: the tools are right to be Windows executables, and the test passes natively here.

Change

runtime/test/check_device_filter_tools.py: one launcher() picks the prefix a tool runs with -- [] on Windows and for a non-PE, wine when the target starts with MZ on any other host, with LEONIDA_WINE naming another loader. It is applied to both tools, not only the one that lists devices. When the host is not Windows and the loader is not on PATH, the script exits 77 with SKIP: ... <loader> is not on PATH instead of reporting the Exec format error as a failure. Native Windows is unchanged.

tests/test_check_device_filter_tools.py covers the choice itself (Windows direct, PE through wine, non-PE direct, no loader still names one, the override, a missing tool, and the 77 path through main), so the branch runs on Windows CI where wine is absent.

Tested

  • The script natively against both real tools: ok: vk_descriptor_bench refuses ... / ok: vk_sandbox refuses ..., exit 0 -- unchanged from before.
  • python -I tests/test_check_device_filter_tools.py -> OK (7 tests); compileall -> 0; check_no_game_data.py -> exit 0.

Not run: a Wine host (none here). The launcher branch is covered by the unit test, not by a real Wine launch.

GPUs tested: NVIDIA GPU (Pascal class, 4 GB), driver 582.28, Windows 10 19045 for the native run.

AI-assisted: yes (OpenCode, DeepSeek V4.1 Flash)

Checklist

  • Based on current main and merges cleanly.
  • One topic.
  • No game data, keys or decryption (CONTRIBUTING.md).
  • A new translator rule is in the contract table of docs/design.md. (No translator change.)

🔄 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/1219 **Author:** [@robot00f](https://github.com/robot00f) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/device-filter-wine` --- ### 📝 Commits (1) - [`9a04373`](https://github.com/ubiquitarianism/leonida/commit/9a043734a4f4d9a4ef0705f4782f9ecdd6c86c2d) test: run the device-filter tools through wine on a non-Windows host (#1150) ### 📊 Changes **2 files changed** (+100 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `runtime/test/check_device_filter_tools.py` (+29 -3) ➕ `tests/test_check_device_filter_tools.py` (+71 -0) </details> ### 📄 Description Claim: https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7143617202 (ID `VK-DEVICE-FILTER-WINE`; from #1150) `vk_device_filter_tools` runs a host Python that started `vk_descriptor_bench.exe` directly, so a ctest run on Linux got `OSError: [Errno 8] Exec format error` (PierreEbele, #1150) -- a runner bug, not a tool bug: the tools are right to be Windows executables, and the test passes natively here. ### Change `runtime/test/check_device_filter_tools.py`: one `launcher()` picks the prefix a tool runs with -- `[]` on Windows and for a non-PE, `wine` when the target starts with `MZ` on any other host, with `LEONIDA_WINE` naming another loader. It is applied to both tools, not only the one that lists devices. When the host is not Windows and the loader is not on `PATH`, the script exits 77 with `SKIP: ... <loader> is not on PATH` instead of reporting the Exec format error as a failure. Native Windows is unchanged. `tests/test_check_device_filter_tools.py` covers the choice itself (Windows direct, PE through wine, non-PE direct, no loader still names one, the override, a missing tool, and the 77 path through `main`), so the branch runs on Windows CI where wine is absent. ### Tested - The script natively against both real tools: `ok: vk_descriptor_bench refuses ...` / `ok: vk_sandbox refuses ...`, exit 0 -- unchanged from before. - `python -I tests/test_check_device_filter_tools.py` -> OK (7 tests); `compileall` -> 0; `check_no_game_data.py` -> exit 0. Not run: a Wine host (none here). The launcher branch is covered by the unit test, not by a real Wine launch. GPUs tested: NVIDIA GPU (Pascal class, 4 GB), driver 582.28, Windows 10 19045 for the native run. AI-assisted: yes (OpenCode, DeepSeek V4.1 Flash) ### Checklist - [x] Based on current main and merges cleanly. - [x] One topic. - [x] No game data, keys or decryption (CONTRIBUTING.md). - [ ] A new translator rule is in the contract table of docs/design.md. (No translator change.) --- <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#1250
No description provided.