feat(compat.spirv-headers): the headers a SPIR-V reader needs - #358
Merged
Conversation
…the index did not carry A program that only SUBMITS SPIR-V to a driver needs nothing from this package: the module is opaque data and `vulkan_core.h` describes the call that takes it. A program that READS one needs the opcode and enum definitions, and llama.cpp's Vulkan backend is such a program -- it inspects the modules its own shader generator produced, through `<spirv/unified1/spirv.hpp>`. The index carried `compat.vulkan-headers` and not this, so that consumer had nowhere in the ecosystem to get it and would have fallen back to the host's `/usr/include`, which is exactly the dependency this ecosystem removes. Split rather than folded into `compat.vulkan-headers`, following Khronos: they are separate repositories on separate cadences, and a renderer that never decodes SPIR-V should not acquire the decoder's headers. The licence is written as a set. The bulk is MIT; upstream's own LICENSE calls out files under CC-BY-4.0 and ships LICENSES/ carrying both texts. The CN mirror is published and verified byte-identical to the upstream archive (sha256 4d703067a7e0...), so the entry takes the table form rather than the plain-string fallback. The test decodes a hand-built module header rather than asserting that the include compiles. A header-only package that resolves and exposes the wrong include root compiles nothing, so "it compiled" would pass on a package that delivered an empty tree; reading spv::MagicNumber, spv::OpCapability and spv::ExecutionModelGLCompute back distinguishes the two.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A new index entry,
compat:spirv-headers@1.4.357.0— the Khronosspirv/unified1tree — plus a workspace test member that decodes a hand-builtSPIR-V module header with it.
Why
A program that only submits SPIR-V to a driver needs nothing from this
package: the module is opaque data and
vulkan_core.hdescribes the call thattakes it. A program that reads one needs the opcode and enum definitions.
llama.cpp's Vulkan backend is such a program —
ggml-vulkan.cppinspects themodules its own shader generator produced, through
<spirv/unified1/spirv.hpp>. The index carriedcompat.vulkan-headersand notthis, so that consumer had nowhere in the ecosystem to get it and would have
resolved it from the host's
/usr/include.Split rather than folded into
compat.vulkan-headers, following Khronos: theyare separate repositories on separate cadences, and a renderer that never
decodes SPIR-V should not acquire the decoder's headers.
Notes
LICENSEcalls out files under CC-BY-4.0 and ships
LICENSES/carrying both texts.archive, so the entry takes the table form rather than the plain-string
fallback.
and exposes the wrong include root compiles nothing, so "it compiled" would
pass on a package that delivered an empty tree.
Measured