image_fuzz: separate harness errors and retry fatal pre-device startup once #2196

Open
github-bot wants to merge 2 commits from github-bot/gh-2196 into main AGit
Owner

@⁠whoalin1 on GitHub · 2026-11-26 05:13 UTC · original
whoalin1:image-fuzz-harness-error-exit → main · +111 −15 · 2 files · 2 commits · open

Claimed in the coordination issue as TEST-IMAGE-FUZZ-HARNESS-ERROR-EXIT (comment 7183240033).

What

tools/image_fuzz.py documents exit 2 for setup/harness errors, but a nonzero vk_image_fuzz exit 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.

This keeps the detailed harness failure line unchanged, returns a distinct HARNESS_ERROR sentinel, counts harness errors separately, and preserves exit 2 as the dominant status. Hardware-oracle reporting also names the translator-side outcome as a harness error instead of falling through raw.

Found while triaging an intermittent pre-device validation-loader crash on the AMD RDNA2 iGPU: the fuzzer reported it as a translator mismatch even though the harness never produced results.

Tested

  • python -m compileall -q tools/image_fuzz.py tests/test_image_fuzz.py — PASS
  • python -m pytest -q tests/test_image_fuzz.py tests/test_image_fuzz_hw.py tests/test_image_fuzz_work_isolation.py tests/test_build_runtime_fallback.py — 105 passed, 6 skipped, 16 subtests passed
  • python -I tools/image_fuzz.py --self-test — PASS

No game data or GPU required for these tests.

AI-assisted.

Consolidated retry behavior

This branch now also contains the pre-device startup retry formerly opened as #2202. vk_image_fuzz is retried exactly once only when it dies with a fatal process status before printing its device: line; at that point shader-module creation has not happened, so the shader under test cannot have caused the crash. Ordinary exit 1/2 results, post-device crashes, skips, and persistent startup failures are not hidden.

The retry portion was validated on the AMD RDNA2 validation/pc-tail setup: a fresh seed-20 campaign hit the intermittent pre-device 0xc000041d four times, each retry succeeded, and the campaign completed 20/20 match with exit 0. The branch head is exactly the previously reviewed #2202 head (6f6865c9a).

**@⁠whoalin1** on GitHub · 2026-11-26 05:13 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2196) `whoalin1:image-fuzz-harness-error-exit` → `main` · +111 −15 · 2 files · 2 commits · open Claimed in the coordination issue as `TEST-IMAGE-FUZZ-HARNESS-ERROR-EXIT` (comment 7183240033). ## What `tools/image_fuzz.py` documents exit 2 for setup/harness errors, but a nonzero `vk_image_fuzz` exit 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. This keeps the detailed harness failure line unchanged, returns a distinct `HARNESS_ERROR` sentinel, counts harness errors separately, and preserves exit 2 as the dominant status. Hardware-oracle reporting also names the translator-side outcome as a harness error instead of falling through raw. Found while triaging an intermittent pre-device validation-loader crash on the AMD RDNA2 iGPU: the fuzzer reported it as a translator mismatch even though the harness never produced results. ## Tested - `python -m compileall -q tools/image_fuzz.py tests/test_image_fuzz.py` — PASS - `python -m pytest -q tests/test_image_fuzz.py tests/test_image_fuzz_hw.py tests/test_image_fuzz_work_isolation.py tests/test_build_runtime_fallback.py` — **105 passed, 6 skipped, 16 subtests passed** - `python -I tools/image_fuzz.py --self-test` — PASS No game data or GPU required for these tests. AI-assisted. ## Consolidated retry behavior This branch now also contains the pre-device startup retry formerly opened as #2202. `vk_image_fuzz` is retried exactly once only when it dies with a fatal process status before printing its `device:` line; at that point shader-module creation has not happened, so the shader under test cannot have caused the crash. Ordinary exit 1/2 results, post-device crashes, skips, and persistent startup failures are not hidden. The retry portion was validated on the AMD RDNA2 validation/pc-tail setup: a fresh seed-20 campaign hit the intermittent pre-device `0xc000041d` four times, each retry succeeded, and the campaign completed 20/20 match with exit 0. The branch head is exactly the previously reviewed #2202 head (`6f6865c9a`).
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:21:58 +00:00
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 #2202 (both touch image_fuzz). With this PR, python -m pytest tests/test_image_fuzz.py: 66 passed. The PR's test file against main's tool: 5 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/2196#issuecomment-7189052607) 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 #2202 (both touch image_fuzz). With this PR, python -m pytest tests/test_image_fuzz.py: 66 passed. The PR's test file against main's tool: 5 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: 65 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/2196#issuecomment-7189908366) Tested on Windows 11, Python 3.12.10, with this PR merged onto current upstream main. - `tests/test_image_fuzz.py`: 65 passed, 1 skipped (main: 63 passed, the same 1 skip). (AI-assisted test run; output checked by hand.)
github-bot changed title from image_fuzz: report harness errors separately from pixel mismatches to image_fuzz: separate harness errors and retry fatal pre-device startup once 2026-11-26 13:26:11 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2196/head:github-bot/gh-2196'
git switch 'github-bot/gh-2196'

Merge

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