image_fuzz: retry fatal pre-device harness startup once #2202

Closed
whoalin1 wants to merge 0 commits from upstream-pr/2202 into main
whoalin1 commented 2026-11-26 05:35:29 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by whoalin1 on 2026-11-26T05:35:29Z.


Summary

  • retry vk_image_fuzz exactly once when it dies with a fatal process status before printing its device: line
  • keep ordinary exit 1/2 failures, post-device crashes, skips and persistent startup crashes classified exactly as before
  • add synthetic sequence tests for retry success, persistent startup failure, post-device crash and ordinary pre-device error

Depends on: #2196
Item: TEST-IMAGE-FUZZ-PREDEVICE-RETRY

Why

On the AMD RDNA2 validation setup used for the image fuzz campaign, the Windows validation loader intermittently exits 0xc000041d during instance/device startup. The exact same generated case then passes repeatedly (one case passed a validation-on 10/10 manual loop), but a 20-case campaign is likely to hit one transient startup crash because every case starts a fresh harness process.

vk_image_fuzz prints device: before creating the shader modules, so a fatal exit before that line cannot have been caused by the shader under test. Retrying once therefore removes startup noise without hiding a shader-induced crash. A crash after device: is never retried.

Tests

  • python -m pytest -q tests/test_image_fuzz.py: 69 passed, 1 skipped
  • python -m compileall -q tools tests: pass
  • python -I tools/image_fuzz.py --self-test: pass (image_fuzz self-test: ok (6 formats, 64x64 draw))
  • git diff --check: pass

No game files or GPU needed for the tests.

AI-assisted with Devin.

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5504625001 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/2202). Originally posted by [whoalin1](https://github.com/whoalin1) on 2026-11-26T05:35:29Z. --- ## Summary - retry `vk_image_fuzz` exactly once when it dies with a fatal process status before printing its `device:` line - keep ordinary exit 1/2 failures, post-device crashes, skips and persistent startup crashes classified exactly as before - add synthetic sequence tests for retry success, persistent startup failure, post-device crash and ordinary pre-device error Depends on: #2196 Item: TEST-IMAGE-FUZZ-PREDEVICE-RETRY ## Why On the AMD RDNA2 validation setup used for the image fuzz campaign, the Windows validation loader intermittently exits `0xc000041d` during instance/device startup. The exact same generated case then passes repeatedly (one case passed a validation-on 10/10 manual loop), but a 20-case campaign is likely to hit one transient startup crash because every case starts a fresh harness process. `vk_image_fuzz` prints `device:` before creating the shader modules, so a fatal exit before that line cannot have been caused by the shader under test. Retrying once therefore removes startup noise without hiding a shader-induced crash. A crash after `device:` is never retried. ## Tests - `python -m pytest -q tests/test_image_fuzz.py`: 69 passed, 1 skipped - `python -m compileall -q tools tests`: pass - `python -I tools/image_fuzz.py --self-test`: pass (`image_fuzz self-test: ok (6 formats, 64x64 draw)`) - `git diff --check`: pass No game files or GPU needed for the tests. AI-assisted with Devin.
whoalin1 commented 2026-11-26 05:37:54 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by whoalin1 on 2026-11-26T05:37:54Z.


Validation evidence on AMD RDNA2 (Radeon iGPU, 128-byte push-constant device, validation on, pc-tail UBO): a fresh 20-case seed-20 image fuzz run hit the intermittent 0xc000041d startup failure four times. Each was retried exactly once before the device: line, the retry succeeded, and the campaign completed 20/20 programs match with exit 0 instead of stopping early as a false mismatch. Output lines: four harness startup exit 0xc000041d before device selection; retrying once, then translator: 20/20 programs that ran match. No game files. AI-assisted with Devin.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7183662243 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/2202#issuecomment-7183662243). Originally posted by [whoalin1](https://github.com/whoalin1) on 2026-11-26T05:37:54Z. --- Validation evidence on AMD RDNA2 (Radeon iGPU, 128-byte push-constant device, validation on, pc-tail UBO): a fresh 20-case seed-20 image fuzz run hit the intermittent `0xc000041d` startup failure **four times**. Each was retried exactly once before the `device:` line, the retry succeeded, and the campaign completed **20/20 programs match** with exit 0 instead of stopping early as a false mismatch. Output lines: four `harness startup exit 0xc000041d before device selection; retrying once`, then `translator: 20/20 programs that ran match`. No game files. AI-assisted with Devin.
real-rusher commented 2026-11-26 10:12:27 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by real-rusher on 2026-11-26T10:12:27Z.


Verified on main a73a57e1 (Ubuntu 24.04 x86-64, Python 3.13, pytest 9.2.0 from tests/requirements.txt, no GPU). Merges cleanly, also together with #2196 (both touch image_fuzz). With this PR, python -m pytest tests/test_image_fuzz.py: 70 passed. The PR's test file against main's tool: 9 failed, 61 passed, so the new tests fail on main and pass with the fix. compileall clean.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7189051760 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/2202#issuecomment-7189051760). Originally posted by [real-rusher](https://github.com/real-rusher) on 2026-11-26T10:12:27Z. --- Verified on main a73a57e1 (Ubuntu 24.04 x86-64, Python 3.13, pytest 9.2.0 from tests/requirements.txt, no GPU). Merges cleanly, also together with #2196 (both touch image_fuzz). With this PR, python -m pytest tests/test_image_fuzz.py: 70 passed. The PR's test file against main's tool: 9 failed, 61 passed, so the new tests fail on main and pass with the fix. compileall clean. AI-assisted: yes (Claude Code)
DeadlyChirp commented 2026-11-26 10:50:21 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by DeadlyChirp on 2026-11-26T10:50:21Z.


Tested on Windows 11, Python 3.12.10, with this PR merged onto current upstream main.

  • tests/test_image_fuzz.py: 69 passed, 1 skipped (main: 63 passed, the same 1 skip).

(AI-assisted test run; output checked by hand.)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7189905376 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/2202#issuecomment-7189905376). Originally posted by [DeadlyChirp](https://github.com/DeadlyChirp) on 2026-11-26T10:50:21Z. --- Tested on Windows 11, Python 3.12.10, with this PR merged onto current upstream main. - `tests/test_image_fuzz.py`: 69 passed, 1 skipped (main: 63 passed, the same 1 skip). (AI-assisted test run; output checked by hand.)
whoalin1 commented 2026-11-26 13:23:13 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by whoalin1 on 2026-11-26T13:23:13Z.


Consolidated into #2196 without rewriting: #2196 was fast-forwarded to this PR's exact head 6f6865c9a, so the pre-device retry behavior, tests, and validation evidence are preserved there. Closing this stacked follow-up to reduce review noise.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7193278623 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/2202#issuecomment-7193278623). Originally posted by [whoalin1](https://github.com/whoalin1) on 2026-11-26T13:23:13Z. --- Consolidated into #2196 without rewriting: #2196 was fast-forwarded to this PR's exact head `6f6865c9a`, so the pre-device retry behavior, tests, and validation evidence are preserved there. Closing this stacked follow-up to reduce review noise.

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!2202
No description provided.