Runtime tests: read shader fixtures through shader_fixture_path #3362

Merged
leonida/mandy
MoonEyes merged 2 commits from fix/runtime-test-fixture-readers into main 2026-12-03 17:55:51 +00:00

Pull request successfully merged and closed

MoonEyes commented 2026-12-03 16:26:12 +00:00

Claimed in the coordination issue as: runtime tests reading a compiled-in shader path (claim comment in #3312)

Depends on: #3359 (same helper, vktest::shader_fixture_path; the files are distinct, so there is no conflict)

What and why

Five tests still opened the shader at the path baked in on the CI runner (std::ifstream on a LEONIDA_*_SPV define). Run from the extracted runtime-windows artifact they read an empty file and fail. Their reader helpers (read_spv, read_spirv, load_spirv) and one direct ifstream in d3d12_fspx_compute_test.cpp now go through vktest::shader_fixture_path, which keeps the compiled path if it exists and else falls back to generated/<name>. The const char* overload is kept, because it decodes the UTF-8 CMake gives; a plain implicit conversion would use the ANSI code page on Windows. Three files from the original list (vk_null_descriptor_test, vk_bindless_dimensions_test, the copy half of d3d12_fspx_compute_test) were already covered on main.

Tested

  • python -I scripts/check_no_game_data.py and cmake -S runtime configure on Linux.
  • Read-only review: the overload, the callers of each helper (all pass a CMake macro), the includes and the absence of other raw readers of the same pattern; the review also found the fspx read, now fixed.
  • Not run: compilation (MSVC, Vulkan, GPU) and the tests from an extracted artifact, so no red/green.

GPUs tested: n/a

AI-assisted: yes. Written with Claude Sonnet 5.5; independently reviewed read-only by Claude Opus 5.5.

Checklist

  • Based on current main and merges cleanly.
  • One topic; the throwing copy_file variants are a separate pull request.
  • No game data, keys or decryption.
  • Not a translator rule.

Generated by Claude Code

Claimed in the coordination issue as: runtime tests reading a compiled-in shader path (claim comment in #3312) Depends on: #3359 (same helper, `vktest::shader_fixture_path`; the files are distinct, so there is no conflict) ### What and why Five tests still opened the shader at the path baked in on the CI runner (`std::ifstream` on a `LEONIDA_*_SPV` define). Run from the extracted `runtime-windows` artifact they read an empty file and fail. Their reader helpers (`read_spv`, `read_spirv`, `load_spirv`) and one direct `ifstream` in `d3d12_fspx_compute_test.cpp` now go through `vktest::shader_fixture_path`, which keeps the compiled path if it exists and else falls back to `generated/<name>`. The `const char*` overload is kept, because it decodes the UTF-8 CMake gives; a plain implicit conversion would use the ANSI code page on Windows. Three files from the original list (`vk_null_descriptor_test`, `vk_bindless_dimensions_test`, the copy half of `d3d12_fspx_compute_test`) were already covered on `main`. ### Tested - `python -I scripts/check_no_game_data.py` and `cmake -S runtime` configure on Linux. - Read-only review: the overload, the callers of each helper (all pass a CMake macro), the includes and the absence of other raw readers of the same pattern; the review also found the `fspx` read, now fixed. - Not run: compilation (MSVC, Vulkan, GPU) and the tests from an extracted artifact, so no red/green. GPUs tested: n/a AI-assisted: yes. Written with Claude Sonnet 5.5; independently reviewed read-only by Claude Opus 5.5. ### Checklist - [x] Based on current `main` and merges cleanly. - [x] One topic; the throwing `copy_file` variants are a separate pull request. - [x] No game data, keys or decryption. - [x] Not a translator rule. --- _Generated by [Claude Code](https://claude.ai/code)_
Kal0s-design commented 2026-12-03 17:14:42 +00:00

Ran natively on Windows 11, head 0a7d4573c merged into current main (fba6f09ce, clean merge).

No findings. MSVC build (CMake + Ninja, RelWithDebInfo) of the touched targets, no new warnings in them. None of the fixtures are in the checkout; glslangValidator compiles them into the build's generated/. To mimic the artifact I hid that folder and ran each exe from a directory with a copy of it as generated/.

test normal run, main / merge compiled path gone, generated/ in cwd, main / merge fixture missing, main / merge
d3d12_fspx_compute_test 0 / 0 1 (EXPECT words.size() > 12, the raw ifstream) / 0 1 / 1
d3d12_indirect_rt_test 0 / 0 1 (FAIL: read vs_tri/fs_solid spv) / 0 1 / 1
d3d12_r9g9b9e5_uav_test 0 / 0 1 (bindless round trip, after the UAV clears and copies pass) / 0 1 / 1
vk_title_mirror_test 77 / 77 77 / 77 77 / 77

So the three tests that run here go red to green in the artifact layout. With the fixture really gone they still exit 1, as before. vk_title_mirror_test skips on this card (no host-visible coherent memory type for sparse buffers) before it loads the shader, so its change is only compiled. The main column was measured on 717b90233; nothing under runtime/ changed since.

Not checked: vk_aftermath_test (not a target in this configuration, so the change there isn't compiled here), a real downloaded CI artifact, CTest itself.

GPUs tested: one NVIDIA desktop card (native Vulkan), plus WARP where the tests compare with it.
AI-assisted: yes (Claude Code).

Ran natively on Windows 11, head `0a7d4573c` merged into current `main` (`fba6f09ce`, clean merge). No findings. MSVC build (CMake + Ninja, RelWithDebInfo) of the touched targets, no new warnings in them. None of the fixtures are in the checkout; glslangValidator compiles them into the build's `generated/`. To mimic the artifact I hid that folder and ran each exe from a directory with a copy of it as `generated/`. | test | normal run, `main` / merge | compiled path gone, `generated/` in cwd, `main` / merge | fixture missing, `main` / merge | |---|---|---|---| | `d3d12_fspx_compute_test` | 0 / 0 | 1 (`EXPECT words.size() > 12`, the raw `ifstream`) / 0 | 1 / 1 | | `d3d12_indirect_rt_test` | 0 / 0 | 1 (`FAIL: read vs_tri/fs_solid spv`) / 0 | 1 / 1 | | `d3d12_r9g9b9e5_uav_test` | 0 / 0 | 1 (bindless round trip, after the UAV clears and copies pass) / 0 | 1 / 1 | | `vk_title_mirror_test` | 77 / 77 | 77 / 77 | 77 / 77 | So the three tests that run here go red to green in the artifact layout. With the fixture really gone they still exit 1, as before. `vk_title_mirror_test` skips on this card (no host-visible coherent memory type for sparse buffers) before it loads the shader, so its change is only compiled. The `main` column was measured on `717b90233`; nothing under `runtime/` changed since. Not checked: `vk_aftermath_test` (not a target in this configuration, so the change there isn't compiled here), a real downloaded CI artifact, CTest itself. GPUs tested: one NVIDIA desktop card (native Vulkan), plus WARP where the tests compare with it. AI-assisted: yes (Claude Code).
Sign in to join this conversation.
No description provided.