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

Merged
leonida/mandy
whoalin1 merged 2 commits from vk-fuzz-run-pctail into main 2026-12-01 11:44:12 +00:00

Pull request successfully merged and closed

whoalin1 commented 2026-11-25 03:11:18 +00:00

Claimed in the coordination issue: https://github.com/ProjectLeonida/mandy/issues/14#issuecomment-7151670929

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

Claimed in the coordination issue: https://github.com/ProjectLeonida/mandy/issues/14#issuecomment-7151670929 ## 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).
GeorgiyDemo commented 2026-11-25 03:20:21 +00:00

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.

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.
ytsodacan commented 2026-11-25 03:33:53 +00:00

[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.
**[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.
tiguan26 approved these changes 2026-11-25 03:54:45 +00:00
tiguan26 left a comment

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

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).
whoalin1 commented 2026-11-25 16:36:06 +00:00

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

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).
tiguan26 approved these changes 2026-11-26 06:54:34 +00:00
tiguan26 left a comment

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

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).
zmasi commented 2026-11-28 23:36:59 +00:00

#1519 | head 8dfb9a9c9772b1dc0a9daf1a0e0582014426504d (merged cleanly with main ba8b77b390) | python -I tests/test_vk_fuzz_run.py -v + python -I tests/test_docs_env_vars.py + python -I tests/test_ci_registration.py | red on main: FAILED (failures=1, errors=1) (--pc-tail-ubo omitted under LEONIDA_PC_TAIL_UBO=yes and RuntimeError: cs_vkfuzz_0: vk_compute_test exit 3221225477 raised under VK_FUZZ_SKIP_CRASH=1) | green on PR+main: 18 ran, OK (test_vk_fuzz_run.py), 5 ran, OK (test_docs_env_vars.py), and 18 ran, OK (test_ci_registration.py) | Windows 11 (10.0.26200.9974), Python 3.12.10 | AI-assisted: yes

Audited rebased head 8dfb9a9c97 (tools/vk_fuzz_run.py and tests/test_vk_fuzz_run.py) merged cleanly onto main (ba8b77b390) on Windows 11 — first Windows verification report on this PR. Confirmed LEONIDA_PC_TAIL_UBO (1/true/yes/on) appends --pc-tail-ubo to rdna2spirv.py while keeping the env var inherited by vk_compute_test, VK_FUZZ_SKIP_CRASH=1 records Windows 0xC0000005 (3221225477) and negative signal exits as skips after retries while keeping harness exits 1 and 2 fatal, and scripts/check_no_game_data.py passes cleanly.

#1519 | head 8dfb9a9c9772b1dc0a9daf1a0e0582014426504d (merged cleanly with main ba8b77b390) | `python -I tests/test_vk_fuzz_run.py -v` + `python -I tests/test_docs_env_vars.py` + `python -I tests/test_ci_registration.py` | red on main: `FAILED (failures=1, errors=1)` (`--pc-tail-ubo` omitted under `LEONIDA_PC_TAIL_UBO=yes` and `RuntimeError: cs_vkfuzz_0: vk_compute_test exit 3221225477` raised under `VK_FUZZ_SKIP_CRASH=1`) | green on PR+main: `18 ran, OK` (`test_vk_fuzz_run.py`), `5 ran, OK` (`test_docs_env_vars.py`), and `18 ran, OK` (`test_ci_registration.py`) | Windows 11 (`10.0.26200.9974`), Python 3.12.10 | AI-assisted: yes Audited rebased head `8dfb9a9c97` (`tools/vk_fuzz_run.py` and `tests/test_vk_fuzz_run.py`) merged cleanly onto `main` (`ba8b77b390`) on Windows 11 — first Windows verification report on this PR. Confirmed `LEONIDA_PC_TAIL_UBO` (`1`/`true`/`yes`/`on`) appends `--pc-tail-ubo` to `rdna2spirv.py` while keeping the env var inherited by `vk_compute_test`, `VK_FUZZ_SKIP_CRASH=1` records Windows `0xC0000005` (`3221225477`) and negative signal exits as skips after retries while keeping harness exits `1` and `2` fatal, and `scripts/check_no_game_data.py` passes cleanly.
TheGeogeo commented 2026-11-29 14:17:54 +00:00

Ready for testing: merges cleanly with main 3535eb5c4. Not in main yet: git cherry finds 2 commit(s) not there, and 14 of the 73 lines it adds are already present. No duplicate found: it carries no claim ID, and no other open pull request has the same title.

AI-assisted (Claude Code).

Ready for testing: merges cleanly with `main` `3535eb5c4`. Not in `main` yet: `git cherry` finds 2 commit(s) not there, and 14 of the 73 lines it adds are already present. No duplicate found: it carries no claim ID, and no other open pull request has the same title. AI-assisted (Claude Code).
enlight3d commented 2026-11-29 15:28:25 +00:00

RUN comment, PR #1519 (vk_fuzz_run: --pc-tail-ubo under LEONIDA_PC_TAIL_UBO, VK_FUZZ_SKIP_CRASH)

Heads: PR 8dfb9a9c9, main 91bab934d (local merge of the PR into it, not pushed).
Kind: Python tool (tools/vk_fuzz_run.py) + tests/test_vk_fuzz_run.py. The tests use a fake GPU child process, no GPU run.

Commands (repo root):
python -I tests/test_vk_fuzz_run.py
python -I tests/test_cf_gpu_run.py and python -I tests/test_fmisc_diff.py (other tests that import vk_fuzz_run, merged tree)

RED (behavioural, only environment variables are added): tools/vk_fuzz_run.py put back to the merge-base version, tests kept.
test_vk_fuzz_run.py: 2 of 18 fail: test_pc_tail_ubo_env_passes_the_flag_and_propagates_to_vk_compute_test ('--pc-tail-ubo' not in the translate command) and test_skip_crash_records_a_crash_as_a_skip_but_keeps_harness_errors_fatal (RuntimeError, exit 3221225477 not skipped).
GREEN at the PR head: test_vk_fuzz_run 18/18.
GREEN merged into main: test_vk_fuzz_run 18/18, test_cf_gpu_run 17/17, test_fmisc_diff 34/34.

Machine: Windows 11 Pro, RTX 3090 24 GB, NVIDIA 621.40, Python 3.13.12 (uv build), run with python -I, one process per test file.

RUN comment, PR #1519 (vk_fuzz_run: --pc-tail-ubo under LEONIDA_PC_TAIL_UBO, VK_FUZZ_SKIP_CRASH) Heads: PR 8dfb9a9c9, main 91bab934d (local merge of the PR into it, not pushed). Kind: Python tool (tools/vk_fuzz_run.py) + tests/test_vk_fuzz_run.py. The tests use a fake GPU child process, no GPU run. Commands (repo root): python -I tests/test_vk_fuzz_run.py python -I tests/test_cf_gpu_run.py and python -I tests/test_fmisc_diff.py (other tests that import vk_fuzz_run, merged tree) RED (behavioural, only environment variables are added): tools/vk_fuzz_run.py put back to the merge-base version, tests kept. test_vk_fuzz_run.py: 2 of 18 fail: test_pc_tail_ubo_env_passes_the_flag_and_propagates_to_vk_compute_test ('--pc-tail-ubo' not in the translate command) and test_skip_crash_records_a_crash_as_a_skip_but_keeps_harness_errors_fatal (RuntimeError, exit 3221225477 not skipped). GREEN at the PR head: test_vk_fuzz_run 18/18. GREEN merged into main: test_vk_fuzz_run 18/18, test_cf_gpu_run 17/17, test_fmisc_diff 34/34. Machine: Windows 11 Pro, RTX 3090 24 GB, NVIDIA 621.40, Python 3.13.12 (uv build), run with `python -I`, one process per test file.
MoonEyes commented 2026-11-29 18:31:11 +00:00

Tested 8dfb9a9c9 merged (no commit) with main 4755667f5: Python 3.12, Windows 11 10.0.26300, CPU only. Ran the PR's tests plus every test file that imports the changed tool.

  • Green: python -I tests/test_vk_fuzz_run.py gives 18 OK.
  • Red with tools/vk_fuzz_run.py back to main: FAILED (failures=1, errors=1).
  • Does not force a rebase of #2566 (merge-tree against 8db8335d2).

AI-assisted (Claude Code).

Tested `8dfb9a9c9` merged (no commit) with `main` `4755667f5`: Python 3.12, Windows 11 10.0.26300, CPU only. Ran the PR's tests plus every test file that imports the changed tool. - Green: `python -I tests/test_vk_fuzz_run.py` gives 18 OK. - Red with `tools/vk_fuzz_run.py` back to `main`: `FAILED (failures=1, errors=1)`. - Does not force a rebase of #2566 (merge-tree against `8db8335d2`). AI-assisted (Claude Code).
whoalin1 commented 2026-11-30 22:27:44 +00:00

Rebased onto current main as 41c49ee83 to refresh the stale CI baseline; the branch reapplied cleanly with no conflicts. Validation after rebase: python -I tests/test_vk_fuzz_run.py -v passes 18/18, py_compile and git diff --check are clean.

Rebased onto current `main` as `41c49ee83` to refresh the stale CI baseline; the branch reapplied cleanly with no conflicts. Validation after rebase: `python -I tests/test_vk_fuzz_run.py -v` passes **18/18**, `py_compile` and `git diff --check` are clean.
whoalin1 commented 2026-11-30 22:45:34 +00:00

Current head 41c49ee83 is mergeable with all visible checks green after the rebase. Existing approvals remain on the same narrow XMA decoder fix; is anything else needed before merge?

Current head `41c49ee83` is mergeable with all visible checks green after the rebase. Existing approvals remain on the same narrow XMA decoder fix; is anything else needed before merge?
MoonEyes commented 2026-12-01 08:02:48 +00:00

Verified by MoonEyes (another person than the author) on head 41c49ee83 merged with main 501b3e6c5: Windows 11, Python 3.14, no GPU and no SPIR-V tools used beyond what the tests find here. tests/test_vk_fuzz_run.py 18 OK; with tools/vk_fuzz_run.py back to main, 1 failure and 1 error. I read the diff: the tool and its test (and a docs line for #1659), nothing the game's build uses.

AI-assisted (Claude Code).

Verified by MoonEyes (another person than the author) on head `41c49ee83` merged with `main` `501b3e6c5`: Windows 11, Python 3.14, no GPU and no SPIR-V tools used beyond what the tests find here. `tests/test_vk_fuzz_run.py` 18 OK; with `tools/vk_fuzz_run.py` back to `main`, 1 failure and 1 error. I read the diff: the tool and its test (and a docs line for #1659), nothing the game's build uses. AI-assisted (Claude Code).
imShangLi commented 2026-12-01 10:01:34 +00:00

VERIFY-1519 — Linux, Python 3.15, no GPU device, no game files

Verdict: PASS — the two additions are in the tool, and the new tests look at the code that decides them.

Head 41c49ee8, base b1f91c2f (the merge-base with the current main), 2 files, +88/−1: tools/vk_fuzz_run.py and tests/test_vk_fuzz_run.py.

1. Its own suite, and the three rows

row tree tests/test_vk_fuzz_run.py
A main 0259473b + this PR 18 tests, OK
B clean main + only this PR's test change (patched) 18 tests, FAILED (failures=1, errors=1)

Row B's failure is an assertion:

FAIL: test_pc_tail_ubo_env_passes_the_flag_and_propagates_to_vk_compute_test
  self.assertIn("--pc-tail-ubo", translate_cmds[0])
  AssertionError: '--pc-tail-ubo' not found in
    ['/usr/bin/python3', '-I', '.../tools/rdna2spirv.py', '.../disasm', '--out', '.../spirv']

The error beside it is the same cause on the other axis: with main's tool, VK_FUZZ_SKIP_CRASH=1 is not read, so a vk_compute_test that dies with 3221225477 raises RuntimeError instead of being recorded as a skip.

2. Discrimination: does the new test look at the changed code?

A test that passes with the fix and without it proves nothing, so I reverted tools/vk_fuzz_run.py alone to main's copy on the green tree and ran the new tests:

tree result
PR head, tools/vk_fuzz_run.py reverted to main's AssertionError (the new tests go red)

3. What the change does, read in the code

Two additions to tools/vk_fuzz_run.py:

  • LEONIDA_PC_TAIL_UBO — the value is read with the same convention the other fuzzers use (1/true/yes/on, case-insensitive, stripped) and appends --pc-tail-ubo to the rdna2spirv.py command. The variable reaches vk_compute_test through the inherited environment, so both sides agree on the layout; the test checks both the flag on the translator's command line and the variable in the child's environment.
  • VK_FUZZ_SKIP_CRASH — a vk_compute_test exit that is not 0, 77, 1 or 2 is recorded as a skip (vk_compute_test: crashed (exit N)) instead of aborting the batch. Exits 1 and 2 stay fatal, because they are a harness CHECK failure and a usage error rather than a driver crash.

Two things the tests pin that the pull request's text does not spell out, and that I checked in the code as well:

  • A signal death on POSIX is a negative return code (-11), and it is a crash skip too: the check is returncode not in (0, 77) and not in (1, 2), so -11 lands on the skip side. The test covers it.
  • Without VK_FUZZ_SKIP_CRASH set, a crash is still fatal; the test covers that too.

4. What I did not check

  • vk_compute_test itself is not run here: the tests substitute a fake child process, so the 128-byte push-constant layout and the real driver's crash are not exercised. --pc-tail-ubo is checked as a command-line argument and an environment variable, not as a translated module that fits a 128-byte device.
  • The AMD Windows Vulkan driver crash the option is written for (the 0xC0000005 in 3221225477) was not seen; the test supplies that number.
  • I did not check whether the other fuzzers (image_fuzz, lds_fuzz, valu_fuzz) need the same VK_FUZZ_SKIP_CRASH; this change touches vk_fuzz_run.py only.

5. Neighbours

tests/test_vk_fuzz_run.py is the only test file this touches, and no other test imports tools/vk_fuzz_run.py.

AI-assisted: MiniMax M3.1 Flash.

## VERIFY-1519 — Linux, Python 3.15, no GPU device, no game files **Verdict: PASS** — the two additions are in the tool, and the new tests look at the code that decides them. Head `41c49ee8`, base `b1f91c2f` (the merge-base with the current `main`), 2 files, +88/−1: `tools/vk_fuzz_run.py` and `tests/test_vk_fuzz_run.py`. ### 1. Its own suite, and the three rows | row | tree | `tests/test_vk_fuzz_run.py` | |---|---|---| | A | `main` `0259473b` + this PR | **18 tests, OK** | | B | clean `main` + **only this PR's test change** (patched) | **18 tests, FAILED (failures=1, errors=1)** | Row B's failure is an assertion: ``` FAIL: test_pc_tail_ubo_env_passes_the_flag_and_propagates_to_vk_compute_test self.assertIn("--pc-tail-ubo", translate_cmds[0]) AssertionError: '--pc-tail-ubo' not found in ['/usr/bin/python3', '-I', '.../tools/rdna2spirv.py', '.../disasm', '--out', '.../spirv'] ``` The error beside it is the same cause on the other axis: with `main`'s tool, `VK_FUZZ_SKIP_CRASH=1` is not read, so a `vk_compute_test` that dies with `3221225477` raises `RuntimeError` instead of being recorded as a skip. ### 2. Discrimination: does the new test look at the changed code? A test that passes with the fix and without it proves nothing, so I reverted `tools/vk_fuzz_run.py` alone to `main`'s copy on the green tree and ran the new tests: | tree | result | |---|---| | PR head, `tools/vk_fuzz_run.py` reverted to `main`'s | **AssertionError** (the new tests go red) | ### 3. What the change does, read in the code Two additions to `tools/vk_fuzz_run.py`: - **`LEONIDA_PC_TAIL_UBO`** — the value is read with the same convention the other fuzzers use (`1`/`true`/`yes`/`on`, case-insensitive, stripped) and appends `--pc-tail-ubo` to the `rdna2spirv.py` command. The variable reaches `vk_compute_test` through the inherited environment, so both sides agree on the layout; the test checks both the flag on the translator's command line and the variable in the child's environment. - **`VK_FUZZ_SKIP_CRASH`** — a `vk_compute_test` exit that is not `0`, `77`, `1` or `2` is recorded as a skip (`vk_compute_test: crashed (exit N)`) instead of aborting the batch. Exits `1` and `2` stay fatal, because they are a harness `CHECK` failure and a usage error rather than a driver crash. Two things the tests pin that the pull request's text does not spell out, and that I checked in the code as well: - A **signal death** on POSIX is a negative return code (`-11`), and it is a crash skip too: the check is `returncode not in (0, 77)` and `not in (1, 2)`, so `-11` lands on the skip side. The test covers it. - Without `VK_FUZZ_SKIP_CRASH` set, a crash is still fatal; the test covers that too. ### 4. What I did not check - `vk_compute_test` itself is not run here: the tests substitute a fake child process, so the 128-byte push-constant layout and the real driver's crash are not exercised. `--pc-tail-ubo` is checked as a command-line argument and an environment variable, not as a translated module that fits a 128-byte device. - The AMD Windows Vulkan driver crash the option is written for (the `0xC0000005` in `3221225477`) was not seen; the test supplies that number. - I did not check whether the other fuzzers (`image_fuzz`, `lds_fuzz`, `valu_fuzz`) need the same `VK_FUZZ_SKIP_CRASH`; this change touches `vk_fuzz_run.py` only. ### 5. Neighbours `tests/test_vk_fuzz_run.py` is the only test file this touches, and no other test imports `tools/vk_fuzz_run.py`. AI-assisted: MiniMax M3.1 Flash.
imShangLi commented 2026-12-01 10:43:00 +00:00

6. The whole standalone suite, against the same runner on a clean tree

I ran the repository's standalone test runner over main 0259473b + this pull request and over a clean main tree, and compared the lists:

tree run passed failed skipped
main + this PR 638 637 1 33
clean main 0259473b 638 637 1 33
$ diff <(sort passed-main) <(sort passed-with-1519)
(no difference)
$ diff <(sort skipped-main) <(sort skipped-with-1519)
(no difference)

The one failure is tests/test_run_semantic_tests.py on all three trees: two tests of the runner's SIGINT handling (communicate(timeout=5) times out on this machine, and one expects exit code 130 and gets 0). It is red on the clean tree as well, so it is not this change's.

AI-assisted: MiniMax M3.1 Flash.

One thing about this head, since it cost me a measurement and would cost a reviewer the same: this branch's head is 41c49ee83 (2026-11-30 22:27 UTC) and it is 114 commits behind the current main 0259473b, so a checkout of the head alone does not contain tests/test_red_green.py or tests/test_live_prompt_glyphs.py, and the suite over the bare head runs 636 files rather than 638. The numbers in the table above are from main + this pull request merged, which is the tree a reviewer would build. The merge is clean.

### 6. The whole standalone suite, against the same runner on a clean tree I ran the repository's standalone test runner over `main` `0259473b` + this pull request and over a clean `main` tree, and compared the lists: | tree | run | passed | failed | skipped | |---|---|---|---|---| | `main` + this PR | 638 | 637 | 1 | 33 | | clean `main` `0259473b` | 638 | 637 | 1 | 33 | ``` $ diff <(sort passed-main) <(sort passed-with-1519) (no difference) $ diff <(sort skipped-main) <(sort skipped-with-1519) (no difference) ``` The one failure is `tests/test_run_semantic_tests.py` on all three trees: two tests of the runner's SIGINT handling (`communicate(timeout=5)` times out on this machine, and one expects exit code 130 and gets 0). It is red on the clean tree as well, so it is not this change's. AI-assisted: MiniMax M3.1 Flash. One thing about this head, since it cost me a measurement and would cost a reviewer the same: this branch's head is `41c49ee83` (2026-11-30 22:27 UTC) and it is **114 commits behind the current `main` `0259473b`**, so a checkout of the head alone does not contain `tests/test_red_green.py` or `tests/test_live_prompt_glyphs.py`, and the suite over the bare head runs 636 files rather than 638. The numbers in the table above are from `main` + this pull request merged, which is the tree a reviewer would build. The merge is clean.
aslan2142 approved these changes 2026-12-01 11:42:52 +00:00
aslan2142 left a comment

Reviewed tools/vk_fuzz_run.py and tests/test_vk_fuzz_run.py on head 41c49ee. Both LEONIDA_PC_TAIL_UBO (forwarding --pc-tail-ubo to rdna2spirv.py and preserving the env var for vk_compute_test) and VK_FUZZ_SKIP_CRASH (recording non-0/1/2/77 crash exits including POSIX signals as skips while keeping exits 1 and 2 fatal) are opt-in, standard-library-only, clean-room, and covered by unit tests. Mergeable cleanly with all 5 CI checks green. Approving and merging.

(AI-assisted review.)

Reviewed `tools/vk_fuzz_run.py` and `tests/test_vk_fuzz_run.py` on head `41c49ee`. Both `LEONIDA_PC_TAIL_UBO` (forwarding `--pc-tail-ubo` to `rdna2spirv.py` and preserving the env var for `vk_compute_test`) and `VK_FUZZ_SKIP_CRASH` (recording non-`0/1/2/77` crash exits including POSIX signals as skips while keeping exits `1` and `2` fatal) are opt-in, standard-library-only, clean-room, and covered by unit tests. Mergeable cleanly with all 5 CI checks green. Approving and merging. *(AI-assisted review.)*
imShangLi commented 2026-12-01 13:33:21 +00:00

A note on this machine's graphics, so "no GPU device" is not misread

I said above that this host has no GPU device. That is true of the Vulkan device, and I should be precise about which path I mean, because the two paths differ here and a reader could otherwise take my wording the wrong way.

What this machine is. A VMware Workstation guest (Fedora 45) on a host with a Radeon 780M. There is no PCI passthrough: the only display device inside the guest is the virtual VMware SVGA II (15ad:0405) driven by vmwgfx, and there is no AMD PCI ID anywhere in the guest.

There is no Vulkan hardware device here. mesa's svga driver has no Vulkan backend, so the loader enumerates nothing by default; with VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/lvp_icd.x86_64.json it enumerates exactly one device, llvmpipe (LLVM 23.1.5, 256 bits) — a CPU software implementation. So no real GPU, no CUDA, no ROCm.

The OpenGL path is hardware-accelerated, though. The guest's SVGA3D calls are forwarded by the host-side VMware renderer to the host's Radeon 780M. The evidence I measured, comparing the default path with LIBGL_ALWAYS_SOFTWARE=1:

default:   OpenGL vendor string: VMware, Inc.   renderer: SVGA3D; build: RELEASE; LLVM;
software:  OpenGL vendor string: Mesa           renderer: llvmpipe (LLVM 23.1.5, 256 bits)

GL_VENDOR = "VMware, Inc." appears only when the commands leave the guest for the host's renderer; llvmpipe runs entirely on the guest's CPU. glxinfo -B also reports Video memory: 2048MB, direct rendering: Yes, OpenGL core profile 4.3 (Mesa 26.2.7), and vmwgfx's kernel capabilities include 3D; GNOME logs Created gbm renderer for '/dev/dri/card0' and the session is Wayland.

What follows for the verification above. Anything that needs a real GPU device or driver is invalid on this host, and none of my conclusions rest on one: the tests I ran are CPU-only, and the tool they measure is a Python script. Where a measured number came from this machine's GPU stack, it says so.

Two things I checked that a reader might otherwise assume. glxinfo's Accelerated: no is not evidence that 3D acceleration is off — that field comes from mesa's GLX_MESA_query_renderer, which cannot see an acceleration that happens on the host side. And OpenGL throughput on this host does not stand for real hardware: in my own measurements the software path was faster than SVGA3D for small, tightly-synchronised batches (713 vs 1061 draws/s in an off-screen rasterisation loop; 88 vs 308-692 FPS in glxgears), because SVGA3D pays a synchronisation round trip across the virtualisation boundary while llvmpipe rasterises locally. That says nothing about which path a real application would take — the vendor string settles that — and it is a reminder that a frame-rate number from here is not a hardware result.

AI-assisted: MiniMax M3.1 Flash.

### A note on this machine's graphics, so "no GPU device" is not misread I said above that this host has no GPU device. That is true of the **Vulkan** device, and I should be precise about which path I mean, because the two paths differ here and a reader could otherwise take my wording the wrong way. **What this machine is.** A VMware Workstation guest (Fedora 45) on a host with a Radeon 780M. There is **no PCI passthrough**: the only display device inside the guest is the virtual `VMware SVGA II (15ad:0405)` driven by `vmwgfx`, and there is no AMD PCI ID anywhere in the guest. **There is no Vulkan hardware device here.** mesa's svga driver has no Vulkan backend, so the loader enumerates nothing by default; with `VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/lvp_icd.x86_64.json` it enumerates exactly one device, `llvmpipe (LLVM 23.1.5, 256 bits)` — a **CPU software implementation**. So no real GPU, no CUDA, no ROCm. **The OpenGL path is hardware-accelerated, though.** The guest's SVGA3D calls are forwarded by the host-side VMware renderer to the host's Radeon 780M. The evidence I measured, comparing the default path with `LIBGL_ALWAYS_SOFTWARE=1`: ``` default: OpenGL vendor string: VMware, Inc. renderer: SVGA3D; build: RELEASE; LLVM; software: OpenGL vendor string: Mesa renderer: llvmpipe (LLVM 23.1.5, 256 bits) ``` `GL_VENDOR = "VMware, Inc."` appears only when the commands leave the guest for the host's renderer; llvmpipe runs entirely on the guest's CPU. `glxinfo -B` also reports `Video memory: 2048MB`, `direct rendering: Yes`, OpenGL core profile 4.3 (Mesa 26.2.7), and `vmwgfx`'s kernel capabilities include `3D`; GNOME logs `Created gbm renderer for '/dev/dri/card0'` and the session is Wayland. **What follows for the verification above.** Anything that needs a real GPU **device** or **driver** is invalid on this host, and none of my conclusions rest on one: the tests I ran are CPU-only, and the tool they measure is a Python script. Where a measured number came from this machine's GPU stack, it says so. Two things I checked that a reader might otherwise assume. `glxinfo`'s **`Accelerated: no`** is not evidence that 3D acceleration is off — that field comes from mesa's `GLX_MESA_query_renderer`, which cannot see an acceleration that happens on the host side. And **OpenGL throughput on this host does not stand for real hardware**: in my own measurements the software path was *faster* than SVGA3D for small, tightly-synchronised batches (713 vs 1061 draws/s in an off-screen rasterisation loop; 88 vs 308-692 FPS in `glxgears`), because SVGA3D pays a synchronisation round trip across the virtualisation boundary while llvmpipe rasterises locally. That says nothing about which path a real application would take — the vendor string settles that — and it is a reminder that a frame-rate number from here is not a hardware result. AI-assisted: MiniMax M3.1 Flash.
imShangLi commented 2026-12-01 13:46:31 +00:00

Correction to my note above: the frame-rate comparison was not controlled

My note above said that on this host the software path measured faster than SVGA3D (713 vs 1061 draws/s in an off-screen rasterisation loop; 88 vs 308-692 FPS in glxgears), and put that down to SVGA3D paying a synchronisation round trip across the virtualisation boundary. That comparison was uncontrolled and the conclusion from it was wrong. I used the default window size and the default swap interval, and the ranking flips with those.

With the window size and the swap interval fixed, glxgears on this host gives:

window swap interval SVGA3D llvmpipe the faster one
300x300 0 (vsync off) 1349 FPS 342 FPS SVGA3D, 3.9x
1024x768 0 (vsync off) 638 FPS 152 FPS SVGA3D, 4.2x
300x300 1 (vsync on) 55 FPS 546 FPS llvmpipe

The two figures I quoted before were the default window with the default swap interval, which is the one combination that happens to favour the software path. So:

  • A frame rate from this host is not a hardware result — that part of my note stands, and this table is the better illustration of why. The same two binaries swap places depending on two settings.
  • Which path is in use is settled by GL_VENDOR / GL_RENDERER (VMware, Inc. / SVGA3D versus Mesa / llvmpipe), never by the frame rate.
  • SVGA3D's cost is a synchronisation round trip per flush, so it is not necessarily ahead of a local software rasteriser on small, tightly-synchronised batches; its advantage shows on larger, GPU-bound batches, which is what the two vsync-off rows above are.

One difference worth recording so the numbers are not read as a reproduction: in the vsync-on row my llvmpipe run reached 546 FPS where the other run on this host reached 89 FPS for the same setting. This is a Wayland session and the swap interval is not honoured identically on the two paths, so the vsync-on row is not a like-for-like comparison between them; the two vsync-off rows are.

AI-assisted: MiniMax M3.1 Flash.

### Correction to my note above: the frame-rate comparison was not controlled My note above said that on this host the software path measured *faster* than SVGA3D (713 vs 1061 draws/s in an off-screen rasterisation loop; 88 vs 308-692 FPS in `glxgears`), and put that down to SVGA3D paying a synchronisation round trip across the virtualisation boundary. **That comparison was uncontrolled and the conclusion from it was wrong.** I used the default window size and the default swap interval, and the ranking flips with those. With the window size and the swap interval fixed, `glxgears` on this host gives: | window | swap interval | SVGA3D | llvmpipe | the faster one | |---|---|---|---|---| | 300x300 | 0 (vsync off) | **1349 FPS** | 342 FPS | SVGA3D, 3.9x | | 1024x768 | 0 (vsync off) | **638 FPS** | 152 FPS | SVGA3D, 4.2x | | 300x300 | 1 (vsync on) | 55 FPS | **546 FPS** | llvmpipe | The two figures I quoted before were the default window with the default swap interval, which is the one combination that happens to favour the software path. So: - **A frame rate from this host is not a hardware result** — that part of my note stands, and this table is the better illustration of why. The same two binaries swap places depending on two settings. - **Which path is in use is settled by `GL_VENDOR` / `GL_RENDERER`** (`VMware, Inc.` / `SVGA3D` versus `Mesa` / `llvmpipe`), never by the frame rate. - SVGA3D's cost is a synchronisation round trip per flush, so it is not necessarily ahead of a local software rasteriser on small, tightly-synchronised batches; its advantage shows on larger, GPU-bound batches, which is what the two vsync-off rows above are. One difference worth recording so the numbers are not read as a reproduction: in the vsync-on row my llvmpipe run reached 546 FPS where the other run on this host reached 89 FPS for the same setting. This is a Wayland session and the swap interval is not honoured identically on the two paths, so the vsync-on row is not a like-for-like comparison between them; the two vsync-off rows are. AI-assisted: MiniMax M3.1 Flash.
Sign in to join this conversation.
No description provided.