make_game: ignore partial vulkaninfo output after a failed probe (OLD-10067) #736

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

@⁠abnalstlll-byte on GitHub · 2026-11-24 13:10 UTC · original
abnalstlll-byte:restore/old-10067-vulkaninfo-probe → main · +8 −3 · 2 files · 1 commits · open

### Summary
Restores old upstream PR 10067 (OLD-10067, replaces draft #332) with original author attribution (@⁠AGInformatique81) preserved.

When the local vulkaninfo process fails after printing a 64-wide adapter, the build could prematurely select native wave64 by reading that partial output. This change verifies the process exit status before reading adapter limits, ensuring a failed probe reliably falls back to wave64 emulation.

Verification

  • Tested with standard library: python -I tests/test_make_game_wave64.py (39/39 PASS in 2.91s).
  • Clean-room check: python -I scripts/check_no_game_data.py clean (0 issues).
  • Zero external runtime dependencies.
  • AI-assisted (Claude Code).
**@⁠abnalstlll-byte** on GitHub · 2026-11-24 13:10 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/736) `abnalstlll-byte:restore/old-10067-vulkaninfo-probe` → `main` · +8 −3 · 2 files · 1 commits · open ### Summary Restores old upstream PR 10067 (OLD-10067, replaces draft #332) with original author attribution (@⁠AGInformatique81) preserved. When the local `vulkaninfo` process fails after printing a 64-wide adapter, the build could prematurely select native wave64 by reading that partial output. This change verifies the process exit status before reading adapter limits, ensuring a failed probe reliably falls back to wave64 emulation. ### Verification - Tested with standard library: `python -I tests/test_make_game_wave64.py` (39/39 PASS in 2.91s). - Clean-room check: `python -I scripts/check_no_game_data.py` clean (0 issues). - Zero external runtime dependencies. - AI-assisted (Claude Code).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:18:46 +00:00
Author
Owner

@⁠KernelSmoker on GitHub · 2026-11-24 13:29 UTC · original · reviewed

Independent Bazzite/Linux verification of PR head c5c7a19c53555c4aa8f040907d35eadea16037ca (base 2d73c242fddfe26d57b52ee150704e6c3b23cff4): python3 -I tests/test_make_game_wave64.py passed 39/39; py_compile and git diff --check passed.

I also exercised the host probe path: vulkaninfo exited 1 with 0 stdout characters, and wave64_settings("auto") returned (True, True), selecting the documented Wave64-emulation fallback. Since this host emitted no partial stdout, that real-device probe does not exercise the new partial-output case; the new regression test covers it with a mocked nonzero exit and parsed-looking stdout. No game data used. AI-assisted independent verification.

**@⁠KernelSmoker** on GitHub · 2026-11-24 13:29 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/736#pullrequestreview-6040042627) · **reviewed** Independent Bazzite/Linux verification of PR head `c5c7a19c53555c4aa8f040907d35eadea16037ca` (base `2d73c242fddfe26d57b52ee150704e6c3b23cff4`): `python3 -I tests/test_make_game_wave64.py` passed 39/39; `py_compile` and `git diff --check` passed. I also exercised the host probe path: `vulkaninfo` exited 1 with 0 stdout characters, and `wave64_settings("auto")` returned `(True, True)`, selecting the documented Wave64-emulation fallback. Since this host emitted no partial stdout, that real-device probe does not exercise the new partial-output case; the new regression test covers it with a mocked nonzero exit and parsed-looking stdout. No game data used. AI-assisted independent verification.
Author
Owner

@⁠abnalstlll-byte on GitHub · 2026-11-25 21:54 UTC · original

Rebased onto latest \main.
Verified \python3 -I tests/test_make_game_wave64.py\ (39/39 passed in 3.4s), \scripts/check_no_game_data.py\ (clean), and \git diff --check.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠abnalstlll-byte** on GitHub · 2026-11-25 21:54 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/736#issuecomment-7175690663) Rebased onto latest \main\. Verified \python3 -I tests/test_make_game_wave64.py\ (39/39 passed in 3.4s), \scripts/check_no_game_data.py\ (clean), and \git diff --check\. AI-assisted (Claude Code, Claude Opus 5.5).
Author
Owner

@⁠wavehs on GitHub · 2026-11-26 18:49 UTC · original

This needs a rebase, and the bug it fixes is still on main f107ae044.

The diff no longer applies: make_game.wave64_settings() has moved (now at make_game.py:1932) and max_subgroup_decider() now returns three values (size, decider, left_out), so the hunk's size = smallest_max_subgroup(r.stdout) no longer exists. The equivalent change is:

-            size, decider, left_out = max_subgroup_decider(r.stdout)
+            if r.returncode == 0:
+                size, decider, left_out = max_subgroup_decider(r.stdout)

The test file still has decide(self, mode, which="vulkaninfo", stdout="", error=None) and real_format(), so the second hunk only needs the returncode=0 parameter and the new test_auto_ignores_partial_stdout_when_vulkaninfo_fails.

I reproduced the defect on current main with the test's own helper: a CompletedProcess(returncode=1, stdout=real_format(("First adapter", 64, []))) and runtime_gpu_info() == {} makes wave64_settings("auto") return (False, True) — native wave64 chosen from a failed probe — where it should return (True, True). No GPU is needed; the script mocks shutil.which, subprocess.run and runtime_gpu_info.

Duplicate: this and #937 are the same change (identical content, different rebase bases), both non-draft and both claiming to replace draft #332. This one is earlier, so it is the one to rebase; #937 can close once this lands.

AI-assisted (review/verification only).

**@⁠wavehs** on GitHub · 2026-11-26 18:49 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/736#issuecomment-7200892059) This needs a rebase, and the bug it fixes is still on `main` `f107ae044`. The diff no longer applies: `make_game.wave64_settings()` has moved (now at `make_game.py:1932`) and `max_subgroup_decider()` now returns three values (`size, decider, left_out`), so the hunk's `size = smallest_max_subgroup(r.stdout)` no longer exists. The equivalent change is: ```python - size, decider, left_out = max_subgroup_decider(r.stdout) + if r.returncode == 0: + size, decider, left_out = max_subgroup_decider(r.stdout) ``` The test file still has `decide(self, mode, which="vulkaninfo", stdout="", error=None)` and `real_format()`, so the second hunk only needs the `returncode=0` parameter and the new `test_auto_ignores_partial_stdout_when_vulkaninfo_fails`. I reproduced the defect on current main with the test's own helper: a `CompletedProcess(returncode=1, stdout=real_format(("First adapter", 64, [])))` and `runtime_gpu_info() == {}` makes `wave64_settings("auto")` return `(False, True)` — native wave64 chosen from a failed probe — where it should return `(True, True)`. No GPU is needed; the script mocks `shutil.which`, `subprocess.run` and `runtime_gpu_info`. **Duplicate:** this and **#937** are the same change (identical content, different rebase bases), both non-draft and both claiming to replace draft #332. This one is earlier, so it is the one to rebase; #937 can close once this lands. AI-assisted (review/verification only).
Author
Owner

@⁠wavehs on GitHub · 2026-11-26 18:54 UTC · original

Correction to my recommendation above: the fix now has a consolidated carrier, #2208 ("make_game: harden crash reporting, WINE resolution, and vulkaninfo probing"), which folds in the former #2217 and is the one to rebase. This PR and #937 are duplicates of that part and can close once #2208 lands.

The live-bug evidence above still stands ((False, True) on a failed probe with partial 64-wide output), and #2208 has the same one-line adaptation to make: if r.returncode == 0: around size, decider, left_out = max_subgroup_decider(r.stdout) on current main. If #2208 is abandoned, then rebase the earlier of #736/#937 as previously described.

AI-assisted (review only).

**@⁠wavehs** on GitHub · 2026-11-26 18:54 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/736#issuecomment-7200989010) Correction to my recommendation above: the fix now has a consolidated carrier, **#2208** ("make_game: harden crash reporting, WINE resolution, and vulkaninfo probing"), which folds in the former #2217 and is the one to rebase. This PR and #937 are duplicates of that part and can close once #2208 lands. The live-bug evidence above still stands (`(False, True)` on a failed probe with partial 64-wide output), and #2208 has the same one-line adaptation to make: `if r.returncode == 0:` around `size, decider, left_out = max_subgroup_decider(r.stdout)` on current main. If #2208 is abandoned, then rebase the earlier of #736/#937 as previously described. AI-assisted (review only).
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/736/head:github-bot/gh-736'
git switch 'github-bot/gh-736'

Merge

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