Skip to content

tests/conftest.py: run spirv-as/spirv-val with bare names in the work folder (non-ANSI TEMP) - #4807

Open
lines9686-rgb wants to merge 1 commit into
ItsNotRexed:mainfrom
lines9686-rgb:tests-spirv-bare-names
Open

lines9686-rgb wants to merge 1 commit into
ItsNotRexed:mainfrom
lines9686-rgb:tests-spirv-bare-names

Conversation

@lines9686-rgb

Copy link
Copy Markdown

Item: new TEST item, claimed in #4683 (#4683 (comment)).

tests/conftest.py Shader.validate() handed spirv-as and spirv-val the absolute tmp_path. On Windows they read their command line in the ANSI code page, so a tmp_path under a user name outside it reached them with ? (tmp_ação → tmp_acao, "file does not exist") and every pytest translator test that validates failed. They now run in the work folder with bare file names, the approach #3423 took for rdna2spirv.py's assemble_spirv; output is decoded with errors="replace".

Tested

Windows 11 (ANSI code page 1251), Python 3.12, pytest 9.2, SPIRV-Tools from Vulkan SDK 1.4.357.0, llvm-mc 23.1.6. test_translate, test_mesh_compute, test_spirv_gs_to_compute, test_image_load_d16_typed, test_pc_tail_ubo, test_vs_packed_inputs:

TEMP main 98fa503 this branch
D:\Leonida\tmp_ação 513 failed, 133 passed, 5 errors 11 failed, 635 passed, 5 errors
ASCII folder 651 passed 651 passed

The 11 + 5 left come from those files' own spirv-as calls (test_mesh_compute.py ~line 134, the gs_module fixture in test_spirv_gs_to_compute.py), outside this helper; about 50 other test files and tools/spirv_gs_to_compute.py also pass full paths to SPIRV-Tools. Left for a follow-up. No game files. AI-assisted (Claude Code).

🤖 Generated with Claude Code

… folder

On Windows the SPIRV-Tools read their command line in the ANSI code page, so a
tmp_path under a user name outside it reached them with "?" and every pytest
translator test that validates failed. With %TEMP% at "tmp_ação" on a cp1251 PC:
513 failures across test_translate, test_mesh_compute, test_spirv_gs_to_compute,
test_image_load_d16_typed, test_pc_tail_ubo and test_vs_packed_inputs on main;
11 (plus 5 errors) with this change, all from those files' own spirv-as calls.
Same approach as rdna2spirv.py's assemble_spirv (ItsNotRexed#3423).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Atomic258

Copy link
Copy Markdown

Verified c0b4abc125861594fccef315962a95c51bc0697d on Windows 11 (ANSI code page 1252), Python 3.15.2, Vulkan SDK 1.4.363.0 / SPIRV-Tools v2026.4. Direct python -I -c repro imported tests/conftest.py and called Shader.validate() on a minimal hand-written compute SPIR-V module with real spirv-as and spirv-val. Both ASCII and 漢字_ temporary-directory prefixes passed. Red control: restored only tests/conftest.py from HEAD^ and reran with 漢字_: spirv-as failed with file does not exist, showing ??_ in the path. The direct repro stubbed pytest decorators only and bypassed the LLVM-dependent fixture constructor; the cited pytest suites were not run (pytest and llvm-mc unavailable on the active environment). Restored HEAD; worktree clean.

AI-assisted (Devin); no game files.

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.

2 participants