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

Manually merged
github merged 1 commit from gh-pr/483/head into gh-pr/483/base 2026-11-26 09:03:21 +00:00
Owner

@⁠xroneyaa on GitHub · 2026-11-24 06:10 UTC · original
xroneyaa:fix/native-tool-paths-utf8-acp → main · +8 −2 · 1 files · 1 commits · merged 2026-11-24 17:38 UTC

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).
**@⁠xroneyaa** on GitHub · 2026-11-24 06:10 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/483) `xroneyaa:fix/native-tool-paths-utf8-acp` → `main` · +8 −2 · 1 files · 1 commits · merged 2026-11-24 17:38 UTC 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).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:03:15 +00:00
github manually merged commit fbbdb0979c into gh-pr/483/base 2026-11-26 09:03:21 +00:00
Author
Owner

@⁠Dezmonius on GitHub · 2026-11-24 12:11 UTC · original

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).

**@⁠Dezmonius** on GitHub · 2026-11-24 12:11 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/483#issuecomment-7131087078) 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).
Author
Owner

@⁠QemmHD on GitHub · 2026-11-24 17:38 UTC · original

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).

**@⁠QemmHD** on GitHub · 2026-11-24 17:38 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/483#issuecomment-7139495122) 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).
This discussion has been locked. Commenting is limited to contributors.
No description provided.