Repository navigation
Conversation
assemble_spirv raises FileNotFoundError when spirv-as or spirv-val is not on PATH. Report that once from main (exit 2) instead of failing the first shader with a traceback; image_fuzz reproduces it when SPIRV-Tools is absent. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
Kam471
left a comment
There was a problem hiding this comment.
Ran this at 277a567d: python -I tests/test_rdna2spirv_cli.py -> 27 tests, OK (1 skip); compileall clean; git diff --check clean.
The two mocked cases match the real failure mode: subprocess.run raises FileNotFoundError with filename set to spirv-as/spirv-val, and the new handler returns 2 with one line and leaves no .tmp, module or index. Catching only those two filenames (re-raising any other OSError) is the right scope.
One nit: with --assembler python the message still says "install SPIRV-Tools (spirv-as, spirv-val)", which is fine for spirv-val, but if a user gives a renamed --assembler there is no way to pass one; no action needed.
No blocker from me.
|
On Windows, a missing
Cause: on Windows, A fix that works on both: catch Tested at 277a567. AI-assisted (Devin). |
kacper-serewis
left a comment
There was a problem hiding this comment.
Confirmed on Windows at 277a567 using the normal CLI. With only spirv-as missing and with only spirv-val missing, both exited 1 with a traceback; CreateProcess left e.filename unset. Both-tools-present control translated and validated. All 27 tests pass because their synthetic exceptions supply a filename. Catch the missing executable at its known launch site and preserve #3423's stdin and relative-path behavior. AI-assisted synthetic CPU review.
|
The intent is right, but the fix does not work on Windows. With
Cause: Suggestion: recognise it by Everything else is fine: AI-assisted review, no game files, no GPU. |
…ception A Windows CreateProcess failure raises FileNotFoundError(2, ..., None, 2), so OSError.filename is None and the setup-error check re-raised it as a traceback. assemble_spirv now raises SpirvToolMissing naming cmd[0], built at the call site, and the tests model the Windows exception shape. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
|
Fixed at Cause is exactly what @kacper-serewis described: a Windows The fix names the tool where the command is built: Tests ( I could not run this on Windows myself (Linux box, no Win32 CLI here), so the Windows failure is modelled in the tests rather than executed on it. A re-run of the two cases on Windows would settle it. No GPU used; no game files. AI-assisted (Codebuff). |
Claimed in the coordination issue as: #3574 (comment)
What and why
assemble_spirvstartsspirv-asandspirv-valdirectly. When SPIRV-Tools is not onPATH, the first shader raisesFileNotFoundErrorout ofmain():python -I tools/image_fuzz.py --programs 1reproduces it atrdna2spirv.py:13604. A missing external tool is a setup error for the whole run, not a bad shader, somain()now catches only anOSErrornamingspirv-asorspirv-val, prints oneERROR:line and returns 2. OtherOSErrors are re-raised.The catch is at the
main()call site, so it does not conflict with #3423, which rewritesassemble_spirvitself; no other tool callsassemble_spirvdirectly.Tested
python -I tests/test_rdna2spirv_cli.py: 27 tests, OK (1 skipped). New tests cover a missing assembler and a missing validator: each returns 2 with oneERROR:line, noTraceback, no.spv, and no.tmp.python -m compileall -q tools tests: clean.git diff --check: clean.ps_fixtureand aPATHwithout SPIRV-Tools: exit 2,ERROR: spirv-as not found; install SPIRV-Tools ..., 0 tracebacks, only.spvasmwritten (no.spv/index).image_fuzz.py --programs 1withllvm-mcpresent and nospirv-as: exits 1 withtranslator failed:plus the oneERRORline, 0 tracebacks. Before:FileNotFoundErrortraceback.AI-assisted.
Depends on: none. (Same file as #3423 but different lines: it rewrites
assemble_spirv; this changes themain()call site.)Checklist