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

Closed
abnalstlll-byte wants to merge 1 commit from upstream-pr/736 into main
abnalstlll-byte commented 2026-11-24 13:10:47 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-24T13:10:47Z.


### 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).
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5472785384 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/736). Originally posted by [abnalstlll-byte](https://github.com/abnalstlll-byte) on 2026-11-24T13:10:47Z. --- ### 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).
KernelSmoker commented 2026-11-24 13:29:15 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by KernelSmoker on 2026-11-24T13:29:15Z.

Review: COMMENTED


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6040042627 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/736#pullrequestreview-6040042627). Originally posted by [KernelSmoker](https://github.com/KernelSmoker) on 2026-11-24T13:29:15Z. **Review:** COMMENTED --- 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.
abnalstlll-byte commented 2026-11-25 21:54:24 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-25T21:54:24Z.


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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7175690663 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/736#issuecomment-7175690663). Originally posted by [abnalstlll-byte](https://github.com/abnalstlll-byte) on 2026-11-25T21:54:24Z. --- 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).
wavehs commented 2026-11-26 18:49:26 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by wavehs on 2026-11-26T18:49:26Z.


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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7200892059 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/736#issuecomment-7200892059). Originally posted by [wavehs](https://github.com/wavehs) on 2026-11-26T18:49:26Z. --- 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).
wavehs commented 2026-11-26 18:54:50 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by wavehs on 2026-11-26T18:54:50Z.


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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7200989010 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/736#issuecomment-7200989010). Originally posted by [wavehs](https://github.com/wavehs) on 2026-11-26T18:54:50Z. --- 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).
MoonEyes commented 2026-11-27 19:44:15 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-27T19:44:15Z.


Thanks a lot for this, @abnalstlll-byte. The same change is in #937: it carries the same commit by AGInformatique81 (from draft #332) with the same diff to make_game.py and tests/test_make_game_wave64.py, and it was claimed in #14 as DRAFT-332. We could not find a claim for OLD-10067 from this account in #14 or #1608.

I am closing this one so the review happens in one place. Please continue the discussion on #937, or reopen this one if you see something it misses.

AI-assisted (Claude Code, Claude Opus 5.5)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7226821508 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/736#issuecomment-7226821508). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-27T19:44:15Z. --- Thanks a lot for this, @abnalstlll-byte. The same change is in #937: it carries the same commit by AGInformatique81 (from draft #332) with the same diff to `make_game.py` and `tests/test_make_game_wave64.py`, and it was claimed in #14 as DRAFT-332. We could not find a claim for OLD-10067 from this account in #14 or #1608. I am closing this one so the review happens in one place. Please continue the discussion on #937, or reopen this one if you see something it misses. AI-assisted (Claude Code, Claude Opus 5.5)

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
ProjectLeonida/mandy!736
No description provided.