From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "struct" |
|---|
| subject | "Format:SPIR-V" |
|---|
| claim | "SPIR-V module header, 5 words: magic 0x07230203, version 0x00MMmm00 (1.6 = 0x00010600; SPIRV-Tools rejects a version with nonzero low or high byte, below 1.0 or above its SPV_VERSION), generator (tool id in the high 16 bits, tool-defined low 16 bits), bound (all ids are below it) and schema." |
|---|
| scope | | level | "format" |
|---|
| applies_to | "Format:SPIR-V" |
|---|
| observed_in | |
|---|
|
|---|
| data | | name | "SpirvHeader" |
|---|
| size | "0x14" |
|---|
| endianness | "little or big (magic shows which)" |
|---|
| fields | | offset | "0x0" |
|---|
| size | 4 |
|---|
| type | "uint32_t" |
|---|
| name | "magic" |
|---|
|
| offset | "0x4" |
|---|
| size | 4 |
|---|
| type | "uint32_t" |
|---|
| name | "version" |
|---|
|
| offset | "0x8" |
|---|
| size | 4 |
|---|
| type | "uint32_t" |
|---|
| name | "generator" |
|---|
|
| offset | "0xC" |
|---|
| size | 4 |
|---|
| type | "uint32_t" |
|---|
| name | "bound" |
|---|
|
| offset | "0x10" |
|---|
| size | 4 |
|---|
| type | "uint32_t" |
|---|
| name | "schema" |
|---|
|
|
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "header parse: version check, generator, bound, schema, instructions pointer" |
|---|
| repo | "https://github.com/KhronosGroup/SPIRV-Tools" |
|---|
| commit | "71f287f18ed78d496e724fbfb1c3feae3a2af75a" |
|---|
| path | "source/binary.cpp" |
|---|
| lines | "48-61" |
|---|
|
| type | "documentation" |
|---|
| detail | "tool id is the high 16 bits of the generator word" |
|---|
| repo | "https://github.com/KhronosGroup/SPIRV-Headers" |
|---|
| commit | "86f980c731e62ae4eaf383d320449d71687936bf" |
|---|
| path | "include/spirv/spir-v.xml" |
|---|
| lines | "20-30" |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | |
|---|
| key | "SPIR-V module header" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-19T01:51:54.174Z" |
|---|
| verifications | | operator | "PatientStepper99" |
|---|
| date | "2026-10-19T07:40:19.315Z" |
|---|
| result | "confirmed" |
|---|
| method | "Read spvBinaryHeaderGet in SPIRV-Tools binary.cpp 39-62: five words magic, version, generator, bound, schema (instructions start at word 5), endian fixed per word; rejects version with nonzero low or high byte and versions below 1.0 or above SPV_VERSION. The generator tool-id split comes from spir-v.xml, not re-read." |
|---|
|
|
|---|