vk_fuzz_run: --pc-tail-ubo under LEONIDA_PC_TAIL_UBO, VK_FUZZ_SKIP_CRASH for driver crashes #1519
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1519"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ubiquitarianism/leonida. Originally posted by whoalin1 on 2026-11-25T03:11:18Z.
Claimed in the coordination issue: https://github.com/ProjectLeonida/mandy/issues/14#issuecomment-7151670929
What
Two small
tools/vk_fuzz_run.pyadditions 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 asimage_fuzz/lds_fuzz/valu_fuzz), the flag is appended to therdna2spirv.pycall so translated shaders fit 128-byte push-constant devices. The variable reachesvk_compute_testvia the inherited env, so both sides agree on the layout.VK_FUZZ_SKIP_CRASH=1: recordsvk_compute_testcrashes (any exit other than 0/1/2/77 — e.g. the0xC0000005driver 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 underVK_FUZZ_SKIP_CRASH=1.compileallclean;check_no_game_data.pyclean.AI-assisted (Devin).
Imported from ubiquitarianism/leonida. Originally posted by GeorgiyDemo on 2026-11-25T03:20:21Z.
Tested
c69330afbon Apple M5 Pro (16-core GPU), macOS 26.7.3 (25G342), againstmain0bc810504(Python tool; no fuzzing campaign run):pytest tests/test_vk_fuzz_run.py(pytest 9.2.0 fromtests/requirements.txt): 17 passed, 24 subtests passed at this head. The same file onmain: 2 failed, 15 passed, 22 subtests —test_pc_tail_ubo_env_passes_the_flag_and_propagates_to_vk_compute_testandtest_skip_crash_records_a_crash_as_a_skip_but_keeps_harness_errors_fatal.vk_fuzz_runcampaign 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.
Imported from ubiquitarianism/leonida. Originally posted by ytsodacan on 2026-11-25T03:33:53Z.
[KEEP]
tools/vk_fuzz_run.pygainsLEONIDA_PC_TAIL_UBO->--pc-tail-uboandVK_FUZZ_SKIP_CRASH, with two new tests intests/test_vk_fuzz_run.py(an existing comment reports 17 pass here vs 2 fail on main).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.Imported from ubiquitarianism/leonida. Originally posted by tiguan26 on 2026-11-25T03:54:45Z.
Review: APPROVED
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).
Imported from ubiquitarianism/leonida. Originally posted by whoalin1 on 2026-11-25T16:36:06Z.
Rebased onto current
main(b0f3d3998) and pushed383650dde.Addressed @ytsodacan
s skip-crash documentation note: the module contract now states explicitly thatVK_FUZZ_SKIP_CRASH=1skips everyvk_compute_testexit outside0/1/2/77, including signal deaths reported by Python as negative return codes, while exits1and2remain 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.py17/17 passing. AI-assisted (Devin).Imported from ubiquitarianism/leonida. Originally posted by tiguan26 on 2026-11-26T06:54:34Z.
Review: APPROVED
Approving
383650d. Merged into current main (a73a57e) with no conflicts;tests/test_vk_fuzz_run.pypasses 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-ubois only added whenLEONIDA_PC_TAIL_UBOis set, the same variablevk_compute_testreads. A crash recorded underVK_FUZZ_SKIP_CRASHbecomes a reason string inresults[i], which is already howrun_programsreports a program with no result (translator refusal, unsupported device). Sofmisc_diff.pyandwint_diff.pytreat it like the others. Keeping exits 1 and 2 fatal is right: those are harness or check failures, not driver crashes.AI-assisted (Claude).
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T23:36:59Z.
#1519 | head
8dfb9a9c97(merged cleanly with mainba8b77b390) |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-uboomitted underLEONIDA_PC_TAIL_UBO=yesandRuntimeError: cs_vkfuzz_0: vk_compute_test exit 3221225477raised underVK_FUZZ_SKIP_CRASH=1) | green on PR+main:18 ran, OK(test_vk_fuzz_run.py),5 ran, OK(test_docs_env_vars.py), and18 ran, OK(test_ci_registration.py) | Windows 11 (10.0.26200.9974), Python 3.12.10 | AI-assisted: yesAudited rebased head
8dfb9a9c97(tools/vk_fuzz_run.pyandtests/test_vk_fuzz_run.py) merged cleanly ontomain(ba8b77b390) on Windows 11 — first Windows verification report on this PR. ConfirmedLEONIDA_PC_TAIL_UBO(1/true/yes/on) appends--pc-tail-ubotordna2spirv.pywhile keeping the env var inherited byvk_compute_test,VK_FUZZ_SKIP_CRASH=1records Windows0xC0000005(3221225477) and negative signal exits as skips after retries while keeping harness exits1and2fatal, andscripts/check_no_game_data.pypasses cleanly.Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-29T14:17:54Z.
Ready for testing: merges cleanly with
main3535eb5c4. Not inmainyet:git cherryfinds 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).
Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-11-29T15:28:25Z.
RUN comment, PR #1519 (vk_fuzz_run: --pc-tail-ubo under LEONIDA_PC_TAIL_UBO, VK_FUZZ_SKIP_CRASH)
Heads: PR
8dfb9a9c9, main91bab934d(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.Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-29T18:31:11Z.
Tested
8dfb9a9c9merged (no commit) withmain4755667f5: Python 3.12, Windows 11 10.0.26300, CPU only. Ran the PR's tests plus every test file that imports the changed tool.python -I tests/test_vk_fuzz_run.pygives 18 OK.tools/vk_fuzz_run.pyback tomain:FAILED (failures=1, errors=1).8db8335d2).AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by whoalin1 on 2026-11-30T22:27:44Z.
Rebased onto current
mainas41c49ee83to refresh the stale CI baseline; the branch reapplied cleanly with no conflicts. Validation after rebase:python -I tests/test_vk_fuzz_run.py -vpasses 18/18,py_compileandgit diff --checkare clean.Imported from ubiquitarianism/leonida. Originally posted by whoalin1 on 2026-11-30T22:45:34Z.
Current head
41c49ee83is 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?Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-01T08:02:48Z.
Verified by MoonEyes (another person than the author) on head
41c49ee83merged withmain501b3e6c5: Windows 11, Python 3.14, no GPU and no SPIR-V tools used beyond what the tests find here.tests/test_vk_fuzz_run.py18 OK; withtools/vk_fuzz_run.pyback tomain, 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).
Imported from ubiquitarianism/leonida. Originally posted by imShangLi on 2026-12-01T10:01:34Z.
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, baseb1f91c2f(the merge-base with the currentmain), 2 files, +88/−1:tools/vk_fuzz_run.pyandtests/test_vk_fuzz_run.py.1. Its own suite, and the three rows
tests/test_vk_fuzz_run.pymain0259473b+ this PRmain+ only this PR's test change (patched)Row B's failure is an assertion:
The error beside it is the same cause on the other axis: with
main's tool,VK_FUZZ_SKIP_CRASH=1is not read, so avk_compute_testthat dies with3221225477raisesRuntimeErrorinstead 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.pyalone tomain's copy on the green tree and ran the new tests:tools/vk_fuzz_run.pyreverted tomain's3. 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-uboto therdna2spirv.pycommand. The variable reachesvk_compute_testthrough 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— avk_compute_testexit that is not0,77,1or2is recorded as a skip (vk_compute_test: crashed (exit N)) instead of aborting the batch. Exits1and2stay fatal, because they are a harnessCHECKfailure 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:
-11), and it is a crash skip too: the check isreturncode not in (0, 77)andnot in (1, 2), so-11lands on the skip side. The test covers it.VK_FUZZ_SKIP_CRASHset, a crash is still fatal; the test covers that too.4. What I did not check
vk_compute_testitself 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-ubois checked as a command-line argument and an environment variable, not as a translated module that fits a 128-byte device.0xC0000005in3221225477) was not seen; the test supplies that number.image_fuzz,lds_fuzz,valu_fuzz) need the sameVK_FUZZ_SKIP_CRASH; this change touchesvk_fuzz_run.pyonly.5. Neighbours
tests/test_vk_fuzz_run.pyis the only test file this touches, and no other test importstools/vk_fuzz_run.py.AI-assisted: MiniMax M3.1 Flash.
Imported from ubiquitarianism/leonida. Originally posted by imShangLi on 2026-12-01T10:43:00Z.
6. The whole standalone suite, against the same runner on a clean tree
I ran the repository's standalone test runner over
main0259473b+ this pull request and over a cleanmaintree, and compared the lists:main+ this PRmain0259473bThe one failure is
tests/test_run_semantic_tests.pyon 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 currentmain0259473b, so a checkout of the head alone does not containtests/test_red_green.pyortests/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 frommain+ this pull request merged, which is the tree a reviewer would build. The merge is clean.Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T11:42:52Z.
Review: APPROVED
Reviewed
tools/vk_fuzz_run.pyandtests/test_vk_fuzz_run.pyon head41c49ee. BothLEONIDA_PC_TAIL_UBO(forwarding--pc-tail-ubotordna2spirv.pyand preserving the env var forvk_compute_test) andVK_FUZZ_SKIP_CRASH(recording non-0/1/2/77crash exits including POSIX signals as skips while keeping exits1and2fatal) 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.)
Imported from ubiquitarianism/leonida. Originally posted by imShangLi on 2026-12-01T13:33:21Z.
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 byvmwgfx, 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.jsonit 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: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 -Balso reportsVideo memory: 2048MB,direct rendering: Yes, OpenGL core profile 4.3 (Mesa 26.2.7), andvmwgfx's kernel capabilities include3D; GNOME logsCreated 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'sAccelerated: nois not evidence that 3D acceleration is off — that field comes from mesa'sGLX_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 inglxgears), 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.
Imported from ubiquitarianism/leonida. Originally posted by imShangLi on 2026-12-01T13:46:31Z.
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,
glxgearson this host gives: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:
GL_VENDOR/GL_RENDERER(VMware, Inc./SVGA3DversusMesa/llvmpipe), never by the frame rate.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.