mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:15:51 +01:00
[PR #2104] runtime: compile test shaders through an ASCII-cwd glslang wrapper #2110
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#2110
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/2104
Author: @whoalin1
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:glslang-nonascii-relative📝 Commits (1)
3e3b8b7runtime: compile test shaders through an ASCII-cwd glslang wrapper📊 Changes
2 files changed (+130 additions, -2 deletions)
View changed files
📝
runtime/CMakeLists.txt(+13 -2)➕
runtime/test/glslang_ascii_cwd.py(+117 -0)📄 Description
Claimed in the coordination issue: https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7173272902 (BUILD-GLSLANG-NONASCII-RELATIVE-FIXTURE, from alexandersato0830's finding at https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7172499920).
What
Windows glslang (16.6.0 standalone) fast-fails with
0xC0000409in a non-ASCII working directory, whatever its arguments say: the CRT resolves files through the narrow (ANSI codepage) current directory, and a character the codepage cannot represent crashes the runtime beforemain. A CMake build tree under a non-ASCII directory (a user name, a desktop folder) hits this for every shader the test build compiles.This runs the validator through
runtime/test/glslang_ascii_cwd.py, which keeps every byte glslang sees ASCII:.comp→.com) and glslang classifies the shader stage from the extension.Off Windows, without Python3, or in an already-ASCII tree the wrapper is a plain pass-through and nothing changes. When a path has no 8.3 short form (short names disabled on the volume) the validator runs exactly as it would without the wrapper — no regression — with a warning saying why.
Evidence (Windows 11, system codepage 1252, glslang 11:16.6.0 from VulkanSDK 1.4.363.0)
Failure reproduced on unmodified main — configure +
cmake --build --target vk_null_descriptor_testin a build dir whose name holds CJK characters outside cp1252:the exact exit code alexandersato0830 reported (-1073740791). ninja's own log line shows the mechanism:
cmd.exe /C "cd /D <unicode-build-dir> && glslangValidator ...".Mechanism isolated: run directly, glslang crashes with
0xC0000409whenever its cwd is non-ASCII — even with--stdinand no file arguments at all — while an ASCII cwd with Unicode absolute paths only fails to open the input (rc 1). The cwd is the deciding variable.With this PR: the same configure + build in a CJK build directory succeeds;
generated/cs_null_descriptors.spvis byte-identical to the ASCII-tree build (15036 bytes, valid SPIR-V magic). Wrapper-level checks: Unicode input + Unicode output + Unicode cwd, ASCII input + Unicode output/cwd (the reported scenario), and the all-ASCII pass-through all produce byte-identical output; staged input copies are cleaned up after the run.Test plan
0xC0000409vk_null_descriptor_testin a CJK build dir; SPIR-V byte-identical to ASCII buildNo game files involved; the shader is the synthetic GLSL test fixture. AI-assisted with Devin.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.