vk_fuzz_run: --pc-tail-ubo under LEONIDA_PC_TAIL_UBO, VK_FUZZ_SKIP_CRASH for driver crashes #1519

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

@⁠whoalin1 on GitHub · 2026-11-25 03:11 UTC · original
whoalin1:vk-fuzz-run-pctail → main · +89 −2 · 2 files · 2 commits · open

Claimed in the coordination issue: #14

What

Two small tools/vk_fuzz_run.py additions found during overnight fuzzing on 128-byte-push-constant and crash-prone drivers:

  • LEONIDA_PC_TAIL_UBO → --pc-tail-ubo: when the env var is truthy (1/true/yes/on, same convention as image_fuzz/lds_fuzz/valu_fuzz), the flag is appended to the rdna2spirv.py call so translated shaders fit 128-byte push-constant devices. The variable reaches vk_compute_test via the inherited env, so both sides agree on the layout.
  • VK_FUZZ_SKIP_CRASH=1: records vk_compute_test crashes (any exit other than 0/1/2/77 — e.g. the 0xC0000005 driver crashes seen on the AMD Windows Vulkan driver for ~2% of fuzz programs) as skips instead of aborting the whole batch. Harness errors (exit 1/2) stay fatal.

Tested

  • tests/test_vk_fuzz_run.py: 17 tests OK — new tests pin flag→translator-cmd, env→harness propagation, flag absent when unset, crash→skip, and exits 1+2 staying fatal under VK_FUZZ_SKIP_CRASH=1.
  • compileall clean; check_no_game_data.py clean.
  • Used in anger: the overnight fuzz campaign ran thousands of programs through this path on AMD iGPU + RTX 4070 SUPER.

AI-assisted (Devin).

**@⁠whoalin1** on GitHub · 2026-11-25 03:11 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1519) `whoalin1:vk-fuzz-run-pctail` → `main` · +89 −2 · 2 files · 2 commits · open Claimed in the coordination issue: https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14 ## What Two small `tools/vk_fuzz_run.py` additions found during overnight fuzzing on 128-byte-push-constant and crash-prone drivers: - **`LEONIDA_PC_TAIL_UBO` → `--pc-tail-ubo`**: when the env var is truthy (`1/true/yes/on`, same convention as `image_fuzz`/`lds_fuzz`/`valu_fuzz`), the flag is appended to the `rdna2spirv.py` call so translated shaders fit 128-byte push-constant devices. The variable reaches `vk_compute_test` via the inherited env, so both sides agree on the layout. - **`VK_FUZZ_SKIP_CRASH=1`**: records `vk_compute_test` crashes (any exit other than 0/1/2/77 — e.g. the `0xC0000005` driver crashes seen on the AMD Windows Vulkan driver for ~2% of fuzz programs) as skips instead of aborting the whole batch. Harness errors (exit 1/2) stay fatal. ## Tested - `tests/test_vk_fuzz_run.py`: **17 tests OK** — new tests pin flag→translator-cmd, env→harness propagation, flag absent when unset, crash→skip, and exits 1+2 staying fatal under `VK_FUZZ_SKIP_CRASH=1`. - `compileall` clean; `check_no_game_data.py` clean. - Used in anger: the overnight fuzz campaign ran thousands of programs through this path on AMD iGPU + RTX 4070 SUPER. AI-assisted (Devin).
Translate with rdna2spirv.py --pc-tail-ubo when LEONIDA_PC_TAIL_UBO asks for it
(the 1/true/yes/on convention image_fuzz, lds_fuzz and valu_fuzz already use), so
the modules fit a device's 128-byte push-constant range; the variable also
reaches vk_compute_test through the inherited environment.

VK_FUZZ_SKIP_CRASH=1 records a vk_compute_test crash (the AMD Windows shader
compiler's access violation and the like) as a per-program skip instead of
aborting the batch; exit 1 (CHECK failures) and 2 (usage errors) stay fatal,
as does every non-zero exit without the variable.

Co-Authored-By: Devin <[email protected]>
VK_FUZZ_SKIP_CRASH treats every vk_compute_test exit outside 0/1/2/77 as a
driver crash skip, including the negative return codes Python uses for signal
deaths on POSIX. Spell that out in the module contract and cover it beside the
Windows access-violation case so exits 1/2 staying fatal is unambiguous.

Co-Authored-By: Devin <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:55:09 +00:00
Author
Owner

@⁠GeorgiyDemo on GitHub · 2026-11-25 03:20 UTC · original

Tested c69330afb on Apple M5 Pro (16-core GPU), macOS 26.7.3 (25G342), against main 0bc810504 (Python tool; no fuzzing campaign run):

  • pytest tests/test_vk_fuzz_run.py (pytest 9.2.0 from tests/requirements.txt): 17 passed, 24 subtests passed at this head. The same file on main: 2 failed, 15 passed, 22 subtests — test_pc_tail_ubo_env_passes_the_flag_and_propagates_to_vk_compute_test and test_skip_crash_records_a_crash_as_a_skip_but_keeps_harness_errors_fatal.
  • Not run: a real vk_fuzz_run campaign against a 128-byte push-constant device or a crash-prone driver; the unit tests are the evidence here.

AI-assisted; synthetic fixtures only, no game data.

**@⁠GeorgiyDemo** on GitHub · 2026-11-25 03:20 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1519#issuecomment-7151820765) Tested `c69330afb` on Apple M5 Pro (16-core GPU), macOS 26.7.3 (25G342), against `main` `0bc810504` (Python tool; no fuzzing campaign run): - `pytest tests/test_vk_fuzz_run.py` (pytest 9.2.0 from `tests/requirements.txt`): **17 passed, 24 subtests passed** at this head. The same file on `main`: **2 failed**, 15 passed, 22 subtests — `test_pc_tail_ubo_env_passes_the_flag_and_propagates_to_vk_compute_test` and `test_skip_crash_records_a_crash_as_a_skip_but_keeps_harness_errors_fatal`. - Not run: a real `vk_fuzz_run` campaign against a 128-byte push-constant device or a crash-prone driver; the unit tests are the evidence here. AI-assisted; synthetic fixtures only, no game data.
Author
Owner

@⁠ytsodacan on GitHub · 2026-11-25 03:33 UTC · original · edited 2026-11-25 03:45 UTC

[KEEP]

  • Scope is small and tested: tools/vk_fuzz_run.py gains LEONIDA_PC_TAIL_UBO -> --pc-tail-ubo and VK_FUZZ_SKIP_CRASH, with two new tests in tests/test_vk_fuzz_run.py (an existing comment reports 17 pass here vs 2 fail on main).
  • Harness exits 1/2 stay fatal under skip-crash, and the default behavior is unchanged when the variables are unset; no duplicate PR found.
  • CI is still pending (change-scope, no-game-data), so it is not yet green. Minor note for the author: skip-crash also treats any non-0/1/2/77 exit (e.g. signals) as a skip, which is intended but worth documenting.
  • Likely mergeable once CI passes.
**@⁠ytsodacan** on GitHub · 2026-11-25 03:33 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1519#issuecomment-7152031693) · edited 2026-11-25 03:45 UTC **[KEEP]** - Scope is small and tested: `tools/vk_fuzz_run.py` gains `LEONIDA_PC_TAIL_UBO` -> `--pc-tail-ubo` and `VK_FUZZ_SKIP_CRASH`, with two new tests in `tests/test_vk_fuzz_run.py` (an existing comment reports 17 pass here vs 2 fail on main). - Harness exits 1/2 stay fatal under skip-crash, and the default behavior is unchanged when the variables are unset; no duplicate PR found. - CI is still pending (`change-scope`, `no-game-data`), so it is not yet green. Minor note for the author: skip-crash also treats any non-0/1/2/77 exit (e.g. signals) as a skip, which is intended but worth documenting. - Likely mergeable once CI passes.
Author
Owner

@⁠tiguan26 on GitHub · 2026-11-25 03:54 UTC · original · approved these changes

Approving. Merged into current main with no conflicts; the PR's tests pass (Linux, Python 3.13). Both switches are opt-in with the defaults unchanged: LEONIDA_PC_TAIL_UBO adds --pc-tail-ubo to the translation, the same convention the other fuzzers use, and VK_FUZZ_SKIP_CRASH records a vk_compute_test crash as a skip while exit codes 1/2 (real results) still count.

AI-assisted (Claude).

**@⁠tiguan26** on GitHub · 2026-11-25 03:54 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1519#pullrequestreview-6051630865) · **approved these changes** Approving. Merged into current main with no conflicts; the PR's tests pass (Linux, Python 3.13). Both switches are opt-in with the defaults unchanged: LEONIDA_PC_TAIL_UBO adds --pc-tail-ubo to the translation, the same convention the other fuzzers use, and VK_FUZZ_SKIP_CRASH records a vk_compute_test crash as a skip while exit codes 1/2 (real results) still count. AI-assisted (Claude).
Author
Owner

@⁠whoalin1 on GitHub · 2026-11-25 16:36 UTC · original

Rebased onto current main (b0f3d3998) and pushed 383650dde.

Addressed @⁠ytsodacans skip-crash documentation note: the module contract now states explicitly that VK_FUZZ_SKIP_CRASH=1skips everyvk_compute_testexit outside0/1/2/77, including signal deaths reported by Python as negative return codes, while exits 1and2remain fatal harness/check failures. Added a negative-returncode unit case beside the Windows0xC0000005`-style case.

Verified locally with Python 3.14: tests/test_vk_fuzz_run.py 17/17 passing. AI-assisted (Devin).

**@⁠whoalin1** on GitHub · 2026-11-25 16:36 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1519#issuecomment-7168240898) Rebased onto current `main` (`b0f3d3998`) and pushed `383650dde`. Addressed @⁠ytsodacan`s skip-crash documentation note: the module contract now states explicitly that `VK_FUZZ_SKIP_CRASH=1` skips every `vk_compute_test` exit outside `0/1/2/77`, including signal deaths reported by Python as negative return codes, while exits `1` and `2` remain fatal harness/check failures. Added a negative-returncode unit case beside the Windows `0xC0000005`-style case. Verified locally with Python 3.14: `tests/test_vk_fuzz_run.py` 17/17 passing. AI-assisted (Devin).
Author
Owner

@⁠tiguan26 on GitHub · 2026-11-26 06:54 UTC · original · approved these changes

Approving 383650d. Merged into current main (a73a57e) with no conflicts; tests/test_vk_fuzz_run.py passes both standalone (17 tests) and under pytest (17 passed, 24 subtests). Linux, Python 3.13.

Both switches are opt-in and change nothing by default. --pc-tail-ubo is only added when LEONIDA_PC_TAIL_UBO is set, the same variable vk_compute_test reads. A crash recorded under VK_FUZZ_SKIP_CRASH becomes a reason string in results[i], which is already how run_programs reports a program with no result (translator refusal, unsupported device). So fmisc_diff.py and wint_diff.py treat it like the others. Keeping exits 1 and 2 fatal is right: those are harness or check failures, not driver crashes.

AI-assisted (Claude).

**@⁠tiguan26** on GitHub · 2026-11-26 06:54 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1519#pullrequestreview-6069728329) · **approved these changes** Approving 383650d. Merged into current main (a73a57e) with no conflicts; `tests/test_vk_fuzz_run.py` passes both standalone (17 tests) and under pytest (17 passed, 24 subtests). Linux, Python 3.13. Both switches are opt-in and change nothing by default. `--pc-tail-ubo` is only added when `LEONIDA_PC_TAIL_UBO` is set, the same variable `vk_compute_test` reads. A crash recorded under `VK_FUZZ_SKIP_CRASH` becomes a reason string in `results[i]`, which is already how `run_programs` reports a program with no result (translator refusal, unsupported device). So `fmisc_diff.py` and `wint_diff.py` treat it like the others. Keeping exits 1 and 2 fatal is right: those are harness or check failures, not driver crashes. AI-assisted (Claude).
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/1519/head:github-bot/gh-1519'
git switch 'github-bot/gh-1519'

Merge

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