Repository navigation
vk_fuzz_run: validate wave, clean up temp dir on error, read index as utf-8-sig, and guard exact_verdict - #6700
Conversation
… utf-8-sig, and guard exact_verdict
|
Tested from this Linux box at head Two of your four points reproduce cleanly here as real on
Your What I did not exercise: the One unrelated failure to flag. The translator pytest set gives 1761 passed, 1 failed at your head — and the Small usability note for Linux testers of this tool: the docstring example passes AI-assisted testing, counts read through by hand. |
shayderrr
left a comment
There was a problem hiding this comment.
Summary
tools/vk_fuzz_run.py: run_programs() rejects wave outside 32/64, wraps its body in try/finally so the vk_fuzz_* temp directory is removed even when llvm-mc raises, and reads index.json as utf-8-sig. exact_verdict() now reports word-count differences and tolerates short or malformed observation lines instead of indexing past them. Tests cover each guard.
Why merge
Prevents leftover temp directories on exceptions, handles BOM-bearing indexes, and gives a clear verdict when programs produce different word counts.
Verdict: Approve
Summary
Why mergePrevents leftover temp directories on exceptions, handles BOM-bearing indexes, and gives a clear verdict when programs produce different word counts. Verdict: Approve |
Claimed in #6603 (#6603 (comment)).
Problem
In
tools/vk_fuzz_run.py(added in #6306):run_programs()validateswords in (1, 2, 4, 8)but does not validatewave in (32, 64), so an invalid wave size silently emits broken compute assembly and mis-sized dumps.shutil.rmtree(work)ran only on normal return withouttry...finally, leakingvk_fuzz_*temp directories ifmc_command.mc_command()or a subprocess raises.spirv/index.jsonwas opened as strictutf-8instead ofutf-8-sig.exact_verdict()raisedIndexErrorwhenlen(hw) != len(got), whenlen(lines) < n_obs, or when an observation line did not contain", ".Fix
wave in (32, 64)inrun_programs()(ValueError).workusage intry...finallyso temp directories are removed on error too (still honoringVK_FUZZ_KEEP).spirv/index.jsonwithencoding="utf-8-sig".exact_verdict()on mismatched lengths and fallback register labels when observation lines are absent or lack", ".tests/test_vk_fuzz_run.py.Testing
python3 -m compileall -q tools/vk_fuzz_run.py tests/test_vk_fuzz_run.pypython3 -I tests/test_vk_fuzz_run.py -v: 9/9 passed (Arch Linux, Python 3.13).vk_fuzz_run.run_programswave32 + wave64 on syntheticv_mov_b32program): OK on AMD Radeon RX 5500 XT (RADV NAVI14, Mesa 26.3.1-arch3.5, Vulkan 1.4.363).