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

Closed
github-bot wants to merge 2 commits from github-bot/gh-2202 into main AGit
Owner

@⁠whoalin1 on GitHub · 2026-11-26 05:35 UTC · original
whoalin1:image-fuzz-predevice-retry → main · +111 −15 · 2 files · 2 commits · closed without merging

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** on GitHub · 2026-11-26 05:35 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2202) `whoalin1:image-fuzz-predevice-retry` → `main` · +111 −15 · 2 files · 2 commits · closed without merging ## 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.
A nonzero vk_image_fuzz exit means the harness never produced an image,
but it shared run_case's False result with real pixel mismatches. The
fuzzer therefore counted a driver/loader crash as a translator mismatch
and exited 1 even though the documented harness-error exit is 2, which
made intermittent validation-loader startup crashes look like translator
regressions.

Keep the detailed harness failure line unchanged, return a distinct
sentinel, count harness errors separately, and preserve exit 2 as the
dominant status. Synthetic tests pin the classification and both exit
codes.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:22:11 +00:00
Author
Owner

@⁠whoalin1 on GitHub · 2026-11-26 05:37 UTC · original

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.

**@⁠whoalin1** on GitHub · 2026-11-26 05:37 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2202#issuecomment-7183662243) 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.
Author
Owner

@⁠real-rusher on GitHub · 2026-11-26 10:12 UTC · original

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)

**@⁠real-rusher** on GitHub · 2026-11-26 10:12 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2202#issuecomment-7189051760) 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)
Author
Owner

@⁠DeadlyChirp on GitHub · 2026-11-26 10:50 UTC · original

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

**@⁠DeadlyChirp** on GitHub · 2026-11-26 10:50 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2202#issuecomment-7189905376) 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.)
github-bot closed this pull request 2026-11-26 13:26:15 +00:00
Author
Owner

@⁠whoalin1 on GitHub · 2026-11-26 13:23 UTC · original

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.

**@⁠whoalin1** on GitHub · 2026-11-26 13:23 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2202#issuecomment-7193278623) 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

This discussion has been locked. Commenting is limited to contributors.
No description provided.