Use UTF-8 for shader library module filenames (SHADER-LIBRARY-UTF8-MODULE-PATHS) #2043
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2043"
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?
Imported from ubiquitarianism/leonida. Originally posted by alexandersato0830 on 2026-11-25T18:54:17Z.
Claimed in the coordination issue as: SHADER-LIBRARY-UTF8-MODULE-PATHS
What and why
Index strings are decoded as UTF-8.
spirv_bytes()andspirv()append those strings as narrow paths, which on Windows can use the system code page. A shader indexed ascs_\u00e9can therefore be found in the metadata but missed on disk.Use one path builder that appends the filename as UTF-8 for both the generated filename and the explicit
spvfallback. A filename the host cannot decode is treated as unavailable, so a working fallback can still be used.Tested
9f9a7c5f3inspirv_bytes(). With the fix, the CMakeshader_librarytest passes in RelWithDebInfo on Windows 11 using MSVC 19.51. It checks size and word reads through both filename forms and a malformed default name with a valid fallback.git diff --checkand the source-only check passed.GPUs tested: n/a (CPU-only synthetic shader files)
AI-assisted: yes (Codex)
Checklist
main.Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T12:24:16Z.
Verified on Windows 11 (
10.0.26200.9974) with MSVC19.44.35228(x64,/std:c++20 /EHsc /W4 /permissive- /utf-8 /O2) againstmaind48a957bb+6198879899(claim#2570#issuecomment-7239117859):runtime/src/shader_library.h,runtime/test/shader_library_test.cpp); builds module paths viastd::u8stringso Windowsstd::filesystem::pathdecodes JSON filenames as UTF-8 instead of the host narrow code page, and catchesstd::system_erroron malformed UTF-8 sospirv_bytes/spirvfall back toentry.spv_file.check_no_game_data.pyclean; also merges cleanly alongside#2045.d48a957bb+ PR test):shader_library_test.exefails on Windows 11 (rc=1,line 744: module && utf8.spirv_bytes(*module) == sizeof(words)).d48a957bb+6198879899merge): Auto-merges cleanly (rc=0), introduces0new compiler warnings, and passes (SHA-256, inflate (stored/fixed/dynamic), JSON, FSSM extraction, FSPX programs and index lookup OK,rc=0).AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-29T03:45:35Z.
Verified by OreoFR
aa918e5d9+ PR head619887989ctest -R ^shader_library$xs_proxy_mock,xmem_no_write_watch,xmem_write_watchfailed once under load and pass on a serial rerun)Note: shares
runtime/src/shader_library.h,runtime/test/shader_library_test.cppwith the open #2566; a rebase may be needed if #2566 lands first.AI-assisted (Claude Code, Claude Opus 5.5).
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-29T14:19:04Z.
Merged at head
6198879. Tested by others, not re-run on my side (organizing machine, no build): OreoFR, Windows + RTX 4070,ctest -R ^shader_library$red on main, green with this PR; zmasi, Windows 11 + MSVC 19.44, same result. GPUs: n/a for this test. AI-assisted: yes.