Decode generated shader fixture paths as UTF-8 (TEST-SHADER-FIXTURE-UTF8) #2069

Merged
leonida/mandy
alexandersato0830 merged 1 commit from codex/shader-fixture-utf8 into main 2026-11-28 18:12:32 +00:00

Pull request successfully merged and closed

alexandersato0830 commented 2026-11-25 19:29:02 +00:00

Claimed in the coordination issue as: TEST-SHADER-FIXTURE-UTF8

What and why

CMake passes the absolute generated shader paths to GPU tests as narrow UTF-8 strings. The implicit filesystem path conversion uses the Windows native narrow encoding, which can make tests miss a shader under a non-ASCII build directory. Convert these strings as UTF-8 before checking the original file and the packaged fallback. Callers that already have a filesystem path use the existing overload. C++ filesystem encoding rules

Tested

  • Native Windows 11, MSVC 19.51. The regression failed on main e48ff03 and passed in shader_fixture_path CTest after the patch. It exercises both an absolute generated path and a packaged fallback with non-ASCII names.
  • Built vk_null_descriptor_test in a non-ASCII CMake build directory and ran it successfully on the RTX 4080 from a working directory without a fixture fallback. The standalone compiler crashed when asked to emit directly into that build directory. For the reader test, I staged the synthetic SPIR-V generated from byte-identical GLSL in an ASCII build directory.
  • Verified git diff --check and the source-only check.

GPUs tested: NVIDIA RTX 4080, driver 621.01, Windows 11.

AI-assisted: yes.

  • Based on current main.
  • One topic.
  • Uses source and synthetic fixtures.
Claimed in the coordination issue as: [TEST-SHADER-FIXTURE-UTF8](https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7172241015) ### What and why CMake passes the absolute generated shader paths to GPU tests as narrow UTF-8 strings. The implicit filesystem path conversion uses the Windows native narrow encoding, which can make tests miss a shader under a non-ASCII build directory. Convert these strings as UTF-8 before checking the original file and the packaged fallback. Callers that already have a filesystem path use the existing overload. [C++ filesystem encoding rules](https://eel.is/c++draft/fs.path.type.cvt) ### Tested - Native Windows 11, MSVC 19.51. The regression failed on main `e48ff03` and passed in `shader_fixture_path` CTest after the patch. It exercises both an absolute generated path and a packaged fallback with non-ASCII names. - Built `vk_null_descriptor_test` in a non-ASCII CMake build directory and ran it successfully on the RTX 4080 from a working directory without a fixture fallback. The standalone compiler crashed when asked to emit directly into that build directory. For the reader test, I staged the synthetic SPIR-V generated from byte-identical GLSL in an ASCII build directory. - Verified `git diff --check` and the source-only check. GPUs tested: NVIDIA RTX 4080, driver 621.01, Windows 11. AI-assisted: yes. - [x] Based on current `main`. - [x] One topic. - [x] Uses source and synthetic fixtures.
MSedgeMC approved these changes 2026-11-25 19:32:24 +00:00
MSedgeMC left a comment

Verified on the PR branch by compiling the standalone test directly: g++ -std=c++20 -O0 -o shader_fixture_path_test runtime/test/shader_fixture_path_test.cpp && ./shader_fixture_path_test -> 'shader fixture lookup passed', exit 0. The new char* overload correctly decodes CMake's narrow UTF-8 fixture paths via u8string before filesystem lookup, and the added Tokyo/Unicode cases pass along with the existing packaged/local/missing cases. Advisory: branch carries ~60 older commits not on current main; rebase before merge for clean history.

Verified on the PR branch by compiling the standalone test directly: g++ -std=c++20 -O0 -o shader_fixture_path_test runtime/test/shader_fixture_path_test.cpp && ./shader_fixture_path_test -> 'shader fixture lookup passed', exit 0. The new char* overload correctly decodes CMake's narrow UTF-8 fixture paths via u8string before filesystem lookup, and the added Tokyo/Unicode cases pass along with the existing packaged/local/missing cases. Advisory: branch carries ~60 older commits not on current main; rebase before merge for clean history.
zmasi commented 2026-11-28 11:35:35 +00:00

Verified on Windows 11 (10.0.26200.9974) with MSVC 19.44.35228 (x64, /std:c++20 /EHsc /W4 /permissive- /utf-8 /O2) against main 4a54aedcb + 2355e6088 (claim #2570#issuecomment-7238618828):

  • Line-by-line diff audit: Clean (runtime/test/shader_fixture_path.h, runtime/test/shader_fixture_path_test.cpp); adds a const char* overload converting narrow CMake UTF-8 strings via std::u8string before constructing std::filesystem::path so non-ASCII paths resolve accurately under Windows ACP locales. check_no_game_data.py clean.
  • Red (4a54aedcb + PR test): shader_fixture_path_test.exe fails (rc=1, shader fixture lookup failed on narrow UTF-8 path under Windows ACP).
  • Green (4a54aedcb + 2355e6088 merge): Merges cleanly (rc=0), compiles with 0 /W4 warnings, and shader_fixture_path_test.exe passes (shader fixture lookup passed, rc=0).

AI-assisted.

Verified on Windows 11 (`10.0.26200.9974`) with MSVC `19.44.35228` (`x64`, `/std:c++20 /EHsc /W4 /permissive- /utf-8 /O2`) against `main` `4a54aedcb` + `2355e6088` (claim `#2570#issuecomment-7238618828`): - **Line-by-line diff audit**: Clean (`runtime/test/shader_fixture_path.h`, `runtime/test/shader_fixture_path_test.cpp`); adds a `const char*` overload converting narrow CMake UTF-8 strings via `std::u8string` before constructing `std::filesystem::path` so non-ASCII paths resolve accurately under Windows ACP locales. `check_no_game_data.py` clean. - **Red (`4a54aedcb` + PR test)**: `shader_fixture_path_test.exe` fails (`rc=1`, `shader fixture lookup failed` on narrow UTF-8 path under Windows ACP). - **Green (`4a54aedcb` + `2355e6088` merge)**: Merges cleanly (`rc=0`), compiles with `0` `/W4` warnings, and `shader_fixture_path_test.exe` passes (`shader fixture lookup passed`, `rc=0`). AI-assisted.
MoonEyes commented 2026-11-28 18:12:29 +00:00

Red/green: On main shader_fixture_path_test fails (shader fixture lookup failed on a narrow UTF-8 path), and with the PR ctest -R "^shader_fixture_path$" passes.
Independent tester (OreoFR, RTX 4070, Windows 11): PR head merged with the other PRs of its batch on main c1ecf04ed, full ctest run (485 tests, tests that launch the game excluded): no new failure compared with main.

Red/green: On main shader_fixture_path_test fails (shader fixture lookup failed on a narrow UTF-8 path), and with the PR ctest -R "^shader_fixture_path$" passes. Independent tester (OreoFR, RTX 4070, Windows 11): PR head merged with the other PRs of its batch on main c1ecf04ed, full ctest run (485 tests, tests that launch the game excluded): no new failure compared with main.
OreoFR commented 2026-11-28 21:59:34 +00:00

Verified by OreoFR

  • Base: main c1ecf04ed + PR head 2355e6088; green run in a merge package of 16 PRs, no new ctest failure vs main
  • Test: ctest -R "^shader_fixture_path$"
  • Red on main: 1 failure ("shader fixture lookup failed") with the PR's .cpp test and main's shader_fixture_path.h (the fix is in that test header)
  • Green with the PR: OK
  • Verdict: READY
  • Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11

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

**Verified by OreoFR** - Base: main `c1ecf04ed` + PR head `2355e6088`; green run in a merge package of 16 PRs, no new ctest failure vs main - Test: `ctest -R "^shader_fixture_path$"` - Red on main: 1 failure ("shader fixture lookup failed") with the PR's .cpp test and main's shader_fixture_path.h (the fix is in that test header) - Green with the PR: OK - Verdict: READY - Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11 AI-assisted (Claude Code, Claude Opus 5.5).
Sign in to join this conversation.
No description provided.