Repository navigation
runtime: add a read-only shader-pack compatibility check - #2417
marcelofrayha wants to merge 1 commit into
Conversation
|
Verified the CLI on native Windows 11, RTX 4090, NVIDIA 616.64 at All nine CLI cases returned the expected code. The native pixel/mesh pair returned 0. The fallback pair returned 1 and reported both blockers even with an unreadable optional index. An incomplete pack, a missing main index, and an unmatched adapter filter returned 2. A non-ASCII directory worked through the positional argument, I also checked the read-only behavior. With |
tiguan26
left a comment
There was a problem hiding this comment.
Approving. Checked on 7f3892a, which merges cleanly onto main.
Built shader_pack_check_test and gta6rt (clang-cl, cross-built). Under Wine on llvmpipe the ctest passes. I ran gta6rt --check-shader-pack on hand-made indexes (no game data): one ms entry, one ps entry that needs native barycentrics, one ps with bary_fallback_input and a vs. It reports llvmpipe as native mesh yes, barycentrics no, counts 1 + 1 blockers, exits 1. A pack with only a vs exits 0 ("no known mesh/barycentric mismatch"), a missing directory exits 2 ("cannot open ...index.json"), and two arguments print the usage. tests/test_vk_subgroup_info.py and tests/test_make_game_translator_flags.py: 89 passed.
Read the diff. The probe stops before the logical device, and OwnedRuntime has no destructor, so the explicit destroy_instance on the probe path is the only one (no double destroy). read_shader_index moving out of load_index keeps the BOM and object checks. The rules table is now one source for C++ and Python, and the gfx90c and ANV entries are the same IDs that were removed from vk_subgroup_info.py. I checked that nothing copies that script out of the tree, so reading runtime/src/shader_driver_rules.inc by relative path is safe. And main's runtime indeed reads neither mesh_compute nor bary_fallback_input, so "cannot replay" and "not implemented" are accurate today.
Two small things, not blockers. With a missing or unreadable directory it still probes the GPU before reporting the index error, and the device line prints after the error; reading the main index first would fail fast. And usage() returns 2, the same code as "incomplete check", so a script calling it with bad arguments can't tell the two apart.
|
Verified On a local 29,279-module pack, the index-only check counted 9,282 mesh-as-compute modules, 527 fallback pixel modules and 0 unknown, matching an independent index count. All five index digests and the pack’s file metadata were unchanged. The checker process opened the indexes read-only; its driver activity matched enumeration, not the device-creation control, and it wrote no pipeline-cache blobs. That is a check of this PR head, not a claim that pipelines were compiled or drawn. AI-assisted. |
|
Independent check on Windows (not the author), at
Environment: Ryzen 9 7950X3D, Windows 11 Pro 10.0.26200.9711, Python 3.12.10, Vulkan SDK 1.4.363.0. AI-assisted: yes (opencode). |
|
Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime ( |
Claimed in the coordination issue as: RT-SHADER-PACK-CHECK
Depends on: none. There are textual conflicts with #1885 and #2192 in the builder/probe code; this change shares the existing driver rules without changing translation flag selection. It does not depend on the runtime fallback or pipeline-check PRs.
What and why
Add
gta6rt --check-shader-pack [DIR]to catch mesh and barycentric mismatches before precompiling pipelines. It uses the same physical Vulkan adapter selection as--runwith the Vulkan backend and reads only shader indexes. It does not open game files, create a logical Vulkan device, compile pipelines, or write caches.The report distinguishes missing native GPU features, known driver issues (using the same rules as
make_game.py), and translated fallbacks the runtime does not yet support. Unrecognized stages and unreadable optional indexes are reported without hiding blockers found in readable indexes. Exit codes:0no mismatch found,1blockers,2incomplete without known blockers.Tested
shader_libraryandshader_pack_check, including synthetic driver IDs, unknown stages, and malformed optional indexes.test_vk_subgroup_info.pyandtest_make_game_translator_flags.py(89 tests),test_text_write_line_endings.py, andmake_game.py --help.GPUs tested: AMD Radeon RX 5700 XT (RADV) and Lavapipe/llvmpipe (LLVM 21.1.8), both Mesa 26.0.8-1ubuntu0.3 on Linux under Wine 10.0. The affected Intel/AMD driver cases were tested with synthetic adapter data, not on affected hardware.
AI-assisted: yes.
Checklist
mainand merges cleanly.