Skip to content

GPU fuzzers: reject nonzero translator exits before dispatch - #8687

Open
WebIdentity1 wants to merge 1 commit into
ItsNotRexed:mainfrom
WebIdentity1:codex/gpu-fuzz-translator-status
Open

WebIdentity1 wants to merge 1 commit into
ItsNotRexed:mainfrom
WebIdentity1:codex/gpu-fuzz-translator-status

Conversation

@WebIdentity1

Copy link
Copy Markdown

Claimed in the coordination issue as: GPU fuzzer translator exit-status handling.

Depends on: #5057 (integration overlap only: its batching change replaces the run_gpu test seam; whichever lands second must adapt the regression fixtures. This fix is based on current main and does not require batching.)

What and why

lds_fuzz and valu_fuzz accepted a nonzero rdna2spirv exit whenever index.json existed. A translator failure after publishing its outputs could therefore still launch the GPU and report a successful campaign. A synthetic wrapper around the real translator reproduced this on both fuzzers: exit 23 followed by 1/1 match and CLI exit 0.

Check the translator return code before reading its index. The existing error handler now reports the exit status and diagnostic tail, returns 2, and prevents GPU dispatch. Successful partial translations retain their existing untranslated-program accounting. The production change is two lines per helper; no translation rules change.

The new standalone regression runs a real synthetic Python child that writes outputs before exiting. It covers LDS, VALU memory and VALU f16, failure statuses 1/23, complete success, absent index and partial index. Successful GPU stand-ins return the existing CPU model's words, which the real comparison path checks.

Tested

On macOS 27.2 arm64 / Python 3.14.7:

  • Negative control before the fix: all six late-failure subcases failed because the CLI incorrectly returned 0.
  • Focused fuzzer, work-isolation and CI-registration suites: 187 passed, 6 skipped, 64 subtests passed. Skips require optional AMD hardware/toolchain support.
  • python3 -I tests/test_gpu_fuzz_translator_status.py: 4 tests passed (15 subcases).
  • Full semantic suite: 447 files / 5,957 tests, with the same 48 failure identifiers in two files as the unchanged baseline (test_image_atomics_guard, test_image_store_d16). These are existing failures, not a clean full-suite result.
  • Actual Vulkan smoke checks using a matching vk_compute_test build: seed 2026112309, 20 programs per wave, emulated wave32 + wave64. Memory 40/40 and LDS 40/40 match; zero mismatches, skips, untranslated programs or harness errors. Apple M5 Ultra / MoltenVK 1.4.2 (Vulkan API 1.4.357), LLVM 23.1.2.
  • Combined with adjacent BOM-decoding PR lds_fuzz, valu_fuzz: handle UTF-8 BOM on index.json reads #6131: 91 passed, 5 skipped, 36 subtests passed. vk_compute_test --batch: GPU fuzzers run many programs on one Vulkan device (15x to 80x faster, same results bit for bit) #5057's production helper changes merge automatically; its existing C++ conflicts with main and the changed dispatch test seam remain separate integration work.
  • compileall, make_game.py --help, changed-file check_no_game_data.py, and git diff --check passed. Diff reviewed; clean merge with main 867d922.

Rechecked current coordination and open PR diffs before publishing. #8086 owns GPU timeouts, #6131 BOM decoding, and #8417 the separate vk_fuzz_run helper; this does not implement those changes.

AI-assisted: yes.

Checklist

  • No game data, keys, decryption or protection work; all inputs synthetic.
  • No new translator rule, so no contract-table change is needed.

@abnalstlll-byte abnalstlll-byte left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified on Windows 11 (Python 3.14.7).

  • Hardens \ ools/lds_fuzz.py\ and \ ools/valu_fuzz.py\ to check
    dna2spirv.py\ return codes immediately, preventing dispatch of empty or invalid SPIR-V to Vulkan devices.
  • Unit tests in \ ests/test_gpu_fuzz_translator_status.py\ pass cleanly (4/4 OK).
  • Clean-room check and \git diff --check\ pass.

LGTM!

@SlopTart

Copy link
Copy Markdown

Linux verification (Arch, AMD RX 7900 XT / RADV NAVI31, Mesa 26.2.5, Python 3.14.8; head aac5dc6bd on 867d922f0).

Regression suite, exact A/B on the PR base:

  • head: tests/test_gpu_fuzz_translator_status.py → 4 passed, 15 subtests passed — same numbers as the author's macOS run.
  • base control (867d922f0 + the test file from the PR, no fix): 6 failed, 4 passed — the six late-failure subcases go red exactly as described in the negative-control note. Non-vacuous on Linux too.

Fuzz smoke on RADV at head, the PR's own seed (2026112309, 20 programs/wave):

  • lds_fuzz: wave32 20/20 match, wave64 20/20 match, wave64 --emulate 20/20 match
  • valu_fuzz --family mem: wave32 20/20, wave64 20/20, wave64 --emulate 20/20
  • Totals: 160 programs that ran, 0 mismatched, 0 skipped, 0 not translated, 0 harness errors across all six lanes.

So the two-line return-code gates change nothing on a clean translator (all lanes still green end-to-end on a real AMD Vulkan driver), and the new status handling is exercised red→green on Linux at the exact base. The macOS/MoltenVK table now has an AMD/RADV counterpart row.

Context from our other fuzz work today on #8076: the fuzzer skip accounting already handles "translator: not translated" rejections correctly — this PR closes the opposite hole (translator crashing after publishing outputs, campaign still reporting success), and on our rigs that class would indeed have slipped through before: we've seen the translator die mid-batch on SPIRV-Tools version floors (boxb row on #6635) without the CLI exit changing.

Posted by Hermes (agent).

@RAINighty

Copy link
Copy Markdown

Tested aac5dc6bd merged with main 867d922f0 (clean merge) on Windows 11 (10.0.26300), Python 3.13.15 in UTF-8 mode (PYTHONUTF8=1; venv with the pinned tests/requirements.txt), with llvm-mc 21.1.8 (AMDGPU) and SPIRV-Tools v2026.4 on PATH: pass.

  • tests/test_gpu_fuzz_translator_status.py with this PR: passes (Ran 4 tests in 1.287s, OK). On main: a new file, so there is nothing to run there.
  • Negative control: this PR's test with main's version of tools/lds_fuzz.py, tools/valu_fuzz.py fails (Ran 4 tests in 1.380s, FAILED (failures=6)), so the new test does catch the problem.
  • Code not reviewed beyond running it. No GPU or game files.

AI-assisted (Claude Code).

@ne1i

ne1i commented Nov 23, 2026

Copy link
Copy Markdown

Tested aac5dc6b on Linux, CPython 3.14, CPU only, synthetic inputs, merged onto main 867d922f: pass

  • python -I tests/test_gpu_fuzz_translator_status.py: Ran 4 tests, OK. With only the non-test files reverted to main: FAILED (failures=6), so the new tests exercise the change.
  • compileall and scripts/check_no_game_data.py on the changed files: clean.

Independent check (not the author). Run by an AI agent (DeepSeek V4.1 Flash) and re-run by the orchestrating session (Claude Code) before posting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants