TEST-NATIVE-FOLDER-FAILURES: cover Windows short-path lookup failures #548
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!548
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/548/head"
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?
@RedMiS7 on GitHub · 2026-11-24 07:30 UTC · original
RedMiS7:codex/test-native-folder-failures→main· +53 −0 · 1 files · 1 commits · merged 2026-11-24 09:25 UTCClaimed 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.
@kawaii-shakal on GitHub · 2026-11-24 07:55 UTC · original
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.
@QemmHD on GitHub · 2026-11-24 09:25 UTC · original
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).