TEST-NATIVE-FOLDER-FAILURES: cover Windows short-path lookup failures #548
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/548"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ubiquitarianism/leonida. Originally posted by RedMiS7 on 2026-11-24T07:30:20Z.
Claimed in the coordination issue as: TEST-NATIVE-FOLDER-FAILURES (claim)
Depends on: #483 (the existing UTF-8-code-page test failure on this Windows host; its fix is not copied into this PR)
What and why
Add four Windows-only tests in
NativeFolderLookupto exercise five controlled outcomes ofGetShortPathNameW:The API is mocked, so these tests do not create directories or depend on a volume keeping 8.3 short names. The existing code-page tests are untouched, and there are no runtime changes.
Tested
Windows 11 build 26200, CPython 3.10.11 and Anaconda Python 3.13.9; CPU only, no game files.
python -I tests/test_native_tool_paths.py NativeFolderLookup: 4 tests passed, no skips.py -3.13 -I tests/test_native_tool_paths.py NativeFolderLookup: 4 tests passed, no skips.py -3.13 -I tests/test_native_tool_paths.py: 12 tests, 8 passed, 1 failed, 3 skipped. The failure is the originalNativeFolder.test_a_folder_outside_the_code_page_gets_its_short_name_or_none, also reproduced before this change on the same base. The three skips needspirv-asandspirv-val.py -3.13 -I scripts/check_no_game_data.py tests/test_native_tool_paths.pyandgit diff --check: passed.py -3.13 -I scripts/run_semantic_tests.py tests/semantic: 465 files, 6105 tests, 2 files failed in 289 s with 12 jobs. Bothtest_sopc_validationandtest_unary_f16_validationreport missingspirv-as/spirv-valon PATH. This PR does not change the translator or any semantic-suite file.GPUs tested: n/a (mocked Windows API and CPU tests only)
AI-assisted: yes (OpenAI Codex)
Checklist
mainatd42773d07; GitHub reports Able to merge.Draft while #483 remains open and the environment limitations above remain recorded.
Imported from ubiquitarianism/leonida. Originally posted by kawaii-shakal on 2026-11-24T07:55:17Z.
Reviewed head
9be0932042(AI-assisted review). Environment: Linux (WSL2), Python venv, no Windows, no GPU.What ran:
python -I tests/test_native_tool_paths.py: OK, but all 8 tests skipped on Linux, the 4 new ones included (skipUnless(os.name == "nt")).NativeFolderLookupclass anyway, I used a small harness. It put a stubctypes.windll.kernel32in place, cleared the class skip and patchedos.nameto"nt"for the call. All 4 tests pass on the unchanged code.Mutations to
native_folderinscripts/run_gpu_tests.py(all caught):0 < n->0 <= n: caught (failed-lookup test)n < len(buf)->n <= len(buf): caught (insufficient-buffer test, extra=0)n <= len(buf) + 1: caught (both subtests)fits(short)check: caught (code-page test)short = buf.value): caught (3 failures)Findings: none blocking. Each new test covers a separate branch of the return-value and code-page checks, and nothing duplicates an existing test.
Not tested: a real
GetShortPathNameWcall on Windows, or a volume with 8.3 names turned off. I could only run the tests through the Linux harness above.Review written by Claude (Claude Code, Opus 5.5), an AI agent, posted from a contributor's account.
Imported from ubiquitarianism/leonida. Originally posted by QemmHD on 2026-11-24T09:25:37Z.
Merging. Why merged: four Windows tests for run_gpu_tests.native_folder's short-path lookup failures (failed lookup, too-small buffer, name outside the code page, success).
Why it's good: test-only (mocks GetShortPathNameW); test_native_tool_paths 5 -> 9 passed; clean on main
7430f59; consistency set 565/0 before and after.AI-assisted (Claude Code, Claude Opus 5.5).