TEST-NATIVE-TOOL-PATHS-UTF8: exercise narrow ANSI short-name path on UTF-8 Windows hosts #483

Merged
xroneyaa merged 1 commit from upstream-pr/483 into main 2026-11-24 17:38:39 +00:00
xroneyaa commented 2026-11-24 06:10:14 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by xroneyaa on 2026-11-24T06:10:14Z.


Claimed in the coordination issue as: TEST-NATIVE-TOOL-PATHS-UTF8

What and why

scripts/run_gpu_tests.py:native_folder(path, ansi="mbcs") exposes ansi specifically so tests can force a narrow code page. On Windows systems configured with UTF-8 as the active ANSI code page (GetACP() == 65001), "mbcs" encodes private-use characters cleanly without raising UnicodeEncodeError, so test_a_folder_outside_the_code_page_gets_its_short_name_or_none returned work unchanged and failed its assertion instead of testing 8.3 short-name resolution.

This passes ansi="cp1252" in that test (and verifies native.encode("cp1252")), and adds test_a_utf8_code_page_keeps_non_ascii_paths to confirm UTF-8 code pages keep paths outside narrow legacy code pages intact.

Tested

  • python -I tests/test_native_tool_paths.py (Windows 11, ACP=65001) -> Ran 9 tests: 6 passed (test_a_folder_outside_the_code_page_gets_its_short_name_or_none and test_a_utf8_code_page_keeps_non_ascii_paths both pass), 3 skipped (needs spirv-as and spirv-val)
  • python -I scripts/check_no_game_data.py tests/test_native_tool_paths.py -> exit 0

GPUs tested: n/a

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed (n/a — no translator rule added).
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5467086465 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/483). Originally posted by [xroneyaa](https://github.com/xroneyaa) on 2026-11-24T06:10:14Z. --- Claimed in the coordination issue as: TEST-NATIVE-TOOL-PATHS-UTF8 ### What and why `scripts/run_gpu_tests.py:native_folder(path, ansi="mbcs")` exposes `ansi` specifically so tests can force a narrow code page. On Windows systems configured with UTF-8 as the active ANSI code page (`GetACP() == 65001`), `"mbcs"` encodes private-use characters cleanly without raising `UnicodeEncodeError`, so `test_a_folder_outside_the_code_page_gets_its_short_name_or_none` returned `work` unchanged and failed its assertion instead of testing 8.3 short-name resolution. This passes `ansi="cp1252"` in that test (and verifies `native.encode("cp1252")`), and adds `test_a_utf8_code_page_keeps_non_ascii_paths` to confirm UTF-8 code pages keep paths outside narrow legacy code pages intact. ### Tested - `python -I tests/test_native_tool_paths.py` (Windows 11, ACP=65001) -> Ran 9 tests: 6 passed (`test_a_folder_outside_the_code_page_gets_its_short_name_or_none` and `test_a_utf8_code_page_keeps_non_ascii_paths` both pass), 3 skipped (needs `spirv-as` and `spirv-val`) - `python -I scripts/check_no_game_data.py tests/test_native_tool_paths.py` -> exit 0 GPUs tested: n/a AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed (n/a — no translator rule added).
Dezmonius commented 2026-11-24 12:11:14 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Dezmonius on 2026-11-24T12:11:14Z.


Independent Windows 10 22H2 check of the #483 test edits applied to 21625bc, which already has the four NativeFolderLookup tests from #548. CPython 3.14.7, host ACP 1251. The combined file ran 13 tests: 9 passed, 4 skipped. All four Win32 API mock cases and the explicit UTF-8 case passed. Three skips need SPIRV-Tools. The real short-name test skipped because the synthetic directory had no CP1252-compatible 8.3 spelling on this volume.

I also called native_folder with the same real synthetic directory under both explicit codecs. UTF-8 kept the original path, and CP1252 returned None on this volume. This covers the two paths from one Windows process without changing the system code page.

No game files or GPU. AI-assisted (Codex).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7131087078 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/483#issuecomment-7131087078). Originally posted by [Dezmonius](https://github.com/Dezmonius) on 2026-11-24T12:11:14Z. --- Independent Windows 10 22H2 check of the #483 test edits applied to `21625bc`, which already has the four `NativeFolderLookup` tests from #548. CPython 3.14.7, host ACP 1251. The combined file ran 13 tests: 9 passed, 4 skipped. All four Win32 API mock cases and the explicit UTF-8 case passed. Three skips need SPIRV-Tools. The real short-name test skipped because the synthetic directory had no CP1252-compatible 8.3 spelling on this volume. I also called `native_folder` with the same real synthetic directory under both explicit codecs. UTF-8 kept the original path, and CP1252 returned `None` on this volume. This covers the two paths from one Windows process without changing the system code page. No game files or GPU. AI-assisted (Codex).
QemmHD commented 2026-11-24 17:38:37 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by QemmHD on 2026-11-24T17:38:37Z.


Merging.

Why merged: Test-only: native tool paths get an explicit ansi="cp1252" and a UTF-8 case, so the test no longer depends on the machine's ANSI code page. Dezmonius passed it independently on Windows 10 with ACP 1251.

Why it's good: test_native_tool_paths: 13 passed.

Tested on Windows 11 / RTX 4070 SUPER: merged alone onto main 82a2aabcc. With it in, the repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests) gives 566 passed / 5 skipped / 0 failed, and check_no_game_data on the changed files is clean. git merge-tree against current main 32950551e: no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or build/CI changes.

AI-assisted (Claude Code, Claude Opus 5.5).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7139495122 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/483#issuecomment-7139495122). Originally posted by [QemmHD](https://github.com/QemmHD) on 2026-11-24T17:38:37Z. --- Merging. **Why merged:** Test-only: native tool paths get an explicit ansi="cp1252" and a UTF-8 case, so the test no longer depends on the machine's ANSI code page. Dezmonius passed it independently on Windows 10 with ACP 1251. **Why it's good:** test_native_tool_paths: 13 passed. Tested on Windows 11 / RTX 4070 SUPER: merged alone onto main 82a2aabcc. With it in, the repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests) gives 566 passed / 5 skipped / 0 failed, and check_no_game_data on the changed files is clean. git merge-tree against current main 32950551e: no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or build/CI changes. AI-assisted (Claude Code, Claude Opus 5.5).
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!483
No description provided.