Skip to content

tests: keep direct SPIR-V calls working under non-ANSI TEMP - #4850

Open
editrice wants to merge 2 commits into
ItsNotRexed:mainfrom
editrice:codex/nonansi-spirv-tests
Open

editrice wants to merge 2 commits into
ItsNotRexed:mainfrom
editrice:codex/nonansi-spirv-tests

Conversation

@editrice

Copy link
Copy Markdown

Claimed as a new TEST follow-up in the current coordination issue: #4816 (comment)

Depends on: #4807

What and why

After #4807 fixes Shader.validate(), direct spirv-as/spirv-val calls in tests/test_mesh_compute.py and tests/test_spirv_gs_to_compute.py still pass absolute tmp_path filenames. On Windows, SPIRV-Tools can read those arguments through the ANSI code page and fail when TEMP contains characters outside it. Run the tools from their work directory with bare filenames. The GS CLI tests also pass relative module/layout names so the converter's internal SPIRV-Tools calls stay safe.

The two representative tests now create a tmp_測試 child directory even under an ordinary ASCII TEMP, so CI exercises the failure mode. This branch contains #4807's helper commit as its parent and only changes these two test files beyond that dependency.

Tests

  • Focused suites: 38 passed.
  • Non-ANSI TEMP run: 37 passed, 1 skipped; the skip is a sandbox-denied hard-link test.
  • Committed Unicode-path selectors: 6 passed. Applying only those triggers to the tests/conftest.py: run spirv-as/spirv-val with bare names in the work folder (non-ANSI TEMP) #4807 parent without this fix gives 6 failures with tmp_?? missing-file diagnostics.
  • Before the fix, both full focused suites under a non-ANSI TEMP gave 11 failed, 22 passed, 5 errors.
  • compileall and git diff --check clean; independent pre-push review passed.

Windows CPU-only, synthetic SPIR-V tests. No game files or game-derived content. AI-assisted (Codex daybreak-blue implementation and independent review).

lines9686-rgb and others added 2 commits November 23, 2026 08:17
… 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>

@kacper-serewis kacper-serewis 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.

Independent Windows ACP 1250 comparison using Python 3.13.15 and Vulkan SDK 1.4.363.0. Both ASCII TEMP runs passed 21 tests. Under U+6E2C TEMP the #4807 baseline had 6 passes, 10 failures and 5 setup errors; b81dd94 passed all 21 runnable tests. Each run skipped 17 AMDGCN llvm-mc-dependent tests. AI-assisted CPU only.

@kacper-serewis kacper-serewis 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.

Completed the 17 formerly skipped cases using AMDGCN llvm-mc 21.1.8 and native Windows Python with U+6E2C in TEMP and TMP. All 38 passed on b81dd94, zero skipped. Parent c0b4abc had 22 passes, 11 failures and 5 setup errors. AI-assisted CPU-only synthetic comparison.

@editrice
editrice marked this pull request as ready for review November 23, 2026 05:54
@Atomic258

Copy link
Copy Markdown

Tested head b81dd94 on Windows 11, CPython 3.15.2, CPU, synthetic fixtures only. Vulkan SDK 1.4.363.0 SPIRV-Tools and MSYS2 UCRT llvm-mc were on PATH. Created a temporary venv and installed the repository-pinned tests/requirements.txt (pytest 9.2.0, NumPy 2.5.5, Pillow 13.0.0).

  • Base python -I tests/test_mesh_compute.py and python -I tests/test_spirv_gs_to_compute.py initially failed with ModuleNotFoundError: No module named 'pytest'. Did you mean: 'test'? Those files are pytest suites; used the pinned venv for the real run.
  • <venv>/Scripts/python.exe -I -m pytest -q tests/test_mesh_compute.py tests/test_spirv_gs_to_compute.py: 38 passed. This includes the committed non-ANSI tmp_測試 children.
  • Same command with TEMP and TMP set to a temporary directory containing 測試: 38 passed, no skips.
  • Red control with git checkout origin/main -- tests/test_mesh_compute.py tests/test_spirv_gs_to_compute.py, retaining the PR's conftest.py dependency helper, and the same non-ANSI TEMP: 11 failed, 22 passed, 5 errors, exit 1. SPIR-V tools reported error: could not open file with the Unicode path replaced by ??. Restored both test files from HEAD; worktree clean.
  • python -I -m unittest discover -s tests/semantic -v was started separately, but stopped before completion to avoid checkout during the run; no full-suite result is claimed.

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.

4 participants