Skip to content

Warn when optional shader indexes cannot be loaded - #8270

Closed
Samu3k wants to merge 1 commit into
ProjectLeonida:mainfrom
Samu3k:fix/report-unreadable-shader-index
Closed

Samu3k wants to merge 1 commit into
ProjectLeonida:mainfrom
Samu3k:fix/report-unreadable-shader-index

Conversation

@Samu3k

@Samu3k Samu3k commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: comment in #8186

Depends on: #7527, #7746 (overlapping edits to the optional index loader; this change can land independently)

What and why

While loading shaders, the Vulkan D3D12 runtime could silently skip an unreadable or malformed optional bvh/index.json or fspx/index.json. The log now identifies the skipped index and why it could not be loaded. An absent optional index remains quiet. The main index and any other usable optional index still load.

Tested

  • Passed shader_library on Windows with MSVC 19.51 and Windows SDK 10.0.26100 (RelWithDebInfo). The regression test failed as expected when the warning was suppressed and passed with the fix. The synthetic cases cover malformed BVH and FidelityFX indexes, preservation of valid indexes, and an absent optional index.
  • Built the Vulkan D3D12 runtime target gta6rt_d3d12_com. Passed d3d12_present and xbox_present on an NVIDIA GeForce RTX 4070 SUPER with driver 591.59.
  • git diff --check and scripts/check_no_game_data.py passed for the changed files.

AI-assisted: yes (Codex).

Checklist

  • No game data, keys or decryption, including in logs or reports quoted here.
  • Translator contract table: N/A (runtime diagnostics only).

Keep the main and other valid shader indexes available when an optional BVH or FidelityFX index fails to load. Log the affected index and the loader error.

AI-assisted with Codex.

@devnull34 devnull34 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified via Tier 2 Free Cloud (Groq gpt-oss-120b): Populating structured warnings when auxiliary indexes (fspx/index.json or bvh/index.json) are corrupted allows the runtime to provide actionable diagnostics to stderr without failing main shader library initialization.

@lohant27-netizen

Copy link
Copy Markdown

Tested 29c420a02 on Windows 11 (10.0.26300), NVIDIA GeForce RTX 5070 (driver 32.0.16.2101, subgroup 32), MSVC with SDK 10.0.26100, Release, merged onto main 23060e087 together with #8314, #8252, #8326 and #8270 (no conflicts): pass.

@MartinIndra02

Copy link
Copy Markdown
Contributor

Independent build + test: PASS

AI-assisted (Claude Code). Windows 11 x64, MSVC 19.44.35220, Ninja RelWithDebInfo. GPU (not used by this test): NVIDIA GeForce RTX 3080 driver 621.24 / 32.0.16.2124.

Head 29c420a02, merged locally with current main dfe4e4ad3. d3d12_vulkan_device.cpp auto-merged without conflicts.

Target / test Result
shader_library_test, gta6rt_d3d12_com build, no new warnings in the changed files
shader_library_test.exe exit 0, SHA-256, inflate (stored/fixed/dynamic), JSON, FSSM extraction, FSPX programs and index lookup OK (includes the new warning checks for broken bvh/ and fspx/ indexes and no warning for a missing one)

load_index calls its fail callback in only two places (cannot open ..., index.json is not a JSON object), so skipped entries don't produce warnings. A broken optional index still leaves the rest loaded, as before. No issues found.

FYI: #8254 and #8256 also change runtime/src/shader_library.h, so whichever merges later should be rebuilt.

@ne1i

ne1i commented Nov 23, 2026

Copy link
Copy Markdown

Tested 29c420a0 on Linux, GCC, CPU only (no GPU, no Windows API), merged onto main 867d922f: pass

  • Built only the shader_library test target(s) from the merged tree and ran them through CTest: 100% tests passed out of 1.
  • With the PR's runtime/src files reverted to main and rebuilt: build failed, because the new test does not compile without the change.
    • runtime/test/shader_library_test.cpp:525:23: error: no matching function for call to ‘leonida::ShaderLibrary::load(std::string, std::string*, std::vector<std::__cxx11::ba
    • runtime/test/shader_library_test.cpp:530:23: error: no matching function for call to ‘leonida::ShaderLibrary::load(std::string, std::string*, std::vector<std::__cxx11::ba

So the new test depends on the change.

The proof here is compile-level: the new test calls an overload that does not exist without the change. The PR's runtime/shims/d3d12_vulkan_device.cpp part is Windows-only and was not built here. The agent also built the test under ASan/UBSan and reports it clean; I did not repeat the sanitizer build.

Independent check (not the author). Run by an AI agent (DeepSeek V4.1 Flash) and re-run by the orchestrating session (Claude Code) before posting.

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.

6 participants