Impulse Graph C++ Engine 2.4.0
High-Performance Zero-Copy C-ABI Kernel and C++20 Fluent VM Engine
Loading...
Searching...
No Matches
impulse_format_v0_10.h
Go to the documentation of this file.
1// Generated from impulse-graph-spec/spec/v0.10.0.yaml (Spec v0.10.0).
2#ifndef IMPULSE_GRAPH_FORMAT_V0_10_H
3#define IMPULSE_GRAPH_FORMAT_V0_10_H
4
5#include <stdint.h>
6#include <stddef.h>
7
8#ifdef __cplusplus
9extern "C" {
10#endif
11
12#define IMPULSE_SPEC_VERSION_MAJOR_V0_10 0
13#define IMPULSE_SPEC_VERSION_MINOR_V0_10 10
14#define IMPULSE_SPEC_MAGIC_V0_10 0x494D5053
15#define IMPULSE_SPEC_HEADER_BASELINE_OFFSET_V0_10 4096
16
17#ifndef IMPULSE_SPEC_VERSION_PACKED
18#define IMPULSE_SPEC_VERSION_PACKED 10
19#define IMPULSE_SPEC_VERSION_MAJOR 0
20#define IMPULSE_SPEC_VERSION_MINOR 10
21#endif
22
23#ifndef IMPULSE_GLOBAL_FEAT_4KB_PAGE_ALIGNED
24#define IMPULSE_GLOBAL_FEAT_4KB_PAGE_ALIGNED 0x0000000000000001ULL
25#endif
26#ifndef IMPULSE_GLOBAL_FEAT_CRYPTO_SIGNED
27#define IMPULSE_GLOBAL_FEAT_CRYPTO_SIGNED 0x0000000000000002ULL
28#endif
29#ifndef IMPULSE_GLOBAL_FEAT_FOOTER_CATALOG
30#define IMPULSE_GLOBAL_FEAT_FOOTER_CATALOG 0x0000000000000004ULL
31#endif
32
33#ifndef IMPULSE_SECTION_FEAT_RAW_UINT32
34#define IMPULSE_SECTION_FEAT_RAW_UINT32 0x0000000000000001ULL
35#endif
36#ifndef IMPULSE_SECTION_FEAT_DELTA_VBYTE
37#define IMPULSE_SECTION_FEAT_DELTA_VBYTE 0x0000000000000002ULL
38#endif
39#ifndef IMPULSE_SECTION_FEAT_RAW_UINT16
40#define IMPULSE_SECTION_FEAT_RAW_UINT16 0x0000000000000004ULL
41#endif
42#ifndef IMPULSE_SECTION_FEAT_SIMDCOMP
43#define IMPULSE_SECTION_FEAT_SIMDCOMP 0x0000000000000010ULL
44#endif
45
46// Relation Directory SectionFeatures Bitmask (Spec v0.10.0 ยง2.4)
47#ifndef IMP_REL_FEATURE_INCLUDE_CSC
48#define IMP_REL_FEATURE_INCLUDE_CSC 0x0000000000000001ULL
49#define IMP_REL_FEATURE_WEIGHTED 0x0000000000000002ULL
50#define IMP_REL_FEATURE_VIRTUAL 0x0000000000000004ULL
51#define IMP_REL_CARDINALITY_MASK 0x0000000000000018ULL
52#define IMP_REL_CARDINALITY_M_N 0x0000000000000000ULL
53#define IMP_REL_CARDINALITY_M_1 0x0000000000000008ULL
54#define IMP_REL_CARDINALITY_1_M 0x0000000000000010ULL
55#define IMP_REL_CARDINALITY_1_1 0x0000000000000018ULL
56#endif
57
58// C-ABI Status and Error Return Codes (v0.10.0)
71
72// Domain Catalog Key Type Enums (v0.10.0)
87
88// Primary Topology CSR Encoding Enums (v0.10.0)
100
101#pragma pack(push, 1)
102
103// Section 1 Fixed 4KB Baseline Snapshot Header (Spec v0.10.0)
105 uint32_t magic; // Magic constant (0x494D5053 = 'IMPS')
106 uint16_t version; // Protocol version number (0x000A)
107 uint32_t data_offset; // Byte offset where Section 2 payload begins (4096)
108 uint16_t domain_count; // Total number of domains in catalog
109 uint16_t relation_count; // Total number of relations in matrix
110 uint64_t timestamp_ms; // Unix epoch timestamp (milliseconds)
111 uint64_t required_features; // Global feature flags bitmask
112 uint64_t footer_directory_offset; // Absolute file offset to Footer Directory Table
113 uint64_t footer_directory_bytes; // Byte size of Footer Directory Table
114 uint8_t snapshot_uuid[16]; // 128-bit Binary UUID
115 uint16_t header_checksum; // CRC-16-CCITT checksum over bytes 0x00..0x3D
116 uint16_t index_count; // Total number of secondary indices
117 uint8_t header_padding[4030]; // Reserved header expansion padding
119
120// Section 2.2 Domain Catalog Entry (32 Bytes, Spec v0.10.0)
122 uint16_t domain_id; // Zero-indexed domain identifier
123 uint8_t key_type; // Domain key primitive type enum
124 uint8_t reserved1; // Alignment padding (0x00)
125 uint32_t name_offset; // Offset into Shared String Table
126 uint64_t node_count; // Total node count in domain
127 uint16_t attr_count; // Number of domain attribute descriptors following this entry
128 uint16_t key_attr_index; // 0-indexed domain attribute index holding primary key column (0xFFFF if none)
129 uint8_t reserved2[12]; // Reserved expansion padding (0x00)
131
132// Section 2.3 Relation Directory Entry (128 Bytes, Spec v0.10.0)
134 uint16_t relation_id; // Zero-indexed relation identifier
135 uint16_t src_domain_id; // Source domain ID
136 uint16_t tgt_domain_id; // Target domain ID
137 uint8_t encoding_id; // Topology encoding type enum
138 uint8_t node_id_width; // Node index width (bytes: 2, 4, or 8)
139 uint8_t edge_index_width; // Edge index width (bytes: 4 or 8)
140 uint8_t reserved1[3]; // Reserved alignment
141 uint32_t name_offset; // Offset into Shared String Table
142 uint64_t node_count; // Source node count
143 uint64_t edge_count; // Edge count
144 uint64_t section_features; // Section feature bitmask
145 uint64_t csr_row_off_offset; // CSR row offsets file offset
146 uint64_t csr_row_off_bytes; // CSR row offsets byte size
147 uint64_t csr_col_idx_offset; // CSR col indices file offset
148 uint64_t csr_col_idx_bytes; // CSR col indices byte size
149 uint64_t csc_row_off_offset; // CSC row offsets file offset
150 uint64_t csc_row_off_bytes; // CSC row offsets byte size
151 uint64_t csc_col_idx_offset; // CSC col indices file offset
152 uint64_t csc_col_idx_bytes; // CSC col indices byte size
153 uint16_t attr_count; // Number of edge attribute descriptors following this entry
154 uint8_t reserved2[22]; // Directory entry expansion padding
156
157// Section 2.4 Node Domain & Edge Relation Attribute Descriptor Entry (44 Bytes, Spec v0.10.0)
159 uint32_t name_offset; // Offset into Shared String Table
160 uint8_t type_code; // Attribute primitive type enum (bits 0..6) + 0x80 nullable flag (bit 7)
161 uint8_t reserved1; // Alignment padding
162 uint16_t reserved2; // Alignment padding
163 uint32_t dimension; // Vector dimension (1 for scalar, 0 for variable-length)
164 uint64_t data_offset; // Absolute 128B-aligned file offset to attribute payload
165 uint64_t data_bytes; // Byte size of attribute payload
166 uint64_t offsets_offset; // Absolute 128B-aligned file offset to var-string offsets array
167 uint64_t offsets_bytes; // Byte size of var-string offsets array
169
170// Section 2.6 Secondary Index Directory Entry (Fixed 64 Bytes POD, Spec v0.10.0)
172 uint32_t index_id; // Zero-indexed secondary index identifier
173 uint16_t domain_id; // Target Node Domain ID
174 uint16_t relation_id; // Target Relation ID (0xFFFF for Node Domain attributes)
175 uint16_t attribute_index; // 0-indexed Attribute index within relation or domain
176 uint8_t index_type; // Generic Index Type enum (0x01..0x08)
177 uint8_t reserved1; // Alignment padding
178 uint32_t name_offset; // Offset into Shared String Table
179 uint64_t data_offset; // Absolute 128B-aligned file offset to index data
180 uint64_t data_bytes; // Total byte size of index data payload
181 uint64_t payload_feature_mask; // Generic Index Feature Bitmask
182 uint8_t reserved_padding[24]; // Reserved expansion padding
184
185// 16-Byte Footer Trailer at EOF (Spec v0.10.0)
187 uint64_t footer_length; // Byte size of Footer Block
188 uint32_t spec_version; // Spec version (0x000A)
189 uint32_t footer_magic; // Footer magic (0x494D5053 = 'IMPS')
191
192#pragma pack(pop)
193
194#ifdef __cplusplus
195static_assert(sizeof(impulse_snapshot_header_v0_10_t) == 4096, "v0.10.0 SnapshotHeader must be 4096 bytes");
196static_assert(sizeof(impulse_domain_catalog_entry_v0_10_t) == 32, "v0.10.0 DomainCatalogEntry must be 32 bytes");
197static_assert(sizeof(impulse_relation_directory_entry_v0_10_t) == 128, "v0.10.0 RelationDirectoryEntry must be 128 bytes");
198static_assert(sizeof(impulse_attribute_descriptor_v0_10_t) == 44, "v0.10.0 AttributeDescriptor must be 44 bytes");
199static_assert(sizeof(impulse_index_directory_entry_v0_10_t) == 64, "v0.10.0 IndexDirectoryEntry must be 64 bytes");
200static_assert(sizeof(impulse_footer_trailer_v0_10_t) == 16, "v0.10.0 FooterTrailer must be 16 bytes");
201#endif
202
203#ifdef __cplusplus
204}
205#endif
206
207#endif // IMPULSE_GRAPH_FORMAT_V0_10_H
impulse_key_type_t_v0_10
Definition impulse_format_v0_10.h:73
@ IMPULSE_KEY_TYPE_FLOAT32_V0_10
Definition impulse_format_v0_10.h:82
@ IMPULSE_KEY_TYPE_UINT32_V0_10
Definition impulse_format_v0_10.h:80
@ IMPULSE_KEY_TYPE_UINT64_V0_10
Definition impulse_format_v0_10.h:81
@ IMPULSE_KEY_TYPE_VAR_STRING_V0_10
Definition impulse_format_v0_10.h:84
@ IMPULSE_KEY_TYPE_INT32_V0_10
Definition impulse_format_v0_10.h:76
@ IMPULSE_KEY_TYPE_INT8_V0_10
Definition impulse_format_v0_10.h:74
@ IMPULSE_KEY_TYPE_FLOAT64_V0_10
Definition impulse_format_v0_10.h:83
@ IMPULSE_KEY_TYPE_UINT8_V0_10
Definition impulse_format_v0_10.h:78
@ IMPULSE_KEY_TYPE_UINT16_V0_10
Definition impulse_format_v0_10.h:79
@ IMPULSE_KEY_TYPE_UUID128_V0_10
Definition impulse_format_v0_10.h:85
@ IMPULSE_KEY_TYPE_INT64_V0_10
Definition impulse_format_v0_10.h:77
@ IMPULSE_KEY_TYPE_INT16_V0_10
Definition impulse_format_v0_10.h:75
enum impulse_status_t_v0_10 impulse_status_t_v0_10_t
enum impulse_encoding_type_t_v0_10 impulse_encoding_type_t_v0_10_t
impulse_status_t_v0_10
Definition impulse_format_v0_10.h:59
@ IMPULSE_ERR_UNSUPPORTED_SECTION_FEATURE_V0_10
Definition impulse_format_v0_10.h:64
@ IMPULSE_ERR_CORRUPT_CHECKSUM_V0_10
Definition impulse_format_v0_10.h:65
@ IMPULSE_ERR_UNSUPPORTED_VERSION_V0_10
Definition impulse_format_v0_10.h:62
@ IMPULSE_ERR_INVALID_MAGIC_V0_10
Definition impulse_format_v0_10.h:61
@ IMPULSE_ERR_BUFFER_OVERFLOW_V0_10
Definition impulse_format_v0_10.h:69
@ IMPULSE_ERR_SIGNATURE_MISMATCH_V0_10
Definition impulse_format_v0_10.h:68
@ IMPULSE_OK_V0_10
Definition impulse_format_v0_10.h:60
@ IMPULSE_ERR_IO_FAILURE_V0_10
Definition impulse_format_v0_10.h:66
@ IMPULSE_ERR_UNSUPPORTED_GLOBAL_FEATURE_V0_10
Definition impulse_format_v0_10.h:63
@ IMPULSE_ERR_INVALID_ARGUMENT_V0_10
Definition impulse_format_v0_10.h:67
enum impulse_key_type_t_v0_10 impulse_key_type_t_v0_10_t
impulse_encoding_type_t_v0_10
Definition impulse_format_v0_10.h:89
@ IMPULSE_ENC_TPU_BCOO_V0_10
Definition impulse_format_v0_10.h:96
@ IMPULSE_ENC_RAW_UINT16_V0_10
Definition impulse_format_v0_10.h:92
@ IMPULSE_ENC_SLICED_ELLPACK_V0_10
Definition impulse_format_v0_10.h:95
@ IMPULSE_ENC_DELTA_VBYTE_V0_10
Definition impulse_format_v0_10.h:91
@ IMPULSE_ENC_RAW_UINT32_V0_10
Definition impulse_format_v0_10.h:90
@ IMPULSE_ENC_SIMDCOMP_V0_10
Definition impulse_format_v0_10.h:94
@ IMPULSE_ENC_HYBRID_16_32_V0_10
Definition impulse_format_v0_10.h:93
@ IMPULSE_ENC_ROARING_BITMAP_V0_10
Definition impulse_format_v0_10.h:98
@ IMPULSE_ENC_RAW_UINT64_V0_10
Definition impulse_format_v0_10.h:97
Definition impulse_format_v0_10.h:158
uint32_t name_offset
Definition impulse_format_v0_10.h:159
uint64_t data_offset
Definition impulse_format_v0_10.h:164
uint8_t reserved1
Definition impulse_format_v0_10.h:161
uint16_t reserved2
Definition impulse_format_v0_10.h:162
uint64_t offsets_bytes
Definition impulse_format_v0_10.h:167
uint8_t type_code
Definition impulse_format_v0_10.h:160
uint64_t data_bytes
Definition impulse_format_v0_10.h:165
uint64_t offsets_offset
Definition impulse_format_v0_10.h:166
uint32_t dimension
Definition impulse_format_v0_10.h:163
Definition impulse_format_v0_10.h:121
uint8_t reserved2[12]
Definition impulse_format_v0_10.h:129
uint16_t domain_id
Definition impulse_format_v0_10.h:122
uint64_t node_count
Definition impulse_format_v0_10.h:126
uint8_t reserved1
Definition impulse_format_v0_10.h:124
uint32_t name_offset
Definition impulse_format_v0_10.h:125
uint8_t key_type
Definition impulse_format_v0_10.h:123
uint16_t attr_count
Definition impulse_format_v0_10.h:127
uint16_t key_attr_index
Definition impulse_format_v0_10.h:128
Definition impulse_format_v0_10.h:171
uint16_t attribute_index
Definition impulse_format_v0_10.h:175
uint64_t data_bytes
Definition impulse_format_v0_10.h:180
uint8_t reserved_padding[24]
Definition impulse_format_v0_10.h:182
uint8_t reserved1
Definition impulse_format_v0_10.h:177
uint16_t relation_id
Definition impulse_format_v0_10.h:174
uint64_t data_offset
Definition impulse_format_v0_10.h:179
uint32_t name_offset
Definition impulse_format_v0_10.h:178
uint8_t index_type
Definition impulse_format_v0_10.h:176
uint16_t domain_id
Definition impulse_format_v0_10.h:173
uint32_t index_id
Definition impulse_format_v0_10.h:172
uint64_t payload_feature_mask
Definition impulse_format_v0_10.h:181
Definition impulse_format_v0_10.h:133
uint8_t reserved1[3]
Definition impulse_format_v0_10.h:140
uint16_t relation_id
Definition impulse_format_v0_10.h:134
uint64_t csc_col_idx_offset
Definition impulse_format_v0_10.h:151
uint64_t csr_row_off_bytes
Definition impulse_format_v0_10.h:146
uint16_t attr_count
Definition impulse_format_v0_10.h:153
uint16_t tgt_domain_id
Definition impulse_format_v0_10.h:136
uint64_t section_features
Definition impulse_format_v0_10.h:144
uint64_t csc_col_idx_bytes
Definition impulse_format_v0_10.h:152
uint8_t reserved2[22]
Definition impulse_format_v0_10.h:154
uint64_t csr_col_idx_offset
Definition impulse_format_v0_10.h:147
uint8_t edge_index_width
Definition impulse_format_v0_10.h:139
uint8_t encoding_id
Definition impulse_format_v0_10.h:137
uint8_t node_id_width
Definition impulse_format_v0_10.h:138
uint64_t csc_row_off_offset
Definition impulse_format_v0_10.h:149
uint64_t csr_row_off_offset
Definition impulse_format_v0_10.h:145
uint64_t csr_col_idx_bytes
Definition impulse_format_v0_10.h:148
uint64_t node_count
Definition impulse_format_v0_10.h:142
uint16_t src_domain_id
Definition impulse_format_v0_10.h:135
uint64_t edge_count
Definition impulse_format_v0_10.h:143
uint64_t csc_row_off_bytes
Definition impulse_format_v0_10.h:150
uint32_t name_offset
Definition impulse_format_v0_10.h:141
Definition impulse_format_v0_10.h:104
uint32_t magic
Definition impulse_format_v0_10.h:105
uint64_t footer_directory_bytes
Definition impulse_format_v0_10.h:113
uint16_t version
Definition impulse_format_v0_10.h:106
uint16_t index_count
Definition impulse_format_v0_10.h:116
uint64_t timestamp_ms
Definition impulse_format_v0_10.h:110
uint64_t footer_directory_offset
Definition impulse_format_v0_10.h:112
uint16_t relation_count
Definition impulse_format_v0_10.h:109
uint32_t data_offset
Definition impulse_format_v0_10.h:107
uint16_t header_checksum
Definition impulse_format_v0_10.h:115
uint64_t required_features
Definition impulse_format_v0_10.h:111
uint8_t header_padding[4030]
Definition impulse_format_v0_10.h:117
uint8_t snapshot_uuid[16]
Definition impulse_format_v0_10.h:114
uint16_t domain_count
Definition impulse_format_v0_10.h:108