Skip to content

Preserve Unicode paths in the Windows pipeline checker - #1096

Open
nschlaepfer wants to merge 1 commit into
ItsNotRexed:mainfrom
nschlaepfer:codex/unicode-pipeline-paths
Open

nschlaepfer wants to merge 1 commit into
ItsNotRexed:mainfrom
nschlaepfer:codex/unicode-pipeline-paths

Conversation

@nschlaepfer

Copy link
Copy Markdown
Contributor

On Windows with the default Western ANSI code page, placing the translated shaders under a folder such as 地形 🎮 could make the pipeline checker exit successfully with zero shaders. Against the same five synthetic inputs in an ASCII folder, it compiled five pipelines and wrote 27 driver statistics. The Unicode-folder run instead produced a 36-byte empty cache. A Unicode cache or statistics output path could also fail independently.

Read the original Windows UTF-16 command line through the standard wmain entry point and keep native paths for the index, modules, partner stubs, cache and statistics. The checker reports a missing or unreadable index before opening the cache. A valid empty {} index continues to succeed. The build change selects the wide CRT entry point for MinGW.

Verification. Native Windows 11, ANSI code page 1252, RTX 5090 driver 621.14: both MSVC and MinGW-w64 Windows builds compiled all five synthetic pipelines with Unicode paths. The checker wrote all 27 rows, byte-identical to the ASCII control, and reopened the Unicode cache. Missing, unreadable and malformed index inputs returned exit 2 and preserved the existing cache contents and modification time. The committed CTest passed on Windows and macOS. Independent runs on an Apple M3 Max and software llvmpipe preserved all five successful pipelines and seeded cache reuse. All fixtures were hand-written test shaders. AI-assisted.

Coordination claim.

@kapitche

Copy link
Copy Markdown
Contributor

Tested a2c3423 on Windows 11 with two GPUs on one machine (runtime built from this PR's head, MSVC 14.51): pass

  • ctest: 48/48 on the RTX 4080 SUPER. 46/48 on the Intel UHD 770, where the two failures (d3d12_vulkan_device d3d12_vulkan_device_test: compare OPTIONS1 with the same GPU's host device, not the default adapter #962 and d3d12_descriptor's min-LOD case) also fail on main. pipeline_check_paths passes on both.
  • Negative control, on a system ANSI code page of 1252: with the merge-base runtime/test/vk_pipeline_check.cpp (narrow main), pipeline_check_paths fails with Expected an input error for the missing Unicode index, got 0. The translated 地形 🎮 folder isn't reachable through ACP argv. With this PR's wmain, it passes.
  • Heads-up: this conflicts with Quote text fields in pipeline statistics CSV #1099 in runtime/CMakeLists.txt and runtime/test/vk_pipeline_check.cpp (trial merge), so whichever lands second needs a rebase.

@quackottu quackottu 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.

Tested a2c3423 on NVIDIA GeForce RTX 5070, driver 621.24, Windows 11 Pro (26300), VS 2022 Build Tools, Vulkan SDK 1.4.363.0, with LEONIDA_VK_VALIDATION=1 and LEONIDA_D3D12=vulkan: pass

  • Build ok. ctest: 100% tests passed, 0 tests failed out of 48 (gameinput disabled, no SDL3).
  • runtime/test/check_pipeline_paths.py didn't run under ctest here, and I didn't run it by hand, so the Unicode-path case itself isn't covered by this run.
  • 49 test programs exit 0 with 0 validation messages.
  • Same on main, not from this PR: d3d12_clear_test (NVIDIA 0.5 tie rounding, #521), vk_binary_occlusion_test (needs an input file), and the 3 VUID-vkCreateDevice-ppEnabledExtensionNames-01387 in d3d12_fence_timing_test/d3d12_vulkan_device_test (#1027).

@tupacfan04

Copy link
Copy Markdown
Contributor

Unverified: with no cl/cmake/MSVC here the test cannot run. compileall/py_compile are clean, and the stub control does discriminate (it rejects the pre-PR missing-index exit 0 and passes a post-PR stub).

Two problems before it can merge:

  • It is CONFLICTING in runtime/CMakeLists.txt:863 and 10 hunks of runtime/test/vk_pipeline_check.cpp. In particular, the head's read_index (:276-292) lacks main's trailing-data guard (main :373 closed()), so a merge that favours this PR regresses {}garbage.
  • runtime/test/check_pipeline_paths.py:22 never covers {} (0 shaders, exit 0) or trailing data.

Rebase keeping both guards, and extend the test to those two cases; then it needs a build-capable check.

AI-assisted review, no game files, no GPU.

@lines9686-rgb

Copy link
Copy Markdown
Contributor

Still reproduces on current main (7b7d73f), on a different code page than the description's: Windows 11, ANSI code page 1251, RTX 3060 Ti 610.88, vk_pipeline_check built with MSVC. The same five synthetic test modules (plus index.json):

  • in D:\Leonida\vkp_ascii\spirv: all modules and pipelines ok;
  • in D:\Leonida\vkp_测试\spirv: error: cannot read D:\Leonida\vkp_??\spirv/index.json: cannot open the file.

So make_game's pipelines stage still fails for a work folder under a user name outside the ANSI code page. The PR now conflicts with main (vk_pipeline_check.cpp is a hot spot); once it's rebased I can re-run the same check on this 1251 machine. No game files. AI-assisted (Claude Code).

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.

5 participants